]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/context/src/asm/make_ppc32_sysv_xcoff_gas.S
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / boost / libs / context / src / asm / make_ppc32_sysv_xcoff_gas.S
1 .globl make_fcontext[DS]
2 .globl .make_fcontext[PR]
3 .align 2
4 .csect make_fcontext[DS]
5 make_fcontext:
6 .long .make_fcontext[PR]
7 .csect .make_fcontext[PR], 3
8 #.make_fcontext:
9 # save return address into R6
10 mflr 6
11
12 # first arg of make_fcontext() == top address of context-function
13 # shift address in R3 to lower 16 byte boundary
14 clrrwi 3, 3, 4
15
16 # reserve space for context-data on context-stack
17 # including 64 byte of linkage + parameter area (R1 % 16 == 0)
18 subi 3, 3, 172
19
20 # third arg of make_fcontext() == address of context-function
21 stw 5, 88(3)
22
23 # set back-chain to zero
24 li 0, 0
25 stw 0, 92(3)
26
27 # compute address of returned transfer_t
28 addi 0, 3, 100
29 mr 4, 0
30 stw 4, 76(3)
31
32 # load LR
33 mflr 0
34 # jump to label 1
35 bl .Label
36 .Label:
37 # load LR into R4
38 mflr 4
39 # compute abs address of label .L_finish
40 addi 4, 4, .L_finish - .Label
41 # restore LR
42 mtlr 0
43 # save address of finish as return-address for context-function
44 # will be entered after context-function returns
45 stw 4, 84(3)
46
47 # restore return address from R6
48 mtlr 6
49
50 blr # return pointer to context-data
51
52 .L_finish:
53 # save return address into R0
54 mflr 0
55 # save return address on stack, set up stack frame
56 stw 0, 4(1)
57 # allocate stack space, R1 % 16 == 0
58 stwu 1, -16(1)
59
60 # exit code is zero
61 li 3, 0
62 # exit application
63 bl ._exit
64 nop