![]() |
Samsung Internal API reference
2.0
|
Typedefs | |
| typedef struct __TEES_ContiguousMemoryHandle * | TEES_ContiguousMemoryHandle |
Enumerations | |
| enum | TEES_ContiguousAllocateFlags { TEES_CONTIGUOUS_FLAG_ZERO_ON_FREE = (1U << 0), TEES_CONTIGUOUS_FLAG_ZERO_ON_ALLOC = (1U << 1) } |
| Determines the desired allocated memory handle properties. More... | |
| enum | TEES_ContiguousMapFlags { TEES_CONTIGUOUS_MAP_READ = (1U << 0), TEES_CONTIGUOUS_MAP_WRITE = (1U << 1), TEES_CONTIGUOUS_MAP_NON_CACHEABLE = (1U << 2), TEES_CONTIGUOUS_MAP_FIXED = (1U << 3), TEES_CONTIGUOUS_MAP_POPULATE = (1U << 4) } |
| Determines the desired mapping properties. More... | |
Functions | |
| TEE_Result | TEES_AllocateContiguousMemory (const char *region, size_t size, size_t align, uint32_t flags, TEES_ContiguousMemoryHandle *memory) |
| Allocates physically contiguous memory buffer handle of the specified region type. More... | |
| void | TEES_ReleaseContiguousMemory (TEES_ContiguousMemoryHandle memory) |
| Releases physically contiguous memory buffer that was previously allocated by TEES_AllocateContiguousMemory. More... | |
| TEE_Result | TEES_MapContiguousMemory (TEES_ContiguousMemoryHandle memory, void **addr, uint32_t flags) |
| Maps physically contiguous memory buffer previously allocated by TEES_AllocateContiguousMemory into the address space of current process. More... | |
| void | TEES_UnmapContiguousMemory (void *addr) |
| Unmaps physically contiguous memory buffer that was previously mapped by TEES_MapContiguousMemory. More... | |
| TEE_Result | TEES_GetContiguousMemoryPhysaddr (TEES_ContiguousMemoryHandle memory, uint64_t *physaddr) |
| Retrieves physical address of physically contiguous memory buffer that was previously allocated by TEES_AllocateContiguousMemory. More... | |
Provides set of functions to manipulate secure contiguous memory allocator.
#include <scma.h>
SCMA handle abstraction
#include <scma.h>
Determines the desired allocated memory handle properties.
| Enumerator | |
|---|---|
| TEES_CONTIGUOUS_FLAG_ZERO_ON_FREE |
Allocated memory will be zeroed on free. |
| TEES_CONTIGUOUS_FLAG_ZERO_ON_ALLOC |
Allocated memory will be zeroed on allocate. |
#include <scma.h>
Determines the desired mapping properties.
| TEE_Result TEES_AllocateContiguousMemory | ( | const char * | region, |
| size_t | size, | ||
| size_t | align, | ||
| uint32_t | flags, | ||
| TEES_ContiguousMemoryHandle * | memory | ||
| ) |
#include <scma.h>
Allocates physically contiguous memory buffer handle of the specified region type.
| [in] | region | A pointer to the zero-terminated string containing region type name of the contiguous memory region to allocate buffer from. |
| [in] | size | The size in bytes of the buffer to be allocated. |
| [in] | align | The minimal alignment requirement of starting address and size in bytes. Must be the power of 2. |
| [in] | flags | Determines the desired allocated memory handle properties. Containing zero or more bitwise ORed flags from the following list: TEES_CONTIGUOUS_FLAG_ZERO_ON_FREE: allocated memory will be zeroed on free. TEES_CONTIGUOUS_FLAG_ZERO_ON_ALLOC: allocated memory will be zeroed on allocate. |
| [out] | memory | Filled with a handle on the allocated memory. |
| TEE_SUCCESS | in case of success |
| TEE_ERROR_ACCESS_DENIED | If this API is prohibited for use by current TA. |
| TEE_ERROR_ITEM_NOT_FOUND | If the region is not found or access to that region is denied for this TA. |
| TEE_ERROR_OUT_OF_MEMORY | If there are not enough contiguous memory of the requested region type. |
| TEE_ERROR_ACCESS_CONFLICT | If requested flags are incompatible with flags specified in region configuration. |
| TEE_ERROR_BAD_PARAMETERS | If requested size is not Page-aligned, if align is not power of 2 or if called with unknown flags. |
Example:
| TEE_Result TEES_GetContiguousMemoryPhysaddr | ( | TEES_ContiguousMemoryHandle | memory, |
| uint64_t * | physaddr | ||
| ) |
#include <scma.h>
Retrieves physical address of physically contiguous memory buffer that was previously allocated by TEES_AllocateContiguousMemory.
| [in] | memory | A handle on the previously allocated memory. |
| [out] | physaddr | Filled with the physical address of the allocated memory assigned to handle. |
| TEE_SUCCESS | in case of success |
| TEE_ERROR_ACCESS_DENIED | If this API is prohibited for use by current TA. |
Example:
| TEE_Result TEES_MapContiguousMemory | ( | TEES_ContiguousMemoryHandle | memory, |
| void ** | addr, | ||
| uint32_t | flags | ||
| ) |
#include <scma.h>
Maps physically contiguous memory buffer previously allocated by TEES_AllocateContiguousMemory into the address space of current process.
| [in] | memory | A handle on the previously allocated memory. |
| [in,out] | addr | On input filled with a hint address at which memory is to be mapped. If filled by NULL address is chosen automatically. If function success on output contains address of the mapped area. |
| [in] | flags | Determines the desired mapping properties. Containing at least TEES_CONTIGUOUS_MAP_READ or TEES_CONTIGUOUS_MAP_WRITE and the bitwise OR of zero or more of the following flags: TEES_CONTIGUOUS_MAP_NON_CACHEABLE: map memory as non-cacheable. TEES_CONTIGUOUS_MAP_READ: map memory with read permission. TEES_CONTIGUOUS_MAP_WRITE: map memory with write permission. TEES_CONTIGUOUS_MAP_FIXED: Don't interpret addr as a hint: place the mapping at exactly that address. addr must be a multiple of alignment (maximum of alignment specified in region properties and allocate function). If addr is not aligned or addr + size (specifiead on alloc) overlaps existing mapping function fails. If this flag is passed and addr is NULL function fails. TEES_CONTIGUOUS_MAP_POPULATE: do not use lazy mapping. |
| TEE_SUCCESS | in case of success |
| TEE_ERROR_OUT_OF_MEMORY | If there are not enough virtual memory to make mapping or it can't be mapped at fixed hint. |
| TEE_ERROR_ACCESS_CONFLICT | If requested flags are incompatible with flags specified in region configuration or during alloc. |
| TEE_ERROR_BAD_PARAMETERS | If requested flags don’t have TEES_CONTIGUOUS_MAP_READ or TEES_CONTIGUOUS_MAP_WRITE or contains unknown bits set. |
Example:
| void TEES_ReleaseContiguousMemory | ( | TEES_ContiguousMemoryHandle | memory | ) |
#include <scma.h>
Releases physically contiguous memory buffer that was previously allocated by TEES_AllocateContiguousMemory.
| [in] | memory | Handle of the allocated memory to release. |
Example:
| void TEES_UnmapContiguousMemory | ( | void * | addr | ) |
#include <scma.h>
Unmaps physically contiguous memory buffer that was previously mapped by TEES_MapContiguousMemory.
| [in] | addr | Address at which contiguous memory buffer was mapped. |
Example: