|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
–fast-sd whole-block SD serving seam More...
#include <stdio.h>#include "board_periph_sd.h"#include "emu_elf.h"#include "emu_engine.h"#include "emu_host_io_internal.h"#include "emu_seams.h"#include "emu_trace.h"Go to the source code of this file.
Enumerations | |
| enum | fast_sd_const_t : uint16_t { k_fast_sd_block = 512U } |
| –fast-sd block-serving constants. More... | |
Functions | |
| static RA8_INTERNAL void | internal_on_sdmmc_read_block (uc_engine *uc, uint64_t address, uint32_t size, void *user) |
| Perform on sdmmc read block for the emu seam SD model. | |
| void | fast_sd_seam_install (uc_engine *uc, const emu_elf_source_t *elf) |
| Install the --fast-sd block-read hook if opted-in and the symbol exists. | |
| void | emu_fast_sd_enable (void) |
| Implementation of emu_fast_sd_enable() – CLI opt-in latch. | |
Variables | |
| static bool | s_fast_sd |
| True once --fast-sd is requested on the command line. | |
–fast-sd whole-block SD serving seam
Serves whole 512-byte SD blocks in C instead of clocking 512 SPI bytes each – an opt-in emulation-speed seam whose data path is byte-identical to the CMD17 stream (the FAT parse, inflate and render all still run on the real firmware). Moved verbatim out of the ra8_emulator main translation unit; the full rationale rides with the code below.
Definition in file emu_seam_sd.c.
| enum fast_sd_const_t : uint16_t |
–fast-sd block-serving constants.
| Enumerator | |
|---|---|
| k_fast_sd_block | SD block size served per hook entry. |
Definition at line 61 of file emu_seam_sd.c.
| void emu_fast_sd_enable | ( | void | ) |
Implementation of emu_fast_sd_enable() – CLI opt-in latch.
Opt in to the –fast-sd block-serving seam for this run.
Definition at line 149 of file emu_seam_sd.c.
References s_fast_sd.
Referenced by internal_args_try_mode().
| void fast_sd_seam_install | ( | uc_engine * | uc, |
| const emu_elf_source_t * | elf ) |
Install the --fast-sd block-read hook if opted-in and the symbol exists.
| [in,out] | uc | Active Unicorn engine. |
| [in] | elf | Loaded ELF image (for symbol resolution). |
uc is initialised and elf is a validated loaded image. s_fast_sd and the symbol present, a UC_HOOK_CODE fires internal_on_sdmmc_read_block at the function entry; otherwise nothing is armed.Definition at line 124 of file emu_seam_sd.c.
References elf_sym_addr(), internal_on_sdmmc_read_block(), priv_emu_io_errf(), and s_fast_sd.
Referenced by internal_main_install_run_seams().
|
static |
Perform on sdmmc read block for the emu seam SD model.
Perform on sdmmc read block for the emu seam sd model; this step is contained within the emu seam SD model and uses bounded caller or module-owned storage.
| [in,out] | uc | Unicorn engine whose emulated state is read or updated. |
| [in] | address | Guest address involved in the operation. |
| [in] | size | Size of the requested region or access in bytes. |
| [in,out] | user | Hook context supplied when the callback was registered. |
Definition at line 88 of file emu_seam_sd.c.
References board_sd_attached(), board_sd_read_block(), emu_mem_write(), emu_seam_request_relaunch(), eth_hook_return(), and k_fast_sd_block.
Referenced by fast_sd_seam_install().
|
static |
True once --fast-sd is requested on the command line.
Gates fast_sd_seam_install; when false the hook is never armed and the SD path runs the full faithful per-byte MMIO block protocol.
Definition at line 73 of file emu_seam_sd.c.
Referenced by emu_fast_sd_enable(), and fast_sd_seam_install().