Samsung Internal API reference  2.0
Teesl_smc

Macros

#define U(n)   ((unsigned int)(n))
 Defined for compatibility now.
 

Typedefs

typedef int TEES_SMCHandle
 SMC interface handle.
 
typedef struct smc_data TEES_SMCData
 SMC command data.
 

Functions

TEE_Result TEES_SMCInit (TEES_SMCHandle *handle)
 Initialize handler fields. More...
 
TEE_Result TEES_SMCFini (TEES_SMCHandle handle)
 release SMC interface handle. More...
 
TEE_Result TEES_SMCCommand (TEES_SMCHandle handle, TEES_SMCData *data)
 Send SMC command to EL3. More...
 

Detailed Description

Function Documentation

TEE_Result TEES_SMCCommand ( TEES_SMCHandle  handle,
TEES_SMCData data 
)

#include <tee_smc.h>

Send SMC command to EL3.

Parameters
[in]handleSMC handle which contains device descriptor.
[in,out]dataSMC command data.
Return values
TEE_SUCCESSon success, error code otherwise.

Example:

TEES_SMCData data = {
.arg_types = SMC_ARG_TYPES(SMC_ARG_TYPE_VALUE,
SMC_ARG_TYPE_VALUE,
0, 0, 0, 0, 0);
.args.arg[0] = CREATE_SMC_CMD(SMC_TYPE_FAST, // SMC command code
SMC_AARCH_32,
SMC_SIP_SERVICE_MASK,
0x42),
.args.arg[1] = 5000000, // some SMC argument
};
TEE_Result res = TEES_SMCInit(&handle);
if (res != TEE_SUCCESS) {
printf("TEST: Failed to initalize SMC, tee_err: %#x\n", res);
return res;
}
res = TEES_SMCCommand(handle, &data);
if (res != TEE_SUCCESS) {
printf("TEST: Failed to call SMC, tee_err: %#x\n", res);
TEES_SMCFini(handle);
return res;
}
TEES_SMCFini(handle);
TEE_Result TEES_SMCFini ( TEES_SMCHandle  handle)

#include <tee_smc.h>

release SMC interface handle.

Parameters
[in]handleSMC handle which contains device descriptor.
Return values
TEE_SUCCESSon success, error code otherwise.
TEE_Result TEES_SMCInit ( TEES_SMCHandle handle)

#include <tee_smc.h>

Initialize handler fields.

Parameters
[out]handlePointer to SMC handle which contains device descriptor.
Return values
TEE_SUCCESSon success, error code otherwise.