![]() |
TF-M Reference Manual
1.2.0
TrustedFirmware-M
|
#include "its_flash_fs.h"
#include <stdbool.h>
#include "its_flash_fs_dblock.h"
#include "tfm_memory_utils.h"
#include "its_utils.h"
Go to the source code of this file.
Macros | |
#define | ITS_FLASH_FS_INTERNAL_FLAGS_MASK (UINT32_MAX - ((1U << 24) - 1)) |
#define | ITS_FLASH_FS_FLAG_DELETE (1U << 24) |
Functions | |
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. More... | |
psa_status_t | its_flash_fs_wipe_all (struct its_flash_fs_ctx_t *fs_ctx) |
Wipes all files from the filesystem. More... | |
psa_status_t | its_flash_fs_file_exist (struct its_flash_fs_ctx_t *fs_ctx, const uint8_t *fid) |
Checks if a file exists in the filesystem. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
psa_status_t | its_flash_fs_validate_params (const struct its_flash_info_t *info) |
Validates the configuration of the flash filesystem. More... | |
#define ITS_FLASH_FS_FLAG_DELETE (1U << 24) |
Definition at line 20 of file its_flash_fs.c.
#define ITS_FLASH_FS_INTERNAL_FLAGS_MASK (UINT32_MAX - ((1U << 24) - 1)) |
Definition at line 18 of file its_flash_fs.c.
psa_status_t its_flash_fs_file_delete | ( | its_flash_fs_ctx_t * | fs_ctx, |
const uint8_t * | fid | ||
) |
Deletes file referenced by the file ID.
[in,out] | fs_ctx | Filesystem context |
[in] | fid | File ID |
Definition at line 454 of file its_flash_fs.c.
psa_status_t its_flash_fs_file_exist | ( | its_flash_fs_ctx_t * | fs_ctx, |
const uint8_t * | fid | ||
) |
Checks if a file exists in the filesystem.
[in,out] | fs_ctx | Filesystem context |
[in] | fid | File ID |
Definition at line 98 of file its_flash_fs.c.
psa_status_t its_flash_fs_file_get_info | ( | 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.
[in,out] | fs_ctx | Filesystem context |
[in] | fid | File ID |
[out] | info | Pointer to the information structure to store the file information values its_file_info_t |
Definition at line 112 of file its_flash_fs.c.
psa_status_t its_flash_fs_file_read | ( | 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.
[in,out] | fs_ctx | Filesystem context |
[in] | fid | File ID |
[in] | size | Size to be read |
[in] | offset | Offset in the file |
[out] | data | Pointer to buffer to store the data |
Definition at line 469 of file its_flash_fs.c.
psa_status_t its_flash_fs_file_write | ( | 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.
[in,out] | fs_ctx | Filesystem context |
[in] | fid | File ID |
[in] | flags | Flags of the file |
[in] | max_size | Maximum size of the file to be created. Ignored if the file is not being created. |
[in] | data_size | Size of the incoming write data. |
[in] | offset | Offset in the file to write. Must be less than or equal to the current file size. |
[in] | data | Pointer to buffer containing data to be written |
Definition at line 144 of file its_flash_fs.c.
psa_status_t its_flash_fs_prepare | ( | its_flash_fs_ctx_t * | fs_ctx, |
const struct its_flash_info_t * | flash_info | ||
) |
Prepares the filesystem to accept operations on the files.
[in,out] | fs_ctx | Filesystem context to prepare. Must have been initialised by the caller. |
[in] | flash_info | Struct containing information about the flash device to associate with the context. |
Definition at line 58 of file its_flash_fs.c.
psa_status_t its_flash_fs_validate_params | ( | const struct its_flash_info_t * | info | ) |
Validates the configuration of the flash filesystem.
This function checks that the flash block provided is compatible with the flash_fs described by the info parameter
[in] | info | Filesystem information |
Definition at line 541 of file its_flash_fs.c.
psa_status_t its_flash_fs_wipe_all | ( | its_flash_fs_ctx_t * | fs_ctx | ) |
Wipes all files from the filesystem.
[in,out] | fs_ctx | Filesystem context to wipe. Must be prepared again before further use. |
Definition at line 92 of file its_flash_fs.c.