2 Copyright Oliver Kowalke 2009.
3 Copyright Thomas Sailer 2013.
4 Distributed under the Boost Software License, Version 1.0.
5 (See accompanying file LICENSE_1_0.txt or copy at
6 http://www.boost.org/LICENSE_1_0.txt)
9 /*************************************************************************************
10 * --------------------------------------------------------------------------------- *
11 * | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | *
12 * --------------------------------------------------------------------------------- *
13 * | 0h | 04h | 08h | 0ch | 010h | 014h | 018h | 01ch | *
14 * --------------------------------------------------------------------------------- *
15 * | fc_mxcsr|fc_x87_cw| fc_strg |fc_deallo| limit | base | fc_seh | EDI | *
16 * --------------------------------------------------------------------------------- *
17 * --------------------------------------------------------------------------------- *
18 * | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | *
19 * --------------------------------------------------------------------------------- *
20 * | 020h | 024h | 028h | 02ch | 030h | 034h | 038h | 03ch | *
21 * --------------------------------------------------------------------------------- *
22 * | ESI | EBX | EBP | EIP | to | data | EH NXT |SEH HNDLR| *
23 * --------------------------------------------------------------------------------- *
24 **************************************************************************************/
26 .file "jump_i386_ms_pe_gas.asm"
30 .def _jump_fcontext; .scl 2; .type 32; .endef
33 leal -0x2c(%esp), %esp
35 #if !defined(BOOST_USE_TSX)
36 /* save MMX control- and status-word */
38 /* save x87 control-word */
44 /* load fiber local storage */
47 /* load current dealloction stack */
48 movl 0xe0c(%edx), %eax
50 /* load current stack limit */
53 /* load current stack base */
56 /* load current SEH exception list */
60 movl %edi, 0x1c(%esp) /* save EDI */
61 movl %esi, 0x20(%esp) /* save ESI */
62 movl %ebx, 0x24(%esp) /* save EBX */
63 movl %ebp, 0x28(%esp) /* save EBP */
65 /* store ESP (pointing to context-data) in EAX */
68 /* firstarg of jump_fcontext() == fcontext to jump to */
71 /* restore ESP (pointing to context-data) from ECX */
74 #if !defined(BOOST_USE_TSX)
75 /* restore MMX control- and status-word */
77 /* restore x87 control-word */
81 /* restore NT_TIB into EDX */
83 /* restore fiber local storage */
86 /* restore current deallocation stack */
88 movl %ecx, 0xe0c(%edx)
89 /* restore current stack limit */
92 /* restore current stack base */
95 /* restore current SEH exception list */
99 movl 0x2c(%esp), %ecx /* restore EIP */
101 movl 0x1c(%esp), %edi /* restore EDI */
102 movl 0x20(%esp), %esi /* restore ESI */
103 movl 0x24(%esp), %ebx /* restore EBX */
104 movl 0x28(%esp), %ebp /* restore EBP */
107 leal 0x30(%esp), %esp
109 /* return transfer_t */
110 /* FCTX == EAX, DATA == EDX */
111 movl 0x34(%eax), %edx
113 /* jump to context */
117 .ascii " -export:\"jump_fcontext\""