![]() |
TF-M Reference Manual
1.2.0
TrustedFirmware-M
|
#include "ps_object_system.h"
#include <stddef.h>
#include "cmsis_compiler.h"
#include "psa/internal_trusted_storage.h"
#include "tfm_memory_utils.h"
#include "ps_object_defs.h"
#include "ps_object_table.h"
#include "ps_utils.h"
#include "tfm_ps_req_mngr.h"
Go to the source code of this file.
Macros | |
#define | PS_OBJECT_SIZE(max_size) (PS_OBJECT_HEADER_SIZE + (max_size)) |
#define | PS_OBJECT_START_POSITION 0 |
Enumerations | |
enum | read_type_t { READ_HEADER_ONLY = 0, READ_ALL_OBJECT } |
Functions | |
__STATIC_INLINE void | ps_init_empty_object (psa_storage_create_flags_t create_flags, uint32_t size, struct ps_object_t *obj) |
Initialize g_ps_object based on the input parameters and empty data. More... | |
psa_status_t | ps_system_prepare (void) |
Prepares the protected storage system for usage, populating internal structures. It identifies and validates the system metadata. More... | |
psa_status_t | ps_object_read (psa_storage_uid_t uid, int32_t client_id, uint32_t offset, uint32_t size, size_t *p_data_length) |
Gets the data of the object with the provided UID and client ID. More... | |
psa_status_t | ps_object_create (psa_storage_uid_t uid, int32_t client_id, psa_storage_create_flags_t create_flags, uint32_t size) |
Creates a new object with the provided UID and client ID. More... | |
psa_status_t | ps_object_write (psa_storage_uid_t uid, int32_t client_id, uint32_t offset, uint32_t size) |
Writes data into the object with the provided UID and client ID. More... | |
psa_status_t | ps_object_get_info (psa_storage_uid_t uid, int32_t client_id, struct psa_storage_info_t *info) |
Gets the asset information for the object with the provided UID and client ID. More... | |
psa_status_t | ps_object_delete (psa_storage_uid_t uid, int32_t client_id) |
Deletes the object with the provided UID and client ID. More... | |
psa_status_t | ps_system_wipe_all (void) |
Wipes the protected storage system and all object data. More... | |
#define PS_OBJECT_SIZE | ( | max_size | ) | (PS_OBJECT_HEADER_SIZE + (max_size)) |
Definition at line 25 of file ps_object_system.c.
#define PS_OBJECT_START_POSITION 0 |
Definition at line 26 of file ps_object_system.c.
enum read_type_t |
Enumerator | |
---|---|
READ_HEADER_ONLY | |
READ_ALL_OBJECT |
Definition at line 82 of file ps_object_system.c.
__STATIC_INLINE void ps_init_empty_object | ( | psa_storage_create_flags_t | create_flags, |
uint32_t | size, | ||
struct ps_object_t * | obj | ||
) |
Initialize g_ps_object based on the input parameters and empty data.
[in] | create_flags | Object create flags |
[in] | size | Object size |
[out] | obj | Object to initialize |
Definition at line 42 of file ps_object_system.c.
psa_status_t ps_object_create | ( | psa_storage_uid_t | uid, |
int32_t | client_id, | ||
psa_storage_create_flags_t | create_flags, | ||
uint32_t | size | ||
) |
Creates a new object with the provided UID and client ID.
[in] | uid | Unique identifier for the data |
[in] | client_id | Identifier of the asset's owner (client) |
[in] | create_flags | Flags indicating the properties of the data |
[in] | size | Size of the contents of data in bytes |
Definition at line 222 of file ps_object_system.c.
psa_status_t ps_object_delete | ( | psa_storage_uid_t | uid, |
int32_t | client_id | ||
) |
Deletes the object with the provided UID and client ID.
[in] | uid | Unique identifier for the data |
[in] | client_id | Identifier of the asset's owner (client) |
Definition at line 476 of file ps_object_system.c.
psa_status_t ps_object_get_info | ( | psa_storage_uid_t | uid, |
int32_t | client_id, | ||
struct psa_storage_info_t * | info | ||
) |
Gets the asset information for the object with the provided UID and client ID.
[in] | uid | Unique identifier for the data |
[in] | client_id | Identifier of the asset's owner (client) |
[out] | info | Pointer to the psa_storage_info_t struct that will be populated with the metadata |
Definition at line 442 of file ps_object_system.c.
psa_status_t ps_object_read | ( | psa_storage_uid_t | uid, |
int32_t | client_id, | ||
uint32_t | offset, | ||
uint32_t | size, | ||
size_t * | p_data_length | ||
) |
Gets the data of the object with the provided UID and client ID.
[in] | uid | Unique identifier for the data |
[in] | client_id | Identifier of the asset's owner (client) |
[in] | offset | Offset in the object at which to begin the read |
[in] | size | Size of the contents of data in bytes |
[out] | p_data_length | On success, this will contain size of the data written to asset |
Definition at line 175 of file ps_object_system.c.
psa_status_t ps_object_write | ( | psa_storage_uid_t | uid, |
int32_t | client_id, | ||
uint32_t | offset, | ||
uint32_t | size | ||
) |
Writes data into the object with the provided UID and client ID.
[in] | uid | Unique identifier for the data |
[in] | client_id | Identifier of the asset's owner (client) |
[in] | offset | Offset in the object at which to begin the write |
[in] | size | Size of the contents of data in bytes |
Definition at line 337 of file ps_object_system.c.
psa_status_t ps_system_prepare | ( | void | ) |
Prepares the protected storage system for usage, populating internal structures. It identifies and validates the system metadata.
Definition at line 157 of file ps_object_system.c.
psa_status_t ps_system_wipe_all | ( | void | ) |
Wipes the protected storage system and all object data.
Definition at line 522 of file ps_object_system.c.