![]() |
Samsung Internal API reference
2.0
|
Data Structures | |
| struct | TEES_ClientCredentials |
| Client credentials structure. Used by TEES_GetClientCredentials(). More... | |
Functions | |
| int | TEES_GetTaskDataSize (size_t *data_size) |
| Get used size of data memory of the current Trusted Application instance. More... | |
| void * | TEES_DupIwshmem (void *address, uint32_t size) |
| Make long-life duplicate of an Interworld Shared memory buffer. More... | |
| TEE_Result | TEES_IsREESharedMemory (uint32_t accessFlags, const void *buffer, size_t size) |
| Check is buffer shared with REE. More... | |
| TEE_Result | TEES_GetClientCredentials (struct TEES_ClientCredentials *credentials) |
| Get client credentials (pid, gid, uid) More... | |
Provides set of miscellaneous Samsung's extension of TEE Internal API.
| struct TEES_ClientCredentials |
Client credentials structure. Used by TEES_GetClientCredentials().
| Data Fields | ||
|---|---|---|
| int | gid |
Group ID of client caller |
| int | pid |
Process ID of client |
| int | uid |
User ID of client caller |
| void* TEES_DupIwshmem | ( | void * | address, |
| uint32_t | size | ||
| ) |
#include <tees_extension.h>
Make long-life duplicate of an Interworld Shared memory buffer.
The TEES_DupIwshmem will make a copy of Interworld Shared memory buffer, that was passed in TEE_Param[] on TA entry. This copy became accessible by current Trusted Application instance during current and all the following TA entries, even if the buffer is not passed in TEE_Param[] anymore or TA entry have no TEE_Param argument at all. If buffer became not needed, TA may release it by calling munmap().
| [in] | address | Interworld Shared memory buffer. |
| [in] | size | Buffer size. |
| TEE_Result TEES_GetClientCredentials | ( | struct TEES_ClientCredentials * | credentials | ) |
#include <tees_extension.h>
Get client credentials (pid, gid, uid)
TEES_GetClientCredentials fills struct pointed to by a parameter credentials with client's credentials. The client can be a CA employing TEE Client API or TA using Internal Client API. For full list of values see definition of struct TEES_ClientCredentials.
| [out] | credentials | Structure to fill with values of client credentials |
| TEE_SUCCESS | On success. |
| TEE_ERROR_BAD_PARAMETERS | When called with credentials == NULL. |
| TEE_RESULT_NOT_READY | If called when client session does not exist, i.e. in TA_CreateEntryPoint() or TA_DestroyEntryPoint(). |
Example:
| int TEES_GetTaskDataSize | ( | size_t * | data_size | ) |
#include <tees_extension.h>
Get used size of data memory of the current Trusted Application instance.
| [out] | data_size | Output data memory size. |
| 0 | On success. |
| -1 | On error. In this case errno is set with appropriate error code. |
| TEE_Result TEES_IsREESharedMemory | ( | uint32_t | accessFlags, |
| const void * | buffer, | ||
| size_t | size | ||
| ) |
#include <tees_extension.h>
Check is buffer shared with REE.
The TEES_IsREESharedMemory examines memory buffer passed in a parameters buffer and size to determine whether Trusted Application instance can access buffer accordingly to requested accessFlags and buffer can be accessed by REE. If the characteristics of the buffer are compatible with accessFlags and REE can access this buffer, then the function returns TEE_SUCCESS. Otherwise, it returns TEE_ERROR_ACCESS_DENIED. Function should be used only to determine whether buffer shared. To determine whether buffer accessible exclusively by Trusted Application (not shared) use the TEE_CheckMemoryAccessRights.
The parameter accessFlags can contain one or more of the following flags:
This function MUST NOT panic for any reason.
| [in] | accessFlags | The access flags to check. |
| [in] | buffer | Pointer of the buffer to check. |
| [in] | size | Size of the buffer to check. |
| TEE_SUCCESS | If the entire buffer allows the requested accesses. |
| TEE_ERROR_ACCESS_DENIED | If at least one byte in the buffer is not accessible with the requested accesses or REE may not access this buffer. |
| TEE_ERROR_BAD_PARAMETERS | If passed zero or unknown accessFlags. |