safec
3.0
Safe C Library - ISO TR24731 Bounds Checking Interface
|
#include "mem_primitives_lib.h"
Macros | |
#define | wsize sizeof(uint32_t) |
#define | wmask (wsize - 1) |
Functions | |
void | mem_prim_set (void *dest, uint32_t len, uint8_t value) |
Sets len bytes starting at dest to the specified value. More... | |
void | mem_prim_set16 (uint16_t *dest, uint32_t len, uint16_t value) |
Sets len uint16_t's starting at dest to the specified value. More... | |
void | mem_prim_set32 (uint32_t *dest, uint32_t len, uint32_t value) |
Sets len uint32_t's starting at dest to the specified value. More... | |
void | mem_prim_move (void *dest, const void *src, uint32_t len) |
Moves at most len of bytes from src to dest. More... | |
void | mem_prim_move8 (uint8_t *dest, const uint8_t *src, uint32_t len) |
Moves at most len of uint8_t's from src to dest. More... | |
void | mem_prim_move16 (uint16_t *dest, const uint16_t *src, uint32_t len) |
Moves at most len uint16_t's from src to dest. More... | |
void | mem_prim_move32 (uint32_t *dest, const uint32_t *src, uint32_t len) |
Moves at most len of uint32_t's from src to dest. More... | |
#define wsize sizeof(uint32_t) |
#define wmask (wsize - 1) |
void mem_prim_set | ( | void * | dest, |
uint32_t | len, | ||
uint8_t | value | ||
) |
Sets len bytes starting at dest to the specified value.
[out] | dest | pointer to memory that will be set to value |
[in] | len | number of bytes to be set |
[in] | value | byte value |
void mem_prim_set16 | ( | uint16_t * | dest, |
uint32_t | len, | ||
uint16_t | value | ||
) |
Sets len uint16_t's starting at dest to the specified value.
Pointers must meet system alignment requirements.
[out] | dest | pointer to memory that will be set to value |
[in] | len | number of uint16_ts to be set |
[in] | value | uint16_t value |
void mem_prim_set32 | ( | uint32_t * | dest, |
uint32_t | len, | ||
uint32_t | value | ||
) |
Sets len uint32_t's starting at dest to the specified value.
Pointers must meet system alignment requirements.
[out] | dest | pointer to memory that will be set to value |
[in] | len | number of uint32_t's to be set |
[in] | value | uint32_t value |
void mem_prim_move | ( | void * | dest, |
const void * | src, | ||
uint32_t | len | ||
) |
Moves at most len of bytes from src to dest.
Dest may overlap with src.
[out] | dest | pointer to the memory that will be replaced by src. |
[in] | src | pointer to the memory that will be copied to dest |
[in] | len | maximum number bytes of src that can be copied |
void mem_prim_move8 | ( | uint8_t * | dest, |
const uint8_t * | src, | ||
uint32_t | len | ||
) |
Moves at most len of uint8_t's from src to dest.
The destination may overlap with source.
[out] | dest | pointer to the memory that will be replaced by src |
[in] | src | pointer to the memory that will be copied to dest |
[in] | len | maximum number uint8_t of src that can be copied |
void mem_prim_move16 | ( | uint16_t * | dest, |
const uint16_t * | src, | ||
uint32_t | len | ||
) |
Moves at most len uint16_t's from src to dest.
The destination may overlap with source.
[out] | dest | pointer to the memory that will be replaced by src. |
[in] | src | pointer to the memory that will be copied to dest |
[in] | len | maximum number uint16_t of src that can be copied |
void mem_prim_move32 | ( | uint32_t * | dest, |
const uint32_t * | src, | ||
uint32_t | len | ||
) |
Moves at most len of uint32_t's from src to dest.
The destination may overlap with source.
[out] | dest | pointer to the memory that will be replaced by src. |
[in] | src | pointer to the memory that will be copied to dest |
[in] | len | maximum number uint32_t of sp that can be copied |