Print this page
| Split |
Close |
| Expand all |
| Collapse all |
--- old/usr/src/uts/common/brand/solaris10/s10_brand.h
+++ new/usr/src/uts/common/brand/solaris10/s10_brand.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 *
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 23 * Copyright (c) 2013, OmniTI Computer Consulting, Inc. All rights reserved.
24 24 * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
25 25 * Copyright (c) 2014, Joyent, Inc. All rights reserved.
26 26 */
27 27
28 28 #ifndef _S10_BRAND_H
29 29 #define _S10_BRAND_H
30 30
31 31 #ifdef __cplusplus
32 32 extern "C" {
33 33 #endif
34 34
35 35 #include <sys/brand.h>
36 36
37 37 #define S10_BRANDNAME "solaris10"
38 38
39 39 #define S10_VERSION_1 1
40 40 #define S10_VERSION S10_VERSION_1
41 41
42 42 #define S10_LIB_NAME "s10_brand.so.1"
43 43 #define S10_LINKER_NAME "ld.so.1"
44 44
45 45 #define S10_LIB32 BRAND_NATIVE_DIR "usr/lib/" S10_LIB_NAME
46 46 #define S10_LIB64 BRAND_NATIVE_DIR "usr/lib/64/" S10_LIB_NAME
47 47
48 48 #if defined(_LP64)
49 49 #define S10_LIB S10_LIB64
50 50 #else /* !_LP64 */
51 51 #define S10_LIB S10_LIB32
52 52 #endif /* !_LP64 */
53 53
54 54 /*
55 55 * Solaris 10 value of _SIGRTMIN, _SIGRTMAX, MAXSIG, NSIG
56 56 */
57 57 #define S10_SIGRTMIN 41
58 58 #define S10_SIGRTMAX 48
59 59 #define S10_MAXSIG 48
60 60 #define S10_NSIG 49
61 61
62 62 /*
63 63 * Brand system call subcodes. 0-127 are reserved for generic subcodes.
64 64 */
65 65 #define B_S10_PIDINFO 128
66 66 #define B_S10_NATIVE 130
67 67 #define B_S10_FSREGCORRECTION 131
68 68 #define B_S10_ISFDXATTRDIR 132
69 69
70 70 /*
71 71 * Versioning flags
72 72 *
73 73 * The first enum value must be zero. Place new enum values at the end of the
74 74 * list but before S10_NUM_EMUL_FEATURES, which must always come last.
75 75 * Enum values should start with "S10_FEATURE_" and be named after the
76 76 * fixes/backports that they represent. For example, an enum value representing
77 77 * a backport that changes a MNTFS ioctl could be named
78 78 * "S10_FEATURE_ALTERED_MNTFS_IOCTL".
79 79 */
80 80 enum s10_emulated_features {
81 81 S10_FEATURE_ALTERED_MNTFS_IOCTL,
82 82 S10_FEATURE_U9_ZFS_IOCTL, /* S10u9 ZFS ioctl changes */
83 83 S10_NUM_EMUL_FEATURES /* This must be the last entry! */
84 84 };
85 85
86 86 /*
87 87 * This string constant represents the path of the Solaris 10 directory
88 88 * containing emulation feature files.
89 89 */
90 90 #define S10_REQ_EMULATION_DIR "/usr/lib/brand/solaris10"
91 91
92 92 /*
93 93 * s10_brand_syscall_callback_common() needs to save 4 local registers so it
94 94 * can free them up for its own use.
95 95 */
96 96 #define S10_CPU_REG_SAVE_SIZE (sizeof (ulong_t) * 4)
97 97
98 98 /*
99 99 * S10 system call codes for S10 traps that have been removed or reassigned,
100 100 * or that are to be removed or reassigned after the dtrace syscall provider
101 101 * has been reengineered to deal properly with syscall::open (for example).
102 102 */
103 103 #define S10_SYS_forkall 2
104 104 #define S10_SYS_open 5
105 105 #define S10_SYS_wait 7
106 106 #define S10_SYS_creat 8
107 107 #define S10_SYS_link 9
108 108 #define S10_SYS_unlink 10
109 109 #define S10_SYS_exec 11
110 110 #define S10_SYS_mknod 14
111 111 #define S10_SYS_chmod 15
112 112 #define S10_SYS_chown 16
113 113 #define S10_SYS_stat 18
114 114 #define S10_SYS_umount 22
115 115 #define S10_SYS_fstat 28
116 116 #define S10_SYS_utime 30
117 117 #define S10_SYS_access 33
118 118 #define S10_SYS_dup 41
119 119 #define S10_SYS_pipe 42
120 120 #define S10_SYS_issetugid 75
121 121 #define S10_SYS_fsat 76
122 122 #define S10_SYS_rmdir 79
123 123 #define S10_SYS_mkdir 80
124 124 #define S10_SYS_poll 87
125 125 #define S10_SYS_lstat 88
126 126 #define S10_SYS_symlink 89
127 127 #define S10_SYS_readlink 90
128 128 #define S10_SYS_fchmod 93
129 129 #define S10_SYS_fchown 94
130 130 #define S10_SYS_xstat 123
131 131 #define S10_SYS_lxstat 124
132 132 #define S10_SYS_fxstat 125
133 133 #define S10_SYS_xmknod 126
134 134 #define S10_SYS_lchown 130
135 135 #define S10_SYS_rename 134
136 136 #define S10_SYS_fork1 143
137 137 #define S10_SYS_lwp_sema_wait 147
138 138 #define S10_SYS_utimes 154
139 139 #define S10_SYS_lwp_mutex_lock 169
140 140 #define S10_SYS_stat64 215
141 141 #define S10_SYS_lstat64 216
142 142 #define S10_SYS_fstat64 217
143 143 #define S10_SYS_creat64 224
144 144 #define S10_SYS_open64 225
145 145 #define S10_SYS_so_socket 230
146 146 #define S10_SYS_accept 234
147 147
148 148 /*
149 149 * solaris10-brand-specific attributes
150 150 * These must start at ZONE_ATTR_BRAND_ATTRS.
151 151 */
152 152 #define S10_EMUL_BITMAP ZONE_ATTR_BRAND_ATTRS
153 153
154 154 /*
155 155 * s10_emul_bitmap represents an emulation feature bitmap. Each constant
156 156 * in s10_emulated_features defines a bit index in this bitmap. If a bit is
157 157 * set, then the feature associated with the s10_emulated_features constant
158 158 * whose value is the bit's index is present in the associated zone's hosted
159 159 * Solaris 10 environment.
160 160 *
161 161 * NOTE: There must be at least one byte in the bitmap.
162 162 *
163 163 * We don't use the bitmap macros provided by usr/src/uts/common/sys/bitmap.h
164 164 * because they operate on ulong_t arrays. The size of a ulong_t depends on
165 165 * the data model in which the code that declares the ulong_t is compiled:
166 166 * four bytes on 32-bit architectures and eight bytes 64-bit architectures.
167 167 * If the kernel is 64-bit and a 32-bit process executes in a solaris10-
168 168 * branded zone, then if the process' emulation library, which is 32-bit,
169 169 * queries the kernel for the zone's emulation bitmap, then the kernel will
170 170 * refuse because the library will request a bitmap that's half as big
171 171 * as the bitmap the kernel provides. The 32-bit emulation library would need
172 172 * its own macros to define and operate on bitmaps with 64-bit array elements.
173 173 * Thus using the sys/bitmap.h macros is probably more troublesome than
174 174 * defining and using our own constants and macros for bitmap manipulations.
175 175 */
176 176 typedef uint8_t s10_emul_bitmap_t[(S10_NUM_EMUL_FEATURES >> 3) + 1];
177 177
178 178 #if defined(_KERNEL)
179 179
180 180 /* brand specific data */
181 181 typedef struct s10_zone_data {
182 182 /*
183 183 * emul_bitmap specifies the features that are present in the
184 184 * associated zone.
185 185 */
186 186 s10_emul_bitmap_t emul_bitmap;
187 187 } s10_zone_data_t;
188 188
189 189 void s10_brand_syscall_callback(void);
190 190 void s10_brand_syscall32_callback(void);
191 191
192 192 #if !defined(sparc)
193 193 void s10_brand_sysenter_callback(void);
194 194 #endif /* !sparc */
195 195
196 196 #if defined(__amd64)
197 197 void s10_brand_int91_callback(void);
198 198 #endif /* __amd64 */
199 199 #endif /* _KERNEL */
200 200
201 201 #ifdef __cplusplus
202 202 }
203 203 #endif
204 204
205 205 #endif /* _S10_BRAND_H */
|
↓ open down ↓ |
205 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX