ARM _arch_irq_enable should not implicitly unpend IRQs


Chettimada, Vinayak Kariappa
 

Hi,

I am wondering why _arch_irq_enable for ARM unpends the IRQs, and not actually have a separate interfaces to pend and unpend IRQs.

Below is a diff that I want to submit, which removes the call to _NvicIrqUnpend() being made inside _arch_irq_enable. The reasoning is, sometimes an IRQ could be pending and implementations could then enable the ISR at a later time.

Regards,
Vinayak

diff --git a/arch/arm/core/irq_manage.c b/arch/arm/core/irq_manage.c
index 2d34ba5..bef7463 100644
--- a/arch/arm/core/irq_manage.c
+++ b/arch/arm/core/irq_manage.c
@@ -39,16 +39,13 @@ extern void __reserved(void);
*
* @brief Enable an interrupt line
*
- * Clear possible pending interrupts on the line, and enable the interrupt
- * line. After this call, the CPU will receive interrupts for the specified
- * <irq>.
+ * Enable the interrupt. After this call, the CPU will receive interrupts for
+ * the specified <irq>.
*
* @return N/A
*/
void _arch_irq_enable(unsigned int irq)
{
- /* before enabling interrupts, ensure that interrupt is cleared */
- _NvicIrqUnpend(irq);
_NvicIrqEnable(irq);
}

Join devel@lists.zephyrproject.org to automatically receive all group messages.