VirtualBox

Ignore:
Timestamp:
Jul 21, 2009 9:16:52 AM (15 years ago)
Author:
vboxsync
Message:

crOpenGL: update to wine 1.1.26

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/Graphics/Wine/include/wine/exception.h

    r19678 r21731  
    223223}
    224224
     225static inline EXCEPTION_REGISTRATION_RECORD *__wine_get_frame(void)
     226{
     227#if defined(__GNUC__) && defined(__i386__)
     228    EXCEPTION_REGISTRATION_RECORD *ret;
     229    __asm__ __volatile__(".byte 0x64\n\tmovl (0),%0" : "=r" (ret) );
     230    return ret;
     231#else
     232    NT_TIB *teb = (NT_TIB *)NtCurrentTeb();
     233    return teb->ExceptionList;
     234#endif
     235}
     236
    225237/* Exception handling flags - from OS/2 2.0 exception handling */
    226238
     
    248260NTSYSAPI void WINAPI RtlUnwind(PVOID,PVOID,PEXCEPTION_RECORD,PVOID);
    249261
     262static inline void DECLSPEC_NORETURN __wine_unwind_target(void)
     263{
     264    __WINE_FRAME *wine_frame = (__WINE_FRAME *)__wine_get_frame();
     265    __wine_pop_frame( &wine_frame->frame );
     266    siglongjmp( wine_frame->jmp, 1 );
     267}
     268
    250269/* wrapper for RtlUnwind since it clobbers registers on Windows */
    251 static inline void __wine_rtl_unwind( EXCEPTION_REGISTRATION_RECORD* frame, EXCEPTION_RECORD *record )
     270static inline void DECLSPEC_NORETURN __wine_rtl_unwind( EXCEPTION_REGISTRATION_RECORD* frame,
     271                                                        EXCEPTION_RECORD *record,
     272                                                        void (*target)(void) )
    252273{
    253274#if defined(__GNUC__) && defined(__i386__)
    254     int dummy1, dummy2, dummy3;
     275    int dummy1, dummy2, dummy3, dummy4;
    255276    __asm__ __volatile__("pushl %%ebp\n\t"
    256277                         "pushl %%ebx\n\t"
    257278                         "pushl $0\n\t"
     279                         "pushl %3\n\t"
    258280                         "pushl %2\n\t"
    259                          "pushl $0\n\t"
    260281                         "pushl %1\n\t"
    261282                         "call *%0\n\t"
    262283                         "popl %%ebx\n\t"
    263284                         "popl %%ebp"
    264                          : "=a" (dummy1), "=S" (dummy2), "=D" (dummy3)
    265                          : "0" (RtlUnwind), "1" (frame), "2" (record)
    266                          : "ecx", "edx", "memory" );
     285                         : "=a" (dummy1), "=S" (dummy2), "=D" (dummy3), "=c" (dummy4)
     286                         : "0" (RtlUnwind), "1" (frame), "2" (target), "3" (record)
     287                         : "edx", "memory" );
    267288#else
    268     RtlUnwind( frame, 0, record, 0 );
    269 #endif
     289    RtlUnwind( frame, target, record, 0 );
     290#endif
     291    for (;;) target();
    270292}
    271293
     
    279301    wine_frame->ExceptionRecord = wine_frame;
    280302
    281     __wine_rtl_unwind( frame, record );
    282     __wine_pop_frame( frame );
    283     siglongjmp( wine_frame->jmp, 1 );
     303    __wine_rtl_unwind( frame, record, __wine_unwind_target );
    284304}
    285305
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette