Improve context structure handling on non-Windows.

Instead of copying data into and out of a fake CONTEXT structure with
only a few entries, use the platform specific structure directly with a
typedef and macros.  This is needed because fastmem writes need to be
able to access any register from BackPatch.  It adds a fair number of
repetitive defines, but it's better than the alternative.
This commit is contained in:
comex
2013-09-24 01:38:27 -04:00
parent 4cdce55615
commit 29dc253fde
5 changed files with 225 additions and 102 deletions

View File

@ -81,11 +81,9 @@ void sigsegv_handler(int signal, siginfo_t *info, void *raw_context)
u32 em_address = (u32)(bad_address - memspace_bottom);
CONTEXT fake_ctx;
fake_ctx.reg_pc = ctx->arm_pc;
const u8 *new_rip = jit->BackPatch(fault_instruction_ptr, em_address, &fake_ctx);
const u8 *new_rip = jit->BackPatch(fault_instruction_ptr, em_address, ctx);
if (new_rip) {
ctx->arm_pc = fake_ctx.reg_pc;
ctx->arm_pc = (u32) new_rip;
}
}