diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2021-06-20 16:51:38 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2021-06-20 16:51:38 +0000 |
commit | c901253ae17f90663b2adca1eef52fe82d37a274 (patch) | |
tree | 930e8ca7959df4aaafc58594b9d9083a7af0d7c0 /sys/arch/riscv64 | |
parent | 879e51dbf2a08924e461e932d3726a0aeaf7c59e (diff) |
Skip disabled cpus (usually service cpus without full functionality).
cpumatch will also ignore them, but skipping them here avoids increment
of hw.cpusfound
ok jsg
Diffstat (limited to 'sys/arch/riscv64')
-rw-r--r-- | sys/arch/riscv64/dev/mainbus.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/arch/riscv64/dev/mainbus.c b/sys/arch/riscv64/dev/mainbus.c index 75b72e99384..d68acbd68c4 100644 --- a/sys/arch/riscv64/dev/mainbus.c +++ b/sys/arch/riscv64/dev/mainbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mainbus.c,v 1.7 2021/05/14 06:48:52 jsg Exp $ */ +/* $OpenBSD: mainbus.c,v 1.8 2021/06/20 16:51:37 deraadt Exp $ */ /* * Copyright (c) 2016 Patrick Wildt <patrick@blueri.se> @@ -303,6 +303,10 @@ mainbus_attach_cpus(struct device *self, cfmatch_t match) ncpusfound = 0; for (node = OF_child(node); node != 0; node = OF_peer(node)) { + if (OF_getprop(node, "status", buf, sizeof(buf)) > 0 && + strcmp(buf, "disabled") == 0) + continue; + if (OF_getprop(node, "device_type", buf, sizeof(buf)) > 0 && strcmp(buf, "cpu") == 0) ncpusfound++; |