- current_cpu_datap()->cpu_hibernate = 0;
- did_hibernate = TRUE;
-
- } else {
- did_hibernate = FALSE;
- }
-
- /* Re-enable 64-bit mode if necessary. */
- if (cpu_mode_is64bit()) {
- cpu_IA32e_enable(current_cpu_datap());
- cpu_desc_load64(current_cpu_datap());
- kprintf("acpi_sleep_kernel 64-bit mode re-enabled\n");
- fast_syscall_init64();
- } else {
- fast_syscall_init();
- }
-
- /* Re-enable machine check handling */
- mca_cpu_init();
-
- /* restore MTRR settings */
- mtrr_update_cpu();
-
- /* set up PAT following boot processor power up */
- pat_init();
-
- if (did_hibernate) {
- hibernate_machine_init();
- }
-
- /* re-enable and re-init local apic */
- if (lapic_probe())
- lapic_init();
-
- /* Restore HPET state */
- hpet_restore();
-
- /* let the realtime clock reset */
- rtc_sleep_wakeup();
-
- fpinit();
- clear_fpu();
-
- if (did_hibernate) {
- enable_preemption();
- }
+
+ /* Re-enable mode (including 64-bit if applicable) */
+ cpu_mode_init(current_cpu_datap());
+
+ /* Re-enable machine check handling */
+ mca_cpu_init();
+
+ /* restore MTRR settings */
+ mtrr_update_cpu();
+
+ /*
+ * Restore VT mode
+ */
+ vmx_resume();
+
+ /* set up PAT following boot processor power up */
+ pat_init();
+
+ /* let the realtime clock reset */
+ rtc_sleep_wakeup(acpi_sleep_abstime);
+
+ if (did_hibernate)
+ hibernate_machine_init();
+
+ /* re-enable and re-init local apic */
+ if (lapic_probe())
+ lapic_init();
+
+ /* Restore HPET state */
+ hpet_restore();
+
+ /* Restart tick interrupts from the LAPIC timer */
+ rtc_lapic_start_ticking();
+
+ fpinit();
+ clear_fpu();
+
+#if HIBERNATION
+ if (did_hibernate)
+ enable_preemption();
+
+ kprintf("ret from acpi_sleep_cpu hib=%d\n", did_hibernate);
+#endif