Skip to content

Commit

Permalink
smp
Browse files Browse the repository at this point in the history
  • Loading branch information
zhuzhuzhus authored and Rbb666 committed Sep 24, 2024
1 parent d8956e4 commit d037952
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions components/drivers/smp/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ void rt_smp_call_func_cond(int cpu_mask, rt_smp_call_func_back func, void *data,
int cpuid = 1 << cur_cpu;
int tmp_id = 0, cpu_nr = 0;
int tmp_mask;
int irq_flag;

if (flag == SMP_CALL_WAIT_ALL)
{
Expand Down Expand Up @@ -101,9 +102,9 @@ void rt_smp_call_func_cond(int cpu_mask, rt_smp_call_func_back func, void *data,
event.func = func;
event.data = data;
event.cpu_mask = cpu_mask;
rt_spin_lock(&rt_smp_work[tmp_id].lock);
irq_flag = rt_spin_lock_irqsave(&rt_smp_work[tmp_id].lock);
rt_smp_work[tmp_id].event = event;
rt_spin_unlock(&rt_smp_work[tmp_id].lock);
rt_spin_unlock_irqrestore(&rt_smp_work[tmp_id].lock,irq_flag);
}
tmp_id++;
tmp_mask = tmp_mask >> 1;
Expand Down

0 comments on commit d037952

Please sign in to comment.