diff --git a/mm/mm_heap/mm.h b/mm/mm_heap/mm.h index f15a7d29ed..28cf0bae0d 100644 --- a/mm/mm_heap/mm.h +++ b/mm/mm_heap/mm.h @@ -258,7 +258,6 @@ struct mm_heap_s * immdiately. */ - spinlock_t mm_spinlock; FAR struct mm_delaynode_s *mm_delaylist[CONFIG_SMP_NCPUS]; /* The is a multiple mempool of the heap */ diff --git a/mm/mm_heap/mm_free.c b/mm/mm_heap/mm_free.c index d2f10fff77..881b025e02 100644 --- a/mm/mm_heap/mm_free.c +++ b/mm/mm_heap/mm_free.c @@ -45,12 +45,12 @@ static void add_delaylist(FAR struct mm_heap_s *heap, FAR void *mem) /* Delay the deallocation until a more appropriate time. */ - flags = spin_lock_irqsave(&heap->mm_spinlock); + flags = up_irq_save(); tmp->flink = heap->mm_delaylist[up_cpu_index()]; heap->mm_delaylist[up_cpu_index()] = tmp; - spin_unlock_irqrestore(&heap->mm_spinlock, flags); + up_irq_restore(flags); #endif } diff --git a/mm/mm_heap/mm_malloc.c b/mm/mm_heap/mm_malloc.c index 03691c4b1e..46f9648fea 100644 --- a/mm/mm_heap/mm_malloc.c +++ b/mm/mm_heap/mm_malloc.c @@ -47,12 +47,12 @@ static void free_delaylist(FAR struct mm_heap_s *heap) /* Move the delay list to local */ - flags = spin_lock_irqsave(&heap->mm_spinlock); + flags = up_irq_save(); tmp = heap->mm_delaylist[up_cpu_index()]; heap->mm_delaylist[up_cpu_index()] = NULL; - spin_unlock_irqrestore(&heap->mm_spinlock, flags); + up_irq_restore(flags); /* Test if the delayed is empty */ diff --git a/mm/tlsf/mm_tlsf.c b/mm/tlsf/mm_tlsf.c index 1bf906a4c1..8162976147 100644 --- a/mm/tlsf/mm_tlsf.c +++ b/mm/tlsf/mm_tlsf.c @@ -105,7 +105,6 @@ struct mm_heap_s /* Free delay list, for some situation can't do free immdiately */ - spinlock_t mm_spinlock; struct mm_delaynode_s *mm_delaylist[CONFIG_SMP_NCPUS]; #if defined(CONFIG_FS_PROCFS) && !defined(CONFIG_FS_PROCFS_EXCLUDE_MEMINFO) @@ -178,12 +177,12 @@ static void add_delaylist(FAR struct mm_heap_s *heap, FAR void *mem) /* Delay the deallocation until a more appropriate time. */ - flags = spin_lock_irqsave(&heap->mm_spinlock); + flags = up_irq_save(); tmp->flink = heap->mm_delaylist[up_cpu_index()]; heap->mm_delaylist[up_cpu_index()] = tmp; - spin_unlock_irqrestore(&heap->mm_spinlock, flags); + up_irq_restore(flags); #endif } @@ -199,12 +198,12 @@ static void free_delaylist(FAR struct mm_heap_s *heap) /* Move the delay list to local */ - flags = spin_lock_irqsave(&heap->mm_spinlock); + flags = up_irq_save(); tmp = heap->mm_delaylist[up_cpu_index()]; heap->mm_delaylist[up_cpu_index()] = NULL; - spin_unlock_irqrestore(&heap->mm_spinlock, flags); + up_irq_restore(flags); /* Test if the delayed is empty */