[CPU] Move ARM definitions to arm_defs.hpp file

This commit is contained in:
wheremyfoodat 2022-09-20 15:43:37 +03:00
parent 9b95bd87f1
commit 33fc380896
5 changed files with 64 additions and 61 deletions

View file

@ -1,5 +1,6 @@
#ifdef CPU_DYNARMIC
#include "cpu_dynarmic.hpp"
#include "arm_defs.hpp"
CPU::CPU(Memory& mem, Kernel& kernel) : mem(mem), env(mem, kernel, *this) {
cp15 = std::make_shared<CP15>();
@ -16,8 +17,8 @@ CPU::CPU(Memory& mem, Kernel& kernel) : mem(mem), env(mem, kernel, *this) {
}
void CPU::reset() {
// ARM mode, all flags disabled, interrupts and aborts all enabled, user mode
setCPSR(0x00000010);
setCPSR(CPSR::UserMode);
setFPSCR(FPSCR::ThreadDefault);
cp15->reset();
cp15->setTLSBase(VirtualAddrs::TLSBase); // Set cp15 TLS pointer to the main thread's thread-local storage