Changeset 14549


Ignore:
Timestamp:
Jan 4, 2011, 1:31:59 AM (8 years ago)
Author:
gb
Message:

Android wants to pretend that Linux only supports 32 traditional
signals (and doesn't support RT signals.) Use traditional (non-RT)
signal numbers for CCL (so no #$SIGUSR2 for user code.)

That's bad enough, but they define #_pthread_sigmask in terms
of #_rt_sigprocmask, and get it wrong: #_pthread_sigmask always
fails. It's possible to waste lots of time tracking this down,
but it's been known for a long time:

<http://markmail.org/message/s657k4ogn7qtqghp#query:+page:1+mid:s657k4ogn7qtqghp+state:results>

Sadly, poor little Google can't afford to hire people who know
what they're doing.

Location:
trunk/source/lisp-kernel
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/lisp-kernel/arm-asmutils.s

    r14184 r14549  
    150150_exportfn(C(get_vector_registers))
    151151        __(uuo_debug_trap(al))
    152 _endfn         
     152_endfn
     153       
     154        __ifdef(`ANDROID')
     155_exportfn(rt_sigprocmask)
     156        __(stmdb sp!,{r7,lr})
     157        __(mov r7,#175)
     158        __(svc #0)
     159        __(ldmia sp!,{r7,pc})
     160_endfn
     161        __endif
     162       
    153163
    154164        __ifdef(`DARWIN')
     
    181191        __(bx ip)
    182192_endfn               
    183                        
     193
     194                               
    184195        _endfile
    185196
  • trunk/source/lisp-kernel/arm-exceptions.c

    r14545 r14549  
    4343#include <sysexits.h>
    4444
     45
    4546/* a distinguished UUO at a distinguished address */
    4647extern void pseudo_sigreturn(ExceptionInformation *);
     
    5051#include "threads.h"
    5152
     53#ifdef ANDROID
     54#define pthread_sigmask(how,in,out) rt_sigprocmask(how,in,out,8)
     55#endif
    5256
    5357#ifdef LINUX
     
    13371341exit_signal_handler(TCR *tcr, int old_valence, natural old_last_lisp_frame)
    13381342{
     1343#ifndef ANDROID
    13391344  sigset_t mask;
    13401345  sigfillset(&mask);
     1346#else
     1347  int mask [] = {0,0};
     1348#endif
    13411349 
    1342   pthread_sigmask(SIG_SETMASK,&mask, NULL);
     1350  pthread_sigmask(SIG_SETMASK,(sigset_t *)&mask, NULL);
    13431351  tcr->valence = old_valence;
    13441352  tcr->pending_exception_context = NULL;
     
    17561764{
    17571765  struct sigaction sa;
     1766
     1767  sigfillset(&sa.sa_mask);
    17581768 
    17591769  sa.sa_sigaction = (void *)handler;
     
    17611771  sa.sa_flags =
    17621772    0 /* SA_RESTART */
     1773    | SA_NODEFER
    17631774    | SA_SIGINFO
    17641775#ifdef USE_SIGALTSTACK
     
    18201831  TCR *tcr = get_tcr(false);
    18211832  area *a;
     1833#ifndef ANDROID
    18221834  sigset_t mask;
    18231835 
    18241836  sigemptyset(&mask);
     1837#else
     1838  int mask[] = {0,0};
     1839#endif
    18251840
    18261841  if (tcr) {
     
    18361851  }
    18371852 
    1838   pthread_sigmask(SIG_SETMASK,&mask,NULL);
     1853  pthread_sigmask(SIG_SETMASK,(sigset_t *)&mask,NULL);
    18391854  pthread_exit(NULL);
    18401855}
  • trunk/source/lisp-kernel/lisp-exceptions.h

    r14295 r14549  
    102102#else
    103103#define ALLOW_EXCEPTIONS(context) \
    104   pthread_sigmask(SIG_SETMASK, &context->uc_sigmask, NULL);
     104pthread_sigmask(SIG_SETMASK, (sigset_t *)(&context->uc_sigmask), NULL);
    105105#endif
    106106
  • trunk/source/lisp-kernel/os-linux.h

    r13638 r14549  
    1717
    1818#define SIGNAL_FOR_PROCESS_INTERRUPT SIGPWR
     19#ifdef ANDROID
     20#define SIG_SUSPEND_THREAD SIGUSR2
     21#define SIG_KILL_THREAD SIGXCPU
     22#else
    1923#define SIG_SUSPEND_THREAD (SIGRTMIN+6)
    2024#define SIG_KILL_THREAD (SIGRTMIN+7)
     25#endif
Note: See TracChangeset for help on using the changeset viewer.