Subject: Re: cpu_id?
To: Simon Gerraty <sjg@juniper.net>
From: Simon Burge <simonb@wasabisystems.com>
List: tech-smp
Date: 12/07/2000 22:22:43
Simon Gerraty wrote:

> kern_sysctl.c expects struct cpu_info to have a ci_cpuid
> but neither sparc nor i386 have such a beast.  
> 
> I was just going to try a -current MP kernel on my SS20, to see if the
> Hypersparcs spinup.

I know nothing about MP sparcs, but it _looks_ like the Module ID is
what we'd equate to the MI cpuid.  The following keeps the struct
cpu_info mid (it's used in a few places) and simply adds a ci_cpuid that
is initialised to the same value as the mid.

Any more sparc-savvy folk care to comment?

Simon.
--
Simon Burge                            <simonb@wasabisystems.com>
NetBSD Sales, Support and Service:  http://www.wasabisystems.com/



Index: sparc/cpu.c
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/sparc/sparc/cpu.c,v
retrieving revision 1.109
diff -d -p -u -r1.109 cpu.c
--- sparc/cpu.c	2000/11/11 12:12:46	1.109
+++ sparc/cpu.c	2000/12/07 11:19:20
@@ -335,6 +335,7 @@ static	int cpu_instance;
 	cpus[cpu_instance] = cpi;
 	cpi->cpu_no = cpu_instance++;
 	cpi->mid = mid;
+	cpi->ci_cpuid = (cpuid_t)mid;
 	cpi->node = node;
 
 	if (ncpu > 1)
Index: sparc/cpuvar.h
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/sparc/sparc/cpuvar.h,v
retrieving revision 1.29
diff -d -p -u -r1.29 cpuvar.h
--- sparc/cpuvar.h	2000/06/27 16:51:44	1.29
+++ sparc/cpuvar.h	2000/12/07 11:19:20
@@ -161,6 +161,7 @@ struct cpu_info {
 
 	int		cpu_no;		/* CPU index (see cpus[] array) */
 	int		mid;		/* Module ID for MP systems */
+	cpuid_t		ci_cpuid;	/* our CPU ID */
 	int		mbus;		/* 1 if CPU is on MBus */
 	int		mxcc;		/* 1 if a MBus-level MXCC is present */