PERFORCE change 76008 for review

David Xu davidxu at FreeBSD.org
Tue Apr 26 07:29:01 PDT 2005


http://perforce.freebsd.org/chv.cgi?CH=76008

Change 76008 by davidxu at davidxu_tiger on 2005/04/26 14:28:17

	Eliminate a branch.

Affected files ...

.. //depot/projects/davidxu_thread/src/sys/i386/i386/sysenter.s#2 edit

Differences ...

==== //depot/projects/davidxu_thread/src/sys/i386/i386/sysenter.s#2 (text+ko) ====

@@ -28,7 +28,7 @@
 	MEXITCOUNT
 	movl    PCPU(CURPCB),%eax
 	testl	$PCB_FULLCTX,PCB_FLAGS(%eax)
-	jnz	2f
+	jnz	1f
 	/*
 	 * Check for ASTs atomically with returning.  Disabling CPU
 	 * interrupts provides sufficient locking even in the SMP case,
@@ -37,10 +37,7 @@
 	cli
 	movl	PCPU(CURTHREAD),%eax
 	testl	$TDF_ASTPENDING | TDF_NEEDRESCHED,TD_FLAGS(%eax)
-	jz	1f
-	sti
-	jmp	2f
-1:
+	jnz	1f
 	.globl	sysenter_popl_fs
 sysenter_popl_fs:
 	popl	%fs
@@ -68,6 +65,8 @@
 #endif
 	sysexit
 
-2:      /* Requested full context restore, use doreti for that */
+1: 
+	/* Requested full context restore, use doreti for that */
+	sti
 	andq    $~PCB_FULLCTX,PCB_FLAGS(%rax)
 	jmp     doreti


More information about the p4-projects mailing list