diff --git a/arch/arm/src/armv6-m/up_doirq.c b/arch/arm/src/armv6-m/up_doirq.c index 2edbc55ddb..cf77bc47bb 100644 --- a/arch/arm/src/armv6-m/up_doirq.c +++ b/arch/arm/src/armv6-m/up_doirq.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/arm/src/armv6-m/up_doirq.c * - * Copyright (C) 2013 Gregory Nutt. All rights reserved. + * Copyright (C) 2013-2014 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -93,9 +93,9 @@ uint32_t *up_doirq(int irq, uint32_t *regs) savestate = (uint32_t*)current_regs; current_regs = regs; - /* Mask and acknowledge the interrupt */ + /* Acknowledge the interrupt */ - up_maskack_irq(irq); + up_ack_irq(irq); /* Deliver the IRQ */ @@ -115,10 +115,6 @@ uint32_t *up_doirq(int irq, uint32_t *regs) */ current_regs = savestate; - - /* Unmask the last interrupt (global interrupts are still disabled) */ - - up_enable_irq(irq); #endif up_ledoff(LED_INIRQ); return regs; diff --git a/arch/arm/src/armv7-m/up_doirq.c b/arch/arm/src/armv7-m/up_doirq.c index d8a1446deb..5cb93bfc96 100644 --- a/arch/arm/src/armv7-m/up_doirq.c +++ b/arch/arm/src/armv7-m/up_doirq.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/arm/src/armv7-m/up_doirq.c * - * Copyright (C) 2009, 2011, 2013 Gregory Nutt. All rights reserved. + * Copyright (C) 2009, 2011, 2013-2014 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -93,9 +93,9 @@ uint32_t *up_doirq(int irq, uint32_t *regs) savestate = (uint32_t*)current_regs; current_regs = regs; - /* Mask and acknowledge the interrupt */ + /* Acknowledge the interrupt */ - up_maskack_irq(irq); + up_ack_irq(irq); /* Deliver the IRQ */ @@ -115,10 +115,6 @@ uint32_t *up_doirq(int irq, uint32_t *regs) */ current_regs = savestate; - - /* Unmask the last interrupt (global interrupts are still disabled) */ - - up_enable_irq(irq); #endif up_ledoff(LED_INIRQ); return regs; diff --git a/arch/arm/src/common/up_internal.h b/arch/arm/src/common/up_internal.h index eb3ca896ae..20ae8dc732 100644 --- a/arch/arm/src/common/up_internal.h +++ b/arch/arm/src/common/up_internal.h @@ -1,7 +1,7 @@ /**************************************************************************** * common/up_internal.h * - * Copyright (C) 2007-2013 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2014 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -313,15 +313,15 @@ void up_systemreset(void) noreturn_function; /* Interrupt handling *******************************************************/ void up_irqinitialize(void); -void up_maskack_irq(int irq); /* Exception handling logic unique to the Cortex-M family */ #if defined(CONFIG_ARCH_CORTEXM0) || defined(CONFIG_ARCH_CORTEXM3) || \ defined(CONFIG_ARCH_CORTEXM4) -/* Interrupt dispatch */ +/* Interrupt acknowledge and dispatch */ +void up_ack_irq(int irq); uint32_t *up_doirq(int irq, uint32_t *regs); /* Exception Handlers */ @@ -341,8 +341,9 @@ int up_memfault(int irq, FAR void *context); #elif defined(CONFIG_ARCH_CORTEXA5) || defined(CONFIG_ARCH_CORTEXA8) -/* Interrupt dispatch */ +/* Interrupt acknowledge and dispatch */ +void up_maskack_irq(int irq); uint32_t *arm_doirq(int irq, uint32_t *regs); /* Paging support */ @@ -365,8 +366,9 @@ uint32_t *arm_undefinedinsn(uint32_t *regs); #else /* ARM7 | ARM9 */ -/* Interrupt dispatch */ +/* Interrupt acknowledge and dispatch */ +void up_maskack_irq(int irq); void up_doirq(int irq, uint32_t *regs); /* Paging support (and exception handlers) */ diff --git a/arch/arm/src/kinetis/kinetis_irq.c b/arch/arm/src/kinetis/kinetis_irq.c index 5deda2a16d..af62b466f3 100644 --- a/arch/arm/src/kinetis/kinetis_irq.c +++ b/arch/arm/src/kinetis/kinetis_irq.c @@ -1,6 +1,5 @@ /**************************************************************************** * arch/arm/src/lpc17/kinetis_irq.c - * arch/arm/src/chip/kinetis_irq.c * * Copyright (C) 2011, 2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -478,17 +477,15 @@ void up_enable_irq(int irq) } /**************************************************************************** - * Name: up_maskack_irq + * Name: up_ack_irq * * Description: - * Mask the IRQ and acknowledge it + * Acknowledge the IRQ * ****************************************************************************/ -void up_maskack_irq(int irq) +void up_ack_irq(int irq) { - up_disable_irq(irq); - #if 0 /* Does not appear to be necessary in most cases */ kinetis_clrpend(irq); #endif diff --git a/arch/arm/src/kl/kl_irq.c b/arch/arm/src/kl/kl_irq.c index 1e04773187..127a667a6a 100644 --- a/arch/arm/src/kl/kl_irq.c +++ b/arch/arm/src/kl/kl_irq.c @@ -1,8 +1,7 @@ /**************************************************************************** * arch/arm/src/stm32/kl_irq.c - * arch/arm/src/chip/kl_irq.c * - * Copyright (C) 2013 Gregory Nutt. All rights reserved. + * Copyright (C) 2013-2014 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -258,11 +257,6 @@ void up_irqinitialize(void) void up_disable_irq(int irq) { - /* This will be called on each interrupt (via up_maskack_irq()) whether - * the interrupt can be disabled or not. So this assertion is necessarily - * lame. - */ - DEBUGASSERT((unsigned)irq < NR_IRQS); /* Check for an external interrupt */ @@ -297,7 +291,7 @@ void up_disable_irq(int irq) void up_enable_irq(int irq) { /* This will be called on each interrupt exit whether the interrupt can be - * enambled or not. So this assertion is necessarily lame. + * enabled or not. So this assertion is necessarily lame. */ DEBUGASSERT((unsigned)irq < NR_IRQS); @@ -324,15 +318,14 @@ void up_enable_irq(int irq) } /**************************************************************************** - * Name: up_maskack_irq + * Name: up_ack_irq * * Description: - * Mask the IRQ and acknowledge it + * Acknowledge the IRQ * ****************************************************************************/ -void up_maskack_irq(int irq) +void up_ack_irq(int irq) { - up_disable_irq(irq); kl_clrpend(irq); } diff --git a/arch/arm/src/lm/lm_irq.c b/arch/arm/src/lm/lm_irq.c index 0ef8d21975..de5b75bd31 100644 --- a/arch/arm/src/lm/lm_irq.c +++ b/arch/arm/src/lm/lm_irq.c @@ -2,7 +2,7 @@ * arch/arm/src/lm/lm_irq.c * arch/arm/src/chip/lm_irq.c * - * Copyright (C) 2009, 2011, 2013 Gregory Nutt. All rights reserved. + * Copyright (C) 2009, 2011, 2013-2014 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -402,6 +402,7 @@ void up_disable_irq(int irq) regval &= ~bit; putreg32(regval, regaddr); } + lm_dumpnvic("disable", irq); } @@ -427,20 +428,20 @@ void up_enable_irq(int irq) regval |= bit; putreg32(regval, regaddr); } + lm_dumpnvic("enable", irq); } /**************************************************************************** - * Name: up_maskack_irq + * Name: up_ack_irq * * Description: - * Mask the IRQ and acknowledge it + * Acknowledge the IRQ * ****************************************************************************/ -void up_maskack_irq(int irq) +void up_ack_irq(int irq) { - up_disable_irq(irq); } /**************************************************************************** diff --git a/arch/arm/src/lpc17xx/lpc17_irq.c b/arch/arm/src/lpc17xx/lpc17_irq.c index 840574fab7..a3fd9043d8 100644 --- a/arch/arm/src/lpc17xx/lpc17_irq.c +++ b/arch/arm/src/lpc17xx/lpc17_irq.c @@ -1,8 +1,7 @@ /**************************************************************************** * arch/arm/src/lpc17/lpc17_irq.c - * arch/arm/src/chip/lpc17_irq.c * - * Copyright (C) 2010-2011, 2013 Gregory Nutt. All rights reserved. + * Copyright (C) 2010-2011, 2013-2014 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -404,6 +403,7 @@ void up_disable_irq(int irq) lpc17_gpioirqdisable(irq); } #endif + lpc17_dumpnvic("disable", irq); } @@ -437,21 +437,20 @@ void up_enable_irq(int irq) lpc17_gpioirqenable(irq); } #endif + lpc17_dumpnvic("enable", irq); } /**************************************************************************** - * Name: up_maskack_irq + * Name: up_ack_irq * * Description: - * Mask the IRQ and acknowledge it + * Acknowledge the IRQ * ****************************************************************************/ -void up_maskack_irq(int irq) +void up_ack_irq(int irq) { - up_disable_irq(irq); - #if 0 /* Does not appear to be necessary in most cases */ lpc17_clrpend(irq); #endif diff --git a/arch/arm/src/lpc43xx/lpc43_irq.c b/arch/arm/src/lpc43xx/lpc43_irq.c index 779a9c50c4..c9e130fd41 100644 --- a/arch/arm/src/lpc43xx/lpc43_irq.c +++ b/arch/arm/src/lpc43xx/lpc43_irq.c @@ -1,8 +1,7 @@ /**************************************************************************** * arch/arm/src/lpc43/lpc43_irq.c - * arch/arm/src/chip/lpc43_irq.c * - * Copyright (C) 2012-2013 Gregory Nutt. All rights reserved. + * Copyright (C) 2012-2014 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -442,6 +441,7 @@ void up_disable_irq(int irq) lpc43_gpioint_disable(irq); } #endif + lpc43_dumpnvic("disable", irq); } @@ -475,21 +475,20 @@ void up_enable_irq(int irq) lpc43_gpioint_enable(irq); } #endif + lpc43_dumpnvic("enable", irq); } /**************************************************************************** - * Name: up_maskack_irq + * Name: up_ack_irq * * Description: - * Mask the IRQ and acknowledge it + * Acknowledge the IRQ * ****************************************************************************/ -void up_maskack_irq(int irq) +void up_ack_irq(int irq) { - up_disable_irq(irq); - #if 0 /* Does not appear to be necessary in most cases */ lpc43_clrpend(irq); #endif diff --git a/arch/arm/src/nuc1xx/nuc_irq.c b/arch/arm/src/nuc1xx/nuc_irq.c index b6198ff42e..e45121b137 100644 --- a/arch/arm/src/nuc1xx/nuc_irq.c +++ b/arch/arm/src/nuc1xx/nuc_irq.c @@ -1,8 +1,7 @@ /**************************************************************************** * arch/arm/src/stm32/nuc_irq.c - * arch/arm/src/chip/nuc_irq.c * - * Copyright (C) 2009-2013 Gregory Nutt. All rights reserved. + * Copyright (C) 2009-2014 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -258,11 +257,6 @@ void up_irqinitialize(void) void up_disable_irq(int irq) { - /* This will be called on each interrupt (via up_maskack_irq()) whether - * the interrupt can be disabled or not. So this assertion is necessarily - * lame. - */ - DEBUGASSERT((unsigned)irq < NR_IRQS); /* Check for an external interrupt */ @@ -324,16 +318,15 @@ void up_enable_irq(int irq) } /**************************************************************************** - * Name: up_maskack_irq + * Name: up_ack_irq * * Description: - * Mask the IRQ and acknowledge it + * Acknowledge the IRQ * ****************************************************************************/ -void up_maskack_irq(int irq) +void up_ack_irq(int irq) { - up_disable_irq(irq); nuc_clrpend(irq); } diff --git a/arch/arm/src/sam34/sam_irq.c b/arch/arm/src/sam34/sam_irq.c index e2117ff090..1cac7da7cb 100644 --- a/arch/arm/src/sam34/sam_irq.c +++ b/arch/arm/src/sam34/sam_irq.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/arm/src/sam34/sam_irq.c * - * Copyright (C) 2009, 2011, 2013 Gregory Nutt. All rights reserved. + * Copyright (C) 2009, 2011, 2013-2014 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -507,16 +507,15 @@ void up_enable_irq(int irq) } /**************************************************************************** - * Name: up_maskack_irq + * Name: up_ack_irq * * Description: - * Mask the IRQ and acknowledge it + * Acknowledge the IRQ * ****************************************************************************/ -void up_maskack_irq(int irq) +void up_ack_irq(int irq) { - up_disable_irq(irq); } /**************************************************************************** diff --git a/arch/arm/src/stm32/stm32_irq.c b/arch/arm/src/stm32/stm32_irq.c index e3fae743be..1e866cd381 100644 --- a/arch/arm/src/stm32/stm32_irq.c +++ b/arch/arm/src/stm32/stm32_irq.c @@ -2,7 +2,7 @@ * arch/arm/src/stm32/stm32_irq.c * arch/arm/src/chip/stm32_irq.c * - * Copyright (C) 2009-2013 Gregory Nutt. All rights reserved. + * Copyright (C) 2009-2014 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -458,16 +458,15 @@ void up_enable_irq(int irq) } /**************************************************************************** - * Name: up_maskack_irq + * Name: up_ack_irq * * Description: - * Mask the IRQ and acknowledge it + * Acknowledge the IRQ * ****************************************************************************/ -void up_maskack_irq(int irq) +void up_ack_irq(int irq) { - up_disable_irq(irq); } /****************************************************************************