summaryrefslogtreecommitdiffstats
path: root/sys/arm/qemu
diff options
context:
space:
mode:
authortijl <tijl@FreeBSD.org>2015-11-08 14:26:50 +0000
committertijl <tijl@FreeBSD.org>2015-11-08 14:26:50 +0000
commit4e8b6b4a06e9b8bd64928b39a5a6cfe0fabaf9f0 (patch)
treed99bd7707b05f7869f04d5798da496d2d1e398bd /sys/arm/qemu
parentd94cce972ea22ac1b6d1ef125b413808e1dadf36 (diff)
downloadFreeBSD-src-4e8b6b4a06e9b8bd64928b39a5a6cfe0fabaf9f0.zip
FreeBSD-src-4e8b6b4a06e9b8bd64928b39a5a6cfe0fabaf9f0.tar.gz
Since r289279 bufinit() uses mp_ncpus, but some architectures set this
variable during mp_start() which is too late. Move this to mp_setmaxid() where other architectures set it and move x86 assertions to MI code. Reviewed by: kib (x86 part)
Diffstat (limited to 'sys/arm/qemu')
-rw-r--r--sys/arm/qemu/virt_mp.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/sys/arm/qemu/virt_mp.c b/sys/arm/qemu/virt_mp.c
index 2fe1592..89a30c6 100644
--- a/sys/arm/qemu/virt_mp.c
+++ b/sys/arm/qemu/virt_mp.c
@@ -49,17 +49,8 @@ static int running_cpus;
int
platform_mp_probe(void)
{
- int ncpus;
- ncpus = ofw_cpu_early_foreach(NULL, true);
- if (ncpus <= 1) {
- mp_ncpus = 1;
- return (0);
- }
-
- mp_ncpus = MIN(ncpus, MAXCPU);
-
- return (1);
+ return (mp_ncpus > 1);
}
static boolean_t
@@ -77,7 +68,10 @@ platform_mp_setmaxid(void)
{
mp_maxid = PCPU_GET(cpuid);
- ofw_cpu_early_foreach(virt_maxid, true);
+ mp_ncpus = ofw_cpu_early_foreach(virt_maxid, true);
+ if (mp_ncpus < 1)
+ mp_ncpus = 1;
+ mp_ncpus = MIN(ncpus, MAXCPU);
}
static boolean_t
OpenPOWER on IntegriCloud