mirror of
https://github.com/apache/nuttx.git
synced 2026-06-04 23:03:27 +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:
@@ -210,6 +210,10 @@ config ARCH_HAVE_RTC_SUBSECONDS
|
|||||||
bool
|
bool
|
||||||
default n
|
default n
|
||||||
|
|
||||||
|
config ARCH_GLOBAL_IRQDISABLE
|
||||||
|
bool
|
||||||
|
defautl n
|
||||||
|
|
||||||
config ARCH_USE_MMU
|
config ARCH_USE_MMU
|
||||||
bool "Enable MMU"
|
bool "Enable MMU"
|
||||||
default n
|
default n
|
||||||
|
|||||||
@@ -107,6 +107,7 @@ config ARCH_CHIP_LC823450
|
|||||||
select ARCH_HAVE_HEAPCHECK
|
select ARCH_HAVE_HEAPCHECK
|
||||||
select ARCH_HAVE_MULTICPU
|
select ARCH_HAVE_MULTICPU
|
||||||
select ARCH_HAVE_I2CRESET
|
select ARCH_HAVE_I2CRESET
|
||||||
|
select ARCH_GLOBAL_IRQDISABLE
|
||||||
---help---
|
---help---
|
||||||
ON Semiconductor LC823450 architectures (ARM dual Cortex-M3)
|
ON Semiconductor LC823450 architectures (ARM dual Cortex-M3)
|
||||||
|
|
||||||
|
|||||||
+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);
|
irqstate_t spin_lock_irqsave(void);
|
||||||
#else
|
#else
|
||||||
# define spin_lock_irqsave(f) enter_critical_section(f)
|
# 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);
|
void spin_unlock_irqrestore(irqstate_t flags);
|
||||||
#else
|
#else
|
||||||
# define spin_unlock_irqrestore(f) leave_critical_section(f)
|
# define spin_unlock_irqrestore(f) leave_critical_section(f)
|
||||||
|
|||||||
@@ -38,8 +38,10 @@ CSRCS += irq_initialize.c irq_attach.c irq_dispatch.c irq_unexpectedisr.c
|
|||||||
ifeq ($(CONFIG_SMP),y)
|
ifeq ($(CONFIG_SMP),y)
|
||||||
CSRCS += irq_csection.c
|
CSRCS += irq_csection.c
|
||||||
ifeq ($(CONFIG_SPINLOCK_IRQ),y)
|
ifeq ($(CONFIG_SPINLOCK_IRQ),y)
|
||||||
|
ifeq ($(CONFIG_ARCH_GLOBAL_IRQDISABLE),y)
|
||||||
CSRCS += irq_spinlock.c
|
CSRCS += irq_spinlock.c
|
||||||
endif
|
endif
|
||||||
|
endif
|
||||||
else ifeq ($(CONFIG_SCHED_INSTRUMENTATION_CSECTION),y)
|
else ifeq ($(CONFIG_SCHED_INSTRUMENTATION_CSECTION),y)
|
||||||
CSRCS += irq_csection.c
|
CSRCS += irq_csection.c
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -45,6 +45,9 @@
|
|||||||
|
|
||||||
#include "sched/sched.h"
|
#include "sched/sched.h"
|
||||||
|
|
||||||
|
#if defined(CONFIG_SMP) && defined (CONFIG_SPINLOCK_IRQ) && \
|
||||||
|
defined(CONFIG_ARCH_GLOBAL_IRQDISABLE)
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Data
|
* Public Data
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
@@ -138,3 +141,5 @@ void spin_unlock_irqrestore(irqstate_t flags)
|
|||||||
|
|
||||||
up_irq_restore(flags);
|
up_irq_restore(flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif /* CONFIG_SMP && CONFIG_SPINLOCK_IRQ && CONFIG_ARCH_GLOBAL_IRQDISABLE */
|
||||||
|
|||||||
Reference in New Issue
Block a user