Deleted Added
full compact
acpi_wakecode.S (121743) acpi_wakecode.S (121830)
1/*-
2 * Copyright (c) 2001 Takanori Watanabe <takawata@jp.freebsd.org>
3 * Copyright (c) 2001 Mitsuru IWASAKI <iwasaki@jp.freebsd.org>
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 12 unchanged lines hidden (view full) ---

21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 * SUCH DAMAGE.
26 */
27
28#include <machine/asm.h>
1/*-
2 * Copyright (c) 2001 Takanori Watanabe <takawata@jp.freebsd.org>
3 * Copyright (c) 2001 Mitsuru IWASAKI <iwasaki@jp.freebsd.org>
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 12 unchanged lines hidden (view full) ---

21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 * SUCH DAMAGE.
26 */
27
28#include <machine/asm.h>
29__FBSDID("$FreeBSD: head/sys/i386/acpica/acpi_wakecode.S 121743 2003-10-30 16:14:55Z iwasaki $");
29__FBSDID("$FreeBSD: head/sys/i386/acpica/acpi_wakecode.S 121830 2003-11-01 00:18:29Z njl $");
30
31#define LOCORE
32
30
31#define LOCORE
32
33#include <machine/param.h>
33#include <machine/specialreg.h>
34
35 .align 4
36 .code16
37wakeup_16:
38 nop
39 cli
40
34#include <machine/specialreg.h>
35
36 .align 4
37 .code16
38wakeup_16:
39 nop
40 cli
41
41 /* Set up segment registers for real mode */
42 /*
43 * Set up segment registers for real mode and a small stack for
44 * any calls we make.
45 */
42 movw %cs,%ax
43 movw %ax,%ds
44 movw %ax,%ss
46 movw %cs,%ax
47 movw %ax,%ds
48 movw %ax,%ss
45
46#ifndef ACPI_NO_RESET_VIDEO
49 movw $PAGE_SIZE,%sp
50
51 /* Re-initialize video BIOS if the reset_video tunable is set. */
52 cmp $1,reset_video
53 je wakeup_16_gdt
54 lcall $0xc000,$3
55
47 /*
56 /*
48 * Re-initialize video BIOS. Restore DS and SS from CS in
49 * case the BIOS modified them.
57 * Set up segment registers for real mode again in case the
58 * previous BIOS call clobbers them.
50 */
59 */
51 cmp $1, no_reset_video
52 je wakeup_16_gdt
53 lcall $0xc000, $3
54 movw %cs, %ax
55 movw %ax, %ds
56 movw %ax, %ss
57#endif
60 movw %cs,%ax
61 movw %ax,%ds
62 movw %ax,%ss
58
59wakeup_16_gdt:
60 /* Load GDT for real mode */
61 lgdt physical_gdt
62
63 /* Restore CR2, CR3 and CR4 */
64 mov previous_cr2,%eax
65 mov %eax,%cr2

--- 143 unchanged lines hidden (view full) ---

209
210/* used in real mode */
211physical_gdt: .word 0
212 .long 0
213physical_esp: .long 0
214previous_cr2: .long 0
215previous_cr3: .long 0
216previous_cr4: .long 0
63
64wakeup_16_gdt:
65 /* Load GDT for real mode */
66 lgdt physical_gdt
67
68 /* Restore CR2, CR3 and CR4 */
69 mov previous_cr2,%eax
70 mov %eax,%cr2

--- 143 unchanged lines hidden (view full) ---

214
215/* used in real mode */
216physical_gdt: .word 0
217 .long 0
218physical_esp: .long 0
219previous_cr2: .long 0
220previous_cr3: .long 0
221previous_cr4: .long 0
217no_reset_video: .long 0
222reset_video: .long 0
218
219/* transfer from real mode to protected mode */
220previous_cr0: .long 0
221previous_tr: .word 0
222previous_gdt: .word 0
223 .long 0
224previous_ldt: .word 0
225previous_idt: .word 0
226 .long 0
227where_to_recover: .long 0
228previous_ds: .word 0
229previous_es: .word 0
230previous_fs: .word 0
231previous_gs: .word 0
232previous_ss: .word 0
233dummy: .word 0
223
224/* transfer from real mode to protected mode */
225previous_cr0: .long 0
226previous_tr: .word 0
227previous_gdt: .word 0
228 .long 0
229previous_ldt: .word 0
230previous_idt: .word 0
231 .long 0
232where_to_recover: .long 0
233previous_ds: .word 0
234previous_es: .word 0
235previous_fs: .word 0
236previous_gs: .word 0
237previous_ss: .word 0
238dummy: .word 0