- /*
- * Save master CPU state and sleep platform.
- * Will not return until platform is woken up,
- * or if sleep failed.
- */
+ /* Save HPET state */
+ hpet_save();
+
+ /*
+ * If we're in 64-bit mode, drop back into legacy mode during sleep.
+ */
+ if (cpu_mode_is64bit()) {
+ cpu_IA32e_disable(current_cpu_datap());
+ kprintf("acpi_sleep_kernel legacy mode re-entered\n");
+ }
+
+ /*
+ * Save master CPU state and sleep platform.
+ * Will not return until platform is woken up,
+ * or if sleep failed.
+ */