Changeset 5622


Ignore:
Timestamp:
Dec 14, 2006, 6:47:14 PM (18 years ago)
Author:
Gary Byers
Message:

Need to handle SIGQUIT on ppc, too.

File:
1 edited

Legend:

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

    r5542 r5622  
    3838#define SA_NODEFER 0
    3939#endif
     40#include <sysexits.h>
    4041
    4142/* a distinguished UUO at a distinguished address */
     
    656657}
    657658
     659TCR *gc_tcr = NULL;
     660
    658661/* Suspend and "normalize" other tcrs, then call a gc-like function
    659662   in that context.  Resume the other tcrs, then return what the
     
    679682    return 0;
    680683  }
     684
     685  gc_tcr = tcr;
    681686
    682687  xpGPR(xp, allocptr) = VOID_ALLOCPTR;
     
    709714    other_tcr = other_tcr->next;
    710715  } while (other_tcr != tcr);
     716
     717  gc_tcr = NULL;
    711718
    712719  resume_other_threads(true);
     
    13591366  tcr->save_tsp = (LispObj*) ptr_from_lispobj(xpGPR(xp, tsp));
    13601367
    1361   tcr->lisp_fpscr.words.l = 0xd0;
    1362   enable_fp_exceptions();
    13631368
    13641369
     
    20952100
    20962101void
     2102quit_handler(int signum, siginfo_t info, ExceptionInformation *xp)
     2103{
     2104  TCR *tcr = get_tcr(false);
     2105  area *a;
     2106  sigset_t mask;
     2107 
     2108  sigemptyset(&mask);
     2109
     2110  if (tcr) {
     2111    tcr->valence = TCR_STATE_FOREIGN;
     2112    a = tcr->vs_area;
     2113    if (a) {
     2114      a->active = a->high;
     2115    }
     2116    a = tcr->ts_area;
     2117    if (a) {
     2118      a->active = a->high;
     2119    }
     2120    a = tcr->cs_area;
     2121    if (a) {
     2122      a->active = a->high;
     2123    }
     2124  }
     2125 
     2126  pthread_sigmask(SIG_SETMASK,&mask,NULL);
     2127  pthread_exit(NULL);
     2128}
     2129
     2130void
    20972131thread_signal_setup()
    20982132{
     
    21022136  install_signal_handler(thread_suspend_signal, (void *) suspend_resume_handler);
    21032137  install_signal_handler(thread_resume_signal,  (void *) suspend_resume_handler);
     2138  install_signal_handler(SIGQUIT, (void *)quit_handler);
    21042139}
    21052140
     
    26722707#endif
    26732708    kret = 0;
     2709    if (tcr == gc_tcr) {
     2710      int i;
     2711      write(1, "exception in GC thread. Sleeping for 60 seconds\n",sizeof("exception in GC thread.  Sleeping for 60 seconds\n"));
     2712      for (i = 0; i < 60; i++) {
     2713        sleep(1);
     2714      }
     2715      _exit(EX_SOFTWARE);
     2716    }
    26742717  }
    26752718  return kret;
Note: See TracChangeset for help on using the changeset viewer.