]> git.saurik.com Git - apple/xnu.git/blob - bsd/dev/i386/sysctl.c
13d4355b98d2ebc6efc1aa1421799099a688dd00
[apple/xnu.git] / bsd / dev / i386 / sysctl.c
1 /*
2 * Copyright (c) 2003 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5 *
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.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
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.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28
29 #include <string.h>
30 #include <sys/param.h>
31 #include <sys/kernel.h>
32 #include <sys/sysctl.h>
33 #include <i386/cpuid.h>
34 #include <i386/tsc.h>
35
36 static int
37 hw_cpu_sysctl SYSCTL_HANDLER_ARGS
38 {
39 __unused struct sysctl_oid *unused_oidp = oidp;
40 i386_cpu_info_t *cpu_info = cpuid_info();
41 void *ptr = (uint8_t *)cpu_info + (uintptr_t)arg1;
42 int value;
43
44 if (arg2 == -1) {
45 ptr = *(void **)ptr;
46 arg2 = 0;
47 }
48
49 if (arg2 == 0 && ((char *)ptr)[0] == '\0') {
50 return ENOENT;
51 }
52
53 if (arg2 == sizeof(uint8_t)) {
54 value = (uint32_t) *(uint8_t *)ptr;
55 ptr = &value;
56 arg2 = sizeof(uint32_t);
57 }
58 return SYSCTL_OUT(req, ptr, arg2 ? (size_t) arg2 : strlen((char *)ptr)+1);
59 }
60
61 static int
62 hw_cpu_sysctl_nonzero SYSCTL_HANDLER_ARGS
63 {
64 i386_cpu_info_t *cpu_info = cpuid_info();
65 void *ptr = (uint8_t *)cpu_info + (uintptr_t)arg1;
66 int value = *(uint32_t *)ptr;
67
68 if (value == 0)
69 return ENOENT;
70
71 return hw_cpu_sysctl(oidp, arg1, arg2, req);
72 }
73
74 static int
75 hw_cpu_features SYSCTL_HANDLER_ARGS
76 {
77 __unused struct sysctl_oid *unused_oidp = oidp;
78 __unused void *unused_arg1 = arg1;
79 __unused int unused_arg2 = arg2;
80 char buf[256];
81
82 buf[0] = '\0';
83 cpuid_get_feature_names(cpuid_features(), buf, sizeof(buf));
84
85 return SYSCTL_OUT(req, buf, strlen(buf) + 1);
86 }
87
88 static int
89 hw_cpu_extfeatures SYSCTL_HANDLER_ARGS
90 {
91 __unused struct sysctl_oid *unused_oidp = oidp;
92 __unused void *unused_arg1 = arg1;
93 __unused int unused_arg2 = arg2;
94 char buf[256];
95
96 buf[0] = '\0';
97 cpuid_get_extfeature_names(cpuid_extfeatures(), buf, sizeof(buf));
98
99 return SYSCTL_OUT(req, buf, strlen(buf) + 1);
100 }
101
102 static int
103 hw_cpu_logical_per_package SYSCTL_HANDLER_ARGS
104 {
105 __unused struct sysctl_oid *unused_oidp = oidp;
106 __unused void *unused_arg1 = arg1;
107 __unused int unused_arg2 = arg2;
108 i386_cpu_info_t *cpu_info = cpuid_info();
109
110 if (!(cpuid_features() & CPUID_FEATURE_HTT))
111 return ENOENT;
112
113 return SYSCTL_OUT(req, &cpu_info->cpuid_logical_per_package,
114 sizeof(cpu_info->cpuid_logical_per_package));
115 }
116
117 static int
118 hw_cpu_flex_ratio_desired SYSCTL_HANDLER_ARGS
119 {
120 __unused struct sysctl_oid *unused_oidp = oidp;
121 __unused void *unused_arg1 = arg1;
122 __unused int unused_arg2 = arg2;
123 i386_cpu_info_t *cpu_info = cpuid_info();
124
125 if (cpu_info->cpuid_model != 26)
126 return ENOENT;
127
128 return SYSCTL_OUT(req, &flex_ratio, sizeof(flex_ratio));
129 }
130
131 static int
132 hw_cpu_flex_ratio_min SYSCTL_HANDLER_ARGS
133 {
134 __unused struct sysctl_oid *unused_oidp = oidp;
135 __unused void *unused_arg1 = arg1;
136 __unused int unused_arg2 = arg2;
137 i386_cpu_info_t *cpu_info = cpuid_info();
138
139 if (cpu_info->cpuid_model != 26)
140 return ENOENT;
141
142 return SYSCTL_OUT(req, &flex_ratio_min, sizeof(flex_ratio_min));
143 }
144
145 static int
146 hw_cpu_flex_ratio_max SYSCTL_HANDLER_ARGS
147 {
148 __unused struct sysctl_oid *unused_oidp = oidp;
149 __unused void *unused_arg1 = arg1;
150 __unused int unused_arg2 = arg2;
151 i386_cpu_info_t *cpu_info = cpuid_info();
152
153 if (cpu_info->cpuid_model != 26)
154 return ENOENT;
155
156 return SYSCTL_OUT(req, &flex_ratio_max, sizeof(flex_ratio_max));
157 }
158
159 SYSCTL_NODE(_machdep, OID_AUTO, cpu, CTLFLAG_RW|CTLFLAG_LOCKED, 0,
160 "CPU info");
161
162 SYSCTL_PROC(_machdep_cpu, OID_AUTO, max_basic, CTLTYPE_INT | CTLFLAG_RD,
163 (void *)offsetof(i386_cpu_info_t, cpuid_max_basic),sizeof(uint32_t),
164 hw_cpu_sysctl, "IU", "Max Basic Information value");
165
166 SYSCTL_PROC(_machdep_cpu, OID_AUTO, max_ext, CTLTYPE_INT | CTLFLAG_RD,
167 (void *)offsetof(i386_cpu_info_t, cpuid_max_ext), sizeof(uint32_t),
168 hw_cpu_sysctl, "IU", "Max Extended Function Information value");
169
170 SYSCTL_PROC(_machdep_cpu, OID_AUTO, vendor, CTLTYPE_STRING | CTLFLAG_RD,
171 (void *)offsetof(i386_cpu_info_t, cpuid_vendor), 0,
172 hw_cpu_sysctl, "A", "CPU vendor");
173
174 SYSCTL_PROC(_machdep_cpu, OID_AUTO, brand_string, CTLTYPE_STRING | CTLFLAG_RD,
175 (void *)offsetof(i386_cpu_info_t, cpuid_brand_string), 0,
176 hw_cpu_sysctl, "A", "CPU brand string");
177
178 SYSCTL_PROC(_machdep_cpu, OID_AUTO, family, CTLTYPE_INT | CTLFLAG_RD,
179 (void *)offsetof(i386_cpu_info_t, cpuid_family), sizeof(uint8_t),
180 hw_cpu_sysctl, "I", "CPU family");
181
182 SYSCTL_PROC(_machdep_cpu, OID_AUTO, model, CTLTYPE_INT | CTLFLAG_RD,
183 (void *)offsetof(i386_cpu_info_t, cpuid_model), sizeof(uint8_t),
184 hw_cpu_sysctl, "I", "CPU model");
185
186 SYSCTL_PROC(_machdep_cpu, OID_AUTO, extmodel, CTLTYPE_INT | CTLFLAG_RD,
187 (void *)offsetof(i386_cpu_info_t, cpuid_extmodel), sizeof(uint8_t),
188 hw_cpu_sysctl, "I", "CPU extended model");
189
190 SYSCTL_PROC(_machdep_cpu, OID_AUTO, extfamily, CTLTYPE_INT | CTLFLAG_RD,
191 (void *)offsetof(i386_cpu_info_t, cpuid_extfamily), sizeof(uint8_t),
192 hw_cpu_sysctl, "I", "CPU extended family");
193
194 SYSCTL_PROC(_machdep_cpu, OID_AUTO, stepping, CTLTYPE_INT | CTLFLAG_RD,
195 (void *)offsetof(i386_cpu_info_t, cpuid_stepping), sizeof(uint8_t),
196 hw_cpu_sysctl, "I", "CPU stepping");
197
198 SYSCTL_PROC(_machdep_cpu, OID_AUTO, feature_bits, CTLTYPE_QUAD | CTLFLAG_RD,
199 (void *)offsetof(i386_cpu_info_t, cpuid_features), sizeof(uint64_t),
200 hw_cpu_sysctl, "IU", "CPU features");
201
202 SYSCTL_PROC(_machdep_cpu, OID_AUTO, extfeature_bits, CTLTYPE_QUAD | CTLFLAG_RD,
203 (void *)offsetof(i386_cpu_info_t, cpuid_extfeatures), sizeof(uint64_t),
204 hw_cpu_sysctl, "IU", "CPU extended features");
205
206 SYSCTL_PROC(_machdep_cpu, OID_AUTO, signature, CTLTYPE_INT | CTLFLAG_RD,
207 (void *)offsetof(i386_cpu_info_t, cpuid_signature), sizeof(uint32_t),
208 hw_cpu_sysctl, "I", "CPU signature");
209
210 SYSCTL_PROC(_machdep_cpu, OID_AUTO, brand, CTLTYPE_INT | CTLFLAG_RD,
211 (void *)offsetof(i386_cpu_info_t, cpuid_brand), sizeof(uint8_t),
212 hw_cpu_sysctl, "I", "CPU brand");
213
214 SYSCTL_PROC(_machdep_cpu, OID_AUTO, features, CTLTYPE_STRING | CTLFLAG_RD,
215 0, 0,
216 hw_cpu_features, "A", "CPU feature names");
217
218 SYSCTL_PROC(_machdep_cpu, OID_AUTO, extfeatures, CTLTYPE_STRING | CTLFLAG_RD,
219 0, 0,
220 hw_cpu_extfeatures, "A", "CPU extended feature names");
221
222 SYSCTL_PROC(_machdep_cpu, OID_AUTO, logical_per_package,
223 CTLTYPE_INT | CTLFLAG_RD,
224 0, 0,
225 hw_cpu_logical_per_package, "I", "CPU logical cpus per package");
226
227 SYSCTL_PROC(_machdep_cpu, OID_AUTO, cores_per_package,
228 CTLTYPE_INT | CTLFLAG_RD,
229 (void *)offsetof(i386_cpu_info_t, cpuid_cores_per_package),
230 sizeof(uint32_t),
231 hw_cpu_sysctl, "I", "CPU cores per package");
232
233 SYSCTL_PROC(_machdep_cpu, OID_AUTO, microcode_version,
234 CTLTYPE_INT | CTLFLAG_RD,
235 (void *)offsetof(i386_cpu_info_t, cpuid_microcode_version),
236 sizeof(uint32_t),
237 hw_cpu_sysctl, "I", "Microcode version number");
238
239
240 SYSCTL_NODE(_machdep_cpu, OID_AUTO, mwait, CTLFLAG_RW|CTLFLAG_LOCKED, 0,
241 "mwait");
242
243 SYSCTL_PROC(_machdep_cpu_mwait, OID_AUTO, linesize_min,
244 CTLTYPE_INT | CTLFLAG_RD,
245 (void *)offsetof(i386_cpu_info_t, cpuid_mwait_linesize_min),
246 sizeof(uint32_t),
247 hw_cpu_sysctl, "I", "Monitor/mwait minimum line size");
248
249 SYSCTL_PROC(_machdep_cpu_mwait, OID_AUTO, linesize_max,
250 CTLTYPE_INT | CTLFLAG_RD,
251 (void *)offsetof(i386_cpu_info_t, cpuid_mwait_linesize_max),
252 sizeof(uint32_t),
253 hw_cpu_sysctl, "I", "Monitor/mwait maximum line size");
254
255 SYSCTL_PROC(_machdep_cpu_mwait, OID_AUTO, extensions,
256 CTLTYPE_INT | CTLFLAG_RD,
257 (void *)offsetof(i386_cpu_info_t, cpuid_mwait_extensions),
258 sizeof(uint32_t),
259 hw_cpu_sysctl, "I", "Monitor/mwait extensions");
260
261 SYSCTL_PROC(_machdep_cpu_mwait, OID_AUTO, sub_Cstates,
262 CTLTYPE_INT | CTLFLAG_RD,
263 (void *)offsetof(i386_cpu_info_t, cpuid_mwait_sub_Cstates),
264 sizeof(uint32_t),
265 hw_cpu_sysctl, "I", "Monitor/mwait sub C-states");
266
267
268 SYSCTL_NODE(_machdep_cpu, OID_AUTO, thermal, CTLFLAG_RW|CTLFLAG_LOCKED, 0,
269 "thermal");
270
271 SYSCTL_PROC(_machdep_cpu_thermal, OID_AUTO, sensor,
272 CTLTYPE_INT | CTLFLAG_RD,
273 (void *)offsetof(i386_cpu_info_t, cpuid_thermal_sensor),
274 sizeof(boolean_t),
275 hw_cpu_sysctl, "I", "Thermal sensor present");
276
277 SYSCTL_PROC(_machdep_cpu_thermal, OID_AUTO, dynamic_acceleration,
278 CTLTYPE_INT | CTLFLAG_RD,
279 (void *)offsetof(i386_cpu_info_t, cpuid_thermal_dynamic_acceleration),
280 sizeof(boolean_t),
281 hw_cpu_sysctl, "I", "Dynamic Acceleration Technology");
282
283 SYSCTL_PROC(_machdep_cpu_thermal, OID_AUTO, thresholds,
284 CTLTYPE_INT | CTLFLAG_RD,
285 (void *)offsetof(i386_cpu_info_t, cpuid_thermal_thresholds),
286 sizeof(uint32_t),
287 hw_cpu_sysctl, "I", "Number of interrupt thresholds");
288
289 SYSCTL_PROC(_machdep_cpu_thermal, OID_AUTO, ACNT_MCNT,
290 CTLTYPE_INT | CTLFLAG_RD,
291 (void *)offsetof(i386_cpu_info_t, cpuid_thermal_ACNT_MCNT),
292 sizeof(boolean_t),
293 hw_cpu_sysctl, "I", "ACNT_MCNT capability");
294
295
296 SYSCTL_NODE(_machdep_cpu, OID_AUTO, arch_perf, CTLFLAG_RW|CTLFLAG_LOCKED, 0,
297 "arch_perf");
298
299 SYSCTL_PROC(_machdep_cpu_arch_perf, OID_AUTO, version,
300 CTLTYPE_INT | CTLFLAG_RD,
301 (void *)offsetof(i386_cpu_info_t, cpuid_arch_perf_version),
302 sizeof(uint8_t),
303 hw_cpu_sysctl, "I", "Architectural Performance Version Number");
304
305 SYSCTL_PROC(_machdep_cpu_arch_perf, OID_AUTO, number,
306 CTLTYPE_INT | CTLFLAG_RD,
307 (void *)offsetof(i386_cpu_info_t, cpuid_arch_perf_number),
308 sizeof(uint8_t),
309 hw_cpu_sysctl, "I", "Number of counters per logical cpu");
310
311 SYSCTL_PROC(_machdep_cpu_arch_perf, OID_AUTO, width,
312 CTLTYPE_INT | CTLFLAG_RD,
313 (void *)offsetof(i386_cpu_info_t, cpuid_arch_perf_width),
314 sizeof(uint8_t),
315 hw_cpu_sysctl, "I", "Bit width of counters");
316
317 SYSCTL_PROC(_machdep_cpu_arch_perf, OID_AUTO, events_number,
318 CTLTYPE_INT | CTLFLAG_RD,
319 (void *)offsetof(i386_cpu_info_t, cpuid_arch_perf_events_number),
320 sizeof(uint8_t),
321 hw_cpu_sysctl, "I", "Number of monitoring events");
322
323 SYSCTL_PROC(_machdep_cpu_arch_perf, OID_AUTO, events,
324 CTLTYPE_INT | CTLFLAG_RD,
325 (void *)offsetof(i386_cpu_info_t, cpuid_arch_perf_events),
326 sizeof(uint32_t),
327 hw_cpu_sysctl, "I", "Bit vector of events");
328
329 SYSCTL_PROC(_machdep_cpu_arch_perf, OID_AUTO, fixed_number,
330 CTLTYPE_INT | CTLFLAG_RD,
331 (void *)offsetof(i386_cpu_info_t, cpuid_arch_perf_fixed_number),
332 sizeof(uint8_t),
333 hw_cpu_sysctl, "I", "Number of fixed-function counters");
334
335 SYSCTL_PROC(_machdep_cpu_arch_perf, OID_AUTO, fixed_width,
336 CTLTYPE_INT | CTLFLAG_RD,
337 (void *)offsetof(i386_cpu_info_t, cpuid_arch_perf_fixed_width),
338 sizeof(uint8_t),
339 hw_cpu_sysctl, "I", "Bit-width of fixed-function counters");
340
341
342 SYSCTL_NODE(_machdep_cpu, OID_AUTO, cache, CTLFLAG_RW|CTLFLAG_LOCKED, 0,
343 "cache");
344
345 SYSCTL_PROC(_machdep_cpu_cache, OID_AUTO, linesize,
346 CTLTYPE_INT | CTLFLAG_RD,
347 (void *)offsetof(i386_cpu_info_t, cpuid_cache_linesize),
348 sizeof(uint32_t),
349 hw_cpu_sysctl, "I", "Cacheline size");
350
351 SYSCTL_PROC(_machdep_cpu_cache, OID_AUTO, L2_associativity,
352 CTLTYPE_INT | CTLFLAG_RD,
353 (void *)offsetof(i386_cpu_info_t, cpuid_cache_L2_associativity),
354 sizeof(uint32_t),
355 hw_cpu_sysctl, "I", "L2 cache associativity");
356
357 SYSCTL_PROC(_machdep_cpu_cache, OID_AUTO, size,
358 CTLTYPE_INT | CTLFLAG_RD,
359 (void *)offsetof(i386_cpu_info_t, cpuid_cache_size),
360 sizeof(uint32_t),
361 hw_cpu_sysctl, "I", "Cache size (in Kbytes)");
362
363
364 SYSCTL_NODE(_machdep_cpu, OID_AUTO, tlb, CTLFLAG_RW|CTLFLAG_LOCKED, 0,
365 "tlb");
366 SYSCTL_NODE(_machdep_cpu_tlb, OID_AUTO, inst, CTLFLAG_RW|CTLFLAG_LOCKED, 0,
367 "inst");
368 SYSCTL_NODE(_machdep_cpu_tlb, OID_AUTO, data, CTLFLAG_RW|CTLFLAG_LOCKED, 0,
369 "data");
370
371 SYSCTL_PROC(_machdep_cpu_tlb_inst, OID_AUTO, small,
372 CTLTYPE_INT | CTLFLAG_RD,
373 (void *)offsetof(i386_cpu_info_t,
374 cpuid_tlb[TLB_INST][TLB_SMALL][0]),
375 sizeof(uint32_t),
376 hw_cpu_sysctl_nonzero, "I",
377 "Number of small page instruction TLBs");
378
379 SYSCTL_PROC(_machdep_cpu_tlb_data, OID_AUTO, small,
380 CTLTYPE_INT | CTLFLAG_RD,
381 (void *)offsetof(i386_cpu_info_t,
382 cpuid_tlb[TLB_DATA][TLB_SMALL][0]),
383 sizeof(uint32_t),
384 hw_cpu_sysctl_nonzero, "I",
385 "Number of small page data TLBs (1st level)");
386
387 SYSCTL_PROC(_machdep_cpu_tlb_data, OID_AUTO, small_level1,
388 CTLTYPE_INT | CTLFLAG_RD,
389 (void *)offsetof(i386_cpu_info_t,
390 cpuid_tlb[TLB_DATA][TLB_SMALL][1]),
391 sizeof(uint32_t),
392 hw_cpu_sysctl_nonzero, "I",
393 "Number of small page data TLBs (2nd level)");
394
395 SYSCTL_PROC(_machdep_cpu_tlb_inst, OID_AUTO, large,
396 CTLTYPE_INT | CTLFLAG_RD,
397 (void *)offsetof(i386_cpu_info_t,
398 cpuid_tlb[TLB_INST][TLB_LARGE][0]),
399 sizeof(uint32_t),
400 hw_cpu_sysctl_nonzero, "I",
401 "Number of large page instruction TLBs");
402
403 SYSCTL_PROC(_machdep_cpu_tlb_data, OID_AUTO, large,
404 CTLTYPE_INT | CTLFLAG_RD,
405 (void *)offsetof(i386_cpu_info_t,
406 cpuid_tlb[TLB_DATA][TLB_LARGE][0]),
407 sizeof(uint32_t),
408 hw_cpu_sysctl_nonzero, "I",
409 "Number of large page data TLBs (1st level)");
410
411 SYSCTL_PROC(_machdep_cpu_tlb_data, OID_AUTO, large_level1,
412 CTLTYPE_INT | CTLFLAG_RD,
413 (void *)offsetof(i386_cpu_info_t,
414 cpuid_tlb[TLB_DATA][TLB_LARGE][1]),
415 sizeof(uint32_t),
416 hw_cpu_sysctl_nonzero, "I",
417 "Number of large page data TLBs (2nd level)");
418
419 SYSCTL_PROC(_machdep_cpu_tlb, OID_AUTO, shared,
420 CTLTYPE_INT | CTLFLAG_RD,
421 (void *)offsetof(i386_cpu_info_t, cpuid_stlb),
422 sizeof(uint32_t),
423 hw_cpu_sysctl_nonzero, "I",
424 "Number of shared TLBs");
425
426
427 SYSCTL_NODE(_machdep_cpu, OID_AUTO, address_bits, CTLFLAG_RW|CTLFLAG_LOCKED, 0,
428 "address_bits");
429
430 SYSCTL_PROC(_machdep_cpu_address_bits, OID_AUTO, physical,
431 CTLTYPE_INT | CTLFLAG_RD,
432 (void *)offsetof(i386_cpu_info_t, cpuid_address_bits_physical),
433 sizeof(uint32_t),
434 hw_cpu_sysctl, "I", "Number of physical address bits");
435
436 SYSCTL_PROC(_machdep_cpu_address_bits, OID_AUTO, virtual,
437 CTLTYPE_INT | CTLFLAG_RD,
438 (void *)offsetof(i386_cpu_info_t, cpuid_address_bits_virtual),
439 sizeof(uint32_t),
440 hw_cpu_sysctl, "I", "Number of virtual address bits");
441
442
443 SYSCTL_PROC(_machdep_cpu, OID_AUTO, core_count,
444 CTLTYPE_INT | CTLFLAG_RD,
445 (void *)offsetof(i386_cpu_info_t, core_count),
446 sizeof(uint32_t),
447 hw_cpu_sysctl, "I", "Number of enabled cores per package");
448
449 SYSCTL_PROC(_machdep_cpu, OID_AUTO, thread_count,
450 CTLTYPE_INT | CTLFLAG_RD,
451 (void *)offsetof(i386_cpu_info_t, thread_count),
452 sizeof(uint32_t),
453 hw_cpu_sysctl, "I", "Number of enabled threads per package");
454
455 SYSCTL_NODE(_machdep_cpu, OID_AUTO, flex_ratio, CTLFLAG_RW|CTLFLAG_LOCKED, 0,
456 "Flex ratio");
457
458 SYSCTL_PROC(_machdep_cpu_flex_ratio, OID_AUTO, desired,
459 CTLTYPE_INT | CTLFLAG_RD,
460 0, 0,
461 hw_cpu_flex_ratio_desired, "I", "Flex ratio desired (0 disabled)");
462
463 SYSCTL_PROC(_machdep_cpu_flex_ratio, OID_AUTO, min,
464 CTLTYPE_INT | CTLFLAG_RD,
465 0, 0,
466 hw_cpu_flex_ratio_min, "I", "Flex ratio min (efficiency)");
467
468 SYSCTL_PROC(_machdep_cpu_flex_ratio, OID_AUTO, max,
469 CTLTYPE_INT | CTLFLAG_RD,
470 0, 0,
471 hw_cpu_flex_ratio_max, "I", "Flex ratio max (non-turbo)");
472
473 uint64_t pmap_pv_hashlist_walks;
474 uint64_t pmap_pv_hashlist_cnts;
475 uint32_t pmap_pv_hashlist_max;
476 uint32_t pmap_kernel_text_ps = PAGE_SIZE;
477
478 /*extern struct sysctl_oid_list sysctl__machdep_pmap_children;*/
479
480 SYSCTL_NODE(_machdep, OID_AUTO, pmap, CTLFLAG_RW|CTLFLAG_LOCKED, 0,
481 "PMAP info");
482
483 SYSCTL_QUAD (_machdep_pmap, OID_AUTO, hashwalks, CTLFLAG_RD | CTLFLAG_KERN, &pmap_pv_hashlist_walks, "");
484 SYSCTL_QUAD (_machdep_pmap, OID_AUTO, hashcnts, CTLFLAG_RD | CTLFLAG_KERN, &pmap_pv_hashlist_cnts, "");
485 SYSCTL_INT (_machdep_pmap, OID_AUTO, hashmax, CTLFLAG_RD | CTLFLAG_KERN, &pmap_pv_hashlist_max, 0, "");
486 SYSCTL_INT (_machdep_pmap, OID_AUTO, kernel_text_ps, CTLFLAG_RD | CTLFLAG_KERN, &pmap_kernel_text_ps, 0, "");
487
488 SYSCTL_NODE(_machdep, OID_AUTO, memmap, CTLFLAG_RD|CTLFLAG_LOCKED, NULL, "physical memory map");
489
490 uint64_t firmware_Conventional_bytes = 0;
491 uint64_t firmware_RuntimeServices_bytes = 0;
492 uint64_t firmware_ACPIReclaim_bytes = 0;
493 uint64_t firmware_ACPINVS_bytes = 0;
494 uint64_t firmware_PalCode_bytes = 0;
495 uint64_t firmware_Reserved_bytes = 0;
496 uint64_t firmware_Unusable_bytes = 0;
497 uint64_t firmware_other_bytes = 0;
498
499 SYSCTL_QUAD(_machdep_memmap, OID_AUTO, Conventional, CTLFLAG_RD|CTLFLAG_LOCKED, &firmware_Conventional_bytes, "");
500 SYSCTL_QUAD(_machdep_memmap, OID_AUTO, RuntimeServices, CTLFLAG_RD|CTLFLAG_LOCKED, &firmware_RuntimeServices_bytes, "");
501 SYSCTL_QUAD(_machdep_memmap, OID_AUTO, ACPIReclaim, CTLFLAG_RD|CTLFLAG_LOCKED, &firmware_ACPIReclaim_bytes, "");
502 SYSCTL_QUAD(_machdep_memmap, OID_AUTO, ACPINVS, CTLFLAG_RD|CTLFLAG_LOCKED, &firmware_ACPINVS_bytes, "");
503 SYSCTL_QUAD(_machdep_memmap, OID_AUTO, PalCode, CTLFLAG_RD|CTLFLAG_LOCKED, &firmware_PalCode_bytes, "");
504 SYSCTL_QUAD(_machdep_memmap, OID_AUTO, Reserved, CTLFLAG_RD|CTLFLAG_LOCKED, &firmware_Reserved_bytes, "");
505 SYSCTL_QUAD(_machdep_memmap, OID_AUTO, Unusable, CTLFLAG_RD|CTLFLAG_LOCKED, &firmware_Unusable_bytes, "");
506 SYSCTL_QUAD(_machdep_memmap, OID_AUTO, Other, CTLFLAG_RD|CTLFLAG_LOCKED, &firmware_other_bytes, "");