L4Re - L4 Runtime Environment
Sigma0 API

Sigma0 API bindings. More...

+ Collaboration diagram for Sigma0 API:

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_SMALLERFPAGE
}
 Return flags of libsigma0 functions. More...
 

Functions

l4_kernel_info_tl4sigma0_map_kip (l4_cap_idx_t sigma0, void *addr, unsigned log2_size)
 Map the kernel info page from pager to addr. More...
 
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. More...
 
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. More...
 
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. More...
 
int l4sigma0_map_tbuf (l4_cap_idx_t sigma0, l4_addr_t virt)
 Request Fiasco trace buffer. More...
 
void l4sigma0_debug_dump (l4_cap_idx_t sigma0)
 Request sigma0 to dump internal debug information. More...
 
int l4sigma0_new_client (l4_cap_idx_t sigma0, l4_cap_idx_t gate)
 Create a new IPC gate for a new Sigma0 client. More...
 
char const * l4sigma0_map_errstr (int err)
 Get a user readable error messages for the return codes. More...
 

Detailed Description

Sigma0 API bindings.

Convenience bindings for the Sigma0 protocol.

Enumeration Type Documentation

◆ l4sigma0_return_flags_t

Return flags of libsigma0 functions.

Enumerator
L4SIGMA0_OK 

Ok.

L4SIGMA0_NOTALIGNED 

Phys, virt or size not aligned.

L4SIGMA0_IPCERROR 

IPC error.

L4SIGMA0_NOFPAGE 

No fpage received.

L4SIGMA0_SMALLERFPAGE 

Superpage requested but smaller flexpage received.

Definition at line 81 of file sigma0.h.

Function Documentation

◆ l4sigma0_debug_dump()

void l4sigma0_debug_dump ( l4_cap_idx_t  sigma0)

Request sigma0 to dump internal debug information.

The debug information, such as internal memory maps, as well as statistics about the internal allocators is dumped to the kernel debugger.

Parameters
sigma0the sigma0 thread id.

◆ l4sigma0_map_anypage()

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.

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().

Parameters
sigma0usually the thread id of sigma0.
map_areathe base address of the local virtual memory area where the page should be mapped.
log2_map_sizethe 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.
Return values
basephysical address of the page received (i.e., the send base of the received mapping if any).
Parameters
szSize to map by the server, in 2^sz bytes.
Returns
0 on success, !0 else (see l4sigma0_map_errstr()).

◆ l4sigma0_map_errstr()

char const * l4sigma0_map_errstr ( int  err)
inline

Get a user readable error messages for the return codes.

Parameters
errthe error code reported by the map functions.
Returns
a string containing the error message.

Definition at line 213 of file sigma0.h.

References EXTERN_C_END.

◆ l4sigma0_map_iomem()

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.

Parameters
sigma0Capability to pager implementing the Sigma0 protocol.
physThe physical address to be requested (page aligned).
virtThe virtual address where the memory should be mapped to (page aligned).
sizeThe size of the IO memory area to be mapped (multiple of page size)
cachedRequests cacheable IO memory if 1, and uncached if 0.
Return values
0Success.
-L4SIGMA0_NOTALIGNEDphys, virt, or size are not aligned.
-L4SIGMA0_IPCERRORIPC error.
-L4SIGMA0_NOFPAGENo 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.

◆ l4sigma0_map_kip()

l4_kernel_info_t* l4sigma0_map_kip ( l4_cap_idx_t  sigma0,
void *  addr,
unsigned  log2_size 
)

Map the kernel info page from pager to addr.

Parameters
sigma0Capability selector for the sigma0 gate.
addrStart of the receive window to receive KIP in.
log2_sizeSize of the receive window to receive KIP in.
Returns
Address KIP was mapped to, 0 indicates an error.

◆ l4sigma0_map_mem()

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.

Parameters
sigma0ID of service talking the sigma0 protocol.
physthe physical address of the requested page (must be at least aligned to the minimum page size).
virtthe virtual address where the paged should be mapped in the local address space (must be at least aligned to the minimum page size).
sizethe size of the requested page, this must be a multiple of the minimum page size.
Returns
0 on success, !0 else (see l4sigma0_map_errstr()).

◆ l4sigma0_map_tbuf()

int l4sigma0_map_tbuf ( l4_cap_idx_t  sigma0,
l4_addr_t  virt 
)

Request Fiasco trace buffer.

This is a Fiasco specific feature. Where you can request the kernel internal trace buffer for user-level evaluation. This is for special debugging tools, such as Ferret.

Parameters
sigma0as usual the sigma0 thread id.
virtthe virtual address where the trace buffer should be mapped,
Returns
0 on success, !0 else (see l4sigma0_map_errstr()).

◆ l4sigma0_new_client()

int l4sigma0_new_client ( l4_cap_idx_t  sigma0,
l4_cap_idx_t  gate 
)

Create a new IPC gate for a new Sigma0 client.

Parameters
sigma0Capability selector for sigma0 gate.
gateCapability selector to use for the new gate.