summaryrefslogtreecommitdiff
path: root/sys/arch/amd64
diff options
context:
space:
mode:
authorMike Larkin <mlarkin@cvs.openbsd.org>2009-11-22 22:00:52 +0000
committerMike Larkin <mlarkin@cvs.openbsd.org>2009-11-22 22:00:52 +0000
commit94a350935aba5eb33e9f23827d190405e40923d1 (patch)
treecee88b4bdb086221b6b8bba905e1eea86f3dd43f /sys/arch/amd64
parentf8fb5eeb35a44ff60fd4b72482b44fdcc6ae24d9 (diff)
Missed 4 MSRs on suspend/resume in previous version. Tested by pirofti
and myself, ok pirofti@
Diffstat (limited to 'sys/arch/amd64')
-rw-r--r--sys/arch/amd64/amd64/acpi_wakecode.S52
1 files changed, 50 insertions, 2 deletions
diff --git a/sys/arch/amd64/amd64/acpi_wakecode.S b/sys/arch/amd64/amd64/acpi_wakecode.S
index 7da9a0a4b8a..3b49a1e0569 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.3 2009/02/19 21:02:05 marco Exp $ */
+/* $OpenBSD: acpi_wakecode.S,v 1.4 2009/11/22 22:00:51 mlarkin Exp $ */
/*
* Copyright (c) 2001 Takanori Watanabe <takawata@jp.freebsd.org>
* Copyright (c) 2001 Mitsuru IWASAKI <iwasaki@jp.freebsd.org>
@@ -128,7 +128,7 @@ _C_LABEL(acpi_real_mode_resume):
* laptops), we might not restore the proper VGA mode
* on resume. Caveat emptor.
*/
- jmp nobiosreset /* XXX make this a tunable */
+ /* jmp nobiosreset */ /* XXX make this a tunable */
lcall $0xc000,$3
/*
@@ -280,6 +280,26 @@ _C_LABEL(acpi_long_mode_resume):
movw %ax, %gs
/* Restore registers - start with the MSRs */
+ movl $MSR_STAR, %ecx
+ movl acpi_saved_star, %eax
+ movl acpi_saved_star+4, %edx
+ wrmsr
+
+ movl $MSR_LSTAR, %ecx
+ movl acpi_saved_lstar, %eax
+ movl acpi_saved_lstar+4, %edx
+ wrmsr
+
+ movl $MSR_CSTAR, %ecx
+ movl acpi_saved_cstar, %eax
+ movl acpi_saved_cstar+4, %edx
+ wrmsr
+
+ movl $MSR_SFMASK, %ecx
+ movl acpi_saved_sfmask, %eax
+ movl acpi_saved_sfmask+4, %edx
+ wrmsr
+
movl $MSR_FSBASE, %ecx
movl acpi_saved_fsbase, %eax
movl acpi_saved_fsbase+4, %edx
@@ -481,6 +501,14 @@ _ACPI_TRMP_LABEL(acpi_saved_gsbase)
.quad 0
_ACPI_TRMP_LABEL(acpi_saved_kgs)
.quad 0
+_ACPI_TRMP_LABEL(acpi_saved_star)
+ .quad 0
+_ACPI_TRMP_LABEL(acpi_saved_lstar)
+ .quad 0
+_ACPI_TRMP_LABEL(acpi_saved_cstar)
+ .quad 0
+_ACPI_TRMP_LABEL(acpi_saved_sfmask)
+ .quad 0
.align 4
_ACPI_TRMP_LABEL(acpi_pdirpa)
@@ -533,6 +561,26 @@ NENTRY(acpi_savecpu)
pushq %rcx
pushq %rdx
+ movl $MSR_STAR, %ecx
+ rdmsr
+ movl %eax, acpi_saved_star
+ movl %edx, acpi_saved_star+4
+
+ movl $MSR_CSTAR, %ecx
+ rdmsr
+ movl %eax, acpi_saved_cstar
+ movl %edx, acpi_saved_cstar+4
+
+ movl $MSR_LSTAR, %ecx
+ rdmsr
+ movl %eax, acpi_saved_lstar
+ movl %edx, acpi_saved_lstar+4
+
+ movl $MSR_SFMASK, %ecx
+ rdmsr
+ movl %eax, acpi_saved_sfmask
+ movl %edx, acpi_saved_sfmask+4
+
movl $MSR_FSBASE, %ecx
rdmsr
movl %eax, acpi_saved_fsbase