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

Cross-TU prototypes for the GPT partition locators. More...

Include dependency graph for ra8_fs_fat_gpt_internal.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

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.

Detailed Description

Cross-TU prototypes for the GPT partition locators.

The two entry points ra8_fs_fat_gpt.c offers the mount path: locate the first mountable partition on a GPT disk, and locate one by entry index. Split out as a themed sub-header (like the exFAT stream and directory seams) rather than grown onto the alphabetical prototype headers, which sit against the source-size cap.

Since
0.1.0

Definition in file ra8_fs_fat_gpt_internal.h.

Function Documentation

◆ priv_gpt_locate_partition()

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.

Reads the header geometry via ::priv_gpt_read_geom, bounds-checks index against the (clamped) entry count, reads the sector holding that entry, and validates it via ::priv_gpt_entry_select.

Parameters
[in,out]mMount whose backend supplies the sectors.
[in]indexZero-based GPT entry-array index.
[out]out_baseReceives the selected partition's first LBA.
Returns
Error code.
Return values
k_ra8_okout_base holds the volume base.
k_ra8_err_out_of_rangeindex is past the entry count.
k_ra8_err_not_foundThe selected entry is empty.
k_ra8_err_not_supportedEntry-array geometry, or an entry LBA, this backend cannot address.
k_ra8_err_validation_failedNo header, or a malformed entry.
k_ra8_err_*Backend read failure.
Precondition
m->partition_base_lba is still 0 (reads are absolute).
out_base is non-NULL.
Postcondition
On k_ra8_ok out_base holds a non-zero LBA.
g_fs_scratch is overwritten (callers must re-read their sector).
Note
Not thread-safe – uses module-level scratch.
Since
0.1.0

Definition at line 317 of file ra8_fs_fat_gpt.c.

References g_fs_scratch, internal_gpt_entry_select(), internal_gpt_read_geom(), k_gpt_entry_bytes, k_ra8_err_out_of_range, k_ra8_ok, priv_bps(), and priv_read_sector().

Referenced by internal_locate_indexed().

◆ priv_gpt_locate_volume()

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).

Reads the header geometry via ::priv_gpt_read_geom, then scans the entries via ::priv_gpt_scan_entries (Microsoft Basic Data preferred, else the first allocated entry of any type).

Parameters
[in,out]mMount whose backend supplies the sectors.
[out]out_baseReceives the chosen partition's first LBA.
Returns
Error code.
Return values
k_ra8_okout_base holds the volume base.
k_ra8_err_validation_failedNo "EFI PART" header at LBA 1.
k_ra8_err_not_supportedNon-standard entry size or array LBA.
k_ra8_err_*Backend read failure or no entry found.
Precondition
m->partition_base_lba is still 0 (reads are absolute).
out_base is non-NULL.
Postcondition
On k_ra8_ok out_base holds a non-zero LBA.
g_fs_scratch is overwritten (callers must re-read their sector).
Note
Not thread-safe – uses module-level scratch.
Since
0.1.0

Definition at line 263 of file ra8_fs_fat_gpt.c.

References internal_gpt_read_geom(), internal_gpt_scan_entries(), and k_ra8_ok.

Referenced by internal_read_boot_sector().