Interface: Clean up the tfm_api.h header file
This file does not look like an "interface" file as it contains
some SPM internal usage definitions.
This patch:
- Moves the SPM internal definitions to spm.h.
- Use the error codes in `internal_status_code.h` instead of the
ones in tfm_api.h.
- Removes error codes in tfm_api.h.
- Renames tfm_api.h to tfm_veneers.h to reflect what it does.
- Corresponding changes in source files.
Change-Id: Iba5d1aae6837c9f0bf52c9a0c456023d19a735ea
Signed-off-by: Kevin Peng <kevin.peng@arm.com>
diff --git a/interface/include/tfm_ns_interface.h b/interface/include/tfm_ns_interface.h
index 6b55fc3..32a04c5 100644
--- a/interface/include/tfm_ns_interface.h
+++ b/interface/include/tfm_ns_interface.h
@@ -14,7 +14,7 @@
#endif
#include <stdint.h>
-#include "tfm_api.h"
+#include "tfm_veneers.h"
typedef int32_t (*veneer_fn) (uint32_t arg0, uint32_t arg1,
uint32_t arg2, uint32_t arg3);
diff --git a/interface/include/tfm_platform_api.h b/interface/include/tfm_platform_api.h
index f7f3972..e925503 100644
--- a/interface/include/tfm_platform_api.h
+++ b/interface/include/tfm_platform_api.h
@@ -11,7 +11,7 @@
#include <limits.h>
#include <stdbool.h>
#include <stdint.h>
-#include "tfm_api.h"
+#include "psa/client.h"
#ifdef __cplusplus
extern "C" {
diff --git a/interface/include/tfm_api.h b/interface/include/tfm_veneers.h
similarity index 60%
rename from interface/include/tfm_api.h
rename to interface/include/tfm_veneers.h
index 7e79746..24c4036 100644
--- a/interface/include/tfm_api.h
+++ b/interface/include/tfm_veneers.h
@@ -5,59 +5,15 @@
*
*/
-#ifndef __TFM_API_H__
-#define __TFM_API_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
+#ifndef __TFM_VENEERS_H__
+#define __TFM_VENEERS_H__
#include <stdint.h>
#include "psa/client.h"
-#define TFM_INVALID_CLIENT_ID 0
-
-/**
- * \brief Checks if the provided client ID is a secure client ID.
- *
- * \param[in] client_id Client ID to check.
- *
- * \retval 1 Client ID is secure.
- * \retval 0 Client ID is non-secure.
- */
-#define TFM_CLIENT_ID_IS_S(client_id) ((client_id)>0)
-
-/**
- * \brief Checks if the provided client ID is a non-secure client ID.
- *
- * \param[in] client_id Client ID to check.
- *
- * \retval 1 Client ID is non-secure.
- * \retval 0 Client ID is secure.
- */
-#define TFM_CLIENT_ID_IS_NS(client_id) ((client_id)<0)
-
-/* The mask used for timeout values */
-#define PSA_TIMEOUT_MASK PSA_BLOCK
-
-/* FixMe: sort out DEBUG compile option and limit return value options
- * on external interfaces */
-enum tfm_status_e
-{
- TFM_SUCCESS = 0,
- TFM_PARTITION_BUSY,
- TFM_ERROR_SECURE_DOMAIN_LOCKED,
- TFM_ERROR_INVALID_PARAMETER,
- TFM_ERROR_PARTITION_NON_REENTRANT,
- TFM_ERROR_NS_THREAD_MODE_CALL,
- TFM_ERROR_NOT_INITIALIZED,
- TFM_ERROR_NO_ACTIVE_PARTITION,
- TFM_ERROR_INVALID_EXC_MODE,
- TFM_ERROR_NOT_IN_RANGE,
- TFM_SECURE_LOCK_FAILED,
- TFM_SECURE_UNLOCK_FAILED,
- TFM_ERROR_GENERIC = 0x1F,
-};
+#ifdef __cplusplus
+extern "C" {
+#endif
/********************* Secure function declarations ***************************/
@@ -116,4 +72,4 @@
}
#endif
-#endif /* __TFM_API_H__ */
+#endif /* __TFM_VENEERS_H__ */