From d7c4d7afbf0472d2b842e352bdf066c2dbe9ff98 Mon Sep 17 00:00:00 2001 From: gbeauche <> Date: Mon, 20 May 2002 18:12:01 +0000 Subject: [PATCH] Backout "ignoresegv" support on FreeBSD/x86 for now. Unfortunately, the configure script would hang whereas standalone testing will pass all tests. Any idea why?? - Unix/sigsegv.cpp (ix86_skip_instruction): Add decoder for mozbl instruction. (SIGSEGV_REGISTER_FILE [FreeBSD/x86]): Note why we start at EDI offset rather than plain sigcontext pointer. i.e. I don't know sigset_t size beforehand and don't intend to. --- BasiliskII/ChangeLog | 3 +-- BasiliskII/README | 2 +- BasiliskII/src/Unix/sigsegv.cpp | 10 ++++++++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/BasiliskII/ChangeLog b/BasiliskII/ChangeLog index 52a57605..ce98ae76 100644 --- a/BasiliskII/ChangeLog +++ b/BasiliskII/ChangeLog @@ -3,8 +3,7 @@ V1.0 (snapshot) - just 60Hz (e.g. moving the mouse made the caret blink faster) - Unix: cleaned up pthread attributes [Brian Johnson] - Unix: fixed floppy problems under Linux - - Unix: implement "ignoresegv" feature on Linux/x86, Linux/ppc, Darwin/ppc, - FreeBSD/x86 + - Unix: implement "ignoresegv" feature on Linux/x86, Linux/ppc, Darwin/ppc V1.0 (snapshot) - 15.Jan.2002 - added support for on-the-fly video resolution and depth switching, and diff --git a/BasiliskII/README b/BasiliskII/README index c79c35fc..e8e0cb03 100644 --- a/BasiliskII/README +++ b/BasiliskII/README @@ -578,7 +578,7 @@ Unix: Set this to "true" to ignore illegal memory accesses. The default is "false". This feature is only implemented on the following - platforms: Linux/x86, Linux/ppc, Darwin/ppc, FreeBSD/x86. + platforms: Linux/x86, Linux/ppc, Darwin/ppc. AmigaOS: diff --git a/BasiliskII/src/Unix/sigsegv.cpp b/BasiliskII/src/Unix/sigsegv.cpp index 6b8d42f4..42bbbe1d 100644 --- a/BasiliskII/src/Unix/sigsegv.cpp +++ b/BasiliskII/src/Unix/sigsegv.cpp @@ -217,8 +217,11 @@ static void powerpc_decode_instruction(instruction_t *instruction, unsigned int #define SIGSEGV_FAULT_ADDRESS sip->si_addr #if (defined(i386) || defined(__i386__)) #define SIGSEGV_FAULT_INSTRUCTION (((struct sigcontext *)scp)->sc_eip) -#define SIGSEGV_REGISTER_FILE ((unsigned int *)&(((struct sigcontext *)scp)->sc_edi)) +#define SIGSEGV_REGISTER_FILE ((unsigned int *)&(((struct sigcontext *)scp)->sc_edi)) /* EDI is the first GPR (even below EIP) in sigcontext */ +/* (gb) Disable because this would hang configure script for some reason + * though standalone testing gets it right. Any idea why? #define SIGSEGV_SKIP_INSTRUCTION ix86_skip_instruction +*/ #endif #if defined(__linux__) #if (defined(i386) || defined(__i386__)) @@ -463,7 +466,9 @@ static bool ix86_skip_instruction(unsigned int * regs) // Decode instruction switch (eip[0]) { case 0x0f: - if (eip[1] == 0xb7) { // MOVZX r32, r/m16 + switch (eip[1]) { + case 0xb6: // MOVZX r32, r/m8 + case 0xb7: // MOVZX r32, r/m16 switch (eip[2] & 0xc0) { case 0x80: reg = (eip[2] >> 3) & 7; @@ -479,6 +484,7 @@ static bool ix86_skip_instruction(unsigned int * regs) break; } len += 3 + ix86_step_over_modrm(eip + 2); + break; } break; case 0x8a: // MOV r8, r/m8