Jamie Fox | 520fb4d | 2019-06-13 14:27:21 +0100 | [diff] [blame] | 1 | /* |
Sherry Zhang | 07b4241 | 2021-01-07 14:19:41 +0800 | [diff] [blame] | 2 | * Copyright (c) 2019-2021, Arm Limited. All rights reserved. |
Jamie Fox | 520fb4d | 2019-06-13 14:27:21 +0100 | [diff] [blame] | 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | * |
| 6 | */ |
| 7 | |
| 8 | /** |
| 9 | * \file psa/error.h |
| 10 | * \brief Standard error codes for the SPM and RoT Services |
| 11 | */ |
| 12 | |
| 13 | #ifndef __PSA_ERROR_H__ |
| 14 | #define __PSA_ERROR_H__ |
| 15 | |
| 16 | #include <stdint.h> |
| 17 | |
| 18 | #ifdef __cplusplus |
| 19 | extern "C" { |
| 20 | #endif |
| 21 | |
David Vincze | 7aa5203 | 2019-11-14 14:40:34 +0100 | [diff] [blame] | 22 | /* If #PSA_SUCCESS is already defined, it means that #psa_status_t |
| 23 | * is also defined in an external header, so prevent its multiple |
| 24 | * definition. |
| 25 | */ |
| 26 | #ifndef PSA_SUCCESS |
Jamie Fox | 520fb4d | 2019-06-13 14:27:21 +0100 | [diff] [blame] | 27 | typedef int32_t psa_status_t; |
David Vincze | 7aa5203 | 2019-11-14 14:40:34 +0100 | [diff] [blame] | 28 | #endif |
Jamie Fox | 520fb4d | 2019-06-13 14:27:21 +0100 | [diff] [blame] | 29 | |
| 30 | #define PSA_SUCCESS ((psa_status_t)0) |
Sherry Zhang | 07b4241 | 2021-01-07 14:19:41 +0800 | [diff] [blame] | 31 | #define PSA_SUCCESS_REBOOT ((psa_status_t)1) |
| 32 | #define PSA_SUCCESS_RESTART ((psa_status_t)2) |
Jamie Fox | 520fb4d | 2019-06-13 14:27:21 +0100 | [diff] [blame] | 33 | |
| 34 | #define PSA_ERROR_PROGRAMMER_ERROR ((psa_status_t)-129) |
| 35 | #define PSA_ERROR_CONNECTION_REFUSED ((psa_status_t)-130) |
| 36 | #define PSA_ERROR_CONNECTION_BUSY ((psa_status_t)-131) |
| 37 | #define PSA_ERROR_GENERIC_ERROR ((psa_status_t)-132) |
| 38 | #define PSA_ERROR_NOT_PERMITTED ((psa_status_t)-133) |
| 39 | #define PSA_ERROR_NOT_SUPPORTED ((psa_status_t)-134) |
| 40 | #define PSA_ERROR_INVALID_ARGUMENT ((psa_status_t)-135) |
| 41 | #define PSA_ERROR_INVALID_HANDLE ((psa_status_t)-136) |
| 42 | #define PSA_ERROR_BAD_STATE ((psa_status_t)-137) |
| 43 | #define PSA_ERROR_BUFFER_TOO_SMALL ((psa_status_t)-138) |
| 44 | #define PSA_ERROR_ALREADY_EXISTS ((psa_status_t)-139) |
| 45 | #define PSA_ERROR_DOES_NOT_EXIST ((psa_status_t)-140) |
| 46 | #define PSA_ERROR_INSUFFICIENT_MEMORY ((psa_status_t)-141) |
| 47 | #define PSA_ERROR_INSUFFICIENT_STORAGE ((psa_status_t)-142) |
| 48 | #define PSA_ERROR_INSUFFICIENT_DATA ((psa_status_t)-143) |
| 49 | #define PSA_ERROR_SERVICE_FAILURE ((psa_status_t)-144) |
| 50 | #define PSA_ERROR_COMMUNICATION_FAILURE ((psa_status_t)-145) |
| 51 | #define PSA_ERROR_STORAGE_FAILURE ((psa_status_t)-146) |
| 52 | #define PSA_ERROR_HARDWARE_FAILURE ((psa_status_t)-147) |
| 53 | #define PSA_ERROR_INVALID_SIGNATURE ((psa_status_t)-149) |
Sherry Zhang | 07b4241 | 2021-01-07 14:19:41 +0800 | [diff] [blame] | 54 | #define PSA_ERROR_DEPENDENCY_NEEDED ((psa_status_t)-156) |
| 55 | #define PSA_ERROR_CURRENTLY_INSTALLING ((psa_status_t)-157) |
Jamie Fox | 520fb4d | 2019-06-13 14:27:21 +0100 | [diff] [blame] | 56 | #ifdef __cplusplus |
| 57 | } |
| 58 | #endif |
| 59 | |
| 60 | #endif /* __PSA_ERROR_H__ */ |