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

Go to the source code of this file.

Functions

psa_status_t its_flash_fs_dblock_compact_block (struct its_flash_fs_ctx_t *fs_ctx, uint32_t lblock, size_t free_size, size_t src_offset, size_t dst_offset, size_t size)
 Compacts block data for the given logical block. More...
 
psa_status_t its_flash_fs_dblock_read_file (struct its_flash_fs_ctx_t *fs_ctx, const struct its_file_meta_t *file_meta, size_t offset, size_t size, uint8_t *buf)
 Reads the file content. More...
 
psa_status_t its_flash_fs_dblock_write_file (struct its_flash_fs_ctx_t *fs_ctx, const struct its_block_meta_t *block_meta, const struct its_file_meta_t *file_meta, size_t offset, size_t size, const uint8_t *data)
 Writes scratch data block content with requested data and the rest of the data from the given logical block. More...
 

Function Documentation

psa_status_t its_flash_fs_dblock_compact_block ( struct its_flash_fs_ctx_t fs_ctx,
uint32_t  lblock,
size_t  free_size,
size_t  src_offset,
size_t  dst_offset,
size_t  size 
)

Compacts block data for the given logical block.

Parameters
[in,out]fs_ctxFilesystem context
[in]lblockLogical data block to compact
[in]free_sizeAvailable data size to compact
[in]src_offsetOffset in the current data block which points to the data position to reallocate
[in]dst_offsetOffset in the scratch block which points to the data position to store the data to be reallocated
[in]sizeNumber of bytes to be reallocated
Returns
Returns error code as specified in psa_status_t

Definition at line 34 of file its_flash_fs_dblock.c.

Here is the call graph for this function:

psa_status_t its_flash_fs_dblock_read_file ( struct its_flash_fs_ctx_t fs_ctx,
const struct its_file_meta_t file_meta,
size_t  offset,
size_t  size,
uint8_t *  buf 
)

Reads the file content.

Parameters
[in,out]fs_ctxFilesystem context
[in]file_metaFile metadata
[in]offsetOffset in the file
[in]sizeSize to be read
[out]bufBuffer pointer to store the data
Returns
Returns error code as specified in psa_status_t

Definition at line 114 of file its_flash_fs_dblock.c.

Here is the caller graph for this function:

psa_status_t its_flash_fs_dblock_write_file ( struct its_flash_fs_ctx_t fs_ctx,
const struct its_block_meta_t block_meta,
const struct its_file_meta_t file_meta,
size_t  offset,
size_t  size,
const uint8_t *  data 
)

Writes scratch data block content with requested data and the rest of the data from the given logical block.

Parameters
[in,out]fs_ctxFilesystem context
[in]block_metaBlock metadata
[in]file_metaFile metadata
[in]offsetOffset in the scratch data block where to start the copy of the incoming data
[in]sizeSize of the incoming data
[in]dataPointer to data buffer to copy in the scratch data block
Returns
Returns error code as specified in psa_status_t

Definition at line 135 of file its_flash_fs_dblock.c.

Here is the call graph for this function: