svn commit: r239480 - in head/sys/powerpc: aim include

Adrian Chadd adrian at FreeBSD.org
Tue Aug 21 06:34:21 UTC 2012


Author: adrian
Date: Tue Aug 21 06:34:21 2012
New Revision: 239480
URL: http://svn.freebsd.org/changeset/base/239480

Log:
  On Nintendo Wii CPUs, the mdp value will be garbage.  Set it to NULL
  so as to not confuse things.
  
  Submitted by:	Margarida Gouveia

Modified:
  head/sys/powerpc/aim/machdep.c
  head/sys/powerpc/include/spr.h

Modified: head/sys/powerpc/aim/machdep.c
==============================================================================
--- head/sys/powerpc/aim/machdep.c	Tue Aug 21 06:33:10 2012	(r239479)
+++ head/sys/powerpc/aim/machdep.c	Tue Aug 21 06:34:21 2012	(r239480)
@@ -257,7 +257,7 @@ powerpc_init(vm_offset_t startkernel, vm
 	size_t		trap_offset;
 	void		*kmdp;
         char		*env;
-	register_t	msr, scratch;
+	register_t	msr, scratch, vers;
 	uint8_t		*cache_check;
 	int		cacheline_warn;
 	#ifndef __powerpc64__
@@ -269,6 +269,14 @@ powerpc_init(vm_offset_t startkernel, vm
 	cacheline_warn = 0;
 
 	/*
+	 * The Wii loader doesn't pass us any environment so, mdp
+	 * points to garbage at this point. The Wii CPU is a 750CL.
+	 */
+	vers = mfpvr();
+	if ((vers & 0xfffff0e0) == (MPC750 << 16 | MPC750CL)) 
+		mdp = NULL;
+
+	/*
 	 * Parse metadata if present and fetch parameters.  Must be done
 	 * before console is inited so cninit gets the right value of
 	 * boothowto.

Modified: head/sys/powerpc/include/spr.h
==============================================================================
--- head/sys/powerpc/include/spr.h	Tue Aug 21 06:33:10 2012	(r239479)
+++ head/sys/powerpc/include/spr.h	Tue Aug 21 06:34:21 2012	(r239480)
@@ -140,6 +140,7 @@
 #define	  MPC603e		  0x0006
 #define	  MPC603ev		  0x0007
 #define	  MPC750		  0x0008
+#define	  MPC750CL		  0x7000	/* Nintendo Wii's Broadway */
 #define	  MPC604ev		  0x0009
 #define	  MPC7400		  0x000c
 #define	  MPC620		  0x0014


More information about the svn-src-all mailing list