target/avr: Move cpu register accesses into system memory

Integrate the i/o 0x00-0x1f and 0x38-0x3f loopbacks into
the cpu registers with normal address space accesses.
We no longer need to trap accesses to the first page within
avr_cpu_tlb_fill but can wait until a write occurs.

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
Richard Henderson 2025-03-21 17:14:27 -07:00
parent a2860ff908
commit 204a7bd856
5 changed files with 138 additions and 153 deletions

View file

@ -23,6 +23,7 @@
#include "cpu-qom.h"
#include "exec/cpu-defs.h"
#include "exec/memory.h"
#ifdef CONFIG_USER_ONLY
#error "AVR 8-bit does not support user mode"
@ -152,6 +153,9 @@ struct ArchCPU {
CPUAVRState env;
MemoryRegion cpu_reg1;
MemoryRegion cpu_reg2;
/* Initial value of stack pointer */
uint32_t init_sp;
};
@ -252,6 +256,9 @@ bool avr_cpu_tlb_fill(CPUState *cs, vaddr address, int size,
MMUAccessType access_type, int mmu_idx,
bool probe, uintptr_t retaddr);
extern const MemoryRegionOps avr_cpu_reg1;
extern const MemoryRegionOps avr_cpu_reg2;
#include "exec/cpu-all.h"
#endif /* QEMU_AVR_CPU_H */