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

Caller-workspace CLI composition for every supported tool verb. More...

#include <stddef.h>
#include <stdint.h>
#include "ra8_attributes.h"
#include "ra8_fmt_stream.h"
Include dependency graph for ra8_fmt_portable_main_internal.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  ra8_fmt_cli_workspace_t
 One explicit, shared composition-root workspace for portable verbs. More...

Enumerations

enum  ra8_fmt_cli_limit_t : uint32_t {
  k_ra8_fmt_cli_convert_arena_bytes = 8U * 1024U * 1024U ,
  k_ra8_fmt_cli_record_cap = 65536U ,
  k_ra8_fmt_cli_tile_cap = 4194304U ,
  k_ra8_fmt_cli_scratch_cap = 4718848U ,
  k_ra8_fmt_cli_workspace_bytes ,
  k_ra8_fmt_cli_rbkc_table_cap = 65537U ,
  k_ra8_fmt_cli_rbkc_compressed_cap = 4194304U ,
  k_ra8_fmt_cli_rbkc_chunk_cap = 4194304U ,
  k_ra8_fmt_cli_rbkc_scratch_cap
}
 Explicit composition-root RAM budget for image-to-JOF conversion. More...

Functions

int priv_fmt_try_portable_convert (int argc, char **argv, uint8_t *arena, size_t arena_cap, bool *handled)
 Try the caller-workspace JOF-convert command path.
int priv_fmt_try_portable_inspect (int argc, char **argv, ra8_fmt_cli_workspace_t *workspace, bool *handled)
 Try strict streamed JOF or RBKC inspection.
int priv_fmt_try_portable_verify (int argc, char **argv, ra8_fmt_cli_workspace_t *workspace, bool *handled)
 Try the bounded two-spool JOF-verification command path.

Detailed Description

Caller-workspace CLI composition for every supported tool verb.

Exposes bounded JOF paths and strict streamed RBKC inspection.

Since
0.1.0

Definition in file ra8_fmt_portable_main_internal.h.

Enumeration Type Documentation

◆ ra8_fmt_cli_limit_t

enum ra8_fmt_cli_limit_t : uint32_t

Explicit composition-root RAM budget for image-to-JOF conversion.

Enumerator
k_ra8_fmt_cli_convert_arena_bytes 

Convert prefix (8 MiB).

k_ra8_fmt_cli_record_cap 

All legal JOF audit records.

k_ra8_fmt_cli_tile_cap 

Decoded-tile bytes (4 MiB).

k_ra8_fmt_cli_scratch_cap 

Stored-tile bound bytes.

k_ra8_fmt_cli_workspace_bytes 

Existing shared high-water.

k_ra8_fmt_cli_rbkc_table_cap 

At most 65,536 chunks plus end.

k_ra8_fmt_cli_rbkc_compressed_cap 

One stored chunk.

k_ra8_fmt_cli_rbkc_chunk_cap 

One inflated chunk.

k_ra8_fmt_cli_rbkc_scratch_cap 

Strict book work.

Definition at line 19 of file ra8_fmt_portable_main_internal.h.

Function Documentation

◆ priv_fmt_try_portable_convert()

int priv_fmt_try_portable_convert ( int argc,
char ** argv,
uint8_t * arena,
size_t arena_cap,
bool * handled )
nodiscard

Try the caller-workspace JOF-convert command path.

Parameters
[in]argcProcess argument count.
[in]argvProcess argument vector.
[in,out]arenaExplicit caller-owned producer workspace.
[in]arena_capExact bytes supplied at arena.
[out]handledSet when this function owns the exit status.
Returns
Process exit status when handled; unspecified otherwise.
Precondition
arena is aligned for max_align_t and spans arena_cap bytes.
Postcondition
An over-budget input fails before any output transaction begins.
Since
0.1.0

Definition at line 379 of file ra8_fmt_portable_convert.c.

References convert_cli_args_t::format, convert_cli_args_t::input, internal_parse(), internal_report_run_failure(), internal_run(), internal_size_input(), internal_status(), internal_text(), k_convert_cli_fail, k_convert_cli_input, k_convert_cli_ok, k_convert_cli_usage, k_ra8_ok, convert_cli_args_t::output, priv_fmt_host_fd_sink(), priv_fmt_host_source_close(), priv_fmt_host_source_open(), RA8_PRIV, ra8_fmt_host_source_t::source, and strcmp().

Referenced by internal_dispatch().

◆ priv_fmt_try_portable_inspect()

int priv_fmt_try_portable_inspect ( int argc,
char ** argv,
ra8_fmt_cli_workspace_t * workspace,
bool * handled )
nodiscard

Try strict streamed JOF or RBKC inspection.

Parameters
[in]argcProcess argument count.
[in]argvProcess argument vector.
[in,out]workspaceExplicit shared composition-root arena.
[out]handledSet when this function owns the exit status.
Returns
Process exit status when handled; unspecified otherwise.

Definition at line 385 of file ra8_fmt_portable_main.c.

References internal_open(), internal_parse(), internal_text(), k_cli_exit_fail, k_cli_exit_ok, k_cli_exit_usage, priv_fmt_host_fd_sink(), RA8_PRIV, and strcmp().

Referenced by internal_dispatch().

◆ priv_fmt_try_portable_verify()

int priv_fmt_try_portable_verify ( int argc,
char ** argv,
ra8_fmt_cli_workspace_t * workspace,
bool * handled )
nodiscard

Try the bounded two-spool JOF-verification command path.

Parameters
[in]argcProcess argument count.
[in]argvProcess argument vector.
[in,out]workspaceExplicit shared composition-root arena.
[out]handledSet when this function owns the exit status.
Returns
Process exit status when handled; unspecified otherwise.
Precondition
workspace is aligned for every producer and decode carve.
Postcondition
Every anonymous spool and source descriptor is closed.
Optional PPM publication occurs only after full comparison and validation.
Since
0.1.0

Definition at line 595 of file ra8_fmt_portable_verify.c.

References ra8_fmt_cli_workspace_t::bytes, verify_cli_args_t::format, verify_cli_args_t::input, internal_execute(), internal_open_and_size(), internal_parse(), k_ra8_ok, k_verify_cli_fail, k_verify_cli_ok, priv_fmt_host_fd_sink(), RA8_PRIV, and strcmp().

Referenced by internal_dispatch().