summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/mips/cavium/octeon_mp.c10
-rw-r--r--sys/mips/include/hwfunc.h2
-rw-r--r--sys/mips/mips/mp_machdep.c4
-rw-r--r--sys/mips/rmi/xlr_machdep.c10
-rw-r--r--sys/mips/sibyte/sb_scd.c10
5 files changed, 15 insertions, 21 deletions
diff --git a/sys/mips/cavium/octeon_mp.c b/sys/mips/cavium/octeon_mp.c
index 5e494b8..efddee8 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 4e6ddf5..a9e3285 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 eb36d6f..289c0a7 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 7181a5c..836c605 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 f2035d8..50b9987 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 */
OpenPOWER on IntegriCloud