ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/BasiliskII/src/Unix/sigsegv.cpp
(Generate patch)

Comparing BasiliskII/src/Unix/sigsegv.cpp (file contents):
Revision 1.54 by gbeauche, 2005-03-23T21:37:24Z vs.
Revision 1.55 by gbeauche, 2005-03-23T22:00:06Z

# Line 264 | Line 264 | static void powerpc_decode_instruction(i
264   #define SIGSEGV_SKIP_INSTRUCTION                ix86_skip_instruction
265   #endif
266   #endif
267 < #if defined(__FreeBSD__)
267 > #if defined(__FreeBSD__) || defined(__OpenBSD__)
268   #if (defined(i386) || defined(__i386__))
269   #define SIGSEGV_FAULT_INSTRUCTION               (((struct sigcontext *)scp)->sc_eip)
270   #define SIGSEGV_REGISTER_FILE                   ((unsigned long *)&(((struct sigcontext *)scp)->sc_edi)) /* EDI is the first GPR (even below EIP) in sigcontext */
# Line 737 | Line 737 | enum {
737   #endif
738   };
739   #endif
740 + #if defined(__OpenBSD__)
741 + enum {
742 + #if defined(__i386__)
743 +        // EDI is the first register we consider
744 + #define OREG(REG) offsetof(struct sigcontext, sc_##REG)
745 + #define DREG(REG) ((OREG(REG) - OREG(edi)) / 4)
746 +        X86_REG_EIP = DREG(eip), // 7
747 +        X86_REG_EAX = DREG(eax), // 6
748 +        X86_REG_ECX = DREG(ecx), // 5
749 +        X86_REG_EDX = DREG(edx), // 4
750 +        X86_REG_EBX = DREG(ebx), // 3
751 +        X86_REG_ESP = DREG(esp), // 10
752 +        X86_REG_EBP = DREG(ebp), // 2
753 +        X86_REG_ESI = DREG(esi), // 1
754 +        X86_REG_EDI = DREG(edi)  // 0
755 + #undef DREG
756 + #undef OREG
757 + #endif
758 + };
759 + #endif
760   #if defined(__sun__)
761   // Same as for Linux, need to check for x86-64
762   enum {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines