svn commit: r256434 - projects/pmac_pmu/sys/powerpc/powermac

Justin Hibbits jhibbits at FreeBSD.org
Mon Oct 14 00:56:39 UTC 2013


Author: jhibbits
Date: Mon Oct 14 00:56:38 2013
New Revision: 256434
URL: http://svnweb.freebsd.org/changeset/base/256434

Log:
  PCPU fputhread and vecthread get reset to NULL when save_fpu()/save_vec() is
  called.  Cache these.

Modified:
  projects/pmac_pmu/sys/powerpc/powermac/pmu.c

Modified: projects/pmac_pmu/sys/powerpc/powermac/pmu.c
==============================================================================
--- projects/pmac_pmu/sys/powerpc/powermac/pmu.c	Sun Oct 13 21:46:08 2013	(r256433)
+++ projects/pmac_pmu/sys/powerpc/powermac/pmu.c	Mon Oct 14 00:56:38 2013	(r256434)
@@ -1129,11 +1129,13 @@ extern void *ap_pcpu;
 
 void pmu_sleep_int(void)
 {
+	jmp_buf resetjb;
 	u_quad_t timebase;
+	struct thread *fputd = NULL;
+	struct thread *vectd = NULL;
 	register_t hid0;
 	register_t msr;
 	register_t saved_msr;
-	jmp_buf resetjb;
 
 	ap_pcpu = pcpup;
 
@@ -1143,9 +1145,11 @@ void pmu_sleep_int(void)
 	saved_msr = mfmsr();
 	timebase = mftb();
 	flush_disable_caches();
-	if (PCPU_GET(fputhread) != NULL)
+	fputd = PCPU_GET(fputhread);
+	vectd = PCPU_GET(vecthread);
+	if (fputd != NULL)
 		save_fpu(PCPU_GET(fputhread));
-	if (PCPU_GET(vecthread) != NULL)
+	if (vectd != NULL)
 		save_vec(PCPU_GET(vecthread));
 	if (setjmp(resetjb) == 0) {
 		sprgs[0] = mfspr(SPR_SPRG0);
@@ -1177,9 +1181,9 @@ void pmu_sleep_int(void)
 	mtspr(SPR_SRR0, srrs[0]);
 	mtspr(SPR_SRR1, srrs[1]);
 	mtmsr(saved_msr);
-	if (PCPU_GET(fputhread) == curthread)
+	if (fputd == curthread)
 		enable_fpu(curthread);
-	if (PCPU_GET(vecthread) == curthread)
+	if (vectd == curthread)
 		enable_vec(curthread);
 	powerpc_sync();
 }


More information about the svn-src-projects mailing list