Add qemu 2.4.0
[kvmfornfv.git] / qemu / roms / SLOF / rtas / rtas_common.S
1 /******************************************************************************
2  * Copyright (c) 2004, 2008 IBM Corporation
3  * All rights reserved.
4  * This program and the accompanying materials
5  * are made available under the terms of the BSD License
6  * which accompanies this distribution, and is available at
7  * http://www.opensource.org/licenses/bsd-license.php
8  *
9  * Contributors:
10  *     IBM Corporation - initial implementation
11  *****************************************************************************/
12
13 .globl save_regs_r3_r12
14 .globl restore_regs_r3_r12
15 .globl save_regs_r13_r25
16 .globl restore_regs_r13_r25
17
18
19 save_regs_r3_r12:
20         stdu    r1,-0x80(r1)            # allocate space on stack
21
22         std     r3,0x30(r1)
23         std     r4,0x38(r1)
24         std     r5,0x40(r1)
25         std     r6,0x48(r1)
26         std     r7,0x50(r1)
27         std     r8,0x58(r1)
28         std     r9,0x60(r1)
29         std     r10,0x68(r1)
30         std     r11,0x70(r1)
31         std     r12,0x78(r1)
32
33         blr
34         
35 restore_regs_r3_r12:
36         ld      r3,0x30(r1)
37         ld      r4,0x38(r1)
38         ld      r5,0x40(r1)
39         ld      r6,0x48(r1)
40         ld      r7,0x50(r1)
41         ld      r8,0x58(r1)
42         ld      r9,0x60(r1)
43         ld      r10,0x68(r1)
44         ld      r11,0x70(r1)
45         ld      r12,0x78(r1)
46
47         addi    r1,r1,0x80              # cleanup stack
48
49         blr
50
51 save_regs_r13_r25:
52         stdu    r1,-0x98(r1)            # allocate space on stack
53
54         std     r13,0x30(r1)
55         std     r14,0x38(r1)
56         std     r15,0x40(r1)
57         std     r16,0x48(r1)
58         std     r17,0x50(r1)
59         std     r18,0x58(r1)
60         std     r19,0x60(r1)
61         std     r20,0x68(r1)
62         std     r21,0x70(r1)
63         std     r22,0x78(r1)
64         std     r23,0x80(r1)
65         std     r24,0x88(r1)
66         std     r25,0x90(r1)
67
68         blr
69
70 restore_regs_r13_r25:
71         ld      r13,0x30(r1)            # restore registers from stack
72         ld      r14,0x38(r1)
73         ld      r15,0x40(r1)
74         ld      r16,0x48(r1)
75         ld      r17,0x50(r1)
76         ld      r18,0x58(r1)
77         ld      r19,0x60(r1)
78         ld      r20,0x68(r1)
79         ld      r21,0x70(r1)
80         ld      r22,0x78(r1)
81         ld      r23,0x80(r1)
82         ld      r24,0x88(r1)
83         ld      r25,0x90(r1)
84
85         addi    r1,r1,0x98              # cleanup stack
86
87         blr