-
-/*
- * Set the worst-case time for the C4 to C2 transition.
- * The maxdelay parameter is in nanoseconds.
- */
-
-void
-ml_set_maxsnoop(uint32_t maxdelay)
-{
- C4C2SnoopDelay = maxdelay; /* Set the transition time */
- machine_nap_policy(); /* Adjust the current nap state */
-}
-
-
-/*
- * Get the worst-case time for the C4 to C2 transition. Returns nanoseconds.
- */
-
-unsigned
-ml_get_maxsnoop(void)
-{
- return C4C2SnoopDelay; /* Set the transition time */
-}
-
-
-uint32_t
-ml_get_maxbusdelay(void)
-{
- return maxBusDelay;
-}
-
-/*
- * Set the maximum delay time allowed for snoop on the bus.
- *
- * Note that this value will be compared to the amount of time that it takes
- * to transition from a non-snooping power state (C4) to a snooping state (C2).
- * If maxBusDelay is less than C4C2SnoopDelay,
- * we will not enter the lowest power state.
- */
-
-void
-ml_set_maxbusdelay(uint32_t mdelay)
-{
- maxBusDelay = mdelay; /* Set the delay */
- machine_nap_policy(); /* Adjust the current nap state */
-}
-
-
-boolean_t ml_is64bit(void) {
-
- return (cpu_mode_is64bit());
-}
-
-
-boolean_t ml_thread_is64bit(thread_t thread) {
-
- return (thread_is_64bit(thread));
-}
-
-
-boolean_t ml_state_is64bit(void *saved_state) {
-
- return is_saved_state64(saved_state);
-}
-
-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);
-}
-
-#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