62 const uint32_t imm11 = (uint32_t)(hw & (uint16_t)
k_op_bn_imm);
68 if ((target > aligned) || ((aligned - target) > (uint32_t)
k_idle_loop_max)) {
74 if (
emu_mem_read(uc, (uint64_t)k, &bhw,
sizeof(bhw)) != UC_ERR_OK) {
122 const uint32_t aligned = pc & ~1U;
124 if (
emu_mem_read(uc, (uint64_t)aligned, &hw0,
sizeof(hw0)) != UC_ERR_OK) {
136 if (
emu_mem_read(uc, (uint64_t)at, &hw,
sizeof(hw)) != UC_ERR_OK) {
Cortex-M exception model constants and interfaces for ra8_emulator.
@ k_thumb2_insn_bytes
32-bit Thumb-2 instruction width.
@ k_thumb_hw_bytes
Bytes per Thumb halfword.
bool idle_spin_at(uc_engine *uc, uint32_t pc)
True if pc sits in a wait-for-interrupt spin (the core is idle).
static RA8_INTERNAL bool internal_idle_back_edge(uc_engine *uc, uint32_t at, uint16_t hw, uint32_t aligned, bool *done)
Does the halfword at at close a tight idle loop around aligned?
uc_err emu_mem_read(uc_engine *uc, uint64_t address, void *bytes, size_t count)
Read guest memory through the central access seam.
The chunked emulation run loop, report and exit-code mapping.
@ k_op_wfi
Thumb wfi (wait-for-interrupt).
@ k_idle_loop_max
Largest idle loop (bytes) that may hold PC.
@ k_idle_scan_fwd
Halfwords scanned ahead for a loop edge.
@ k_bn_imm_sext_shl
Shift imm11 bit10 up to bit31 (sign bit).
@ k_bn_imm_sext_shr
Arith >> sign-extends and scales imm by 2.
@ k_op_bn_mask
Mask selecting a Thumb T2 b.n opcode.
@ k_op_branch_self
Thumb "b ." (branch-to-self idle loop).
@ k_op_bn_base
Thumb T2 unconditional b.n base value.
@ k_op_cpsie_i
Thumb cpsie i (re-enable IRQ in a poll).
@ k_op_bn_imm
Thumb T2 b.n imm11 field mask.
#define RA8_INTERNAL
Marker that a function is intended to be static (file-local).