Defines Trusted Little Kernel (TLK) memory allocation services functions.
|
void * | te_mem_alloc (uint32_t size) |
| Allocates memory of specified size. More...
|
|
void * | te_mem_calloc (uint32_t size) |
| Allocates and clears memory of specified size. More...
|
|
void * | te_mem_realloc (void *buffer, uint32_t size) |
| Changes size of memory by specified amount. More...
|
|
void | te_mem_free (void *buffer) |
| Frees the specified memory. More...
|
|
void | te_mem_fill (void *buffer, uint32_t value, uint32_t size) |
| Fills specified memory range with specified value. More...
|
|
void | te_mem_move (void *dest, const void *src, uint32_t size) |
| Moves specified number of bytes from a source memory range to a destination memory range. More...
|
|
int | te_mem_compare (const void *buffer1, const void *buffer2, uint32_t size) |
| Compares two ranges of memory for equality. More...
|
|
void* te_mem_alloc |
( |
uint32_t |
size | ) |
|
Allocates memory of specified size.
- Parameters
-
[in] | size | Size in bytes of desired memory. |
- Returns
- A non-NULL pointer to the requested memory or NULL if the request to allocate memory failed.
void* te_mem_calloc |
( |
uint32_t |
size | ) |
|
Allocates and clears memory of specified size.
- Parameters
-
[in] | size | Size in bytes of desired memory. |
- Returns
- A non-NULL pointer to the requested memory or NULL if the request to allocate and clear memory failed.
int te_mem_compare |
( |
const void * |
buffer1, |
|
|
const void * |
buffer2, |
|
|
uint32_t |
size |
|
) |
| |
Compares two ranges of memory for equality.
- Parameters
-
[in] | buffer1 | A pointer to first memory range to compare. |
[in] | buffer2 | A pointer to second memory range to compare. |
[in] | size | Number of bytes to compare. |
- Returns
- An integer where:
- 0 indicates the contents of the first memory range match match the contents of the second memory range.
- < 0 indicates the contents of the first memory range are less than the contents of the second memory range.
- > 0 indicates the contents of the first memory range are greater than the contents of the second memory range.
void te_mem_fill |
( |
void * |
buffer, |
|
|
uint32_t |
value, |
|
|
uint32_t |
size |
|
) |
| |
Fills specified memory range with specified value.
- Parameters
-
[in] | buffer | A pointer to memory to fill. |
[in] | value | Value to use for fill operation. |
[in] | size | Number of bytes to fill. |
void te_mem_free |
( |
void * |
buffer | ) |
|
Frees the specified memory.
- Parameters
-
[in] | buffer | A pointer to memory to free. |
void te_mem_move |
( |
void * |
dest, |
|
|
const void * |
src, |
|
|
uint32_t |
size |
|
) |
| |
Moves specified number of bytes from a source memory range to a destination memory range.
- Note
- The two memory ranges may overlap.
- Parameters
-
[out] | dest | A pointer to destination buffer for move operation. |
[in] | src | A pointer to source buffer for move operation. |
[in] | size | Number of bytes to move. |
void* te_mem_realloc |
( |
void * |
buffer, |
|
|
uint32_t |
size |
|
) |
| |
Changes size of memory by specified amount.
- Parameters
-
[in] | buffer | Pointer to memory block to resize. |
[in] | size | New size in bytes of memory block. |
- Returns
- A non-NULL pointer to the newly resized memory or NULL if the request to resize failed.