summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2007-11-10 00:22:30 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2007-11-10 00:22:30 +0000
commit7cde6e34b7b6d52afd0b7cb965244ae2f67bb8b5 (patch)
tree09a76fcc84284d10e26284487174a2c4c00e5eb1 /sys
parent7236181631362420374951296b3685a5af49b7b0 (diff)
For single-processor kernels, only match the CPU we're running on.
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/sparc64/sparc64/cpu.c25
1 files changed, 23 insertions, 2 deletions
diff --git a/sys/arch/sparc64/sparc64/cpu.c b/sys/arch/sparc64/sparc64/cpu.c
index eda5c156a5e..9743024c43a 100644
--- a/sys/arch/sparc64/sparc64/cpu.c
+++ b/sys/arch/sparc64/sparc64/cpu.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cpu.c,v 1.29 2007/11/09 16:13:52 kettenis Exp $ */
+/* $OpenBSD: cpu.c,v 1.30 2007/11/10 00:22:29 kettenis Exp $ */
/* $NetBSD: cpu.c,v 1.13 2001/05/26 21:27:15 chs Exp $ */
/*
@@ -174,8 +174,29 @@ cpu_match(parent, vcf, aux)
{
struct mainbus_attach_args *ma = aux;
struct cfdata *cf = (struct cfdata *)vcf;
+#ifndef MULTIPROCESSOR
+ int portid;
+#endif
+
+ if (strcmp(cf->cf_driver->cd_name, ma->ma_name) != 0)
+ return (0);
+
+#ifndef MULTIPROCESSOR
+ /*
+ * On singleprocessor kernels, only match the CPU we're
+ * running on.
+ */
+ portid = getpropint(ma->ma_node, "portid", -1);
+ if (portid == -1)
+ portid = getpropint(ma->ma_node, "upa-portid", -1);
+ if (portid == -1)
+ return (0);
+
+ if (portid != cpus->ci_upaid)
+ return (0);
+#endif
- return (strcmp(cf->cf_driver->cd_name, ma->ma_name) == 0);
+ return (1);
}
/*