Skip to content

Commit 5ba0c8e

Browse files
stephanosioioannisg
authored andcommitted
arch: arm: Inline arch_isr_direct_header.
This commit inlines arch_isr_direct_header function that was previously placed in irq_manage.c for no good reason (possibly in relation to the FIXME for #3056). In addition, since the PR #20119 resolved the header circular dependency issue described in the issue #3056, this commit removes the references to it in the code. The reason for not inlining _arch_is_direct_pm as the #3056 FIXME suggests is that there is little to gain from doing so and there still exists circular dependency for the headers required by this function (#20119 only addresses kernel_structs.h, which is required for _current and _kernel, which, in turn, is required for handling interrupt nesting in many architectures; in fact, Cortex-A and Cortex-R port will require it as well). Signed-off-by: Stephanos Ioannidis <[email protected]>
1 parent 8d40d87 commit 5ba0c8e

File tree

2 files changed

+8
-18
lines changed

2 files changed

+8
-18
lines changed

arch/arm/core/irq_manage.c

-14
Original file line numberDiff line numberDiff line change
@@ -159,15 +159,6 @@ void z_irq_spurious(void *unused)
159159
z_arm_reserved();
160160
}
161161

162-
/* FIXME: IRQ direct inline functions have to be placed here and not in
163-
* arch/cpu.h as inline functions due to nasty circular dependency between
164-
* arch/cpu.h and kernel_structs.h; the inline functions typically need to
165-
* perform operations on _kernel. For now, leave as regular functions, a
166-
* future iteration will resolve this.
167-
*
168-
* See https://github.com/zephyrproject-rtos/zephyr/issues/3056
169-
*/
170-
171162
#ifdef CONFIG_SYS_POWER_MANAGEMENT
172163
void _arch_isr_direct_pm(void)
173164
{
@@ -206,11 +197,6 @@ void _arch_isr_direct_pm(void)
206197
}
207198
#endif
208199

209-
void arch_isr_direct_header(void)
210-
{
211-
sys_trace_isr_enter();
212-
}
213-
214200
#if defined(CONFIG_ARM_SECURE_FIRMWARE)
215201
/**
216202
*

include/arch/arm/irq.h

+8-4
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ extern void z_arm_irq_priority_set(unsigned int irq, unsigned int prio,
9090
irq_p; \
9191
})
9292

93-
/* FIXME prefer these inline, but see GH-3056 */
9493
#ifdef CONFIG_SYS_POWER_MANAGEMENT
9594
extern void _arch_isr_direct_pm(void);
9695
#define ARCH_ISR_DIRECT_PM() _arch_isr_direct_pm()
@@ -99,20 +98,25 @@ extern void _arch_isr_direct_pm(void);
9998
#endif
10099

101100
#define ARCH_ISR_DIRECT_HEADER() arch_isr_direct_header()
102-
extern void arch_isr_direct_header(void);
103-
104101
#define ARCH_ISR_DIRECT_FOOTER(swap) arch_isr_direct_footer(swap)
105102

106103
/* arch/arm/core/exc_exit.S */
107104
extern void z_arm_int_exit(void);
108105

109106
#ifdef CONFIG_TRACING
107+
extern void sys_trace_isr_enter(void);
110108
extern void sys_trace_isr_exit(void);
111109
#endif
112110

113-
static inline void arch_isr_direct_footer(int maybe_swap)
111+
static inline void arch_isr_direct_header(void)
114112
{
113+
#ifdef CONFIG_TRACING
114+
sys_trace_isr_enter();
115+
#endif
116+
}
115117

118+
static inline void arch_isr_direct_footer(int maybe_swap)
119+
{
116120
#ifdef CONFIG_TRACING
117121
sys_trace_isr_exit();
118122
#endif

0 commit comments

Comments
 (0)