Skip to content

Commit

Permalink
arm/isr: move up_set_interrupt_context() to chip define
Browse files Browse the repository at this point in the history
up_set_interrupt_context() is chip specific implement, move this function to correct place

Signed-off-by: chao an <[email protected]>
  • Loading branch information
anchao authored and xiaoxiang781216 committed Nov 29, 2024
1 parent 2961eca commit 8257b11
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 18 deletions.
10 changes: 10 additions & 0 deletions arch/arm/include/arm/irq.h
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,16 @@ static inline_function bool up_interrupt_context(void)
#endif
}

noinstrument_function
static inline_function void up_set_interrupt_context(bool flag)
{
#ifdef CONFIG_ARCH_HAVE_MULTICPU
g_interrupt_context[up_cpu_index()] = flag;
#else
g_interrupt_context[0] = flag;
#endif
}

/****************************************************************************
* Public Function Prototypes
****************************************************************************/
Expand Down
6 changes: 6 additions & 0 deletions arch/arm/include/armv7-a/irq.h
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,12 @@ static inline_function bool up_interrupt_context(void)
return (bool)CP15_GET(TPIDRPRW);
}

noinstrument_function
static inline_function void up_set_interrupt_context(bool flag)
{
CP15_SET(TPIDRPRW, flag);
}

/****************************************************************************
* Public Data
****************************************************************************/
Expand Down
6 changes: 6 additions & 0 deletions arch/arm/include/armv7-r/irq.h
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,12 @@ static inline_function bool up_interrupt_context(void)
return (bool)CP15_GET(TPIDRPRW);
}

noinstrument_function
static inline_function void up_set_interrupt_context(bool flag)
{
CP15_SET(TPIDRPRW, flag);
}

/****************************************************************************
* Public Data
****************************************************************************/
Expand Down
6 changes: 6 additions & 0 deletions arch/arm/include/armv8-r/irq.h
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,12 @@ static inline_function bool up_interrupt_context(void)
return (bool)CP15_GET(TPIDRPRW);
}

noinstrument_function
static inline_function void up_set_interrupt_context(bool flag)
{
CP15_SET(TPIDRPRW, flag);
}

/****************************************************************************
* Public Data
****************************************************************************/
Expand Down
10 changes: 10 additions & 0 deletions arch/arm/include/tlsr82/irq.h
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,16 @@ static inline_function bool up_interrupt_context(void)
#endif
}

noinstrument_function
static inline_function void up_set_interrupt_context(bool flag)
{
#ifdef CONFIG_ARCH_HAVE_MULTICPU
g_interrupt_context[up_cpu_index()] = flag;
#else
g_interrupt_context[0] = flag;
#endif
}

#define up_switch_context(tcb, rtcb) \
do { \
if (!up_interrupt_context()) \
Expand Down
2 changes: 0 additions & 2 deletions arch/arm/src/common/arm_initialize.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@

/* g_interrupt_context store irq status */

#if defined(CONFIG_ARCH_ARM)
volatile bool g_interrupt_context[CONFIG_SMP_NCPUS];
#endif

/****************************************************************************
* Private Functions
Expand Down
16 changes: 0 additions & 16 deletions arch/arm/src/common/arm_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -410,14 +410,6 @@ uint32_t *arm_prefetchabort(uint32_t *regs, uint32_t ifar, uint32_t ifsr);
uint32_t *arm_syscall(uint32_t *regs);
uint32_t *arm_undefinedinsn(uint32_t *regs);

/* IRQ Flag */

noinstrument_function
static inline_function void up_set_interrupt_context(bool flag)
{
CP15_SET(TPIDRPRW, flag);
}

/* Exception handling logic common to other ARM7 and ARM9 family. */

#else /* ARM7 | ARM9 */
Expand All @@ -439,14 +431,6 @@ void arm_prefetchabort(uint32_t *regs);
uint32_t *arm_syscall(uint32_t *regs);
void arm_undefinedinsn(uint32_t *regs);

/* IRQ Flag */

noinstrument_function
static inline_function void up_set_interrupt_context(bool flag)
{
g_interrupt_context[this_cpu()] = flag;
}

#endif /* CONFIG_ARCH_ARMV[6-8]M */

void arm_vectorundefinsn(void);
Expand Down

0 comments on commit 8257b11

Please sign in to comment.