spin_lock_irqsave() and spin_unlock_irqrestore() are only valid if the CPU supports global disabling of interrupts.

This commit is contained in:
Gregory Nutt
2018-02-04 15:41:22 -06:00
parent 5c5d19f1c8
commit 5beab6fbf0
5 changed files with 16 additions and 2 deletions
+4 -2
View File
@@ -247,7 +247,8 @@ void leave_critical_section(irqstate_t flags);
*
****************************************************************************/
#if defined (CONFIG_SMP) && defined (CONFIG_SPINLOCK_IRQ)
#if defined(CONFIG_SMP) && defined(CONFIG_SPINLOCK_IRQ) && \
defined(CONFIG_ARCH_GLOBAL_IRQDISABLE)
irqstate_t spin_lock_irqsave(void);
#else
# define spin_lock_irqsave(f) enter_critical_section(f)
@@ -275,7 +276,8 @@ irqstate_t spin_lock_irqsave(void);
*
****************************************************************************/
#if defined (CONFIG_SMP) && defined (CONFIG_SPINLOCK_IRQ)
#if defined(CONFIG_SMP) && defined(CONFIG_SPINLOCK_IRQ) && \
defined(CONFIG_ARCH_GLOBAL_IRQDISABLE)
void spin_unlock_irqrestore(irqstate_t flags);
#else
# define spin_unlock_irqrestore(f) leave_critical_section(f)