-#define LJMP(segment, address) \
- .byte 0xea ;\
- .long address - EXT(acpi_wake_start) ;\
- .word segment
-
-#define PA(addr) ((addr)-KERNELBASE)
-
-/*
- * acpi_wake_start
- *
- * The code from acpi_wake_start to acpi_wake_end is copied to
- * memory below 1MB. The firmware waking vector is updated to
- * point at acpi_wake_start in low memory before sleeping.
- */
-
-ENTRY(acpi_wake_start)
- /*
- * CPU woke up from sleep, and is back in real mode.
- * Initialize it just enough to get back to protected mode.
- */
- cli
-
- POSTCODE(ACPI_WAKE_START_ENTRY)
-
- /* set up DS to match CS */
- movw %cs, %ax
- movw %ax, %ds
-
- /*
- * Must initialize GDTR before entering protected mode.
- * Use a temporary GDT that is 0 based, 4GB limit, code and data.
- * Restoring the actual GDT will come later.
- */
- addr16
- data16
- lgdt EXT(acpi_gdtr) - EXT(acpi_wake_start)
-
- /* set CR0.PE to enter protected mode */
- mov %cr0, %eax
- data16
- or $(CR0_PE), %eax
- mov %eax, %cr0
-
- /*
- * Make intra-segment jump to flush pipeline and reload CS register.
- * If GDT is bogus, it will blow up here.
- */
- data16
- LJMP(0x8, acpi_wake_prot + ACPI_WAKE_ADDR)