Loading...
Searching...
No Matches
Memory related
Base API

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

Referenced by L4Re::Dataspace::map(), L4Re::Dataspace::map_region(), and L4Re::Util::Dataspace_svr::page_shift().

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

## L4_PAGEMASK

#define L4_PAGEMASK

Mask for the page number.

Note
  The most significant bits are set.

Definition at line 400 of file consts.h.

Referenced by L4virtio::Driver::Device::driver_connect(), l4_round_page(), and l4_trunc_page().

## L4_PAGESHIFT [1/3]

#define L4_PAGESHIFT 12

Size of a page, log2-based.

Size of a page log2-based.

Definition at line 24 of file consts.h.

## L4_PAGESHIFT [2/3]

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

Referenced by L4Re::Rm::attach(), L4virtio::Driver::Device::driver_connect(), L4Re::Rm::free_area(), L4Re::Util::Dataspace_svr::map(), L4Re::Rm::reserve_area(), L4Re::Rm::reserve_area(), L4virtio::Driver::Block_device::setup_device(), and L4virtio::Driver::Virtio_net_device::setup_device().

## L4_PAGESHIFT [3/3]

#define L4_PAGESHIFT 12

Size of a page, log2-based.

Size of a page log2-based.

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

## L4_SUPERPAGESHIFT [1/3]

#define L4_SUPERPAGESHIFT 21

Size of a large page, log2-based.

Size of a large page log2-based.

Definition at line 30 of file consts.h.

## L4_SUPERPAGESHIFT [2/3]

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

Referenced by L4virtio::Svr::Driver_mem_region_t< No_custom_data >::Driver_mem_region_t().

## L4_SUPERPAGESHIFT [3/3]

#define L4_SUPERPAGESHIFT 21

Size of a large page, log2-based.

Size of a large page log2-based.

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

Referenced by L4virtio::Driver::Device::driver_connect().

## Enumeration Type Documentation

## l4_addr_consts_t

enum l4_addr_consts_t

Address related constants.

Enumerator
L4_INVALID_ADDR | Invalid address.

Definition at line 503 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

  size | The number of bytes to be translated into machine words.

Definition at line 496 of file consts.h.

References L4_INLINE, and L4_NOTHROW.

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

  address | The address to round up.

Definition at line 473 of file consts.h.

References L4_INLINE, L4_NOTHROW, L4_PAGEMASK, and L4_PAGESIZE.

Referenced by L4virtio::Svr::Driver_mem_region_t< No_custom_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

  value | The value to round up to the next size-alignment.
  bits | The size of the alignment (log2).

Definition at line 484 of file consts.h.

References L4_INLINE, and L4_NOTHROW.

Referenced by cxx::List_alloc::alloc_max(), L4virtio::Driver::Block_device::setup_device(), L4virtio::Driver::Virtio_net_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

  address | The address to round.

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

Definition at line 448 of file consts.h.

References L4_INLINE, L4_NOTHROW, and L4_PAGEMASK.

Referenced by L4virtio::Svr::Driver_mem_region_t< No_custom_data >::Driver_mem_region_t(), 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 flexpage with size bits.

Parameters

  address | The address to round.
  bits | The size of the flexpage (log2).

Definition at line 459 of file consts.h.

References L4_INLINE, and L4_NOTHROW.

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: