#include <i386/cpuid.h>
#include <i386/tsc.h>
#include <i386/machine_routines.h>
+#include <i386/pal_routines.h>
#include <i386/ucode.h>
#include <kern/clock.h>
#include <libkern/libkern.h>
#include <i386/lapic.h>
+#include <i386/pmCPU.h>
+
static int
_i386_cpu_info SYSCTL_HANDLER_ARGS
CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_LOCKED,
(void *)offsetof(cpuid_thermal_leaf_t, package_thermal_intr),
sizeof(boolean_t),
- cpu_thermal, "I", "Packge Thermal interrupt and Status");
+ cpu_thermal, "I", "Package Thermal interrupt and Status");
SYSCTL_PROC(_machdep_cpu_thermal, OID_AUTO, hardware_feedback,
CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_LOCKED,
SYSCTL_NODE(_machdep, OID_AUTO, tsc, CTLFLAG_RD|CTLFLAG_LOCKED, NULL, "Timestamp counter parameters");
-SYSCTL_QUAD(_machdep_tsc, OID_AUTO, frequency, CTLFLAG_RD|CTLFLAG_LOCKED, &tscFreq, "");
+SYSCTL_QUAD(_machdep_tsc, OID_AUTO, frequency,
+ CTLFLAG_RD|CTLFLAG_LOCKED, &tscFreq, "");
+
+extern uint32_t deep_idle_rebase;
+SYSCTL_UINT(_machdep_tsc, OID_AUTO, deep_idle_rebase,
+ CTLFLAG_RW|CTLFLAG_KERN|CTLFLAG_LOCKED, &deep_idle_rebase, 0, "");
+
+SYSCTL_NODE(_machdep_tsc, OID_AUTO, nanotime,
+ CTLFLAG_RD|CTLFLAG_LOCKED, NULL, "TSC to ns conversion");
+SYSCTL_QUAD(_machdep_tsc_nanotime, OID_AUTO, tsc_base,
+ CTLFLAG_RD | CTLFLAG_LOCKED,
+ (uint64_t *) &pal_rtc_nanotime_info.tsc_base, "");
+SYSCTL_QUAD(_machdep_tsc_nanotime, OID_AUTO, ns_base,
+ CTLFLAG_RD | CTLFLAG_LOCKED,
+ (uint64_t *)&pal_rtc_nanotime_info.ns_base, "");
+SYSCTL_UINT(_machdep_tsc_nanotime, OID_AUTO, scale,
+ CTLFLAG_RD | CTLFLAG_LOCKED,
+ (uint32_t *)&pal_rtc_nanotime_info.scale, 0, "");
+SYSCTL_UINT(_machdep_tsc_nanotime, OID_AUTO, shift,
+ CTLFLAG_RD | CTLFLAG_LOCKED,
+ (uint32_t *)&pal_rtc_nanotime_info.shift, 0, "");
+SYSCTL_UINT(_machdep_tsc_nanotime, OID_AUTO, generation,
+ CTLFLAG_RD | CTLFLAG_LOCKED,
+ (uint32_t *)&pal_rtc_nanotime_info.generation, 0, "");
SYSCTL_NODE(_machdep, OID_AUTO, misc, CTLFLAG_RW|CTLFLAG_LOCKED, 0,
"Miscellaneous x86 kernel parameters");