Ashutosh Singh | f4d8867 | 2017-11-29 13:35:43 +0000 | [diff] [blame] | 1 | /* |
Mate Toth-Pal | 7de74b5 | 2018-02-23 15:46:47 +0100 | [diff] [blame] | 2 | * Copyright (c) 2017-2018, Arm Limited. All rights reserved. |
Ashutosh Singh | f4d8867 | 2017-11-29 13:35:43 +0000 | [diff] [blame] | 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | * |
| 6 | */ |
| 7 | |
| 8 | #ifndef __TFM_API_H__ |
| 9 | #define __TFM_API_H__ |
| 10 | |
| 11 | #ifdef __cplusplus |
| 12 | extern "C" { |
| 13 | #endif |
| 14 | |
Mate Toth-Pal | ce61afa | 2018-08-03 13:51:01 +0200 | [diff] [blame^] | 15 | #include <stdint.h> |
| 16 | |
Ashutosh Singh | f4d8867 | 2017-11-29 13:35:43 +0000 | [diff] [blame] | 17 | /* FixMe: sort out DEBUG compile option and limit return value options |
| 18 | * on external interfaces */ |
| 19 | /* Note: |
| 20 | * TFM will only return values recognized and parsed by TFM core. |
| 21 | * Service return codes are not automatically passed on to REE. |
| 22 | * Any non-zero return value is interpreted as an error that may trigger |
| 23 | * TEE error handling flow. |
| 24 | */ |
| 25 | enum tfm_status_e |
| 26 | { |
| 27 | TFM_SUCCESS = 0, |
Mate Toth-Pal | 7de74b5 | 2018-02-23 15:46:47 +0100 | [diff] [blame] | 28 | TFM_PARTITION_PENDED, |
| 29 | TFM_PARTITION_BUSY, |
| 30 | TFM_ERROR_PARTITION_ALREADY_PENDED, |
Ashutosh Singh | f4d8867 | 2017-11-29 13:35:43 +0000 | [diff] [blame] | 31 | TFM_ERROR_SECURE_DOMAIN_LOCKED, |
| 32 | TFM_ERROR_INVALID_PARAMETER, |
Mate Toth-Pal | 7de74b5 | 2018-02-23 15:46:47 +0100 | [diff] [blame] | 33 | TFM_ERROR_PARTITION_NON_REENTRANT, |
Ashutosh Singh | f4d8867 | 2017-11-29 13:35:43 +0000 | [diff] [blame] | 34 | TFM_ERROR_NS_THREAD_MODE_CALL, |
| 35 | TFM_ERROR_INVALID_EXC_MODE, |
| 36 | TFM_SECURE_LOCK_FAILED, |
| 37 | TFM_SECURE_UNLOCK_FAILED, |
| 38 | TFM_ERROR_GENERIC = 0x1F, |
Mate Toth-Pal | 7de74b5 | 2018-02-23 15:46:47 +0100 | [diff] [blame] | 39 | TFM_PARTITION_SPECIFIC_ERROR_MIN, |
Ashutosh Singh | f4d8867 | 2017-11-29 13:35:43 +0000 | [diff] [blame] | 40 | }; |
| 41 | |
| 42 | //==================== Secure function declarations ==========================// |
| 43 | |
Mate Toth-Pal | ce61afa | 2018-08-03 13:51:01 +0200 | [diff] [blame^] | 44 | /** |
| 45 | * \brief Assign client ID to the current TZ context |
| 46 | * |
| 47 | * \param[in] ns_client_id The client ID to be assigned to the current |
| 48 | * context |
| 49 | * \return TFM_SUCCESS if the client ID assigned successfully, an error code |
| 50 | * according to \ref tfm_status_e in case of error. |
| 51 | * |
| 52 | * \note This function have to be called from handler mode. |
| 53 | */ |
| 54 | enum tfm_status_e tfm_register_client_id (int32_t ns_client_id); |
Ashutosh Singh | f4d8867 | 2017-11-29 13:35:43 +0000 | [diff] [blame] | 55 | |
| 56 | //================ End Secure function declarations ==========================// |
| 57 | |
| 58 | #ifdef __cplusplus |
| 59 | } |
| 60 | #endif |
| 61 | |
| 62 | #endif /* __TFM_API_H__ */ |