Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 8 May 2006 00:31:59 GMT
From:      Kip Macy <kmacy@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 96809 for review
Message-ID:  <200605080031.k480Vxba036060@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=96809

Change 96809 by kmacy@kmacy_storage:sun4v_rwbuf on 2006/05/08 00:31:23

	re-load floating point registers on fp not available trap if bit is set in PCB

Affected files ...

.. //depot/projects/kmacy_sun4v/src/sys/sun4v/sun4v/exception.S#49 edit

Differences ...

==== //depot/projects/kmacy_sun4v/src/sys/sun4v/sun4v/exception.S#49 (text+ko) ====

@@ -591,35 +591,36 @@
 	.endm
 
 	.macro	tl0_fp_restore
-	ba,a	%xcc, tl0_fp_restore
-	 nop
+	GET_PCB(PCB_REG)			! 3 instructions
+	ldx	[%g6 + PCB_FLAGS], %g1
+	ba,pt	%xcc, tl0_fp_restore
+	  wr	%g0, FPRS_FEF, %fprs
 	.align	32
 	.endm
 
 	.macro tl0_fp_enable
-	wr	%g0, FPRS_FEF, %fprs
+	GET_PCB(PCB_REG)			! 3 instructions
+	ldx	[PCB_REG + PCB_FLAGS], %g1
+	andcc	%g1, PCB_FEF, %g0
+	bnz,pt	%xcc, tl0_fp_restore		
+	  wr	%g0, FPRS_FEF, %fprs
 	retry
 	.align	32
 	.endm
 	
 ENTRY(tl0_fp_restore)
-	GET_PCB(PCB_REG)
-
-	ldx	[%g6 + PCB_FLAGS], %g1
 	andn	%g1, PCB_FEF, %g1
 	stx	%g1, [%g6 + PCB_FLAGS]
-
-	wr	%g0, FPRS_FEF, %fprs
-	wr	%g0, ASI_BLK_S, %asi
-	ldda	[PCB_REG + PCB_UFP + (0 * 64)] %asi, %f0
-	ldda	[PCB_REG + PCB_UFP + (1 * 64)] %asi, %f16
-	ldda	[PCB_REG + PCB_UFP + (2 * 64)] %asi, %f32
-	ldda	[PCB_REG + PCB_UFP + (3 * 64)] %asi, %f48
-	membar	#Sync
-	done
+	
+	ldd	[PCB_REG + PCB_UFP + (0 * 64)], %f0
+	ldd	[PCB_REG + PCB_UFP + (1 * 64)], %f16
+	ldd	[PCB_REG + PCB_UFP + (2 * 64)], %f32
+	ldd	[PCB_REG + PCB_UFP + (3 * 64)], %f48
+	retry
 END(tl0_fp_restore)
 
 	.macro	tl1_insn_excptn
+	 nop
 	.align	32
 	.endm
 



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