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 *****************************************************************************************/
23 .type jump_fcontext,@function
25 pushl %ebp /* save EBP */
26 pushl %ebx /* save EBX */
27 pushl %esi /* save ESI */
28 pushl %edi /* save EDI */
30 /* store fcontext_t in ECX */
33 /* first arg of jump_fcontext() == fcontext to jump to */
36 /* second arg of jump_fcontext() == data to be transferred */
39 /* restore ESP (pointing to context-data) from EAX */
42 /* address of returned transport_t */
44 /* return parent fcontext_t */
49 popl %edi /* restore EDI */
50 popl %esi /* restore ESI */
51 popl %ebx /* restore EBX */
52 popl %ebp /* restore EBP */
56 .size jump_fcontext,.-jump_fcontext
58 /* Mark that we don't need executable stack. */
59 .section .note.GNU-stack,"",%progbits