]> git.saurik.com Git - apple/libc.git/blob - sys.subproj/ppc.subproj/_setjmp.s
Libc-167.tar.gz
[apple/libc.git] / sys.subproj / ppc.subproj / _setjmp.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 /* int _setjmp(jmp_buf env); */
24 /*
25 * Copyright (c) 1998 Apple Computer, Inc. All rights reserved.
26 *
27 * File: sys/ppc/_setjmp.s
28 *
29 * Implements _setjmp()
30 *
31 * History:
32 * 8 September 1998 Matt Watson (mwatson@apple.com)
33 * Created. Derived from setjmp.s
34 */
35
36 #include "SYS.h"
37 #include <architecture/ppc/asm_help.h>
38 #include "_setjmp.h"
39
40 LEAF(__setjmp)
41 stw r31, JMP_r31(r3)
42 /* r1, r2, r13-r30 */
43 stw r1, JMP_r1(r3)
44 stw r2, JMP_r2(r3)
45 stw r13, JMP_r13(r3)
46 stw r14, JMP_r14(r3)
47 stw r15, JMP_r15(r3)
48 stw r16, JMP_r16(r3)
49 stw r17, JMP_r17(r3)
50 stw r18, JMP_r18(r3)
51 stw r19, JMP_r19(r3)
52 stw r20, JMP_r20(r3)
53 stw r21, JMP_r21(r3)
54 stw r22, JMP_r22(r3)
55 mfcr r0
56 stw r23, JMP_r23(r3)
57 stw r24, JMP_r24(r3)
58 mflr r5
59 stw r25, JMP_r25(r3)
60 stw r26, JMP_r26(r3)
61 mfctr r6 ; XXX ctr is volatile
62 stw r27, JMP_r27(r3)
63 stw r28, JMP_r28(r3)
64 mfxer r7 ; XXX xer is volatile
65 stw r29, JMP_r29(r3)
66 stw r30, JMP_r30(r3)
67 stw r0, JMP_cr(r3)
68 stw r5, JMP_lr(r3)
69 stw r6, JMP_ctr(r3)
70 stw r7, JMP_xer(r3)
71 li r3, 0
72 blr
73