2 Copyright Oliver Kowalke 2009.
3 Distributed under the Boost Software License, Version 1.0.
4 (See accompanying file LICENSE_1_0.txt or copy at
5 http://www.boost.org/LICENSE_1_0.txt)
8 /****************************************************************************************
10 * ---------------------------------------------------------------------------------- *
11 * | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | *
12 * ---------------------------------------------------------------------------------- *
13 * | 0x0 | 0x4 | 0x8 | 0xc | 0x10 | 0x14 | 0x18 | 0x1c | *
14 * ---------------------------------------------------------------------------------- *
15 * | fc_mxcsr|fc_x87_cw| EDI | ESI | EBX | EBP | EIP | to | *
16 * ---------------------------------------------------------------------------------- *
17 * ---------------------------------------------------------------------------------- *
18 * | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | *
19 * ---------------------------------------------------------------------------------- *
21 * ---------------------------------------------------------------------------------- *
23 * ---------------------------------------------------------------------------------- *
25 ****************************************************************************************/
31 leal -0x18(%esp), %esp /* prepare stack */
33 #if !defined(BOOST_USE_TSX)
34 stmxcsr (%esp) /* save MMX control- and status-word */
35 fnstcw 0x4(%esp) /* save x87 control-word */
38 movl %edi, 0x8(%esp) /* save EDI */
39 movl %esi, 0xc(%esp) /* save ESI */
40 movl %ebx, 0x10(%esp) /* save EBX */
41 movl %ebp, 0x14(%esp) /* save EBP */
43 /* store ESP (pointing to context-data) in ECX */
46 /* first arg of jump_fcontext() == fcontext to jump to */
49 /* second arg of jump_fcontext() == data to be transferred */
52 /* restore ESP (pointing to context-data) from EAX */
55 /* return parent fcontext_t */
57 /* returned data is stored in EDX */
60 movl 0x18(%esp), %ecx /* restore EIP */
62 #if !defined(BOOST_USE_TSX)
63 ldmxcsr (%esp) /* restore MMX control- and status-word */
64 fldcw 0x4(%esp) /* restore x87 control-word */
67 movl 0x8(%esp), %edi /* restore EDI */
68 movl 0xc(%esp), %esi /* restore ESI */
69 movl 0x10(%esp), %ebx /* restore EBX */
70 movl 0x14(%esp), %ebp /* restore EBP */
72 leal 0x1c(%esp), %esp /* prepare stack */