clang format fix
This commit is contained in:
parent
1047293bf2
commit
d2c53d0fde
|
@ -12,14 +12,15 @@
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <sys/mman.h>
|
#include <sys/mman.h>
|
||||||
|
|
||||||
#define PROT_READ_WRITE (PROT_READ | PROT_WRITE) // There is no option to combine bitflags like this on Windows
|
#define PROT_READ_WRITE
|
||||||
|
(PROT_READ | PROT_WRITE) // There is no option to combine bitflags like this on Windows
|
||||||
#else
|
#else
|
||||||
#include <Windows.h>
|
#include <Windows.h>
|
||||||
|
|
||||||
#define PROT_NONE PAGE_NOACCESS
|
#define PROT_NONE PAGE_NOACCESS
|
||||||
#define PROT_READ_WRITE PAGE_READWRITE
|
#define PROT_READ_WRITE PAGE_READWRITE
|
||||||
|
|
||||||
void mprotect(void *addr, size_t len, int prot) {
|
void mprotect(void* addr, size_t len, int prot) {
|
||||||
DWORD old_prot{};
|
DWORD old_prot{};
|
||||||
BOOL result = VirtualProtect(addr, len, prot, &old_prot);
|
BOOL result = VirtualProtect(addr, len, prot, &old_prot);
|
||||||
ASSERT_MSG(result != 0, "Region protection failed");
|
ASSERT_MSG(result != 0, "Region protection failed");
|
||||||
|
@ -43,15 +44,14 @@ void GuestFaultSignalHandler(int sig, siginfo_t* info, void* raw_context) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
LONG WINAPI GuestFaultSignalHandler(EXCEPTION_POINTERS *pExp) noexcept {
|
LONG WINAPI GuestFaultSignalHandler(EXCEPTION_POINTERS* pExp) noexcept {
|
||||||
const u32 ec = pExp->ExceptionRecord->ExceptionCode;
|
const u32 ec = pExp->ExceptionRecord->ExceptionCode;
|
||||||
if (ec == EXCEPTION_ACCESS_VIOLATION) {
|
if (ec == EXCEPTION_ACCESS_VIOLATION) {
|
||||||
const auto info = pExp->ExceptionRecord->ExceptionInformation;
|
const auto info = pExp->ExceptionRecord->ExceptionInformation;
|
||||||
if (info[0] == 1) { // Write violation
|
if (info[0] == 1) { // Write violation
|
||||||
g_texture_cache->OnCpuWrite(info[1]);
|
g_texture_cache->OnCpuWrite(info[1]);
|
||||||
return EXCEPTION_CONTINUE_EXECUTION;
|
return EXCEPTION_CONTINUE_EXECUTION;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
UNREACHABLE();
|
UNREACHABLE();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue