blob: c450c7ce379ba9b06f705d30445a90552bcd3767 [file] [log] [blame]
Ashutosh Singhf4d88672017-11-29 13:35:43 +00001/*
Mate Toth-Pal7de74b52018-02-23 15:46:47 +01002 * Copyright (c) 2017-2018, Arm Limited. All rights reserved.
Ashutosh Singhf4d88672017-11-29 13:35:43 +00003 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 *
6 */
7
8#ifndef __TFM_API_H__
9#define __TFM_API_H__
10
11#ifdef __cplusplus
12extern "C" {
13#endif
14
Mate Toth-Palce61afa2018-08-03 13:51:01 +020015#include <stdint.h>
16
Ashutosh Singhf4d88672017-11-29 13:35:43 +000017/* 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 */
25enum tfm_status_e
26{
27 TFM_SUCCESS = 0,
Mate Toth-Pal7de74b52018-02-23 15:46:47 +010028 TFM_PARTITION_PENDED,
29 TFM_PARTITION_BUSY,
30 TFM_ERROR_PARTITION_ALREADY_PENDED,
Ashutosh Singhf4d88672017-11-29 13:35:43 +000031 TFM_ERROR_SECURE_DOMAIN_LOCKED,
32 TFM_ERROR_INVALID_PARAMETER,
Mate Toth-Pal7de74b52018-02-23 15:46:47 +010033 TFM_ERROR_PARTITION_NON_REENTRANT,
Ashutosh Singhf4d88672017-11-29 13:35:43 +000034 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-Pal7de74b52018-02-23 15:46:47 +010039 TFM_PARTITION_SPECIFIC_ERROR_MIN,
Ashutosh Singhf4d88672017-11-29 13:35:43 +000040};
41
42//==================== Secure function declarations ==========================//
43
Mate Toth-Palce61afa2018-08-03 13:51:01 +020044/**
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 */
54enum tfm_status_e tfm_register_client_id (int32_t ns_client_id);
Ashutosh Singhf4d88672017-11-29 13:35:43 +000055
56//================ End Secure function declarations ==========================//
57
58#ifdef __cplusplus
59}
60#endif
61
62#endif /* __TFM_API_H__ */