arch: initialize irq_offload during boot, do not use SYS_INIT
Do not use SYS_INIT for initializing irq_offload when enabled, instead using a new interface that is called during the boot process for all architectures. Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
parent
c9f7b512da
commit
7e225efab7
14 changed files with 49 additions and 13 deletions
|
@ -54,7 +54,7 @@ void arch_irq_offload(irq_offload_routine_t routine, const void *parameter)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* need to be executed on every core in the system */
|
/* need to be executed on every core in the system */
|
||||||
int arc_irq_offload_init(void)
|
void arch_irq_offload_init(void)
|
||||||
{
|
{
|
||||||
|
|
||||||
IRQ_CONNECT(IRQ_OFFLOAD_LINE, IRQ_OFFLOAD_PRIO, arc_irq_offload_handler, NULL, 0);
|
IRQ_CONNECT(IRQ_OFFLOAD_LINE, IRQ_OFFLOAD_PRIO, arc_irq_offload_handler, NULL, 0);
|
||||||
|
@ -64,8 +64,4 @@ int arc_irq_offload_init(void)
|
||||||
* with generic irq_enable() but via z_arc_v2_irq_unit_int_enable().
|
* with generic irq_enable() but via z_arc_v2_irq_unit_int_enable().
|
||||||
*/
|
*/
|
||||||
z_arc_v2_irq_unit_int_enable(IRQ_OFFLOAD_LINE);
|
z_arc_v2_irq_unit_int_enable(IRQ_OFFLOAD_LINE);
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SYS_INIT(arc_irq_offload_init, POST_KERNEL, 0);
|
|
||||||
|
|
|
@ -9,11 +9,9 @@
|
||||||
|
|
||||||
#ifdef CONFIG_IRQ_OFFLOAD
|
#ifdef CONFIG_IRQ_OFFLOAD
|
||||||
|
|
||||||
int arc_irq_offload_init(const struct device *unused);
|
|
||||||
|
|
||||||
static inline void arc_irq_offload_init_smp(void)
|
static inline void arc_irq_offload_init_smp(void)
|
||||||
{
|
{
|
||||||
arc_irq_offload_init(NULL);
|
arch_irq_offload_init();
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -42,3 +42,7 @@ void arch_irq_offload(irq_offload_routine_t routine, const void *parameter)
|
||||||
offload_routine = NULL;
|
offload_routine = NULL;
|
||||||
k_sched_unlock();
|
k_sched_unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void arch_irq_offload_init(void)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
|
@ -23,3 +23,7 @@ void arch_irq_offload(irq_offload_routine_t routine, const void *parameter)
|
||||||
: [svid] "i" (_SVC_CALL_IRQ_OFFLOAD),
|
: [svid] "i" (_SVC_CALL_IRQ_OFFLOAD),
|
||||||
"r" (x0), "r" (x1));
|
"r" (x0), "r" (x1));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void arch_irq_offload_init(void)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
|
@ -48,3 +48,7 @@ void arch_irq_offload(irq_offload_routine_t routine, const void *parameter)
|
||||||
|
|
||||||
irq_unlock(key);
|
irq_unlock(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void arch_irq_offload_init(void)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
|
@ -41,3 +41,7 @@ void arch_irq_offload(irq_offload_routine_t routine, const void *parameter)
|
||||||
|
|
||||||
irq_unlock(key);
|
irq_unlock(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void arch_irq_offload_init(void)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
|
@ -14,6 +14,10 @@ void arch_irq_offload(irq_offload_routine_t routine, const void *parameter)
|
||||||
{
|
{
|
||||||
posix_irq_offload(routine, parameter);
|
posix_irq_offload(routine, parameter);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void arch_irq_offload_init(void)
|
||||||
|
{
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void arch_irq_enable(unsigned int irq)
|
void arch_irq_enable(unsigned int irq)
|
||||||
|
|
|
@ -11,3 +11,7 @@ void arch_irq_offload(irq_offload_routine_t routine, const void *parameter)
|
||||||
{
|
{
|
||||||
arch_syscall_invoke2((uintptr_t)routine, (uintptr_t)parameter, RV_ECALL_IRQ_OFFLOAD);
|
arch_syscall_invoke2((uintptr_t)routine, (uintptr_t)parameter, RV_ECALL_IRQ_OFFLOAD);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void arch_irq_offload_init(void)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
|
@ -39,3 +39,7 @@ void arch_irq_offload(irq_offload_routine_t routine, const void *parameter)
|
||||||
|
|
||||||
irq_unlock(key);
|
irq_unlock(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void arch_irq_offload_init(void)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
|
@ -47,3 +47,7 @@ void arch_irq_offload(irq_offload_routine_t routine, const void *parameter)
|
||||||
|
|
||||||
irq_unlock(key);
|
irq_unlock(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void arch_irq_offload_init(void)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
|
@ -44,11 +44,7 @@ void arch_irq_offload(irq_offload_routine_t routine, const void *parameter)
|
||||||
arch_irq_unlock(key);
|
arch_irq_unlock(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
int irq_offload_init(void)
|
void arch_irq_offload_init(void)
|
||||||
{
|
{
|
||||||
x86_irq_funcs[CONFIG_IRQ_OFFLOAD_VECTOR - IV_IRQS] = dispatcher;
|
x86_irq_funcs[CONFIG_IRQ_OFFLOAD_VECTOR - IV_IRQS] = dispatcher;
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SYS_INIT(irq_offload_init, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
|
|
||||||
|
|
|
@ -37,3 +37,7 @@ void arch_irq_offload(irq_offload_routine_t routine, const void *parameter)
|
||||||
:: "r"(intenable), "r"(BIT(ZSR_IRQ_OFFLOAD_INT)));
|
:: "r"(intenable), "r"(BIT(ZSR_IRQ_OFFLOAD_INT)));
|
||||||
arch_irq_unlock(key);
|
arch_irq_unlock(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void arch_irq_offload_init(void)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
|
@ -455,6 +455,13 @@ bool arch_irq_is_used(unsigned int irq);
|
||||||
* @param parameter Value to pass to the function when invoked
|
* @param parameter Value to pass to the function when invoked
|
||||||
*/
|
*/
|
||||||
void arch_irq_offload(irq_offload_routine_t routine, const void *parameter);
|
void arch_irq_offload(irq_offload_routine_t routine, const void *parameter);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initialize the architecture-specific portion of the irq_offload subsystem
|
||||||
|
*/
|
||||||
|
void arch_irq_offload_init(void);
|
||||||
|
|
||||||
#endif /* CONFIG_IRQ_OFFLOAD */
|
#endif /* CONFIG_IRQ_OFFLOAD */
|
||||||
|
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|
|
@ -516,6 +516,9 @@ static void bg_thread_main(void *unused1, void *unused2, void *unused3)
|
||||||
#endif /* CONFIG_MMU */
|
#endif /* CONFIG_MMU */
|
||||||
z_sys_post_kernel = true;
|
z_sys_post_kernel = true;
|
||||||
|
|
||||||
|
#if CONFIG_IRQ_OFFLOAD
|
||||||
|
arch_irq_offload_init();
|
||||||
|
#endif
|
||||||
z_sys_init_run_level(INIT_LEVEL_POST_KERNEL);
|
z_sys_init_run_level(INIT_LEVEL_POST_KERNEL);
|
||||||
#if CONFIG_SOC_LATE_INIT_HOOK
|
#if CONFIG_SOC_LATE_INIT_HOOK
|
||||||
soc_late_init_hook();
|
soc_late_init_hook();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue