diff options
author | tijl <tijl@FreeBSD.org> | 2015-11-08 14:26:50 +0000 |
---|---|---|
committer | tijl <tijl@FreeBSD.org> | 2015-11-08 14:26:50 +0000 |
commit | 4e8b6b4a06e9b8bd64928b39a5a6cfe0fabaf9f0 (patch) | |
tree | d99bd7707b05f7869f04d5798da496d2d1e398bd /sys/arm/qemu | |
parent | d94cce972ea22ac1b6d1ef125b413808e1dadf36 (diff) | |
download | FreeBSD-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.c | 16 |
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 |