Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interrupt nesting #10057

Merged
merged 9 commits into from
Aug 7, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
arch/tlsr82: Port arm_doirq to tc32_doirq.c
Solve the dependency on ARMV6M when compiling tlsr8278adk80d:nsh.

Signed-off-by: wangming9 <[email protected]>
  • Loading branch information
wangming9 committed Aug 3, 2023
commit 4b1625eb8eb88a706293591b5b491bec53f414ad
5 changes: 5 additions & 0 deletions arch/arm/include/tlsr82/irq.h
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,11 @@ static inline void up_enable_irq(int irq)
_IRQ_MASK_REG |= (1 << irq);
}

static inline uint32_t getcontrol(void)
{
return 0;
}

#endif /* __ASSEMBLY__ */

/****************************************************************************
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/src/tlsr82/tc32/Make.defs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ CMN_ASRCS := $(filter-out $(TC32_ASRCS_FILTER), $(CMN_ASRCS))

# Common files in arch/arm/src/armv6-m

CMN_CSRCS += arm_sigdeliver.c arm_doirq.c
CMN_CSRCS += arm_sigdeliver.c

# Common files in arch/arm/src/tlsr82/tc32

Expand Down
57 changes: 57 additions & 0 deletions arch/arm/src/tlsr82/tc32/tc32_doirq.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,63 @@
* Private Functions
****************************************************************************/

uint32_t *arm_doirq(int irq, uint32_t *regs)
{
board_autoled_on(LED_INIRQ);
#ifdef CONFIG_SUPPRESS_INTERRUPTS
PANIC();
#else

/* Nested interrupts are not supported in this implementation. If you
* want to implement nested interrupts, you would have to (1) change the
* way that CURRENT_REGS is handled and (2) the design associated with
* CONFIG_ARCH_INTERRUPTSTACK.
*/

/* Current regs non-zero indicates that we are processing an interrupt;
* CURRENT_REGS is also used to manage interrupt level context switches.
*/

if (CURRENT_REGS == NULL)
{
CURRENT_REGS = regs;
regs = NULL;
}

/* Acknowledge the interrupt */

arm_ack_irq(irq);

/* Deliver the IRQ */

irq_dispatch(irq, (uint32_t *)CURRENT_REGS);

/* If a context switch occurred while processing the interrupt then
* CURRENT_REGS may have change value. If we return any value different
* from the input regs, then the lower level will know that a context
* switch occurred during interrupt processing.
*/

if (regs == NULL)
{
/* Restore the cpu lock */

if (regs != CURRENT_REGS)
{
restore_critical_section();
regs = (uint32_t *)CURRENT_REGS;
}

/* Update the CURRENT_REGS to NULL. */

CURRENT_REGS = NULL;
}
#endif

board_autoled_off(LED_INIRQ);
return regs;
}

/****************************************************************************
* Name: tc32_getirq
*
Expand Down