svn commit: r209996 - in head/sys/mips: include mips

Warner Losh imp at FreeBSD.org
Tue Jul 13 15:29:38 UTC 2010


Author: imp
Date: Tue Jul 13 15:29:37 2010
New Revision: 209996
URL: http://svn.freebsd.org/changeset/base/209996

Log:
  cpu_id and fpu_id are unused, except to be set early in the boot code.
  The problem with setting it there is that the last CPU to come up
  wins, it seems.  This also removes one more ifdef in locore.S, a noble
  goal too.  Since they are unused, and pollute cpu.h, remove them.
  
  Submitted by:	bde.h (cpu.h pollution)
  Approved in theory by: jmallet@

Modified:
  head/sys/mips/include/cpu.h
  head/sys/mips/include/md_var.h
  head/sys/mips/mips/cpu.c
  head/sys/mips/mips/locore.S

Modified: head/sys/mips/include/cpu.h
==============================================================================
--- head/sys/mips/include/cpu.h	Tue Jul 13 15:06:13 2010	(r209995)
+++ head/sys/mips/include/cpu.h	Tue Jul 13 15:29:37 2010	(r209996)
@@ -393,16 +393,7 @@ union cpuprid {
 #define	MIPS_RM52XX	0x28	/* QED RM52X0 based FPU		ISA IV	 */
 #define	MIPS_VR5400	0x54	/* NEC Vr5400 FPU		ISA IV+	 */
 
-#ifndef _LOCORE
-extern union cpuprid cpu_id;
-
-#define	mips_proc_type()      ((cpu_id.cpu.cp_vendor << 8) | cpu_id.cpu.cp_imp)
-#define	mips_set_proc_type(type)	(cpu_id.cpu.cp_vendor = (type)  >> 8, \
-					 cpu_id.cpu.cp_imp = ((type) & 0x00ff))
-#endif				/* !_LOCORE */
-
 #if defined(_KERNEL) && !defined(_LOCORE)
-extern union cpuprid fpu_id;
 
 struct user;
 

Modified: head/sys/mips/include/md_var.h
==============================================================================
--- head/sys/mips/include/md_var.h	Tue Jul 13 15:06:13 2010	(r209995)
+++ head/sys/mips/include/md_var.h	Tue Jul 13 15:29:37 2010	(r209996)
@@ -66,7 +66,6 @@ void	mips_generic_reset(void);
 #endif
 
 void	mips_vector_init(void);
-void	cpu_identify(void);
 void	mips_cpu_init(void);
 void	mips_pcpu0_init(void);
 void	mips_proc0_init(void);

Modified: head/sys/mips/mips/cpu.c
==============================================================================
--- head/sys/mips/mips/cpu.c	Tue Jul 13 15:06:13 2010	(r209995)
+++ head/sys/mips/mips/cpu.c	Tue Jul 13 15:29:37 2010	(r209996)
@@ -52,15 +52,14 @@ __FBSDID("$FreeBSD$");
 #include <machine/tlb.h>
 #include <machine/hwfunc.h>
 
-struct mips_cpuinfo cpuinfo;
+static void cpu_identify(void);
 
-union	cpuprid cpu_id;
-union	cpuprid fpu_id;
+struct mips_cpuinfo cpuinfo;
 
 /*
  * Attempt to identify the MIPS CPU as much as possible.
  *
- * XXX: Assumes the CPU is MIPS32 compliant.
+ * XXX: Assumes the CPU is MIPS{32,64}{,r2} compliant.
  * XXX: For now, skip config register selections 2 and 3
  * as we don't currently use L2/L3 cache or additional
  * MIPS32 processor features.
@@ -148,7 +147,7 @@ mips_cpu_init(void)
 	cpu_identify();
 }
 
-void
+static void
 cpu_identify(void)
 {
 	uint32_t cfg0, cfg1, cfg2, cfg3;

Modified: head/sys/mips/mips/locore.S
==============================================================================
--- head/sys/mips/mips/locore.S	Tue Jul 13 15:06:13 2010	(r209995)
+++ head/sys/mips/mips/locore.S	Tue Jul 13 15:29:37 2010	(r209996)
@@ -134,25 +134,6 @@ VECTOR(_locore, unknown)
 	mtc0	t0, MIPS_COP_0_CONFIG
 	COP0_SYNC
 
-	/* Read and store the PrID FPU ID for CPU identification, if any. */
-	mfc0	t2, COP_0_STATUS_REG
-	mfc0	t0, MIPS_COP_0_PRID
-#ifdef CPU_HAVEFPU
-	and	t2, MIPS_SR_COP_1_BIT
-	beqz	t2, 1f
-	move	t1, zero
-	cfc1	t1, MIPS_FPU_ID
-1:
-#else
-	/*
-	 * This platform has no FPU, and attempting to detect one
-	 * using the official method causes an exception.
-	 */
-	move	t1, zero
-#endif
-	sw	t0, _C_LABEL(cpu_id)
-	sw	t1, _C_LABEL(fpu_id)
-
 	/*xxximp
 	 * now that we pass a0...a3 to the platform_init routine, do we need
 	 * to stash this stuff here?


More information about the svn-src-all mailing list