|
17 | 17 |
|
18 | 18 | #if defined(TARGET_TFM)
|
19 | 19 | #include "interface/include/psa_client.h"
|
20 |
| -#else |
| 20 | +#elif defined(TARGET_MBED_SPM) |
21 | 21 | #include "TARGET_MBED_SPM/psa_defs.h"
|
22 | 22 | #include "TARGET_MBED_SPM/spm_client.h"
|
| 23 | +#else |
| 24 | + |
| 25 | +#ifndef __MBED_OS_DEFAULT_PSA_CLIENT_API_H__ |
| 26 | +#define __MBED_OS_DEFAULT_PSA_CLIENT_API_H__ |
| 27 | + |
| 28 | +#if !defined(UINT32_MAX) |
| 29 | +#define UINT32_MAX ((uint32_t)-1) |
| 30 | +#endif |
| 31 | + |
| 32 | +#if !defined(INT32_MIN) |
| 33 | +#define INT32_MIN (-0x7fffffff - 1) |
| 34 | +#endif |
| 35 | + |
| 36 | +#define PSA_FRAMEWORK_VERSION (0x0100) /**< Version of the PSA Framework API. */ |
| 37 | +#define PSA_VERSION_NONE (0L) /**< Identifier for an unimplemented Root of Trust (RoT) Service. */ |
| 38 | +#define PSA_SUCCESS (0L) /**< A general result code for calls to psa_call() indicating success.*/ |
| 39 | +#define PSA_CONNECTION_REFUSED (INT32_MIN + 1) /**< The return value from psa_connect() if the RoT Service or SPM was unable to establish a connection.*/ |
| 40 | +#define PSA_CONNECTION_BUSY (INT32_MIN + 2) /**< The return value from psa_connect() if the RoT Service rejects the connection for a transient reason.*/ |
| 41 | +#define PSA_DROP_CONNECTION (INT32_MIN) /**< The result code in a call to psa_reply() to indicate a nonrecoverable error in the client.*/ |
| 42 | +#define PSA_NULL_HANDLE ((psa_handle_t)0) /**< Denotes an invalid handle.*/ |
| 43 | + |
| 44 | +typedef int32_t psa_status_t; |
| 45 | +typedef int32_t psa_handle_t; |
| 46 | + |
| 47 | +typedef struct psa_invec { |
| 48 | + const void *base; /**< Starting address of the buffer.*/ |
| 49 | + size_t len; /**< Length in bytes of the buffer.*/ |
| 50 | +} psa_invec; |
| 51 | + |
| 52 | + |
| 53 | +typedef struct psa_outvec { |
| 54 | + void *base; /**< Starting address of the buffer.*/ |
| 55 | + size_t len; /**< Length in bytes of the buffer.*/ |
| 56 | +} psa_outvec; |
| 57 | + |
| 58 | +#endif // __MBED_OS_DEFAULT_PSA_CLIENT_API_H__ |
23 | 59 | #endif
|
0 commit comments