Skip to content

Commit

Permalink
arch-riscv: Remove CPU_SET use for non-linux host (gem5#1835)
Browse files Browse the repository at this point in the history
For non-Linux systems, we use cpu_set_cpu. CPU_SET is a macro that is
not available for non-Linux systems.

Fixes gem5#1720
  • Loading branch information
BobbyRBruce authored Dec 4, 2024
1 parent 7e1713d commit 2625d23
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/arch/riscv/linux/se_workload.cc
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,14 @@ get_cpu_online_mask(ThreadContext *tc)
RiscvLinux::cpumask_t *cpu_online_mask = cpumask_malloc(tc);
if (cpu_online_mask != nullptr) {
for (int i = 0; i < tc->getSystemPtr()->threads.size(); i++) {
CPU_SET(i, (cpu_set_t *)&cpu_online_mask->bits);
#ifdef __linux__
CPU_SET(i, (cpu_set_t *)&cpu_online_mask->bits);
#else
// For non-Linux systems, we use cpumask_set_cpu.
// CPU_SET is a macro that is not available on all
// non-Linux systems.
cpumask_set_cpu(i, cpu_online_mask);
#endif
}
}

Expand Down

0 comments on commit 2625d23

Please sign in to comment.