Loading...
Searching...
No Matches
Memory descriptors (C version)
Base API » Kernel Interface Page

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_t * | l4_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>
  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

typedef struct l4_kernel_info_mem_desc_t 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

enum 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 59 of file memdesc.h.

## l4_mem_info_sub_type_t

enum 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 50 of file memdesc.h.

## l4_mem_type_t

enum 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 33 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 215 of file memdesc.h.

References L4_NOTHROW.

## 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 236 of file memdesc.h.

References L4_NOTHROW.

## 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 208 of file memdesc.h.

References L4_NOTHROW.

## 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 229 of file memdesc.h.

References L4_NOTHROW.

## 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 222 of file memdesc.h.

References L4_NOTHROW.

## 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 186 of file memdesc.h.

References L4_NOTHROW.

## 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

  md | Pointer to memory descriptor
  start | Start of region
  end | End of region
  type | Type of region
  virt | 1 if virtual region, 0 if physical region
  sub_type | Sub type.

Definition at line 193 of file memdesc.h.

References L4_NOTHROW.