Describes TEE internal memory management.
Functions | |
void * | TEE_Malloc (size_t size, uint32_t hint) |
This function allocates memory for use by the caller. More... | |
void | TEE_Free (void *buffer) |
The TEE_Free function deallocates memory that was previously allocated with the TEE_Malloc() API. More... | |
void | TEE_MemMove (void *dest, const void *src, uint32_t size) |
This function copies size bytes from a particular buffer denoted as source buffer to another buffer denoted as destination. More... | |
int32_t | TEE_MemCompare (const void *buffer1, const void *buffer2, uint32_t size) |
This function compares the first size bytes of the buffer pointed to by buffer1 to the first size bytes of the buffer pointed to by buffer2. More... | |
void | TEE_MemFill (void *buffer, uint32_t x, uint32_t size) |
The TEE_MemFill function writes the byte x (converted to a uint8_t) into the first size bytes of the object pointed to by buffer. More... | |
void TEE_Free | ( | void * | buffer | ) |
The TEE_Free function deallocates memory that was previously allocated with the TEE_Malloc() API.
(QNX PDK Only) Error behavior: (1) If buffer is a NULL pointer, TEE_Free does nothing. (2) If the provided address is not currently allocated with TEE_Malloc() API, halt the system.
(QNX PDK Only) Side effects: one memory chunk will be returned to the pool if free succeeds.
[in] | buffer | The pointer to the memory buffer to be freed. |
void* TEE_Malloc | ( | size_t | size, |
uint32_t | hint | ||
) |
This function allocates memory for use by the caller.
(QNX PDK only) Error behavior: (1) If input hint is not a valid memory type, halt the system (2) All other errors return an nullptr.
(QNX PDK Only) Side effects: one memory 256-Byte chunk will be marked as allocated if the allocation succeeds.
[in] | size | Size of memory chunk required. Unit: Byte. (QNX PDK Only) Valid range: positive number <= 256. |
[in] | hint | Specifies the memory type. Valid values: (1) TEE_ALLOC_HEAP_MEM for normal memory; (2) TEE_ALLOC_DEVICE_MEM for non-speculative memory; (3) TEE_ALLOC_TZSYSRAM_MEM for TZSysRAM memory (QNX PDK only) |
int32_t TEE_MemCompare | ( | const void * | buffer1, |
const void * | buffer2, | ||
uint32_t | size | ||
) |
This function compares the first size bytes of the buffer pointed to by buffer1 to the first size bytes of the buffer pointed to by buffer2.
(QNX PDK Only) Error behavior: (1) if either buffer parameter is null, halt the system.
(QNX PDK Only) Side effects: N/A
[in] | buffer1 | A pointer to the first buffer. |
[in] | buffer2 | A pointer to the second buffer. |
[in] | size | The number of bytes to be compared. |
void TEE_MemFill | ( | void * | buffer, |
uint32_t | x, | ||
uint32_t | size | ||
) |
The TEE_MemFill function writes the byte x (converted to a uint8_t) into the first size bytes of the object pointed to by buffer.
(QNX PDK Only) Error behavior: (1) if input buffer is nullptr, halt the system. (2) if input arguments (buffer + size) result in an integer overflow, halt the system. (3) if parameter x is outside of the supported range, halt the system.
(QNX PDK Only) Side effects: N/A
[out] | buffer | A pointer to the destination buffer. |
[in] | x | The value to be set. Valid Range (QNX PDK Only): 0 through 255 |
[in] | size | The number of bytes to be set. |
void TEE_MemMove | ( | void * | dest, |
const void * | src, | ||
uint32_t | size | ||
) |
This function copies size bytes from a particular buffer denoted as source buffer to another buffer denoted as destination.
If the source and destination buffer overlap, the API will ensure that the the final destination buffer contents match the contents of the original source buffer.
(QNX PDK Only) Error behavior: (1) if the source or destination buffers are null, halt the system (2) if input arguments (buffer + size) result in an integer overflow, halt the system. (3) if the source address has been allocated with TEE_ALLOC_DEVICE_MEM and the destination address has not been allocated with either TEE_ALLOC_DEVICE_MEM or TEE_ALLOC_TZSYSRAM_MEM, the system will halt. (4) if the source address has been allocated with TEE_ALLOC_TZSYSRAM_MEM and the destination address has not been allocated with either TEE_ALLOC_DEVICE_MEM or TEE_ALLOC_TZSYSRAM_MEM, the system will halt.
(QNX PDK Only) Side effects: N/A
[in] | src | A pointer to the source buffer. |
[out] | dest | A pointer to the destination buffer, |
[in] | size | The number of bytes to be copied. |