+
+void ml_cpu_set_ldt(int selector)
+{
+ /*
+ * Avoid loading the LDT
+ * if we're setting the KERNEL LDT and it's already set.
+ */
+ if (selector == KERNEL_LDT &&
+ current_cpu_datap()->cpu_ldt == KERNEL_LDT)
+ return;
+
+ /*
+ * If 64bit this requires a mode switch (and back).
+ */
+ if (cpu_mode_is64bit())
+ ml_64bit_lldt(selector);
+ else
+ lldt(selector);
+ current_cpu_datap()->cpu_ldt = selector;
+}
+
+void ml_fp_setvalid(boolean_t value)
+{
+ fp_setvalid(value);
+}
+
+uint64_t ml_cpu_int_event_time(void)
+{
+ return current_cpu_datap()->cpu_int_event_time;
+}
+
+
+#if MACH_KDB
+
+/*
+ * Display the global msrs
+ * *
+ * ms
+ */
+void
+db_msr(__unused db_expr_t addr,
+ __unused int have_addr,
+ __unused db_expr_t count,
+ __unused char *modif)
+{
+
+ uint32_t i, msrlow, msrhigh;
+
+ /* Try all of the first 4096 msrs */
+ for (i = 0; i < 4096; i++) {
+ if (!rdmsr_carefully(i, &msrlow, &msrhigh)) {
+ db_printf("%08X - %08X.%08X\n", i, msrhigh, msrlow);
+ }
+ }
+
+ /* Try all of the 4096 msrs at 0x0C000000 */
+ for (i = 0; i < 4096; i++) {
+ if (!rdmsr_carefully(0x0C000000 | i, &msrlow, &msrhigh)) {
+ db_printf("%08X - %08X.%08X\n",
+ 0x0C000000 | i, msrhigh, msrlow);
+ }
+ }
+
+ /* Try all of the 4096 msrs at 0xC0000000 */
+ for (i = 0; i < 4096; i++) {
+ if (!rdmsr_carefully(0xC0000000 | i, &msrlow, &msrhigh)) {
+ db_printf("%08X - %08X.%08X\n",
+ 0xC0000000 | i, msrhigh, msrlow);
+ }
+ }
+}
+
+#endif