From owner-freebsd-smp Fri Jan 5 13: 5: 6 2001 From owner-freebsd-smp@FreeBSD.ORG Fri Jan 5 13:05:02 2001 Return-Path: Delivered-To: freebsd-smp@freebsd.org Received: from fw.wintelcom.net (ns1.wintelcom.net [209.1.153.20]) by hub.freebsd.org (Postfix) with ESMTP id E79E237B6B4 for ; Fri, 5 Jan 2001 13:05:01 -0800 (PST) Received: (from bright@localhost) by fw.wintelcom.net (8.10.0/8.10.0) id f05L51o16204 for smp@freebsd.org; Fri, 5 Jan 2001 13:05:01 -0800 (PST) Date: Fri, 5 Jan 2001 13:05:01 -0800 From: Alfred Perlstein To: smp@freebsd.org Subject: [patch] cpuid on UP systems Message-ID: <20010105130500.M15744@fw.wintelcom.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i Sender: bright@fw.wintelcom.net Sender: owner-freebsd-smp@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org 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