diff options
author | Attilio Rao <attilio@FreeBSD.org> | 2011-05-13 19:56:58 +0000 |
---|---|---|
committer | Attilio Rao <attilio@FreeBSD.org> | 2011-05-13 19:56:58 +0000 |
commit | f89d6b3f06c9688c2326b2f172d3bafea07f5685 (patch) | |
tree | d2889bf496fba4f4f14a81f1881c272545fd637f | |
parent | 245a25353805f3a2951d932c19b24a3911a53a22 (diff) |
Notes
-rw-r--r-- | sys/mips/cavium/octeon_mp.c | 10 | ||||
-rw-r--r-- | sys/mips/include/hwfunc.h | 2 | ||||
-rw-r--r-- | sys/mips/mips/mp_machdep.c | 4 | ||||
-rw-r--r-- | sys/mips/rmi/xlr_machdep.c | 10 | ||||
-rw-r--r-- | sys/mips/sibyte/sb_scd.c | 10 |
5 files changed, 15 insertions, 21 deletions
diff --git a/sys/mips/cavium/octeon_mp.c b/sys/mips/cavium/octeon_mp.c index 5e494b895c96..efddee86ae0f 100644 --- a/sys/mips/cavium/octeon_mp.c +++ b/sys/mips/cavium/octeon_mp.c @@ -102,20 +102,18 @@ platform_init_ap(int cpuid) mips_wbflush(); } -cpuset_t -platform_cpu_mask(void) +void +platform_cpu_mask(cpuset_t *mask) { - cpuset_t cpumask; - CPU_ZERO(&cpumask); + CPU_ZERO(mask); /* * XXX: hack in order to simplify CPU set building, assuming that * core_mask is 32-bits. */ - memcpy(&cpumask, &octeon_bootinfo->core_mask, + memcpy(mask, &octeon_bootinfo->core_mask, sizeof(octeon_bootinfo->core_mask)); - return (cpumask); } struct cpu_group * diff --git a/sys/mips/include/hwfunc.h b/sys/mips/include/hwfunc.h index 4e6ddf548b4c..a9e3285f5395 100644 --- a/sys/mips/include/hwfunc.h +++ b/sys/mips/include/hwfunc.h @@ -93,7 +93,7 @@ extern int platform_processor_id(void); /* * Return the cpumask of available processors. */ -extern cpuset_t platform_cpu_mask(void); +extern void platform_cpu_mask(cpuset_t *mask); /* * Return the topology of processors on this platform diff --git a/sys/mips/mips/mp_machdep.c b/sys/mips/mips/mp_machdep.c index eb36d6fef653..289c0a77b58b 100644 --- a/sys/mips/mips/mp_machdep.c +++ b/sys/mips/mips/mp_machdep.c @@ -205,7 +205,7 @@ cpu_mp_setmaxid(void) cpuset_t cpumask; int cpu, last; - cpumask = platform_cpu_mask(); + platform_cpu_mask(&cpumask); mp_ncpus = 0; last = 1; while ((cpu = cpusetobj_ffs(&cpumask)) != 0) { @@ -247,7 +247,7 @@ cpu_mp_start(void) mtx_init(&ap_boot_mtx, "ap boot", NULL, MTX_SPIN); CPU_ZERO(&all_cpus); - cpumask = platform_cpu_mask(); + platform_cpu_mask(&cpumask); while (!CPU_EMPTY(&cpumask)) { cpuid = cpusetobj_ffs(&cpumask) - 1; diff --git a/sys/mips/rmi/xlr_machdep.c b/sys/mips/rmi/xlr_machdep.c index 7181a5caa864..836c605f7de3 100644 --- a/sys/mips/rmi/xlr_machdep.c +++ b/sys/mips/rmi/xlr_machdep.c @@ -614,17 +614,15 @@ platform_processor_id(void) return (xlr_hwtid_to_cpuid[xlr_cpu_id()]); } -cpuset_t -platform_cpu_mask(void) +void +platform_cpu_mask(cpuset_t *mask) { - cpuset_t cpumask; int i, s; - CPU_ZERO(&cpumask); + CPU_ZERO(mask); s = xlr_ncores * xlr_threads_per_core; for (i = 0; i < s; i++) - CPU_SET(i, &cpumask); - return (cpumask); + CPU_SET(i, mask); } struct cpu_group * diff --git a/sys/mips/sibyte/sb_scd.c b/sys/mips/sibyte/sb_scd.c index f2035d818180..50b99876acaa 100644 --- a/sys/mips/sibyte/sb_scd.c +++ b/sys/mips/sibyte/sb_scd.c @@ -243,17 +243,15 @@ sb_clear_mailbox(int cpu, uint64_t val) sb_store64(regaddr, val); } -cpuset_t -platform_cpu_mask(void) +void +platform_cpu_mask(cpuset_t *mask) { - cpuset_t cpumask; int i, s; - CPU_ZERO(&cpumask); + CPU_ZERO(mask); s = SYSREV_NUM_PROCESSORS(sb_read_sysrev()); for (i = 0; i < s; i++) - CPU_SET(i, &cpumask); - return (cpumask); + CPU_SET(i, mask); } #endif /* SMP */ |