]>
Commit | Line | Data |
---|---|---|
1c79356b | 1 | /* |
91447636 | 2 | * Copyright (c) 2002-2005 Apple Computer, Inc. All rights reserved. |
1c79356b A |
3 | * |
4 | * @APPLE_LICENSE_HEADER_START@ | |
5 | * | |
e5568f75 A |
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. | |
1c79356b | 11 | * |
e5568f75 A |
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 | |
1c79356b A |
14 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, |
15 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | |
e5568f75 A |
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. | |
1c79356b A |
19 | * |
20 | * @APPLE_LICENSE_HEADER_END@ | |
21 | */ | |
1c79356b | 22 | |
9bccf70c A |
23 | #ifndef _SYS_UCONTEXT_H_ |
24 | #define _SYS_UCONTEXT_H_ | |
1c79356b | 25 | |
91447636 A |
26 | #include <sys/cdefs.h> |
27 | #include <sys/_types.h> | |
9bccf70c | 28 | #include <machine/ucontext.h> |
1c79356b | 29 | |
91447636 A |
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 | |
1c79356b | 48 | |
91447636 A |
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 */ | |
55e303ae | 55 | |
91447636 A |
56 | #ifdef KERNEL |
57 | #include <machine/types.h> /* user_addr_t, user_size_t */ | |
1c79356b | 58 | |
91447636 A |
59 | #if __DARWIN_ALIGN_NATURAL |
60 | #pragma options align=natural | |
61 | #endif | |
62 | ||
63 | /* kernel representation of struct ucontext64 for 64 bit processes */ | |
64 | struct user_ucontext64 { | |
65 | int uc_onstack; | |
66 | sigset_t uc_sigmask; /* signal mask */ | |
67 | struct user_sigaltstack uc_stack; /* stack */ | |
68 | user_addr_t uc_link; /* ucontext pointer */ | |
69 | user_size_t uc_mcsize; /* mcontext size */ | |
70 | user_addr_t uc_mcontext64; /* machine context */ | |
55e303ae A |
71 | }; |
72 | ||
91447636 A |
73 | #if __DARWIN_ALIGN_NATURAL |
74 | #pragma options align=reset | |
75 | #endif | |
76 | ||
77 | typedef struct user_ucontext64 user_ucontext64_t; | |
78 | #endif /* KERNEL */ | |
55e303ae | 79 | |
9bccf70c | 80 | #endif /* _SYS_UCONTEXT_H_ */ |