]> git.saurik.com Git - apple/libc.git/blob - sys.subproj/ppc.subproj/_longjmp.s
4591e54befcc5a4295f5d789703a6c136a2856f9
[apple/libc.git] / sys.subproj / ppc.subproj / _longjmp.s
1 /*
2 * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * The contents of this file constitute Original Code as defined in and
7 * are subject to the Apple Public Source License Version 1.1 (the
8 * "License"). You may not use this file except in compliance with the
9 * License. Please obtain a copy of the License at
10 * http://www.apple.com/publicsource and read it before using this file.
11 *
12 * This Original Code and all software distributed under the License are
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
18 * under the License.
19 *
20 * @APPLE_LICENSE_HEADER_END@
21 */
22
23 /* void _longjmp(jmp_buf env, int val); */
24
25 /* int _longjmp(jmp_buf env); */
26 /*
27 * Copyright (c) 1998 Apple Computer, Inc. All rights reserved.
28 *
29 * File: sys/ppc/_longjmp.s
30 *
31 * Implements _longjmp()
32 *
33 * History:
34 * 8 September 1998 Matt Watson (mwatson@apple.com)
35 * Created. Derived from longjmp.s
36 */
37 #include "SYS.h"
38 #include <architecture/ppc/asm_help.h>
39 #include "_setjmp.h"
40
41 LEAF(__longjmp)
42 lwz r31, JMP_r31(r3)
43 /* r1, r14-r30 */
44 lwz r1, JMP_r1 (r3)
45 lwz r2, JMP_r2 (r3)
46 lwz r13, JMP_r13(r3)
47 lwz r14, JMP_r14(r3)
48 lwz r15, JMP_r15(r3)
49 lwz r16, JMP_r16(r3)
50 lwz r17, JMP_r17(r3)
51 lwz r18, JMP_r18(r3)
52 lwz r19, JMP_r19(r3)
53 lwz r20, JMP_r20(r3)
54 lwz r21, JMP_r21(r3)
55 lwz r22, JMP_r22(r3)
56 lwz r23, JMP_r23(r3)
57 lwz r24, JMP_r24(r3)
58 lwz r25, JMP_r25(r3)
59 lwz r26, JMP_r26(r3)
60 lwz r27, JMP_r27(r3)
61 lwz r28, JMP_r28(r3)
62 lwz r29, JMP_r29(r3)
63 lwz r30, JMP_r30(r3)
64 lwz r0, JMP_cr(r3)
65 mtcrf 0xff,r0
66 lwz r0, JMP_lr(r3)
67 mtlr r0
68 lwz r0, JMP_ctr(r3) ; XXX ctr is volatile
69 mtctr r0
70 lwz r0, JMP_xer(r3) ; XXX xer is volatile
71 mtxer r0
72 mr. r3, r4
73 bnelr
74 li r3, 1
75 blr
76