Print this page
| Split |
Close |
| Expand all |
| Collapse all |
--- old/usr/src/uts/intel/sys/ucontext.h
+++ new/usr/src/uts/intel/sys/ucontext.h
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
12 12 *
|
↓ open down ↓ |
12 lines elided |
↑ open up ↑ |
13 13 * When distributing Covered Code, include this CDDL HEADER in each
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 15 * If applicable, add the following below this CDDL HEADER, with the
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
19 19 * CDDL HEADER END
20 20 */
21 21
22 22 /*
23 - * Copyright 2015 Joyent, Inc.
24 23 * Copyright 2015 Nexenta Systems, Inc. All rights reserved.
25 - *
24 + * Copyright 2015 Joyent, Inc.
26 25 * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
27 26 * Use is subject to license terms.
28 27 */
29 28
30 29 /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
31 30 /* All Rights Reserved */
32 31
33 32 #ifndef _SYS_UCONTEXT_H
34 33 #define _SYS_UCONTEXT_H
35 34
36 35 #include <sys/feature_tests.h>
37 36
38 37 #include <sys/types.h>
39 38 #include <sys/mcontext.h>
40 39 #if !defined(_XPG4_2) || defined(__EXTENSIONS__)
41 40 #include <sys/signal.h>
42 41 #endif
43 42
44 43 #ifdef __cplusplus
45 44 extern "C" {
46 45 #endif
47 46
48 47 /*
49 48 * Inclusion of <sys/signal.h> for sigset_t and stack_t definitions
50 49 * breaks XPG4v2 namespace. Therefore we must duplicate the defines
51 50 * for these types here when _XPG4_2 is defined.
52 51 */
53 52
54 53 #if defined(_XPG4_2) && !defined(__EXTENSIONS__)
55 54 #ifndef _SIGSET_T
56 55 #define _SIGSET_T
57 56 typedef struct { /* signal set type */
58 57 unsigned long __sigbits[4];
59 58 } sigset_t;
60 59 #endif /* _SIGSET_T */
61 60
62 61 #ifndef _STACK_T
63 62 #define _STACK_T
64 63 typedef struct {
65 64 void *ss_sp;
66 65 size_t ss_size;
67 66 int ss_flags;
68 67 } stack_t;
69 68 #endif /* _STACK_T */
70 69 #endif /* defined(_XPG4_2) && !defined(__EXTENSIONS__) */
71 70
72 71 #if !defined(_XPG4_2) || defined(__EXTENSIONS__)
73 72 typedef struct ucontext ucontext_t;
74 73 #else
75 74 typedef struct __ucontext ucontext_t;
76 75 #endif /* !defined(_XPG4_2) || defined(__EXTENSIONS__) */
77 76
78 77 #if !defined(_XPG4_2) || defined(__EXTENSIONS__)
79 78 struct ucontext {
80 79 #else
81 80 struct __ucontext {
82 81 #endif
83 82 unsigned long uc_flags;
84 83 ucontext_t *uc_link;
85 84 sigset_t uc_sigmask;
86 85 stack_t uc_stack;
87 86 mcontext_t uc_mcontext;
88 87 /*
89 88 * The Intel386 ABI specification includes a 5-element array of longs
90 89 * called "uc_filler", padding the size of the struct to 512 bytes. To
91 90 * allow zone brands to communicate extra data right the way through
92 91 * the signal handling process, from sigacthandler to setcontext, we
93 92 * steal the first three of these longs as a brand-private member.
94 93 */
95 94 void *uc_brand_data[3];
96 95 long uc_filler[2];
97 96 };
98 97 #if defined(_SYSCALL32)
99 98
100 99 /* Kernel view of user ILP32 ucontext structure */
101 100
102 101 typedef struct ucontext32 {
103 102 uint32_t uc_flags;
104 103 caddr32_t uc_link;
105 104 sigset_t uc_sigmask;
106 105 stack32_t uc_stack;
107 106 mcontext32_t uc_mcontext;
108 107 caddr32_t uc_brand_data[3];
109 108 int32_t uc_filler[2];
110 109 } ucontext32_t;
111 110
112 111 #if defined(_KERNEL)
113 112 extern void ucontext_nto32(const ucontext_t *src, ucontext32_t *dest);
114 113 extern void ucontext_32ton(const ucontext32_t *src, ucontext_t *dest);
115 114 #endif
116 115
117 116 #endif /* _SYSCALL32 */
118 117
119 118 #if !defined(_XPG4_2) || defined(__EXTENSIONS__)
120 119 #define GETCONTEXT 0
121 120 #define SETCONTEXT 1
122 121 #define GETUSTACK 2
123 122 #define SETUSTACK 3
124 123
125 124 /*
126 125 * values for uc_flags
127 126 * these are implementation dependent flags, that should be hidden
128 127 * from the user interface, defining which elements of ucontext
129 128 * are valid, and should be restored on call to setcontext
130 129 */
131 130
132 131 #define UC_SIGMASK 0x01
133 132 #define UC_STACK 0x02
134 133 #define UC_CPU 0x04
135 134 #define UC_MAU 0x08
136 135 #define UC_FPU UC_MAU
137 136
138 137 #define UC_MCONTEXT (UC_CPU|UC_FPU)
139 138
140 139 /*
141 140 * UC_ALL specifies the default context
142 141 */
143 142
144 143 #define UC_ALL (UC_SIGMASK|UC_STACK|UC_MCONTEXT)
145 144 #endif /* !defined(_XPG4_2) || defined(__EXTENSIONS__) */
146 145
147 146 #ifdef _KERNEL
148 147 void savecontext(ucontext_t *, const k_sigset_t *);
149 148 void restorecontext(ucontext_t *);
150 149
151 150 #ifdef _SYSCALL32
152 151 extern void savecontext32(ucontext32_t *, const k_sigset_t *);
153 152 #endif
154 153 #endif
155 154
156 155 #ifdef __cplusplus
157 156 }
158 157 #endif
159 158
160 159 #endif /* _SYS_UCONTEXT_H */
|
↓ open down ↓ |
125 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX