L4Re Operating System Framework
Interface and Usage Documentation
Loading...
Searching...
No Matches
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.
 

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...
 
enum  l4_mem_archspecific_sub_type_common_t { l4_mem_archspecific_acpi_tables = 3 , l4_mem_archspecific_acpi_nvs = 4 }
 Memory sub types for l4_mem_type_archspecific 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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 

Detailed Description

C Interface for KIP memory descriptors.

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

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_archspecific_sub_type_common_t

Memory sub types for l4_mem_type_archspecific descriptors.

Enumerator
l4_mem_archspecific_acpi_tables 

Firmware ACPI tables.

l4_mem_archspecific_acpi_nvs 

Firmware reserved address space.

Definition at line 70 of file memdesc.h.

◆ 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 227 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 248 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 220 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 241 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 234 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 198 of file memdesc.h.

◆ 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 205 of file memdesc.h.