]>
git.saurik.com Git - apple/libc.git/blob - ppc/sys/_setjmp.h
2 * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
21 * @APPLE_LICENSE_HEADER_END@
24 * Copyright (c) 1998, Apple Computer Inc. All rights reserved.
28 * Defines for register offsets in the save area.
32 /* NOTE: jmp_bufs are only 4-byte aligned. This means we
33 * need to pad before the VR and FPR save areas, so that they
34 * can be naturally aligned in the buffer. In case a jmp_buf
35 * is bcopy'd to a different alignment between the setjmp
36 * and longjmp, we need to save the jmp_buf address in the
37 * jmp_buf at setjmp time, so we can realign before reloading.
39 * ALSO NOTE: the typedef for jmpbufs in <ppc/setjmp.h> is
40 * 192 ints (0x300 bytes) long, due to incorrectly assuming
41 * that we need to save all 32 VRs in a jmpbuf. This is
42 * fortuitous, because when it came time to add additional
43 * fields and expand GPRs for 64-bit mode, there was plenty
47 /* 32-bit-mode layout */
74 #define JMP_SIGFLAG 0x5c
75 #define JMP_sig 0x60 /* reserve 8 bytes for sigmask */
76 #define JMP_fpscr 0x68 /* reserve 8 bytes for FPSCR too */
77 #define JMP_vrsave 0x70
78 #define JMP_addr_at_setjmp 0x74
79 /* 12 bytes padding here */
80 #define JMP_vr_base_addr 0x84
81 /* save room for 12 VRs (v20-v31), or 0xC0 bytes */
82 #define JMP_fp_base_addr 0x144
83 /* save room for 18 FPRs (f14-f31), or 0x90 bytes */
84 #define JMP_buf_end 0x1d4
87 /* 64-bit-mode layout */
89 #elif defined(__ppc64__)
115 #define JMP_SIGFLAG 0xc0
116 #define JMP_fpscr 0xc8
117 #define JMP_vrsave 0xd0
118 #define JMP_addr_at_setjmp 0xd8
119 /* 12 bytes padding here */
120 #define JMP_vr_base_addr 0x0ec
121 /* save room for 12 VRs (v20-v31), or 0xC0 bytes */
122 #define JMP_fp_base_addr 0x1ac
123 /* save room for 18 FPRs (f14-f31), or 0x90 bytes */
124 #define JMP_buf_end 0x23c
127 #error architecture not supported