Mistake on this page?
Report an issue in GitHub or email us
storage_common.h
Go to the documentation of this file.
1 /* Copyright (C) 2019, ARM Limited, All Rights Reserved
2  * SPDX-License-Identifier: Apache-2.0
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License"); you may
5  * not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 /** @file
18 @brief This file includes common definitions for PSA storage
19 */
20 
21 #ifndef __PSA_STORAGE_COMMON_H__
22 #define __PSA_STORAGE_COMMON_H__
23 
24 #include <stddef.h>
25 #include <stdint.h>
26 #include "psa/error.h"
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
32 /** \brief Flags used when creating a data entry
33  */
34 typedef uint32_t psa_storage_create_flags_t;
35 
36 #define PSA_STORAGE_FLAG_NONE 0 /**< No flags to pass */
37 #define PSA_STORAGE_FLAG_WRITE_ONCE (1 << 0) /**< The data associated with the uid will not be able to be modified or deleted. Intended to be used to set bits in `psa_storage_create_flags_t`*/
38 
39 /** \brief A type for UIDs used for identifying data
40  */
41 typedef uint64_t psa_storage_uid_t;
42 
43 /**
44  * \brief A container for metadata associated with a specific uid
45  */
47  uint32_t size; /**< The size of the data associated with a uid **/
48  psa_storage_create_flags_t flags; /**< The flags set when the uid was created **/
49 };
50 
51 /** \brief Flag indicating that \ref psa_storage_create and \ref psa_storage_set_extended are supported */
52 #define PSA_STORAGE_SUPPORT_SET_EXTENDED (1 << 0)
53 
54 /** \brief PSA storage specific error codes */
55 #define PSA_ERROR_DATA_CORRUPT ((psa_status_t)-152)
56 
57 #ifdef __cplusplus
58 }
59 #endif
60 
61 #endif // __PSA_STORAGE_COMMON_H__
uint32_t size
The size of the data associated with a uid.
uint64_t psa_storage_uid_t
A type for UIDs used for identifying data.
A container for metadata associated with a specific uid.
psa_storage_create_flags_t flags
The flags set when the uid was created.
uint32_t psa_storage_create_flags_t
Flags used when creating a data entry.
Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.