summaryrefslogtreecommitdiffstats
path: root/sys/amd64
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1998-07-28 17:35:09 +0000
committerbde <bde@FreeBSD.org>1998-07-28 17:35:09 +0000
commit09a9db632f0ddf1b731633685ad0e7c70d0d584d (patch)
tree1507a62c4114d654dc6c24a9ce2ab27bad86790d /sys/amd64
parentd7aa77e789378c3cc29c0ae98e66ed030cd8231a (diff)
downloadFreeBSD-src-09a9db632f0ddf1b731633685ad0e7c70d0d584d.zip
FreeBSD-src-09a9db632f0ddf1b731633685ad0e7c70d0d584d.tar.gz
Micro-optimized and cleaned up the clearing of switchtime in idle().
Cleaned up the conditionals in the disgusting SMP ifdef in idle().
Diffstat (limited to 'sys/amd64')
-rw-r--r--sys/amd64/amd64/cpu_switch.S20
-rw-r--r--sys/amd64/amd64/swtch.s20
2 files changed, 16 insertions, 24 deletions
diff --git a/sys/amd64/amd64/cpu_switch.S b/sys/amd64/amd64/cpu_switch.S
index e952f68..0a079e7 100644
--- a/sys/amd64/amd64/cpu_switch.S
+++ b/sys/amd64/amd64/cpu_switch.S
@@ -33,7 +33,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: swtch.s,v 1.73 1998/05/19 20:59:07 dufault Exp $
+ * $Id: swtch.s,v 1.74 1998/05/28 09:29:59 phk Exp $
*/
#include "npx.h"
@@ -251,15 +251,12 @@ rem3id: .asciz "remrq.id"
*/
ALIGN_TEXT
_idle:
- xorl %eax,%eax
- movl %eax, _switchtime
- movl %eax, _switchtime+4
+ xorl %ebp,%ebp
+ movl %ebp,_switchtime
#ifdef SMP
- /* when called, we have the mplock, intr disabled */
-
- xorl %ebp,%ebp
+ /* when called, we have the mplock, intr disabled */
/* use our idleproc's "context" */
movl _my_idlePTD,%ecx
movl %ecx,%cr3
@@ -353,9 +350,7 @@ idle_loop:
2:
/* enable intrs for a halt */
-#ifdef SMP
movl $0, lapic_tpr /* 1st candidate for an INT */
-#endif
sti
call *_hlt_vector /* wait for interrupt */
cli
@@ -379,8 +374,8 @@ idle_loop:
call _rel_mplock
jmp idle_loop
-#else
- xorl %ebp,%ebp
+#else /* !SMP */
+
movl $HIDENAME(tmpstk),%esp
#if defined(OVERLY_CONSERVATIVE_PTD_MGMT)
#if defined(SWTCH_OPTIM_STATS)
@@ -443,7 +438,8 @@ idle_loop:
sti
call *_hlt_vector /* wait for interrupt */
jmp idle_loop
-#endif
+
+#endif /* SMP */
CROSSJUMPTARGET(_idle)
diff --git a/sys/amd64/amd64/swtch.s b/sys/amd64/amd64/swtch.s
index e952f68..0a079e7 100644
--- a/sys/amd64/amd64/swtch.s
+++ b/sys/amd64/amd64/swtch.s
@@ -33,7 +33,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: swtch.s,v 1.73 1998/05/19 20:59:07 dufault Exp $
+ * $Id: swtch.s,v 1.74 1998/05/28 09:29:59 phk Exp $
*/
#include "npx.h"
@@ -251,15 +251,12 @@ rem3id: .asciz "remrq.id"
*/
ALIGN_TEXT
_idle:
- xorl %eax,%eax
- movl %eax, _switchtime
- movl %eax, _switchtime+4
+ xorl %ebp,%ebp
+ movl %ebp,_switchtime
#ifdef SMP
- /* when called, we have the mplock, intr disabled */
-
- xorl %ebp,%ebp
+ /* when called, we have the mplock, intr disabled */
/* use our idleproc's "context" */
movl _my_idlePTD,%ecx
movl %ecx,%cr3
@@ -353,9 +350,7 @@ idle_loop:
2:
/* enable intrs for a halt */
-#ifdef SMP
movl $0, lapic_tpr /* 1st candidate for an INT */
-#endif
sti
call *_hlt_vector /* wait for interrupt */
cli
@@ -379,8 +374,8 @@ idle_loop:
call _rel_mplock
jmp idle_loop
-#else
- xorl %ebp,%ebp
+#else /* !SMP */
+
movl $HIDENAME(tmpstk),%esp
#if defined(OVERLY_CONSERVATIVE_PTD_MGMT)
#if defined(SWTCH_OPTIM_STATS)
@@ -443,7 +438,8 @@ idle_loop:
sti
call *_hlt_vector /* wait for interrupt */
jmp idle_loop
-#endif
+
+#endif /* SMP */
CROSSJUMPTARGET(_idle)
OpenPOWER on IntegriCloud