mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-06-03 20:37:18 +12:00
Merge pull request #35 from Wunkolo/span-cpu-state
Use `std::span` for CPU register-state
This commit is contained in:
commit
1aab10bec7
5 changed files with 36 additions and 32 deletions
|
@ -1,5 +1,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <span>
|
||||
|
||||
#include "dynarmic/interface/A32/a32.h"
|
||||
#include "dynarmic/interface/A32/config.h"
|
||||
#include "dynarmic/interface/exclusive_monitor.h"
|
||||
|
@ -132,17 +134,11 @@ public:
|
|||
return jit->Regs()[index];
|
||||
}
|
||||
|
||||
std::array<u32, 16>& regs() {
|
||||
return jit->Regs();
|
||||
}
|
||||
std::span<u32, 16> regs() { return jit->Regs(); }
|
||||
|
||||
// Get reference to array of FPRs. This array consists of the FPRs as single precision values
|
||||
// Hence why its base type is u32
|
||||
// Note: Dynarmic keeps 64 VFP registers as VFPv3 extends the VFP register set to 64 registers.
|
||||
// However the 3DS ARM11 is an ARMv6k processor with VFPv2, so only the first 32 registers are actually used
|
||||
std::array<u32, 64>& fprs() {
|
||||
return jit->ExtRegs();
|
||||
}
|
||||
// Get reference to array of FPRs. This array consists of the FPRs as single precision values
|
||||
// Hence why its base type is u32
|
||||
std::span<u32, 32> fprs() { return std::span(jit->ExtRegs()).first<32>(); }
|
||||
|
||||
void setCPSR(u32 value) {
|
||||
jit->SetCpsr(value);
|
||||
|
|
|
@ -2,10 +2,12 @@
|
|||
#include <array>
|
||||
#include <cassert>
|
||||
#include <limits>
|
||||
#include <span>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include "kernel_types.hpp"
|
||||
|
||||
#include "helpers.hpp"
|
||||
#include "kernel_types.hpp"
|
||||
#include "logger.hpp"
|
||||
#include "memory.hpp"
|
||||
#include "resource_limits.hpp"
|
||||
|
@ -14,7 +16,7 @@
|
|||
class CPU;
|
||||
|
||||
class Kernel {
|
||||
std::array<u32, 16>& regs;
|
||||
std::span<u32, 16> regs;
|
||||
CPU& cpu;
|
||||
Memory& mem;
|
||||
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
#pragma once
|
||||
#include <array>
|
||||
#include <optional>
|
||||
#include <span>
|
||||
|
||||
#include "kernel_types.hpp"
|
||||
#include "logger.hpp"
|
||||
#include "memory.hpp"
|
||||
|
@ -14,16 +16,16 @@
|
|||
#include "services/cfg.hpp"
|
||||
#include "services/dlp_srvr.hpp"
|
||||
#include "services/dsp.hpp"
|
||||
#include "services/hid.hpp"
|
||||
#include "services/frd.hpp"
|
||||
#include "services/fs.hpp"
|
||||
#include "services/gsp_gpu.hpp"
|
||||
#include "services/gsp_lcd.hpp"
|
||||
#include "services/hid.hpp"
|
||||
#include "services/ldr_ro.hpp"
|
||||
#include "services/mic.hpp"
|
||||
#include "services/ndm.hpp"
|
||||
#include "services/nfc.hpp"
|
||||
#include "services/nim.hpp"
|
||||
#include "services/ndm.hpp"
|
||||
#include "services/ptm.hpp"
|
||||
#include "services/y2r.hpp"
|
||||
|
||||
|
@ -31,7 +33,7 @@
|
|||
class Kernel;
|
||||
|
||||
class ServiceManager {
|
||||
std::array<u32, 16>& regs;
|
||||
std::span<u32, 16> regs;
|
||||
Memory& mem;
|
||||
Kernel& kernel;
|
||||
|
||||
|
@ -69,8 +71,8 @@ class ServiceManager {
|
|||
void registerClient(u32 messagePointer);
|
||||
void subscribe(u32 messagePointer);
|
||||
|
||||
public:
|
||||
ServiceManager(std::array<u32, 16>& regs, Memory& mem, GPU& gpu, u32& currentPID, Kernel& kernel);
|
||||
public:
|
||||
ServiceManager(std::span<u32, 16> regs, Memory& mem, GPU& gpu, u32& currentPID, Kernel& kernel);
|
||||
void reset();
|
||||
void initializeFS() { fs.initializeFilesystem(); }
|
||||
void handleSyncRequest(u32 messagePointer);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue