OpenCores
URL https://opencores.org/ocsvn/c0or1k/c0or1k/trunk

Subversion Repositories c0or1k

[/] [c0or1k/] [trunk/] [docs/] [man/] [man7/] [l4_map.7] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 drasko
.TH L4_MAP 7 2009-11-18 "Codezero" "Codezero Programmer's Manual"
2
.SH NAME
3
.nf
4
.BR "l4_map" " - Set up a range of virtual to physical address mappings. "
5
 
6
.SH SYNOPSIS
7
.nf
8
.B #include 
9
.B #include 
10
 
11
.BI "int l4_map(void " "*p" ", void " "*v" ", u32 " "npages" ", u32 " "flags" ", l4id_t " "tid" ")"
12
.SH DESCRIPTION
13
.BR "l4_map() " " sets up a virtual to physical mapping for the thread identified by "
14
.IR "tid" ", from virtual address " "v" " to physical address " "p" ", spanning for the number of pages defined in " "npages" ", and using the map flags provided in " "flags" "."
15
 
16
A thread who calls this function must possess capabilities associated with the physical and virtual memory ranges to be mapped. In particular, the range and access permissions for one or more physical and one or more virtual memory capabilities must match the request.
17
 
18
Due to the hierarchical nature of page table organization on some cpu architectures, an
19
.BR "l4_map() " "request may result in a middle-level page-table expenditure. The caller is also expected to have enough capability resources, namely " "mappool " "capabilities, to cover these cases. All formerly mentioned capability parameters may be configured at kernel configuration time. For more information see
20
.BR "capability" "(7)."
21
 
22
.IR "flags " " field determines different mapping permissions and caching behaviour as defined below:"
23
.TP
24
.B MAP_USR_RW_FLAGS
25
Map with read/write permissions for userspace as cacheable/bufferable
26
 
27
.TP
28
.B MAP_USR_RO_FLAGS
29
Map with read-only permissions for userspace as cacheable/bufferable
30
 
31
.TP
32
.B MAP_SVC_RW_FLAGS
33
Map with read/write permissions for supervisor mode-only as cacheable/bufferable.
34
 
35
.TP
36
.B MAP_USR_IO_FLAGS
37
Map with read/write permissions for userspace as non-cacheable/non-bufferable.
38
 
39
.TP
40
.B MAP_USR_DEFAULT_FLAGS
41
An alias for MAP_USR_RW_FLAGS (See above). This is the default for userspace
42
 
43
.TP
44
.B MAP_IO_DEFAULT_FLAGS
45
An alias for MAP_USR_IO_FLAGS (See above). This is the default for userspace device mappings
46
 
47
.SH L4 USERSPACE LIBRARY
48
 
49
.nf
50
 
51
/*
52
 * Helper that maps given physical address to a virtual address
53
 * in the current task spanning npages in size.
54
 * Returns mapped virtual address on success, negative value on error.
55
 */
56
.BI "static inline void *l4_map_helper(void " "*phys" ", int " "npages" ");"
57
 
58
.SH RETURN VALUE
59
.BR "l4_map"()
60
returns 0 on success, and negative value on failure. See below for error codes.
61
 
62
.SH ERRORS
63
 
64
.B -ESRCH
65
The thread to make the mapping could not be found on the system.
66
 
67
.B -ENOCAP
68
Capabilities required don't exist or do not have sufficient privileges.
69
 
70
.SH SEE ALSO
71
.BR "capability"(7)
72
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.