Changeset 10594


Ignore:
Timestamp:
Aug 31, 2008, 8:48:40 AM (11 years ago)
Author:
gb
Message:

Reference 'restore_windows_context*', not win64-specific.
Stub out some things for win32, conditionalize existing code for win64.

File:
1 edited

Legend:

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

    r10565 r10594  
    4545#ifdef WINDOWS
    4646extern pc spentry_start, spentry_end,subprims_start,subprims_end;
    47 extern pc restore_win64_context_start, restore_win64_context_end,
    48   restore_win64_context_load_rcx, restore_win64_context_iret;
     47extern pc restore_windows_context_start, restore_windows_context_end,
     48  restore_windows_context_load_rcx, restore_windows_context_iret;
    4949
    5050extern void interrupt_handler(int, siginfo_t *, ExceptionInformation *);
     
    116116   
    117117    *icontext = *pcontext;
    118    
     118
     119#ifdef WIN64   
    119120    xpGPR(pcontext,REG_RCX) = SIGNAL_FOR_PROCESS_INTERRUPT;
    120121    xpGPR(pcontext,REG_RDX) = 0;
     
    122123    xpGPR(pcontext,REG_RSP) = (LispObj)(((LispObj *)icontext)-1);
    123124    *(((LispObj *)icontext)-1) = (LispObj)raise_thread_interrupt;
     125#else
     126#warning need interrupt setup for win32
     127#endif
    124128    xpPC(pcontext) = (LispObj)interrupt_handler;
    125129    SetThreadContext(hthread,pcontext);
     
    456460    return 0;
    457461  case WAIT_TIMEOUT:
    458     return ETIMEDOUT;
     462    return WAIT_TIMEOUT;
    459463  default:
    460464    break;
     
    497501                    GetCurrentThread(),
    498502                    GetCurrentProcess(),
    499                     &current,
     503                    (LPHANDLE)(&current),
    500504                    0,
    501505                    FALSE,
     
    864868  tcr->ldt_selector = NULL_SEL;
    865869}
     870#endif
     871
     872#ifdef WINDOWS
     873void
     874setup_tcr_extra_segment(TCR *tcr)
     875{
     876}
     877
     878void
     879free_tcr_extra_segment(TCR *tcr)
     880{
     881}
     882
     883
    866884#endif
    867885#endif
     
    10001018    dequeue_tcr(tcr);
    10011019#endif
    1002 #ifdef DARWIN
    10031020#ifdef X8632
    10041021    free_tcr_extra_segment(tcr);
    1005 #endif
    10061022#endif
    10071023    UNLOCK(lisp_global(TCR_AREA_LOCK),tcr);
     
    14721488
    14731489    if (tcr->valence == TCR_STATE_LISP) {
    1474       if ((where >= restore_win64_context_start) &&
    1475           (where < restore_win64_context_end)) {
     1490      if ((where >= restore_windows_context_start) &&
     1491          (where < restore_windows_context_end)) {
    14761492        /* Thread has started to return from an exception. */
    1477         if (where < restore_win64_context_load_rcx) {
     1493        if (where < restore_windows_context_load_rcx) {
    14781494          /* In the process of restoring registers; context still in
    14791495             %rcx.  Just make our suspend_context be the context
     
    14811497             the suspend in the same context that we're trying to
    14821498             restore */
     1499#ifdef WIN64
    14831500          *pcontext = * (CONTEXT *)(pcontext->Rcx);
     1501#endif
    14841502        } else {
    14851503          /* Most of the context has already been restored; fix %rcx
    14861504             if need be, then restore ss:rsp, cs:rip, and flags. */
     1505#ifdef WIN64
    14871506          x64_iret_frame *iret_frame = (x64_iret_frame *) (pcontext->Rsp);
    1488           if (where == restore_win64_context_load_rcx) {
     1507          if (where == restore_windows_context_load_rcx) {
    14891508            pcontext->Rcx = ((CONTEXT*)(pcontext->Rcx))->Rcx;
    14901509          }
     
    14941513          pcontext->Rsp = iret_frame->Rsp;
    14951514          pcontext->SegSs = (WORD) iret_frame->Ss;
     1515#else
     1516#warning need context setup for win32
     1517#endif
    14961518        }
    14971519        tcr->suspend_context = NULL;
Note: See TracChangeset for help on using the changeset viewer.