L4Re - L4 Runtime Environment
Memory descriptors (C version)

C Interface for KIP memory descriptors. More...

+ Collaboration diagram for Memory descriptors (C version):

Data Structures

struct  l4_kernel_info_mem_desc_t
 Memory descriptor data structure. More...
 

Typedefs

typedef struct l4_kernel_info_mem_desc_t l4_kernel_info_mem_desc_t
 Memory descriptor data structure. More...
 

Enumerations

enum  l4_mem_type_t {
  l4_mem_type_undefined = 0x0, l4_mem_type_conventional = 0x1, l4_mem_type_reserved = 0x2, l4_mem_type_dedicated = 0x3,
  l4_mem_type_shared = 0x4, l4_mem_type_info = 0xd, l4_mem_type_bootloader = 0xe, l4_mem_type_archspecific = 0xf
}
 Type of a memory descriptor. More...
 
enum  l4_mem_info_sub_type_t { l4_mem_info_acpi_rsdp = 0 }
 Memory sub types for l4_mem_type_info descriptors. More...
 

Functions

l4_kernel_info_mem_desc_tl4_kernel_info_get_mem_descs (l4_kernel_info_t *kip) L4_NOTHROW
 Get pointer to memory descriptors from KIP.
 
unsigned l4_kernel_info_get_num_mem_descs (l4_kernel_info_t *kip) L4_NOTHROW
 Get number of memory descriptors in KIP. More...
 
void l4_kernel_info_set_mem_desc (l4_kernel_info_mem_desc_t *md, l4_addr_t start, l4_addr_t end, unsigned type, unsigned virt, unsigned sub_type) L4_NOTHROW
 Populate a memory descriptor. More...
 
l4_umword_t l4_kernel_info_get_mem_desc_start (l4_kernel_info_mem_desc_t *md) L4_NOTHROW
 Get start address of the region described by the memory descriptor. More...
 
l4_umword_t l4_kernel_info_get_mem_desc_end (l4_kernel_info_mem_desc_t *md) L4_NOTHROW
 Get end address of the region described by the memory descriptor. More...
 
l4_umword_t l4_kernel_info_get_mem_desc_type (l4_kernel_info_mem_desc_t *md) L4_NOTHROW
 Get type of the memory region. More...
 
l4_umword_t l4_kernel_info_get_mem_desc_subtype (l4_kernel_info_mem_desc_t *md) L4_NOTHROW
 Get sub-type of memory region. More...
 
l4_umword_t l4_kernel_info_get_mem_desc_is_virtual (l4_kernel_info_mem_desc_t *md) L4_NOTHROW
 Get virtual flag of the memory descriptor. More...
 

Detailed Description

C Interface for KIP memory descriptors.

Include File
#include <l4/sys/memdesc.h>

This module contains the C functions to access the memory descriptor in the kernel interface page (KIP).

Typedef Documentation

◆ l4_kernel_info_mem_desc_t

Memory descriptor data structure.

Note
This data type is opaque, and must be accessed by the accessor functions defined in this module.

Enumeration Type Documentation

◆ l4_mem_info_sub_type_t

Memory sub types for l4_mem_type_info descriptors.

Enumerator
l4_mem_info_acpi_rsdp 

Physical address of the ACPI root pointer.

Definition at line 61 of file memdesc.h.

◆ l4_mem_type_t

Type of a memory descriptor.

Enumerator
l4_mem_type_undefined 

Undefined, unused descriptor.

l4_mem_type_conventional 

Conventional memory.

l4_mem_type_reserved 

Reserved memory for kernel etc.

l4_mem_type_dedicated 

Dedicated memory (some device memory)

l4_mem_type_shared 

Shared memory (not implemented)

l4_mem_type_info 

Info from the boot loader.

l4_mem_type_bootloader 

Memory owned by the boot loader.

l4_mem_type_archspecific 

Architecture specific memory (e.g., ACPI memory)

Definition at line 44 of file memdesc.h.

Function Documentation

◆ l4_kernel_info_get_mem_desc_end()

l4_umword_t l4_kernel_info_get_mem_desc_end ( l4_kernel_info_mem_desc_t md)
inline

Get end address of the region described by the memory descriptor.

Returns
End address.

Definition at line 217 of file memdesc.h.

◆ l4_kernel_info_get_mem_desc_is_virtual()

l4_umword_t l4_kernel_info_get_mem_desc_is_virtual ( l4_kernel_info_mem_desc_t md)
inline

Get virtual flag of the memory descriptor.

Returns
1 if region is virtual memory, 0 if region is physical memory

Definition at line 238 of file memdesc.h.

◆ l4_kernel_info_get_mem_desc_start()

l4_umword_t l4_kernel_info_get_mem_desc_start ( l4_kernel_info_mem_desc_t md)
inline

Get start address of the region described by the memory descriptor.

Returns
Start address.

Definition at line 210 of file memdesc.h.

◆ l4_kernel_info_get_mem_desc_subtype()

l4_umword_t l4_kernel_info_get_mem_desc_subtype ( l4_kernel_info_mem_desc_t md)
inline

Get sub-type of memory region.

Returns
Sub-type.

The sub type is defined for architecture specific memory descriptors (see l4_mem_type_archspecific) and has architecture specific meaning.

Definition at line 231 of file memdesc.h.

◆ l4_kernel_info_get_mem_desc_type()

l4_umword_t l4_kernel_info_get_mem_desc_type ( l4_kernel_info_mem_desc_t md)
inline

Get type of the memory region.

Returns
Type of the region (see l4_mem_type_t).

Definition at line 224 of file memdesc.h.

◆ l4_kernel_info_get_num_mem_descs()

unsigned l4_kernel_info_get_num_mem_descs ( l4_kernel_info_t kip)
inline

Get number of memory descriptors in KIP.

Returns
Number of memory descriptors.

Definition at line 188 of file memdesc.h.

References l4_kernel_info_t::mem_info.

◆ l4_kernel_info_set_mem_desc()

void l4_kernel_info_set_mem_desc ( l4_kernel_info_mem_desc_t md,
l4_addr_t  start,
l4_addr_t  end,
unsigned  type,
unsigned  virt,
unsigned  sub_type 
)
inline

Populate a memory descriptor.

Parameters
mdPointer to memory descriptor
startStart of region
endEnd of region
typeType of region
virt1 if virtual region, 0 if physical region
sub_typeSub type.

Definition at line 195 of file memdesc.h.