22 #define ITS_BUF_SIZE ITS_MAX_ASSET_SIZE
40 return (client_id ==
TFM_SP_PS) ? &fs_ctx_ps : &fs_ctx_its;
50 static void tfm_its_get_fid(int32_t client_id,
54 tfm_memcpy(fid, (
const void *)&client_id,
sizeof(client_id));
55 tfm_memcpy(fid +
sizeof(client_id), (
const void *)&uid,
sizeof(uid));
65 #ifdef ITS_CREATE_FLASH_LAYOUT
92 #ifdef TFM_PARTITION_PROTECTED_STORAGE
96 #ifdef PS_CREATE_FLASH_LAYOUT
151 tfm_its_get_fid(client_id, uid, g_fid);
171 flags = (uint32_t)create_flags |
186 data_length, write_size, offset,
195 offset += write_size;
196 data_length -= write_size;
197 }
while (data_length > 0);
206 size_t *p_data_length)
211 #ifdef TFM_PARTITION_TEST_PS
226 tfm_its_get_fid(client_id, uid, g_fid);
245 *p_data_length = data_size;
256 data_offset, asset_data);
265 data_offset += read_size;
266 data_size -= read_size;
267 }
while (data_size > 0);
283 tfm_its_get_fid(client_id, uid, g_fid);
304 #ifdef TFM_PARTITION_TEST_PS
319 tfm_its_get_fid(client_id, uid, g_fid);
#define PSA_STORAGE_FLAG_NO_CONFIDENTIALITY
psa_status_t its_flash_fs_file_get_info(struct its_flash_fs_ctx_t *fs_ctx, const uint8_t *fid, struct its_file_info_t *info)
Gets the file information referenced by the file ID.
psa_status_t its_flash_fs_prepare(struct its_flash_fs_ctx_t *fs_ctx, const struct its_flash_info_t *flash_info)
Prepares the filesystem to accept operations on the files.
Internal Trusted Storage service filesystem abstraction APIs. The purpose of this abstraction is to h...
psa_status_t tfm_its_get_info(int32_t client_id, psa_storage_uid_t uid, struct psa_storage_info_t *p_info)
Retrieve the metadata about the provided uid.
#define PSA_STORAGE_FLAG_WRITE_ONCE
psa_status_t its_flash_fs_file_write(struct its_flash_fs_ctx_t *fs_ctx, const uint8_t *fid, uint32_t flags, size_t max_size, size_t data_size, size_t offset, const uint8_t *data)
Writes data to a file.
#define PSA_ERROR_INVALID_ARGUMENT
psa_status_t its_flash_fs_file_read(struct its_flash_fs_ctx_t *fs_ctx, const uint8_t *fid, size_t size, size_t offset, uint8_t *data)
Reads data from an existing file.
#define PSA_ERROR_NOT_PERMITTED
#define ITS_FLASH_MAX_ALIGNMENT
Provides a compile-time constant for the maximum program unit required by any flash device that can b...
psa_status_t its_flash_fs_file_delete(struct its_flash_fs_ctx_t *fs_ctx, const uint8_t *fid)
Deletes file referenced by the file ID.
const struct its_flash_info_t * its_flash_get_info(enum its_flash_id_t id)
Gets the flash info structure for the provided flash device.
psa_status_t tfm_its_remove(int32_t client_id, psa_storage_uid_t uid)
Remove the provided uid and its associated data from the storage.
#define PSA_STORAGE_FLAG_NO_REPLAY_PROTECTION
#define PSA_ERROR_NOT_SUPPORTED
psa_status_t tfm_its_get(int32_t client_id, psa_storage_uid_t uid, size_t data_offset, size_t data_size, size_t *p_data_length)
Retrieve data associated with a provided UID.
psa_status_t tfm_its_set(int32_t client_id, psa_storage_uid_t uid, size_t data_length, psa_storage_create_flags_t create_flags)
Create a new, or modify an existing, uid/value pair.
__STATIC_INLINE void * tfm_memcpy(void *dest, const void *src, size_t num)
void its_req_mngr_write(const uint8_t *buf, size_t num_bytes)
Writes asset data to the caller.
uint64_t psa_storage_uid_t
psa_status_t tfm_its_init(void)
Initializes the internal trusted storage system.
#define ITS_FLASH_FS_FLAG_CREATE
#define TFM_ITS_INVALID_UID
psa_status_t its_flash_fs_wipe_all(struct its_flash_fs_ctx_t *fs_ctx)
Wipes all files from the filesystem.
Structure to store the file information.
psa_storage_create_flags_t flags
Structure to store the ITS flash file system context.
#define PSA_ERROR_DOES_NOT_EXIST
uint32_t psa_storage_create_flags_t
int32_t psa_status_t
Function return status.
#define ITS_UTILS_ALIGN(x, a)
Aligns a value up to the provided alignment.
#define ITS_UTILS_MIN(x, y)
Evaluates to the minimum of the two parameters.
#define ITS_FLASH_FS_FLAG_TRUNCATE
size_t its_req_mngr_read(uint8_t *buf, size_t num_bytes)
Reads asset data from the caller.