Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/hp700 *** empty log message ***



details:   https://anonhg.NetBSD.org/src/rev/8198cf822487
branches:  trunk
changeset: 755445:8198cf822487
user:      skrll <skrll%NetBSD.org@localhost>
date:      Sun Jun 06 10:15:51 2010 +0000

description:
*** empty log message ***

diffstat:

 sys/arch/hp700/hp700/machdep.c |   7 +++----
 sys/arch/hp700/include/cpu.h   |  25 ++++++++++++++++---------
 2 files changed, 19 insertions(+), 13 deletions(-)

diffs (85 lines):

diff -r 1601a7f21444 -r 8198cf822487 sys/arch/hp700/hp700/machdep.c
--- a/sys/arch/hp700/hp700/machdep.c    Sun Jun 06 09:12:39 2010 +0000
+++ b/sys/arch/hp700/hp700/machdep.c    Sun Jun 06 10:15:51 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: machdep.c,v 1.86 2010/06/06 09:12:39 skrll Exp $       */
+/*     $NetBSD: machdep.c,v 1.87 2010/06/06 10:15:51 skrll Exp $       */
 
 /*-
  * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@@ -58,7 +58,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.86 2010/06/06 09:12:39 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.87 2010/06/06 10:15:51 skrll Exp $");
 
 #include "opt_cputype.h"
 #include "opt_ddb.h"
@@ -256,8 +256,7 @@
 /* Virtual page frame for /dev/mem (see mem.c) */
 vaddr_t vmmap;
 
-/* Our exported CPU info; we can have only one. */
-struct cpu_info cpu_info_store = {
+struct cpu_info cpus[HPPA_MAXCPUS] = {
 #ifdef MULTIPROCESSOR
        .ci_curlwp = &lwp0
 #endif
diff -r 1601a7f21444 -r 8198cf822487 sys/arch/hp700/include/cpu.h
--- a/sys/arch/hp700/include/cpu.h      Sun Jun 06 09:12:39 2010 +0000
+++ b/sys/arch/hp700/include/cpu.h      Sun Jun 06 10:15:51 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpu.h,v 1.49 2010/06/04 06:39:38 skrll Exp $   */
+/*     $NetBSD: cpu.h,v 1.50 2010/06/06 10:15:51 skrll Exp $   */
 
 /*     $OpenBSD: cpu.h,v 1.55 2008/07/23 17:39:35 kettenis Exp $       */
 
@@ -243,25 +243,28 @@
 } __aligned(64);
 
 
-extern struct cpu_info cpu_info_store;
-
 /*
  * definitions of cpu-dependent requirements
  * referenced in generic code
  */
 
-#define        curcpu()                        (&cpu_info_store)
-#define        cpu_number()                    0
-
 #define        cpu_proc_fork(p1, p2)
 
 #ifdef MULTIPROCESSOR
-#define        CPU_IS_PRIMARY(ci)              1
+
+#define        HPPA_MAXCPUS    4
+#define        cpu_number()                    (curcpu()->ci_cpuid)
+
+#define        CPU_IS_PRIMARY(ci)              ((ci)->ci_cpuid == 0)
 #define        CPU_INFO_ITERATOR               int
-#define        CPU_INFO_FOREACH(cii, ci)       cii = 0; ci = curcpu(), cii < 1; cii++
+#define        CPU_INFO_FOREACH(cii, ci)       cii = 0; ci =  &cpu_info[0], cii < ncpus; cii++, ci++
 
 void   cpu_boot_secondary_processors(void);
-#endif /* MULTIPROCESSOR */
+#else /* MULTIPROCESSOR */
+
+#define        HPPA_MAXCPUS    1
+#define        curcpu()                        (&cpus[0])
+#define        cpu_number()                    0
 
 static __inline struct lwp *
 hppa_curlwp(void)
@@ -275,6 +278,10 @@
 
 #define        curlwp                          hppa_curlwp()
 
+#endif /* MULTIPROCESSOR */
+
+extern struct cpu_info cpus[HPPA_MAXCPUS];
+
 #define        DELAY(x) delay(x)
 
 static __inline paddr_t



Home | Main Index | Thread Index | Old Index