From 0d42f1b3cf2513ae0e07b2ab3ccd8091c56dda17 Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Sun, 12 Nov 2023 13:07:45 +0800 Subject: [PATCH] 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 --- arch/sim/src/sim/sim_heap.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/sim/src/sim/sim_heap.c b/arch/sim/src/sim/sim_heap.c index f7b3ea092c..17cb5e198d 100644 --- a/arch/sim/src/sim/sim_heap.c +++ b/arch/sim/src/sim/sim_heap.c @@ -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 */