2 * Copyright (c) 2003 Apple Computer, Inc. All rights reserved.
4 * @APPLE_OSREFERENCE_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. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
30 #include <sys/param.h>
31 #include <sys/kernel.h>
32 #include <sys/sysctl.h>
33 #include <i386/cpuid.h>
35 #include <i386/machine_routines.h>
38 _i386_cpu_info SYSCTL_HANDLER_ARGS
40 __unused
struct sysctl_oid
*unused_oidp
= oidp
;
49 if (arg2
== 0 && ((char *)ptr
)[0] == '\0') {
53 if (arg2
== sizeof(uint8_t)) {
54 value
= (uint32_t) *(uint8_t *)ptr
;
56 arg2
= sizeof(uint32_t);
58 return SYSCTL_OUT(req
, ptr
, arg2
? (size_t) arg2
: strlen((char *)ptr
)+1);
62 i386_cpu_info SYSCTL_HANDLER_ARGS
64 void *ptr
= (uint8_t *)cpuid_info() + (uintptr_t)arg1
;
65 return _i386_cpu_info(oidp
, ptr
, arg2
, req
);
69 i386_cpu_info_nonzero SYSCTL_HANDLER_ARGS
71 void *ptr
= (uint8_t *)cpuid_info() + (uintptr_t)arg1
;
72 int value
= *(uint32_t *)ptr
;
77 return _i386_cpu_info(oidp
, ptr
, arg2
, req
);
80 cpu_mwait SYSCTL_HANDLER_ARGS
82 i386_cpu_info_t
*cpu_info
= cpuid_info();
83 void *ptr
= (uint8_t *)cpu_info
->cpuid_mwait_leafp
+ (uintptr_t)arg1
;
84 if (cpu_info
->cpuid_mwait_leafp
== NULL
)
86 return _i386_cpu_info(oidp
, ptr
, arg2
, req
);
90 cpu_thermal SYSCTL_HANDLER_ARGS
92 i386_cpu_info_t
*cpu_info
= cpuid_info();
93 void *ptr
= (uint8_t *)cpu_info
->cpuid_thermal_leafp
+ (uintptr_t)arg1
;
94 if (cpu_info
->cpuid_thermal_leafp
== NULL
)
96 return _i386_cpu_info(oidp
, ptr
, arg2
, req
);
100 cpu_arch_perf SYSCTL_HANDLER_ARGS
102 i386_cpu_info_t
*cpu_info
= cpuid_info();
103 void *ptr
= (uint8_t *)cpu_info
->cpuid_arch_perf_leafp
+ (uintptr_t)arg1
;
104 if (cpu_info
->cpuid_arch_perf_leafp
== NULL
)
106 return _i386_cpu_info(oidp
, ptr
, arg2
, req
);
110 cpu_xsave SYSCTL_HANDLER_ARGS
112 i386_cpu_info_t
*cpu_info
= cpuid_info();
113 void *ptr
= (uint8_t *)cpu_info
->cpuid_xsave_leafp
+ (uintptr_t)arg1
;
114 if (cpu_info
->cpuid_xsave_leafp
== NULL
)
116 return _i386_cpu_info(oidp
, ptr
, arg2
, req
);
120 cpu_features SYSCTL_HANDLER_ARGS
122 __unused
struct sysctl_oid
*unused_oidp
= oidp
;
123 __unused
void *unused_arg1
= arg1
;
124 __unused
int unused_arg2
= arg2
;
128 cpuid_get_feature_names(cpuid_features(), buf
, sizeof(buf
));
130 return SYSCTL_OUT(req
, buf
, strlen(buf
) + 1);
134 cpu_extfeatures SYSCTL_HANDLER_ARGS
136 __unused
struct sysctl_oid
*unused_oidp
= oidp
;
137 __unused
void *unused_arg1
= arg1
;
138 __unused
int unused_arg2
= arg2
;
142 cpuid_get_extfeature_names(cpuid_extfeatures(), buf
, sizeof(buf
));
144 return SYSCTL_OUT(req
, buf
, strlen(buf
) + 1);
148 cpu_logical_per_package SYSCTL_HANDLER_ARGS
150 __unused
struct sysctl_oid
*unused_oidp
= oidp
;
151 __unused
void *unused_arg1
= arg1
;
152 __unused
int unused_arg2
= arg2
;
153 i386_cpu_info_t
*cpu_info
= cpuid_info();
155 if (!(cpuid_features() & CPUID_FEATURE_HTT
))
158 return SYSCTL_OUT(req
, &cpu_info
->cpuid_logical_per_package
,
159 sizeof(cpu_info
->cpuid_logical_per_package
));
163 cpu_flex_ratio_desired SYSCTL_HANDLER_ARGS
165 __unused
struct sysctl_oid
*unused_oidp
= oidp
;
166 __unused
void *unused_arg1
= arg1
;
167 __unused
int unused_arg2
= arg2
;
168 i386_cpu_info_t
*cpu_info
= cpuid_info();
170 if (cpu_info
->cpuid_model
!= 26)
173 return SYSCTL_OUT(req
, &flex_ratio
, sizeof(flex_ratio
));
177 cpu_flex_ratio_min SYSCTL_HANDLER_ARGS
179 __unused
struct sysctl_oid
*unused_oidp
= oidp
;
180 __unused
void *unused_arg1
= arg1
;
181 __unused
int unused_arg2
= arg2
;
182 i386_cpu_info_t
*cpu_info
= cpuid_info();
184 if (cpu_info
->cpuid_model
!= 26)
187 return SYSCTL_OUT(req
, &flex_ratio_min
, sizeof(flex_ratio_min
));
191 cpu_flex_ratio_max SYSCTL_HANDLER_ARGS
193 __unused
struct sysctl_oid
*unused_oidp
= oidp
;
194 __unused
void *unused_arg1
= arg1
;
195 __unused
int unused_arg2
= arg2
;
196 i386_cpu_info_t
*cpu_info
= cpuid_info();
198 if (cpu_info
->cpuid_model
!= 26)
201 return SYSCTL_OUT(req
, &flex_ratio_max
, sizeof(flex_ratio_max
));
205 * Populates the {CPU, vector, latency} triple for the maximum observed primary
209 misc_interrupt_latency_max(__unused
struct sysctl_oid
*oidp
, __unused
void *arg1
, __unused
int arg2
, struct sysctl_req
*req
)
211 int changed
= 0, error
;
215 interrupt_populate_latency_stats(buf
, sizeof(buf
));
217 error
= sysctl_io_string(req
, buf
, sizeof(buf
), 0, &changed
);
219 if (error
== 0 && changed
) {
220 interrupt_reset_latency_stats();
226 SYSCTL_NODE(_machdep
, OID_AUTO
, cpu
, CTLFLAG_RW
|CTLFLAG_LOCKED
, 0,
229 SYSCTL_PROC(_machdep_cpu
, OID_AUTO
, max_basic
, CTLTYPE_INT
| CTLFLAG_RD
,
230 (void *)offsetof(i386_cpu_info_t
, cpuid_max_basic
),sizeof(uint32_t),
231 i386_cpu_info
, "IU", "Max Basic Information value");
233 SYSCTL_PROC(_machdep_cpu
, OID_AUTO
, max_ext
, CTLTYPE_INT
| CTLFLAG_RD
,
234 (void *)offsetof(i386_cpu_info_t
, cpuid_max_ext
), sizeof(uint32_t),
235 i386_cpu_info
, "IU", "Max Extended Function Information value");
237 SYSCTL_PROC(_machdep_cpu
, OID_AUTO
, vendor
, CTLTYPE_STRING
| CTLFLAG_RD
,
238 (void *)offsetof(i386_cpu_info_t
, cpuid_vendor
), 0,
239 i386_cpu_info
, "A", "CPU vendor");
241 SYSCTL_PROC(_machdep_cpu
, OID_AUTO
, brand_string
, CTLTYPE_STRING
| CTLFLAG_RD
,
242 (void *)offsetof(i386_cpu_info_t
, cpuid_brand_string
), 0,
243 i386_cpu_info
, "A", "CPU brand string");
245 SYSCTL_PROC(_machdep_cpu
, OID_AUTO
, family
, CTLTYPE_INT
| CTLFLAG_RD
,
246 (void *)offsetof(i386_cpu_info_t
, cpuid_family
), sizeof(uint8_t),
247 i386_cpu_info
, "I", "CPU family");
249 SYSCTL_PROC(_machdep_cpu
, OID_AUTO
, model
, CTLTYPE_INT
| CTLFLAG_RD
,
250 (void *)offsetof(i386_cpu_info_t
, cpuid_model
), sizeof(uint8_t),
251 i386_cpu_info
, "I", "CPU model");
253 SYSCTL_PROC(_machdep_cpu
, OID_AUTO
, extmodel
, CTLTYPE_INT
| CTLFLAG_RD
,
254 (void *)offsetof(i386_cpu_info_t
, cpuid_extmodel
), sizeof(uint8_t),
255 i386_cpu_info
, "I", "CPU extended model");
257 SYSCTL_PROC(_machdep_cpu
, OID_AUTO
, extfamily
, CTLTYPE_INT
| CTLFLAG_RD
,
258 (void *)offsetof(i386_cpu_info_t
, cpuid_extfamily
), sizeof(uint8_t),
259 i386_cpu_info
, "I", "CPU extended family");
261 SYSCTL_PROC(_machdep_cpu
, OID_AUTO
, stepping
, CTLTYPE_INT
| CTLFLAG_RD
,
262 (void *)offsetof(i386_cpu_info_t
, cpuid_stepping
), sizeof(uint8_t),
263 i386_cpu_info
, "I", "CPU stepping");
265 SYSCTL_PROC(_machdep_cpu
, OID_AUTO
, feature_bits
, CTLTYPE_QUAD
| CTLFLAG_RD
,
266 (void *)offsetof(i386_cpu_info_t
, cpuid_features
), sizeof(uint64_t),
267 i386_cpu_info
, "IU", "CPU features");
269 SYSCTL_PROC(_machdep_cpu
, OID_AUTO
, extfeature_bits
, CTLTYPE_QUAD
| CTLFLAG_RD
,
270 (void *)offsetof(i386_cpu_info_t
, cpuid_extfeatures
), sizeof(uint64_t),
271 i386_cpu_info
, "IU", "CPU extended features");
273 SYSCTL_PROC(_machdep_cpu
, OID_AUTO
, signature
, CTLTYPE_INT
| CTLFLAG_RD
,
274 (void *)offsetof(i386_cpu_info_t
, cpuid_signature
), sizeof(uint32_t),
275 i386_cpu_info
, "I", "CPU signature");
277 SYSCTL_PROC(_machdep_cpu
, OID_AUTO
, brand
, CTLTYPE_INT
| CTLFLAG_RD
,
278 (void *)offsetof(i386_cpu_info_t
, cpuid_brand
), sizeof(uint8_t),
279 i386_cpu_info
, "I", "CPU brand");
281 SYSCTL_PROC(_machdep_cpu
, OID_AUTO
, features
, CTLTYPE_STRING
| CTLFLAG_RD
,
283 cpu_features
, "A", "CPU feature names");
285 SYSCTL_PROC(_machdep_cpu
, OID_AUTO
, extfeatures
, CTLTYPE_STRING
| CTLFLAG_RD
,
287 cpu_extfeatures
, "A", "CPU extended feature names");
289 SYSCTL_PROC(_machdep_cpu
, OID_AUTO
, logical_per_package
,
290 CTLTYPE_INT
| CTLFLAG_RD
,
292 cpu_logical_per_package
, "I", "CPU logical cpus per package");
294 SYSCTL_PROC(_machdep_cpu
, OID_AUTO
, cores_per_package
,
295 CTLTYPE_INT
| CTLFLAG_RD
,
296 (void *)offsetof(i386_cpu_info_t
, cpuid_cores_per_package
),
298 i386_cpu_info
, "I", "CPU cores per package");
300 SYSCTL_PROC(_machdep_cpu
, OID_AUTO
, microcode_version
,
301 CTLTYPE_INT
| CTLFLAG_RD
,
302 (void *)offsetof(i386_cpu_info_t
, cpuid_microcode_version
),
304 i386_cpu_info
, "I", "Microcode version number");
307 SYSCTL_NODE(_machdep_cpu
, OID_AUTO
, mwait
, CTLFLAG_RW
|CTLFLAG_LOCKED
, 0,
310 SYSCTL_PROC(_machdep_cpu_mwait
, OID_AUTO
, linesize_min
,
311 CTLTYPE_INT
| CTLFLAG_RD
,
312 (void *)offsetof(cpuid_mwait_leaf_t
, linesize_min
),
314 cpu_mwait
, "I", "Monitor/mwait minimum line size");
316 SYSCTL_PROC(_machdep_cpu_mwait
, OID_AUTO
, linesize_max
,
317 CTLTYPE_INT
| CTLFLAG_RD
,
318 (void *)offsetof(cpuid_mwait_leaf_t
, linesize_max
),
320 cpu_mwait
, "I", "Monitor/mwait maximum line size");
322 SYSCTL_PROC(_machdep_cpu_mwait
, OID_AUTO
, extensions
,
323 CTLTYPE_INT
| CTLFLAG_RD
,
324 (void *)offsetof(cpuid_mwait_leaf_t
, extensions
),
326 cpu_mwait
, "I", "Monitor/mwait extensions");
328 SYSCTL_PROC(_machdep_cpu_mwait
, OID_AUTO
, sub_Cstates
,
329 CTLTYPE_INT
| CTLFLAG_RD
,
330 (void *)offsetof(cpuid_mwait_leaf_t
, sub_Cstates
),
332 cpu_mwait
, "I", "Monitor/mwait sub C-states");
335 SYSCTL_NODE(_machdep_cpu
, OID_AUTO
, thermal
, CTLFLAG_RW
|CTLFLAG_LOCKED
, 0,
338 SYSCTL_PROC(_machdep_cpu_thermal
, OID_AUTO
, sensor
,
339 CTLTYPE_INT
| CTLFLAG_RD
,
340 (void *)offsetof(cpuid_thermal_leaf_t
, sensor
),
342 cpu_thermal
, "I", "Thermal sensor present");
344 SYSCTL_PROC(_machdep_cpu_thermal
, OID_AUTO
, dynamic_acceleration
,
345 CTLTYPE_INT
| CTLFLAG_RD
,
346 (void *)offsetof(cpuid_thermal_leaf_t
, dynamic_acceleration
),
348 cpu_thermal
, "I", "Dynamic Acceleration Technology (Turbo Mode)");
350 SYSCTL_PROC(_machdep_cpu_thermal
, OID_AUTO
, invariant_APIC_timer
,
351 CTLTYPE_INT
| CTLFLAG_RD
,
352 (void *)offsetof(cpuid_thermal_leaf_t
, invariant_APIC_timer
),
354 cpu_thermal
, "I", "Invariant APIC Timer");
356 SYSCTL_PROC(_machdep_cpu_thermal
, OID_AUTO
, thresholds
,
357 CTLTYPE_INT
| CTLFLAG_RD
,
358 (void *)offsetof(cpuid_thermal_leaf_t
, thresholds
),
360 cpu_thermal
, "I", "Number of interrupt thresholds");
362 SYSCTL_PROC(_machdep_cpu_thermal
, OID_AUTO
, ACNT_MCNT
,
363 CTLTYPE_INT
| CTLFLAG_RD
,
364 (void *)offsetof(cpuid_thermal_leaf_t
, ACNT_MCNT
),
366 cpu_thermal
, "I", "ACNT_MCNT capability");
368 SYSCTL_PROC(_machdep_cpu_thermal
, OID_AUTO
, core_power_limits
,
369 CTLTYPE_INT
| CTLFLAG_RD
| CTLFLAG_LOCKED
,
370 (void *)offsetof(cpuid_thermal_leaf_t
, core_power_limits
),
372 cpu_thermal
, "I", "Power Limit Notifications at a Core Level");
374 SYSCTL_PROC(_machdep_cpu_thermal
, OID_AUTO
, fine_grain_clock_mod
,
375 CTLTYPE_INT
| CTLFLAG_RD
| CTLFLAG_LOCKED
,
376 (void *)offsetof(cpuid_thermal_leaf_t
, fine_grain_clock_mod
),
378 cpu_thermal
, "I", "Fine Grain Clock Modulation");
380 SYSCTL_PROC(_machdep_cpu_thermal
, OID_AUTO
, package_thermal_intr
,
381 CTLTYPE_INT
| CTLFLAG_RD
| CTLFLAG_LOCKED
,
382 (void *)offsetof(cpuid_thermal_leaf_t
, package_thermal_intr
),
384 cpu_thermal
, "I", "Packge Thermal interrupt and Status");
386 SYSCTL_PROC(_machdep_cpu_thermal
, OID_AUTO
, hardware_feedback
,
387 CTLTYPE_INT
| CTLFLAG_RD
| CTLFLAG_LOCKED
,
388 (void *)offsetof(cpuid_thermal_leaf_t
, hardware_feedback
),
390 cpu_thermal
, "I", "Hardware Coordination Feedback");
392 SYSCTL_PROC(_machdep_cpu_thermal
, OID_AUTO
, energy_policy
,
393 CTLTYPE_INT
| CTLFLAG_RD
| CTLFLAG_LOCKED
,
394 (void *)offsetof(cpuid_thermal_leaf_t
, energy_policy
),
396 cpu_thermal
, "I", "Energy Efficient Policy Support");
399 SYSCTL_NODE(_machdep_cpu
, OID_AUTO
, xsave
, CTLFLAG_RW
|CTLFLAG_LOCKED
, 0,
402 SYSCTL_PROC(_machdep_cpu_xsave
, OID_AUTO
, extended_state
,
403 CTLTYPE_INT
| CTLFLAG_RD
| CTLFLAG_LOCKED
,
404 (void *)offsetof(cpuid_xsave_leaf_t
, extended_state
),
405 sizeof(cpuid_xsave_leaf_t
),
406 cpu_xsave
, "IU", "XSAVE Extended State");
409 SYSCTL_NODE(_machdep_cpu
, OID_AUTO
, arch_perf
, CTLFLAG_RW
|CTLFLAG_LOCKED
, 0,
412 SYSCTL_PROC(_machdep_cpu_arch_perf
, OID_AUTO
, version
,
413 CTLTYPE_INT
| CTLFLAG_RD
,
414 (void *)offsetof(cpuid_arch_perf_leaf_t
, version
),
416 cpu_arch_perf
, "I", "Architectural Performance Version Number");
418 SYSCTL_PROC(_machdep_cpu_arch_perf
, OID_AUTO
, number
,
419 CTLTYPE_INT
| CTLFLAG_RD
,
420 (void *)offsetof(cpuid_arch_perf_leaf_t
, number
),
422 cpu_arch_perf
, "I", "Number of counters per logical cpu");
424 SYSCTL_PROC(_machdep_cpu_arch_perf
, OID_AUTO
, width
,
425 CTLTYPE_INT
| CTLFLAG_RD
,
426 (void *)offsetof(cpuid_arch_perf_leaf_t
, width
),
428 cpu_arch_perf
, "I", "Bit width of counters");
430 SYSCTL_PROC(_machdep_cpu_arch_perf
, OID_AUTO
, events_number
,
431 CTLTYPE_INT
| CTLFLAG_RD
,
432 (void *)offsetof(cpuid_arch_perf_leaf_t
, events_number
),
434 cpu_arch_perf
, "I", "Number of monitoring events");
436 SYSCTL_PROC(_machdep_cpu_arch_perf
, OID_AUTO
, events
,
437 CTLTYPE_INT
| CTLFLAG_RD
,
438 (void *)offsetof(cpuid_arch_perf_leaf_t
, events
),
440 cpu_arch_perf
, "I", "Bit vector of events");
442 SYSCTL_PROC(_machdep_cpu_arch_perf
, OID_AUTO
, fixed_number
,
443 CTLTYPE_INT
| CTLFLAG_RD
,
444 (void *)offsetof(cpuid_arch_perf_leaf_t
, fixed_number
),
446 cpu_arch_perf
, "I", "Number of fixed-function counters");
448 SYSCTL_PROC(_machdep_cpu_arch_perf
, OID_AUTO
, fixed_width
,
449 CTLTYPE_INT
| CTLFLAG_RD
,
450 (void *)offsetof(cpuid_arch_perf_leaf_t
, fixed_width
),
452 cpu_arch_perf
, "I", "Bit-width of fixed-function counters");
455 SYSCTL_NODE(_machdep_cpu
, OID_AUTO
, cache
, CTLFLAG_RW
|CTLFLAG_LOCKED
, 0,
458 SYSCTL_PROC(_machdep_cpu_cache
, OID_AUTO
, linesize
,
459 CTLTYPE_INT
| CTLFLAG_RD
,
460 (void *)offsetof(i386_cpu_info_t
, cpuid_cache_linesize
),
462 i386_cpu_info
, "I", "Cacheline size");
464 SYSCTL_PROC(_machdep_cpu_cache
, OID_AUTO
, L2_associativity
,
465 CTLTYPE_INT
| CTLFLAG_RD
,
466 (void *)offsetof(i386_cpu_info_t
, cpuid_cache_L2_associativity
),
468 i386_cpu_info
, "I", "L2 cache associativity");
470 SYSCTL_PROC(_machdep_cpu_cache
, OID_AUTO
, size
,
471 CTLTYPE_INT
| CTLFLAG_RD
,
472 (void *)offsetof(i386_cpu_info_t
, cpuid_cache_size
),
474 i386_cpu_info
, "I", "Cache size (in Kbytes)");
477 SYSCTL_NODE(_machdep_cpu
, OID_AUTO
, tlb
, CTLFLAG_RW
|CTLFLAG_LOCKED
, 0,
479 SYSCTL_NODE(_machdep_cpu_tlb
, OID_AUTO
, inst
, CTLFLAG_RW
|CTLFLAG_LOCKED
, 0,
481 SYSCTL_NODE(_machdep_cpu_tlb
, OID_AUTO
, data
, CTLFLAG_RW
|CTLFLAG_LOCKED
, 0,
484 SYSCTL_PROC(_machdep_cpu_tlb_inst
, OID_AUTO
, small
,
485 CTLTYPE_INT
| CTLFLAG_RD
,
486 (void *)offsetof(i386_cpu_info_t
,
487 cpuid_tlb
[TLB_INST
][TLB_SMALL
][0]),
489 i386_cpu_info_nonzero
, "I",
490 "Number of small page instruction TLBs");
492 SYSCTL_PROC(_machdep_cpu_tlb_data
, OID_AUTO
, small
,
493 CTLTYPE_INT
| CTLFLAG_RD
,
494 (void *)offsetof(i386_cpu_info_t
,
495 cpuid_tlb
[TLB_DATA
][TLB_SMALL
][0]),
497 i386_cpu_info_nonzero
, "I",
498 "Number of small page data TLBs (1st level)");
500 SYSCTL_PROC(_machdep_cpu_tlb_data
, OID_AUTO
, small_level1
,
501 CTLTYPE_INT
| CTLFLAG_RD
,
502 (void *)offsetof(i386_cpu_info_t
,
503 cpuid_tlb
[TLB_DATA
][TLB_SMALL
][1]),
505 i386_cpu_info_nonzero
, "I",
506 "Number of small page data TLBs (2nd level)");
508 SYSCTL_PROC(_machdep_cpu_tlb_inst
, OID_AUTO
, large
,
509 CTLTYPE_INT
| CTLFLAG_RD
,
510 (void *)offsetof(i386_cpu_info_t
,
511 cpuid_tlb
[TLB_INST
][TLB_LARGE
][0]),
513 i386_cpu_info_nonzero
, "I",
514 "Number of large page instruction TLBs");
516 SYSCTL_PROC(_machdep_cpu_tlb_data
, OID_AUTO
, large
,
517 CTLTYPE_INT
| CTLFLAG_RD
,
518 (void *)offsetof(i386_cpu_info_t
,
519 cpuid_tlb
[TLB_DATA
][TLB_LARGE
][0]),
521 i386_cpu_info_nonzero
, "I",
522 "Number of large page data TLBs (1st level)");
524 SYSCTL_PROC(_machdep_cpu_tlb_data
, OID_AUTO
, large_level1
,
525 CTLTYPE_INT
| CTLFLAG_RD
,
526 (void *)offsetof(i386_cpu_info_t
,
527 cpuid_tlb
[TLB_DATA
][TLB_LARGE
][1]),
529 i386_cpu_info_nonzero
, "I",
530 "Number of large page data TLBs (2nd level)");
532 SYSCTL_PROC(_machdep_cpu_tlb
, OID_AUTO
, shared
,
533 CTLTYPE_INT
| CTLFLAG_RD
,
534 (void *)offsetof(i386_cpu_info_t
, cpuid_stlb
),
536 i386_cpu_info_nonzero
, "I",
537 "Number of shared TLBs");
540 SYSCTL_NODE(_machdep_cpu
, OID_AUTO
, address_bits
, CTLFLAG_RW
|CTLFLAG_LOCKED
, 0,
543 SYSCTL_PROC(_machdep_cpu_address_bits
, OID_AUTO
, physical
,
544 CTLTYPE_INT
| CTLFLAG_RD
,
545 (void *)offsetof(i386_cpu_info_t
, cpuid_address_bits_physical
),
547 i386_cpu_info
, "I", "Number of physical address bits");
549 SYSCTL_PROC(_machdep_cpu_address_bits
, OID_AUTO
, virtual,
550 CTLTYPE_INT
| CTLFLAG_RD
,
551 (void *)offsetof(i386_cpu_info_t
, cpuid_address_bits_virtual
),
553 i386_cpu_info
, "I", "Number of virtual address bits");
556 SYSCTL_PROC(_machdep_cpu
, OID_AUTO
, core_count
,
557 CTLTYPE_INT
| CTLFLAG_RD
,
558 (void *)offsetof(i386_cpu_info_t
, core_count
),
560 i386_cpu_info
, "I", "Number of enabled cores per package");
562 SYSCTL_PROC(_machdep_cpu
, OID_AUTO
, thread_count
,
563 CTLTYPE_INT
| CTLFLAG_RD
,
564 (void *)offsetof(i386_cpu_info_t
, thread_count
),
566 i386_cpu_info
, "I", "Number of enabled threads per package");
568 SYSCTL_NODE(_machdep_cpu
, OID_AUTO
, flex_ratio
, CTLFLAG_RW
|CTLFLAG_LOCKED
, 0,
571 SYSCTL_PROC(_machdep_cpu_flex_ratio
, OID_AUTO
, desired
,
572 CTLTYPE_INT
| CTLFLAG_RD
,
574 cpu_flex_ratio_desired
, "I", "Flex ratio desired (0 disabled)");
576 SYSCTL_PROC(_machdep_cpu_flex_ratio
, OID_AUTO
, min
,
577 CTLTYPE_INT
| CTLFLAG_RD
,
579 cpu_flex_ratio_min
, "I", "Flex ratio min (efficiency)");
581 SYSCTL_PROC(_machdep_cpu_flex_ratio
, OID_AUTO
, max
,
582 CTLTYPE_INT
| CTLFLAG_RD
,
584 cpu_flex_ratio_max
, "I", "Flex ratio max (non-turbo)");
586 uint64_t pmap_pv_hashlist_walks
;
587 uint64_t pmap_pv_hashlist_cnts
;
588 uint32_t pmap_pv_hashlist_max
;
589 uint32_t pmap_kernel_text_ps
= PAGE_SIZE
;
591 /*extern struct sysctl_oid_list sysctl__machdep_pmap_children;*/
593 SYSCTL_NODE(_machdep
, OID_AUTO
, pmap
, CTLFLAG_RW
|CTLFLAG_LOCKED
, 0,
596 SYSCTL_QUAD (_machdep_pmap
, OID_AUTO
, hashwalks
, CTLFLAG_RD
| CTLFLAG_KERN
, &pmap_pv_hashlist_walks
, "");
597 SYSCTL_QUAD (_machdep_pmap
, OID_AUTO
, hashcnts
, CTLFLAG_RD
| CTLFLAG_KERN
, &pmap_pv_hashlist_cnts
, "");
598 SYSCTL_INT (_machdep_pmap
, OID_AUTO
, hashmax
, CTLFLAG_RD
| CTLFLAG_KERN
, &pmap_pv_hashlist_max
, 0, "");
599 SYSCTL_INT (_machdep_pmap
, OID_AUTO
, kernel_text_ps
, CTLFLAG_RD
| CTLFLAG_KERN
, &pmap_kernel_text_ps
, 0, "");
601 SYSCTL_NODE(_machdep
, OID_AUTO
, memmap
, CTLFLAG_RD
|CTLFLAG_LOCKED
, NULL
, "physical memory map");
603 uint64_t firmware_Conventional_bytes
= 0;
604 uint64_t firmware_RuntimeServices_bytes
= 0;
605 uint64_t firmware_ACPIReclaim_bytes
= 0;
606 uint64_t firmware_ACPINVS_bytes
= 0;
607 uint64_t firmware_PalCode_bytes
= 0;
608 uint64_t firmware_Reserved_bytes
= 0;
609 uint64_t firmware_Unusable_bytes
= 0;
610 uint64_t firmware_other_bytes
= 0;
612 SYSCTL_QUAD(_machdep_memmap
, OID_AUTO
, Conventional
, CTLFLAG_RD
|CTLFLAG_LOCKED
, &firmware_Conventional_bytes
, "");
613 SYSCTL_QUAD(_machdep_memmap
, OID_AUTO
, RuntimeServices
, CTLFLAG_RD
|CTLFLAG_LOCKED
, &firmware_RuntimeServices_bytes
, "");
614 SYSCTL_QUAD(_machdep_memmap
, OID_AUTO
, ACPIReclaim
, CTLFLAG_RD
|CTLFLAG_LOCKED
, &firmware_ACPIReclaim_bytes
, "");
615 SYSCTL_QUAD(_machdep_memmap
, OID_AUTO
, ACPINVS
, CTLFLAG_RD
|CTLFLAG_LOCKED
, &firmware_ACPINVS_bytes
, "");
616 SYSCTL_QUAD(_machdep_memmap
, OID_AUTO
, PalCode
, CTLFLAG_RD
|CTLFLAG_LOCKED
, &firmware_PalCode_bytes
, "");
617 SYSCTL_QUAD(_machdep_memmap
, OID_AUTO
, Reserved
, CTLFLAG_RD
|CTLFLAG_LOCKED
, &firmware_Reserved_bytes
, "");
618 SYSCTL_QUAD(_machdep_memmap
, OID_AUTO
, Unusable
, CTLFLAG_RD
|CTLFLAG_LOCKED
, &firmware_Unusable_bytes
, "");
619 SYSCTL_QUAD(_machdep_memmap
, OID_AUTO
, Other
, CTLFLAG_RD
|CTLFLAG_LOCKED
, &firmware_other_bytes
, "");
621 SYSCTL_NODE(_machdep
, OID_AUTO
, tsc
, CTLFLAG_RD
|CTLFLAG_LOCKED
, NULL
, "Timestamp counter parameters");
623 SYSCTL_QUAD(_machdep_tsc
, OID_AUTO
, frequency
, CTLFLAG_RD
|CTLFLAG_LOCKED
, &tscFreq
, "");
624 SYSCTL_NODE(_machdep
, OID_AUTO
, misc
, CTLFLAG_RW
|CTLFLAG_LOCKED
, 0,
625 "Miscellaneous x86 kernel parameters");
627 SYSCTL_PROC(_machdep_misc
, OID_AUTO
, interrupt_latency_max
, CTLTYPE_STRING
| CTLFLAG_RW
| CTLFLAG_LOCKED
,
629 misc_interrupt_latency_max
, "A", "Maximum Interrupt latency");