Linux-2.6.12-rc2
[linux-2.6] / arch / ppc64 / xmon / setjmp.S
1 /*
2  * Copyright (C) 1996 Paul Mackerras.
3  *
4  *      This program is free software; you can redistribute it and/or
5  *      modify it under the terms of the GNU General Public License
6  *      as published by the Free Software Foundation; either version
7  *      2 of the License, or (at your option) any later version.
8  *
9  * NOTE: assert(sizeof(buf) > 184)
10  */
11 #include <asm/processor.h>
12 #include <asm/ppc_asm.h>
13
14 _GLOBAL(xmon_setjmp)
15         mflr    r0
16         std     r0,0(r3)
17         std     r1,8(r3)
18         std     r2,16(r3)
19         mfcr    r0
20         std     r0,24(r3)
21         std     r13,32(r3)
22         std     r14,40(r3)
23         std     r15,48(r3)
24         std     r16,56(r3)
25         std     r17,64(r3)
26         std     r18,72(r3)
27         std     r19,80(r3)
28         std     r20,88(r3)
29         std     r21,96(r3)
30         std     r22,104(r3)
31         std     r23,112(r3)
32         std     r24,120(r3)
33         std     r25,128(r3)
34         std     r26,136(r3)
35         std     r27,144(r3)
36         std     r28,152(r3)
37         std     r29,160(r3)
38         std     r30,168(r3)
39         std     r31,176(r3)
40         li      r3,0
41         blr
42
43 _GLOBAL(xmon_longjmp)
44         cmpdi   r4,0
45         bne     1f
46         li      r4,1
47 1:      ld      r13,32(r3)
48         ld      r14,40(r3)
49         ld      r15,48(r3)
50         ld      r16,56(r3)
51         ld      r17,64(r3)
52         ld      r18,72(r3)
53         ld      r19,80(r3)
54         ld      r20,88(r3)
55         ld      r21,96(r3)
56         ld      r22,104(r3)
57         ld      r23,112(r3)
58         ld      r24,120(r3)
59         ld      r25,128(r3)
60         ld      r26,136(r3)
61         ld      r27,144(r3)
62         ld      r28,152(r3)
63         ld      r29,160(r3)
64         ld      r30,168(r3)
65         ld      r31,176(r3)
66         ld      r0,24(r3)
67         mtcrf   56,r0
68         ld      r0,0(r3)
69         ld      r1,8(r3)
70         ld      r2,16(r3)
71         mtlr    r0
72         mr      r3,r4
73         blr