Ignore:
Timestamp:
Dec 18, 2011, 10:28:22 PM (14 years ago)
Author:
dmik
Message:

Merge branch gcc-kmk to trunk.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

    • Property svn:ignore
      •  

        old new  
        1 bin
        2 Makefile.inc
         1env.cmd
         2LocalConfig.kmk
    • Property svn:mergeinfo set to
      /branches/gcc-kmkmergedeligible
  • trunk/src/kernel32/exceptutil.asm

    r10409 r21916  
    3333
    3434CODE32          SEGMENT DWORD PUBLIC USE32 'CODE'
     35
     36
    3537        public  _RaiseException@16
    36         extrn   OS2RAISEEXCEPTION : near
     38        extrn   _OS2RaiseException : near
    3739
    3840_RaiseException@16 proc near
    39         push dword ptr [esp+4]  ;DWORD dwExceptionCode
    40         push dword ptr [esp+12] ;DWORD dwExceptionFlags
    41         push dword ptr [esp+20] ;DWORD cArguments
    42         push dword ptr [esp+28] ;DWORD *lpArguments
    43         push dword ptr [esp+16] ;return address
    44         push esp
    45         add  dword ptr [esp], 20
     41
     42        ; _OS2RaiseException is _cdecl
     43
    4644        push ebp
     45        mov  ebp, esp
     46        push eax
     47
     48        mov  eax, 0
     49        mov  eax, ss
     50        push eax
     51        mov  eax, gs
     52        push eax
     53        mov  eax, fs
     54        push eax
     55        mov  eax, es
     56        push eax
     57        mov  eax, ds
     58        push eax
     59        mov  eax, cs
     60        push cs
     61        push esi
     62        push edi
     63        push edx
     64        push ecx
     65        push ebx
     66        push dword ptr [ebp-4]      ; original eax
    4767        pushfd
    48         push eax
     68        push dword ptr [ebp]        ; original ebp
     69        push ebp
     70        add  dword ptr [esp], 4     ; original esp
     71        push dword ptr [ebp + 4]    ; original eip (return address)
     72
     73        push dword ptr [ebp + 20]   ; arg 4 (DWORD *lpArguments)
     74        push dword ptr [ebp + 16]   ; arg 3 (DWORD cArguments)
     75        push dword ptr [ebp + 12]   ; arg 2 (DWORD dwExceptionFlags)
     76        push dword ptr [ebp + 8]    ; arg 1 (DWORD dwExceptionCode)
     77
     78        call _OS2RaiseException
     79
     80        add esp, 20 * 4
     81
     82        pop eax
     83        pop ebp
     84
     85        ret 16      ;__stdcall
     86
     87_RaiseException@16 endp
     88
     89
     90        public  _RtlUnwind@16
     91        extrn   _OS2RtlUnwind : near
     92
     93_RtlUnwind@16 proc near
     94
     95        ; OS2RtlUnwind is _cdecl
     96
     97        push ebp
     98        mov  ebp, esp
     99        push eax
     100
     101        mov  eax, 0
     102        mov  eax, ss
     103        push eax
     104        mov  eax, gs
     105        push eax
     106        mov  eax, fs
     107        push eax
     108        mov  eax, es
     109        push eax
     110        mov  eax, ds
     111        push eax
     112        mov  eax, cs
     113        push cs
     114        push esi
     115        push edi
     116        push edx
     117        push ecx
    49118        push ebx
    50         push ecx
    51         push edx
    52         push edi
    53         push esi
    54         xor  eax, eax
    55         mov  eax, cs
    56         push eax
    57         mov  eax, ds
    58         push eax
    59         mov  eax, es
    60         push eax
    61         mov  eax, fs
    62         push eax
    63         mov  eax, gs
    64         push eax
    65         mov  eax, ss
    66         push eax
    67         call OS2RAISEEXCEPTION
     119        push dword ptr [ebp-4]      ; original eax
     120        pushfd
     121        push dword ptr [ebp]        ; original ebp
     122        push ebp
     123        add  dword ptr [esp], 4     ; original esp
     124        push dword ptr [ebp + 4]    ; original eip (return address)
     125
     126        push dword ptr [ebp + 20]   ; arg 4 (DWORD returnEax)
     127        push dword ptr [ebp + 16]   ; arg 3 (PWINEXCEPTION_RECORD pRecord)
     128        push dword ptr [ebp + 12]   ; arg 2 (LPVOID unusedEip)
     129        push dword ptr [ebp + 8]    ; arg 1 (PWINEXCEPTION_FRAME pEndFrame)
     130
     131        call _OS2RtlUnwind
     132
     133        add esp, 20 * 4
     134
     135        pop eax
     136        pop ebp
    68137
    69138        ret 16      ;__stdcall
    70 _RaiseException@16 endp
    71 
    72         public  _RtlUnwind@16
    73         extrn   OS2RTLUNWIND : near
    74 
    75 _RtlUnwind@16 proc near
    76         push dword ptr [esp+4]  ;PWINEXCEPTION_FRAME  pEndFrame
    77         push dword ptr [esp+12] ;LPVOID unusedEip
    78         push dword ptr [esp+20] ;PWINEXCEPTION_RECORD pRecord
    79         push dword ptr [esp+28] ;DWORD  returnEax
    80         push dword ptr [esp+16] ;return address
    81         push esp
    82         add  dword ptr [esp], 20
    83         push ebp
    84         pushfd
    85         push eax
    86         push ebx
    87         push ecx
    88         push edx
    89         push edi
    90         push esi
    91         xor  eax, eax
    92         mov  eax, cs
    93         push eax
    94         mov  eax, ds
    95         push eax
    96         mov  eax, es
    97         push eax
    98         mov  eax, fs
    99         push eax
    100         mov  eax, gs
    101         push eax
    102         mov  eax, ss
    103         push eax
    104         call OS2RTLUNWIND
    105 
    106         ret 16      ;__stdcall
     139
    107140_RtlUnwind@16 endp
    108141
     
    118151OS2ExceptionHandler endp
    119152
    120         PUBLIC QueryExceptionChain
    121 
    122 QueryExceptionChain proc near
     153        PUBLIC _QueryExceptionChain
     154
     155_QueryExceptionChain proc near
    123156        mov  eax, fs:[0]
    124157        ret
    125 QueryExceptionChain endp
     158_QueryExceptionChain endp
    126159
    127160        PUBLIC GetExceptionRecord
     
    279312_CallEntryPoint endp
    280313
    281 
    282 ; 281 static DWORD EXC_CallHandler( WINEXCEPTION_RECORD *record, WINEXCEPTION_FRAME *frame,
     314ifndef __EMX__
     315
    283316        EXTRN WriteLog:PROC
    284317        EXTRN _GetThreadTEB@0:PROC
    285318IFDEF DEBUG
    286         EXTRN DbgEnabledKERNEL32:DWORD
     319        EXTRN _DbgEnabledKERNEL32:DWORD
    287320ENDIF
    288321
    289 EXC_push_frame__FP19_WINEXCEPTION_FRAME proc
     322; 129 static inline WINEXCEPTION_FRAME * EXC_push_frame( WINEXCEPTION_FRAME *frame )
     323        align 04h
     324
     325EXC_push_frame  proc
    290326        push    ebp
    291327        mov     ebp,esp
     
    313349        leave   
    314350        ret     
    315 EXC_push_frame__FP19_WINEXCEPTION_FRAME endp
     351EXC_push_frame  endp
    316352
    317353; 138 static inline WINEXCEPTION_FRAME * EXC_pop_frame( WINEXCEPTION_FRAME *frame )
    318354        align 04h
    319355
    320 EXC_pop_frame__FP19_WINEXCEPTION_FRAME  proc
     356EXC_pop_frame   proc
    321357        push    ebp
    322358        mov     ebp,esp
     
    339375        leave   
    340376        ret     
    341 EXC_pop_frame__FP19_WINEXCEPTION_FRAME  endp
    342 
     377EXC_pop_frame   endp
     378
     379; 281 static extern "C" DWORD EXC_CallHandler( WINEXCEPTION_RECORD *record, WINEXCEPTION_FRAME *frame,
    343380        align 04h
    344         PUBLIC EXC_CallHandler__FP20_WINEXCEPTION_RECORDP19_WINEXCEPTION_FRAMEP10WINCONTEXTPP19_WINEXCEPTION_FRAMEPFP20_WINEXCEPTION_RECORDP19_WINEXCEPTION_FRAMEP10WINCONTEXTPv_UlT5
    345 
    346 EXC_CallHandler__FP20_WINEXCEPTION_RECORDP19_WINEXCEPTION_FRAMEP10WINCONTEXTPP19_WINEXCEPTION_FRAMEPFP20_WINEXCEPTION_RECORDP19_WINEXCEPTION_FRAMEP10WINCONTEXTPv_UlT5  proc
     381        PUBLIC _EXC_CallHandler
     382
     383_EXC_CallHandler        proc
    347384        push    ebp
    348385        mov     ebp,esp
     
    363400; 298     EXC_push_frame( &newframe.frame );
    364401        lea     eax,[ebp-0ch];  newframe
    365         call    EXC_push_frame__FP19_WINEXCEPTION_FRAME
     402        call    EXC_push_frame
    366403
    367404; 299     dprintf(("KERNEL32: Calling handler at %p code=%lx flags=%lx\n",
    368405IFDEF DEBUG
    369         cmp     word ptr  DbgEnabledKERNEL32+020h,01h
     406        cmp     word ptr  _DbgEnabledKERNEL32+020h,01h
    370407        jne     @BLBL20
    371408        mov     eax,[ebp+08h];  record
     
    392429IFDEF DEBUG
    393430; 302     dprintf(("KERNEL32: Handler returned %lx\n", ret));
    394         cmp     word ptr  DbgEnabledKERNEL32+020h,01h
     431        cmp     word ptr  _DbgEnabledKERNEL32+020h,01h
    395432        jne     @BLBL21
    396433        push    dword ptr [ebp-010h];   ret
     
    403440; 303     EXC_pop_frame( &newframe.frame );
    404441        lea     eax,[ebp-0ch];  newframe
    405         call    EXC_pop_frame__FP19_WINEXCEPTION_FRAME
     442        call    EXC_pop_frame
    406443
    407444; 304     return ret;
     
    410447        leave   
    411448        ret     
    412 EXC_CallHandler__FP20_WINEXCEPTION_RECORDP19_WINEXCEPTION_FRAMEP10WINCONTEXTPP19_WINEXCEPTION_FRAMEPFP20_WINEXCEPTION_RECORDP19_WINEXCEPTION_FRAMEP10WINCONTEXTPv_UlT5  endp
     449_EXC_CallHandler        endp
     450
     451endif ; ifndef __EMX__
    413452
    414453CODE32          ENDS
Note: See TracChangeset for help on using the changeset viewer.