summaryrefslogtreecommitdiff
path: root/sys/arch/mips64
diff options
context:
space:
mode:
authorTakuya ASADA <syuu@cvs.openbsd.org>2009-10-30 08:13:58 +0000
committerTakuya ASADA <syuu@cvs.openbsd.org>2009-10-30 08:13:58 +0000
commit7b2ee8a540c68bc249a4734323bb044e004e7bd0 (patch)
tree0254ef28bec4f8b9a50f9d123bb7907e7e80d12d /sys/arch/mips64
parent95686a4205e4b4f0e746d26a3ad510beaa475f29 (diff)
Support IP30 secondary cpu bootup. ok miod@
Diffstat (limited to 'sys/arch/mips64')
-rw-r--r--sys/arch/mips64/include/cpu.h4
-rw-r--r--sys/arch/mips64/mips64/cpu.c19
2 files changed, 18 insertions, 5 deletions
diff --git a/sys/arch/mips64/include/cpu.h b/sys/arch/mips64/include/cpu.h
index a1eb25d6591..25c16aee8c5 100644
--- a/sys/arch/mips64/include/cpu.h
+++ b/sys/arch/mips64/include/cpu.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: cpu.h,v 1.41 2009/10/22 22:08:52 miod Exp $ */
+/* $OpenBSD: cpu.h,v 1.42 2009/10/30 08:13:57 syuu Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -403,6 +403,8 @@ extern struct cpuset cpus_running;
extern struct cpu_info *cpu_info[];
void cpu_unidle(struct cpu_info *);
void cpu_boot_secondary_processors(void);
+#define cpu_boot_secondary(ci) hw_cpu_boot_secondary(ci)
+#define cpu_hatch(ci) hw_cpu_hatch(ci)
#include <sys/mplock.h>
#else
diff --git a/sys/arch/mips64/mips64/cpu.c b/sys/arch/mips64/mips64/cpu.c
index 428285ee1ef..8d14587e6ec 100644
--- a/sys/arch/mips64/mips64/cpu.c
+++ b/sys/arch/mips64/mips64/cpu.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cpu.c,v 1.15 2009/10/26 20:14:40 miod Exp $ */
+/* $OpenBSD: cpu.c,v 1.16 2009/10/30 08:13:57 syuu Exp $ */
/*
* Copyright (c) 1997-2004 Opsycon AB (www.opsycon.se)
@@ -99,13 +99,11 @@ cpuattach(struct device *parent, struct device *dev, void *aux)
int isr16k = 0;
int displayver;
-#ifdef MULTIPROCESSOR
- cpuset_add(&cpus_running, ci);
-#endif
if (cpuno == 0) {
ci = &cpu_info_primary;
#ifdef MULTIPROCESSOR
ci->ci_flags |= CPUF_RUNNING | CPUF_PRESENT | CPUF_PRIMARY;
+ cpuset_add(&cpus_running, ci);
#endif
bcopy(dev, &ci->ci_dev, sizeof *dev);
}
@@ -315,6 +313,19 @@ cpuattach(struct device *parent, struct device *dev, void *aux)
void
cpu_boot_secondary_processors(void)
{
+ struct cpu_info *ci;
+ u_long i;
+
+ for (i = 0; i < MAXCPUS; i++) {
+ ci = cpu_info[i];
+ if (ci == NULL)
+ continue;
+ if ((ci->ci_flags & CPUF_PRESENT) == 0)
+ continue;
+ if (ci->ci_flags & CPUF_PRIMARY)
+ continue;
+ cpu_boot_secondary(ci);
+ }
}
void