ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
mkbookimg_internal.h
Go to the documentation of this file.
1
28#pragma once
29
30#include <fcntl.h>
31#include <stddef.h>
32#include <stdint.h>
33
34#include "ra8_attributes.h"
35#include "ra8_fs.h"
36
37#ifndef O_CLOEXEC
39#define O_CLOEXEC (0)
40#endif
41
42#ifndef O_DIRECTORY
44#define O_DIRECTORY (0)
45#endif
46
47#ifndef O_NOFOLLOW
49#define O_NOFOLLOW (0)
50#endif
51
65
67typedef struct {
68 uint64_t block_count;
69 uint32_t block_size;
70 int fd;
71 bool io_failed;
73
85RA8_PRIV void priv_mkbookimg_diag(const char* text);
86
98RA8_PRIV void priv_mkbookimg_diag_u64(uint64_t value);
99
117RA8_PRIV bool priv_mkbookimg_pread_exact(int fd, uint64_t offset, uint8_t* bytes, size_t length);
118
138 char** argv,
139 int book_count,
140 const mkbookimg_disk_t* disk);
bool priv_mkbookimg_pread_exact(int fd, uint64_t offset, uint8_t *bytes, size_t length)
Read exactly one bounded positioned byte range.
Definition mkbookimg.c:75
void priv_mkbookimg_diag(const char *text)
Write a complete diagnostic fragment to the standard-error descriptor.
Definition mkbookimg.c:41
void priv_mkbookimg_diag_u64(uint64_t value)
Emit an unsigned decimal value without a formatting runtime.
Definition mkbookimg.c:58
mkbookimg_limit_t
Fixed image geometry and bounded host-I/O capacities.
@ k_host_path_cap
Hosted path capacity.
@ k_block_size
Bytes per image sector.
@ k_img_sectors
Sectors in the 64 MiB image.
@ k_decimal_base
Decimal conversion radix.
@ k_host_name_cap
Hosted leaf capacity.
@ k_temp_create_attempts
Exclusive-create retry bound.
@ k_output_create_mode
Hosted output creation mode.
@ k_decimal_u64_digits
Maximum uint64_t digits.
@ k_max_books
Maximum input-book count.
@ k_stream_chunk_bytes
Bounded copy chunk bytes.
bool priv_mkbookimg_build_image(const ra8_fs_backend_t *backend, char **argv, int book_count, const mkbookimg_disk_t *disk)
Format, populate, and unmount the destination image.
Annotation-attribute framework macros for ra8-firmware.
#define RA8_PRIV
Module-private helper: shared across TUs but only inside one library.
Minimal FAT12/FAT16/FAT32 filesystem adapter (read + write).
Host descriptor-backed block device bound into ra8_fs.
bool io_failed
Sticky positioned-I/O failure.
uint64_t block_count
Addressable sectors.
int fd
Open sibling-temporary descriptor.
uint32_t block_size
Bytes in one sector.
Block-device interface that ra8_fs runs on top of.