Changeset 21731 in vbox for trunk/src/VBox/Additions/WINNT/Graphics/Wine/include/wine/exception.h
- Timestamp:
- Jul 21, 2009 9:16:52 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Wine/include/wine/exception.h
r19678 r21731 223 223 } 224 224 225 static 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 225 237 /* Exception handling flags - from OS/2 2.0 exception handling */ 226 238 … … 248 260 NTSYSAPI void WINAPI RtlUnwind(PVOID,PVOID,PEXCEPTION_RECORD,PVOID); 249 261 262 static 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 250 269 /* wrapper for RtlUnwind since it clobbers registers on Windows */ 251 static inline void __wine_rtl_unwind( EXCEPTION_REGISTRATION_RECORD* frame, EXCEPTION_RECORD *record ) 270 static inline void DECLSPEC_NORETURN __wine_rtl_unwind( EXCEPTION_REGISTRATION_RECORD* frame, 271 EXCEPTION_RECORD *record, 272 void (*target)(void) ) 252 273 { 253 274 #if defined(__GNUC__) && defined(__i386__) 254 int dummy1, dummy2, dummy3 ;275 int dummy1, dummy2, dummy3, dummy4; 255 276 __asm__ __volatile__("pushl %%ebp\n\t" 256 277 "pushl %%ebx\n\t" 257 278 "pushl $0\n\t" 279 "pushl %3\n\t" 258 280 "pushl %2\n\t" 259 "pushl $0\n\t"260 281 "pushl %1\n\t" 261 282 "call *%0\n\t" 262 283 "popl %%ebx\n\t" 263 284 "popl %%ebp" 264 : "=a" (dummy1), "=S" (dummy2), "=D" (dummy3) 265 : "0" (RtlUnwind), "1" (frame), "2" ( record)266 : "e cx", "edx", "memory" );285 : "=a" (dummy1), "=S" (dummy2), "=D" (dummy3), "=c" (dummy4) 286 : "0" (RtlUnwind), "1" (frame), "2" (target), "3" (record) 287 : "edx", "memory" ); 267 288 #else 268 RtlUnwind( frame, 0, record, 0 ); 269 #endif 289 RtlUnwind( frame, target, record, 0 ); 290 #endif 291 for (;;) target(); 270 292 } 271 293 … … 279 301 wine_frame->ExceptionRecord = wine_frame; 280 302 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 ); 284 304 } 285 305
Note:
See TracChangeset
for help on using the changeset viewer.