]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/context/src/asm/jump_mips32_o32_elf_gas.S
bump version to 12.2.2-pve1
[ceph.git] / ceph / src / boost / libs / context / src / asm / jump_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 * ------------------------------------------------- *
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.text
28.globl jump_fcontext
29.align 2
30.type jump_fcontext,@function
31.ent jump_fcontext
32jump_fcontext:
33 # reserve space on stack
34 addiu $sp, $sp, -112
35
36 sw $s0, ($sp) # save S0
37 sw $s1, 4($sp) # save S1
38 sw $s2, 8($sp) # save S2
39 sw $s3, 12($sp) # save S3
40 sw $s4, 16($sp) # save S4
41 sw $s5, 20($sp) # save S5
42 sw $s6, 24($sp) # save S6
43 sw $s7, 28($sp) # save S7
44 sw $fp, 32($sp) # save FP
45 sw $a0, 36($sp) # save hidden, address of returned transfer_t
46 sw $ra, 40($sp) # save RA
47 sw $ra, 44($sp) # save RA as PC
48
49 # store SP (pointing to context-data) in A0
50 move $a0, $sp
51
52 # restore SP (pointing to context-data) from A1
53 move $sp, $a1
54
55 lw $s0, ($sp) # restore S0
56 lw $s1, 4($sp) # restore S1
57 lw $s2, 8($sp) # restore S2
58 lw $s3, 12($sp) # restore S3
59 lw $s4, 16($sp) # restore S4
60 lw $s5, 20($sp) # restore S5
61 lw $s6, 24($sp) # restore S6
62 lw $s7, 28($sp) # restore S7
63 lw $fp, 32($sp) # restore FP
64 lw $t0, 36($sp) # restore hidden, address of returned transfer_t
65 lw $ra, 40($sp) # restore RA
66
67 # load PC
68 lw $t9, 44($sp)
69
70 # adjust stack
71 addiu $sp, $sp, 112
72
73 # return transfer_t from jump
74 sw $a0, ($t0) # fctx of transfer_t
75 sw $a1, 4($t0) # data of transfer_t
76 # pass transfer_t as first arg in context function
77 # A0 == fctx, A1 == data
78 move $a1, $a2
79
80 # jump to context
81 jr $t9
82.end jump_fcontext
83.size jump_fcontext, .-jump_fcontext
84
85/* Mark that we don't need executable stack. */
86.section .note.GNU-stack,"",%progbits