lib: optee_client: add optee initialize flag
Add optee initialize flag to reduce redundant calling. Signed-off-by: Elon Zhang <zhangzj@rock-chips.com> Change-Id: Ib3e883c48d5c85c446f3e9e991cd4cfcd1cede90
This commit is contained in:
parent
74eb602743
commit
7a349fdcbd
|
|
@ -17,6 +17,8 @@
|
||||||
#define OPTEE_MSG_REVISION_MAJOR 2
|
#define OPTEE_MSG_REVISION_MAJOR 2
|
||||||
#define OPTEE_MSG_REVISION_MINOR 0
|
#define OPTEE_MSG_REVISION_MINOR 0
|
||||||
|
|
||||||
|
static bool optee_is_init;
|
||||||
|
|
||||||
static bool optee_api_revision_is_compatible(void)
|
static bool optee_api_revision_is_compatible(void)
|
||||||
{
|
{
|
||||||
ARM_SMC_ARGS ArmSmcArgs = {0};
|
ARM_SMC_ARGS ArmSmcArgs = {0};
|
||||||
|
|
@ -44,6 +46,9 @@ TEEC_Result OpteeClientApiLibInitialize(void)
|
||||||
{
|
{
|
||||||
TEEC_Result status = TEEC_SUCCESS;
|
TEEC_Result status = TEEC_SUCCESS;
|
||||||
|
|
||||||
|
if (optee_is_init)
|
||||||
|
return TEEC_SUCCESS;
|
||||||
|
|
||||||
/* check api revision compatibility */
|
/* check api revision compatibility */
|
||||||
if (!optee_api_revision_is_compatible())
|
if (!optee_api_revision_is_compatible())
|
||||||
panic("optee api revision is too low");
|
panic("optee api revision is too low");
|
||||||
|
|
@ -59,6 +64,8 @@ TEEC_Result OpteeClientApiLibInitialize(void)
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
optee_is_init = true;
|
||||||
|
|
||||||
return TEEC_SUCCESS;
|
return TEEC_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue