mirror of
https://github.com/pound-emu/pound.git
synced 2025-12-12 19:36:57 +00:00
Introduce the basic data structures required to manage the architectural state of an emulated ARMv8 guest. This is a foundational patch for a forthcoming emulator framework. The core of this change is the `vcpu_state_t` structure, which holds the essential user-visible state of a single virtual CPU (vCPU), including the general-purpose registers, stack pointer, program counter, and PSTATE. The state for all vCPUs is aligned to the CPU L1 cache line. This design choice ensures that there is no false sharing between physical host cores running separate vCPU emulation threads. Signed-off-by: Ronald Caesar <github43132@proton.me>
20 lines
535 B
C++
Executable file
20 lines
535 B
C++
Executable file
#include "isa.h"
|
|
#include "Base/Assert.h"
|
|
|
|
void cpuTest()
|
|
{
|
|
aarch64::vcpu_state_t vcpu_states[CPU_CORES] = {};
|
|
|
|
// Outdated Code
|
|
CPU cpu;
|
|
cpu.pc = 0;
|
|
|
|
// Simple ARMv8 program in memory (MOVZ X0, #5; ADD X0, X0, #3; RET)
|
|
// These are placeholders; real encoding will be parsed later
|
|
cpu.write_byte(0, 0x05); // MOVZ placeholder
|
|
cpu.write_byte(4, 0x03); // ADD placeholder
|
|
cpu.write_byte(8, 0xFF); // RET placeholder
|
|
|
|
LOG_INFO(ARM, "{}", cpu.read_byte(0));
|
|
cpu.print_debug_information();
|
|
}
|