diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2007-11-16 23:27:29 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2007-11-16 23:27:29 +0000 |
commit | 7df657fb833b121970634f4c7f42cf706342500d (patch) | |
tree | cf78087997aeaf0ef229523066c3c09e6a021f04 /sys/arch/sparc64 | |
parent | 8cd1be59a0a22ceaf89ca0c49ed83b78d2849108 (diff) |
Pass name of CPU nodes instead of "cpu" such that we see it for unconfigured
CPUs on UP kernels.
Diffstat (limited to 'sys/arch/sparc64')
-rw-r--r-- | sys/arch/sparc64/sparc64/autoconf.c | 17 | ||||
-rw-r--r-- | sys/arch/sparc64/sparc64/cpu.c | 8 |
2 files changed, 15 insertions, 10 deletions
diff --git a/sys/arch/sparc64/sparc64/autoconf.c b/sys/arch/sparc64/sparc64/autoconf.c index b8628b43b55..dc7905ef334 100644 --- a/sys/arch/sparc64/sparc64/autoconf.c +++ b/sys/arch/sparc64/sparc64/autoconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: autoconf.c,v 1.74 2007/10/31 22:21:43 kettenis Exp $ */ +/* $OpenBSD: autoconf.c,v 1.75 2007/11/16 23:27:28 kettenis Exp $ */ /* $NetBSD: autoconf.c,v 1.51 2001/07/24 19:32:11 eeh Exp $ */ /* @@ -719,8 +719,11 @@ extern bus_space_tag_t mainbus_space_tag; ma.ma_bustag = mainbus_space_tag; ma.ma_dmatag = &mainbus_dma_tag; ma.ma_node = node; - ma.ma_name = "cpu"; - config_found(dev, (void *)&ma, mbprint); + OF_getprop(node, "name", buf, sizeof(buf)); + if (strcmp(buf, "cpu") == 0) + OF_getprop(node, "compatible", buf, sizeof(buf)); + ma.ma_name = buf; + config_found(dev, &ma, mbprint); ncpus++; } @@ -750,8 +753,8 @@ extern bus_space_tag_t mainbus_space_tag; int portid; DPRINTF(ACDB_PROBE, ("Node: %x", node)); - if ((OF_getprop(node, "device_type", buf, sizeof(buf)) > 0) && - strcmp(buf, "cpu") == 0) + if (OF_getprop(node, "device_type", buf, sizeof(buf)) > 0 && + strcmp(buf, "cpu") == 0) continue; OF_getprop(node, "name", buf, sizeof(buf)); DPRINTF(ACDB_PROBE, (" name %s\n", buf)); @@ -819,7 +822,7 @@ extern bus_space_tag_t mainbus_space_tag; printf(" no address\n"); } #endif - (void) config_found(dev, (void *)&ma, mbprint); + config_found(dev, &ma, mbprint); free(ma.ma_reg, M_DEVBUF); if (ma.ma_ninterrupts) free(ma.ma_interrupts, M_DEVBUF); @@ -829,7 +832,7 @@ extern bus_space_tag_t mainbus_space_tag; /* Try to attach PROM console */ bzero(&ma, sizeof ma); ma.ma_name = "pcons"; - (void) config_found(dev, (void *)&ma, mbprint); + config_found(dev, &ma, mbprint); } struct cfattach mainbus_ca = { diff --git a/sys/arch/sparc64/sparc64/cpu.c b/sys/arch/sparc64/sparc64/cpu.c index 9743024c43a..262c61b1513 100644 --- a/sys/arch/sparc64/sparc64/cpu.c +++ b/sys/arch/sparc64/sparc64/cpu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.c,v 1.30 2007/11/10 00:22:29 kettenis Exp $ */ +/* $OpenBSD: cpu.c,v 1.31 2007/11/16 23:27:28 kettenis Exp $ */ /* $NetBSD: cpu.c,v 1.13 2001/05/26 21:27:15 chs Exp $ */ /* @@ -62,6 +62,7 @@ #include <machine/cpu.h> #include <machine/reg.h> #include <machine/trap.h> +#include <machine/openfirm.h> #include <machine/pmap.h> #include <machine/sparc64.h> @@ -173,12 +174,13 @@ cpu_match(parent, vcf, aux) void *aux; { struct mainbus_attach_args *ma = aux; - struct cfdata *cf = (struct cfdata *)vcf; #ifndef MULTIPROCESSOR int portid; #endif + char buf[32]; - if (strcmp(cf->cf_driver->cd_name, ma->ma_name) != 0) + if (OF_getprop(ma->ma_node, "device_type", buf, sizeof(buf)) <= 0 || + strcmp(buf, "cpu") != 0) return (0); #ifndef MULTIPROCESSOR |