]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/context/src/asm/ontop_mips32_o32_elf_gas.S
update sources to v12.2.3
[ceph.git] / ceph / src / boost / libs / context / src / asm / ontop_mips32_o32_elf_gas.S
CommitLineData
7c673cae
FG
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 * | 0 | 4 | 8 | 12 | 16 | 20 | 24 | 28 | *
14 * ------------------------------------------------- *
b32b8144 15 * | F20 | F22 | F24 | F26 | *
7c673cae
FG
16 * ------------------------------------------------- *
17 * ------------------------------------------------- *
18 * | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | *
19 * ------------------------------------------------- *
20 * | 32 | 36 | 40 | 44 | 48 | 52 | 56 | 60 | *
21 * ------------------------------------------------- *
b32b8144
FG
22 * | F28 | F30 | S0 | S1 | S2 | S3 | *
23 * ------------------------------------------------- *
24 * ------------------------------------------------- *
25 * | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | *
26 * ------------------------------------------------- *
27 * | 64 | 68 | 72 | 76 | 80 | 84 | 88 | 92 | *
28 * ------------------------------------------------- *
29 * | S4 | S5 | S6 | S7 | FP |hiddn| RA | PC | *
30 * ------------------------------------------------- *
31 * ------------------------------------------------- *
32 * | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | *
33 * ------------------------------------------------- *
34 * | 96 | 100 | 104 | 108 | 112 | 116 | 120 | 124 | *
35 * ------------------------------------------------- *
36 * | GP | FCTX| DATA| | | | | | *
7c673cae
FG
37 * ------------------------------------------------- *
38 * *
39 * *****************************************************/
40
41.text
42.globl ontop_fcontext
43.align 2
44.type ontop_fcontext,@function
45.ent ontop_fcontext
46ontop_fcontext:
47 # reserve space on stack
b32b8144 48 addiu $sp, $sp, -96
7c673cae 49
b32b8144
FG
50 sw $s0, 48($sp) # save S0
51 sw $s1, 52($sp) # save S1
52 sw $s2, 56($sp) # save S2
53 sw $s3, 60($sp) # save S3
54 sw $s4, 64($sp) # save S4
55 sw $s5, 68($sp) # save S5
56 sw $s6, 72($sp) # save S6
57 sw $s7, 76($sp) # save S7
58 sw $fp, 80($sp) # save FP
59 sw $a0, 84($sp) # save hidden, address of returned transfer_t
60 sw $ra, 88($sp) # save RA
61 sw $ra, 92($sp) # save RA as PC
62
63#if defined(__mips_hard_float)
64 s.d $f20, ($sp) # save F20
65 s.d $f22, 8($sp) # save F22
66 s.d $f24, 16($sp) # save F24
67 s.d $f26, 24($sp) # save F26
68 s.d $f28, 32($sp) # save F28
69 s.d $f30, 40($sp) # save F30
70#endif
7c673cae
FG
71
72 # store SP (pointing to context-data) in A0
73 move $a0, $sp
74
75 # restore SP (pointing to context-data) from A1
76 move $sp, $a1
77
b32b8144
FG
78#if defined(__mips_hard_float)
79 l.d $f20, ($sp) # restore F20
80 l.d $f22, 8($sp) # restore F22
81 l.d $f24, 16($sp) # restore F24
82 l.d $f26, 24($sp) # restore F26
83 l.d $f28, 32($sp) # restore F28
84 l.d $f30, 40($sp) # restore F30
85#endif
86
87 lw $s0, 48($sp) # restore S0
88 lw $s1, 52($sp) # restore S1
89 lw $s2, 56($sp) # restore S2
90 lw $s3, 60($sp) # restore S3
91 lw $s4, 64($sp) # restore S4
92 lw $s5, 68($sp) # restore S5
93 lw $s6, 72($sp) # restore S6
94 lw $s7, 76($sp) # restore S7
95 lw $fp, 80($sp) # restore FP
96 lw $t0, 84($sp) # restore hidden, address of returned transfer_t
97 lw $ra, 88($sp) # restore RA
7c673cae
FG
98
99 # load PC
100 lw $t9, 44($sp)
101
102 # adjust stack
b32b8144 103 addiu $sp, $sp, 96
7c673cae
FG
104
105 # return transfer_t from jump
106 sw $a0, ($t0) # fctx of transfer_t
107 sw $a2, 4($t0) # data of transfer_t
108 # pass transfer_t as first arg in context function
109 # A0 == hidden, A1 == fctx, A2 == data
110 move $a1, $a0
111 move $a0, $t0
112
113 # jump to context
114 jr $a3
115.end ontop_fcontext
116.size ontop_fcontext, .-ontop_fcontext
117
118/* Mark that we don't need executable stack. */
119.section .note.GNU-stack,"",%progbits