diff --git a/ChangeLog b/ChangeLog index 78892f8035..bdcaee4d7f 100755 --- a/ChangeLog +++ b/ChangeLog @@ -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). diff --git a/TODO b/TODO index e8bf3a1a8b..0c17856b6e 100644 --- a/TODO +++ b/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 diff --git a/arch b/arch index 354df5c0f3..4a9148e44a 160000 --- a/arch +++ b/arch @@ -1 +1 @@ -Subproject commit 354df5c0f3f7e0f4df605a85edef7d8e170843c1 +Subproject commit 4a9148e44aa3a1540ce26fc15599732c281cbbfd diff --git a/configs b/configs index cfbc3f7c3e..904067c60c 160000 --- a/configs +++ b/configs @@ -1 +1 @@ -Subproject commit cfbc3f7c3e07bf07b012e42933f3fea7c2397d52 +Subproject commit 904067c60cb19341e9f806710f7f8c20301a33e8 diff --git a/include/nuttx/arch.h b/include/nuttx/arch.h index a6a30e69f0..bec1aab8e1 100644 --- a/include/nuttx/arch.h +++ b/include/nuttx/arch.h @@ -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 diff --git a/include/nuttx/irq.h b/include/nuttx/irq.h index 519059c7f6..2f7dba3764 100644 --- a/include/nuttx/irq.h +++ b/include/nuttx/irq.h @@ -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 diff --git a/sched/irq/irq_csection.c b/sched/irq/irq_csection.c index 536117151d..38eebdf3d0 100644 --- a/sched/irq/irq_csection.c +++ b/sched/irq/irq_csection.c @@ -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 */ diff --git a/sched/irq/irq_unexpectedisr.c b/sched/irq/irq_unexpectedisr.c index 9f207ae860..490a6251e1 100644 --- a/sched/irq/irq_unexpectedisr.c +++ b/sched/irq/irq_unexpectedisr.c @@ -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 */ diff --git a/sched/paging/pg_worker.c b/sched/paging/pg_worker.c index 701076901a..668d768d44 100644 --- a/sched/paging/pg_worker.c +++ b/sched/paging/pg_worker.c @@ -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 diff --git a/sched/semaphore/spinlock.c b/sched/semaphore/spinlock.c index a5919305f4..2b6c56f052 100644 --- a/sched/semaphore/spinlock.c +++ b/sched/semaphore/spinlock.c @@ -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 */