2 * ACPI wakeup real mode startup stub
4 #include <asm/segment.h>
5 #include <asm/msr-index.h>
6 #include <asm/page_types.h>
7 #include <asm/pgtable_types.h>
8 #include <asm/processor-flags.h>
11 .section ".header", "a"
13 /* This should match the structure in wakeup.h */
16 video_mode: .short 0 /* Video mode number */
17 pmode_return: .byte 0x66, 0xea /* ljmpl */
18 .long 0 /* offset goes here */
20 pmode_cr0: .long 0 /* Saved %cr0 */
21 pmode_cr3: .long 0 /* Saved %cr3 */
22 pmode_cr4: .long 0 /* Saved %cr4 */
23 pmode_efer: .quad 0 /* Saved EFER */
25 realmode_flags: .long 0
27 trampoline_segment: .word 0
29 wakeup_jmp: .byte 0xea /* ljmpw */
30 wakeup_jmp_off: .word 3f
31 wakeup_jmp_seg: .word 0
32 wakeup_gdt: .quad 0, 0, 0
33 signature: .long 0x51ee1111
43 /* Apparently some dimwit BIOS programmers don't know how to
44 program a PM to RM transition, and we might end up here with
45 junk in the data segment descriptor registers. The only way
46 to repair that is to go into PM and fix it ourselves... */
61 andb $~X86_CR0_PE, %al
72 movl $wakeup_stack_end, %esp
74 /* Clear the EFLAGS */
78 /* Check header signature... */
80 cmpl $0x51ee1111, %eax
83 /* Check we really have everything... */
84 movl end_signature, %eax
85 cmpl $0x65a22c82, %eax
91 /* Do any other stuff... */
94 /* This could also be done in C code... */
102 movl pmode_efer, %eax
103 movl pmode_efer + 4, %edx
107 movl $0xc0000080, %ecx
113 /* This really couldn't... */
119 pushw trampoline_segment
132 /* This is the standard real-mode IDT */
134 .word 0xffff /* limit */
135 .long 0 /* address */
138 .globl HEAP, heap_end