Changeset 9913 for trunk/src/kernel32


Ignore:
Timestamp:
Mar 6, 2003, 1:49:08 PM (23 years ago)
Author:
sandervl
Message:

Don't change the stack alignment if the thread has less than 128 kb stack.

Location:
trunk/src/kernel32
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kernel32/exceptutil.asm

    r9822 r9913  
    1 ; $Id: exceptutil.asm,v 1.24 2003-02-18 11:38:30 sandervl Exp $
     1; $Id: exceptutil.asm,v 1.25 2003-03-06 12:49:08 sandervl Exp $
    22
    33;/*
     
    155155
    156156
     157;;ULONG CDECL AsmCallThreadHandler(BOOL fAlignStack, ULONG handler, LPVOID parameter);
    157158        PUBLIC  _AsmCallThreadHandler
    158159_AsmCallThreadHandler proc near
    159160        push    ebp
    160161        mov     ebp, esp
     162
     163;first check if we have 128kb stack or more; if not, then skip the stack alignment code
     164        mov     eax, [ebp+8]
     165        cmp     eax, 0
     166        je      @goodthreadstack
    161167
    162168;We're asking for problems if our stack start near a 64kb boundary
     
    192198@goodthreadstack:
    193199
    194         push    dword ptr [ebp+12]
    195         mov     eax, dword ptr [ebp+8]
     200        push    dword ptr [ebp+16]
     201        mov     eax, dword ptr [ebp+12]
    196202        call    eax
    197203
  • trunk/src/kernel32/exceptutil.h

    r8548 r9913  
    1 /* $Id: exceptutil.h,v 1.14 2002-06-02 12:42:09 sandervl Exp $ */
     1/* $Id: exceptutil.h,v 1.15 2003-03-06 12:49:08 sandervl Exp $ */
    22
    33/*
     
    3232#endif
    3333
    34 ULONG CDECL AsmCallThreadHandler(ULONG handler, LPVOID parameter);
     34ULONG CDECL AsmCallThreadHandler(BOOL fAlignStack, ULONG handler, LPVOID parameter);
    3535
    3636DWORD CDECL CallEntryPoint(DWORD entryPoint, DWORD parameter);
  • trunk/src/kernel32/thread.cpp

    r9910 r9913  
    1 /* $Id: thread.cpp,v 1.51 2003-03-06 10:22:27 sandervl Exp $ */
     1/* $Id: thread.cpp,v 1.52 2003-03-06 12:49:08 sandervl Exp $ */
    22
    33/*
     
    348348    Win32DllBase::attachThreadToAllDlls();    //send DLL_THREAD_ATTACH message to all dlls
    349349
     350    BOOL fAlignStack = ((ULONG)winteb->stack_top - (ULONG)winteb->stack_low) >= 128*1024;
     351
    350352    //Set FPU control word to 0x27F (same as in NT)
    351353    CONTROL87(0x27F, 0xFFF);
    352     rc = AsmCallThreadHandler(threadCallback, userdata);
     354    rc = AsmCallThreadHandler(fAlignStack, threadCallback, userdata);
    353355
    354356    if(fExitProcess) {
Note: See TracChangeset for help on using the changeset viewer.