]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/context/src/asm/jump_i386_sysv_macho_gas.S
253b25b218541cf66bd7a2d3cafe009b0412faca
[ceph.git] / ceph / src / boost / libs / context / src / asm / jump_i386_sysv_macho_gas.S
1 /*
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)
6 */
7
8 /*****************************************************************************************
9 * *
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 * ----------------------------------------------------------------------------------- *
17 * *
18 *****************************************************************************************/
19
20 .text
21 .globl _jump_fcontext
22 .align 2
23 _jump_fcontext:
24 pushl %ebp /* save EBP */
25 pushl %ebx /* save EBX */
26 pushl %esi /* save ESI */
27 pushl %edi /* save EDI */
28
29 /* store fcontext_t in ECX */
30 movl %esp, %ecx
31
32 /* first arg of jump_fcontext() == context jumping to */
33 movl 0x18(%esp), %eax
34
35 /* second arg of jump_fcontext() == data to be transferred */
36 movl 0x1c(%esp), %edx
37
38 /* restore ESP (pointing to context-data) from EAX */
39 movl %eax, %esp
40
41 /* address of returned transport_t */
42 movl 0x14(%esp), %eax
43 /* return parent fcontext_t */
44 movl %ecx, (%eax)
45 /* return data */
46 movl %edx, 0x4(%eax)
47
48 popl %edi /* restore EDI */
49 popl %esi /* restore ESI */
50 popl %ebx /* restore EBX */
51 popl %ebp /* restore EBP */
52
53 /* jump to context */
54 ret $4