svn commit: r198588 - head/sys/powerpc/aim

Nathan Whitehorn nwhitehorn at FreeBSD.org
Thu Oct 29 14:22:09 UTC 2009


Author: nwhitehorn
Date: Thu Oct 29 14:22:09 2009
New Revision: 198588
URL: http://svn.freebsd.org/changeset/base/198588

Log:
  Turn off Altivec data-stream prefetching before going into power-save
  mode on those CPUs that need it.

Modified:
  head/sys/powerpc/aim/machdep.c

Modified: head/sys/powerpc/aim/machdep.c
==============================================================================
--- head/sys/powerpc/aim/machdep.c	Thu Oct 29 13:52:34 2009	(r198587)
+++ head/sys/powerpc/aim/machdep.c	Thu Oct 29 14:22:09 2009	(r198588)
@@ -897,8 +897,10 @@ void
 cpu_idle(int busy)
 {
 	uint32_t msr;
+	uint16_t vers;
 
 	msr = mfmsr();
+	vers = mfpvr() >> 16;
 
 #ifdef INVARIANTS
 	if ((msr & PSL_EE) != PSL_EE) {
@@ -908,9 +910,25 @@ cpu_idle(int busy)
 	}
 #endif
 	if (powerpc_pow_enabled) {
-		powerpc_sync();
-		mtmsr(msr | PSL_POW);
-		isync();
+		switch (vers) {
+		case IBM970:
+		case IBM970FX:
+		case IBM970MP:
+		case MPC7447A:
+		case MPC7448:
+		case MPC7450:
+		case MPC7455:
+		case MPC7457:
+			__asm __volatile("\
+			    dssall; sync; mtmsr %0; isync"
+			    :: "r"(msr | PSL_POW));
+			break;
+		default:
+			powerpc_sync();
+			mtmsr(msr | PSL_POW);
+			isync();
+			break;
+		}
 	}
 }
 


More information about the svn-src-all mailing list