]> git.saurik.com Git - apple/xnu.git/blob - bsd/sys/ucontext.h
xnu-792.25.20.tar.gz
[apple/xnu.git] / bsd / sys / ucontext.h
1 /*
2 * Copyright (c) 2002-2005 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 #ifndef _SYS_UCONTEXT_H_
24 #define _SYS_UCONTEXT_H_
25
26 #include <sys/cdefs.h>
27 #include <sys/_types.h>
28 #include <machine/ucontext.h>
29
30 #ifndef _SIGSET_T
31 #define _SIGSET_T
32 typedef __darwin_sigset_t sigset_t;
33 #endif
34
35 #ifndef _STACK_T
36 #define _STACK_T
37 typedef __darwin_stack_t stack_t;
38 #endif
39
40 #ifndef _UCONTEXT_T
41 #define _UCONTEXT_T
42 #ifndef _POSIX_C_SOURCE
43 typedef struct ucontext ucontext_t;
44 #else /* _POSIX_C_SOURCE */
45 typedef struct __darwin_ucontext ucontext_t;
46 #endif /* _POSIX_C_SOURCE */
47 #endif
48
49 #ifndef _POSIX_C_SOURCE
50 #ifndef _UCONTEXT64_T
51 #define _UCONTEXT64_T
52 typedef struct ucontext64 ucontext64_t;
53 #endif
54 #endif /* _POSIX_C_SOURCE */
55
56 #ifdef KERNEL
57 #include <machine/types.h> /* user_addr_t, user_size_t */
58
59 /* kernel representation of struct ucontext64 for 64 bit processes */
60 struct user_ucontext64 {
61 int uc_onstack;
62 sigset_t uc_sigmask; /* signal mask */
63 struct user_sigaltstack uc_stack; /* stack */
64 user_addr_t uc_link; /* ucontext pointer */
65 user_size_t uc_mcsize; /* mcontext size */
66 user_addr_t uc_mcontext64; /* machine context */
67 };
68
69 typedef struct user_ucontext64 user_ucontext64_t;
70 #endif /* KERNEL */
71
72 #endif /* _SYS_UCONTEXT_H_ */