]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/context/src/asm/jump_arm_aapcs_macho_gas.S
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / boost / libs / context / src / asm / jump_arm_aapcs_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 * | sjlj|hiddn| v1 | v2 | v3 | v4 | v5 | v6 | *
16 * ------------------------------------------------- *
17 * ------------------------------------------------- *
18 * | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | *
19 * ------------------------------------------------- *
20 * | 0x20| 0x24| 0x28| 0x2c| 0x30| 0x34| 0x38| 0x3c| *
21 * ------------------------------------------------- *
22 * | v7 | v8 | lr | pc | FCTX| DATA| | *
23 * ------------------------------------------------- *
24 * *
25 *******************************************************/
26
27 .text
28 .globl _jump_fcontext
29 .align 2
30 _jump_fcontext:
31 @ save LR as PC
32 push {lr}
33 @ save hidden,V1-V8,LR
34 push {a1,v1-v8,lr}
35
36 @ locate TLS to save/restore SjLj handler
37 mrc p15, 0, v2, c13, c0, #3
38 bic v2, v2, #3
39
40 @ load TLS[__PTK_LIBC_DYLD_Unwind_SjLj_Key]
41 ldr v1, [v2, #8]
42 @ save SjLj handler
43 push {v1}
44
45 @ store RSP (pointing to context-data) in A1
46 mov a1, sp
47
48 @ restore RSP (pointing to context-data) from A2
49 mov sp, a2
50
51 @ r#estore SjLj handler
52 pop {v1}
53 @ store SjLj handler in TLS
54 str v1, [v2, #8]
55
56 @ restore hidden,V1-V8,LR
57 pop {a4,v1-v8,lr}
58
59 @ return transfer_t from jump
60 str a1, [a4, #0]
61 str a3, [a4, #4]
62 @ pass transfer_t as first arg in context function
63 @ A1 == FCTX, A2 == DATA
64 mov a2, a3
65
66 @ restore PC
67 pop {pc}