Changeset 11002


Ignore:
Timestamp:
Oct 7, 2008, 4:10:52 AM (11 years ago)
Author:
gb
Message:

Define ensure_safe_for_string_operations() - which clears the direction
flag and ensures that %es = %ds - and call it before copying structures
around in windows_arbstack_exception_handler(). (The assembler function
is supposed to trap if %es /= %ds; my model of things is that it always
should be.)

Still get occasional faults in memcpy(), so there may be some similar
case that isn't handled right (maybe interrupt/suspend ?).

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

Legend:

Unmodified
Added
Removed
  • trunk/source/lisp-kernel/x86-asmutils32.s

    r10930 r11002  
    236236C(restore_windows_context_iret): .long Xrestore_windows_context_iret
    237237
    238 
     238        __ifdef([WIN32_ES_HACK])
    239239/* Something that we shouldn't return to */
    240240_exportfn(C(windows_halt))
    241241        __(hlt)
    242 _endfn                               
     242_endfn         
     243        __endif
     244_exportfn(C(ensure_safe_for_string_operations))
     245        __ifdef([WIN32_ES_HACK])
     246        __(movw %es,%ax)
     247        __(movw %ds,%dx)
     248        __(cmpw %ax,%dx)
     249        __(jne 9f)
     2500:      __(movw %dx,%es)
     251        __endif
     252        __(cld)       
     253        __(ret)
     254        __ifdef ([WIN32_ES_HACK])
     2559:      __(hlt)
     256        __(jmp 0b)
     257        __endif
     258_endfn                                       
    243259        __endif
    244260        _endfile
  • trunk/source/lisp-kernel/x86-exceptions.c

    r10995 r11002  
    18331833windows_arbstack_exception_handler(EXCEPTION_POINTERS *exception_pointers)
    18341834{
     1835  extern void ensure_safe_for_string_operations(void);
    18351836  DWORD code = exception_pointers->ExceptionRecord->ExceptionCode;
     1837
     1838  ensure_safe_for_string_operations();
    18361839 
    18371840  if ((code & 0x80000000L) == 0) {
Note: See TracChangeset for help on using the changeset viewer.