L4Re - L4 Runtime Environment
Memory related

Memory related constants, data types and functions. More...

+ Collaboration diagram for Memory related:

Macros

#define L4_PAGESIZE
 Minimal page size (in bytes).
 
#define L4_PAGEMASK
 Mask for the page number. More...
 
#define L4_LOG2_PAGESIZE
 Number of bits used for page offset. More...
 
#define L4_SUPERPAGESIZE
 Size of a large page. More...
 
#define L4_SUPERPAGEMASK
 Mask for the number of a large page. More...
 
#define L4_LOG2_SUPERPAGESIZE
 Number of bits used as offset for a large page. More...
 
#define L4_INVALID_PTR   ((void *)L4_INVALID_ADDR)
 Invalid address as pointer type.
 
#define L4_PAGESHIFT   12
 Size of a page, log2-based.
 
#define L4_SUPERPAGESHIFT   21
 Size of a large page, log2-based.
 
#define L4_PAGESHIFT   12
 Size of a page, log2-based.
 
#define L4_SUPERPAGESHIFT   21
 Size of a large page, log2-based.
 
#define L4_PAGESHIFT   12
 Size of a page log2-based.
 
#define L4_SUPERPAGESHIFT   22
 Size of a large page log2-based.
 

Enumerations

enum  l4_addr_consts_t { L4_INVALID_ADDR = ~0UL }
 Address related constants. More...
 

Functions

l4_addr_t l4_trunc_page (l4_addr_t address) L4_NOTHROW
 Round an address down to the next lower page boundary. More...
 
l4_addr_t l4_trunc_size (l4_addr_t address, unsigned char bits) L4_NOTHROW
 Round an address down to the next lower flex page with size bits. More...
 
l4_addr_t l4_round_page (l4_addr_t address) L4_NOTHROW
 Round address up to the next page. More...
 
l4_addr_t l4_round_size (l4_umword_t value, unsigned char bits) L4_NOTHROW
 Round value up to the next alignment with bits size. More...
 

Detailed Description

Memory related constants, data types and functions.

Macro Definition Documentation

◆ L4_LOG2_PAGESIZE

#define L4_LOG2_PAGESIZE

Number of bits used for page offset.

Size of page in log2.

Definition at line 325 of file consts.h.

Referenced by L4Re::Rm::attach(), L4Re::Dataspace::map(), and L4Re::Dataspace::map_region().

◆ L4_LOG2_SUPERPAGESIZE

#define L4_LOG2_SUPERPAGESIZE

Number of bits used as offset for a large page.

Size of large page in log2

Definition at line 351 of file consts.h.

◆ L4_PAGEMASK

#define L4_PAGEMASK

Mask for the page number.

Note
The most significant bits are set.

Definition at line 316 of file consts.h.

Referenced by l4_round_page(), l4_sleep_forever(), and l4_trunc_page().

◆ L4_SUPERPAGEMASK

#define L4_SUPERPAGEMASK

Mask for the number of a large page.

Note
The most significant bits are set.

Definition at line 343 of file consts.h.

◆ L4_SUPERPAGESIZE

#define L4_SUPERPAGESIZE

Size of a large page.

A large page is a super page on IA32 or a section on ARM.

Definition at line 334 of file consts.h.

Enumeration Type Documentation

◆ l4_addr_consts_t

Address related constants.

Enumerator
L4_INVALID_ADDR 

Invalid address.

Definition at line 407 of file consts.h.

Function Documentation

◆ l4_round_page()

l4_addr_t l4_round_page ( l4_addr_t  address)
inline

Round address up to the next page.

The address is rounded up to the next minimal page boundary. On most architectures this is a 4k page. Check L4_PAGESIZE for the minimal page size.

Parameters
addressThe address to round up.

Definition at line 389 of file consts.h.

References L4_NOTHROW, L4_PAGEMASK, L4_PAGESIZE, and l4_round_size().

Referenced by L4Re::Rm::attach(), l4_trunc_size(), L4Re::Dataspace::map(), and L4Re::Dataspace::map_region().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ l4_round_size()

l4_addr_t l4_round_size ( l4_umword_t  value,
unsigned char  bits 
)
inline

Round value up to the next alignment with bits size.

Parameters
valueThe value to round up to the next size-alignment.
bitsThe size of the alignment (log2).

Definition at line 400 of file consts.h.

Referenced by l4_round_page(), and L4Re::Dataspace::map_region().

+ Here is the caller graph for this function:

◆ l4_trunc_page()

l4_addr_t l4_trunc_page ( l4_addr_t  address)
inline

Round an address down to the next lower page boundary.

The address is rounded down to the next lower mininmal page boundary. On most architectures this is a 4k page. Check L4_PAGESIZE for the minimal page size.

Parameters
addressThe address to round.
Examples:
examples/libs/l4re/c++/mem_alloc/ma+rm.cc, and examples/libs/l4re/c/ma+rm.c.

Definition at line 364 of file consts.h.

References L4_NOTHROW, L4_PAGEMASK, and l4_trunc_size().

Referenced by l4_touch_ro(), l4_touch_rw(), L4Re::Dataspace::map(), and L4Re::Dataspace::map_region().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ l4_trunc_size()

l4_addr_t l4_trunc_size ( l4_addr_t  address,
unsigned char  bits 
)
inline

Round an address down to the next lower flex page with size bits.

Parameters
addressThe address to round.
bitsThe size of the flex page (log2).

Definition at line 375 of file consts.h.

References L4_NOTHROW, and l4_round_page().

Referenced by l4_fpage_max_order(), l4_trunc_page(), and L4Re::Dataspace::map_region().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: