Build-time settings: widths, region sizes, feature switches and the region cut macros. More...
Macros | |
| #define | MMGR_ALIGN_BYTES |
| The settings of a build that gives no command line flag. | |
| #define | MMGR_DEBUG_CHECKS |
| Set to 1 to enable the library's debug-only checks. | |
| #define | MMGR_ASSERT(cond, msg) |
| Runtime assertion hook: a trap under MMGR_DEBUG_CHECKS, inert otherwise. | |
| #define | MMGR_PLAINTEXT_CONFIN_SIZE |
| Bytes in the largest plaintext confinium this build will declare. | |
| #define | MMGR_SECURE_CONFIN_SIZE |
| Bytes in the largest secure confinium this build will declare. | |
| #define | MMGR_CARCER_MAX |
| Bytes in the larger of the two confinia, the bound on the worst case a scan or a read must cover. | |
| #define | MMGR_ENABLE_CLOCK |
| Set to 1 to build the memoriam_praetereo DMA path. | |
| #define | MMGR_MEMOR_IS_SIZE(x_) |
| Microseconds a ring waits before its attach. | |
| #define | MMGR_MEMOR_IS_BYTE(x_) |
| Fails the build unless x_ has type uint8_t. | |
| #define | MMGR_STR_MAX |
| Read bound applied to the <string.h> names that take no length of their own. | |
| #define | memcpy(dest, source, bytes) |
| Replaces memcpy with mmgr_shim_cpy. | |
| #define | memmove(dest, source, bytes) |
| Replaces memmove with mmgr_shim_move. | |
| #define | memset(dest, value, bytes) |
| Replaces memset with mmgr_shim_set. | |
| #define | memcmp(left, right, bytes) |
| Replaces memcmp with mmgr_shim_cmp. | |
| #define | memchr(region, value, bytes) |
| Replaces memchr with mmgr_shim_chr. | |
| #define | strlen(text) |
| Replaces strlen with a scan bounded at MMGR_STR_MAX. | |
| #define | strnlen(text, limit) |
| Replaces strnlen with a scan bounded at limit. | |
| #define | strstr(haystack, needle) |
| Replaces strstr with a case-sensitive search bounded at MMGR_STR_MAX. | |
| #define | strcasestr(haystack, needle) |
| Replaces strcasestr with a case-folded search bounded at MMGR_STR_MAX. | |
| #define | strcmp(left, right) |
| Replaces strcmp with an equality test bounded at MMGR_STR_MAX. | |
| #define | strcasecmp(left, right) |
| Replaces strcasecmp with a case-folded equality test bounded at MMGR_STR_MAX. | |
| #define | strncmp(left, right, limit) |
| Replaces strncmp with an equality test over at max limit bytes. | |
| #define | strncasecmp(left, right, limit) |
| Replaces strncasecmp with a case-folded equality test over at max limit bytes. | |
| #define | strlcpy(dest, source, limit) |
| Replaces strlcpy with a bounded copy that always terminates unless limit is 0. | |
| #define | strchr(text, value) |
| Replaces strchr with a search bounded at MMGR_STR_MAX. | |
Functions | |
| static EMBED_HOST_DEVICE void * | mmgr_shim_cpy (void *dest, const void *source, size_t bytes) |
| Copies bytes from source to dest and returns dest. | |
| static EMBED_HOST_DEVICE void * | mmgr_shim_move (void *dest, const void *source, size_t bytes) |
| Copies bytes from source to dest, with overlap allowed, and returns dest. | |
| static EMBED_HOST_DEVICE void * | mmgr_shim_set (void *dest, embed_iword value, size_t bytes) |
| Fills bytes of dest with the low byte of value and returns dest. | |
| static EMBED_HOST_DEVICE embed_iword | mmgr_shim_cmp (const void *left, const void *right, size_t bytes) |
| Compares bytes of left against right. | |
| static EMBED_HOST_DEVICE void * | mmgr_shim_chr (const void *region, embed_iword value, size_t bytes) |
| Finds the first byte in region equal to the low byte of value. | |
Build-time settings: widths, region sizes, feature switches and the region cut macros.
Redirects the <string.h> names onto MMgr's bounded implementations.
| #define MMGR_ALIGN_BYTES |
The settings of a build that gives no command line flag.
A build sets a tunable on its command line, or in the header mmgr_settings.h on its include path. This tree holds no such header. Where the compiler finds one, this file reads it before the first tunable.
Alignment applied to every carved region, and the granularity each pool must be a multiple of.
Definition at line 41 of file mmgr_config.h.
| #define MMGR_DEBUG_CHECKS |
Set to 1 to enable the library's debug-only checks.
Definition at line 50 of file mmgr_config.h.
| #define MMGR_ASSERT | ( | cond, | |
| msg ) |
Runtime assertion hook: a trap under MMGR_DEBUG_CHECKS, inert otherwise.
| [in] | cond | Condition the caller expects to hold. |
| [in] | msg | String literal that describes the expectation. |
Definition at line 84 of file mmgr_config.h.
| #define MMGR_PLAINTEXT_CONFIN_SIZE |
Bytes in the largest plaintext confinium this build will declare.
Definition at line 97 of file mmgr_config.h.
| #define MMGR_SECURE_CONFIN_SIZE |
Bytes in the largest secure confinium this build will declare.
Definition at line 106 of file mmgr_config.h.
| #define MMGR_CARCER_MAX |
Bytes in the larger of the two confinia, the bound on the worst case a scan or a read must cover.
Definition at line 123 of file mmgr_config.h.
| #define MMGR_ENABLE_CLOCK |
Set to 1 to build the memoriam_praetereo DMA path.
Set to 1 to build the memoria_externa external memory path.
Set to 1 to build the time-based ring behavior.
Definition at line 154 of file mmgr_config.h.
| #define MMGR_MEMOR_IS_SIZE | ( | x_ | ) |
Microseconds a ring waits before its attach.
Fails the build unless x_ has type size_t.
| [in] | x_ | Expression under a type check. |
Definition at line 174 of file mmgr_config.h.
| #define MMGR_MEMOR_IS_BYTE | ( | x_ | ) |
Fails the build unless x_ has type uint8_t.
| [in] | x_ | Expression under a type check. |
Definition at line 182 of file mmgr_config.h.
| #define MMGR_STR_MAX |
Read bound applied to the <string.h> names that take no length of their own.
Definition at line 26 of file mmgr_string_shim.h.
| #define memcpy | ( | dest, | |
| source, | |||
| bytes ) |
Replaces memcpy with mmgr_shim_cpy.
Definition at line 139 of file mmgr_string_shim.h.
| #define memmove | ( | dest, | |
| source, | |||
| bytes ) |
Replaces memmove with mmgr_shim_move.
Definition at line 144 of file mmgr_string_shim.h.
| #define memset | ( | dest, | |
| value, | |||
| bytes ) |
Replaces memset with mmgr_shim_set.
Definition at line 149 of file mmgr_string_shim.h.
| #define memcmp | ( | left, | |
| right, | |||
| bytes ) |
Replaces memcmp with mmgr_shim_cmp.
Definition at line 156 of file mmgr_string_shim.h.
| #define memchr | ( | region, | |
| value, | |||
| bytes ) |
Replaces memchr with mmgr_shim_chr.
Definition at line 161 of file mmgr_string_shim.h.
| #define strlen | ( | text | ) |
Replaces strlen with a scan bounded at MMGR_STR_MAX.
Definition at line 168 of file mmgr_string_shim.h.
| #define strnlen | ( | text, | |
| limit ) |
Replaces strnlen with a scan bounded at limit.
Definition at line 175 of file mmgr_string_shim.h.
| #define strstr | ( | haystack, | |
| needle ) |
Replaces strstr with a case-sensitive search bounded at MMGR_STR_MAX.
Definition at line 183 of file mmgr_string_shim.h.
| #define strcasestr | ( | haystack, | |
| needle ) |
Replaces strcasestr with a case-folded search bounded at MMGR_STR_MAX.
Definition at line 193 of file mmgr_string_shim.h.
| #define strcmp | ( | left, | |
| right ) |
Replaces strcmp with an equality test bounded at MMGR_STR_MAX.
Definition at line 203 of file mmgr_string_shim.h.
| #define strcasecmp | ( | left, | |
| right ) |
Replaces strcasecmp with a case-folded equality test bounded at MMGR_STR_MAX.
Definition at line 212 of file mmgr_string_shim.h.
| #define strncmp | ( | left, | |
| right, | |||
| limit ) |
Replaces strncmp with an equality test over at max limit bytes.
Definition at line 222 of file mmgr_string_shim.h.
| #define strncasecmp | ( | left, | |
| right, | |||
| limit ) |
Replaces strncasecmp with a case-folded equality test over at max limit bytes.
Definition at line 233 of file mmgr_string_shim.h.
| #define strlcpy | ( | dest, | |
| source, | |||
| limit ) |
Replaces strlcpy with a bounded copy that always terminates unless limit is 0.
Definition at line 242 of file mmgr_string_shim.h.
| #define strchr | ( | text, | |
| value ) |
Replaces strchr with a search bounded at MMGR_STR_MAX.
Definition at line 252 of file mmgr_string_shim.h.
|
inlinestatic |
Copies bytes from source to dest and returns dest.
| [out] | dest | Destination to write [BORROWS]. |
| [in] | source | Bytes to read [BORROWS]. |
| [in] | bytes | Number of bytes to copy. |
Definition at line 62 of file mmgr_string_shim.h.
References MemoriaCfg::dst, and mmgr_shim_cpy().
Referenced by mmgr_shim_cpy().
|
inlinestatic |
Copies bytes from source to dest, with overlap allowed, and returns dest.
| [out] | dest | Destination to write [BORROWS]. |
| [in] | source | Bytes to read [BORROWS]. |
| [in] | bytes | Number of bytes to copy. |
Definition at line 78 of file mmgr_string_shim.h.
References MemoriaCfg::dst, and mmgr_shim_move().
Referenced by mmgr_shim_move().
|
inlinestatic |
Fills bytes of dest with the low byte of value and returns dest.
| [out] | dest | Destination to write [BORROWS]. |
| [in] | value | Fill value; only its low eight bits count. |
| [in] | bytes | Number of bytes to write. |
Definition at line 100 of file mmgr_string_shim.h.
References MemoriaCfg::dst, and mmgr_shim_set().
Referenced by mmgr_shim_set().
|
inlinestatic |
Compares bytes of left against right.
| [in] | left | First region [BORROWS]. |
| [in] | right | Second region [BORROWS]. |
| [in] | bytes | Number of bytes to compare. |
Definition at line 115 of file mmgr_string_shim.h.
References mmgr_shim_cmp(), and MemoriaCfg::src.
Referenced by mmgr_shim_cmp().
|
inlinestatic |
Finds the first byte in region equal to the low byte of value.
| [in] | region | Bytes to search [BORROWS]. |
| [in] | value | Byte sought; only its low eight bits count. |
| [in] | bytes | Number of bytes to search. |
Definition at line 129 of file mmgr_string_shim.h.
References mmgr_shim_chr(), and MemoriaCfg::src.
Referenced by mmgr_shim_chr().