2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
21 * @APPLE_LICENSE_HEADER_END@
24 * Copyright (c) 1982, 1986, 1989, 1993
25 * The Regents of the University of California. All rights reserved.
27 * This code is derived from software contributed to Berkeley by
28 * Mike Karels at Berkeley Software Design, Inc.
30 * Quite extensively rewritten by Poul-Henning Kamp of the FreeBSD
31 * project, to make these variables more userfriendly.
33 * Redistribution and use in source and binary forms, with or without
34 * modification, are permitted provided that the following conditions
36 * 1. Redistributions of source code must retain the above copyright
37 * notice, this list of conditions and the following disclaimer.
38 * 2. Redistributions in binary form must reproduce the above copyright
39 * notice, this list of conditions and the following disclaimer in the
40 * documentation and/or other materials provided with the distribution.
41 * 3. All advertising materials mentioning features or use of this software
42 * must display the following acknowledgement:
43 * This product includes software developed by the University of
44 * California, Berkeley and its contributors.
45 * 4. Neither the name of the University nor the names of its contributors
46 * may be used to endorse or promote products derived from this software
47 * without specific prior written permission.
49 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
50 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
51 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
52 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
53 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
54 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
55 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
56 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
57 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
58 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
61 * @(#)kern_sysctl.c 8.4 (Berkeley) 4/14/94
64 #include <sys/param.h>
65 #include <sys/kernel.h>
66 #include <sys/systm.h>
67 #include <sys/sysctl.h>
68 #include <sys/proc_internal.h>
69 #include <sys/unistd.h>
72 #include <machine/smp.h>
75 #include <sys/param.h> /* XXX prune includes */
76 #include <sys/systm.h>
77 #include <sys/kernel.h>
78 #include <sys/malloc.h>
80 #include <sys/file_internal.h>
81 #include <sys/vnode.h>
82 #include <sys/unistd.h>
83 #include <sys/ioctl.h>
84 #include <sys/namei.h>
86 #include <sys/disklabel.h>
88 #include <sys/sysctl.h>
90 #include <mach/machine.h>
91 #include <mach/mach_types.h>
92 #include <mach/vm_param.h>
93 #include <kern/task.h>
94 #include <vm/vm_kern.h>
95 #include <mach/host_info.h>
97 extern vm_map_t bsd_pageable_map
;
99 #include <sys/mount_internal.h>
100 #include <sys/kdebug.h>
102 #include <IOKit/IOPlatformExpert.h>
103 #include <pexpert/pexpert.h>
105 #include <machine/machine_routines.h>
106 #include <machine/cpu_capabilities.h>
108 static int cputype
, cpusubtype
, cputhreadtype
;
110 SYSCTL_NODE(, 0, sysctl
, CTLFLAG_RW
, 0,
111 "Sysctl internal magic");
112 SYSCTL_NODE(, CTL_KERN
, kern
, CTLFLAG_RW
, 0,
113 "High kernel, proc, limits &c");
114 SYSCTL_NODE(, CTL_VM
, vm
, CTLFLAG_RW
, 0,
116 SYSCTL_NODE(, CTL_VFS
, vfs
, CTLFLAG_RW
, 0,
118 SYSCTL_NODE(, CTL_NET
, net
, CTLFLAG_RW
, 0,
119 "Network, (see socket.h)");
120 SYSCTL_NODE(, CTL_DEBUG
, debug
, CTLFLAG_RW
, 0,
122 SYSCTL_NODE(, CTL_HW
, hw
, CTLFLAG_RW
, 0,
124 SYSCTL_NODE(, CTL_MACHDEP
, machdep
, CTLFLAG_RW
, 0,
125 "machine dependent");
126 SYSCTL_NODE(, CTL_USER
, user
, CTLFLAG_RW
, 0,
129 #define SYSCTL_RETURN(r, x) SYSCTL_OUT(r, &x, sizeof(x))
131 /******************************************************************************
135 #define CTLHW_RETQUAD (1 << 31)
136 #define CTLHW_LOCAL (1 << 30)
138 #define HW_LOCAL_CPUTHREADTYPE (1 | CTLHW_LOCAL)
139 #define HW_LOCAL_PHYSICALCPU (2 | CTLHW_LOCAL)
140 #define HW_LOCAL_PHYSICALCPUMAX (3 | CTLHW_LOCAL)
141 #define HW_LOCAL_LOGICALCPU (4 | CTLHW_LOCAL)
142 #define HW_LOCAL_LOGICALCPUMAX (5 | CTLHW_LOCAL)
146 * Supporting some variables requires us to do "real" work. We
147 * gather some of that here.
150 sysctl_hw_generic SYSCTL_HANDLER_ARGS
154 extern int vm_page_wire_count
;
155 ml_cpu_info_t cpu_info
;
158 host_basic_info_data_t hinfo
;
160 int count
= HOST_BASIC_INFO_COUNT
;
163 * Test and mask off the 'return quad' flag.
164 * Note that only some things here support it.
166 doquad
= arg2
& CTLHW_RETQUAD
;
167 arg2
&= ~CTLHW_RETQUAD
;
169 ml_cpu_get_info(&cpu_info
);
172 kret
= host_info(BSD_HOST
, HOST_BASIC_INFO
, &hinfo
, &count
);
175 * Handle various OIDs.
177 * OIDs that can return int or quad set val and qval and then break.
178 * Errors and int-only values return inline.
182 if (kret
== KERN_SUCCESS
) {
183 return(SYSCTL_RETURN(req
, hinfo
.max_cpus
));
188 if (kret
== KERN_SUCCESS
) {
189 return(SYSCTL_RETURN(req
, hinfo
.avail_cpus
));
193 case HW_LOCAL_PHYSICALCPU
:
194 if (kret
== KERN_SUCCESS
) {
195 return(SYSCTL_RETURN(req
, hinfo
.physical_cpu
));
199 case HW_LOCAL_PHYSICALCPUMAX
:
200 if (kret
== KERN_SUCCESS
) {
201 return(SYSCTL_RETURN(req
, hinfo
.physical_cpu_max
));
205 case HW_LOCAL_LOGICALCPU
:
206 if (kret
== KERN_SUCCESS
) {
207 return(SYSCTL_RETURN(req
, hinfo
.logical_cpu
));
211 case HW_LOCAL_LOGICALCPUMAX
:
212 if (kret
== KERN_SUCCESS
) {
213 return(SYSCTL_RETURN(req
, hinfo
.logical_cpu_max
));
218 val
= cpu_info
.cache_line_size
;
219 qval
= (long long)val
;
221 case HW_L1ICACHESIZE
:
222 val
= cpu_info
.l1_icache_size
;
223 qval
= (long long)val
;
225 case HW_L1DCACHESIZE
:
226 val
= cpu_info
.l1_dcache_size
;
227 qval
= (long long)val
;
230 if (cpu_info
.l2_cache_size
== 0xFFFFFFFF)
232 val
= cpu_info
.l2_cache_size
;
233 qval
= (long long)val
;
236 if (cpu_info
.l3_cache_size
== 0xFFFFFFFF)
238 val
= cpu_info
.l3_cache_size
;
239 qval
= (long long)val
;
243 * Deprecated variables. We still support these for
244 * backwards compatibility purposes only.
247 bzero(dummy
, sizeof(dummy
));
248 if(!PEGetMachineName(dummy
,64))
251 return(SYSCTL_OUT(req
, dummy
, strlen(dummy
) + 1));
253 bzero(dummy
, sizeof(dummy
));
254 if(!PEGetModelName(dummy
,64))
257 return(SYSCTL_OUT(req
, dummy
, strlen(dummy
) + 1));
260 int usermem
= mem_size
- vm_page_wire_count
* page_size
;
262 return(SYSCTL_RETURN(req
, usermem
));
265 epochTemp
= PEGetPlatformEpoch();
268 return(SYSCTL_RETURN(req
, epochTemp
));
270 return(SYSCTL_RETURN(req
, cpu_info
.vector_unit
));
272 if (cpu_info
.l2_cache_size
== 0xFFFFFFFF)
274 return(SYSCTL_RETURN(req
, cpu_info
.l2_settings
));
276 if (cpu_info
.l3_cache_size
== 0xFFFFFFFF)
278 return(SYSCTL_RETURN(req
, cpu_info
.l3_settings
));
283 * Callers may come to us with either int or quad buffers.
286 return(SYSCTL_RETURN(req
, qval
));
288 return(SYSCTL_RETURN(req
, val
));
292 * hw.* MIB variables.
294 SYSCTL_PROC (_hw
, HW_NCPU
, ncpu
, CTLTYPE_INT
| CTLFLAG_RD
| CTLFLAG_KERN
, 0, HW_NCPU
, sysctl_hw_generic
, "I", "");
295 SYSCTL_PROC (_hw
, HW_AVAILCPU
, activecpu
, CTLTYPE_INT
| CTLFLAG_RD
| CTLFLAG_KERN
, 0, HW_AVAILCPU
, sysctl_hw_generic
, "I", "");
296 SYSCTL_PROC (_hw
, OID_AUTO
, physicalcpu
, CTLTYPE_INT
| CTLFLAG_RD
| CTLFLAG_KERN
, 0, HW_LOCAL_PHYSICALCPU
, sysctl_hw_generic
, "I", "");
297 SYSCTL_PROC (_hw
, OID_AUTO
, physicalcpu_max
, CTLTYPE_INT
| CTLFLAG_RD
| CTLFLAG_KERN
, 0, HW_LOCAL_PHYSICALCPUMAX
, sysctl_hw_generic
, "I", "");
298 SYSCTL_PROC (_hw
, OID_AUTO
, logicalcpu
, CTLTYPE_INT
| CTLFLAG_RD
| CTLFLAG_KERN
, 0, HW_LOCAL_LOGICALCPU
, sysctl_hw_generic
, "I", "");
299 SYSCTL_PROC (_hw
, OID_AUTO
, logicalcpu_max
, CTLTYPE_INT
| CTLFLAG_RD
| CTLFLAG_KERN
, 0, HW_LOCAL_LOGICALCPUMAX
, sysctl_hw_generic
, "I", "");
300 SYSCTL_INT (_hw
, HW_BYTEORDER
, byteorder
, CTLFLAG_RD
| CTLFLAG_KERN
, NULL
, BYTE_ORDER
, "");
301 SYSCTL_INT (_hw
, OID_AUTO
, cputype
, CTLFLAG_RD
| CTLFLAG_KERN
, &cputype
, 0, "");
302 SYSCTL_INT (_hw
, OID_AUTO
, cpusubtype
, CTLFLAG_RD
| CTLFLAG_KERN
, &cpusubtype
, 0, "");
303 SYSCTL_INT2QUAD(_hw
, OID_AUTO
, pagesize
, CTLFLAG_RD
| CTLFLAG_KERN
, &page_size
, "");
304 SYSCTL_QUAD (_hw
, OID_AUTO
, busfrequency
, CTLFLAG_RD
| CTLFLAG_KERN
, &gPEClockFrequencyInfo
.bus_frequency_hz
, "");
305 SYSCTL_QUAD (_hw
, OID_AUTO
, busfrequency_min
, CTLFLAG_RD
| CTLFLAG_KERN
, &gPEClockFrequencyInfo
.bus_frequency_min_hz
, "");
306 SYSCTL_QUAD (_hw
, OID_AUTO
, busfrequency_max
, CTLFLAG_RD
| CTLFLAG_KERN
, &gPEClockFrequencyInfo
.bus_frequency_max_hz
, "");
307 SYSCTL_QUAD (_hw
, OID_AUTO
, cpufrequency
, CTLFLAG_RD
| CTLFLAG_KERN
, &gPEClockFrequencyInfo
.cpu_frequency_hz
, "");
308 SYSCTL_QUAD (_hw
, OID_AUTO
, cpufrequency_min
, CTLFLAG_RD
| CTLFLAG_KERN
, &gPEClockFrequencyInfo
.cpu_frequency_min_hz
, "");
309 SYSCTL_QUAD (_hw
, OID_AUTO
, cpufrequency_max
, CTLFLAG_RD
| CTLFLAG_KERN
, &gPEClockFrequencyInfo
.cpu_frequency_max_hz
, "");
310 SYSCTL_PROC (_hw
, OID_AUTO
, cachelinesize
, CTLTYPE_QUAD
| CTLFLAG_RD
| CTLFLAG_KERN
, 0, HW_CACHELINE
| CTLHW_RETQUAD
, sysctl_hw_generic
, "Q", "");
311 SYSCTL_PROC (_hw
, OID_AUTO
, l1icachesize
, CTLTYPE_QUAD
| CTLFLAG_RD
| CTLFLAG_KERN
, 0, HW_L1ICACHESIZE
| CTLHW_RETQUAD
, sysctl_hw_generic
, "Q", "");
312 SYSCTL_PROC (_hw
, OID_AUTO
, l1dcachesize
, CTLTYPE_QUAD
| CTLFLAG_RD
| CTLFLAG_KERN
, 0, HW_L1DCACHESIZE
| CTLHW_RETQUAD
, sysctl_hw_generic
, "Q", "");
313 SYSCTL_PROC (_hw
, OID_AUTO
, l2cachesize
, CTLTYPE_QUAD
| CTLFLAG_RD
| CTLFLAG_KERN
, 0, HW_L2CACHESIZE
| CTLHW_RETQUAD
, sysctl_hw_generic
, "Q", "");
314 SYSCTL_PROC (_hw
, OID_AUTO
, l3cachesize
, CTLTYPE_QUAD
| CTLFLAG_RD
| CTLFLAG_KERN
, 0, HW_L3CACHESIZE
| CTLHW_RETQUAD
, sysctl_hw_generic
, "Q", "");
315 SYSCTL_INT2QUAD(_hw
, OID_AUTO
, tbfrequency
, CTLFLAG_RD
| CTLFLAG_KERN
, &gPEClockFrequencyInfo
.timebase_frequency_hz
, "");
316 SYSCTL_QUAD (_hw
, HW_MEMSIZE
, memsize
, CTLFLAG_RD
| CTLFLAG_KERN
, &max_mem
, "");
319 * Optional features can register nodes below hw.optional.
321 * If the feature is not present, the node should either not be registered,
322 * or it should return -1. If the feature is present, the node should return
323 * 0. If the feature is present and its use is advised, the node should
326 SYSCTL_NODE(_hw
, OID_AUTO
, optional
, CTLFLAG_RW
, NULL
, "optional features");
328 SYSCTL_INT(_hw_optional
, OID_AUTO
, floatingpoint
, CTLFLAG_RD
| CTLFLAG_KERN
, 0, 1, ""); /* always set */
331 * Deprecated variables. These are supported for backwards compatibility
332 * purposes only. The MASKED flag requests that the variables not be
333 * printed by sysctl(8) and similar utilities.
335 * The variables named *_compat here are int-sized versions of variables
336 * that are now exported as quads. The int-sized versions are normally
337 * looked up only by number, wheras the quad-sized versions should be
340 * The *_compat nodes are *NOT* visible within the kernel.
342 SYSCTL_INT (_hw
, HW_PAGESIZE
, pagesize_compat
, CTLFLAG_RD
| CTLFLAG_MASKED
, &page_size
, 0, "");
343 SYSCTL_INT (_hw
, HW_BUS_FREQ
, busfrequency_compat
, CTLFLAG_RD
| CTLFLAG_MASKED
, &gPEClockFrequencyInfo
.bus_clock_rate_hz
, 0, "");
344 SYSCTL_INT (_hw
, HW_CPU_FREQ
, cpufrequency_compat
, CTLFLAG_RD
| CTLFLAG_MASKED
, &gPEClockFrequencyInfo
.cpu_clock_rate_hz
, 0, "");
345 SYSCTL_PROC(_hw
, HW_CACHELINE
, cachelinesize_compat
, CTLTYPE_INT
| CTLFLAG_RD
| CTLFLAG_MASKED
, 0, HW_CACHELINE
, sysctl_hw_generic
, "I", "");
346 SYSCTL_PROC(_hw
, HW_L1ICACHESIZE
, l1icachesize_compat
, CTLTYPE_INT
| CTLFLAG_RD
| CTLFLAG_MASKED
, 0, HW_L1ICACHESIZE
, sysctl_hw_generic
, "I", "");
347 SYSCTL_PROC(_hw
, HW_L1DCACHESIZE
, l1dcachesize_compat
, CTLTYPE_INT
| CTLFLAG_RD
| CTLFLAG_MASKED
, 0, HW_L1DCACHESIZE
, sysctl_hw_generic
, "I", "");
348 SYSCTL_PROC(_hw
, HW_L2CACHESIZE
, l2cachesize_compat
, CTLTYPE_INT
| CTLFLAG_RD
| CTLFLAG_MASKED
, 0, HW_L2CACHESIZE
, sysctl_hw_generic
, "I", "");
349 SYSCTL_PROC(_hw
, HW_L3CACHESIZE
, l3cachesize_compat
, CTLTYPE_INT
| CTLFLAG_RD
| CTLFLAG_MASKED
, 0, HW_L3CACHESIZE
, sysctl_hw_generic
, "I", "");
350 SYSCTL_INT (_hw
, HW_TB_FREQ
, tbfrequency_compat
, CTLFLAG_RD
| CTLFLAG_MASKED
, &gPEClockFrequencyInfo
.timebase_frequency_hz
, 0, "");
351 SYSCTL_PROC(_hw
, HW_MACHINE
, machine
, CTLTYPE_STRING
| CTLFLAG_RD
| CTLFLAG_MASKED
, 0, HW_MACHINE
, sysctl_hw_generic
, "A", "");
352 SYSCTL_PROC(_hw
, HW_MODEL
, model
, CTLTYPE_STRING
| CTLFLAG_RD
| CTLFLAG_MASKED
, 0, HW_MODEL
, sysctl_hw_generic
, "A", "");
353 SYSCTL_UINT(_hw
, HW_PHYSMEM
, physmem
, CTLFLAG_RD
| CTLFLAG_MASKED
, &mem_size
, 0, "");
354 SYSCTL_PROC(_hw
, HW_USERMEM
, usermem
, CTLTYPE_INT
| CTLFLAG_RD
| CTLFLAG_MASKED
, 0, HW_USERMEM
, sysctl_hw_generic
, "I", "");
355 SYSCTL_PROC(_hw
, HW_EPOCH
, epoch
, CTLTYPE_INT
| CTLFLAG_RD
| CTLFLAG_MASKED
, 0, HW_EPOCH
, sysctl_hw_generic
, "I", "");
356 SYSCTL_PROC(_hw
, HW_VECTORUNIT
, vectorunit
, CTLTYPE_INT
| CTLFLAG_RD
| CTLFLAG_MASKED
, 0, HW_VECTORUNIT
, sysctl_hw_generic
, "I", "");
357 SYSCTL_PROC(_hw
, HW_L2SETTINGS
, l2settings
, CTLTYPE_INT
| CTLFLAG_RD
| CTLFLAG_MASKED
, 0, HW_L2SETTINGS
, sysctl_hw_generic
, "I", "");
358 SYSCTL_PROC(_hw
, HW_L3SETTINGS
, l3settings
, CTLTYPE_INT
| CTLFLAG_RD
| CTLFLAG_MASKED
, 0, HW_L3SETTINGS
, sysctl_hw_generic
, "I", "");
360 /******************************************************************************
361 * Generic MIB initialisation.
363 * This is a hack, and should be replaced with SYSINITs
367 sysctl_mib_init(void)
369 cputype
= cpu_type();
370 cpusubtype
= cpu_subtype();
371 cputhreadtype
= cpu_threadtype();
374 * Populate the optional portion of the hw.* MIB.
376 * XXX This could be broken out into parts of the code
377 * that actually directly relate to the functions in
381 if (cputhreadtype
!= CPU_THREADTYPE_NONE
) {
382 static SYSCTL_INT(_hw
, OID_AUTO
, cputhreadtype
, CTLFLAG_RD
| CTLFLAG_NOAUTO
| CTLFLAG_KERN
, &cputhreadtype
, 0, "");
383 sysctl_register_oid(&sysctl__hw_cputhreadtype
);
388 static int altivec_flag
= -1;
389 static SYSCTL_INT(_hw_optional
, OID_AUTO
, altivec
, CTLFLAG_RD
| CTLFLAG_NOAUTO
| CTLFLAG_KERN
, &altivec_flag
, 0, "");
391 if (_cpu_capabilities
& kHasAltivec
) {
393 sysctl_register_oid(&sysctl__hw_optional_altivec
);
397 static int graphicsops_flag
= -1;
398 static SYSCTL_INT(_hw_optional
, OID_AUTO
, graphicsops
, CTLFLAG_RD
| CTLFLAG_NOAUTO
| CTLFLAG_KERN
, &graphicsops_flag
, 0, "");
400 if (_cpu_capabilities
& kHasGraphicsOps
) {
401 graphicsops_flag
= 1;
402 sysctl_register_oid(&sysctl__hw_optional_graphicsops
);
406 static int x64bitops_flag
= -1;
407 static SYSCTL_INT(_hw_optional
, OID_AUTO
, 64bitops
, CTLFLAG_RD
| CTLFLAG_NOAUTO
| CTLFLAG_KERN
, &x64bitops_flag
, 0, "");
409 if (_cpu_capabilities
& k64Bit
) {
411 sysctl_register_oid(&sysctl__hw_optional_64bitops
);
415 static int fsqrt_flag
= -1;
416 static SYSCTL_INT(_hw_optional
, OID_AUTO
, fsqrt
, CTLFLAG_RD
| CTLFLAG_NOAUTO
| CTLFLAG_KERN
, &fsqrt_flag
, 0, "");
418 if (_cpu_capabilities
& kHasFsqrt
) {
420 sysctl_register_oid(&sysctl__hw_optional_fsqrt
);
424 static int stfiwx_flag
= -1;
425 static SYSCTL_INT(_hw_optional
, OID_AUTO
, stfiwx
, CTLFLAG_RD
| CTLFLAG_NOAUTO
| CTLFLAG_KERN
, &stfiwx_flag
, 0, "");
427 if (_cpu_capabilities
& kHasStfiwx
) {
429 sysctl_register_oid(&sysctl__hw_optional_stfiwx
);
433 static int dcba_flag
= -1;
434 static SYSCTL_INT(_hw_optional
, OID_AUTO
, dcba
, CTLFLAG_RD
| CTLFLAG_NOAUTO
| CTLFLAG_KERN
, &dcba_flag
, 0, "");
436 if (_cpu_capabilities
& kDcbaAvailable
)
438 if (_cpu_capabilities
& kDcbaRecommended
)
441 sysctl_register_oid(&sysctl__hw_optional_dcba
);
444 static int datastreams_flag
= -1;
445 static SYSCTL_INT(_hw_optional
, OID_AUTO
, datastreams
, CTLFLAG_RD
| CTLFLAG_NOAUTO
| CTLFLAG_KERN
, &datastreams_flag
, 0, "");
447 if (_cpu_capabilities
& kDataStreamsAvailable
)
448 datastreams_flag
= 0;
449 if (_cpu_capabilities
& kDataStreamsRecommended
)
450 datastreams_flag
= 1;
451 if (datastreams_flag
>= 0)
452 sysctl_register_oid(&sysctl__hw_optional_datastreams
);
455 static int dcbtstreams_flag
= -1;
456 static SYSCTL_INT(_hw_optional
, OID_AUTO
, dcbtstreams
, CTLFLAG_RD
| CTLFLAG_NOAUTO
| CTLFLAG_KERN
, &dcbtstreams_flag
, 0, "");
458 if (_cpu_capabilities
& kDcbtStreamsAvailable
)
459 dcbtstreams_flag
= 0;
460 if (_cpu_capabilities
& kDcbtStreamsRecommended
)
461 dcbtstreams_flag
= 1;
462 if (dcbtstreams_flag
>= 0)
463 sysctl_register_oid(&sysctl__hw_optional_dcbtstreams
);
466 # warning we do not support this platform yet