Individual IRQs are not longer disabled on each interrupt. See ChangeLog for detailed explanation

This commit is contained in:
Gregory Nutt 2014-01-15 08:09:19 -06:00
parent 826a0116e8
commit 836057e340
12 changed files with 59 additions and 79 deletions

View File

@ -6432,7 +6432,7 @@
Unfortunately, it does not yet work (2013-1-14).
* configs/px4fmu-v2_upstream: Configuration for testing simple
configurations on the the PX4FMU v2. This version is incomplete
for the PX4 appliation and is not a replacement for the version
for the PX4 application and is not a replacement for the version
in the PX4 GIT repository.
* fs/fat/fs_fat32.c: A correction to FAT cluster allocation from
Tridge via Lorenz Meier (2014-1-14).
@ -6446,4 +6446,10 @@
conditionally done only for FAT 32. Apparently this needs to
done for all FAT types. From Tridge via Lorenz Meier
(2014-1-14).
* arch/arm/src/armv6-m/up_doirq.c and armv7-m/up_doirq.c and all
implementations of up_mask_acq() for all Cortex-M architectures: Do
not disable and enable the IRQ on each interrupt. Because (1)
interrupts are already disabled on interrupt entry, (2) this
interferes with controlling the IRQ interrrupt setting from interrupt
handlers, and (3) up_disable_irq() does not work anyway so that this
has never done anything (2014-1-15).

View File

@ -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 <gnutt@nuttx.org>
*
* 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;

View File

@ -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 <gnutt@nuttx.org>
*
* 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;

View File

@ -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 <gnutt@nuttx.org>
*
* 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) */

View File

@ -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 <gnutt@nuttx.org>
@ -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

View File

@ -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 <gnutt@nuttx.org>
*
* 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);
}

View File

@ -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 <gnutt@nuttx.org>
*
* 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);
}
/****************************************************************************

View File

@ -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 <gnutt@nuttx.org>
*
* 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

View File

@ -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 <gnutt@nuttx.org>
*
* 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

View File

@ -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 <gnutt@nuttx.org>
*
* 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);
}

View File

@ -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 <gnutt@nuttx.org>
*
* 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);
}
/****************************************************************************

View File

@ -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 <gnutt@nuttx.org>
*
* 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);
}
/****************************************************************************