80 uint32_t nonzero = 0U;
145 if (*any_lba == 0U) {
148 if (*basic_lba == 0U) {
184 uint64_t basic_lba = 0U;
185 uint64_t any_lba = 0U;
186 for (uint32_t i = 0U; i < count; i++) {
187 const uint32_t sector = i / eps;
197 if (basic_lba != 0U) {
198 *out_base = basic_lba;
248 if (entry_lba == 0U) {
257 *out_entry_lba = entry_lba;
265 uint64_t entry_lba = 0U;
299 uint32_t nonzero = 0U;
301 if (entry[i] != 0U) {
319 uint64_t entry_lba = 0U;
325 if ((uint32_t)index >= count) {
329 const uint32_t sector = (uint32_t)index / eps;
Annotation-attribute framework macros for ra8-firmware.
#define RA8_INTERNAL
Marker that a function is intended to be static (file-local).
@ k_ra8_err_not_supported
Requested feature not compiled in, not wired, or not supported by this MCU variant.
@ k_ra8_err_out_of_range
Sensor or peripheral output out of valid range.
@ k_ra8_err_validation_failed
Validation rule failed (caller-supplied invariant not satisfied).
@ k_ra8_ok
Success – operation completed with all postconditions satisfied.
@ k_ra8_err_not_found
Requested item not found (lookup / search missed).
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
Minimal FAT12/FAT16/FAT32 filesystem adapter (read + write).
uint32_t priv_rd32(const uint8_t *p)
Decode a little-endian uint32_t from a byte buffer.
ra8_err_t priv_read_sector(const ra8_fs_mount_t *m, uint64_t lba, uint8_t *buf)
Read a single sector into the module scratch buffer.
uint32_t priv_bps(const ra8_fs_mount_t *m)
One mounted volume's sector size in bytes.
uint64_t priv_rd64(const uint8_t *p)
Decode a little-endian uint64_t from a byte buffer.
static uint32_t internal_gpt_entry_is_basic_data(const uint8_t *entry)
Test whether a GPT entry's type GUID is Microsoft Basic Data.
static ra8_err_t internal_gpt_read_geom(const ra8_fs_mount_t *m, uint64_t *out_entry_lba, uint32_t *out_count)
Read and validate the GPT header, returning the entry-array geometry.
static const uint8_t s_gpt_signature[k_gpt_sig_len]
GPT header signature ("EFI PART", UEFI spec 2.10 table 5.5).
static ra8_err_t internal_gpt_entry_select(const uint8_t *entry, uint64_t *out_base)
Extract the first LBA of one explicitly selected GPT entry.
static ra8_err_t internal_gpt_scan_entries(const ra8_fs_mount_t *m, uint64_t entry_lba, uint32_t count, uint64_t *out_base)
Read the GPT entry array sector-by-sector and pick a base LBA.
static void internal_gpt_note_entry(const uint8_t *entry, uint64_t *basic_lba, uint64_t *any_lba)
Fold one GPT entry into the candidate base-LBA bookkeeping.
ra8_err_t priv_gpt_locate_volume(const ra8_fs_mount_t *m, uint64_t *out_base)
Locate the first mountable partition on a GPT disk (auto-select).
ra8_err_t priv_gpt_locate_partition(const ra8_fs_mount_t *m, uint8_t index, uint64_t *out_base)
Locate a GPT partition chosen by entry-array index.
static const uint8_t s_gpt_guid_basic_data[k_gpt_guid_len]
Microsoft Basic Data type GUID, on-disk byte order (EBD0A0A2-B9E5-4433-87C0-68B6B72699C7).
static uint64_t internal_gpt_entry_first_lba(const uint8_t *entry)
Extract a usable first-LBA from one GPT partition entry.
Cross-TU shared declarations for the FAT/exFAT ra8_fs adapter.
uint8_t g_fs_scratch[k_ra8_fs_sector_max]
Single max-sector scratch buffer reused across all I/O.
@ k_gpt_entry_off_first_lba
Entry: first LBA (8 bytes LE).
@ k_gpt_header_lba
GPT header location.
@ k_gpt_off_entry_lba
Entry-array first LBA (8 bytes LE).
@ k_gpt_guid_len
Type-GUID length in an entry.
@ k_gpt_off_entry_size
Bytes per partition entry.
@ k_gpt_off_entry_count
Number of partition entries.
@ k_gpt_entry_scan_max
Bounded entry walk (UEFI minimum).
@ k_gpt_sig_len
"EFI PART" signature length.
@ k_gpt_entry_bytes
Standard entry size supported.
Cached parse of one mounted FAT volume.