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.30 by gbeauche, 2003-10-13T19:56:17Z vs.
Revision 1.31 by gbeauche, 2003-10-13T20:15:41Z

# Line 212 | Line 212 | static void powerpc_decode_instruction(i
212  
213   #if HAVE_SIGINFO_T
214   // Generic extended signal handler
215 #define SIGSEGV_FAULT_HANDLER                   sigsegv_fault_handler
215   #if defined(__NetBSD__) || defined(__FreeBSD__)
216   #define SIGSEGV_ALL_SIGNALS                             FAULT_HANDLER(SIGBUS)
217   #else
# Line 257 | Line 256 | static void powerpc_decode_instruction(i
256   #endif
257  
258   #if HAVE_SIGCONTEXT_SUBTERFUGE
260 #define SIGSEGV_FAULT_HANDLER                   sigsegv_fault_handler
259   // Linux kernels prior to 2.4 ?
260   #if defined(__linux__)
261   #define SIGSEGV_ALL_SIGNALS                             FAULT_HANDLER(SIGSEGV)
# Line 470 | Line 468 | if (ret != KERN_SUCCESS) { \
468  
469   #define SIGSEGV_FAULT_ADDRESS                   code[1]
470   #define SIGSEGV_FAULT_INSTRUCTION               get_fault_instruction(thread, state)
471 < #define SIGSEGV_FAULT_HANDLER                   (code[0] == KERN_PROTECTION_FAILURE) && sigsegv_fault_handler
471 > #define SIGSEGV_FAULT_HANDLER_INVOKE(ADDR, IP)  ((code[0] == KERN_PROTECTION_FAILURE) ? sigsegv_fault_handler(ADDR, IP) : SIGSEGV_RETURN_FAILURE)
472   #define SIGSEGV_FAULT_HANDLER_ARGLIST   mach_port_t thread, exception_data_t code, ppc_thread_state_t *state
473   #define SIGSEGV_FAULT_HANDLER_ARGS              thread, code, &state
474   #define SIGSEGV_SKIP_INSTRUCTION                powerpc_skip_instruction
# Line 784 | Line 782 | static bool powerpc_skip_instruction(uns
782   #ifndef SIGSEGV_FAULT_HANDLER_ARGLIST_1
783   #define SIGSEGV_FAULT_HANDLER_ARGLIST_1 SIGSEGV_FAULT_HANDLER_ARGLIST
784   #endif
785 + #ifndef SIGSEGV_FAULT_HANDLER_INVOKE
786 + #define SIGSEGV_FAULT_HANDLER_INVOKE(ADDR, IP)  sigsegv_fault_handler(ADDR, IP)
787 + #endif
788  
789   // SIGSEGV recovery supported ?
790   #if defined(SIGSEGV_ALL_SIGNALS) && defined(SIGSEGV_FAULT_HANDLER_ARGLIST) && defined(SIGSEGV_FAULT_ADDRESS)
# Line 804 | Line 805 | static bool handle_badaccess(SIGSEGV_FAU
805          sigsegv_address_t fault_instruction = (sigsegv_address_t)SIGSEGV_FAULT_INSTRUCTION;
806          
807          // Call user's handler and reinstall the global handler, if required
808 <        switch (sigsegv_fault_handler(fault_address, fault_instruction)) {
808 >        switch (SIGSEGV_FAULT_HANDLER_INVOKE(fault_address, fault_instruction)) {
809          case SIGSEGV_RETURN_SUCCESS:
810                  return true;
811  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines