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.1 by gbeauche, 2001-05-20T20:31:50Z vs.
Revision 1.2 by gbeauche, 2001-05-21T03:21:54Z

# Line 139 | Line 139 | static bool sigsegv_do_install_handler(i
139   #define SIGSEGV_FAULT_INSTRUCTION               SIGSEGV_INVALID_PC
140   #endif
141  
142 + // SIGSEGV recovery supported ?
143 + #if defined(SIGSEGV_ALL_SIGNALS) && defined(SIGSEGV_FAULT_HANDLER_ARGLIST) && defined(SIGSEGV_FAULT_ADDRESS)
144 + #define HAVE_SIGSEGV_RECOVERY
145 + #endif
146 +
147  
148   /*
149   *  SIGSEGV global handler
150   */
151  
152 + #ifdef HAVE_SIGSEGV_RECOVERY
153   static void sigsegv_handler(SIGSEGV_FAULT_HANDLER_ARGLIST)
154   {
155          // Call user's handler and reinstall the global handler, if required
# Line 159 | Line 165 | static void sigsegv_handler(SIGSEGV_FAUL
165   #undef FAULT_HANDLER
166          }
167   }
168 + #endif
169  
170  
171   /*
# Line 179 | Line 186 | static bool sigsegv_do_install_handler(i
186          return (signal(sig, (signal_handler)sigsegv_handler) != SIG_ERR);
187   #endif
188   }
189 < #elif defined(HAVE_SIGCONTEXT_SUBTERFUGE)
189 > #endif
190 >
191 > #if defined(HAVE_SIGCONTEXT_SUBTERFUGE)
192   static bool sigsegv_do_install_handler(int sig)
193   {
194          // Setup SIGSEGV handler to process writes to frame buffer
# Line 202 | Line 211 | static bool sigsegv_do_install_handler(i
211  
212   bool sigsegv_install_handler(sigsegv_handler_t handler)
213   {
214 < #if defined(HAVE_SIGINFO_T) || defined(HAVE_SIGCONTEXT_SUBTERFUGE)
214 > #ifdef HAVE_SIGSEGV_RECOVERY
215          sigsegv_user_handler = handler;
216          bool success = true;
217   #define FAULT_HANDLER(sig) success = success && sigsegv_do_install_handler(sig);
# Line 222 | Line 231 | bool sigsegv_install_handler(sigsegv_han
231  
232   void sigsegv_deinstall_handler(void)
233   {
234 + #ifdef HAVE_SIGSEGV_RECOVERY
235          sigsegv_user_handler = 0;
236   #define FAULT_HANDLER(sig) signal(sig, SIG_DFL);
237          SIGSEGV_ALL_SIGNALS
238   #undef FAULT_HANDLER
239 + #endif
240   }
241  
242   /*

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines