immediately terminate in OO, use 2MB swap handler

This commit is contained in:
lizzie
2026-02-02 12:55:01 +00:00
parent 4f226a6fc0
commit cb6ad84c52
3 changed files with 8 additions and 10 deletions

View File

@@ -114,7 +114,7 @@ static void SwapHandler(int sig, void* raw_context) {
if (auto const it = std::ranges::find_if(swap_regions, [addr = mctx.mc_addr](auto const& e) {
return uintptr_t(addr) >= uintptr_t(e.first) && uintptr_t(addr) < uintptr_t(e.first) + e.second;
}); it != swap_regions.end()) {
size_t const page_size = 4096 * 8; //16K
size_t const page_size = 0x200000; //2M
size_t const page_mask = ~(page_size - 1);
// should replace the existing mapping... ugh
void* aligned_addr = reinterpret_cast<void*>(uintptr_t(mctx.mc_addr) & page_mask);
@@ -149,7 +149,6 @@ void* AllocateMemoryPages(std::size_t size) noexcept {
off_t offset = 0;
ASSERT(sceKernelAllocateDirectMemory(0, ORBIS_KERNEL_MAIN_DMEM_SIZE, len, align, ORBIS_KERNEL_WB_ONION, &offset) == 0);
ASSERT(sceKernelMapDirectMemory(&addr, len, ORBIS_KERNEL_PROT_CPU_RW, 0, offset, len) == 0);
ASSERT(sceKernelMprotect(addr, len, VM_PROT_ALL) == 0);
LOG_WARNING(HW_Memory, "Using DMem for {} bytes area @ {}", len, addr);
ASSERT(addr != nullptr);
} else {

View File

@@ -87,6 +87,9 @@ void DynarmicCallbacks32::InterpreterFallback(u32 pc, std::size_t num_instructio
LOG_ERROR(Core_ARM,
"Unimplemented instruction @ {:#X} for {} instructions (instr = {:08X})", pc,
num_instructions, m_memory.Read32(pc));
#ifdef __OPENORBIS__
std::abort();
#endif
}
void DynarmicCallbacks32::ExceptionRaised(u32 pc, Dynarmic::A32::Exception exception) {
@@ -307,10 +310,6 @@ void ArmDynarmic32::MakeJit(Common::PageTable* page_table) {
default:
break;
}
#ifdef __OPENORBIS__
config.unsafe_optimizations = false;
config.optimizations = Dynarmic::no_optimizations;
#endif
m_jit.emplace(config);
}

View File

@@ -99,7 +99,11 @@ void DynarmicCallbacks64::InterpreterFallback(u64 pc, std::size_t num_instructio
m_parent.LogBacktrace(m_process);
LOG_ERROR(Core_ARM, "Unimplemented instruction @ {:#X} for {} instructions (instr = {:08X})", pc,
num_instructions, m_memory.Read32(pc));
#ifdef __OPENORBIS__
std::abort();
#else
ReturnException(pc, PrefetchAbort);
#endif
}
void DynarmicCallbacks64::InstructionCacheOperationRaised(Dynarmic::A64::InstructionCacheOperation op, u64 value) {
@@ -357,10 +361,6 @@ void ArmDynarmic64::MakeJit(Common::PageTable* page_table, std::size_t address_s
default:
break;
}
#ifdef __OPENORBIS__
config.unsafe_optimizations = false;
config.optimizations = Dynarmic::no_optimizations;
#endif
m_jit.emplace(config);
}