Lines Matching +full:suspend +full:- +full:to +full:- +full:ram

1 /*-
5 * Copyright (c) 2008-2012 Jung-uk Kim <jkim@FreeBSD.org>
18 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
40 * If XFirmwareWakingVector is zero and FirmwareWakingVector is non-zero
41 * in FACS, the BIOS enters here in real mode after POST with CS set to
42 * (FirmwareWakingVector >> 4) and IP set to (FirmwareWakingVector & 0xf).
43 * Depending on the previous sleep state, we may need to initialize more
44 * of the system (i.e., S3 suspend-to-RAM vs. S4 suspend-to-disk).
46 * Note: If XFirmwareWakingVector is non-zero, it should disable address
48 * a flat 4 GB address space, and set EFLAGS.IF to zero. Currently
62 mov %cs, %ax /* copy %cs to %ds. Remember these */
70 /* To debug resume hangs, beep the speaker if the user requested. */
71 testb $~0, resume_beep - wakeup_start
73 movb $0, resume_beep - wakeup_start
75 /* Set PIC timer2 to beep. */
91 /* Re-initialize video BIOS if the reset_video tunable is set. */
92 testb $~0, reset_video - wakeup_start
94 movb $0, reset_video - wakeup_start
102 /* Re-start in case the previous BIOS call clobbers them. */
115 * in 16-bit protected mode.
117 lgdtl bootgdtdesc - wakeup_start
124 * Now execute a far jump to turn on protected mode. This
125 * causes the segment registers to turn into selectors and causes
126 * %cs to be loaded from the gdt.
129 * ljmpl $bootcode32 - bootgdt, $wakeup_32 - wakeup_start
134 .byte 0x66 /* size override to 32 bits */
136 .long wakeup_32 - wakeup_start /* offset in segment */
137 .word bootcode32 - bootgdt /* index in gdt for 32 bit code */
146 mov $bootdata32 - bootgdt, %eax
155 leal wakeup_pagetables - wakeup_start(%ebx), %ecx
169 movl wakeup_efer - wakeup_start(%ebx), %eax
170 movl wakeup_efer + 4 - wakeup_start(%ebx), %edx
174 * Point to the embedded page tables for startup. Note that this
177 * means we are required to use a temporary page table that is below
181 leal wakeup_pagetables - wakeup_start(%ebx), %eax
187 * Finally, switch to long bit mode by enabling paging. We have
188 * to be very careful here because all the segmentation disappears
190 * subsequent pipelined branch to execute, but *only if* everything
200 * We do another far jump to reload %cs with the 64 bit selector.
201 * %cr3 points to a 4-level page table page.
202 * We cannot yet jump all the way to the kernel because we can only
206 * ljmp $bootcode64 - bootgdt, $wakeup_64 - wakeup_start
212 .long wakeup_64 - wakeup_start /* offset in segment */
213 .word bootcode64 - bootgdt /* index in gdt for 64 bit code */
216 * Yeehar! We're running in 64-bit mode! We can mostly ignore our
220 * switch to a real %cr3 promptly so that we can get to the direct map
227 mov $bootdata64 - bootgdt, %eax
231 movq wakeup_pcb - wakeup_start(%rbx), %rdi
232 movq wakeup_ret - wakeup_start(%rbx), %rax
235 lgdt wakeup_gdt - wakeup_start(%rbx)
237 /* Jump to return address. */
279 .word bootgdtend - bootgdt /* Length */
280 .long bootgdt - wakeup_start /* Offset plus %ds << 4 */