Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 5 Jan 2001 13:05:01 -0800
From:      Alfred Perlstein <bright@wintelcom.net>
To:        smp@freebsd.org
Subject:   [patch] cpuid on UP systems
Message-ID:  <20010105130500.M15744@fw.wintelcom.net>

next in thread | raw e-mail | index | archive | help
I need cpuid to work on UP systems, this untested patch seems to
compile ok, I'm wondering if I'm headed in the right direction here?

John, Jake?


Index: i386/machdep.c
===================================================================
RCS file: /home/ncvs/src/sys/i386/i386/machdep.c,v
retrieving revision 1.425
diff -u -r1.425 machdep.c
--- i386/machdep.c	2000/12/13 10:00:42	1.425
+++ i386/machdep.c	2001/01/05 20:06:10
@@ -440,8 +440,9 @@
 	SLIST_INSERT_HEAD(&cpuhead, GLOBALDATA, gd_allcpu);
 
 	mtx_init(&sched_lock, "sched lock", MTX_SPIN | MTX_COLD);
-
-#ifdef SMP
+#ifndef SMP
+	GLOBALDATA->gd_cpuid = 0;
+#else
 	/*
 	 * OK, enough kmem_alloc/malloc state should be up, lets get on with it!
 	 */
Index: include/globaldata.h
===================================================================
RCS file: /home/ncvs/src/sys/i386/include/globaldata.h,v
retrieving revision 1.15
diff -u -r1.15 globaldata.h
--- include/globaldata.h	2000/10/06 02:20:13	1.15
+++ include/globaldata.h	2001/01/05 20:00:02
@@ -65,8 +65,8 @@
 	struct segment_descriptor gd_common_tssd;
 	struct segment_descriptor *gd_tss_gdt;
 	int		gd_currentldt;		/* only used for USER_LDT */
-#ifdef SMP
 	u_int		gd_cpuid;
+#ifdef SMP
 	u_int		gd_cpu_lockid;
 	u_int		gd_other_cpus;
 	int		gd_inside_intr;
Index: include/globals.h
===================================================================
RCS file: /home/ncvs/src/sys/i386/include/globals.h,v
retrieving revision 1.13
diff -u -r1.13 globals.h
--- include/globals.h	2000/11/15 22:02:05	1.13
+++ include/globals.h	2001/01/05 19:57:22
@@ -106,8 +106,8 @@
 #define	currentldt	GLOBAL_RVALUE(currentldt, int)
 #endif
 
-#ifdef SMP
 #define	cpuid		GLOBAL_RVALUE(cpuid, u_int)
+#ifdef SMP
 #define	other_cpus	GLOBAL_LVALUE(other_cpus, u_int)
 #define	inside_intr	GLOBAL_LVALUE(inside_intr, int)
 #define	prv_CMAP1	GLOBAL_LVALUE(prv_CMAP1, pt_entry_t *)

-- 
-Alfred Perlstein - [bright@wintelcom.net|alfred@freebsd.org]
"I have the heart of a child; I keep it in a jar on my desk."


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-smp" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010105130500.M15744>