]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/context/src/asm/make_mips32_o32_elf_gas.S
update sources to v12.2.3
[ceph.git] / ceph / src / boost / libs / context / src / asm / make_mips32_o32_elf_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 * | 0 | 4 | 8 | 12 | 16 | 20 | 24 | 28 | *
14 * ------------------------------------------------- *
15 * | S0 | S1 | S2 | S3 | S4 | S5 | S6 | S7 | *
16 * ------------------------------------------------- *
17 * ------------------------------------------------- *
18 * | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | *
19 * ------------------------------------------------- *
20 * | 32 | 36 | 40 | 44 | 48 | 52 | 56 | 60 | *
21 * ------------------------------------------------- *
22 * | FP |hiddn| RA | PC | GP | FCTX| DATA| | *
23 * ------------------------------------------------- *
24 * *
25 * *****************************************************/
26 /*******************************************************
27 * *
28 * ------------------------------------------------- *
29 * | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | *
30 * ------------------------------------------------- *
31 * | 0 | 4 | 8 | 12 | 16 | 20 | 24 | 28 | *
32 * ------------------------------------------------- *
33 * | F20 | F22 | F24 | F26 | *
34 * ------------------------------------------------- *
35 * ------------------------------------------------- *
36 * | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | *
37 * ------------------------------------------------- *
38 * | 32 | 36 | 40 | 44 | 48 | 52 | 56 | 60 | *
39 * ------------------------------------------------- *
40 * | F28 | F30 | S0 | S1 | S2 | S3 | *
41 * ------------------------------------------------- *
42 * ------------------------------------------------- *
43 * | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | *
44 * ------------------------------------------------- *
45 * | 64 | 68 | 72 | 76 | 80 | 84 | 88 | 92 | *
46 * ------------------------------------------------- *
47 * | S4 | S5 | S6 | S7 | FP |hiddn| RA | PC | *
48 * ------------------------------------------------- *
49 * ------------------------------------------------- *
50 * | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | *
51 * ------------------------------------------------- *
52 * | 96 | 100 | 104 | 108 | 112 | 116 | 120 | 124 | *
53 * ------------------------------------------------- *
54 * | GP | FCTX| DATA| | | | | | *
55 * ------------------------------------------------- *
56 * *
57 * *****************************************************/
58
59 .text
60 .globl make_fcontext
61 .align 2
62 .type make_fcontext,@function
63 .ent make_fcontext
64 make_fcontext:
65 #ifdef __PIC__
66 .set noreorder
67 .cpload $t9
68 .set reorder
69 #endif
70 # first arg of make_fcontext() == top address of context-stack
71 move $v0, $a0
72
73 # shift address in A0 to lower 16 byte boundary
74 move $v1, $v0
75 li $v0, -16 # 0xfffffffffffffff0
76 and $v0, $v1, $v0
77
78 # reserve space for context-data on context-stack
79 # including 48 byte of shadow space (sp % 16 == 0)
80 addiu $v0, $v0, -112
81
82 # third arg of make_fcontext() == address of context-function
83 sw $a2, 92($v0)
84 # save global pointer in context-data
85 sw $gp, 96($v0)
86
87 # compute address of returned transfer_t
88 addiu $t0, $v0, 52
89 sw $t0, 84($v0)
90
91 # compute abs address of label finish
92 la $t9, finish
93 # save address of finish as return-address for context-function
94 # will be entered after context-function returns
95 sw $t9, 88($v0)
96
97 jr $ra # return pointer to context-data
98
99 finish:
100 lw $gp, 0($sp)
101 # allocate stack space (contains shadow space for subroutines)
102 addiu $sp, $sp, -32
103 # save return address
104 sw $ra, 28($sp)
105
106 # restore GP (global pointer)
107 # move $gp, $s1
108 # exit code is zero
109 move $a0, $zero
110 # address of exit
111 lw $t9, %call16(_exit)($gp)
112 # exit application
113 jalr $t9
114 .end make_fcontext
115 .size make_fcontext, .-make_fcontext
116
117 /* Mark that we don't need executable stack. */
118 .section .note.GNU-stack,"",%progbits