kernel: Simplify k_thread_cpu_pin()
Simplifies the k_thread_cpu_pin() implementation to leverage the existing cpu_mask_mod() infrastructure. Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
This commit is contained in:
parent
dda9ba6031
commit
eda5814dbc
1 changed files with 2 additions and 6 deletions
|
@ -66,11 +66,7 @@ int k_thread_cpu_mask_disable(k_tid_t thread, int cpu)
|
||||||
|
|
||||||
int k_thread_cpu_pin(k_tid_t thread, int cpu)
|
int k_thread_cpu_pin(k_tid_t thread, int cpu)
|
||||||
{
|
{
|
||||||
int ret;
|
uint32_t mask = BIT(cpu);
|
||||||
|
|
||||||
ret = k_thread_cpu_mask_clear(thread);
|
return cpu_mask_mod(thread, mask, ~mask);
|
||||||
if (ret == 0) {
|
|
||||||
return k_thread_cpu_mask_enable(thread, cpu);
|
|
||||||
}
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue