Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 3 Feb 2012 21:24:28 +0000 (UTC)
From:      Jung-uk Kim <jkim@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r230958 - head/sys/amd64/acpica
Message-ID:  <201202032124.q13LOSGv004726@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jkim
Date: Fri Feb  3 21:24:28 2012
New Revision: 230958
URL: http://svn.freebsd.org/changeset/base/230958

Log:
  Restore callee saved registers later and micro-optimize.

Modified:
  head/sys/amd64/acpica/acpi_switch.S

Modified: head/sys/amd64/acpica/acpi_switch.S
==============================================================================
--- head/sys/amd64/acpica/acpi_switch.S	Fri Feb  3 21:21:00 2012	(r230957)
+++ head/sys/amd64/acpica/acpi_switch.S	Fri Feb  3 21:24:28 2012	(r230958)
@@ -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)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201202032124.q13LOSGv004726>