* @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.
* @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.
}
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]);
}
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;
}