aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJung-uk Kim <jkim@FreeBSD.org>2012-02-03 21:24:28 +0000
committerJung-uk Kim <jkim@FreeBSD.org>2012-02-03 21:24:28 +0000
commit8cc51d2da278c6efa9c447e3587f6e187905296f (patch)
tree4806aa53d650fb28701191b87923861b7ccd9477
parent326a21af348995b8e93fa21d7e278272eb13be21 (diff)
Notes
-rw-r--r--sys/amd64/acpica/acpi_switch.S27
1 files changed, 13 insertions, 14 deletions
diff --git a/sys/amd64/acpica/acpi_switch.S b/sys/amd64/acpica/acpi_switch.S
index 35295068539af..11e53564ccf86 100644
--- a/sys/amd64/acpica/acpi_switch.S
+++ b/sys/amd64/acpica/acpi_switch.S
@@ -120,15 +120,6 @@ ENTRY(acpi_restorecpu)
#undef SDT_SYSTSS
#undef SDT_SYSBSY
- /* Restore other callee saved registers. */
- movq PCB_R15(%rdi), %r15
- movq PCB_R14(%rdi), %r14
- movq PCB_R13(%rdi), %r13
- movq PCB_R12(%rdi), %r12
- movq PCB_RBP(%rdi), %rbp
- movq PCB_RSP(%rdi), %rsp
- movq PCB_RBX(%rdi), %rbx
-
/* Restore debug registers. */
movq PCB_DR0(%rdi), %rax
movq %rax, %dr0
@@ -145,6 +136,7 @@ ENTRY(acpi_restorecpu)
/* Restore FPU state. */
fninit
+ movq WAKEUP_CTX(fpusave), %rbx
movq WAKEUP_CTX(xsmask), %rax
testq %rax, %rax
jz 1f
@@ -153,19 +145,26 @@ ENTRY(acpi_restorecpu)
movl $XCR0, %ecx
/* xsetbv */
.byte 0x0f, 0x01, 0xd1
- movq WAKEUP_CTX(fpusave), %rcx
-/* xrstor (%rcx) */
- .byte 0x0f, 0xae, 0x29
+/* xrstor (%rbx) */
+ .byte 0x0f, 0xae, 0x2b
jmp 2f
1:
- movq WAKEUP_CTX(fpusave), %rcx
- fxrstor (%rcx)
+ fxrstor (%rbx)
2:
/* Reload CR0. */
movq PCB_CR0(%rdi), %rax
movq %rax, %cr0
+ /* Restore other callee saved registers. */
+ movq PCB_R15(%rdi), %r15
+ movq PCB_R14(%rdi), %r14
+ movq PCB_R13(%rdi), %r13
+ movq PCB_R12(%rdi), %r12
+ movq PCB_RBP(%rdi), %rbp
+ movq PCB_RSP(%rdi), %rsp
+ movq PCB_RBX(%rdi), %rbx
+
/* Restore return address. */
movq PCB_RIP(%rdi), %rax
movq %rax, (%rsp)