Marc Moreno Berengue | 8e0fa7a | 2018-10-04 18:25:13 +0100 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright (c) 2018, Arm Limited. All rights reserved. |
| 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | * |
| 6 | */ |
| 7 | |
| 8 | #ifndef __TFM_PLATFORM_API__ |
| 9 | #define __TFM_PLATFORM_API__ |
| 10 | |
| 11 | #include <limits.h> |
| 12 | #include "tfm_api.h" |
| 13 | |
| 14 | #ifdef __cplusplus |
| 15 | extern "C" { |
| 16 | #endif |
| 17 | |
| 18 | /** |
| 19 | * \brief TFM secure partition platform API version |
| 20 | */ |
| 21 | #define TFM_PLATFORM_API_VERSION_MAJOR (0) |
| 22 | #define TFM_PLATFORM_API_VERSION_MINOR (1) |
| 23 | |
| 24 | /* The return value is shared with the TF-M partition status value. |
| 25 | * The Platform return codes shouldn't overlap with predefined TFM status |
| 26 | * values. |
| 27 | */ |
| 28 | #define TFM_PLATFORM_ERR_OFFSET (TFM_PARTITION_SPECIFIC_ERROR_MIN) |
| 29 | |
| 30 | /*! |
| 31 | * \enum tfm_platform_err_t |
| 32 | * |
| 33 | * \brief Platform service error types |
| 34 | * |
| 35 | */ |
| 36 | enum tfm_platform_err_t { |
| 37 | TFM_PLATFORM_ERR_SUCCESS = 0, |
| 38 | TFM_PLATFORM_ERR_SYSTEM_ERROR = TFM_PLATFORM_ERR_OFFSET, |
| 39 | |
| 40 | /* Following entry is only to ensure the error code of int size */ |
| 41 | TFM_PLATFORM_ERR_FORCE_INT_SIZE = INT_MAX |
| 42 | }; |
| 43 | |
| 44 | /*! |
| 45 | * \brief Resets the system. |
| 46 | * |
| 47 | * \return Returns values as specified by the \ref tfm_platform_err_t |
| 48 | */ |
| 49 | enum tfm_platform_err_t tfm_platform_system_reset(void); |
| 50 | |
| 51 | #ifdef __cplusplus |
| 52 | } |
| 53 | #endif |
| 54 | |
| 55 | #endif /* __TFM_PLATFORM_API__ */ |