|
TF-M Reference Manual
1.2.0
TrustedFirmware-M
|

Go to the source code of this file.
Macros | |
| #define | ITS_METADATA_BLOCK0 0 |
| #define | ITS_METADATA_BLOCK1 1 |
| #define | ITS_OTHER_META_BLOCK(metablock) |
| Macro to get the the swap metadata block. More... | |
| #define | ITS_BLOCK_META_HEADER_SIZE sizeof(struct its_metadata_block_header_t) |
| #define | ITS_BLOCK_METADATA_SIZE sizeof(struct its_block_meta_t) |
| #define | ITS_FILE_METADATA_SIZE sizeof(struct its_file_meta_t) |
Functions | |
| psa_status_t | its_flash_fs_mblock_cp_file_meta (struct its_flash_fs_ctx_t *fs_ctx, uint32_t idx_start, uint32_t idx_end) |
| Copies the file metadata entries between two indexes from the active metadata block to the scratch metadata block. More... | |
| uint32_t | its_flash_fs_mblock_cur_data_scratch_id (struct its_flash_fs_ctx_t *fs_ctx, uint32_t lblock) |
| Gets current scratch datablock physical ID. More... | |
| psa_status_t | its_flash_fs_mblock_get_file_idx (struct its_flash_fs_ctx_t *fs_ctx, const uint8_t *fid, uint32_t *idx) |
| Gets file metadata entry index. More... | |
| psa_status_t | its_flash_fs_mblock_get_file_idx_flag (struct its_flash_fs_ctx_t *fs_ctx, uint32_t flags, uint32_t *idx) |
| Gets file metadata entry index of the first file with one of the provided flags set. More... | |
| psa_status_t | its_flash_fs_mblock_init (struct its_flash_fs_ctx_t *fs_ctx) |
| Initializes metadata block with the valid/active metablock. More... | |
| psa_status_t | its_flash_fs_mblock_meta_update_finalize (struct its_flash_fs_ctx_t *fs_ctx) |
| Finalizes an update operation. Last step when a create/write/delete is performed. More... | |
| psa_status_t | its_flash_fs_mblock_migrate_lb0_data_to_scratch (struct its_flash_fs_ctx_t *fs_ctx) |
| Writes the files data area of logical block 0 into the scratch block. More... | |
| psa_status_t | its_flash_fs_mblock_read_file_meta (struct its_flash_fs_ctx_t *fs_ctx, uint32_t idx, struct its_file_meta_t *file_meta) |
| Reads specified file metadata. More... | |
| psa_status_t | its_flash_fs_mblock_read_block_metadata (struct its_flash_fs_ctx_t *fs_ctx, uint32_t lblock, struct its_block_meta_t *block_meta) |
| Reads specified logical block metadata. More... | |
| psa_status_t | its_flash_fs_mblock_reserve_file (struct its_flash_fs_ctx_t *fs_ctx, const uint8_t *fid, bool use_spare, size_t size, uint32_t flags, uint32_t *idx, struct its_file_meta_t *file_meta, struct its_block_meta_t *block_meta) |
| Reserves space for a file. More... | |
| psa_status_t | its_flash_fs_mblock_reset_metablock (struct its_flash_fs_ctx_t *fs_ctx) |
| Resets metablock by cleaning and initializing the metadatablock. More... | |
| void | its_flash_fs_mblock_set_data_scratch (struct its_flash_fs_ctx_t *fs_ctx, uint32_t phy_id, uint32_t lblock) |
| Sets current data scratch block. More... | |
| psa_status_t | its_flash_fs_mblock_update_scratch_block_meta (struct its_flash_fs_ctx_t *fs_ctx, uint32_t lblock, struct its_block_meta_t *block_meta) |
| Puts logical block's metadata in scratch metadata block. More... | |
| psa_status_t | its_flash_fs_mblock_update_scratch_file_meta (struct its_flash_fs_ctx_t *fs_ctx, uint32_t idx, const struct its_file_meta_t *file_meta) |
| Writes a file metadata entry into scratch metadata block. More... | |
| #define ITS_BLOCK_META_HEADER_SIZE sizeof(struct its_metadata_block_header_t) |
Definition at line 29 of file its_flash_fs_mblock.c.
| #define ITS_BLOCK_METADATA_SIZE sizeof(struct its_block_meta_t) |
Definition at line 30 of file its_flash_fs_mblock.c.
| #define ITS_FILE_METADATA_SIZE sizeof(struct its_file_meta_t) |
Definition at line 31 of file its_flash_fs_mblock.c.
| #define ITS_METADATA_BLOCK0 0 |
Definition at line 17 of file its_flash_fs_mblock.c.
| #define ITS_METADATA_BLOCK1 1 |
Definition at line 18 of file its_flash_fs_mblock.c.
| #define ITS_OTHER_META_BLOCK | ( | metablock | ) |
Macro to get the the swap metadata block.
Definition at line 25 of file its_flash_fs_mblock.c.
| psa_status_t its_flash_fs_mblock_cp_file_meta | ( | struct its_flash_fs_ctx_t * | fs_ctx, |
| uint32_t | idx_start, | ||
| uint32_t | idx_end | ||
| ) |
Copies the file metadata entries between two indexes from the active metadata block to the scratch metadata block.
| [in,out] | fs_ctx | Filesystem context |
| [in] | idx_start | File metadata entry index to start copy, inclusive |
| [in] | idx_end | File metadata entry index to end copy, exclusive |
Definition at line 716 of file its_flash_fs_mblock.c.


| uint32_t its_flash_fs_mblock_cur_data_scratch_id | ( | struct its_flash_fs_ctx_t * | fs_ctx, |
| uint32_t | lblock | ||
| ) |
Gets current scratch datablock physical ID.
| [in,out] | fs_ctx | Filesystem context |
| [in] | lblock | Logical block number |
Definition at line 733 of file its_flash_fs_mblock.c.

| psa_status_t its_flash_fs_mblock_get_file_idx | ( | struct its_flash_fs_ctx_t * | fs_ctx, |
| const uint8_t * | fid, | ||
| uint32_t * | idx | ||
| ) |
Gets file metadata entry index.
| [in,out] | fs_ctx | Filesystem context |
| [in] | fid | ID of the file |
| [out] | idx | Index of the file metadata in the file system |
Definition at line 745 of file its_flash_fs_mblock.c.


| psa_status_t its_flash_fs_mblock_get_file_idx_flag | ( | struct its_flash_fs_ctx_t * | fs_ctx, |
| uint32_t | flags, | ||
| uint32_t * | idx | ||
| ) |
Gets file metadata entry index of the first file with one of the provided flags set.
| [in,out] | fs_ctx | Filesystem context |
| [in] | flags | Flags to search for |
| [out] | idx | Index of the file metadata in the file system |
Definition at line 770 of file its_flash_fs_mblock.c.


| psa_status_t its_flash_fs_mblock_init | ( | struct its_flash_fs_ctx_t * | fs_ctx | ) |
Initializes metadata block with the valid/active metablock.
| [in,out] | fs_ctx | Filesystem context |
Definition at line 795 of file its_flash_fs_mblock.c.

| psa_status_t its_flash_fs_mblock_meta_update_finalize | ( | struct its_flash_fs_ctx_t * | fs_ctx | ) |
Finalizes an update operation. Last step when a create/write/delete is performed.
| [in,out] | fs_ctx | Filesystem context |
Definition at line 819 of file its_flash_fs_mblock.c.

| psa_status_t its_flash_fs_mblock_migrate_lb0_data_to_scratch | ( | struct its_flash_fs_ctx_t * | fs_ctx | ) |
Writes the files data area of logical block 0 into the scratch block.
| [in,out] | fs_ctx | Filesystem context |
Definition at line 843 of file its_flash_fs_mblock.c.


| psa_status_t its_flash_fs_mblock_read_block_metadata | ( | struct its_flash_fs_ctx_t * | fs_ctx, |
| uint32_t | lblock, | ||
| struct its_block_meta_t * | block_meta | ||
| ) |
Reads specified logical block metadata.
| [in,out] | fs_ctx | Filesystem context |
| [in] | lblock | Logical block number |
| [out] | block_meta | Pointer to block meta structure |
Definition at line 890 of file its_flash_fs_mblock.c.

| psa_status_t its_flash_fs_mblock_read_file_meta | ( | struct its_flash_fs_ctx_t * | fs_ctx, |
| uint32_t | idx, | ||
| struct its_file_meta_t * | file_meta | ||
| ) |
Reads specified file metadata.
| [in,out] | fs_ctx | Filesystem context |
| [in] | idx | File metadata entry index |
| [out] | file_meta | Pointer to file meta structure |
Definition at line 868 of file its_flash_fs_mblock.c.

| psa_status_t its_flash_fs_mblock_reserve_file | ( | struct its_flash_fs_ctx_t * | fs_ctx, |
| const uint8_t * | fid, | ||
| bool | use_spare, | ||
| size_t | size, | ||
| uint32_t | flags, | ||
| uint32_t * | file_meta_idx, | ||
| struct its_file_meta_t * | file_meta, | ||
| struct its_block_meta_t * | block_meta | ||
| ) |
Reserves space for a file.
| [in,out] | fs_ctx | Filesystem context |
| [in] | fid | File ID |
| [in] | use_spare | If true then the spare file will be used, otherwise at least one file will be left free |
| [in] | size | Size of the file for which space is reserve |
| [in] | flags | Flags set when the file was created |
| [out] | file_meta_idx | File metadata entry index |
| [out] | file_meta | File metadata entry |
| [out] | block_meta | Block metadata entry |
Definition at line 912 of file its_flash_fs_mblock.c.

| psa_status_t its_flash_fs_mblock_reset_metablock | ( | struct its_flash_fs_ctx_t * | fs_ctx | ) |
Resets metablock by cleaning and initializing the metadatablock.
| [in,out] | fs_ctx | Filesystem context |
Definition at line 936 of file its_flash_fs_mblock.c.


| void its_flash_fs_mblock_set_data_scratch | ( | struct its_flash_fs_ctx_t * | fs_ctx, |
| uint32_t | phy_id, | ||
| uint32_t | lblock | ||
| ) |
Sets current data scratch block.
| [in,out] | fs_ctx | Filesystem context |
| [in] | phy_id | Physical ID of scratch data block |
| [in] | lblock | Logical block number |
Definition at line 1046 of file its_flash_fs_mblock.c.

| psa_status_t its_flash_fs_mblock_update_scratch_block_meta | ( | struct its_flash_fs_ctx_t * | fs_ctx, |
| uint32_t | lblock, | ||
| struct its_block_meta_t * | block_meta | ||
| ) |
Puts logical block's metadata in scratch metadata block.
| [in,out] | fs_ctx | Filesystem context |
| [in] | lblock | Logical block number |
| [in] | block_meta | Pointer to block's metadata |
Definition at line 1054 of file its_flash_fs_mblock.c.

| psa_status_t its_flash_fs_mblock_update_scratch_file_meta | ( | struct its_flash_fs_ctx_t * | fs_ctx, |
| uint32_t | idx, | ||
| const struct its_file_meta_t * | file_meta | ||
| ) |
Writes a file metadata entry into scratch metadata block.
| [in,out] | fs_ctx | Filesystem context |
| [in] | idx | File's index in the metadata table |
| [in] | file_meta | Metadata pointer |
Definition at line 1077 of file its_flash_fs_mblock.c.
