|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
Private raw-descriptor ELF source operations. More...
Go to the source code of this file.
Functions | |
| emu_elf_io_result_t | priv_emu_elf_source_open (const char *path, emu_elf_source_t *source) |
| Open one regular ELF source without reading or allocating its bytes. | |
| emu_elf_io_result_t | priv_emu_elf_source_close (emu_elf_source_t *source) |
| Close and invalidate one independently owned ELF source. | |
| emu_elf_io_result_t | priv_emu_elf_read (const emu_elf_source_t *source, uint64_t offset, size_t required_bytes, void *scratch, size_t supplied_bytes, emu_elf_view_t *view) |
| Read one exact source range into caller-owned bounded scratch. | |
Private raw-descriptor ELF source operations.
Shares the bounded source seam only among emulator engine and composition translation units; public ELF types remain in emu_elf.h.
Definition in file emu_elf_source_internal.h.
|
nodiscard |
Read one exact source range into caller-owned bounded scratch.
| [in] | source | Open immutable ELF source. |
| [in] | offset | First source byte to read. |
| [in] | required_bytes | Exact requested byte count. |
| [out] | scratch | Caller-owned destination. |
| [in] | supplied_bytes | Available destination bytes. |
| [out] | view | Receives the complete transient view on success. |
| k_emu_elf_io_ok | The view was published completely. |
| k_emu_elf_io_capacity | Required bytes exceed supplied bytes. |
scratch spans supplied_bytes writable bytes when nonzero. source remains open through the operation. view untouched. required_bytes at offset. Definition at line 99 of file emu_elf_source.c.
References emu_elf_source_t::fd, internal_elf_result(), internal_from_host(), k_emu_elf_io_capacity, k_emu_elf_io_eof, k_emu_elf_io_invalid, k_emu_elf_io_ok, k_emu_io_ok, emu_elf_source_t::length, priv_emu_io_pread_exact(), and emu_io_result_t::status.
Referenced by internal_div0_scan_segment(), internal_load_segment(), internal_long_shift_segment(), internal_program_table(), internal_stream_segment(), and internal_symbol_read().
|
nodiscard |
Close and invalidate one independently owned ELF source.
| [in,out] | source | Open source to close. |
| k_emu_elf_io_ok | The descriptor was closed and invalidated. |
| k_emu_elf_io_invalid | source was null or already closed. |
source is null, closed, or owned by the caller. source. Definition at line 85 of file emu_elf_source.c.
References emu_elf_source_t::fd, internal_elf_result(), internal_from_host(), k_emu_elf_io_invalid, k_emu_elf_io_ok, k_emu_io_ok, emu_elf_source_t::length, priv_emu_io_close(), and emu_io_result_t::status.
Referenced by internal_main_load_images(), internal_main_load_ns(), internal_main_load_primary(), internal_main_run_loaded(), and priv_run_cleanup().
|
nodiscard |
Open one regular ELF source without reading or allocating its bytes.
| [in] | path | NUL-terminated source path. |
| [out] | source | Receives an independently owned descriptor on success. |
| k_emu_elf_io_ok | A regular source was published with its exact length. |
| k_emu_elf_io_error | The source could not be opened or stated. |
path and source are non-null. source is not currently open. source untouched and owns no descriptor. source open until priv_emu_elf_source_close. Definition at line 70 of file emu_elf_source.c.
References internal_elf_result(), internal_from_host(), k_emu_elf_io_invalid, k_emu_elf_io_ok, k_emu_io_ok, emu_elf_source_t::length, priv_emu_io_open_read(), and emu_io_result_t::status.
Referenced by internal_main_load_ns(), and internal_main_load_primary().