summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKrzysztof Dynowski <k.dynowski@samsung.com>2018-01-03 13:16:52 +0100
committerKrzysztof Dynowski <k.dynowski@samsung.com>2018-01-04 12:21:23 +0100
commit2872e83849510dab933c9812e0be03a31e759fce (patch)
tree5b377e2b3a1c0eb72c34526e418db8ab646b8030
parent610ea67be17d9771a24d9c422ecd5177b885d27e (diff)
downloadlibteec-2872e83849510dab933c9812e0be03a31e759fce.tar.gz
libteec-2872e83849510dab933c9812e0be03a31e759fce.tar.bz2
libteec-2872e83849510dab933c9812e0be03a31e759fce.zip
[TEEC] TEF API compatible with VD, caused by C# API compatibility requirementsubmit/tizen/20180104.132150accepted/tizen/unified/20180105.065637
Change-Id: I26102a69a036122bde3bd65b4e27c4210700e60d
-rw-r--r--api/tef/tee_client_api.h4
-rw-r--r--src/optee/creators.c6
-rw-r--r--src/simulator/creators.c14
3 files changed, 8 insertions, 16 deletions
diff --git a/api/tef/tee_client_api.h b/api/tef/tee_client_api.h
index 6258375..7021b17 100644
--- a/api/tef/tee_client_api.h
+++ b/api/tef/tee_client_api.h
@@ -249,7 +249,7 @@ extern "C" {
* @param[in] p3 The fourth param type.
*/
#define TEEC_PARAM_TYPES(p0, p1, p2, p3) \
- ((p0) | ((p1) << 4) | ((p2) << 8) | ((p3) << 12))
+ ((p0) | ((p1) << 8) | ((p2) << 16) | ((p3) << 24))
/**
* @brief Get the i_th param type from the paramType.
@@ -259,7 +259,7 @@ extern "C" {
* @param p[in] The paramType.
* @param i[in] The i-th parameter to get the type for.
*/
-#define TEEC_PARAM_TYPE_GET(p, i) (((p) >> (i * 4)) & 0xF)
+#define TEEC_PARAM_TYPE_GET(p, i) (((p) >> (i * 8)) & 0xF)
/**
* @brief This type is used to contain return codes which are the results of invoking TEE Client API functions.
diff --git a/src/optee/creators.c b/src/optee/creators.c
index 94a2a83..bfb4a8d 100644
--- a/src/optee/creators.c
+++ b/src/optee/creators.c
@@ -37,5 +37,9 @@ void *optee_TEEC_SharedMemory()
}
uint32_t optee_paramTypes(uint32_t api_params)
{
- return api_params;
+ uint8_t p[4];
+ for (int i = 0; i < 4; ++i) {
+ p[i] = TEEC_PARAM_TYPE_GET(api_params, i);
+ }
+ return TEEC_PARAM_TYPES(p[0], p[1], p[2], p[3]);
}
diff --git a/src/simulator/creators.c b/src/simulator/creators.c
index 981176a..5e6e786 100644
--- a/src/simulator/creators.c
+++ b/src/simulator/creators.c
@@ -36,19 +36,7 @@ void *simulator_TEEC_SharedMemory()
return malloc(sizeof(TEEC_SharedMemory));
}
-/* copied from simulator tee_client_api.h
- */
-#define SIMULATOR_PARAM_TYPES(param0Type, param1Type, param2Type, param3Type) \
- (uint32_t)(((param0Type) & 0x7f) | \
- (((param1Type) & 0x7f) << 8) | \
- (((param2Type) & 0x7f) << 16) | \
- (((param3Type) & 0x7f) << 24))
-
uint32_t simulator_paramTypes(uint32_t api_params)
{
- uint8_t p[4];
- for (int i = 0; i < 4; ++i) {
- p[i] = TEEC_PARAM_TYPE_GET(api_params, i);
- }
- return SIMULATOR_PARAM_TYPES(p[0], p[1], p[2], p[3]);
+ return api_params;
}