arch: Apply dynamic IRQ API change

Switching to constant parameter.

Fixes #27399

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This commit is contained in:
Tomasz Bursztyka 2020-07-10 14:17:51 +02:00 committed by Carles Cufí
parent 6df8b3995e
commit 93cd336204
19 changed files with 44 additions and 39 deletions

View file

@ -165,7 +165,7 @@ void z_irq_priority_set(unsigned int irq, unsigned int prio, uint32_t flags)
* @return N/A
*/
void z_irq_spurious(void *unused)
void z_irq_spurious(const void *unused)
{
ARG_UNUSED(unused);
z_fatal_error(K_ERR_SPURIOUS_IRQ, NULL);
@ -173,8 +173,8 @@ void z_irq_spurious(void *unused)
#ifdef CONFIG_DYNAMIC_INTERRUPTS
int arch_irq_connect_dynamic(unsigned int irq, unsigned int priority,
void (*routine)(void *parameter), void *parameter,
uint32_t flags)
void (*routine)(const void *parameter),
const void *parameter, uint32_t flags)
{
z_isr_install(irq, routine, parameter);
z_irq_priority_set(irq, priority, flags);

View file

@ -154,7 +154,7 @@ void z_arm_fatal_error(unsigned int reason, const z_arch_esf_t *esf);
*
* @return N/A
*/
void z_irq_spurious(void *unused)
void z_irq_spurious(const void *unused)
{
ARG_UNUSED(unused);
@ -257,8 +257,8 @@ int irq_target_state_is_secure(unsigned int irq)
#ifdef CONFIG_DYNAMIC_INTERRUPTS
int arch_irq_connect_dynamic(unsigned int irq, unsigned int priority,
void (*routine)(void *parameter), void *parameter,
uint32_t flags)
void (*routine)(const void *parameter),
const void *parameter, uint32_t flags)
{
z_isr_install(irq, routine, parameter);
z_arm_irq_priority_set(irq, priority, flags);

View file

@ -55,8 +55,8 @@ void z_arm64_irq_priority_set(unsigned int irq, unsigned int prio, uint32_t flag
#ifdef CONFIG_DYNAMIC_INTERRUPTS
int arch_irq_connect_dynamic(unsigned int irq, unsigned int priority,
void (*routine)(void *parameter), void *parameter,
uint32_t flags)
void (*routine)(const void *parameter),
const void *parameter, uint32_t flags)
{
z_isr_install(irq, routine, parameter);
z_arm64_irq_priority_set(irq, priority, flags);
@ -64,7 +64,7 @@ int arch_irq_connect_dynamic(unsigned int irq, unsigned int priority,
}
#endif
void z_irq_spurious(void *unused)
void z_irq_spurious(const void *unused)
{
ARG_UNUSED(unused);

View file

@ -70,7 +70,8 @@ unsigned int get_parent_offset(unsigned int parent_irq,
#endif /* CONFIG_MULTI_LEVEL_INTERRUPTS */
void z_isr_install(unsigned int irq, void (*routine)(void *), void *param)
void z_isr_install(unsigned int irq, void (*routine)(const void *),
const void *param)
{
unsigned int table_idx;
@ -127,8 +128,8 @@ void z_isr_install(unsigned int irq, void (*routine)(void *), void *param)
*/
int __weak arch_irq_connect_dynamic(unsigned int irq,
unsigned int priority,
void (*routine)(void *),
void *parameter,
void (*routine)(const void *),
const void *parameter,
uint32_t flags)
{
ARG_UNUSED(flags);

View file

@ -22,7 +22,7 @@
#include <logging/log.h>
LOG_MODULE_DECLARE(os);
FUNC_NORETURN void z_irq_spurious(void *unused)
FUNC_NORETURN void z_irq_spurious(const void *unused)
{
ARG_UNUSED(unused);
LOG_ERR("Spurious interrupt detected! ipending: %x",
@ -121,8 +121,8 @@ void _enter_irq(uint32_t ipending)
#ifdef CONFIG_DYNAMIC_INTERRUPTS
int arch_irq_connect_dynamic(unsigned int irq, unsigned int priority,
void (*routine)(void *parameter), void *parameter,
uint32_t flags)
void (*routine)(const void *parameter),
const void *parameter, uint32_t flags)
{
ARG_UNUSED(flags);
ARG_UNUSED(priority);

View file

@ -46,8 +46,8 @@ int arch_irq_is_enabled(unsigned int irq)
* @return The vector assigned to this interrupt
*/
int arch_irq_connect_dynamic(unsigned int irq, unsigned int priority,
void (*routine)(void *parameter),
void *parameter, uint32_t flags)
void (*routine)(const void *parameter),
const void *parameter, uint32_t flags)
{
posix_isr_declare(irq, (int)flags, routine, parameter);
posix_irq_priority_set(irq, priority, flags);

View file

@ -9,7 +9,7 @@
#include <logging/log.h>
LOG_MODULE_DECLARE(os);
FUNC_NORETURN void z_irq_spurious(void *unused)
FUNC_NORETURN void z_irq_spurious(const void *unused)
{
ulong_t mcause;
@ -31,8 +31,8 @@ FUNC_NORETURN void z_irq_spurious(void *unused)
#ifdef CONFIG_DYNAMIC_INTERRUPTS
int arch_irq_connect_dynamic(unsigned int irq, unsigned int priority,
void (*routine)(void *parameter), void *parameter,
uint32_t flags)
void (*routine)(const void *parameter),
const void *parameter, uint32_t flags)
{
ARG_UNUSED(flags);

View file

@ -56,9 +56,9 @@ extern unsigned int z_interrupt_vectors_allocated[];
struct dyn_irq_info {
/** IRQ handler */
void (*handler)(void *param);
void (*handler)(const void *param);
/** Parameter to pass to the handler */
void *param;
const void *param;
};
/*
@ -197,8 +197,8 @@ static void idt_vector_install(int vector, void *irq_handler)
}
int arch_irq_connect_dynamic(unsigned int irq, unsigned int priority,
void (*routine)(void *parameter), void *parameter,
uint32_t flags)
void (*routine)(const void *parameter),
const void *parameter, uint32_t flags)
{
int vector, stub_idx, key;

View file

@ -83,7 +83,8 @@ static int allocate_vector(unsigned int priority)
*/
int arch_irq_connect_dynamic(unsigned int irq, unsigned int priority,
void (*func)(void *arg), void *arg, uint32_t flags)
void (*func)(const void *arg),
const void *arg, uint32_t flags)
{
uint32_t key;
int vector;

View file

@ -40,8 +40,8 @@ void z_irq_priority_set(unsigned int irq, unsigned int prio, uint32_t flags)
#ifdef CONFIG_DYNAMIC_INTERRUPTS
#ifndef CONFIG_MULTI_LEVEL_INTERRUPTS
int z_arch_irq_connect_dynamic(unsigned int irq, unsigned int priority,
void (*routine)(void *parameter),
void *parameter, uint32_t flags)
void (*routine)(const void *parameter),
const void *parameter, uint32_t flags)
{
ARG_UNUSED(flags);
ARG_UNUSED(priority);
@ -51,8 +51,8 @@ int z_arch_irq_connect_dynamic(unsigned int irq, unsigned int priority,
}
#else /* !CONFIG_MULTI_LEVEL_INTERRUPTS */
int z_arch_irq_connect_dynamic(unsigned int irq, unsigned int priority,
void (*routine)(void *parameter),
void *parameter, uint32_t flags)
void (*routine)(const void *parameter),
const void *parameter, uint32_t flags)
{
return z_soc_irq_connect_dynamic(irq, priority, routine, parameter,
flags);

View file

@ -64,7 +64,7 @@ void arch_new_thread(struct k_thread *thread, k_thread_stack_t *stack,
p1, p2, p3);
}
void z_irq_spurious(void *arg)
void z_irq_spurious(const void *arg)
{
int irqs, ie;

View file

@ -44,7 +44,7 @@ extern void _irq_exit(void);
extern void z_irq_priority_set(unsigned int irq, unsigned int prio,
uint32_t flags);
extern void _isr_wrapper(void);
extern void z_irq_spurious(void *unused);
extern void z_irq_spurious(const void *unused);
/* Z_ISR_DECLARE will populate the .intList section with the interrupt's
* parameters, which will then be used by gen_irq_tables.py to create

View file

@ -221,7 +221,7 @@ extern void z_arm_irq_direct_dynamic_dispatch_no_reschedule(void);
#endif /* CONFIG_DYNAMIC_DIRECT_INTERRUPTS */
/* Spurious interrupt handler. Throws an error if called */
extern void z_irq_spurious(void *unused);
extern void z_irq_spurious(const void *unused);
#ifdef CONFIG_GEN_SW_ISR_TABLE
/* Architecture-specific common entry point for interrupts from the vector

View file

@ -95,7 +95,7 @@ extern void z_arm64_interrupt_init(void);
}
/* Spurious interrupt handler. Throws an error if called */
extern void z_irq_spurious(void *unused);
extern void z_irq_spurious(const void *unused);
#ifdef CONFIG_GEN_SW_ISR_TABLE
/* Architecture-specific common entry point for interrupts from the vector

View file

@ -44,7 +44,7 @@ extern "C" {
Z_ISR_DECLARE(irq_p, 0, isr_p, isr_param_p); \
}
extern void z_irq_spurious(void *unused);
extern void z_irq_spurious(const void *unused);
static ALWAYS_INLINE unsigned int arch_irq_lock(void)
{

View file

@ -97,7 +97,7 @@ void arch_irq_enable(unsigned int irq);
void arch_irq_disable(unsigned int irq);
int arch_irq_is_enabled(unsigned int irq);
void arch_irq_priority_set(unsigned int irq, unsigned int prio);
void z_irq_spurious(void *unused);
void z_irq_spurious(const void *unused);
#if defined(CONFIG_RISCV_HAS_PLIC)
#define ARCH_IRQ_CONNECT(irq_p, priority_p, isr_p, isr_param_p, flags_p) \

View file

@ -97,6 +97,9 @@ struct x86_ssf {
* All Intel64 interrupts are dynamically connected.
*/
#define ARCH_IRQ_CONNECT arch_irq_connect_dynamic
#define ARCH_IRQ_CONNECT(irq_p, priority_p, isr_p, isr_param_p, flags_p) \
arch_irq_connect_dynamic(irq_p, priority_p, \
(void (*)(const void *))isr_p, \
isr_param_p, flags_p)
#endif /* ZEPHYR_INCLUDE_ARCH_X86_INTEL64_ARCH_H_ */

View file

@ -48,7 +48,7 @@ extern void z_irq_priority_set(uint32_t irq, uint32_t prio, uint32_t flags);
}
/* Spurious interrupt handler. Throws an error if called */
extern void z_irq_spurious(void *unused);
extern void z_irq_spurious(const void *unused);
#define XTENSA_ERR_NORET

View file

@ -140,8 +140,8 @@ out:
#ifdef CONFIG_DYNAMIC_INTERRUPTS
int z_soc_irq_connect_dynamic(unsigned int irq, unsigned int priority,
void (*routine)(void *parameter),
void *parameter, uint32_t flags)
void (*routine)(const void *parameter),
const void *parameter, uint32_t flags)
{
uint32_t table_idx;
uint32_t cavs_irq, cavs_idx;