5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21
22 /*
23 * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
25 * Copyright 2012 Joyent, Inc. All rights reserved.
26 */
27
28 #ifndef _SYS_FSS_H
29 #define _SYS_FSS_H
30
31 #include <sys/types.h>
32 #include <sys/thread.h>
33 #include <sys/project.h>
34 #include <sys/cpucaps.h>
35
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
39
40 #ifdef _KERNEL
41
42 typedef uint64_t fsspri_t;
43 typedef uint64_t fssusage_t;
44 struct cpupart;
45 struct zone;
143 struct zone *fssz_zone; /* ptr to our zone structure */
144 struct fsszone *fssz_next; /* next fsszone_t in fsspset_t */
145 struct fsszone *fssz_prev; /* prev fsszone_t in fsspset_t */
146 uint32_t fssz_shares; /* sum of all project shares */
147 uint32_t fssz_nproj; /* # of projects */
148 uint32_t fssz_rshares; /* "real" shares given to zone */
149 uint32_t fssz_runnable; /* # of runnable projects */
150 } fsszone_t;
151
152 #define FSSPROC(tx) ((fssproc_t *)(tx->t_cldata))
153 #define FSSPROC2FSSPROJ(fssx) ((fssx)->fss_proj);
154 #define FSSPROC2FSSPSET(fssx) (FSSPROC2FSSPROJ(fssx)->fssp_pset)
155 #define FSSPROJ(tx) (FSSPROC(tx)->fss_proj)
156 #define FSSPROJ2FSSPSET(fssx) ((fssx)->fssp_pset)
157 #define FSSPROJ2KPROJ(fssx) ((fssx)->fssp_proj)
158 #define FSSPROJ2FSSZONE(fssx) ((fssx)->fssp_fsszone)
159
160 /*
161 * fss_flags
162 */
163 #define FSSKPRI 0x01 /* the thread is in kernel mode */
164 #define FSSBACKQ 0x02 /* thread should be placed at the back of */
165 /* the dispatch queue if preempted */
166 #define FSSRESTORE 0x04 /* thread was not preempted, due to schedctl */
167 /* restore priority from fss_scpri */
168
169 #endif /* _KERNEL */
170
171 #ifdef __cplusplus
172 }
173 #endif
174
175 #endif /* _SYS_FSS_H */
|
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21
22 /*
23 * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
25 * Copyright 2019 Joyent, Inc.
26 */
27
28 #ifndef _SYS_FSS_H
29 #define _SYS_FSS_H
30
31 #include <sys/types.h>
32 #include <sys/thread.h>
33 #include <sys/project.h>
34 #include <sys/cpucaps.h>
35
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
39
40 #ifdef _KERNEL
41
42 typedef uint64_t fsspri_t;
43 typedef uint64_t fssusage_t;
44 struct cpupart;
45 struct zone;
143 struct zone *fssz_zone; /* ptr to our zone structure */
144 struct fsszone *fssz_next; /* next fsszone_t in fsspset_t */
145 struct fsszone *fssz_prev; /* prev fsszone_t in fsspset_t */
146 uint32_t fssz_shares; /* sum of all project shares */
147 uint32_t fssz_nproj; /* # of projects */
148 uint32_t fssz_rshares; /* "real" shares given to zone */
149 uint32_t fssz_runnable; /* # of runnable projects */
150 } fsszone_t;
151
152 #define FSSPROC(tx) ((fssproc_t *)(tx->t_cldata))
153 #define FSSPROC2FSSPROJ(fssx) ((fssx)->fss_proj);
154 #define FSSPROC2FSSPSET(fssx) (FSSPROC2FSSPROJ(fssx)->fssp_pset)
155 #define FSSPROJ(tx) (FSSPROC(tx)->fss_proj)
156 #define FSSPROJ2FSSPSET(fssx) ((fssx)->fssp_pset)
157 #define FSSPROJ2KPROJ(fssx) ((fssx)->fssp_proj)
158 #define FSSPROJ2FSSZONE(fssx) ((fssx)->fssp_fsszone)
159
160 /*
161 * fss_flags
162 */
163 /* Formerly: FSSKPRI 0x01 - the thread is in kernel mode */
164 #define FSSBACKQ 0x02 /* thread should be placed at the back of */
165 /* the dispatch queue if preempted */
166 #define FSSRESTORE 0x04 /* thread was not preempted, due to schedctl */
167 /* restore priority from fss_scpri */
168
169 #endif /* _KERNEL */
170
171 #ifdef __cplusplus
172 }
173 #endif
174
175 #endif /* _SYS_FSS_H */
|