mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-07-27 04:25:12 +00:00
clang-format lolz
This commit is contained in:
parent
01ce538cd6
commit
d3f2aedb1e
@ -6,12 +6,12 @@
|
|||||||
#include <boost/container/flat_map.hpp>
|
#include <boost/container/flat_map.hpp>
|
||||||
#include <xbyak/xbyak.h>
|
#include <xbyak/xbyak.h>
|
||||||
#include <xbyak/xbyak_util.h>
|
#include <xbyak/xbyak_util.h>
|
||||||
#include "core/signals.h"
|
|
||||||
#include "common/config.h"
|
#include "common/config.h"
|
||||||
#include "common/io_file.h"
|
#include "common/io_file.h"
|
||||||
#include "common/logging/log.h"
|
#include "common/logging/log.h"
|
||||||
#include "common/path_util.h"
|
#include "common/path_util.h"
|
||||||
#include "common/signal_context.h"
|
#include "common/signal_context.h"
|
||||||
|
#include "core/signals.h"
|
||||||
#include "shader_recompiler/info.h"
|
#include "shader_recompiler/info.h"
|
||||||
#include "shader_recompiler/ir/breadth_first_search.h"
|
#include "shader_recompiler/ir/breadth_first_search.h"
|
||||||
#include "shader_recompiler/ir/opcodes.h"
|
#include "shader_recompiler/ir/opcodes.h"
|
||||||
@ -69,8 +69,8 @@ static bool SrtWalkerSignalHandler(void* context, void* fault_address) {
|
|||||||
// Patch instruction to zero register
|
// Patch instruction to zero register
|
||||||
ZydisDecodedInstruction instruction;
|
ZydisDecodedInstruction instruction;
|
||||||
ZydisDecodedOperand operands[ZYDIS_MAX_OPERAND_COUNT];
|
ZydisDecodedOperand operands[ZYDIS_MAX_OPERAND_COUNT];
|
||||||
ZyanStatus status = Common::Decoder::Instance()->decodeInstruction(
|
ZyanStatus status = Common::Decoder::Instance()->decodeInstruction(instruction, operands,
|
||||||
instruction, operands, const_cast<void*>(code), 15);
|
const_cast<void*>(code), 15);
|
||||||
|
|
||||||
ASSERT(ZYAN_SUCCESS(status) && instruction.mnemonic == ZYDIS_MNEMONIC_MOV &&
|
ASSERT(ZYAN_SUCCESS(status) && instruction.mnemonic == ZYDIS_MNEMONIC_MOV &&
|
||||||
operands[0].type == ZYDIS_OPERAND_TYPE_REGISTER &&
|
operands[0].type == ZYDIS_OPERAND_TYPE_REGISTER &&
|
||||||
@ -83,21 +83,21 @@ static bool SrtWalkerSignalHandler(void* context, void* fault_address) {
|
|||||||
// We can only encounter rdi or r10d as the first operand in a
|
// We can only encounter rdi or r10d as the first operand in a
|
||||||
// fault memory access for SRT walker.
|
// fault memory access for SRT walker.
|
||||||
switch (operands[0].reg.value) {
|
switch (operands[0].reg.value) {
|
||||||
case ZYDIS_REGISTER_RDI:
|
case ZYDIS_REGISTER_RDI:
|
||||||
// mov rdi, [rdi + (off_dw << 2)] -> xor rdi, rdi
|
// mov rdi, [rdi + (off_dw << 2)] -> xor rdi, rdi
|
||||||
code_patch[0] = 0x48;
|
code_patch[0] = 0x48;
|
||||||
code_patch[1] = 0x31;
|
code_patch[1] = 0x31;
|
||||||
code_patch[2] = 0xFF;
|
code_patch[2] = 0xFF;
|
||||||
break;
|
break;
|
||||||
case ZYDIS_REGISTER_R10D:
|
case ZYDIS_REGISTER_R10D:
|
||||||
// mov r10d, [rdi + (off_dw << 2)] -> xor r10d, r10d
|
// mov r10d, [rdi + (off_dw << 2)] -> xor r10d, r10d
|
||||||
code_patch[0] = 0x45;
|
code_patch[0] = 0x45;
|
||||||
code_patch[1] = 0x31;
|
code_patch[1] = 0x31;
|
||||||
code_patch[2] = 0xD2;
|
code_patch[2] = 0xD2;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
UNREACHABLE_MSG("Unsupported register for SRT walker patch");
|
UNREACHABLE_MSG("Unsupported register for SRT walker patch");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fill nops
|
// Fill nops
|
||||||
|
Loading…
Reference in New Issue
Block a user