mirror of
https://github.com/apache/nuttx.git
synced 2026-06-07 17:33:08 +08:00
spin_lock_irqsave() and spin_unlock_irqrestore() are only valid if the CPU supports global disabling of interrupts.
This commit is contained in:
+4
-2
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user