Antonio de Angelis | 05b2419 | 2019-07-04 15:28:46 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2017-2019, Arm Limited. All rights reserved. |
| 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | * |
| 6 | */ |
| 7 | #ifndef __TFM_NS_INTERFACE_H__ |
| 8 | #define __TFM_NS_INTERFACE_H__ |
| 9 | |
| 10 | #ifdef __cplusplus |
| 11 | extern "C" { |
| 12 | #endif |
| 13 | |
| 14 | #include <stdint.h> |
| 15 | #include "tfm_api.h" |
| 16 | |
| 17 | typedef int32_t (*veneer_fn) (uint32_t arg0, uint32_t arg1, |
| 18 | uint32_t arg2, uint32_t arg3); |
| 19 | |
| 20 | /** |
| 21 | * \brief NS interface, veneer function dispatcher |
| 22 | * |
| 23 | * \details This function implements the dispatching mechanism for the |
| 24 | * desired veneer function, to be called with the parameters |
| 25 | * described from arg0 to arg3. |
| 26 | * |
| 27 | * \param[in] fn Function pointer to the veneer function desired |
| 28 | * \param[in] arg0 Argument 0 |
| 29 | * \param[in] arg1 Argument 1 |
| 30 | * \param[in] arg2 Argument 2 |
| 31 | * \param[in] arg3 Argument 3 |
| 32 | * |
| 33 | * \return Returns the same return value of the requested veneer function |
| 34 | */ |
Kevin Peng | c86dec0 | 2019-07-23 16:15:57 +0800 | [diff] [blame] | 35 | int32_t tfm_ns_interface_dispatch(veneer_fn fn, |
| 36 | uint32_t arg0, uint32_t arg1, |
| 37 | uint32_t arg2, uint32_t arg3); |
Antonio de Angelis | 05b2419 | 2019-07-04 15:28:46 +0100 | [diff] [blame] | 38 | |
| 39 | /** |
| 40 | * \brief NS interface, Initialise the NS interface |
| 41 | * |
| 42 | * \details This function needs to be called from the NS world to |
| 43 | * properly initialise the NS interface towards TF-M. This |
| 44 | * function will initialise all the objects required for |
| 45 | * runtime dispatching of TF-M requests to services |
| 46 | * |
| 47 | * \return A value according to \ref enum tfm_status_e |
| 48 | */ |
Kevin Peng | c86dec0 | 2019-07-23 16:15:57 +0800 | [diff] [blame] | 49 | enum tfm_status_e tfm_ns_interface_init(void); |
Antonio de Angelis | 05b2419 | 2019-07-04 15:28:46 +0100 | [diff] [blame] | 50 | #ifdef __cplusplus |
| 51 | } |
| 52 | #endif |
| 53 | |
| 54 | #endif /* __TFM_NS_INTERFACE_H__ */ |