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/arm-exceptions.c

    r14807 r14873  
    18601860
    18611861void
    1862 install_signal_handler(int signo, void *handler, Boolean system_p, Boolean on_altstack)
     1862install_signal_handler(int signo, void *handler, unsigned flags)
    18631863{
    18641864  struct sigaction sa;
     1865  int err;
    18651866
    18661867  sigfillset(&sa.sa_mask);
     
    18681869  sa.sa_sigaction = (void *)handler;
    18691870  sigfillset(&sa.sa_mask);
    1870   sa.sa_flags =
    1871     0 /* SA_RESTART */
    1872     | SA_NODEFER
    1873     | SA_SIGINFO
     1871  sa.sa_flags = SA_SIGINFO;
     1872
     1873#ifdef ANDROID
     1874  sa.sa_flags |= SA_NODEFER
     1875#endif
    18741876#ifdef USE_SIGALTSTACK
    1875     | (on_altstack ? SA_ONSTACK : 0)
    1876 #endif
    1877     ;
    1878 
    1879   sigaction(signo, &sa, NULL);
     1877  if (flags & ON_ALTSTACK)
     1878    sa.sa_flags |= SA_ONSTACK;
     1879#endif
     1880  if (flags & RESTART_SYSCALLS)
     1881    sa.sa_flags |= SA_RESTART;
     1882  if (flags & RESERVE_FOR_LISP) {
     1883    extern sigset_t user_signals_reserved;
     1884    sigaddset(&user_signals_reserved, signo);
     1885  }
     1886
     1887  err = sigaction(signo, &sa, NULL);
     1888  if (err) {
     1889    perror("sigaction");
     1890    exit(1);
     1891  }
    18801892}
    18811893
     
    18961908    ;
    18971909  if (install_signal_handlers_for_exceptions) {
    1898     install_signal_handler(SIGILL, (void *)sigill_handler, true, false);
    1899     install_signal_handler(SIGSEGV, (void *)ALTSTACK(signal_handler),true, true);
    1900     install_signal_handler(SIGBUS, (void *)ALTSTACK(signal_handler),true,true);
     1910    install_signal_handler(SIGILL, (void *)sigill_handler, RESERVE_FOR_LISP);
     1911    install_signal_handler(SIGSEGV, (void *)ALTSTACK(signal_handler),
     1912                           RESERVE_FOR_LISP|ON_ALTSTACK);
     1913    install_signal_handler(SIGBUS, (void *)ALTSTACK(signal_handler),
     1914                           RESERVE_FOR_LISP|ON_ALTSTACK);
    19011915
    19021916  }
    19031917 
    19041918  install_signal_handler(SIGNAL_FOR_PROCESS_INTERRUPT,
    1905                          (void *)interrupt_handler, true, false);
     1919                         (void *)interrupt_handler, RESERVE_FOR_LISP);
    19061920  signal(SIGPIPE, SIG_IGN);
    19071921}
     
    19691983  thread_kill_signal = SIG_KILL_THREAD;
    19701984
    1971   install_signal_handler(thread_suspend_signal, (void *) suspend_resume_handler, true, false);
    1972   install_signal_handler(thread_kill_signal, (void *)thread_kill_handler, true, false);
     1985  install_signal_handler(thread_suspend_signal, (void *)suspend_resume_handler,
     1986                         RESERVE_FOR_LISP);
     1987  install_signal_handler(thread_kill_signal, (void *)thread_kill_handler,
     1988                         RESERVE_FOR_LISP);
    19731989}
    19741990
Note: See TracChangeset for help on using the changeset viewer.