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>
12 .section ".jump", "ax"
18 /* This should match the structure in wakeup.h */
19 .section ".header", "a"
22 video_mode: .short 0 /* Video mode number */
23 pmode_return: .byte 0x66, 0xea /* ljmpl */
24 .long 0 /* offset goes here */
26 pmode_cr0: .long 0 /* Saved %cr0 */
27 pmode_cr3: .long 0 /* Saved %cr3 */
28 pmode_cr4: .long 0 /* Saved %cr4 */
29 pmode_efer: .quad 0 /* Saved EFER */
31 realmode_flags: .long 0
33 trampoline_segment: .word 0
35 wakeup_jmp: .byte 0xea /* ljmpw */
36 wakeup_jmp_off: .word 3f
37 wakeup_jmp_seg: .word 0
38 wakeup_gdt: .quad 0, 0, 0
39 signature: .long WAKEUP_HEADER_SIGNATURE
46 /* Apparently some dimwit BIOS programmers don't know how to
47 program a PM to RM transition, and we might end up here with
48 junk in the data segment descriptor registers. The only way
49 to repair that is to go into PM and fix it ourselves... */
64 andb $~X86_CR0_PE, %al
75 movl $wakeup_stack_end, %esp
77 /* Clear the EFLAGS */
81 /* Check header signature... */
83 cmpl $WAKEUP_HEADER_SIGNATURE, %eax
86 /* Check we really have everything... */
87 movl end_signature, %eax
88 cmpl $WAKEUP_END_SIGNATURE, %eax
94 /* Do any other stuff... */
97 /* This could also be done in C code... */
105 movl pmode_efer, %eax
106 movl pmode_efer + 4, %edx
116 /* This really couldn't... */
122 pushw trampoline_segment
135 /* This is the standard real-mode IDT */
137 .word 0xffff /* limit */
138 .long 0 /* address */
141 .globl HEAP, heap_end
154 .section ".signature","a"
156 .long WAKEUP_END_SIGNATURE