Changeset 15873


Ignore:
Timestamp:
Aug 4, 2013, 3:24:00 PM (6 years ago)
Author:
gb
Message:

thread_manager.c: prototype pCancelSynchronousIo as WINAPI. (Likewise

pCancelIoEx, which is currently unused.)

x86-exceptions.c: map Windows exception code to signal number early.

Don't try to handle anything ... that we can't handle. Pass the
signal down through the callback setup stuff.

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

Legend:

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

    r15738 r15873  
    6161}
    6262 
    63 BOOL (*pCancelIoEx)(HANDLE, OVERLAPPED*) = NULL;
    64 BOOL (*pCancelSynchronousIo)(HANDLE) = NULL;
     63BOOL WINAPI (*pCancelIoEx)(HANDLE, OVERLAPPED*) = NULL;
     64BOOL WINAPI (*pCancelSynchronousIo)(HANDLE) = NULL;
    6565
    6666
  • trunk/source/lisp-kernel/x86-exceptions.c

    r15857 r15873  
    20222022
    20232023LONG
    2024 windows_exception_handler(EXCEPTION_POINTERS *exception_pointers, TCR *tcr)
     2024windows_exception_handler(EXCEPTION_POINTERS *exception_pointers, TCR *tcr, int signal_number)
    20252025{
    20262026  DWORD code = exception_pointers->ExceptionRecord->ExceptionCode;
    2027   int old_valence, signal_number;
     2027  int old_valence;
    20282028  ExceptionInformation *context = exception_pointers->ContextRecord;
    20292029  siginfo_t *info = exception_pointers->ExceptionRecord;
     
    20332033  wait_for_exception_lock_in_handler(tcr, context, &xframes);
    20342034
    2035   signal_number = map_windows_exception_code_to_posix_signal(code, info, context);
     2035
    20362036 
    20372037  if (!handle_exception(signal_number, info, context, tcr, old_valence)) {
     
    20542054                             void *handler,
    20552055                             EXCEPTION_POINTERS *new_ep,
    2056                              TCR *tcr)
     2056                             TCR *tcr,
     2057                             int signal_number)
    20572058{
    20582059  extern void windows_halt(void);
     
    20652066  context->Rcx = (DWORD64)new_ep;
    20662067  context->Rdx = (DWORD64)tcr;
     2068  context->R8 = (DWORD64)signal_number;
    20672069#else
    20682070  p-=4;                          /* args on stack, stack aligned */
    20692071  p[0] = (LispObj)new_ep;
    20702072  p[1] = (LispObj)tcr;
     2073  p[2] = signal_number;
    20712074  *(--p) = (LispObj)windows_halt;
    20722075  context->Esp = (DWORD)p;
     
    20782081void
    20792082prepare_to_handle_windows_exception_on_foreign_stack(TCR *tcr,
     2083
    20802084                                                     CONTEXT *context,
    20812085                                                     void *handler,
    2082                                                      EXCEPTION_POINTERS *original_ep)
     2086                                                     EXCEPTION_POINTERS *original_ep,
     2087                                                     int signal_number)
    20832088{
    20842089  LispObj foreign_rsp =
     
    20982103  new_ep->ContextRecord = new_context;
    20992104  new_ep->ExceptionRecord = new_info;
    2100   setup_exception_handler_call(context,foreign_rsp,handler,new_ep, tcr);
     2105  setup_exception_handler_call(context,foreign_rsp,handler,new_ep, tcr, signal_number);
    21012106}
    21022107
     
    21062111  extern void ensure_safe_for_string_operations(void);
    21072112  DWORD code = exception_pointers->ExceptionRecord->ExceptionCode;
    2108 
    2109 
    2110   /* Only try to handle codes which have a "severity" of error
    2111      (e.g. have their high 2 bits set) and which don't have bit
    2112      29 - the "customer" bit - set.
    2113      (Runtime exceptions generated MS language products have #xE
    2114      in thier high nibbles.  So much for "reserved for the customer".)
    2115   */
    2116   if ((code & 0xF0000000L) != 0xc0000000) {
     2113  siginfo_t *info = exception_pointers->ExceptionRecord;
     2114  ExceptionInformation *context = exception_pointers->ContextRecord;
     2115  int signal_number = map_windows_exception_code_to_posix_signal(code, info, context);
     2116
     2117
     2118  if (signal_number <= 0) {
    21172119    return EXCEPTION_CONTINUE_SEARCH;
    21182120  } else {
     
    21202122    area *cs = TCR_AUX(tcr)->cs_area;
    21212123    BytePtr current_sp = (BytePtr) current_stack_pointer();
    2122     CONTEXT *context = exception_pointers->ContextRecord;
    21232124   
    21242125    ensure_safe_for_string_operations();
     
    21342135                                                         context,
    21352136                                                         windows_exception_handler,
    2136                                                          exception_pointers);
     2137                                                         exception_pointers,
     2138                                                         signal_number);
    21372139    return EXCEPTION_CONTINUE_EXECUTION;
    21382140  }
Note: See TracChangeset for help on using the changeset viewer.