This is an automated email from the ASF dual-hosted git repository.
pkarashchenko pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new 0d42f1b3cf arch/sim: Replace [enter|leave]_critical_section with
up_irq_[save|restore]
0d42f1b3cf is described below
commit 0d42f1b3cf2513ae0e07b2ab3ccd8091c56dda17
Author: Xiang Xiao <[email protected]>
AuthorDate: Sun Nov 12 13:07:45 2023 +0800
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 <[email protected]>
---
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 */