]>
git.saurik.com Git - apple/xnu.git/blob - bsd/ppc/setjmp.h
2 * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
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.
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
20 * @APPLE_LICENSE_HEADER_END@
22 /* Copyright (c) 1998 Apple Computer, Inc. All rights reserved.
26 * Declaration of setjmp routines and data structures.
28 #ifndef _BSD_PPC_SETJMP_H_
29 #define _BSD_PPC_SETJMP_H_
31 #include <sys/cdefs.h>
32 #include <machine/signal.h>
35 struct sigcontext sigcontext
; /* kernel state preserved by set/longjmp */
36 unsigned long vmask
__attribute__((aligned(8))); /* vector mask register */
37 unsigned long vreg
[32 * 4] __attribute__((aligned(16)));
38 /* 32 128-bit vector registers */
42 * _JBLEN is number of ints required to save the following:
43 * r1, r2, r13-r31, lr, cr, ctr, xer, sig == 26 ints
44 * fr14 - fr31 = 18 doubles = 36 ints
45 * vmask, 32 vector registers = 129 ints
46 * 2 ints to get all the elements aligned
49 #define _JBLEN (26 + 36 + 129 + 1)
52 typedef struct sigcontext
jmp_buf[1];
53 typedef struct __sigjmp_buf
{
54 int __storage
[_JBLEN
+ 1] __attribute__((aligned(8)));
57 typedef int jmp_buf[_JBLEN
];
58 typedef int sigjmp_buf
[_JBLEN
+ 1];
62 extern int setjmp
__P((jmp_buf env
));
63 extern void longjmp
__P((jmp_buf env
, int val
));
66 int sigsetjmp
__P((sigjmp_buf env
, int val
));
67 void siglongjmp
__P((sigjmp_buf env
, int val
));
68 #endif /* _ANSI_SOURCE */
70 #if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE)
71 int _setjmp
__P((jmp_buf env
));
72 void _longjmp
__P((jmp_buf, int val
));
73 void longjmperror
__P((void));
74 #endif /* neither ANSI nor POSIX */
77 #endif /* !_BSD_PPC_SETJMP_H_ */