1 /*
2  * Copyright (c) 2020-2023, Arm Limited and Contributors. All rights reserved.
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  */
6 
7 #ifndef PSA_STORAGE_COMMON_H
8 #define PSA_STORAGE_COMMON_H
9 
10 #include <psa/error.h>
11 #include <stddef.h>
12 #include <stdint.h>
13 
14 #ifdef __cplusplus
15 extern "C" {
16 #endif
17 
18 /* Types */
19 typedef uint64_t psa_storage_uid_t;
20 typedef uint32_t psa_storage_create_flags_t;
21 
22 struct psa_storage_info_t {
23 	uint32_t capacity;
24 	uint32_t size;
25 	psa_storage_create_flags_t flags;
26 };
27 
28 /* Storage flags */
29 #define PSA_STORAGE_FLAG_NONE			(0u)
30 #define PSA_STORAGE_FLAG_WRITE_ONCE		(1u << 0)
31 #define PSA_STORAGE_FLAG_NO_CONFIDENTIALITY	(1u << 1)
32 #define PSA_STORAGE_FLAG_NO_REPLAY_PROTECTION	(1u << 2)
33 #define PSA_STORAGE_SUPPORT_SET_EXTENDED	(1u << 0)
34 
35 /* Status codes */
36 #define PSA_ERROR_INVALID_SIGNATURE		((psa_status_t)-149)
37 #define PSA_ERROR_DATA_CORRUPT			((psa_status_t)-152)
38 
39 #ifdef __cplusplus
40 }
41 #endif
42 
43 #endif /* PSA_STORAGE_COMMON_H */
44