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:
Xiang Xiao 2023-11-12 13:07:45 +08:00 committed by Petro Karashchenko
parent e1274d1c42
commit 0d42f1b3cf
1 changed files with 4 additions and 4 deletions

View File

@ -72,12 +72,12 @@ static void mm_add_delaylist(struct mm_heap_s *heap, void *mem)
/* Delay the deallocation until a more appropriate time. */
flags = enter_critical_section();
flags = up_irq_save();
tmp->flink = heap->mm_delaylist[up_cpu_index()];
heap->mm_delaylist[up_cpu_index()] = tmp;
leave_critical_section(flags);
up_irq_restore(flags);
#endif
}
@ -89,12 +89,12 @@ static void mm_free_delaylist(struct mm_heap_s *heap)
/* Move the delay list to local */
flags = enter_critical_section();
flags = up_irq_save();
tmp = heap->mm_delaylist[up_cpu_index()];
heap->mm_delaylist[up_cpu_index()] = NULL;
leave_critical_section(flags);
up_irq_restore(flags);
/* Test if the delayed is empty */