L4Re Operating System Framework
Interface and Usage Documentation
|
Sigma0 API bindings. More...
Modules | |
Internal constants | |
Internal sigma0 definitions. | |
Files | |
file | sigma0.h |
Sigma0 interface. | |
Enumerations | |
enum | l4sigma0_return_flags_t { L4SIGMA0_OK , L4SIGMA0_NOTALIGNED , L4SIGMA0_IPCERROR , L4SIGMA0_NOFPAGE , L4SIGMA0_4 , L4SIGMA0_5 , L4SIGMA0_SMALLERFPAGE } |
Return flags of libsigma0 functions. More... | |
Functions | |
l4_kernel_info_t * | l4sigma0_map_kip (l4_cap_idx_t sigma0, void *addr, unsigned log2_size) |
Map the kernel info page from sigma0 to addr. | |
int | l4sigma0_map_mem (l4_cap_idx_t sigma0, l4_addr_t phys, l4_addr_t virt, l4_addr_t size) |
Request a memory mapping from sigma0. | |
int | l4sigma0_map_iomem (l4_cap_idx_t sigma0, l4_addr_t phys, l4_addr_t virt, l4_addr_t size, int cached) |
Request IO memory from sigma0. | |
int | l4sigma0_map_anypage (l4_cap_idx_t sigma0, l4_addr_t map_area, unsigned log2_map_size, l4_addr_t *base, unsigned sz) |
Request an arbitrary free page of RAM. | |
void | l4sigma0_debug_dump (l4_cap_idx_t sigma0) |
Request sigma0 to dump internal debug information. | |
char const * | l4sigma0_map_errstr (int err) |
Get user readable error messages for the return codes. | |
Sigma0 API bindings.
Convenience bindings for the Sigma0 protocol.
void l4sigma0_debug_dump | ( | l4_cap_idx_t | sigma0 | ) |
Request sigma0 to dump internal debug information.
sigma0 | Capability selector for the sigma0 gate. |
The debug information, such as internal memory maps, as well as statistics about the internal allocators is dumped to the kernel debugger.
int l4sigma0_map_anypage | ( | l4_cap_idx_t | sigma0, |
l4_addr_t | map_area, | ||
unsigned | log2_map_size, | ||
l4_addr_t * | base, | ||
unsigned | sz | ||
) |
Request an arbitrary free page of RAM.
sigma0 | Capability selector for the sigma0 gate. | |
map_area | The base address of the local virtual memory area where the page should be mapped. | |
log2_map_size | The size of the requested page log 2 (the size in bytes is 2^log2_map_size). This must be at least the minimal page size. By specifing larger sizes the largest possible hardware page size will be used. | |
[out] | base | Physical address of the page received (i.e. the send base of the received mapping if any). |
sz | Size to map by the server in 2^sz bytes. |
0 | Success. |
-L4SIGMA0_IPCERROR | IPC error. |
-L4SIGMA0_NOFPAGE | No fpage received. |
This function requests arbitrary free memory from sigma0. It should be used whenever spare memory is needed, instead of requesting specific physical memory with l4sigma0_map_mem().
See l4sigma0_map_errstr() to get a description of the return value.
|
inline |
int l4sigma0_map_iomem | ( | l4_cap_idx_t | sigma0, |
l4_addr_t | phys, | ||
l4_addr_t | virt, | ||
l4_addr_t | size, | ||
int | cached | ||
) |
Request IO memory from sigma0.
sigma0 | Capability selector for the sigma0 gate. |
phys | The physical address to be requested (page aligned). |
virt | The virtual address where the memory should be mapped to (page aligned). |
size | The size of the IO memory area to be mapped (multiple of page size) |
cached | Requests cacheable IO memory if 1 and uncached if 0. |
0 | Success. |
-L4SIGMA0_NOTALIGNED | phys , virt , or size are not aligned. |
-L4SIGMA0_IPCERROR | IPC error. |
-L4SIGMA0_NOFPAGE | No fpage received. |
This function is similar to l4sigma0_map_mem(), the difference is that it requests IO memory. IO memory is everything that is not known to be normal RAM. Also ACPI tables or the BIOS memory is treated as IO memory.
See l4sigma0_map_errstr() to get a description of the return value.
l4_kernel_info_t * l4sigma0_map_kip | ( | l4_cap_idx_t | sigma0, |
void * | addr, | ||
unsigned | log2_size | ||
) |
Map the kernel info page from sigma0 to addr.
sigma0 | Capability selector for the sigma0 gate. |
addr | Start of the receive window to receive KIP in. |
log2_size | Size of the receive window to receive KIP in. |
int l4sigma0_map_mem | ( | l4_cap_idx_t | sigma0, |
l4_addr_t | phys, | ||
l4_addr_t | virt, | ||
l4_addr_t | size | ||
) |
Request a memory mapping from sigma0.
sigma0 | Capability selector for the sigma0 gate. |
phys | The physical address of the requested page (must be at least aligned to the minimum page size). |
virt | The virtual address where the paged should be mapped in the local address space (must be at least aligned to the minimum page size). |
size | The size of the requested page, this must be a multiple of the minimum page size. |
0 | Success. |
-L4SIGMA0_NOTALIGNED | phys , virt , or size are not aligned. |
-L4SIGMA0_IPCERROR | IPC error. |
-L4SIGMA0_NOFPAGE | No fpage received. |
This function only maps normal RAM. To map other memory, use l4sigma0_map_iomem(). See also there for the distinction between both memory types.
This is the direct method to request memory from sigma0. There is also the indirect method where sigma0 will answer page faults with a mapping that is one-to-one between the faulting virtual page and the backing physical page. See L4::Pager::page_fault(). For an overview of the memory hierarchy, see Memory management - Data Spaces and the Region Map.
See l4sigma0_map_errstr() to get a description of the return value.