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 | hidden | *
16 * ---------------------------------------------------------------------------------- *
17 * ---------------------------------------------------------------------------------- *
18 * | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | *
19 * ---------------------------------------------------------------------------------- *
21 * ---------------------------------------------------------------------------------- *
23 * ---------------------------------------------------------------------------------- *
25 ****************************************************************************************/
30 .type jump_fcontext,@function
32 leal -0x18(%esp), %esp /* prepare stack */
34 #if !defined(BOOST_USE_TSX)
35 stmxcsr (%esp) /* save MMX control- and status-word */
36 fnstcw 0x4(%esp) /* save x87 control-word */
39 movl %edi, 0x8(%esp) /* save EDI */
40 movl %esi, 0xc(%esp) /* save ESI */
41 movl %ebx, 0x10(%esp) /* save EBX */
42 movl %ebp, 0x14(%esp) /* save EBP */
44 /* store ESP (pointing to context-data) in ECX */
47 /* first arg of jump_fcontext() == fcontext to jump to */
50 /* second arg of jump_fcontext() == data to be transferred */
53 /* restore ESP (pointing to context-data) from EAX */
56 /* address of returned transport_t */
58 /* return parent fcontext_t */
63 movl 0x18(%esp), %ecx /* restore EIP */
65 #if !defined(BOOST_USE_TSX)
66 ldmxcsr (%esp) /* restore MMX control- and status-word */
67 fldcw 0x4(%esp) /* restore x87 control-word */
70 movl 0x8(%esp), %edi /* restore EDI */
71 movl 0xc(%esp), %esi /* restore ESI */
72 movl 0x10(%esp), %ebx /* restore EBX */
73 movl 0x14(%esp), %ebp /* restore EBP */
75 leal 0x20(%esp), %esp /* prepare stack */
79 .size jump_fcontext,.-jump_fcontext
81 /* Mark that we don't need executable stack. */
82 .section .note.GNU-stack,"",%progbits