xtest 6017: Test info.dataSize in Persistent objects
Create a persistent object and write some data into it,
get the info.dataSize and then close it, and reopen it
to get the new info.dataSize of this reopen's object,
these two dataSizes should be equal.
Signed-off-by: Guanchao Liang <liang.guanchao@linaro.org>
Reviewed-by: Joakim Bech <joakim.bech@linaro.org>
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
diff --git a/ta/storage/storage.c b/ta/storage/storage.c
index 1140170..e9a507b 100644
--- a/ta/storage/storage.c
+++ b/ta/storage/storage.c
@@ -485,3 +485,21 @@
TEE_ResetTransientObject(o);
return TEE_SUCCESS;
}
+
+TEE_Result ta_storage_cmd_get_obj_info(uint32_t param_types,
+ TEE_Param params[4])
+{
+ TEE_Result res;
+ TEE_ObjectInfo *info;
+ TEE_ObjectHandle o = VAL2HANDLE(params[0].value.a);
+
+ ASSERT_PARAM_TYPE(TEE_PARAM_TYPES
+ (TEE_PARAM_TYPE_VALUE_INPUT,
+ TEE_PARAM_TYPE_MEMREF_OUTPUT, TEE_PARAM_TYPE_NONE,
+ TEE_PARAM_TYPE_NONE));
+
+ info = (TEE_ObjectInfo *)params[1].memref.buffer;
+ res = TEE_GetObjectInfo1(o, info);
+
+ return res;
+}