Interface: Interface provided to NS side
These files provide a reference interface mplementation for integration
with OS running on the NS side. This has been tested to work with
RTX scheduler.
Modifications may be required while integrating other OS.
Change-Id: I4845584465c5df0bc574de31564a0789154c0dd5
Signed-off-by: Ashutosh Singh <ashutosh.singh@arm.com>
Co-Authored-By: Marc Moreno Berengue <marc.morenoberengue@arm.com>
Co-Authored-By: Antonio de Angelis <antonio.deangelis@arm.com>
diff --git a/interface/include/tfm_api.h b/interface/include/tfm_api.h
new file mode 100644
index 0000000..d911f0c
--- /dev/null
+++ b/interface/include/tfm_api.h
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2017, Arm Limited. All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ *
+ */
+
+#ifndef __TFM_API_H__
+#define __TFM_API_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* FixMe: sort out DEBUG compile option and limit return value options
+ * on external interfaces */
+/* Note:
+ * TFM will only return values recognized and parsed by TFM core.
+ * Service return codes are not automatically passed on to REE.
+ * Any non-zero return value is interpreted as an error that may trigger
+ * TEE error handling flow.
+ */
+enum tfm_status_e
+{
+ TFM_SUCCESS = 0,
+ TFM_SERVICE_PENDED,
+ TFM_SERVICE_BUSY,
+ TFM_ERROR_SERVICE_ALREADY_PENDED,
+ TFM_ERROR_SECURE_DOMAIN_LOCKED,
+ TFM_ERROR_INVALID_PARAMETER,
+ TFM_ERROR_SERVICE_NON_REENTRANT,
+ TFM_ERROR_NS_THREAD_MODE_CALL,
+ TFM_ERROR_INVALID_EXC_MODE,
+ TFM_SECURE_LOCK_FAILED,
+ TFM_SECURE_UNLOCK_FAILED,
+ TFM_ERROR_GENERIC = 0x1F,
+ TFM_SERVICE_SPECIFIC_ERROR_MIN,
+};
+
+//==================== Secure function declarations ==========================//
+
+/* Placeholder for secure function declarations defined by TF-M in the future */
+
+//================ End Secure function declarations ==========================//
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __TFM_API_H__ */