summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2003-02-02 09:07:15 +0000
committermarcel <marcel@FreeBSD.org>2003-02-02 09:07:15 +0000
commit3ddb056ffb0d1e3f754a654710341a0b1d51e3e1 (patch)
treea8ff2f754d1c3a4c66c49d3f58d0180eefbb1e2f /sys
parentc0109dece26cf22a06b4facb0f11b1b0f4524ce6 (diff)
downloadFreeBSD-src-3ddb056ffb0d1e3f754a654710341a0b1d51e3e1.zip
FreeBSD-src-3ddb056ffb0d1e3f754a654710341a0b1d51e3e1.tar.gz
Export IA32 from opt_ia32.h to assembly so that we can eliminate
saving and restoring ia32 specific registers when switching context and ia32 support has not been compiled-in. The primary reason for this change is that one of the ia32 registers (ar.fcr) is wrongly marked as invalid by the simulator. Now that we avoid using the register when possible, usability is improved. The secundary reason is that it saves us 7 loads and stores. Note that the PCB will continue to have room for these registers, irrespective of the IA32 option. There are no benefits that make it worthwhile.
Diffstat (limited to 'sys')
-rw-r--r--sys/ia64/ia64/genassym.c6
-rw-r--r--sys/ia64/ia64/swtch.s10
2 files changed, 16 insertions, 0 deletions
diff --git a/sys/ia64/ia64/genassym.c b/sys/ia64/ia64/genassym.c
index 4a04842..4aa349f 100644
--- a/sys/ia64/ia64/genassym.c
+++ b/sys/ia64/ia64/genassym.c
@@ -37,6 +37,8 @@
* $FreeBSD$
*/
+#include "opt_ia32.h"
+
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/assym.h>
@@ -63,6 +65,10 @@
#include <net/if.h>
#include <netinet/in.h>
+#ifdef IA32
+ASSYM(IA32, IA32);
+#endif
+
ASSYM(PC_CURTHREAD, offsetof(struct pcpu, pc_curthread));
ASSYM(PC_IDLETHREAD, offsetof(struct pcpu, pc_idlethread));
ASSYM(PC_FPCURTHREAD, offsetof(struct pcpu, pc_fpcurthread));
diff --git a/sys/ia64/ia64/swtch.s b/sys/ia64/ia64/swtch.s
index b17c92a..2fce5f7 100644
--- a/sys/ia64/ia64/swtch.s
+++ b/sys/ia64/ia64/swtch.s
@@ -155,9 +155,12 @@ ENTRY(pcb_save,0)
st8 [r8]=r17,16 // ar.rnat
st8 [r9]=r18,16 // ar.lc
;;
+{ .mmb
st8 [r8]=r19,16 // pc_current_pmap
+#ifdef IA32
mov r16=ar.fcr
;;
+}
st8 [r9]=r16,16 // ar.fcr
mov r17=ar.eflag
;;
@@ -178,6 +181,7 @@ ENTRY(pcb_save,0)
;;
{ .mmb
st8 [r9]=r16,16 // ar.fdr
+#endif
mov ar.rsc=3
br.sptk.many b6
;;
@@ -279,10 +283,13 @@ ENTRY(pcb_restore,0)
{ .mmi
invala
;;
+#ifdef IA32
ld8 r16=[r9],16 // ar.fcr
+#endif
mov r18=ar.lc
;;
}
+#ifdef IA32
ld8 r17=[r8],16 // ar.eflag
mov ar.fcr=r16
;;
@@ -301,8 +308,11 @@ ENTRY(pcb_restore,0)
ld8 r16=[r9],16 // ar.fdr
mov ar.fir=r17
;;
+#endif
{ .mmb
+#ifdef IA32
mov ar.fdr=r16
+#endif
mov ar.rsc=3
br.ret.sptk b0
;;
OpenPOWER on IntegriCloud