L4Re Operating System Framework
Interface and Usage Documentation
Loading...
Searching...
No Matches
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.
 
#define L4_LOG2_PAGESIZE
 Number of bits used for page offset.
 
#define L4_SUPERPAGESIZE
 Size of a large page.
 
#define L4_SUPERPAGEMASK
 Mask for the number of a large page.
 
#define L4_LOG2_SUPERPAGESIZE
 Number of bits used as offset for a large page.
 
#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.
 
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.
 
l4_addr_t l4_round_page (l4_addr_t address) L4_NOTHROW
 Round address up to the next page.
 
l4_addr_t l4_round_size (l4_addr_t value, unsigned char bits) L4_NOTHROW
 Round value up to the next alignment with bits size.
 
unsigned l4_bytes_to_mwords (unsigned size) L4_NOTHROW
 Determine how many machine words (l4_umword_t) are required to store a buffer of 'size' bytes.
 

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 398 of file consts.h.

◆ 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 424 of file consts.h.

◆ L4_PAGEMASK

#define L4_PAGEMASK

Mask for the page number.

Note
The most significant bits are set.

Definition at line 389 of file consts.h.

◆ L4_PAGESHIFT [1/2]

#define L4_PAGESHIFT   12

Size of a page, log2-based.

Size of a page log2-based.

Definition at line 35 of file consts.h.

◆ L4_PAGESHIFT [2/2]

#define L4_PAGESHIFT   12

Size of a page, log2-based.

Size of a page log2-based.

Examples
examples/libs/l4re/c++/mem_alloc/ma+rm.cc, examples/libs/l4re/c/ma+rm.c, examples/libs/l4re/streammap/client.cc, and examples/libs/l4re/streammap/server.cc.

Definition at line 37 of file consts.h.

◆ L4_SUPERPAGEMASK

#define L4_SUPERPAGEMASK

Mask for the number of a large page.

Note
The most significant bits are set.

Definition at line 416 of file consts.h.

◆ L4_SUPERPAGESHIFT [1/2]

#define L4_SUPERPAGESHIFT   21

Size of a large page, log2-based.

Size of a large page log2-based.

Definition at line 41 of file consts.h.

◆ L4_SUPERPAGESHIFT [2/2]

#define L4_SUPERPAGESHIFT   21

Size of a large page, log2-based.

Size of a large page log2-based.

Examples
examples/libs/l4re/c++/mem_alloc/ma+rm.cc, and examples/libs/l4re/c/ma+rm.c.

Definition at line 42 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 407 of file consts.h.

Enumeration Type Documentation

◆ l4_addr_consts_t

Address related constants.

Enumerator
L4_INVALID_ADDR 

Invalid address.

Definition at line 492 of file consts.h.

Function Documentation

◆ l4_bytes_to_mwords()

unsigned l4_bytes_to_mwords ( unsigned  size)
inline

Determine how many machine words (l4_umword_t) are required to store a buffer of 'size' bytes.

Parameters
sizeThe number of bytes to be translated into machine words.

Definition at line 485 of file consts.h.

Referenced by __kdebug_3_text(), __kdebug_text(), and l4_vcon_send_u().

+ Here is the caller graph for this function:

◆ 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 462 of file consts.h.

References L4_PAGEMASK, and L4_PAGESIZE.

Referenced by L4virtio::Svr::Driver_mem_region_t< DATA >::Driver_mem_region_t(), L4Re::Util::Dataspace_svr::map(), and L4virtio::Driver::Block_device::setup_device().

+ Here is the caller graph for this function:

◆ l4_round_size()

l4_addr_t l4_round_size ( l4_addr_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 473 of file consts.h.

Referenced by cxx::List_alloc::alloc_max(), L4virtio::Driver::Virtio_net_device::setup_device(), L4virtio::Driver::Block_device::setup_device(), L4virtio::Virtqueue::setup_simple(), and L4virtio::Virtqueue::total_size().

+ 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 minimal 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 437 of file consts.h.

References L4_PAGEMASK.

Referenced by l4_touch_ro(), l4_touch_rw(), and L4Re::Util::Dataspace_svr::map().

+ 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 448 of file consts.h.

Referenced by cxx::List_alloc::alloc_max(), l4_fpage_max_order(), and L4Re::Util::Dataspace_svr::map().

+ Here is the caller graph for this function: