lib: optee_client: add module name in print func
Change-Id: I6cdcb0870bf5a3915009421e5c8b09584ac2bb6c Signed-off-by: Hisping Lin <hisping.lin@rock-chips.com>
This commit is contained in:
parent
4f2523c3a0
commit
efb93541fe
|
|
@ -19,12 +19,12 @@ TEEC_Result OpteeClientApiLibInitialize(void)
|
|||
|
||||
status = OpteeClientMemInit();
|
||||
if (status != TEEC_SUCCESS) {
|
||||
printf("OpteeClientMemInit fail!");
|
||||
printf("TEEC: OpteeClientMemInit fail!\n");
|
||||
return status;
|
||||
}
|
||||
status = OpteeClientRkFsInit();
|
||||
if (status != TEEC_SUCCESS) {
|
||||
printf("OpteeClientRkFsInit fail!");
|
||||
printf("TEEC: OpteeClientRkFsInit fail!\n");
|
||||
return status;
|
||||
}
|
||||
|
||||
|
|
@ -61,7 +61,7 @@ TEEC_Result TEEC_InitializeContext(const char *name,
|
|||
memset(context, 0, sizeof(*context));
|
||||
|
||||
exit:
|
||||
debug("TEEC_InitializeContext Exit : teecresult=0x%X\n\n", teecresult);
|
||||
debug("TEEC_InitializeContext Exit : teecresult=0x%X\n", teecresult);
|
||||
return teecresult;
|
||||
}
|
||||
|
||||
|
|
@ -243,7 +243,7 @@ Exit:
|
|||
if (error_origin != NULL)
|
||||
*error_origin = TeecErrorOrigin;
|
||||
|
||||
debug("TEEC_OpenSession Exit : TeecResult=0x%X, TeecErrorOrigin=0x%X\n\n",
|
||||
debug("TEEC_OpenSession Exit : TeecResult=0x%X, TeecErrorOrigin=0x%X\n",
|
||||
TeecResult, TeecErrorOrigin);
|
||||
return TeecResult;
|
||||
}
|
||||
|
|
@ -265,7 +265,7 @@ void TEEC_CloseSession(TEEC_Session *session)
|
|||
TeecResult = TEEC_SMC_CloseSession(session, &TeecErrorOrigin);
|
||||
|
||||
Exit:
|
||||
debug("TEEC_CloseSession Exit : TeecResult=0x%X, TeecErrorOrigin=0x%X\n\n",
|
||||
debug("TEEC_CloseSession Exit : TeecResult=0x%X, TeecErrorOrigin=0x%X\n",
|
||||
TeecResult, TeecErrorOrigin);
|
||||
return;
|
||||
}
|
||||
|
|
@ -304,7 +304,7 @@ Exit:
|
|||
if (error_origin != NULL)
|
||||
*error_origin = TeecErrorOrigin;
|
||||
|
||||
debug("TEEC_InvokeCommand Exit : TeecResult=0x%X, TeecErrorOrigin=0x%X\n\n",
|
||||
debug("TEEC_InvokeCommand Exit : TeecResult=0x%X, TeecErrorOrigin=0x%X\n",
|
||||
TeecResult, TeecErrorOrigin);
|
||||
|
||||
return TeecResult;
|
||||
|
|
|
|||
|
|
@ -1054,7 +1054,6 @@ exit:
|
|||
TEEC_ReleaseSharedMemory(&SharedMem1);
|
||||
TEEC_CloseSession(&TeecSession);
|
||||
TEEC_FinalizeContext(&TeecContext);
|
||||
debug("testmm end\n");
|
||||
|
||||
return TeecResult;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ ALLOC_FLAG alloc_flags[50];
|
|||
int my_malloc_init(void *start, uint32_t size)
|
||||
{
|
||||
if (start == NULL || size == 0) {
|
||||
printf("malloc init fail!");
|
||||
printf("TEEC: malloc init fail!\n");
|
||||
return -1;
|
||||
}
|
||||
memset(start, 0, size);
|
||||
|
|
@ -34,7 +34,7 @@ int my_malloc_init(void *start, uint32_t size)
|
|||
if (my_flag == NULL) {
|
||||
my_flag = malloc(size/4096);
|
||||
if (my_flag == NULL) {
|
||||
printf("malloc fail!");
|
||||
printf("TEEC: malloc fail!\n");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
|
@ -100,7 +100,7 @@ void *my_malloc(uint32_t size)
|
|||
memset(my_mem_start +
|
||||
(i + k) * 4096, 0, 4096);
|
||||
}
|
||||
debug(" malloc is: 0x%X 0x%X\n",
|
||||
debug("TEEC: malloc is: 0x%X 0x%X\n",
|
||||
(int)i, (int)num);
|
||||
write_usedblock((my_mem_start + i * 4096),
|
||||
num * 4096);
|
||||
|
|
@ -127,7 +127,7 @@ void my_free(void *ptr)
|
|||
return;
|
||||
|
||||
num = (size-1)/4096+1;
|
||||
debug(" free is: 0x%X 0x%X\n", i, num);
|
||||
debug("TEEC: free is: 0x%X 0x%X\n", i, num);
|
||||
|
||||
for (j = 0; j < num; j++) {
|
||||
*(my_flag + i + j) = 0;
|
||||
|
|
@ -152,7 +152,7 @@ int OpteeClientMemInit(void)
|
|||
|
||||
tee_smc_call(&ArmSmcArgs);
|
||||
|
||||
debug("get share memory, arg0=0x%x arg1=0x%x arg2=0x%x arg3=0x%x\n",
|
||||
debug("TEEC: get share memory, arg0=0x%x arg1=0x%x arg2=0x%x arg3=0x%x\n",
|
||||
ArmSmcArgs.Arg0, ArmSmcArgs.Arg1, ArmSmcArgs.Arg2, ArmSmcArgs.Arg3);
|
||||
|
||||
return my_malloc_init((void *)(size_t)ArmSmcArgs.Arg1, ArmSmcArgs.Arg2);
|
||||
|
|
|
|||
|
|
@ -130,9 +130,9 @@ TEEC_Result OpteeRpcCmdLoadTa(t_teesmc32_arg *TeeSmc32Arg)
|
|||
|
||||
memcpy((void *)AllocAddress, ImageData, ImageSize);
|
||||
|
||||
debug("...TA loaded at 0x%zu of size 0x%X bytes\n",
|
||||
debug("TEEC: ...TA loaded at 0x%zu of size 0x%X bytes\n",
|
||||
AllocAddress, ImageSize);
|
||||
debug("...AllocAddress[0] 0x%X ; AllocAddress[1] 0x%X bytes\n",
|
||||
debug("TEEC: ...AllocAddress[0] 0x%X ; AllocAddress[1] 0x%X bytes\n",
|
||||
*(char *)AllocAddress, *(char *)(AllocAddress+1));
|
||||
|
||||
TeeLoadTaCmd->va = AllocAddress;
|
||||
|
|
@ -144,7 +144,7 @@ Exit:
|
|||
TeeSmc32Arg->ret = TeecResult;
|
||||
TeeSmc32Arg->ret_origin = TEEC_ORIGIN_API;
|
||||
|
||||
debug("OpteeRpcCmdLoadTa Exit : TeecResult=0x%X\n", TeecResult);
|
||||
debug("TEEC: OpteeRpcCmdLoadTa Exit : TeecResult=0x%X\n", TeecResult);
|
||||
|
||||
return TeecResult;
|
||||
}
|
||||
|
|
@ -166,15 +166,15 @@ TEEC_Result OpteeRpcCmdLoadV2Ta(t_teesmc32_arg *TeeSmc32Arg)
|
|||
|
||||
memcpy(uuid, (void *)&TeeSmc32Param[0].u.value, 16);
|
||||
for (i = 0; i < 16; i++)
|
||||
debug("uuid 0x%x", uuid[i]);
|
||||
debug("TEEC: uuid 0x%x", uuid[i]);
|
||||
|
||||
if (TeeSmc32Param[1].u.memref.buf_ptr == 0) {
|
||||
debug("return size of TA, keymaster_size = 0\n");
|
||||
debug("TEEC: return size of TA, keymaster_size = 0\n");
|
||||
TeeSmc32Param[1].u.memref.size = 0;
|
||||
} else {
|
||||
/*memcpy((void *)(size_t)TeeSmc32Param[1].u.memref.buf_ptr,
|
||||
(void *)keymaster_data, TeeSmc32Param[1].u.memref.size);*/
|
||||
debug("memref.buf_ptr = 0x%llx; memref.size = 0x%llx\n",
|
||||
debug("TEEC: memref.buf_ptr = 0x%llx; memref.size = 0x%llx\n",
|
||||
TeeSmc32Param[1].u.memref.buf_ptr,
|
||||
TeeSmc32Param[1].u.memref.size);
|
||||
}
|
||||
|
|
@ -183,7 +183,7 @@ Exit:
|
|||
TeeSmc32Arg->ret = TeecResult;
|
||||
TeeSmc32Arg->ret_origin = TEEC_ORIGIN_API;
|
||||
|
||||
debug("OpteeRpcCmdLoadTa Exit : TeecResult=0x%X\n", TeecResult);
|
||||
debug("TEEC: OpteeRpcCmdLoadTa Exit : TeecResult=0x%X\n", TeecResult);
|
||||
|
||||
return TeecResult;
|
||||
}
|
||||
|
|
@ -214,7 +214,7 @@ TEEC_Result OpteeRpcCmdFreeTa(t_teesmc32_arg *TeeSmc32Arg)
|
|||
AllocAddress = TeeSmc32Param[0].u.memref.buf_ptr;
|
||||
ImageSize = TeeSmc32Param[0].u.memref.size;
|
||||
|
||||
debug("OpteeRpcCmdFreeTa Enter: AllocAddress=0x%X, ImageSize=0x%X\n",
|
||||
debug("TEEC: OpteeRpcCmdFreeTa Enter: AllocAddress=0x%X, ImageSize=0x%X\n",
|
||||
(uint32_t) AllocAddress, (uint32_t) ImageSize);
|
||||
|
||||
if (AllocAddress == 0) {
|
||||
|
|
@ -228,7 +228,7 @@ Exit:
|
|||
TeeSmc32Arg->ret = TeecResult;
|
||||
TeeSmc32Arg->ret_origin = TEEC_ORIGIN_API;
|
||||
|
||||
debug("OpteeRpcCmdFreeTa Exit : TeecResult=0x%X\n", TeecResult);
|
||||
debug("TEEC: OpteeRpcCmdFreeTa Exit : TeecResult=0x%X\n", TeecResult);
|
||||
|
||||
return TeecResult;
|
||||
}
|
||||
|
|
@ -253,7 +253,7 @@ TEEC_Result OpteeRpcCmdRpmb(t_teesmc32_arg *TeeSmc32Arg)
|
|||
t_teesmc32_param *TeeSmc32Param;
|
||||
struct mmc *mmc;
|
||||
|
||||
debug("Entered RPMB RPC\n");
|
||||
debug("TEEC: Entered RPMB RPC\n");
|
||||
|
||||
if (TeeSmc32Arg->num_params != 2) {
|
||||
TeecResult = TEEC_ERROR_BAD_PARAMETERS;
|
||||
|
|
@ -308,7 +308,7 @@ TEEC_Result OpteeRpcCmdRpmb(t_teesmc32_arg *TeeSmc32Arg)
|
|||
RequestMsgType = RPMB_PACKET_DATA_TO_UINT16(
|
||||
RequestPackets->msg_type);
|
||||
|
||||
debug("RPMB Data request %d\n", RequestMsgType);
|
||||
debug("TEEC: RPMB Data request %d\n", RequestMsgType);
|
||||
|
||||
switch (RequestMsgType) {
|
||||
case TEE_RPC_RPMB_MSG_TYPE_REQ_AUTH_KEY_PROGRAM: {
|
||||
|
|
@ -403,7 +403,7 @@ TEEC_Result OpteeRpcCmdRpmb(t_teesmc32_arg *TeeSmc32Arg)
|
|||
TeecResult = TEEC_ERROR_BAD_PARAMETERS;
|
||||
break;
|
||||
}
|
||||
debug("RPMB TeecResult %d\n", TeecResult);
|
||||
debug("TEEC: RPMB TeecResult %d\n", TeecResult);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -505,7 +505,7 @@ TEEC_Result OpteeRpcCmdFs(t_teesmc32_arg *TeeSmc32Arg)
|
|||
t_teesmc32_param *TeeSmc32Param;
|
||||
|
||||
if (check_security_exist(0) < 0) {
|
||||
printf("security partition not exist! unable to use RK FS!\n");
|
||||
printf("TEEC: security partition not exist! unable to use RK FS!\n");
|
||||
return TEEC_ERROR_GENERIC;
|
||||
}
|
||||
|
||||
|
|
@ -554,7 +554,7 @@ TEEC_Result OpteeRpcCallback(ARM_SMC_ARGS *ArmSmcArgs)
|
|||
TeecResult = OpteeRpcAlloc(ArmSmcArgs->Arg1, &ArmSmcArgs->Arg1);
|
||||
#endif
|
||||
#ifdef CONFIG_OPTEE_V2
|
||||
debug("ArmSmcArgs->Arg1 = 0x%x \n", ArmSmcArgs->Arg1);
|
||||
debug("TEEC: ArmSmcArgs->Arg1 = 0x%x \n", ArmSmcArgs->Arg1);
|
||||
TeecResult = OpteeRpcAlloc(ArmSmcArgs->Arg1, &ArmSmcArgs->Arg2);
|
||||
ArmSmcArgs->Arg5 = ArmSmcArgs->Arg2;
|
||||
ArmSmcArgs->Arg1 = 0;
|
||||
|
|
@ -595,7 +595,7 @@ TEEC_Result OpteeRpcCallback(ARM_SMC_ARGS *ArmSmcArgs)
|
|||
#ifdef CONFIG_OPTEE_V2
|
||||
t_teesmc32_arg *TeeSmc32Arg =
|
||||
(t_teesmc32_arg *)(size_t)((uint64_t)ArmSmcArgs->Arg1 << 32 | ArmSmcArgs->Arg2);
|
||||
debug("TeeSmc32Arg->cmd = 0x%x\n", TeeSmc32Arg->cmd);
|
||||
debug("TEEC: TeeSmc32Arg->cmd = 0x%x\n", TeeSmc32Arg->cmd);
|
||||
#endif
|
||||
switch (TeeSmc32Arg->cmd) {
|
||||
#ifdef CONFIG_OPTEE_V1
|
||||
|
|
@ -635,7 +635,7 @@ TEEC_Result OpteeRpcCallback(ARM_SMC_ARGS *ArmSmcArgs)
|
|||
uint32_t tempaddr;
|
||||
uint32_t allocsize = TeeSmc32Arg->params[0].u.value.b;
|
||||
TeecResult = OpteeRpcAlloc(allocsize, &tempaddr);
|
||||
debug("allocsize = 0x%x tempaddr = 0x%x\n", allocsize, tempaddr);
|
||||
debug("TEEC: allocsize = 0x%x tempaddr = 0x%x\n", allocsize, tempaddr);
|
||||
TeeSmc32Arg->params[0].attr = OPTEE_MSG_ATTR_TYPE_TMEM_OUTPUT_V2;
|
||||
TeeSmc32Arg->params[0].u.memref.buf_ptr = tempaddr;
|
||||
TeeSmc32Arg->params[0].u.memref.size = allocsize;
|
||||
|
|
@ -665,7 +665,7 @@ TEEC_Result OpteeRpcCallback(ARM_SMC_ARGS *ArmSmcArgs)
|
|||
#endif
|
||||
|
||||
default: {
|
||||
printf("...unsupported RPC CMD: cmd=0x%X\n",
|
||||
printf("TEEC: ...unsupported RPC CMD: cmd=0x%X\n",
|
||||
TeeSmc32Arg->cmd);
|
||||
TeecResult = TEEC_ERROR_NOT_IMPLEMENTED;
|
||||
break;
|
||||
|
|
@ -687,14 +687,14 @@ TEEC_Result OpteeRpcCallback(ARM_SMC_ARGS *ArmSmcArgs)
|
|||
}
|
||||
|
||||
default: {
|
||||
printf("...unsupported RPC : Arg0=0x%X\n", ArmSmcArgs->Arg0);
|
||||
printf("TEEC: ...unsupported RPC : Arg0=0x%X\n", ArmSmcArgs->Arg0);
|
||||
TeecResult = TEEC_ERROR_NOT_IMPLEMENTED;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
ArmSmcArgs->Arg0 = TEESMC32_CALL_RETURN_FROM_RPC;
|
||||
debug("OpteeRpcCallback Exit : TeecResult=0x%X\n", TeecResult);
|
||||
debug("TEEC: OpteeRpcCallback Exit : TeecResult=0x%X\n", TeecResult);
|
||||
|
||||
return TeecResult;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -180,7 +180,7 @@ int check_security_exist(int print_flag)
|
|||
if (!dev_desc) {
|
||||
dev_desc = rockchip_get_bootdev();
|
||||
if (!dev_desc) {
|
||||
printf("%s: Could not find device\n", __func__);
|
||||
printf("TEEC: %s: Could not find device\n", __func__);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
@ -188,7 +188,7 @@ int check_security_exist(int print_flag)
|
|||
"security", &part_info) < 0) {
|
||||
dev_desc = NULL;
|
||||
if (print_flag != 0)
|
||||
printf("Could not find security partition\n");
|
||||
printf("TEEC: Could not find security partition\n");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
|
@ -221,7 +221,7 @@ static int rkss_begin_commit(void)
|
|||
if (check_security_exist(1) < 0)
|
||||
return -1;
|
||||
|
||||
debug("%s\n", __func__);
|
||||
debug("TEEC: %s\n", __func__);
|
||||
p.backup_version = RKSS_BACKUP_VERSION;
|
||||
p.backup_enable = RKSS_BACKUP_ENABLE;
|
||||
p.backup_count = 0;
|
||||
|
|
@ -231,7 +231,7 @@ static int rkss_begin_commit(void)
|
|||
|
||||
ret = blk_dwrite(dev_desc, RKSS_BACKUP_INDEX, 1, data);
|
||||
if (ret != 1) {
|
||||
printf("blk_dwrite fail\n");
|
||||
printf("TEEC: blk_dwrite fail\n");
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
|
|
@ -245,12 +245,12 @@ static int rkss_finish_commit(void)
|
|||
if (check_security_exist(1) < 0)
|
||||
return -1;
|
||||
|
||||
debug("%s\n", __func__);
|
||||
debug("TEEC: %s\n", __func__);
|
||||
memset(data, 0, sizeof(data));
|
||||
|
||||
ret = blk_dwrite(dev_desc, RKSS_BACKUP_INDEX, 1, data);
|
||||
if (ret != 1) {
|
||||
printf("blk_dwrite fail\n");
|
||||
printf("TEEC: blk_dwrite fail\n");
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
|
|
@ -269,7 +269,7 @@ static int rkss_backup_sections(unsigned long index, unsigned int num)
|
|||
|
||||
ret = blk_dread(dev_desc, RKSS_BACKUP_INDEX, 1, data);
|
||||
if (ret != 1) {
|
||||
printf("blk_dread fail\n");
|
||||
printf("TEEC: blk_dread fail\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
@ -294,28 +294,28 @@ static int rkss_backup_sections(unsigned long index, unsigned int num)
|
|||
}
|
||||
if ((info_current.backup_data_index + info_current.backup_num) >
|
||||
(RKSS_BACKUP_INDEX + RKSS_BACKUP_COUNT)) {
|
||||
printf("Not enough backup sections!");
|
||||
printf("TEEC: Not enough backup sections!\n");
|
||||
goto error;
|
||||
}
|
||||
debug("%s index=0x%lx num=0x%x backup_data_index=0x%x\n",
|
||||
debug("TEEC: %s index=0x%lx num=0x%x backup_data_index=0x%x\n",
|
||||
__func__, index, num, info_current.backup_data_index);
|
||||
|
||||
backup_data = malloc(num * RKSS_DATA_LEN);
|
||||
if (!backup_data) {
|
||||
printf("malloc backup_data fail\n");
|
||||
printf("TEEC: malloc backup_data fail\n");
|
||||
goto error;
|
||||
}
|
||||
|
||||
ret = blk_dread(dev_desc, index, num, backup_data);
|
||||
if (ret != num) {
|
||||
printf("blk_dread fail\n");
|
||||
printf("TEEC: blk_dread fail\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
ret = blk_dwrite(dev_desc, info_current.backup_data_index,
|
||||
num, backup_data);
|
||||
if (ret != num) {
|
||||
printf("blk_dwrite fail\n");
|
||||
printf("TEEC: blk_dwrite fail\n");
|
||||
return -1;
|
||||
}
|
||||
free(backup_data);
|
||||
|
|
@ -330,7 +330,7 @@ static int rkss_backup_sections(unsigned long index, unsigned int num)
|
|||
|
||||
ret = blk_dwrite(dev_desc, RKSS_BACKUP_INDEX, 1, data);
|
||||
if (ret != 1) {
|
||||
printf("blk_dwrite fail\n");
|
||||
printf("TEEC: blk_dwrite fail\n");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
|
@ -356,7 +356,7 @@ static int rkss_resume(void)
|
|||
|
||||
ret = blk_dread(dev_desc, RKSS_BACKUP_INDEX, 1, data);
|
||||
if (ret != 1) {
|
||||
printf("blk_dread fail\n");
|
||||
printf("TEEC: blk_dread fail\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
@ -369,7 +369,7 @@ static int rkss_resume(void)
|
|||
|
||||
if (info_current.backup_usedflag ==
|
||||
RKSS_BACKUP_USEDFLAG) {
|
||||
debug("rkss_resume backup_index=0x%x \
|
||||
debug("TEEC: rkss_resume backup_index=0x%x \
|
||||
backup_num=0x%x \
|
||||
info_current.backup_data_index=0x%x\n",
|
||||
info_current.backup_index,
|
||||
|
|
@ -378,19 +378,19 @@ static int rkss_resume(void)
|
|||
if ((info_current.backup_data_index +
|
||||
info_current.backup_num) >
|
||||
(RKSS_BACKUP_INDEX + RKSS_BACKUP_COUNT)) {
|
||||
printf("backup sections error!");
|
||||
printf("TEEC: backup sections error!");
|
||||
goto error;
|
||||
}
|
||||
if ((info_current.backup_index +
|
||||
info_current.backup_num) >
|
||||
RKSS_DATA_SECTION_COUNT) {
|
||||
printf("original sections error!");
|
||||
printf("TEEC: original sections error!");
|
||||
goto error;
|
||||
}
|
||||
backup_data = malloc(info_current.backup_num *
|
||||
RKSS_DATA_LEN);
|
||||
if (!backup_data) {
|
||||
printf("malloc backup_data fail\n");
|
||||
printf("TEEC: malloc backup_data fail\n");
|
||||
goto error;
|
||||
}
|
||||
|
||||
|
|
@ -399,7 +399,7 @@ static int rkss_resume(void)
|
|||
info_current.backup_num,
|
||||
backup_data);
|
||||
if (ret != info_current.backup_num) {
|
||||
printf("blk_dread fail\n");
|
||||
printf("TEEC: blk_dread fail\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
@ -408,7 +408,7 @@ static int rkss_resume(void)
|
|||
info_current.backup_num,
|
||||
backup_data);
|
||||
if (ret != info_current.backup_num) {
|
||||
printf("blk_dwrite fail\n");
|
||||
printf("TEEC: blk_dwrite fail\n");
|
||||
return -1;
|
||||
}
|
||||
free(backup_data);
|
||||
|
|
@ -419,7 +419,7 @@ static int rkss_resume(void)
|
|||
memset(data, 0, sizeof(data));
|
||||
ret = blk_dwrite(dev_desc, RKSS_BACKUP_INDEX, 1, data);
|
||||
if (ret != 1) {
|
||||
printf("blk_dwrite fail\n");
|
||||
printf("TEEC: blk_dwrite fail\n");
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
|
|
@ -438,7 +438,7 @@ static int rkss_read_multi_sections(unsigned char *data, unsigned long index, un
|
|||
|
||||
ret = blk_dread(dev_desc, part_info.start + index, num, data);
|
||||
if (ret != num) {
|
||||
printf("blk_dread fail\n");
|
||||
printf("TEEC: blk_dread fail\n");
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
|
|
@ -451,7 +451,7 @@ static int rkss_write_multi_sections(unsigned char *data, unsigned long index, u
|
|||
|
||||
result = rkss_backup_sections(index, num);
|
||||
if (result < 0) {
|
||||
printf("rkss_backup_sections fail\n");
|
||||
printf("TEEC: rkss_backup_sections fail\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
@ -460,7 +460,7 @@ static int rkss_write_multi_sections(unsigned char *data, unsigned long index, u
|
|||
|
||||
ret = blk_dwrite(dev_desc, part_info.start + index, num, data);
|
||||
if (ret != num) {
|
||||
printf("blk_dwrite fail\n");
|
||||
printf("TEEC: blk_dwrite fail\n");
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
|
|
@ -475,7 +475,7 @@ static int rkss_read_patition_tables(unsigned char *data)
|
|||
|
||||
ret = blk_dread(dev_desc, part_info.start, RKSS_PARTITION_TABLE_COUNT, data);
|
||||
if (ret != RKSS_PARTITION_TABLE_COUNT) {
|
||||
printf("blk_dread fail\n");
|
||||
printf("TEEC: blk_dread fail\n");
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
|
|
@ -504,12 +504,12 @@ static void rkss_dump_ptable(void)
|
|||
|
||||
table_data = malloc(RKSS_PARTITION_TABLE_COUNT * RKSS_DATA_LEN);
|
||||
if (table_data == NULL) {
|
||||
printf("malloc table_data fail\n");
|
||||
printf("TEEC: malloc table_data fail\n");
|
||||
return;
|
||||
}
|
||||
ret = rkss_read_patition_tables(table_data);
|
||||
if (ret < 0) {
|
||||
printf("rkss_read_patition_tables fail ! ret: %d.\n", ret);
|
||||
printf("TEEC: rkss_read_patition_tables fail ! ret: %d.\n", ret);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -539,7 +539,7 @@ static void rkss_dump_usedflags(void)
|
|||
rkss.index = RKSS_USEDFLAGS_INDEX;
|
||||
ret = rkss_read_multi_sections(rkss.data, rkss.index, 1);
|
||||
if (ret < 0) {
|
||||
printf("rkss_read_multi_sections fail ! ret: %d.\n", ret);
|
||||
printf("TEEC: rkss_read_multi_sections fail ! ret: %d.\n", ret);
|
||||
return;
|
||||
}
|
||||
rkss_dump(rkss.data, RKSS_DATA_LEN);
|
||||
|
|
@ -559,7 +559,7 @@ static int rkss_verify_ptable(unsigned char *table_data)
|
|||
|
||||
if (verify->version != RKSS_VERSION
|
||||
|| verify->checkstr != RKSS_CHECK_STR) {
|
||||
printf("verify [%d] fail, cleanning ....", i);
|
||||
printf("TEEC: verify [%d] fail, cleanning ....", i);
|
||||
memset(cp, 0, RKSS_DATA_LEN);
|
||||
verify->checkstr = RKSS_CHECK_STR;
|
||||
verify->version = RKSS_VERSION;
|
||||
|
|
@ -567,10 +567,10 @@ static int rkss_verify_ptable(unsigned char *table_data)
|
|||
}
|
||||
ret = rkss_write_multi_sections(table_data, 0, RKSS_PARTITION_TABLE_COUNT);
|
||||
if (ret < 0) {
|
||||
printf("rkss_write_multi_sections failed!!! ret: %d.\n", ret);
|
||||
printf("TEEC: rkss_write_multi_sections failed!!! ret: %d.\n", ret);
|
||||
return TEEC_ERROR_GENERIC;
|
||||
}
|
||||
debug("verify ptable success.\n");
|
||||
debug("TEEC: verify ptable success.\n");
|
||||
return TEEC_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
@ -584,7 +584,7 @@ static int rkss_verify_usedflags(struct rk_secure_storage *rkss)
|
|||
duel = *(flags + (int)i/2);
|
||||
flag = i & 0x1 ? duel & 0x0F : (duel & 0xF0) >> 4;
|
||||
if (flag != 0x1) {
|
||||
debug("init usedflags section ...\n");
|
||||
debug("TEEC: init usedflags section ...\n");
|
||||
memset(rkss->data, 0x00, RKSS_DATA_LEN);
|
||||
for (n = 0; n < RKSS_PARTITION_TABLE_COUNT + 1; n++) {
|
||||
flagw = (uint8_t *)rkss->data + (int)n/2;
|
||||
|
|
@ -594,14 +594,14 @@ static int rkss_verify_usedflags(struct rk_secure_storage *rkss)
|
|||
}
|
||||
ret = rkss_write_multi_sections(rkss->data, rkss->index, 1);
|
||||
if (ret < 0) {
|
||||
printf("clean usedflags section failed!!! ret: %d.\n", ret);
|
||||
printf("TEEC: clean usedflags section failed!!! ret: %d.\n", ret);
|
||||
return TEEC_ERROR_GENERIC;
|
||||
}
|
||||
|
||||
return TEEC_SUCCESS;
|
||||
}
|
||||
}
|
||||
debug("rkss_verify_usedflags: sucess.\n");
|
||||
debug("TEEC: rkss_verify_usedflags: sucess.\n");
|
||||
return TEEC_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
@ -617,7 +617,7 @@ static int rkss_get_fileinfo_by_index(int fd, struct rkss_file_info *pfileinfo)
|
|||
rkss.index = i;
|
||||
ret = rkss_read_multi_sections(rkss.data, rkss.index, 1);
|
||||
if (ret < 0) {
|
||||
printf("rkss_read_multi_sections fail ! ret: %d.\n", ret);
|
||||
printf("TEEC: rkss_read_multi_sections fail ! ret: %d.\n", ret);
|
||||
return TEEC_ERROR_GENERIC;
|
||||
}
|
||||
|
||||
|
|
@ -626,10 +626,10 @@ static int rkss_get_fileinfo_by_index(int fd, struct rkss_file_info *pfileinfo)
|
|||
p += n;
|
||||
|
||||
if (p->used != 1) {
|
||||
debug("error: unused section!\n");
|
||||
debug("TEEC: error: unused section!\n");
|
||||
return TEEC_ERROR_GENERIC;
|
||||
}
|
||||
debug("rkss_get_fileinfo_by_index p->used = %d p->name=%s p->index=%d p->size=%d\n",
|
||||
debug("TEEC: rkss_get_fileinfo_by_index p->used = %d p->name=%s p->index=%d p->size=%d\n",
|
||||
p->used, p->name, p->index, p->size);
|
||||
memcpy(pfileinfo, p, sizeof(struct rkss_file_info));
|
||||
|
||||
|
|
@ -655,18 +655,18 @@ static int rkss_get_fileinfo_by_name(
|
|||
|
||||
len = strlen(filename);
|
||||
if (len > RKSS_NAME_MAX_LENGTH - 1) {
|
||||
printf("filename is too long. length:%u\n", len);
|
||||
printf("TEEC: filename is too long. length:%u\n", len);
|
||||
return TEEC_ERROR_GENERIC;
|
||||
}
|
||||
|
||||
table_data = malloc(RKSS_DATA_LEN * RKSS_PARTITION_TABLE_COUNT);
|
||||
if (table_data == NULL) {
|
||||
printf("malloc table_data fail\n");
|
||||
printf("TEEC: malloc table_data fail\n");
|
||||
return TEEC_ERROR_GENERIC;
|
||||
}
|
||||
ret = rkss_read_patition_tables(table_data);
|
||||
if (ret < 0) {
|
||||
printf("rkss_read_patition_tables fail ! ret: %d.\n", ret);
|
||||
printf("TEEC: rkss_read_patition_tables fail ! ret: %d.\n", ret);
|
||||
return TEEC_ERROR_GENERIC;
|
||||
}
|
||||
|
||||
|
|
@ -684,7 +684,7 @@ static int rkss_get_fileinfo_by_name(
|
|||
|
||||
/* Full Matching*/
|
||||
if (!strcmp(p->name, filename)) {
|
||||
debug("rkss_get_fileinfo_by_name: hit table[%d/%d], index[%d/%d]\n",
|
||||
debug("TEEC: rkss_get_fileinfo_by_name: hit table[%d/%d], index[%d/%d]\n",
|
||||
i, RKSS_PARTITION_TABLE_COUNT, n, RKSS_EACH_FILEFOLDER_COUNT);
|
||||
memcpy(pfileinfo, p, sizeof(struct rkss_file_info));
|
||||
free(table_data);
|
||||
|
|
@ -713,14 +713,14 @@ static int rkss_get_fileinfo_by_name(
|
|||
|
||||
} while (cur_inpos && cur_svpos);
|
||||
|
||||
debug("Matched folder: %s\n", p->name);
|
||||
debug("TEEC: Matched folder: %s\n", p->name);
|
||||
free(table_data);
|
||||
return TEEC_ERROR_GENERIC;
|
||||
UNMATCHFOLDER:
|
||||
debug("Unmatched ...\n");
|
||||
debug("TEEC: Unmatched ...\n");
|
||||
}
|
||||
}
|
||||
debug("rkss_get_fileinfo_by_name: file or dir no found!\n");
|
||||
debug("TEEC: rkss_get_fileinfo_by_name: file or dir no found!\n");
|
||||
free(table_data);
|
||||
return TEEC_ERROR_GENERIC;
|
||||
}
|
||||
|
|
@ -738,18 +738,18 @@ static int rkss_get_dirs_by_name(char *filename)
|
|||
|
||||
len = strlen(filename);
|
||||
if (len > RKSS_NAME_MAX_LENGTH - 1) {
|
||||
printf("filename is too long. length:%u\n", len);
|
||||
printf("TEEC: filename is too long. length:%u\n", len);
|
||||
return TEEC_ERROR_GENERIC;
|
||||
}
|
||||
|
||||
table_data = malloc(RKSS_DATA_LEN * RKSS_PARTITION_TABLE_COUNT);
|
||||
if (table_data == NULL) {
|
||||
printf("malloc table_data fail\n");
|
||||
printf("TEEC: malloc table_data fail\n");
|
||||
return TEEC_ERROR_GENERIC;
|
||||
}
|
||||
ret = rkss_read_patition_tables(table_data);
|
||||
if (ret < 0) {
|
||||
printf("rkss_read_patition_tables fail ! ret: %d.\n", ret);
|
||||
printf("TEEC: rkss_read_patition_tables fail ! ret: %d.\n", ret);
|
||||
return TEEC_ERROR_GENERIC;
|
||||
}
|
||||
|
||||
|
|
@ -768,14 +768,14 @@ static int rkss_get_dirs_by_name(char *filename)
|
|||
|
||||
/* Full Matching*/
|
||||
ret = memcmp(p->name, filename, strlen(filename));
|
||||
debug("comparing [fd:%d] : %s ?= %s , ret:%d\n",
|
||||
debug("TEEC: comparing [fd:%d] : %s ?= %s , ret:%d\n",
|
||||
i*RKSS_EACH_FILEFOLDER_COUNT+n, p->name, filename, ret);
|
||||
if (!ret && strlen(p->name) > strlen(filename)) {
|
||||
chk = p->name + strlen(filename);
|
||||
if (*chk == '/') {
|
||||
file = p->name + strlen(filename) + 1;
|
||||
subdir = strtok(file, "/");
|
||||
debug("found: %s\n", subdir);
|
||||
debug("TEEC: found: %s\n", subdir);
|
||||
strcpy(dir_cache[dir_num], subdir);
|
||||
++dir_num;
|
||||
}
|
||||
|
|
@ -797,7 +797,7 @@ static int rkss_get_empty_section_from_usedflags(int section_size)
|
|||
rkss.index = RKSS_USEDFLAGS_INDEX;
|
||||
ret = rkss_read_multi_sections(rkss.data, rkss.index, 1);
|
||||
if (ret < 0) {
|
||||
printf("rkss_read_multi_sections fail ! ret: %d.\n", ret);
|
||||
printf("TEEC: rkss_read_multi_sections fail ! ret: %d.\n", ret);
|
||||
return TEEC_ERROR_GENERIC;
|
||||
}
|
||||
|
||||
|
|
@ -814,7 +814,7 @@ static int rkss_get_empty_section_from_usedflags(int section_size)
|
|||
}
|
||||
}
|
||||
|
||||
printf("Not enough space available in secure storage !\n");
|
||||
printf("TEEC: Not enough space available in secure storage !\n");
|
||||
return TEEC_ERROR_GENERIC;
|
||||
}
|
||||
|
||||
|
|
@ -825,14 +825,14 @@ static int rkss_incref_multi_usedflags_sections(unsigned int index, unsigned int
|
|||
uint8_t *flag;
|
||||
|
||||
if ((index + num) >= RKSS_DATA_SECTION_COUNT) {
|
||||
printf("index[%d] out of range.\n", index);
|
||||
printf("TEEC: index[%d] out of range.\n", index);
|
||||
return TEEC_ERROR_GENERIC;
|
||||
}
|
||||
|
||||
rkss.index = RKSS_USEDFLAGS_INDEX;
|
||||
ret = rkss_read_multi_sections(rkss.data, rkss.index, 1);
|
||||
if (ret < 0) {
|
||||
printf("rkss_read_multi_sections fail ! ret: %d.\n", ret);
|
||||
printf("TEEC: rkss_read_multi_sections fail ! ret: %d.\n", ret);
|
||||
return TEEC_ERROR_GENERIC;
|
||||
}
|
||||
|
||||
|
|
@ -840,7 +840,7 @@ static int rkss_incref_multi_usedflags_sections(unsigned int index, unsigned int
|
|||
flag = (uint8_t *)rkss.data + (int)index/2;
|
||||
value = index & 0x1 ? *flag & 0x0F : (*flag & 0xF0) >> 4;
|
||||
if (++value > 0xF) {
|
||||
printf("reference out of data: %d\n", value);
|
||||
printf("TEEC: reference out of data: %d\n", value);
|
||||
value = 0xF;
|
||||
}
|
||||
*flag = index & 0x1 ? (*flag & 0xF0) | (value & 0x0F) :
|
||||
|
|
@ -848,7 +848,7 @@ static int rkss_incref_multi_usedflags_sections(unsigned int index, unsigned int
|
|||
}
|
||||
ret = rkss_write_multi_sections(rkss.data, rkss.index, 1);
|
||||
if (ret < 0) {
|
||||
printf("rkss_write_multi_sections fail ! ret: %d.\n", ret);
|
||||
printf("TEEC: rkss_write_multi_sections fail ! ret: %d.\n", ret);
|
||||
return TEEC_ERROR_GENERIC;
|
||||
}
|
||||
return TEEC_SUCCESS;
|
||||
|
|
@ -861,21 +861,21 @@ static int rkss_decref_multi_usedflags_sections(unsigned int index, unsigned int
|
|||
uint8_t *flag;
|
||||
|
||||
if ((index + num) >= RKSS_DATA_SECTION_COUNT) {
|
||||
printf("index[%d] out of range.\n", index);
|
||||
printf("TEEC: index[%d] out of range.\n", index);
|
||||
return TEEC_ERROR_GENERIC;
|
||||
}
|
||||
|
||||
rkss.index = RKSS_USEDFLAGS_INDEX;
|
||||
ret = rkss_read_multi_sections(rkss.data, rkss.index, 1);
|
||||
if (ret < 0) {
|
||||
printf("rkss_read_multi_sections fail ! ret: %d.\n", ret);
|
||||
printf("TEEC: rkss_read_multi_sections fail ! ret: %d.\n", ret);
|
||||
return TEEC_ERROR_GENERIC;
|
||||
}
|
||||
for (i = 0; i < num; i++, index++) {
|
||||
flag = (uint8_t *)rkss.data + (int)index/2;
|
||||
value = index & 0x1 ? *flag & 0x0F : (*flag & 0xF0) >> 4;
|
||||
if (--value < 0) {
|
||||
printf("reference out of data: %d\n", value);
|
||||
printf("TEEC: reference out of data: %d\n", value);
|
||||
value = 0x0;
|
||||
}
|
||||
*flag = index & 0x1 ? (*flag & 0xF0) | (value & 0x0F) :
|
||||
|
|
@ -883,7 +883,7 @@ static int rkss_decref_multi_usedflags_sections(unsigned int index, unsigned int
|
|||
}
|
||||
ret = rkss_write_multi_sections(rkss.data, rkss.index, 1);
|
||||
if (ret < 0) {
|
||||
printf("rkss_write_multi_sections fail ! ret: %d.\n", ret);
|
||||
printf("TEEC: rkss_write_multi_sections fail ! ret: %d.\n", ret);
|
||||
return TEEC_ERROR_GENERIC;
|
||||
}
|
||||
return TEEC_SUCCESS;
|
||||
|
|
@ -899,13 +899,13 @@ static int rkss_write_empty_ptable(struct rkss_file_info *pfileinfo)
|
|||
|
||||
table_data = malloc(RKSS_DATA_LEN * RKSS_PARTITION_TABLE_COUNT);
|
||||
if (table_data == NULL) {
|
||||
printf("malloc table_data fail\n");
|
||||
printf("TEEC: malloc table_data fail\n");
|
||||
return TEEC_ERROR_GENERIC;
|
||||
}
|
||||
|
||||
ret = rkss_read_patition_tables(table_data);
|
||||
if (ret < 0) {
|
||||
printf("rkss_read_patition_tables fail ! ret: %d.\n", ret);
|
||||
printf("TEEC: rkss_read_patition_tables fail ! ret: %d.\n", ret);
|
||||
return TEEC_ERROR_GENERIC;
|
||||
}
|
||||
|
||||
|
|
@ -917,16 +917,16 @@ static int rkss_write_empty_ptable(struct rkss_file_info *pfileinfo)
|
|||
p = (struct rkss_file_info *)pdata;
|
||||
p += n;
|
||||
if (p->used == 0) {
|
||||
debug("write ptable in [%d][%d] .\n", i, n);
|
||||
debug("TEEC: write ptable in [%d][%d] .\n", i, n);
|
||||
memcpy(p, pfileinfo, sizeof(struct rkss_file_info));
|
||||
p->used = 1;
|
||||
p->id = n;
|
||||
debug("write emt ptable : [%d,%d] name:%s, index:%d,\n",
|
||||
debug("TEEC: write emt ptable : [%d,%d] name:%s, index:%d,\n",
|
||||
i, n, p->name, p->index);
|
||||
debug("size:%d, used:%d\n", p->size, p->used);
|
||||
debug("TEEC: size:%d, used:%d\n", p->size, p->used);
|
||||
ret = rkss_write_multi_sections(rkss.data, rkss.index, 1);
|
||||
if (ret < 0) {
|
||||
printf("rkss_write_multi_sections fail ! ret: %d.\n", ret);
|
||||
printf("TEEC: rkss_write_multi_sections fail ! ret: %d.\n", ret);
|
||||
free(table_data);
|
||||
return TEEC_ERROR_GENERIC;
|
||||
}
|
||||
|
|
@ -936,7 +936,7 @@ static int rkss_write_empty_ptable(struct rkss_file_info *pfileinfo)
|
|||
}
|
||||
}
|
||||
}
|
||||
debug("No enough ptable space available in secure storage.\n");
|
||||
debug("TEEC: No enough ptable space available in secure storage.\n");
|
||||
free(table_data);
|
||||
return TEEC_ERROR_GENERIC;
|
||||
}
|
||||
|
|
@ -953,7 +953,7 @@ static int rkss_write_back_ptable(int fd, struct rkss_file_info *pfileinfo)
|
|||
rkss.index = i;
|
||||
ret = rkss_read_multi_sections(rkss.data, rkss.index, 1);
|
||||
if (ret < 0) {
|
||||
printf("rkss_read_multi_sections fail ! ret: %d.\n", ret);
|
||||
printf("TEEC: rkss_read_multi_sections fail ! ret: %d.\n", ret);
|
||||
return TEEC_ERROR_GENERIC;
|
||||
}
|
||||
|
||||
|
|
@ -962,12 +962,12 @@ static int rkss_write_back_ptable(int fd, struct rkss_file_info *pfileinfo)
|
|||
p += n;
|
||||
|
||||
memcpy(p, pfileinfo, sizeof(struct rkss_file_info));
|
||||
debug("write ptable : [%d,%d] name:%s, index:%d, size:%d, used:%d\n",
|
||||
debug("TEEC: write ptable : [%d,%d] name:%s, index:%d, size:%d, used:%d\n",
|
||||
i, n, p->name, p->index, p->size, p->used);
|
||||
|
||||
ret = rkss_write_multi_sections(rkss.data, rkss.index, 1);
|
||||
if (ret < 0) {
|
||||
printf("rkss_write_multi_sections fail ! ret: %d.\n", ret);
|
||||
printf("TEEC: rkss_write_multi_sections fail ! ret: %d.\n", ret);
|
||||
return TEEC_ERROR_GENERIC;
|
||||
}
|
||||
#ifdef DEBUG_RKFSS
|
||||
|
|
@ -984,7 +984,7 @@ static uint32_t ree_fs_new_open(size_t num_params,
|
|||
int fd;
|
||||
struct rkss_file_info p = {0};
|
||||
|
||||
debug("params[1].u.memref.shm_id = 0x%llx params[1].u.memref.shm_offs = 0x%llx\n",
|
||||
debug("TEEC: params[1].u.memref.shm_id = 0x%llx params[1].u.memref.shm_offs = 0x%llx\n",
|
||||
params[1].u.memref.shm_id, params[1].u.memref.shm_offs);
|
||||
|
||||
filename = (char *)(size_t)params[1].u.memref.shm_id;
|
||||
|
|
@ -992,18 +992,18 @@ static uint32_t ree_fs_new_open(size_t num_params,
|
|||
return TEEC_ERROR_BAD_PARAMETERS;
|
||||
|
||||
if (strlen(filename) > RKSS_NAME_MAX_LENGTH) {
|
||||
printf("ree_fs_new_open: file name too long. %s\n", filename);
|
||||
printf("TEEC: ree_fs_new_open: file name too long. %s\n", filename);
|
||||
return TEEC_ERROR_BAD_PARAMETERS;
|
||||
}
|
||||
|
||||
debug("ree_fs_new_open open file: %s, len: %zu\n", filename, strlen(filename));
|
||||
debug("TEEC: ree_fs_new_open open file: %s, len: %zu\n", filename, strlen(filename));
|
||||
fd = rkss_get_fileinfo_by_name(filename, &p);
|
||||
if (fd < 0) {
|
||||
debug("ree_fs_new_open : no such file. %s\n", filename);
|
||||
debug("TEEC: ree_fs_new_open : no such file. %s\n", filename);
|
||||
return TEEC_ERROR_ITEM_NOT_FOUND;
|
||||
}
|
||||
|
||||
debug("ree_fs_new_open! %s, fd: %d\n", filename, fd);
|
||||
debug("TEEC: ree_fs_new_open! %s, fd: %d\n", filename, fd);
|
||||
|
||||
params[2].u.value.a = fd;
|
||||
return TEEC_SUCCESS;
|
||||
|
|
@ -1021,30 +1021,30 @@ static TEEC_Result ree_fs_new_create(size_t num_params,
|
|||
*/
|
||||
ret = rkss_begin_commit();
|
||||
if (ret < 0) {
|
||||
printf("rkss_begin_commit failed!");
|
||||
printf("TEEC: rkss_begin_commit failed!");
|
||||
return -1;
|
||||
}
|
||||
|
||||
filename = (char *)(size_t)params[1].u.memref.shm_id;
|
||||
debug("params[1].u.memref.shm_id = 0x%llx params[1].u.memref.shm_offs = 0x%llx\n",
|
||||
debug("TEEC: params[1].u.memref.shm_id = 0x%llx params[1].u.memref.shm_offs = 0x%llx\n",
|
||||
params[1].u.memref.shm_id, params[1].u.memref.shm_offs);
|
||||
if (!filename)
|
||||
return TEEC_ERROR_BAD_PARAMETERS;
|
||||
|
||||
if (strlen(filename) > RKSS_NAME_MAX_LENGTH) {
|
||||
printf("ree_fs_new_create: file name too long. %s\n", filename);
|
||||
printf("TEEC: ree_fs_new_create: file name too long. %s\n", filename);
|
||||
return TEEC_ERROR_BAD_PARAMETERS;
|
||||
}
|
||||
|
||||
debug("ree_fs_new_create create file: %s, len: %zu\n", filename, strlen(filename));
|
||||
debug("TEEC: ree_fs_new_create create file: %s, len: %zu\n", filename, strlen(filename));
|
||||
fd = rkss_get_fileinfo_by_name(filename, &p);
|
||||
if (fd >= 0) {
|
||||
debug("ree_fs_new_create : file exist, clear it. %s\n", filename);
|
||||
debug("TEEC: ree_fs_new_create : file exist, clear it. %s\n", filename);
|
||||
/* decrease ref from usedflags */
|
||||
num = p.size / RKSS_DATA_LEN + 1;
|
||||
ret = rkss_decref_multi_usedflags_sections(p.index, num);
|
||||
if (ret < 0) {
|
||||
printf("rkss_decref_multi_usedflags_sections error !\n");
|
||||
printf("TEEC: rkss_decref_multi_usedflags_sections error !\n");
|
||||
return TEEC_ERROR_GENERIC;
|
||||
}
|
||||
|
||||
|
|
@ -1052,12 +1052,12 @@ static TEEC_Result ree_fs_new_create(size_t num_params,
|
|||
memset(&p, 0, sizeof(struct rkss_file_info));
|
||||
ret = rkss_write_back_ptable(fd, &p);
|
||||
if (ret < 0) {
|
||||
printf("ree_fs_new_create : write back error %d\n", ret);
|
||||
printf("TEEC: ree_fs_new_create : write back error %d\n", ret);
|
||||
return TEEC_ERROR_GENERIC;
|
||||
}
|
||||
}
|
||||
|
||||
debug("ree_fs_new_create create new file: %s\n", filename);
|
||||
debug("TEEC: ree_fs_new_create create new file: %s\n", filename);
|
||||
strcpy(p.name, filename);
|
||||
p.index = 0;
|
||||
p.size = 0;
|
||||
|
|
@ -1065,17 +1065,17 @@ static TEEC_Result ree_fs_new_create(size_t num_params,
|
|||
p.flags = RK_FS_R | RK_FS_W;
|
||||
fd = rkss_write_empty_ptable(&p);
|
||||
if (fd < 0) {
|
||||
printf("ree_fs_new_create : write empty ptable error. %s\n", filename);
|
||||
printf("TEEC: ree_fs_new_create : write empty ptable error. %s\n", filename);
|
||||
return TEEC_ERROR_GENERIC;
|
||||
}
|
||||
|
||||
debug("ree_fs_new_create ! %s, fd: %d.\n", filename, fd);
|
||||
debug("TEEC: ree_fs_new_create ! %s, fd: %d.\n", filename, fd);
|
||||
|
||||
params[2].u.value.a = fd;
|
||||
|
||||
ret = rkss_finish_commit();
|
||||
if (ret < 0) {
|
||||
printf("rkss_finish_commit failed!");
|
||||
printf("TEEC: rkss_finish_commit failed!");
|
||||
return -1;
|
||||
}
|
||||
return TEEC_SUCCESS;
|
||||
|
|
@ -1084,7 +1084,7 @@ static TEEC_Result ree_fs_new_create(size_t num_params,
|
|||
static TEEC_Result ree_fs_new_close(size_t num_params,
|
||||
struct tee_ioctl_param *params)
|
||||
{
|
||||
debug("ree_fs_new_close !\n");
|
||||
debug("TEEC: ree_fs_new_close !\n");
|
||||
UNREFERENCED_PARAMETER(params);
|
||||
UNREFERENCED_PARAMETER(num_params);
|
||||
return TEEC_SUCCESS;
|
||||
|
|
@ -1106,18 +1106,18 @@ static TEEC_Result ree_fs_new_read(size_t num_params,
|
|||
offs = params[0].u.value.c;
|
||||
|
||||
data = (uint8_t *)(size_t)params[1].u.memref.shm_id;
|
||||
debug("params[1].u.memref.shm_id = 0x%llx params[1].u.memref.shm_offs = 0x%llx\n",
|
||||
debug("TEEC: params[1].u.memref.shm_id = 0x%llx params[1].u.memref.shm_offs = 0x%llx\n",
|
||||
params[1].u.memref.shm_id, params[1].u.memref.shm_offs);
|
||||
|
||||
if (!data)
|
||||
return TEEC_ERROR_BAD_PARAMETERS;
|
||||
len = params[1].u.memref.size;
|
||||
|
||||
debug("ree_fs_new_read! fd:%d, len:%zu, offs:%ld\n", fd, len, offs);
|
||||
debug("TEEC: ree_fs_new_read! fd:%d, len:%zu, offs:%ld\n", fd, len, offs);
|
||||
|
||||
ret = rkss_get_fileinfo_by_index(fd, &p);
|
||||
if (ret < 0) {
|
||||
debug("unavailable fd: %d!\n", fd);
|
||||
debug("TEEC: unavailable fd: %d!\n", fd);
|
||||
return TEEC_ERROR_GENERIC;
|
||||
}
|
||||
|
||||
|
|
@ -1128,7 +1128,7 @@ static TEEC_Result ree_fs_new_read(size_t num_params,
|
|||
temp_file_data = malloc(section_num * RKSS_DATA_LEN);
|
||||
ret = rkss_read_multi_sections(temp_file_data, p.index, section_num);
|
||||
if (ret < 0) {
|
||||
printf("unavailable file index!\n");
|
||||
printf("TEEC: unavailable file index!\n");
|
||||
free(temp_file_data);
|
||||
return TEEC_ERROR_GENERIC;
|
||||
}
|
||||
|
|
@ -1154,7 +1154,7 @@ static TEEC_Result ree_fs_new_write(size_t num_params,
|
|||
|
||||
ret = rkss_begin_commit();
|
||||
if (ret < 0) {
|
||||
printf("rkss_begin_commit failed!");
|
||||
printf("TEEC: rkss_begin_commit failed!");
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
@ -1162,17 +1162,17 @@ static TEEC_Result ree_fs_new_write(size_t num_params,
|
|||
offs = params[0].u.value.c;
|
||||
|
||||
data = (uint8_t *)(size_t)params[1].u.memref.shm_id;
|
||||
debug("params[1].u.memref.shm_id = 0x%llx params[1].u.memref.shm_offs = 0x%llx\n",
|
||||
debug("TEEC: params[1].u.memref.shm_id = 0x%llx params[1].u.memref.shm_offs = 0x%llx\n",
|
||||
params[1].u.memref.shm_id, params[1].u.memref.shm_offs);
|
||||
if (!data)
|
||||
return TEEC_ERROR_BAD_PARAMETERS;
|
||||
len = params[1].u.memref.size;
|
||||
|
||||
debug("ree_fs_new_write ! fd:%d, len:%zu, offs:%ld \n", fd, len, offs);
|
||||
debug("TEEC: ree_fs_new_write ! fd:%d, len:%zu, offs:%ld \n", fd, len, offs);
|
||||
|
||||
ret = rkss_get_fileinfo_by_index(fd, &p);
|
||||
if (ret < 0) {
|
||||
printf("ree_fs_new_write: fd:%d unvailable!\n", fd);
|
||||
printf("TEEC: ree_fs_new_write: fd:%d unvailable!\n", fd);
|
||||
return TEEC_ERROR_BAD_PARAMETERS;
|
||||
}
|
||||
|
||||
|
|
@ -1187,7 +1187,7 @@ static TEEC_Result ree_fs_new_write(size_t num_params,
|
|||
temp_file_data = malloc(section_num * RKSS_DATA_LEN);
|
||||
ret = rkss_read_multi_sections(temp_file_data, p.index, section_num);
|
||||
if (ret < 0) {
|
||||
printf("unavailable file index %d section_num %d\n", p.index, section_num);
|
||||
printf("TEEC: unavailable file index %d section_num %d\n", p.index, section_num);
|
||||
ret = TEEC_ERROR_GENERIC;
|
||||
goto out;
|
||||
}
|
||||
|
|
@ -1196,7 +1196,7 @@ static TEEC_Result ree_fs_new_write(size_t num_params,
|
|||
temp_file_data = 0;
|
||||
ret = rkss_decref_multi_usedflags_sections(p.index, section_num);
|
||||
if (ret < 0) {
|
||||
printf("rkss_decref_multi_usedflags_sections error !\n");
|
||||
printf("TEEC: rkss_decref_multi_usedflags_sections error !\n");
|
||||
ret = TEEC_ERROR_GENERIC;
|
||||
goto out;
|
||||
}
|
||||
|
|
@ -1207,18 +1207,18 @@ static TEEC_Result ree_fs_new_write(size_t num_params,
|
|||
p.size = new_size;
|
||||
section_num = new_size / RKSS_DATA_LEN + 1;
|
||||
p.index = rkss_get_empty_section_from_usedflags(section_num);
|
||||
debug("Get Empty section in %d\n", p.index);
|
||||
debug("TEEC: Get Empty section in %d\n", p.index);
|
||||
p.used = 1;
|
||||
ret = rkss_incref_multi_usedflags_sections(p.index, section_num);
|
||||
if (ret < 0) {
|
||||
printf("rkss_incref_multi_usedflags_sections error !\n");
|
||||
printf("TEEC: rkss_incref_multi_usedflags_sections error !\n");
|
||||
ret = TEEC_ERROR_GENERIC;
|
||||
goto out;
|
||||
}
|
||||
|
||||
ret = rkss_write_back_ptable(fd, &p);
|
||||
if (ret < 0) {
|
||||
printf("ree_fs_new_write: write ptable error!\n");
|
||||
printf("TEEC: ree_fs_new_write: write ptable error!\n");
|
||||
ret = TEEC_ERROR_GENERIC;
|
||||
goto out;
|
||||
}
|
||||
|
|
@ -1244,7 +1244,7 @@ out:
|
|||
}
|
||||
ret = rkss_finish_commit();
|
||||
if (ret < 0) {
|
||||
printf("rkss_finish_commit failed!");
|
||||
printf("TEEC: rkss_finish_commit failed!");
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
@ -1262,40 +1262,40 @@ static TEEC_Result ree_fs_new_truncate(size_t num_params,
|
|||
|
||||
ret = rkss_begin_commit();
|
||||
if (ret < 0) {
|
||||
printf("rkss_begin_commit failed!");
|
||||
printf("TEEC: rkss_begin_commit failed!");
|
||||
return -1;
|
||||
}
|
||||
|
||||
fd = params[0].u.value.b;
|
||||
len = params[0].u.value.c;
|
||||
|
||||
debug("ree_fs_new_truncate: fd:%d, lenth:%zu\n", fd, len);
|
||||
debug("TEEC: ree_fs_new_truncate: fd:%d, lenth:%zu\n", fd, len);
|
||||
|
||||
ret = rkss_get_fileinfo_by_index(fd, &p);
|
||||
if (ret < 0) {
|
||||
printf("fd:%d unvailable!\n", fd);
|
||||
printf("TEEC: fd:%d unvailable!\n", fd);
|
||||
return TEEC_ERROR_GENERIC;
|
||||
}
|
||||
if (len > p.size) {
|
||||
printf("truncate error!\n");
|
||||
printf("TEEC: truncate error!\n");
|
||||
return TEEC_ERROR_GENERIC;
|
||||
}
|
||||
section_num_old = p.size / RKSS_DATA_LEN + 1;
|
||||
section_num_new = len / RKSS_DATA_LEN + 1;
|
||||
ret = rkss_decref_multi_usedflags_sections(p.index + section_num_new, section_num_old - section_num_new);
|
||||
if (ret < 0) {
|
||||
printf("rkss_decref_multi_usedflags_sections error !\n");
|
||||
printf("TEEC: rkss_decref_multi_usedflags_sections error !\n");
|
||||
ret = TEEC_ERROR_GENERIC;
|
||||
}
|
||||
p.size = len;
|
||||
ret = rkss_write_back_ptable(fd, &p);
|
||||
if (ret < 0) {
|
||||
printf("ree_fs_new_truncate: write ptable error!\n");
|
||||
printf("TEEC: ree_fs_new_truncate: write ptable error!\n");
|
||||
return TEEC_ERROR_GENERIC;
|
||||
}
|
||||
ret = rkss_finish_commit();
|
||||
if (ret < 0) {
|
||||
printf("rkss_finish_commit failed!");
|
||||
printf("TEEC: rkss_finish_commit failed!");
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
@ -1311,11 +1311,11 @@ static TEEC_Result ree_fs_new_remove(size_t num_params,
|
|||
|
||||
ret = rkss_begin_commit();
|
||||
if (ret < 0) {
|
||||
printf("rkss_begin_commit failed!");
|
||||
printf("TEEC: rkss_begin_commit failed!");
|
||||
return -1;
|
||||
}
|
||||
|
||||
debug("params[1].u.memref.shm_id = 0x%llx params[1].u.memref.shm_offs = 0x%llx\n",
|
||||
debug("TEEC: params[1].u.memref.shm_id = 0x%llx params[1].u.memref.shm_offs = 0x%llx\n",
|
||||
params[1].u.memref.shm_id, params[1].u.memref.shm_offs);
|
||||
|
||||
filename = (char *)(size_t)params[1].u.memref.shm_id;
|
||||
|
|
@ -1324,18 +1324,18 @@ static TEEC_Result ree_fs_new_remove(size_t num_params,
|
|||
|
||||
ret = rkss_get_fileinfo_by_name(filename, &p);
|
||||
if (ret < 0) {
|
||||
printf("ree_fs_new_remove: no such file. %s\n", filename);
|
||||
printf("TEEC: ree_fs_new_remove: no such file. %s\n", filename);
|
||||
return 0;
|
||||
}
|
||||
fd = ret;
|
||||
|
||||
debug("ree_fs_new_remove! %s fd:%d index:%d size:%d\n", filename, fd, p.index, p.size);
|
||||
debug("TEEC: ree_fs_new_remove! %s fd:%d index:%d size:%d\n", filename, fd, p.index, p.size);
|
||||
|
||||
/* decrease ref from usedflags */
|
||||
num = p.size / RKSS_DATA_LEN + 1;
|
||||
ret = rkss_decref_multi_usedflags_sections(p.index, num);
|
||||
if (ret < 0) {
|
||||
printf("rkss_decref_multi_usedflags_sections error !\n");
|
||||
printf("TEEC: rkss_decref_multi_usedflags_sections error !\n");
|
||||
return TEEC_ERROR_GENERIC;
|
||||
}
|
||||
|
||||
|
|
@ -1343,7 +1343,7 @@ static TEEC_Result ree_fs_new_remove(size_t num_params,
|
|||
memset(&p, 0, sizeof(struct rkss_file_info));
|
||||
ret = rkss_write_back_ptable(fd, &p);
|
||||
if (ret < 0) {
|
||||
printf("ree_fs_new_remove: write back error %d\n", ret);
|
||||
printf("TEEC: ree_fs_new_remove: write back error %d\n", ret);
|
||||
return TEEC_ERROR_GENERIC;
|
||||
}
|
||||
|
||||
|
|
@ -1353,7 +1353,7 @@ static TEEC_Result ree_fs_new_remove(size_t num_params,
|
|||
#endif
|
||||
ret = rkss_finish_commit();
|
||||
if (ret < 0) {
|
||||
printf("rkss_finish_commit failed!");
|
||||
printf("TEEC: rkss_finish_commit failed!");
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
@ -1370,32 +1370,32 @@ static TEEC_Result ree_fs_new_rename(size_t num_params,
|
|||
|
||||
ret = rkss_begin_commit();
|
||||
if (ret < 0) {
|
||||
printf("rkss_begin_commit failed!");
|
||||
printf("TEEC: rkss_begin_commit failed!");
|
||||
return -1;
|
||||
}
|
||||
|
||||
old_fname = (char *)(size_t)params[1].u.memref.shm_id;
|
||||
debug("params[1].u.memref.shm_id = 0x%llx params[1].u.memref.shm_offs = 0x%llx\n",
|
||||
debug("TEEC: params[1].u.memref.shm_id = 0x%llx params[1].u.memref.shm_offs = 0x%llx\n",
|
||||
params[1].u.memref.shm_id, params[1].u.memref.shm_offs);
|
||||
if (!old_fname)
|
||||
return TEEC_ERROR_BAD_PARAMETERS;
|
||||
|
||||
new_fname = (char *)(size_t)params[2].u.memref.shm_id;
|
||||
debug("params[2].u.memref.shm_id = 0x%llx params[2].u.memref.shm_offs = 0x%llx\n",
|
||||
debug("TEEC: params[2].u.memref.shm_id = 0x%llx params[2].u.memref.shm_offs = 0x%llx\n",
|
||||
params[2].u.memref.shm_id, params[2].u.memref.shm_offs);
|
||||
if (!new_fname)
|
||||
return TEEC_ERROR_BAD_PARAMETERS;
|
||||
|
||||
if (strlen(new_fname) > RKSS_NAME_MAX_LENGTH) {
|
||||
printf("new file name too long. %s\n", new_fname);
|
||||
printf("TEEC: new file name too long. %s\n", new_fname);
|
||||
return TEEC_ERROR_BAD_PARAMETERS;
|
||||
}
|
||||
|
||||
debug("rename: %s -> %s\n", old_fname, new_fname);
|
||||
debug("TEEC: rename: %s -> %s\n", old_fname, new_fname);
|
||||
|
||||
ret = rkss_get_fileinfo_by_name(old_fname, &p);
|
||||
if (ret < 0) {
|
||||
printf("filename: %s no found.\n", old_fname);
|
||||
printf("TEEC: filename: %s no found.\n", old_fname);
|
||||
return TEEC_ERROR_ITEM_NOT_FOUND;
|
||||
}
|
||||
|
||||
|
|
@ -1403,12 +1403,12 @@ static TEEC_Result ree_fs_new_rename(size_t num_params,
|
|||
|
||||
ret = rkss_write_back_ptable(ret, &p);
|
||||
if (ret < 0) {
|
||||
printf("write ptable error!\n");
|
||||
printf("TEEC: write ptable error!\n");
|
||||
return TEEC_ERROR_GENERIC;
|
||||
}
|
||||
ret = rkss_finish_commit();
|
||||
if (ret < 0) {
|
||||
printf("rkss_finish_commit failed!");
|
||||
printf("TEEC: rkss_finish_commit failed!");
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
@ -1421,7 +1421,7 @@ static TEEC_Result ree_fs_new_opendir(size_t num_params,
|
|||
char *dirname;
|
||||
int ret;
|
||||
|
||||
debug("params[1].u.memref.shm_id = 0x%llx params[1].u.memref.shm_offs = 0x%llx\n",
|
||||
debug("TEEC: params[1].u.memref.shm_id = 0x%llx params[1].u.memref.shm_offs = 0x%llx\n",
|
||||
params[1].u.memref.shm_id, params[1].u.memref.shm_offs);
|
||||
|
||||
dirname = (char *)(size_t)params[1].u.memref.shm_id;
|
||||
|
|
@ -1431,11 +1431,11 @@ static TEEC_Result ree_fs_new_opendir(size_t num_params,
|
|||
dir_seek = 0;
|
||||
ret = rkss_get_dirs_by_name(dirname);
|
||||
if (ret < 0) {
|
||||
printf("ree_fs_new_opendir: error\n");
|
||||
printf("TEEC: ree_fs_new_opendir: error\n");
|
||||
return TEEC_ERROR_GENERIC;
|
||||
}
|
||||
|
||||
debug("ree_fs_new_opendir: %s, seek/num:%d/%d\n", dirname, dir_seek, dir_num);
|
||||
debug("TEEC: ree_fs_new_opendir: %s, seek/num:%d/%d\n", dirname, dir_seek, dir_num);
|
||||
return TEEC_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
@ -1461,13 +1461,13 @@ static TEEC_Result ree_fs_new_readdir(size_t num_params,
|
|||
size_t dirname_len;
|
||||
|
||||
dirname = (char *)(size_t)params[1].u.memref.shm_id;
|
||||
debug("params[1].u.memref.shm_id = 0x%llx params[1].u.memref.shm_offs = 0x%llx\n",
|
||||
debug("TEEC: params[1].u.memref.shm_id = 0x%llx params[1].u.memref.shm_offs = 0x%llx\n",
|
||||
params[1].u.memref.shm_id, params[1].u.memref.shm_offs);
|
||||
if (!dirname)
|
||||
return TEEC_ERROR_BAD_PARAMETERS;
|
||||
len = params[1].u.memref.size;
|
||||
|
||||
debug("seek/num:%d/%d\n", dir_seek, dir_num);
|
||||
debug("TEEC: seek/num:%d/%d\n", dir_seek, dir_num);
|
||||
if (dir_seek == dir_num) {
|
||||
params[1].u.memref.size = 0;
|
||||
debug("ree_fs_new_readdir: END \n");
|
||||
|
|
@ -1482,7 +1482,7 @@ static TEEC_Result ree_fs_new_readdir(size_t num_params,
|
|||
strcpy(dirname, dir_cache[dir_seek]);
|
||||
++dir_seek;
|
||||
|
||||
debug("ree_fs_new_readdir: %s\n", dirname);
|
||||
debug("TEEC: ree_fs_new_readdir: %s\n", dirname);
|
||||
|
||||
return TEEC_SUCCESS;
|
||||
}
|
||||
|
|
@ -1512,23 +1512,23 @@ int tee_supp_rk_fs_init(void)
|
|||
memset(rkss.data, 0, RKSS_DATA_LEN);
|
||||
rkss.index = i;
|
||||
rkss_write_multi_sections(rkss.data, rkss.index, 1);
|
||||
printf("cleaned [%d]", i);
|
||||
printf("TEEC: cleaned [%d]", i);
|
||||
}
|
||||
#endif
|
||||
ret = rkss_begin_commit();
|
||||
if (ret < 0) {
|
||||
printf("rkss_begin_commit failed!");
|
||||
printf("TEEC: rkss_begin_commit failed!");
|
||||
return TEEC_ERROR_GENERIC;
|
||||
}
|
||||
|
||||
table_data = malloc(RKSS_DATA_LEN * RKSS_PARTITION_TABLE_COUNT);
|
||||
if (table_data == NULL) {
|
||||
printf("malloc table_data fail\n");
|
||||
printf("TEEC: malloc table_data fail\n");
|
||||
return TEEC_ERROR_GENERIC;
|
||||
}
|
||||
ret = rkss_read_patition_tables(table_data);
|
||||
if (ret < 0) {
|
||||
printf("rkss_read_patition_tables fail ! ret: %d.\n", ret);
|
||||
printf("TEEC: rkss_read_patition_tables fail ! ret: %d.\n", ret);
|
||||
return TEEC_ERROR_GENERIC;
|
||||
}
|
||||
|
||||
|
|
@ -1541,12 +1541,12 @@ int tee_supp_rk_fs_init(void)
|
|||
rkss.index = RKSS_USEDFLAGS_INDEX;
|
||||
ret = rkss_read_multi_sections(rkss.data, rkss.index, 1);
|
||||
if (ret < 0) {
|
||||
printf("rkss_read_multi_sections fail ! ret: %d.\n", ret);
|
||||
printf("TEEC: rkss_read_multi_sections fail ! ret: %d.\n", ret);
|
||||
return TEEC_ERROR_GENERIC;
|
||||
}
|
||||
ret = rkss_verify_usedflags(&rkss);
|
||||
if (ret < 0) {
|
||||
printf("rkss_verify_usedflags fail ! ret: %d.\n", ret);
|
||||
printf("TEEC: rkss_verify_usedflags fail ! ret: %d.\n", ret);
|
||||
return TEEC_ERROR_GENERIC;
|
||||
}
|
||||
|
||||
|
|
@ -1557,7 +1557,7 @@ int tee_supp_rk_fs_init(void)
|
|||
|
||||
ret = rkss_finish_commit();
|
||||
if (ret < 0) {
|
||||
printf("rkss_finish_commit failed!");
|
||||
printf("TEEC: rkss_finish_commit failed!");
|
||||
return TEEC_ERROR_GENERIC;
|
||||
}
|
||||
|
||||
|
|
@ -1566,7 +1566,7 @@ int tee_supp_rk_fs_init(void)
|
|||
|
||||
int OpteeClientRkFsInit(void)
|
||||
{
|
||||
debug(" OpteeClientRkFsInit\n");
|
||||
debug("TEEC: OpteeClientRkFsInit\n");
|
||||
return tee_supp_rk_fs_init();
|
||||
}
|
||||
bool tee_supp_param_is_value(struct tee_ioctl_param *param)
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -126,7 +126,7 @@ TEEC_Result TEEC_SMC_OpenSession(TEEC_Context *context,
|
|||
TeeSmc32Param[1].attr = OPTEE_MSG_ATTR_TYPE_VALUE_INPUT_V2 |
|
||||
OPTEE_MSG_ATTR_META_V2;
|
||||
#else
|
||||
printf("Not support! All rockchips use optee v2.5 are 64 bits! \n");
|
||||
printf("TEEC: Not support! All rockchips use optee v2.5 are 64 bits! \n");
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
|
@ -300,18 +300,18 @@ void SetTeeSmc32Params(TEEC_Operation *operation,
|
|||
#ifdef CONFIG_OPTEE_V1
|
||||
#ifdef CONFIG_ARM64
|
||||
attr |= TEEC_SMC_DEFAULT_CACHE_ATTRIBUTES;
|
||||
debug(" OPTEE_OS_V1 ARCH64 attr %x\n", attr);
|
||||
debug("TEEC: OPTEE_OS_V1 ARCH64 attr %x\n", attr);
|
||||
#else
|
||||
debug(" OPTEE_OS_V1 ARCH32 attr %x\n", attr);
|
||||
debug("TEEC: OPTEE_OS_V1 ARCH32 attr %x\n", attr);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_OPTEE_V2
|
||||
#if defined CONFIG_ARM64 || defined CONFIG_ARM64_BOOT_AARCH32
|
||||
attr += (OPTEE_MSG_ATTR_TYPE_TMEM_INPUT_V2 - TEEC_MEMREF_TEMP_INPUT);
|
||||
debug(" OPTEE_OS_V2 ARCH64 attr %x\n", attr);
|
||||
debug("TEEC: OPTEE_OS_V2 ARCH64 attr %x\n", attr);
|
||||
#else
|
||||
printf("Not support! All rockchips use optee v2 are 64 bits! \n");
|
||||
printf("TEEC: Not support! All rockchips use optee v2 are 64 bits! \n");
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
|
@ -376,7 +376,7 @@ TEEC_Result OpteeSmcCall(t_teesmc32_arg *TeeSmc32Arg)
|
|||
|
||||
while (1) {
|
||||
tee_smc_call(&ArmSmcArgs);
|
||||
debug("arg0=0x%x arg1=0x%x arg2=0x%x arg3=0x%x \n",
|
||||
debug("TEEC: arg0=0x%x arg1=0x%x arg2=0x%x arg3=0x%x \n",
|
||||
ArmSmcArgs.Arg0, ArmSmcArgs.Arg1, ArmSmcArgs.Arg2, ArmSmcArgs.Arg3);
|
||||
if (TEESMC_RETURN_IS_RPC(ArmSmcArgs.Arg0)) {
|
||||
(void) OpteeRpcCallback(&ArmSmcArgs);
|
||||
|
|
|
|||
Loading…
Reference in New Issue