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 /* first arg of make_fcontext() == top of context-stack */
34 /* reserve space for first argument of context-function
35 eax might already point to a 16byte border */
38 /* shift address in EAX to lower 16 byte boundary */
41 /* reserve space for context-data on context-stack */
42 leal -0x2c(%eax), %eax
44 /* third arg of make_fcontext() == address of context-function */
49 /* save MMX control- and status-word */
51 /* save x87 control-word */
54 /* compute abs address of label trampoline */
56 /* address of trampoline 1 */
58 /* compute abs address of label trampoline */
59 addl $trampoline-1b, %ecx
60 /* save address of trampoline as return address */
61 /* will be entered after calling jump_fcontext() first time */
64 /* compute abs address of label finish */
66 /* address of label 2 */
68 /* compute abs address of label finish */
70 /* save address of finish as return-address for context-function */
71 /* will be entered after context-function returns */
74 ret /* return pointer to context-data */
77 /* move transport_t for entering context-function */
81 /* jump to context-function */
85 /* exit code is zero */
88 /* exit application */