From b389fbb11f0942652068f94aaf494f103590d966 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 6 May 2022 19:35:30 +0800 Subject: [PATCH] lilianhui1@huawei.com Signed-off-by: root --- include/CA/tee_client_constants.h | 2 ++ include/CA/tee_client_type.h | 10 ++++++++++ include/TA/tee_defines.h | 5 +++++ 3 files changed, 17 insertions(+) diff --git a/include/CA/tee_client_constants.h b/include/CA/tee_client_constants.h index 9ddff9b..3b86dcb 100644 --- a/include/CA/tee_client_constants.h +++ b/include/CA/tee_client_constants.h @@ -66,6 +66,7 @@ enum TEEC_SharedMemCtl { TEEC_MEM_INPUT = 0x1, /* input type of memroy */ TEEC_MEM_OUTPUT = 0x2, /* output type of memory */ TEEC_MEM_INOUT = 0x3, /* memory is used as both input and output */ + TEEC_MEM_SHARED_INOUT = 0x4, /* no copy shared memory */ }; enum TEEC_ParamType { @@ -79,6 +80,7 @@ enum TEEC_ParamType { refer TEEC_TempMemoryReference */ TEEC_ION_INPUT = 0x08, /* input type of icon memory reference, refer TEEC_IonReference */ TEEC_ION_SGLIST_INPUT = 0x09, /* input type of ion memory block reference, refer TEEC_IonSglistReference */ + TEEC_MEMREF_SHARED_INOUT = 0xa, /* no copy mem */ TEEC_MEMREF_WHOLE = 0xc, /* use whole memory block, refer TEEC_RegisteredMemoryReference */ TEEC_MEMREF_PARTIAL_INPUT = 0xd, /* input type of memory reference, refer TEEC_RegisteredMemoryReference */ TEEC_MEMREF_PARTIAL_OUTPUT = 0xe, /* output type of memory reference, refer TEEC_RegisteredMemoryReference */ diff --git a/include/CA/tee_client_type.h b/include/CA/tee_client_type.h index c5b97e3..54692dd 100644 --- a/include/CA/tee_client_type.h +++ b/include/CA/tee_client_type.h @@ -107,6 +107,15 @@ typedef struct { uint32_t offset; } TEEC_RegisteredMemoryReference; +/* + * the corresponding param types are + * TEEC_SHAREDMEM_INOUT + */ +typedef struct { + TEEC_SharedMemory *parent; + uint32_t size; +} TEEC_RegisteredSharedMemory; + /* * the corresponding param types are * TEEC_VALUE_INPUT/TEEC_VALUE_OUTPUT/TEEC_VALUE_INOUT @@ -124,6 +133,7 @@ typedef struct { typedef union { TEEC_TempMemoryReference tmpref; TEEC_RegisteredMemoryReference memref; + TEEC_RegisteredSharedMemory sharedmem; TEEC_Value value; TEEC_IonReference ionref; } TEEC_Parameter; diff --git a/include/TA/tee_defines.h b/include/TA/tee_defines.h index 8289c07..77fe268 100755 --- a/include/TA/tee_defines.h +++ b/include/TA/tee_defines.h @@ -49,6 +49,10 @@ typedef union { unsigned int a; unsigned int b; } value; + struct { + void *buffer; + size_t size; + } sharedmem; } TEE_Param; #define TEE_PARAM_TYPES(param0Type, param1Type, param2Type, param3Type) \ @@ -84,6 +88,7 @@ enum TEE_ParamType { TEE_PARAM_TYPE_MEMREF_INOUT = 0x7, TEE_PARAM_TYPE_ION_INPUT = 0x8, TEE_PARAM_TYPE_ION_SGLIST_INPUT = 0x9, + TEE_PARAM_TYPE_MEMREF_SHARED_INOUT = 0xa, }; #define S_VAR_NOT_USED(variable) \ -- Gitee