]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/context/src/asm/ontop_mips64_n64_elf_gas.S
import new upstream nautilus stable release 14.2.8
[ceph.git] / ceph / src / boost / libs / context / src / asm / ontop_mips64_n64_elf_gas.S
1 /*
2 Copyright Jiaxun Yang 2018.
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
6 */
7
8 /*******************************************************
9 * *
10 * ------------------------------------------------- *
11 * | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | *
12 * ------------------------------------------------- *
13 * | 0 | 8 | 16 | 24 | *
14 * ------------------------------------------------- *
15 * | F24 | F25 | F26 | F27 | *
16 * ------------------------------------------------- *
17 * ------------------------------------------------- *
18 * | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | *
19 * ------------------------------------------------- *
20 * | 32 | 40 | 48 | 56 | *
21 * ------------------------------------------------- *
22 * | F28 | F29 | F30 | F31 | *
23 * ------------------------------------------------- *
24 * ------------------------------------------------- *
25 * | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | *
26 * ------------------------------------------------- *
27 * | 64 | 72 | 80 | 88 | *
28 * ------------------------------------------------- *
29 * | S0 | S1 | S2 | S3 | *
30 * ------------------------------------------------- *
31 * ------------------------------------------------- *
32 * | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | *
33 * ------------------------------------------------- *
34 * | 96 | 100 | 104 | 108 | 112 | 116 | 120 | 124 | *
35 * ------------------------------------------------- *
36 * | S4 | S5 | S6 | S7 | *
37 * ------------------------------------------------- *
38 * ------------------------------------------------- *
39 * | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | *
40 * ------------------------------------------------- *
41 * | 128 | 132 | 136 | 140 | 144 | 148 | 152 | 156 | *
42 * ------------------------------------------------- *
43 * | FP | GP | RA | PC | *
44 * ------------------------------------------------- *
45 * *
46 * *****************************************************/
47
48 .file "ontop_mips64_n64_elf_gas.S"
49 .text
50 .globl ontop_fcontext
51 .align 2
52 .type ontop_fcontext,@function
53 .ent ontop_fcontext
54 ontop_fcontext:
55 # reserve space on stack
56 daddiu $sp, $sp, -160
57
58 sd $s0, 64($sp) # save S0
59 sd $s1, 72($sp) # save S1
60 sd $s2, 80($sp) # save S2
61 sd $s3, 88($sp) # save S3
62 sd $s4, 96($sp) # save S4
63 sd $s5, 104($sp) # save S5
64 sd $s6, 112($sp) # save S6
65 sd $s7, 120($sp) # save S7
66 sd $fp, 128($sp) # save FP
67 sd $ra, 144($sp) # save RA
68 sd $ra, 152($sp) # save RA as PC
69
70
71 s.d $f24, 0($sp) # save F24
72 s.d $f25, 8($sp) # save F25
73 s.d $f26, 16($sp) # save F26
74 s.d $f27, 24($sp) # save F27
75 s.d $f28, 32($sp) # save F28
76 s.d $f29, 40($sp) # save F29
77 s.d $f30, 48($sp) # save F30
78 s.d $f31, 56($sp) # save F31
79
80 # store SP (pointing to context-data) in t0
81 move $t0, $sp
82
83 # restore SP (pointing to context-data) from a0
84 move $sp, $a0
85
86 l.d $f24, 0($sp) # restore F24
87 l.d $f25, 8($sp) # restore F25
88 l.d $f26, 16($sp) # restore F26
89 l.d $f27, 24($sp) # restore F27
90 l.d $f28, 32($sp) # restore F28
91 l.d $f29, 40($sp) # restore F29
92 l.d $f30, 48($sp) # restore F30
93 l.d $f31, 56($sp) # restore F31
94
95 ld $s0, 64($sp) # restore S0
96 ld $s1, 72($sp) # restore S1
97 ld $s2, 80($sp) # restore S2
98 ld $s3, 88($sp) # restore S3
99 ld $s4, 96($sp) # restore S4
100 ld $s5, 104($sp) # restore S5
101 ld $s6, 112($sp) # restore S6
102 ld $s7, 120($sp) # restore S7
103 ld $fp, 128($sp) # restore FP
104 ld $ra, 144($sp) # restore RA
105
106 # load PC
107 move $t9, $a2
108
109 # adjust stack
110 daddiu $sp, $sp, 160
111
112 move $a0, $t0 # move param from t0 to a0 as param
113
114 # jump to context
115 jr $t9
116 .end ontop_fcontext
117 .size ontop_fcontext, .-ontop_fcontext
118
119 /* Mark that we don't need executable stack. */
120 .section .note.GNU-stack,"",%progbits