]>
Commit | Line | Data |
---|---|---|
e9ce8d39 A |
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 | * Copyright (c) 1998 Apple Computer, Inc. All rights reserved. | |
24 | * | |
25 | * File: sys/ppc/setjmp.s | |
26 | * | |
27 | * Implements sigsetjmp(), setjmp(), _setjmp() | |
28 | * | |
29 | * NOTE: Scatterloading this file will BREAK the functions. | |
30 | * | |
31 | * History: | |
32 | * 30-Aug-1998 Umesh Vaishampayan (umeshv@apple.com) | |
33 | * Created. Derived from _setjmp.s, setjmp.c and setjmp.s | |
34 | */ | |
35 | ||
36 | #include "SYS.h" | |
37 | #include <architecture/ppc/asm_help.h> | |
38 | #include "_setjmp.h" | |
39 | ||
40 | /* | |
41 | * setjmp routines | |
42 | */ | |
43 | ||
44 | /* int sigsetjmp(sigjmp_buf env, int savemask); */ | |
45 | ||
46 | LEAF(_sigsetjmp) | |
47 | cmpwi cr1,r4,0 ; this changes cr1[EQ] which is volatile | |
48 | stw r4, JMP_SIGFLAG(r3) ; save the sigflag for use by siglongjmp() | |
49 | beq- cr1, L__setjmp ; if r4 == 0 do _setjmp() | |
50 | ; else *** fall through *** to setjmp() | |
51 | ||
52 | /* int setjmp(jmp_buf env); */ | |
53 | ||
54 | LEAF(_setjmp) | |
55 | L_setjmp: | |
56 | mflr r0 | |
57 | stw r31, JMP_r31(r3) | |
58 | stw r0, JMP_lr(r3) | |
59 | mr r31, r3 | |
60 | li r3, 0 ; get the previous signal mask | |
61 | CALL_EXTERN(_sigblock) | |
62 | stw r3, JMP_sig(r31) ; save the previous mask | |
63 | mr r3, r31 | |
64 | lwz r0, JMP_lr(r3) | |
65 | mtlr r0 | |
66 | lwz r31, JMP_r31(r3) | |
67 | L__setjmp: | |
68 | BRANCH_EXTERN(__setjmp) |