3 *
4 * The contents of this file are subject to the terms of the
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 * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved.
23 */
24
25 #ifndef _SYS_CPUPART_H
26 #define _SYS_CPUPART_H
27
28 #include <sys/types.h>
29 #include <sys/processor.h>
30 #include <sys/cpuvar.h>
31 #include <sys/disp.h>
32 #include <sys/pset.h>
33 #include <sys/lgrp.h>
34 #include <sys/lgrp_user.h>
35 #include <sys/pg.h>
36 #include <sys/bitset.h>
37 #include <sys/time.h>
38
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
42
43 #ifdef _KERNEL
44
45 typedef int cpupartid_t;
46
47 /*
48 * Special partition id.
49 */
50 #define CP_DEFAULT 0
51
52 /*
53 * Flags for cpupart_list()
54 */
55 #define CP_ALL 0 /* return all cpu partitions */
56 #define CP_NONEMPTY 1 /* return only non-empty ones */
57
58 typedef struct cpupart {
59 disp_t cp_kp_queue; /* partition-wide kpreempt queue */
60 cpupartid_t cp_id; /* partition ID */
61 int cp_ncpus; /* number of online processors */
62 struct cpupart *cp_next; /* next partition in list */
63 struct cpupart *cp_prev; /* previous partition in list */
131 * haltset to prevent contention due to false sharing. The fanout factor
132 * is platform specific, and declared accordingly.
133 */
134 extern uint_t cp_haltset_fanout;
135
136 extern void cpupart_initialize_default();
137 extern cpupart_t *cpupart_find(psetid_t);
138 extern int cpupart_create(psetid_t *);
139 extern int cpupart_destroy(psetid_t);
140 extern psetid_t cpupart_query_cpu(cpu_t *);
141 extern int cpupart_attach_cpu(psetid_t, cpu_t *, int);
142 extern int cpupart_get_cpus(psetid_t *, processorid_t *, uint_t *);
143 extern int cpupart_bind_thread(kthread_id_t, psetid_t, int, void *,
144 void *);
145 extern void cpupart_kpqalloc(pri_t);
146 extern int cpupart_get_loadavg(psetid_t, int *, int);
147 extern uint_t cpupart_list(psetid_t *, uint_t, int);
148 extern int cpupart_setattr(psetid_t, uint_t);
149 extern int cpupart_getattr(psetid_t, uint_t *);
150
151 #endif /* _KERNEL */
152
153 #ifdef __cplusplus
154 }
155 #endif
156
157 #endif /* _SYS_CPUPART_H */
|
3 *
4 * The contents of this file are subject to the terms of the
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 * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved.
23 * Copyright 2017 RackTop Systems.
24 */
25
26 #ifndef _SYS_CPUPART_H
27 #define _SYS_CPUPART_H
28
29 #include <sys/types.h>
30 #include <sys/processor.h>
31 #include <sys/cpuvar.h>
32 #include <sys/disp.h>
33 #include <sys/pset.h>
34 #include <sys/lgrp.h>
35 #include <sys/lgrp_user.h>
36 #include <sys/pg.h>
37 #include <sys/bitset.h>
38 #include <sys/time.h>
39
40 #ifdef __cplusplus
41 extern "C" {
42 #endif
43
44 #if defined(_KERNEL) || defined(_FAKE_KERNEL)
45
46 typedef int cpupartid_t;
47
48 /*
49 * Special partition id.
50 */
51 #define CP_DEFAULT 0
52
53 /*
54 * Flags for cpupart_list()
55 */
56 #define CP_ALL 0 /* return all cpu partitions */
57 #define CP_NONEMPTY 1 /* return only non-empty ones */
58
59 typedef struct cpupart {
60 disp_t cp_kp_queue; /* partition-wide kpreempt queue */
61 cpupartid_t cp_id; /* partition ID */
62 int cp_ncpus; /* number of online processors */
63 struct cpupart *cp_next; /* next partition in list */
64 struct cpupart *cp_prev; /* previous partition in list */
132 * haltset to prevent contention due to false sharing. The fanout factor
133 * is platform specific, and declared accordingly.
134 */
135 extern uint_t cp_haltset_fanout;
136
137 extern void cpupart_initialize_default();
138 extern cpupart_t *cpupart_find(psetid_t);
139 extern int cpupart_create(psetid_t *);
140 extern int cpupart_destroy(psetid_t);
141 extern psetid_t cpupart_query_cpu(cpu_t *);
142 extern int cpupart_attach_cpu(psetid_t, cpu_t *, int);
143 extern int cpupart_get_cpus(psetid_t *, processorid_t *, uint_t *);
144 extern int cpupart_bind_thread(kthread_id_t, psetid_t, int, void *,
145 void *);
146 extern void cpupart_kpqalloc(pri_t);
147 extern int cpupart_get_loadavg(psetid_t, int *, int);
148 extern uint_t cpupart_list(psetid_t *, uint_t, int);
149 extern int cpupart_setattr(psetid_t, uint_t);
150 extern int cpupart_getattr(psetid_t, uint_t *);
151
152 #endif /* _KERNEL || _FAKE_KERNEL */
153
154 #ifdef __cplusplus
155 }
156 #endif
157
158 #endif /* _SYS_CPUPART_H */
|