Skip to content

Commit 0e74e09

Browse files
author
Oren Cohen
committed
Set default PSA client header for single v7 targets
1 parent 737a3cc commit 0e74e09

File tree

2 files changed

+40
-2
lines changed

2 files changed

+40
-2
lines changed

components/TARGET_PSA/inc/psa/client.h

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,43 @@
1717

1818
#if defined(TARGET_TFM)
1919
#include "interface/include/psa_client.h"
20-
#else
20+
#elif defined(TARGET_MBED_SPM)
2121
#include "TARGET_MBED_SPM/psa_defs.h"
2222
#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__
2359
#endif

components/TARGET_PSA/inc/psa/service.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,10 @@
2121
{ \
2222
while(1){}; \
2323
}
24-
#else
24+
#elif defined(TARGET_MBED_SPM)
2525
#include "TARGET_MBED_SPM/psa_defs.h"
2626
#include "TARGET_MBED_SPM/COMPONENT_SPE/spm_server.h"
2727
#include "TARGET_MBED_SPM/COMPONENT_SPE/spm_panic.h"
28+
#else
29+
#error "Compiling psa service header on non-secure target is not allowed"
2830
#endif

0 commit comments

Comments
 (0)