mirror of
https://github.com/apache/nuttx.git
synced 2026-06-01 07:45:16 +08:00
arch/sim: Replace [enter|leave]_critical_section with up_irq_[save|restore]
since it's enough to protect per cpu data with irq disabling Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
committed by
Petro Karashchenko
parent
e1274d1c42
commit
0d42f1b3cf
@@ -72,12 +72,12 @@ static void mm_add_delaylist(struct mm_heap_s *heap, void *mem)
|
|||||||
|
|
||||||
/* Delay the deallocation until a more appropriate time. */
|
/* Delay the deallocation until a more appropriate time. */
|
||||||
|
|
||||||
flags = enter_critical_section();
|
flags = up_irq_save();
|
||||||
|
|
||||||
tmp->flink = heap->mm_delaylist[up_cpu_index()];
|
tmp->flink = heap->mm_delaylist[up_cpu_index()];
|
||||||
heap->mm_delaylist[up_cpu_index()] = tmp;
|
heap->mm_delaylist[up_cpu_index()] = tmp;
|
||||||
|
|
||||||
leave_critical_section(flags);
|
up_irq_restore(flags);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -89,12 +89,12 @@ static void mm_free_delaylist(struct mm_heap_s *heap)
|
|||||||
|
|
||||||
/* Move the delay list to local */
|
/* Move the delay list to local */
|
||||||
|
|
||||||
flags = enter_critical_section();
|
flags = up_irq_save();
|
||||||
|
|
||||||
tmp = heap->mm_delaylist[up_cpu_index()];
|
tmp = heap->mm_delaylist[up_cpu_index()];
|
||||||
heap->mm_delaylist[up_cpu_index()] = NULL;
|
heap->mm_delaylist[up_cpu_index()] = NULL;
|
||||||
|
|
||||||
leave_critical_section(flags);
|
up_irq_restore(flags);
|
||||||
|
|
||||||
/* Test if the delayed is empty */
|
/* Test if the delayed is empty */
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user