Ignore:
Timestamp:
Jul 11, 2011, 8:42:13 PM (8 years ago)
Author:
rme
Message:

Change signature of install_signal_handler() and update
callers.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/lisp-kernel/ppc-exceptions.c

    r14438 r14873  
    22122212
    22132213void
    2214 install_signal_handler(int signo, void *handler, Boolean system, Boolean on_altstack)
     2214install_signal_handler(int signo, void *handler, unsigned flags)
    22152215{
    22162216  struct sigaction sa;
     2217  int err;
    22172218 
    22182219  sa.sa_sigaction = (void *)handler;
    22192220  sigfillset(&sa.sa_mask);
    2220   sa.sa_flags =
    2221     0 /* SA_RESTART */
    2222     | SA_SIGINFO
    2223 #ifdef DARWIN
    2224 #ifdef PPC64
    2225     | SA_64REGSET
    2226 #endif
    2227 #endif
    2228     ;
    2229 
    2230   sigaction(signo, &sa, NULL);
    2231   if (system) {
     2221  sa.sa_flags = SA_SIGINFO;
     2222
     2223  if (flags & RESTART_SYSCALLS)
     2224    sa.sa_flags |= SA_RESTART;
     2225  if (flags & RESERVE_FOR_LISP) {
    22322226    extern sigset_t user_signals_reserved;
    22332227    sigaddset(&user_signals_reserved, signo);
    22342228  }
    22352229
     2230  err = sigaction(signo, &sa, NULL);
     2231  if (err) {
     2232    perror("sigaction");
     2233    exit(1);
     2234  }
    22362235}
    22372236
     
    22522251  if (install_signal_handlers_for_exceptions) {
    22532252    extern int no_sigtrap;
    2254     install_signal_handler(SIGILL, (void *)signal_handler, true, false);
     2253    install_signal_handler(SIGILL, (void *)signal_handler, RESERVE_FOR_LISP);
    22552254    if (no_sigtrap != 1) {
    2256       install_signal_handler(SIGTRAP, (void *)signal_handler, true, false);
    2257     }
    2258     install_signal_handler(SIGBUS,  (void *)signal_handler, true, false);
    2259     install_signal_handler(SIGSEGV, (void *)signal_handler, true, false);
    2260     install_signal_handler(SIGFPE, (void *)signal_handler, true, false);
     2255      install_signal_handler(SIGTRAP, (void *)signal_handler, RESERVE_FOR_LISP);
     2256    }
     2257    install_signal_handler(SIGBUS,  (void *)signal_handler, RESERVE_FOR_LISP);
     2258    install_signal_handler(SIGSEGV, (void *)signal_handler, RESERVE_FOR_LISP);
     2259    install_signal_handler(SIGFPE, (void *)signal_handler, RESERVE_FOR_LISP);
    22612260  }
    22622261 
    22632262  install_signal_handler(SIGNAL_FOR_PROCESS_INTERRUPT,
    2264                          (void *)interrupt_handler, true, false);
     2263                         (void *)interrupt_handler, RESERVE_FOR_LISP);
    22652264  signal(SIGPIPE, SIG_IGN);
    22662265}
     
    23012300  thread_kill_signal = SIG_KILL_THREAD;
    23022301
    2303   install_signal_handler(thread_suspend_signal, (void *) suspend_resume_handler, true, false);
    2304   install_signal_handler(thread_kill_signal, (void *)thread_kill_handler, true, false);
     2302  install_signal_handler(thread_suspend_signal, (void *)suspend_resume_handler,
     2303                         RESERVE_FOR_LISP);
     2304  install_signal_handler(thread_kill_signal, (void *)thread_kill_handler,
     2305                         RESERVE_FOR_LISP);
    23052306}
    23062307
Note: See TracChangeset for help on using the changeset viewer.