ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
fw_if_fs_ra8_vfs.c File Reference

fw_if_fs adapter over one bound ra8_io_vfs mount. More...

#include "fw_if_fs_ra8_vfs.h"
#include <stddef.h>
#include <stdint.h>
#include <string.h>
#include "fw_if_fs.h"
#include "fw_if_fs_backend.h"
#include "fw_if_fs_ra8_vfs_contracts_internal.h"
#include "ra8_attributes.h"
#include "ra8_err.h"
#include "ra8_fs.h"
#include "ra8_fs_meta.h"
#include "ra8_io_vfs.h"
Include dependency graph for fw_if_fs_ra8_vfs.c:

Go to the source code of this file.

Data Structures

struct  vfs_file_state_t
 Backend state stored in a caller's file workspace. More...
struct  vfs_directory_state_t
 Backend state stored in a caller's directory workspace. More...
struct  vfs_list_state_t
 Callback-list compatibility bridge over a format-owned enumeration. More...
struct  vfs_transaction_state_t
 Backend state stored in a caller's transaction workspace. More...
struct  vfs_dir_layout_t
 Where the cursor and the native workspace sit inside a caller span. More...

Enumerations

enum  vfs_stage_limits_t : uint8_t {
  k_vfs_hex_nibble_bits = 4U ,
  k_vfs_stage_hex_digits = 6U ,
  k_vfs_hex_last_digit = k_vfs_stage_hex_digits - 1U ,
  k_vfs_hex_nibble_mask = 0x0FU ,
  k_vfs_stage_attempts = 64U
}
 Bounded attempts to find an unused short staging name. More...
enum  vfs_path_limits_t : uint16_t {
  k_vfs_stage_leaf_bytes = 12U ,
  k_vfs_exfat_name_max_bytes = 192U ,
  k_vfs_fat_name_max_bytes = 510U
}
 Portable-path limits exposed by the FAT/exFAT adapter. More...
enum  vfs_numeric_limits_t : uint32_t {
  k_vfs_nanoseconds_per_centisecond = 10000000U ,
  k_vfs_transaction_id_mask = 0x00FFFFFFU
}
 Timestamp and transaction arithmetic constants. More...

Functions

static fw_fs_timestamp_t internal_timestamp (const ra8_fs_timestamp_t *native)
static uint16_t internal_len (const char *text, uint16_t cap)
static ra8_err_t internal_full_path (fw_fs_ra8_vfs_state_t *state, const char *path, char *out)
static ra8_err_t internal_stat (void *ctx, const char *path, fw_fs_stat_t *out)
static vfs_dir_layout_t internal_dir_layout (void *directory_state, uint8_t native_align)
 Derive both aligned bases inside a caller directory-state span.
static vfs_directory_state_tinternal_dir_cursor (void *directory_state)
 Round a caller directory-state span up to the cursor's alignment.
static ra8_err_t internal_dir_open (void *ctx, const char *path, void *directory_state, uint32_t state_bytes)
static ra8_err_t internal_dir_next (void *ctx, void *directory_state, fw_fs_dirent_value_t *out, bool *out_entry)
static ra8_err_t internal_dir_close (void *ctx, void *directory_state)
static void internal_list_entry (const char *name, uint8_t attr, uint64_t size, void *ctx)
 Translate one format-list callback into the legacy bounded facade.
static ra8_err_t internal_listdir (void *ctx, const char *path, uint32_t max_entries, fw_fs_list_fn_t callback, void *callback_ctx, uint32_t *out_count, bool *out_complete)
static ra8_err_t internal_path_op (void *ctx, const char *path, ra8_err_t(*operation)(const char *))
 One-path VFS dispatch helper.
static ra8_err_t internal_mkdir (void *ctx, const char *path)
static ra8_err_t internal_unlink (void *ctx, const char *path)
static ra8_err_t internal_rmdir (void *ctx, const char *path)
static ra8_err_t internal_rename (void *ctx, const char *old_path, const char *new_path, bool replace)
static ra8_err_t internal_space (void *ctx, fw_fs_space_t *out)
static ra8_err_t internal_mode (fw_fs_open_mode_t mode, ra8_fs_mode_t *out)
static ra8_err_t internal_open (void *ctx, const char *path, fw_fs_open_mode_t mode, void *file_state, uint32_t state_bytes)
static ra8_err_t internal_read (void *ctx, void *file_state, uint8_t *dst, uint32_t cap, uint32_t *out_read)
static ra8_err_t internal_write (void *ctx, void *file_state, const uint8_t *src, uint32_t len, uint32_t *out_written)
static ra8_err_t internal_seek (void *ctx, void *file_state, uint64_t offset)
static ra8_err_t internal_tell (void *ctx, void *file_state, uint64_t *out_offset)
static ra8_err_t internal_size (void *ctx, void *file_state, uint64_t *out_size)
static ra8_err_t internal_close (void *ctx, void *file_state)
static ra8_err_t internal_copy_path (char *out, const char *path)
static void internal_hex6 (char out[k_vfs_stage_hex_digits], uint32_t value)
 Render a fixed-width six-digit hexadecimal transaction id.
static ra8_err_t internal_stage_path (const char *destination, uint32_t id, char *out)
static ra8_err_t internal_stage_open (fw_fs_ra8_vfs_state_t *state, vfs_transaction_state_t *txn)
 Open an unused VFS staging file after a bounded collision search.
static ra8_err_t internal_txn_begin (void *ctx, void *transaction_state, uint32_t state_bytes, const char *destination, fw_fs_transaction_policy_t policy)
static ra8_err_t internal_txn_write (void *ctx, void *transaction_state, const uint8_t *src, uint32_t len, uint32_t *out_written)
static ra8_err_t internal_txn_seek (void *ctx, void *transaction_state, uint64_t offset)
static ra8_err_t internal_txn_validate (void *ctx, void *transaction_state, fw_fs_validate_fn_t validator, void *validator_ctx)
static ra8_err_t internal_txn_commit (void *ctx, void *transaction_state, bool *out_published)
static ra8_err_t internal_txn_abort (void *ctx, void *transaction_state)
static ra8_err_t internal_mount_name (fw_fs_ra8_vfs_state_t *state, const char *name)
static ra8_err_t internal_dir_requirements (fw_fs_ra8_vfs_state_t *state, uint32_t *out_bytes, uint8_t *out_align, uint16_t *out_max_open)
 Query the named format and compose aligned adapter cursor requirements.
static fw_fs_caps_t internal_capabilities (const fw_fs_ra8_vfs_cfg_t *cfg, uint32_t directory_bytes, uint8_t directory_alignment, uint16_t max_directories)
 Compose the portable capability record for one mounted VFS format.
ra8_err_t fw_fs_ra8_vfs_init (fw_fs_t *out, fw_fs_ra8_vfs_state_t *state, const fw_fs_ra8_vfs_cfg_t *cfg)
 Bind a live named VFS mount into the portable filesystem facade.

Variables

static const fw_fs_stream_iface_t s_stream_iface
 Immutable firmware stream vtable.
static const fw_fs_namespace_iface_t s_namespace_iface
 Immutable firmware namespace vtable.
static const fw_fs_transaction_iface_t s_transaction_iface
 Immutable firmware transaction vtable.

Detailed Description

fw_if_fs adapter over one bound ra8_io_vfs mount.

Tag
[Ring 4 / PAL] {World: NS}

Binds the portable filesystem operations to one caller-selected, already mounted ra8_io_vfs volume. The adapter prefixes bounded portable paths, translates metadata and directory callbacks, and stages transactional writes in caller-owned storage without POSIX APIs or dynamic allocation.

Definition in file fw_if_fs_ra8_vfs.c.

Enumeration Type Documentation

◆ vfs_numeric_limits_t

enum vfs_numeric_limits_t : uint32_t

Timestamp and transaction arithmetic constants.

Enumerator
k_vfs_nanoseconds_per_centisecond 

Nanoseconds in 0.01 s.

k_vfs_transaction_id_mask 

Six hexadecimal digits.

Definition at line 52 of file fw_if_fs_ra8_vfs.c.

◆ vfs_path_limits_t

enum vfs_path_limits_t : uint16_t

Portable-path limits exposed by the FAT/exFAT adapter.

Enumerator
k_vfs_stage_leaf_bytes 

TX + six hex digits + .TMP.

k_vfs_exfat_name_max_bytes 

exFAT component byte cap.

k_vfs_fat_name_max_bytes 

FAT LFN component byte cap.

Definition at line 45 of file fw_if_fs_ra8_vfs.c.

◆ vfs_stage_limits_t

enum vfs_stage_limits_t : uint8_t

Bounded attempts to find an unused short staging name.

Enumerator
k_vfs_hex_nibble_bits 

Bits represented by one hex digit.

k_vfs_stage_hex_digits 

Hex digits in a stage identifier.

k_vfs_hex_last_digit 

Highest valid index in a stage identifier.

k_vfs_hex_nibble_mask 

Low-nibble mask.

k_vfs_stage_attempts 

Collision-search cap.

Definition at line 35 of file fw_if_fs_ra8_vfs.c.

Function Documentation

◆ fw_fs_ra8_vfs_init()

ra8_err_t fw_fs_ra8_vfs_init ( fw_fs_t * out,
fw_fs_ra8_vfs_state_t * state,
const fw_fs_ra8_vfs_cfg_t * cfg )
nodiscard

Bind a live named VFS mount into the portable filesystem facade.

Parameters
[out]outComplete portable facade.
[in,out]stateCaller-owned adapter state, retained by out.
[in]cfgLive mount, registered name, and media property.

Definition at line 960 of file fw_if_fs_ra8_vfs.c.

References fw_fs_bind(), ra8_fs_mount_t::in_use, internal_capabilities(), internal_dir_requirements(), internal_mount_name(), k_ra8_err_not_initialized, k_ra8_err_null_ptr, k_ra8_ok, memset(), fw_fs_ra8_vfs_cfg_t::mount, fw_fs_ra8_vfs_state_t::mount, fw_fs_ra8_vfs_cfg_t::mount_name, fw_fs_ra8_vfs_cfg_t::removable_media, fw_fs_ra8_vfs_state_t::removable_media, s_namespace_iface, s_stream_iface, and s_transaction_iface.

◆ internal_capabilities()

fw_fs_caps_t internal_capabilities ( const fw_fs_ra8_vfs_cfg_t * cfg,
uint32_t directory_bytes,
uint8_t directory_alignment,
uint16_t max_directories )
static

Compose the portable capability record for one mounted VFS format.

Combines fixed adapter services with format-dependent file/name limits and the previously queried directory workspace contract.

Parameters
[in]cfgValidated adapter configuration.
[in]directory_bytesComplete directory workspace requirement.
[in]directory_alignmentRequired directory workspace alignment.
[in]max_directoriesFormat-reported concurrent cursor ceiling.
Returns
Fully initialized portable filesystem capabilities.
Return values
fw_fs_caps_tCapability record matching the selected mount.
Precondition
cfg and its mounted format are non-NULL and initialized.
Directory requirement arguments came from internal_dir_requirements.
Postcondition
The returned flags describe every adapter service exposed below.
No caller, mount, or adapter state is modified.
Note
Removable-media capability follows the caller configuration exactly.
Since
0.1.0

Definition at line 926 of file fw_if_fs_ra8_vfs.c.

References fw_fs_caps_t::flags, k_fw_fs_cap_accessed_time, k_fw_fs_cap_atomic_noreplace, k_fw_fs_cap_created_time, k_fw_fs_cap_modified_time, k_fw_fs_cap_namespace, k_fw_fs_cap_rejects_symlink_walk, k_fw_fs_cap_removable_media, k_fw_fs_cap_same_volume_rename, k_fw_fs_cap_space_query, k_fw_fs_cap_stream, k_fw_fs_cap_transactions, k_fw_fs_path_cap, k_ra8_fs_fat_max_file_bytes, k_ra8_fs_max_files, k_ra8_fs_type_exfat, k_vfs_exfat_name_max_bytes, k_vfs_fat_name_max_bytes, fw_fs_ra8_vfs_cfg_t::mount, RA8_INTERNAL, fw_fs_ra8_vfs_cfg_t::removable_media, and ra8_fs_mount_t::type.

Referenced by fw_fs_ra8_vfs_init().

◆ internal_close()

ra8_err_t internal_close ( void * ctx,
void * file_state )
static

Definition at line 525 of file fw_if_fs_ra8_vfs.c.

References ra8_fs_close(), and RA8_INTERNAL.

Referenced by internal_txn_abort(), and internal_txn_validate().

◆ internal_copy_path()

ra8_err_t internal_copy_path ( char * out,
const char * path )
static

Definition at line 535 of file fw_if_fs_ra8_vfs.c.

References k_fw_fs_path_cap, k_ra8_err_invalid_size, k_ra8_ok, and RA8_INTERNAL.

Referenced by internal_txn_begin().

◆ internal_dir_close()

ra8_err_t internal_dir_close ( void * ctx,
void * directory_state )
static

◆ internal_dir_cursor()

vfs_directory_state_t * internal_dir_cursor ( void * directory_state)
static

Round a caller directory-state span up to the cursor's alignment.

The cursor base does not depend on the mounted format's workspace alignment, so dir_next and dir_close – which never touch that workspace – take the layout under the cursor's own alignment and read its cursor half.

Parameters
[in]directory_stateCaller-owned span accepted by dir_open
Returns
The first suitably aligned cursor address inside the span
Return values
non-nullAlways; dir_open already validated the span capacity
Precondition
directory_state is the span a matching dir_open succeeded on
That span still holds the cursor dir_open constructed in it
Postcondition
The returned pointer satisfies alignof(vfs_directory_state_t)
No byte of the span has been written
Note
Pure address arithmetic; reentrant and thread-safe.
Since
0.1.0

Definition at line 232 of file fw_if_fs_ra8_vfs.c.

References vfs_dir_layout_t::cursor, internal_dir_layout(), and RA8_INTERNAL.

Referenced by internal_dir_close(), and internal_dir_next().

◆ internal_dir_layout()

vfs_dir_layout_t internal_dir_layout ( void * directory_state,
uint8_t native_align )
static

Derive both aligned bases inside a caller directory-state span.

fw_if_fs.h hands adapters an arbitrary caller-owned byte span for the directory cursor and promises no alignment, so both bases must be derived, not assumed: storing through an unaligned vfs_directory_state_t* is undefined behavior the host UBSan build rejects. Deriving them together also keeps every address conversion in this one function – callers receive void* bases and never convert a pointer to an integer at all.

Parameters
[in]directory_stateCaller-owned span accepted by dir_open
[in]native_alignAlignment the mounted format requires of its own cursor workspace (a power of two, validated at mount)
Returns
The two aligned bases and the span bytes each consumes
Return values
vfs_dir_layout_tBoth bases are non-null; the caller validates the span capacity against the returned byte counts
Precondition
directory_state is non-null (checked by every caller's contract)
native_align is a non-zero power of two
Postcondition
cursor satisfies alignof(vfs_directory_state_t)
workspace satisfies native_align; no span byte is written
Note
Pure address arithmetic; reentrant and thread-safe.
Since
0.1.0

Definition at line 202 of file fw_if_fs_ra8_vfs.c.

References RA8_INTERNAL.

Referenced by internal_dir_cursor(), and internal_dir_open().

◆ internal_dir_next()

◆ internal_dir_open()

◆ internal_dir_requirements()

ra8_err_t internal_dir_requirements ( fw_fs_ra8_vfs_state_t * state,
uint32_t * out_bytes,
uint8_t * out_align,
uint16_t * out_max_open )
static

Query the named format and compose aligned adapter cursor requirements.

Resolves the registered format through VFS, retains its exact inner cursor facts, and adds checked space for the adapter wrapper.

Parameters
[in,out]stateAdapter with a retained registered mount name.
[out]out_bytesComplete outer workspace bytes.
[out]out_alignComplete outer workspace alignment.
[out]out_max_openFormat-reported concurrency ceiling.
Returns
VFS resolution, capability, or overflow status.
Return values
k_ra8_okAll returned and cached requirements are coherent.
k_ra8_err_*VFS capability, path, or checked-size failure.
Precondition
Required pointers are non-NULL and the named mount is registered.
state owns writable adapter path scratch.
Postcondition
Success caches the inner format requirements in state.
Failure does not publish partial requirement outputs.
Note
This preserves the format-neutral #159 dispatch seam.
Since
0.1.0

Definition at line 878 of file fw_if_fs_ra8_vfs.c.

References fw_fs_ra8_vfs_state_t::directory_workspace_align, fw_fs_ra8_vfs_state_t::directory_workspace_bytes, internal_full_path(), k_ra8_err_invalid_size, k_ra8_ok, fw_fs_ra8_vfs_state_t::max_open_directories, fw_fs_ra8_vfs_state_t::path_a, RA8_INTERNAL, and ra8_io_vfs_dir_requirements().

Referenced by fw_fs_ra8_vfs_init().

◆ internal_full_path()

◆ internal_hex6()

void internal_hex6 ( char out[k_vfs_stage_hex_digits],
uint32_t value )
static

Render a fixed-width six-digit hexadecimal transaction id.

Emits uppercase nibbles from most to least significant without a NUL; callers place the exact field inside an already bounded stage name.

Parameters
[out]outSix-byte hexadecimal field.
[in]valueTransaction identifier whose low 24 bits are rendered.
Precondition
out addresses k_vfs_stage_hex_digits writable bytes.
The destination does not overlap read-only digit storage.
Postcondition
Exactly six uppercase hexadecimal characters are written.
Bytes outside the six-byte field are unchanged.
Note
Pure apart from caller output and thread-safe.
Since
Version 0.1.0

Definition at line 559 of file fw_if_fs_ra8_vfs.c.

References k_vfs_hex_last_digit, k_vfs_hex_nibble_bits, k_vfs_hex_nibble_mask, k_vfs_stage_hex_digits, and RA8_INTERNAL.

Referenced by internal_stage_path().

◆ internal_len()

uint16_t internal_len ( const char * text,
uint16_t cap )
static

Definition at line 110 of file fw_if_fs_ra8_vfs.c.

References RA8_INTERNAL.

Referenced by internal_dir_next(), internal_full_path(), and internal_list_entry().

◆ internal_list_entry()

void internal_list_entry ( const char * name,
uint8_t attr,
uint64_t size,
void * ctx )
static

Translate one format-list callback into the legacy bounded facade.

Bounds and classifies one native entry before forwarding it to the portable callback, preserving stop and error state in the bridge.

Parameters
[in]nameNUL-terminated native entry leaf.
[in]attrNative filesystem attribute bits.
[in]sizeNative file size; ignored for directory classification.
[in,out]ctxActive bounded-list bridge state.
Precondition
name and ctx are non-NULL.
ctx contains a live callback and coherent delivery bounds.
Postcondition
At most one callback is delivered.
The bridge records every capacity stop, callback stop, or callback error.
Note
An overlong native name is converted to a fail-closed bridge error.
Since
Version 0.1.0

Definition at line 315 of file fw_if_fs_ra8_vfs.c.

References vfs_list_state_t::callback, vfs_list_state_t::callback_ctx, vfs_list_state_t::callback_error, vfs_list_state_t::count, internal_len(), k_fw_fs_node_directory, k_fw_fs_node_file, k_fw_fs_path_cap, k_ra8_err_invalid_size, k_ra8_fs_attr_directory, k_ra8_ok, vfs_list_state_t::max_entries, and vfs_list_state_t::stopped.

Referenced by internal_listdir().

◆ internal_listdir()

ra8_err_t internal_listdir ( void * ctx,
const char * path,
uint32_t max_entries,
fw_fs_list_fn_t callback,
void * callback_ctx,
uint32_t * out_count,
bool * out_complete )
static

◆ internal_mkdir()

ra8_err_t internal_mkdir ( void * ctx,
const char * path )
static

Definition at line 384 of file fw_if_fs_ra8_vfs.c.

References internal_path_op(), RA8_INTERNAL, and ra8_io_vfs_mkdir().

◆ internal_mode()

◆ internal_mount_name()

ra8_err_t internal_mount_name ( fw_fs_ra8_vfs_state_t * state,
const char * name )
static

◆ internal_open()

ra8_err_t internal_open ( void * ctx,
const char * path,
fw_fs_open_mode_t mode,
void * file_state,
uint32_t state_bytes )
static

◆ internal_path_op()

ra8_err_t internal_path_op ( void * ctx,
const char * path,
ra8_err_t(* operation )(const char *) )
static

One-path VFS dispatch helper.

Definition at line 373 of file fw_if_fs_ra8_vfs.c.

References internal_full_path(), k_ra8_ok, and fw_fs_ra8_vfs_state_t::path_a.

Referenced by internal_mkdir(), internal_rmdir(), and internal_unlink().

◆ internal_read()

ra8_err_t internal_read ( void * ctx,
void * file_state,
uint8_t * dst,
uint32_t cap,
uint32_t * out_read )
static

Definition at line 480 of file fw_if_fs_ra8_vfs.c.

References ra8_fs_read().

Referenced by priv_fmt_host_spool_open(), and priv_fs_posix_stream_iface().

◆ internal_rename()

ra8_err_t internal_rename ( void * ctx,
const char * old_path,
const char * new_path,
bool replace )
static

◆ internal_rmdir()

ra8_err_t internal_rmdir ( void * ctx,
const char * path )
static

Definition at line 396 of file fw_if_fs_ra8_vfs.c.

References internal_path_op(), RA8_INTERNAL, and ra8_io_vfs_rmdir().

◆ internal_seek()

ra8_err_t internal_seek ( void * ctx,
void * file_state,
uint64_t offset )
static

Definition at line 501 of file fw_if_fs_ra8_vfs.c.

References ra8_fs_seek(), and RA8_INTERNAL.

Referenced by internal_txn_seek().

◆ internal_size()

ra8_err_t internal_size ( void * ctx,
void * file_state,
uint64_t * out_size )
static

Definition at line 517 of file fw_if_fs_ra8_vfs.c.

References ra8_fs_size(), and RA8_INTERNAL.

Referenced by internal_txn_seek().

◆ internal_space()

◆ internal_stage_open()

ra8_err_t internal_stage_open ( fw_fs_ra8_vfs_state_t * state,
vfs_transaction_state_t * txn )
static

Open an unused VFS staging file after a bounded collision search.

Tries monotonically numbered sibling names, stats before open, and handles a create race by continuing only on an exists result.

Parameters
[in,out]stateBound adapter state and transaction-id source.
[in,out]txnTransaction state receiving stage path and writer.
Returns
Bounded stage-open status.
Return values
k_ra8_okA new staging writer is open and tracked.
k_ra8_err_no_memEvery bounded candidate collided.
k_ra8_err_*Naming, stat, or open failure.
Precondition
txn contains a validated terminated destination path.
Adapter state and VFS mount remain live for all attempts.
Postcondition
Success sets both writer_open and stage_exists.
At most k_vfs_stage_attempts candidates are examined.
Note
Not thread-safe; advances the adapter transaction id.
Since
Version 0.1.0

Definition at line 624 of file fw_if_fs_ra8_vfs.c.

References vfs_transaction_state_t::destination, fw_fs_stat_t::exists, vfs_transaction_state_t::file_state, internal_open(), internal_stage_path(), internal_stat(), k_fw_fs_open_write_truncate, k_ra8_err_exists, k_ra8_err_no_mem, k_ra8_ok, k_vfs_stage_attempts, RA8_INTERNAL, vfs_transaction_state_t::stage, vfs_transaction_state_t::stage_exists, fw_fs_ra8_vfs_state_t::transaction_id, and vfs_transaction_state_t::writer_open.

Referenced by internal_txn_begin().

◆ internal_stage_path()

ra8_err_t internal_stage_path ( const char * destination,
uint32_t id,
char * out )
static

◆ internal_stat()

◆ internal_tell()

ra8_err_t internal_tell ( void * ctx,
void * file_state,
uint64_t * out_offset )
static

Definition at line 509 of file fw_if_fs_ra8_vfs.c.

References ra8_fs_tell(), and RA8_INTERNAL.

Referenced by priv_fs_posix_stream_iface().

◆ internal_timestamp()

◆ internal_txn_abort()

◆ internal_txn_begin()

◆ internal_txn_commit()

ra8_err_t internal_txn_commit ( void * ctx,
void * transaction_state,
bool * out_published )
static

◆ internal_txn_seek()

ra8_err_t internal_txn_seek ( void * ctx,
void * transaction_state,
uint64_t offset )
static

◆ internal_txn_validate()

◆ internal_txn_write()

ra8_err_t internal_txn_write ( void * ctx,
void * transaction_state,
const uint8_t * src,
uint32_t len,
uint32_t * out_written )
static

◆ internal_unlink()

ra8_err_t internal_unlink ( void * ctx,
const char * path )
static

Definition at line 390 of file fw_if_fs_ra8_vfs.c.

References internal_path_op(), RA8_INTERNAL, and ra8_io_vfs_unlink().

Referenced by internal_txn_abort().

◆ internal_write()

ra8_err_t internal_write ( void * ctx,
void * file_state,
const uint8_t * src,
uint32_t len,
uint32_t * out_written )
static

Definition at line 489 of file fw_if_fs_ra8_vfs.c.

References k_ra8_ok, and ra8_fs_write().

Referenced by internal_txn_write(), and mdl_storage_vfs_init().

Variable Documentation

◆ s_namespace_iface

const fw_fs_namespace_iface_t s_namespace_iface
static
Initial value:
= {
.stat = internal_stat,
.listdir = internal_listdir,
.dir_open = internal_dir_open,
.dir_next = internal_dir_next,
.dir_close = internal_dir_close,
.mkdir = internal_mkdir,
.unlink = internal_unlink,
.rmdir = internal_rmdir,
.rename = internal_rename,
.space = internal_space,
}
static ra8_err_t internal_rename(void *ctx, const char *old_path, const char *new_path, bool replace)
static ra8_err_t internal_space(void *ctx, fw_fs_space_t *out)
static ra8_err_t internal_dir_close(void *ctx, void *directory_state)
static ra8_err_t internal_mkdir(void *ctx, const char *path)
static ra8_err_t internal_listdir(void *ctx, const char *path, uint32_t max_entries, fw_fs_list_fn_t callback, void *callback_ctx, uint32_t *out_count, bool *out_complete)
static ra8_err_t internal_rmdir(void *ctx, const char *path)
static ra8_err_t internal_unlink(void *ctx, const char *path)
static ra8_err_t internal_dir_next(void *ctx, void *directory_state, fw_fs_dirent_value_t *out, bool *out_entry)
static ra8_err_t internal_dir_open(void *ctx, const char *path, void *directory_state, uint32_t state_bytes)
static ra8_err_t internal_stat(void *ctx, const char *path, fw_fs_stat_t *out)

Immutable firmware namespace vtable.

Definition at line 796 of file fw_if_fs_ra8_vfs.c.

Referenced by fw_fs_ra8_vfs_init(), and priv_fs_posix_bind_interfaces().

◆ s_stream_iface

const fw_fs_stream_iface_t s_stream_iface
static
Initial value:
= {
.open = internal_open,
.read = internal_read,
.write = internal_write,
.seek = internal_seek,
.tell = internal_tell,
.size = internal_size,
.sync = nullptr,
.close = internal_close,
}
static ra8_err_t internal_seek(void *ctx, void *file_state, uint64_t offset)
static ra8_err_t internal_write(void *ctx, void *file_state, const uint8_t *src, uint32_t len, uint32_t *out_written)
static ra8_err_t internal_read(void *ctx, void *file_state, uint8_t *dst, uint32_t cap, uint32_t *out_read)
static ra8_err_t internal_close(void *ctx, void *file_state)
static ra8_err_t internal_size(void *ctx, void *file_state, uint64_t *out_size)
static ra8_err_t internal_tell(void *ctx, void *file_state, uint64_t *out_offset)
static ra8_err_t internal_open(void *ctx, const char *path, fw_fs_open_mode_t mode, void *file_state, uint32_t state_bytes)

Immutable firmware stream vtable.

Definition at line 87 of file fw_if_fs_ra8_vfs.c.

Referenced by fw_fs_ra8_vfs_init(), and internal_txn_validate().

◆ s_transaction_iface

const fw_fs_transaction_iface_t s_transaction_iface
static
Initial value:
= {
.validate = internal_txn_validate,
}
static ra8_err_t internal_txn_commit(void *ctx, void *transaction_state, bool *out_published)
static ra8_err_t internal_txn_begin(void *ctx, void *transaction_state, uint32_t state_bytes, const char *destination, fw_fs_transaction_policy_t policy)
static ra8_err_t internal_txn_validate(void *ctx, void *transaction_state, fw_fs_validate_fn_t validator, void *validator_ctx)
static ra8_err_t internal_txn_abort(void *ctx, void *transaction_state)
static ra8_err_t internal_txn_seek(void *ctx, void *transaction_state, uint64_t offset)
static ra8_err_t internal_txn_write(void *ctx, void *transaction_state, const uint8_t *src, uint32_t len, uint32_t *out_written)

Immutable firmware transaction vtable.

Definition at line 822 of file fw_if_fs_ra8_vfs.c.

Referenced by fw_fs_ra8_vfs_init(), and priv_fs_posix_bind_interfaces().