summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2018-02-24 09:45:11 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2018-02-24 09:45:11 +0000
commitbb58ea87db593b2db211c2a4a99d0410097b9e71 (patch)
treeea71a6d12286ad420abbedafc5e5920c8907abdc
parent3bca2b7f39b20976e8afaeb5030f13985310a267 (diff)
Make ncpusfound count the available processors even if they don't attach.
ok patrick@
-rw-r--r--sys/arch/arm64/arm64/cpu.c10
-rw-r--r--sys/arch/arm64/dev/mainbus.c11
2 files changed, 10 insertions, 11 deletions
diff --git a/sys/arch/arm64/arm64/cpu.c b/sys/arch/arm64/arm64/cpu.c
index de474b7cec9..b88d4e81a15 100644
--- a/sys/arch/arm64/arm64/cpu.c
+++ b/sys/arch/arm64/arm64/cpu.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cpu.c,v 1.15 2018/02/23 19:08:56 kettenis Exp $ */
+/* $OpenBSD: cpu.c,v 1.16 2018/02/24 09:45:10 kettenis Exp $ */
/*
* Copyright (c) 2016 Dale Rahn <drahn@dalerahn.com>
@@ -231,20 +231,12 @@ cpu_attach(struct device *parent, struct device *dev, void *aux)
}
#ifdef MULTIPROCESSOR
else {
- ncpusfound++;
ci = malloc(sizeof(*ci), M_DEVBUF, M_WAITOK | M_ZERO);
cpu_info[dev->dv_unit] = ci;
ci->ci_next = cpu_info_list->ci_next;
cpu_info_list->ci_next = ci;
ci->ci_flags |= CPUF_AP;
}
-#else
- else {
- ncpusfound++;
- printf(" mpidr %llx not configured\n",
- faa->fa_reg[0].addr);
- return;
- }
#endif
ci->ci_dev = dev;
diff --git a/sys/arch/arm64/dev/mainbus.c b/sys/arch/arm64/dev/mainbus.c
index 474e2397b17..4205acff7a1 100644
--- a/sys/arch/arm64/dev/mainbus.c
+++ b/sys/arch/arm64/dev/mainbus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mainbus.c,v 1.8 2018/01/04 14:30:08 kettenis Exp $ */
+/* $OpenBSD: mainbus.c,v 1.9 2018/02/24 09:45:10 kettenis Exp $ */
/*
* Copyright (c) 2016 Patrick Wildt <patrick@blueri.se>
* Copyright (c) 2017 Mark Kettenis <kettenis@openbsd.org>
@@ -236,6 +236,7 @@ mainbus_attach_cpus(struct device *self, cfmatch_t match)
struct mainbus_softc *sc = (struct mainbus_softc *)self;
int node = OF_finddevice("/cpus");
int acells, scells;
+ char buf[32];
if (node == 0)
return;
@@ -245,8 +246,14 @@ mainbus_attach_cpus(struct device *self, cfmatch_t match)
sc->sc_acells = OF_getpropint(node, "#address-cells", 2);
sc->sc_scells = OF_getpropint(node, "#size-cells", 0);
- for (node = OF_child(node); node != 0; node = OF_peer(node))
+ ncpusfound = 0;
+ for (node = OF_child(node); node != 0; node = OF_peer(node)) {
+ if (OF_getprop(node, "device_type", buf, sizeof(buf)) > 0 &&
+ strcmp(buf, "cpu") == 0)
+ ncpusfound++;
+
mainbus_attach_node(self, node, match);
+ }
sc->sc_acells = acells;
sc->sc_scells = scells;