]>
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/longjmp.s | |
26 | * | |
27 | * Implements siglongjmp(), longjmp(), _longjmp() | |
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 | * longjmp routines | |
42 | */ | |
43 | ||
44 | /* void siglongjmp(sigjmp_buf env, int val); */ | |
45 | ||
46 | LEAF(_siglongjmp) | |
47 | lwz r0, JMP_SIGFLAG(r3) ; load sigflag saved by siglongjmp() | |
48 | cmpwi cr1,r0,0 ; this changes cr1[EQ] which is volatile | |
49 | beq- cr1, L__longjmp ; if r0 == 0 do _longjmp() | |
50 | ; else *** fall through *** to longjmp() | |
51 | ||
52 | /* void longjmp(jmp_buf env, int val); */ | |
53 | ||
54 | LEAF(_longjmp) | |
55 | L_longjmp: | |
56 | mr r30, r3 | |
57 | mr r31, r4 | |
58 | lwz r3, JMP_sig(r3) ; restore the signal mask | |
59 | CALL_EXTERN(_sigsetmask) | |
60 | mr r4, r31 | |
61 | mr r3, r30 | |
62 | L__longjmp: | |
63 | BRANCH_EXTERN(__longjmp) |