TF-M Reference Manual  1.2.0
TrustedFirmware-M
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
ps_object_table.h File Reference
#include <stdint.h>
#include "psa/protected_storage.h"
Include dependency graph for ps_object_table.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  ps_obj_table_info_t
 Object table information structure. More...
 

Functions

psa_status_t ps_object_table_create (void)
 Creates object table. More...
 
psa_status_t ps_object_table_init (uint8_t *obj_data)
 Initializes object table. More...
 
psa_status_t ps_object_table_obj_exist (psa_storage_uid_t uid, int32_t client_id)
 Checks if there is an entry in the table for the provided UID and client ID pair. More...
 
psa_status_t ps_object_table_get_free_fid (uint32_t fid_num, uint32_t *p_fid)
 Gets a not in use file ID. More...
 
psa_status_t ps_object_table_set_obj_tbl_info (psa_storage_uid_t uid, int32_t client_id, const struct ps_obj_table_info_t *obj_tbl_info)
 Sets object table information in the object table and stores it persistently, for the provided UID and client ID pair. More...
 
psa_status_t ps_object_table_get_obj_tbl_info (psa_storage_uid_t uid, int32_t client_id, struct ps_obj_table_info_t *obj_tbl_info)
 Gets object table information from the object table for the provided UID and client ID pair. More...
 
psa_status_t ps_object_table_delete_object (psa_storage_uid_t uid, int32_t client_id)
 Deletes the table entry for the provided UID and client ID pair. More...
 
psa_status_t ps_object_table_delete_old_table (void)
 Deletes old object table from the persistent area. More...
 

Function Documentation

psa_status_t ps_object_table_create ( void  )

Creates object table.

Returns
Returns error code as specified in psa_status_t

Definition at line 809 of file ps_object_table.c.

Here is the call graph for this function:

Here is the caller graph for this function:

psa_status_t ps_object_table_delete_object ( psa_storage_uid_t  uid,
int32_t  client_id 
)

Deletes the table entry for the provided UID and client ID pair.

Parameters
[in]uidIdentifier for the data.
[in]client_idIdentifier of the asset’s owner (client)
Returns
Returns error code as specified in psa_status_t

Definition at line 1020 of file ps_object_table.c.

Here is the call graph for this function:

Here is the caller graph for this function:

psa_status_t ps_object_table_delete_old_table ( void  )

Deletes old object table from the persistent area.

Returns
Returns error code as specified in psa_status_t

Definition at line 1056 of file ps_object_table.c.

Here is the call graph for this function:

Here is the caller graph for this function:

psa_status_t ps_object_table_get_free_fid ( uint32_t  fid_num,
uint32_t *  p_fid 
)

Gets a not in use file ID.

Parameters
[in]fid_numAmount of file IDs that the function will check are free before returning one. 0 is an invalid input and will error. Note that this function will only ever return 1 file ID.
[out]p_fidPointer to the location to store the file ID
Returns
Returns PSA_SUCCESS if the fid is valid and fid_num - 1 entries are still free in the table. Otherwise, it returns an error code as specified in psa_status_t

Definition at line 908 of file ps_object_table.c.

Here is the call graph for this function:

Here is the caller graph for this function:

psa_status_t ps_object_table_get_obj_tbl_info ( psa_storage_uid_t  uid,
int32_t  client_id,
struct ps_obj_table_info_t obj_tbl_info 
)

Gets object table information from the object table for the provided UID and client ID pair.

Parameters
[in]uidIdentifier for the data.
[in]client_idIdentifier of the asset’s owner (client)
[out]obj_tbl_infoPointer to the location to store object table information
Returns
Returns PSA_SUCCESS if the object exists. Otherwise, it returns PSA_ERROR_DOES_NOT_EXIST.

Definition at line 995 of file ps_object_table.c.

Here is the call graph for this function:

Here is the caller graph for this function:

psa_status_t ps_object_table_init ( uint8_t *  obj_data)

Initializes object table.

Parameters
[in,out]obj_dataPointer to the static object data allocated in other to reuse that memory to allocated a temporary object table.
Returns
Returns error code as specified in psa_status_t

Definition at line 829 of file ps_object_table.c.

Here is the call graph for this function:

Here is the caller graph for this function:

psa_status_t ps_object_table_obj_exist ( psa_storage_uid_t  uid,
int32_t  client_id 
)

Checks if there is an entry in the table for the provided UID and client ID pair.

Parameters
[in]uidIdentifier for the data
[in]client_idIdentifier of the asset’s owner (client)
Returns
Returns error code as specified in psa_status_t
Return values
PSA_SUCCESSIf there is a table entry for the object
PSA_ERROR_DOES_NOT_EXISTIf no table entry exists for the object

Definition at line 900 of file ps_object_table.c.

psa_status_t ps_object_table_set_obj_tbl_info ( psa_storage_uid_t  uid,
int32_t  client_id,
const struct ps_obj_table_info_t obj_tbl_info 
)

Sets object table information in the object table and stores it persistently, for the provided UID and client ID pair.

Parameters
[in]uidIdentifier for the data.
[in]client_idIdentifier of the asset’s owner (client)
[in]obj_tbl_infoPointer to the location to store object table information ps_obj_table_info_t
Note
A call to this function results in writing the table to the file system.
Returns
Returns error code as specified in psa_status_t

Definition at line 939 of file ps_object_table.c.

Here is the call graph for this function:

Here is the caller graph for this function: