forked from nuttx/nuttx-update
Rename irqsave() and irqrestore() to up_irq_save() and up_irq_restore()
This commit is contained in:
parent
88c17bb4f2
commit
9cb2a6b1f9
10 changed files with 24 additions and 20 deletions
|
@ -11486,4 +11486,8 @@
|
|||
* Everywhere: Replace irqsave() with enter_critical_section(); replace
|
||||
irqrestore() with leave_critical_section(). This is part of the onging
|
||||
development of SMP support (2016-02-13).
|
||||
* Conform to naming convention: Rename irqsave() to up_irq_save(); rename
|
||||
irqrestore() to up_irq_restore(). These should no longer be used. If
|
||||
your code still uses them, please switch to enter_critical_section()
|
||||
and leave_critical_section() (2016-02-14).
|
||||
|
||||
|
|
4
TODO
4
TODO
|
@ -1604,8 +1604,8 @@ o Linux/Cywgin simulation (arch/sim)
|
|||
"faked" during IDLE loop processing and, as a result, there is no
|
||||
task pre-emption because there are no asynchronous events. This could
|
||||
probably be fixed if the "timer interrupt" were driver by Linux
|
||||
signals. NOTE: You would also have to implement irqsave() and
|
||||
irqrestore() to block and (conditionally) unblock the signal.
|
||||
signals. NOTE: You would also have to implement up_irq_save() and
|
||||
up_irq_restore() to block and (conditionally) unblock the signal.
|
||||
Status: Open
|
||||
Priority: Low
|
||||
|
||||
|
|
2
arch
2
arch
|
@ -1 +1 @@
|
|||
Subproject commit 354df5c0f3f7e0f4df605a85edef7d8e170843c1
|
||||
Subproject commit 4a9148e44aa3a1540ce26fc15599732c281cbbfd
|
2
configs
2
configs
|
@ -1 +1 @@
|
|||
Subproject commit cfbc3f7c3e07bf07b012e42933f3fea7c2397d52
|
||||
Subproject commit 904067c60cb19341e9f806710f7f8c20301a33e8
|
|
@ -1350,7 +1350,7 @@ bool up_interrupt_context(void);
|
|||
*
|
||||
* This function implements enabling of the device specified by 'irq'
|
||||
* at the interrupt controller level if supported by the architecture
|
||||
* (irqrestore() supports the global level, the device level is hardware
|
||||
* (up_irq_restore() supports the global level, the device level is hardware
|
||||
* specific).
|
||||
*
|
||||
* Since this API is not supported on all architectures, it should be
|
||||
|
@ -1368,7 +1368,7 @@ void up_enable_irq(int irq);
|
|||
* Description:
|
||||
* This function implements disabling of the device specified by 'irq'
|
||||
* at the interrupt controller level if supported by the architecture
|
||||
* (irqsave() supports the global level, the device level is hardware
|
||||
* (up_irq_save() supports the global level, the device level is hardware
|
||||
* specific).
|
||||
*
|
||||
* Since this API is not supported on all architectures, it should be
|
||||
|
|
|
@ -109,14 +109,14 @@ int irq_attach(int irq, xcpt_t isr);
|
|||
* specific counter is increment to indicate that the thread has IRQs
|
||||
* disabled and to support nested calls to enter_critical_section().
|
||||
* If SMP is not enabled:
|
||||
* This function is equivalent to irqsave().
|
||||
* This function is equivalent to up_irq_save().
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
irqstate_t enter_critical_section(void);
|
||||
#else
|
||||
# define enter_critical_section(f) irqsave(f)
|
||||
# define enter_critical_section(f) up_irq_save(f)
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
|
@ -127,14 +127,14 @@ irqstate_t enter_critical_section(void);
|
|||
* Decrement the IRQ lock count and if it decrements to zero then release
|
||||
* the spinlock.
|
||||
* If SMP is not enabled:
|
||||
* This function is equivalent to irqrestore().
|
||||
* This function is equivalent to up_irq_restore().
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
void leave_critical_section(irqstate_t flags);
|
||||
#else
|
||||
# define leave_critical_section(f) irqrestore(f)
|
||||
# define leave_critical_section(f) up_irq_restore(f)
|
||||
#endif
|
||||
|
||||
#undef EXTERN
|
||||
|
|
|
@ -97,7 +97,7 @@ irqstate_t enter_critical_section(void)
|
|||
|
||||
/* Then disable interrupts (if they have not already been disabeld) */
|
||||
|
||||
return irqsave();
|
||||
return up_irq_save();
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
@ -136,7 +136,7 @@ void leave_critical_section(irqstate_t flags)
|
|||
* disabled (but we don't have a mechanism to verify that now)
|
||||
*/
|
||||
|
||||
irqrestore(flags);
|
||||
up_irq_restore(flags);
|
||||
}
|
||||
|
||||
#endif /* CONFIG_SMP */
|
||||
|
|
|
@ -80,7 +80,7 @@
|
|||
|
||||
int irq_unexpected_isr(int irq, FAR void *context)
|
||||
{
|
||||
(void)irqsave();
|
||||
(void)up_irq_save();
|
||||
lldbg("irq: %d\n", irq);
|
||||
PANIC();
|
||||
return OK; /* Won't get here */
|
||||
|
|
|
@ -537,7 +537,7 @@ int pg_worker(int argc, char *argv[])
|
|||
*/
|
||||
|
||||
pglldbg("Started\n");
|
||||
(void)irqsave();
|
||||
(void)up_irq_save();
|
||||
for (; ; )
|
||||
{
|
||||
/* Wait awhile. We will wait here until either the configurable timeout
|
||||
|
|
|
@ -157,7 +157,7 @@ void spin_lockr(FAR struct spinlock_s *lock)
|
|||
|
||||
/* Disable interrupts (all CPUs) */
|
||||
|
||||
flags = irqsave();
|
||||
flags = up_irq_save();
|
||||
|
||||
/* Do we already hold the lock on this CPU? */
|
||||
|
||||
|
@ -187,9 +187,9 @@ void spin_lockr(FAR struct spinlock_s *lock)
|
|||
|
||||
while (up_testset(&lock->sp_lock) == SP_LOCKED)
|
||||
{
|
||||
irqrestore(flags);
|
||||
up_irq_restore(flags);
|
||||
sched_yield();
|
||||
flags = irqsave();
|
||||
flags = up_irq_save();
|
||||
}
|
||||
|
||||
/* Take one count on the lock */
|
||||
|
@ -198,7 +198,7 @@ void spin_lockr(FAR struct spinlock_s *lock)
|
|||
lock->sp_count = 1;
|
||||
}
|
||||
|
||||
irqrestore(flags);
|
||||
up_irq_restore(flags);
|
||||
|
||||
#else /* CONFIG_SMP */
|
||||
|
||||
|
@ -242,7 +242,7 @@ void spin_unlockr(FAR struct spinlock_s *lock)
|
|||
|
||||
/* Disable interrupts (all CPUs) */
|
||||
|
||||
flags = irqsave();
|
||||
flags = up_irq_save();
|
||||
|
||||
#ifdef CONFIG_SPINLOCK_LOCKDOWN
|
||||
/* REVISIT: What happens if this thread took the lock on a different CPU,
|
||||
|
@ -282,7 +282,7 @@ void spin_unlockr(FAR struct spinlock_s *lock)
|
|||
}
|
||||
}
|
||||
|
||||
irqrestore(flags);
|
||||
up_irq_restore(flags);
|
||||
|
||||
#else /* CONFIG_SMP */
|
||||
/* Just mark the spinlock unlocked */
|
||||
|
|
Loading…
Reference in a new issue