Debian Codegraph @

rpython/translator/c/src/stacklet/switch_x86_msvc.h

raw symbols SCIP
1 /* The actual stack saving function, which just stores the stack,
2 * this declared in an .asm file
3 */
4 extern void *slp_switch_raw(void *(*save_state)(void*, void*),
5 void *(*restore_state)(void*, void*),
6 void *extra);
7
8 #undef STATIC_NOINLINE
9 #define STATIC_NOINLINE static __declspec(noinline)
10
11 #define WIN32_LEAN_AND_MEAN
12 #include <windows.h>
13
14 /* Store any other runtime information on the local stack */
15 #pragma optimize("", off) /* so that autos are stored on the stack */
16 #pragma warning(disable:4733) /* disable warning about modifying FS[0] */
17
18 static void *slp_switch(void *(*save_state)(void*, void*),
19 void *(*restore_state)(void*, void*),
20 void *extra)
21 {
22 /* store the structured exception state for this stack */
23 DWORD seh_state = __readfsdword(FIELD_OFFSET(NT_TIB, ExceptionList));
24 void * result = slp_switch_raw(save_state, restore_state, extra);
25 __writefsdword(FIELD_OFFSET(NT_TIB, ExceptionList), seh_state);
26 return result;
27 }
28 #pragma warning(default:4733) /* disable warning about modifying FS[0] */
29 #pragma optimize("", on)