[TEEC] TEF API compatible with VD, caused by C# API compatibility requirement 70/165870/2 accepted/tizen/unified/20180105.065637 submit/tizen/20180104.132150
authorKrzysztof Dynowski <k.dynowski@samsung.com>
Wed, 3 Jan 2018 12:16:52 +0000 (13:16 +0100)
committerKrzysztof Dynowski <k.dynowski@samsung.com>
Thu, 4 Jan 2018 11:21:23 +0000 (12:21 +0100)
Change-Id: I26102a69a036122bde3bd65b4e27c4210700e60d

api/tef/tee_client_api.h
src/optee/creators.c
src/simulator/creators.c

index 6258375..7021b17 100644 (file)
@@ -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.
index 94a2a83..bfb4a8d 100644 (file)
@@ -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]);
 }
index 981176a..5e6e786 100644 (file)
@@ -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;
 }