|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
Module-private bounded host-storage composition for mkfontimg. More...
Go to the source code of this file.
Data Structures | |
| struct | mkfontimg_disk_t |
| Descriptor-backed block-device state bound into ra8_fs. More... | |
| struct | mkfontimg_host_t |
| Caller-owned sibling-temporary and block-backend binding. More... | |
Enumerations | |
| enum | mkfontimg_host_limit_t : uint32_t { k_mkfontimg_host_path_cap = 4096U , k_mkfontimg_host_name_cap = 256U } |
| Fixed private storage bounds for the hosted adapter. More... | |
Functions | |
| void | priv_mkfontimg_diag (const char *text) |
| Write one complete best-effort diagnostic fragment to standard error. | |
| void | priv_mkfontimg_diag_u64 (uint64_t value) |
| Write one unsigned decimal value to standard error without stdio. | |
| bool | priv_mkfontimg_host_begin (const char *final_path, uint64_t block_count, uint32_t block_size, mkfontimg_host_t *host) |
| Create, size, and bind one private sibling-temporary image. | |
| bool | priv_mkfontimg_host_seed (mkfontimg_host_t *host, const uint8_t *bytes, uint32_t length) |
| Seed exact bytes at the beginning of the temporary image. | |
| bool | priv_mkfontimg_host_copy (const mkfontimg_host_t *host, ra8_fs_mount_t *mount, const char *input_path, const char *card_name, uint64_t minimum_bytes, uint64_t maximum_bytes, uint64_t *out_bytes) |
| Stream one stable host input into a card file and verify it by reread. | |
| bool | priv_mkfontimg_host_commit (mkfontimg_host_t *host) |
| Sync and atomically publish a complete temporary image. | |
| void | priv_mkfontimg_host_abort (mkfontimg_host_t *host) |
| Close and unlink an unpublished temporary image. | |
Module-private bounded host-storage composition for mkfontimg.
Keeps POSIX descriptors and atomic-publication state at the standalone tool's composition edge. The filesystem itself sees only ra8_fs_backend_t callbacks, and font bytes cross into it through bounded ra8_fs_write calls. All state is caller-owned and allocation-free.
Definition in file mkfontimg_internal.h.
| enum mkfontimg_host_limit_t : uint32_t |
Fixed private storage bounds for the hosted adapter.
| Enumerator | |
|---|---|
| k_mkfontimg_host_path_cap | Hosted path capacity. |
| k_mkfontimg_host_name_cap | Hosted leaf capacity. |
Definition at line 24 of file mkfontimg_internal.h.
| void priv_mkfontimg_diag | ( | const char * | text | ) |
Write one complete best-effort diagnostic fragment to standard error.
Retries interrupted and short raw-descriptor writes without stdio.
| [in] | text | NUL-terminated diagnostic fragment. |
text is non-null and NUL-terminated. Definition at line 67 of file mkfontimg_host.c.
References RA8_PRIV, and strlen().
Referenced by internal_run_blank(), internal_run_font(), main(), and priv_mkfontimg_diag_u64().
| void priv_mkfontimg_diag_u64 | ( | uint64_t | value | ) |
Write one unsigned decimal value to standard error without stdio.
Converts through fixed local buffers and delegates one bounded string.
| [in] | value | Unsigned value to render in base ten. |
Definition at line 83 of file mkfontimg_host.c.
References k_host_decimal_base, k_host_decimal_digits, priv_mkfontimg_diag(), and RA8_PRIV.
Referenced by internal_run_font().
| void priv_mkfontimg_host_abort | ( | mkfontimg_host_t * | host | ) |
Close and unlink an unpublished temporary image.
Idempotently releases every partially acquired host resource.
| [in,out] | host | Publication state returned by the begin operation. |
host is non-null and may be only partially initialized. Definition at line 815 of file mkfontimg_host.c.
References mkfontimg_host_t::directory_fd, mkfontimg_host_t::image_fd, RA8_PRIV, mkfontimg_host_t::temp_exists, and mkfontimg_host_t::temp_name.
Referenced by internal_finish_image(), internal_mount_image(), internal_run_font(), and priv_mkfontimg_host_begin().
|
nodiscard |
Create, size, and bind one private sibling-temporary image.
Definition at line 411 of file mkfontimg_host.c.
References mkfontimg_host_t::backend, mkfontimg_host_t::directory_fd, mkfontimg_host_t::disk, mkfontimg_host_t::final_name, mkfontimg_host_t::image_fd, internal_disk_capacity(), internal_disk_read(), internal_disk_write(), internal_split_output(), internal_temp_name(), k_host_create_mode, k_host_temp_attempts, k_mkfontimg_host_path_cap, O_CLOEXEC, O_DIRECTORY, O_NOFOLLOW, priv_mkfontimg_host_abort(), RA8_PRIV, mkfontimg_host_t::temp_exists, and mkfontimg_host_t::temp_name.
Referenced by internal_mount_image().
|
nodiscard |
Sync and atomically publish a complete temporary image.
Definition at line 788 of file mkfontimg_host.c.
References mkfontimg_host_t::directory_fd, mkfontimg_host_t::disk, mkfontimg_host_t::final_name, mkfontimg_host_t::image_fd, mkfontimg_disk_t::io_failed, RA8_PRIV, renameat(), mkfontimg_host_t::temp_exists, and mkfontimg_host_t::temp_name.
Referenced by internal_finish_image().
|
nodiscard |
Stream one stable host input into a card file and verify it by reread.
Definition at line 756 of file mkfontimg_host.c.
References mkfontimg_host_t::disk, internal_mkfontimg_verify(), internal_mkfontimg_write(), mkfontimg_disk_t::io_failed, RA8_PRIV, and host_input_identity_t::size.
Referenced by internal_run_font().
|
nodiscard |
Seed exact bytes at the beginning of the temporary image.
Definition at line 461 of file mkfontimg_host.c.
References mkfontimg_disk_t::block_count, mkfontimg_disk_t::block_size, mkfontimg_host_t::disk, mkfontimg_host_t::image_fd, internal_pwrite_exact(), and mkfontimg_disk_t::io_failed.
Referenced by internal_mount_image().