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 * | EDI | ESI | EBX | EBP | EIP | hidden | to | data | *
16 * ----------------------------------------------------------------------------------- *
18 *****************************************************************************************/
24 pushl %ebp /* save EBP */
25 pushl %ebx /* save EBX */
26 pushl %esi /* save ESI */
27 pushl %edi /* save EDI */
29 /* store fcontext_t in ECX */
32 /* first arg of jump_fcontext() == context jumping to */
35 /* second arg of jump_fcontext() == data to be transferred */
38 /* restore ESP (pointing to context-data) from EAX */
41 /* address of returned transport_t */
43 /* return parent fcontext_t */
48 popl %edi /* restore EDI */
49 popl %esi /* restore ESI */
50 popl %ebx /* restore EBX */
51 popl %ebp /* restore EBP */