summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Irofti <pirofti@cvs.openbsd.org>2009-12-09 16:20:34 +0000
committerPaul Irofti <pirofti@cvs.openbsd.org>2009-12-09 16:20:34 +0000
commitb177d8a42ad6b567b776cbf88bf05832984b6724 (patch)
tree2ce737fa9f5dddce228e13ad7bf880a5548bf4a8
parent9542e90dfa3fb5369646f600c21d3c2863e6dd69 (diff)
Remove the clean gdt bit and leave the idt part in.
Fixes most laptops out there on resume. Okay deraadt@.
-rw-r--r--sys/arch/amd64/amd64/acpi_wakecode.S40
-rw-r--r--sys/arch/i386/i386/acpi_wakecode.S38
2 files changed, 1 insertions, 77 deletions
diff --git a/sys/arch/amd64/amd64/acpi_wakecode.S b/sys/arch/amd64/amd64/acpi_wakecode.S
index d85e782d1ac..8beb64f0b6f 100644
--- a/sys/arch/amd64/amd64/acpi_wakecode.S
+++ b/sys/arch/amd64/amd64/acpi_wakecode.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: acpi_wakecode.S,v 1.8 2009/11/30 16:41:04 pirofti Exp $ */
+/* $OpenBSD: acpi_wakecode.S,v 1.9 2009/12/09 16:20:33 pirofti Exp $ */
/*
* Copyright (c) 2001 Takanori Watanabe <takawata@jp.freebsd.org>
* Copyright (c) 2001 Mitsuru IWASAKI <iwasaki@jp.freebsd.org>
@@ -92,28 +92,6 @@ _C_LABEL(acpi_real_mode_resume):
cli
cld
- /* Some BIOS vendors screw up the gdt, make sure we clean it */
- movw $0x10, %cx
- lgdtl %cs:clean_gdt
- movl %cr0, %eax
- orb $(CR0_PE), %al
- movl %eax, %cr0
- jmp 1f
-1: ljmpw $0x8, $clean1
-
-_ACPI_TRMP_OFFSET(clean1)
- movw %cx, %ds
- movw %cx, %es
- movw %cx, %ss
- movw %cx, %fs
- movw %cx, %gs
-
- andb $~(CR0_PE), %al
- movl %eax, %cr0
- ljmpw $_ACPI_RM_SEGMENT , $clean2
-
-_ACPI_TRMP_OFFSET(clean2)
-
/*
* Set up segment registers for real mode.
* We'll only be in real mode for a moment, and we don't have
@@ -450,22 +428,6 @@ _ACPI_TRMP_OFFSET(clean_idt)
.long 0
.word 0
-_ACPI_TRMP_OFFSET(clean_gdt)
- .word clean_gdt_end - clean_gdtable
- .long clean_gdtable
-
- .align 8
-_ACPI_TRMP_LABEL(clean_gdtable)
- .word 0, 0
- .byte 0, 0, 0, 0
-
- .word 0xffff, ACPI_TRAMPOLINE
- .byte 0, 0x9b, 0, 0
-
- .word 0xffff, ACPI_TRAMPOLINE
- .byte 0, 0x93, 0, 0
-_ACPI_TRMP_LABEL(clean_gdt_end)
-
.align 8
_ACPI_TRMP_LABEL(tmp_gdt64)
.word tmp_gdt64_end - tmp_gdtable64
diff --git a/sys/arch/i386/i386/acpi_wakecode.S b/sys/arch/i386/i386/acpi_wakecode.S
index cf567a97c6b..121fbe47f4e 100644
--- a/sys/arch/i386/i386/acpi_wakecode.S
+++ b/sys/arch/i386/i386/acpi_wakecode.S
@@ -88,28 +88,6 @@ _C_LABEL(acpi_real_mode_resume):
cli
cld
- /* Some BIOS vendors screw up the gdt, make sure we clean it */
- movw $0x10, %cx
- lgdtl %cs:clean_gdt
- movl %cr0, %eax
- orb $(CR0_PE), %al
- movl %eax, %cr0
- jmp 1f
-1: ljmpw $0x8, $clean1
-
-_ACPI_TRMP_OFFSET(clean1)
- movw %cx, %ds
- movw %cx, %es
- movw %cx, %ss
- movw %cx, %fs
- movw %cx, %gs
-
- andb $~(CR0_PE), %al
- movl %eax, %cr0
- ljmpw $_ACPI_RM_SEGMENT , $clean2
-
-_ACPI_TRMP_OFFSET(clean2)
-
/*
* Set up segment registers for real mode.
* We'll only be in real mode for a moment, and we don't have
@@ -393,22 +371,6 @@ _ACPI_TRMP_OFFSET(clean_idt)
.long 0
.word 0
-_ACPI_TRMP_OFFSET(clean_gdt)
- .word clean_gdt_end - clean_gdtable
- .long clean_gdtable
-
- .align 8
-_ACPI_TRMP_LABEL(clean_gdtable)
- .word 0, 0
- .byte 0, 0, 0, 0
-
- .word 0xffff, ACPI_TRAMPOLINE
- .byte 0, 0x9b, 0, 0
-
- .word 0xffff, ACPI_TRAMPOLINE
- .byte 0, 0x93, 0, 0
-_ACPI_TRMP_LABEL(clean_gdt_end)
-
.align 4
_ACPI_TRMP_LABEL(acpi_saved_ebx)
.long 0