Module Name: src Committed By: skrll Date: Sun Jun 6 10:15:51 UTC 2010
Modified Files: src/sys/arch/hp700/hp700: machdep.c src/sys/arch/hp700/include: cpu.h To generate a diff of this commit: cvs rdiff -u -r1.86 -r1.87 src/sys/arch/hp700/hp700/machdep.c cvs rdiff -u -r1.49 -r1.50 src/sys/arch/hp700/include/cpu.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/hp700/hp700/machdep.c diff -u src/sys/arch/hp700/hp700/machdep.c:1.86 src/sys/arch/hp700/hp700/machdep.c:1.87 --- src/sys/arch/hp700/hp700/machdep.c:1.86 Sun Jun 6 09:12:39 2010 +++ src/sys/arch/hp700/hp700/machdep.c Sun Jun 6 10:15:51 2010 @@ -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 Index: src/sys/arch/hp700/include/cpu.h diff -u src/sys/arch/hp700/include/cpu.h:1.49 src/sys/arch/hp700/include/cpu.h:1.50 --- src/sys/arch/hp700/include/cpu.h:1.49 Fri Jun 4 06:39:38 2010 +++ src/sys/arch/hp700/include/cpu.h Sun Jun 6 10:15:51 2010 @@ -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