arch: Apply IRQ offload 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 10:57:23 +02:00 committed by Carles Cufí
parent 84942e4fbc
commit 7def6eeaee
9 changed files with 23 additions and 23 deletions

View file

@ -12,7 +12,7 @@
#include <irq_offload.h>
static irq_offload_routine_t offload_routine;
static void *offload_param;
static const void *offload_param;
/* Called by trap_s exception handler */
void z_irq_do_offload(void)
@ -20,7 +20,7 @@ void z_irq_do_offload(void)
offload_routine(offload_param);
}
void arch_irq_offload(irq_offload_routine_t routine, void *parameter)
void arch_irq_offload(irq_offload_routine_t routine, const void *parameter)
{
offload_routine = routine;

View file

@ -12,7 +12,7 @@
#include <irq_offload.h>
volatile irq_offload_routine_t offload_routine;
static void *offload_param;
static const void *offload_param;
/* Called by z_arm_svc */
void z_irq_do_offload(void)
@ -20,7 +20,7 @@ void z_irq_do_offload(void)
offload_routine(offload_param);
}
void arch_irq_offload(irq_offload_routine_t routine, void *parameter)
void arch_irq_offload(irq_offload_routine_t routine, const void *parameter)
{
#if defined(CONFIG_ARMV6_M_ARMV8_M_BASELINE) && defined(CONFIG_ASSERT)
/* ARMv6-M/ARMv8-M Baseline HardFault if you make a SVC call with

View file

@ -14,14 +14,14 @@
#include <aarch64/exc.h>
volatile irq_offload_routine_t offload_routine;
static void *offload_param;
static const void *offload_param;
void z_irq_do_offload(void)
{
offload_routine(offload_param);
}
void arch_irq_offload(irq_offload_routine_t routine, void *parameter)
void arch_irq_offload(irq_offload_routine_t routine, const void *parameter)
{
k_sched_lock();
offload_routine = routine;

View file

@ -9,7 +9,7 @@
#include <irq_offload.h>
volatile irq_offload_routine_t _offload_routine;
static volatile void *offload_param;
static volatile const void *offload_param;
/* Called by _enter_irq if it was passed 0 for ipending.
* Just in case the offload routine itself generates an unhandled
@ -26,10 +26,10 @@ void z_irq_do_offload(void)
tmp = _offload_routine;
_offload_routine = NULL;
tmp((void *)offload_param);
tmp((const void *)offload_param);
}
void arch_irq_offload(irq_offload_routine_t routine, void *parameter)
void arch_irq_offload(irq_offload_routine_t routine, const void *parameter)
{
unsigned int key;

View file

@ -10,7 +10,7 @@
#ifdef CONFIG_IRQ_OFFLOAD
#include "irq_offload.h"
void arch_irq_offload(irq_offload_routine_t routine, void *parameter)
void arch_irq_offload(irq_offload_routine_t routine, const void *parameter)
{
posix_irq_offload(routine, parameter);
}

View file

@ -9,7 +9,7 @@
#include <sys/printk.h>
volatile irq_offload_routine_t _offload_routine;
static volatile void *offload_param;
static volatile const void *offload_param;
/*
* Called by _enter_irq
@ -28,10 +28,10 @@ void z_irq_do_offload(void)
tmp = _offload_routine;
_offload_routine = NULL;
tmp((void *)offload_param);
tmp((const void *)offload_param);
}
void arch_irq_offload(irq_offload_routine_t routine, void *parameter)
void arch_irq_offload(irq_offload_routine_t routine, const void *parameter)
{
unsigned int key;

View file

@ -17,7 +17,7 @@ NANO_CPU_INT_REGISTER(_irq_sw_handler, NANO_SOFT_IRQ,
CONFIG_IRQ_OFFLOAD_VECTOR, 0);
static irq_offload_routine_t offload_routine;
static void *offload_param;
static const void *offload_param;
/* Called by asm stub */
void z_irq_do_offload(void)
@ -25,7 +25,7 @@ void z_irq_do_offload(void)
offload_routine(offload_param);
}
void arch_irq_offload(irq_offload_routine_t routine, void *parameter)
void arch_irq_offload(irq_offload_routine_t routine, const void *parameter)
{
unsigned int key;

View file

@ -24,10 +24,10 @@ unsigned char _irq_to_interrupt_vector[CONFIG_MAX_IRQ_LINES];
#define NR_IRQ_VECTORS (IV_NR_VECTORS - IV_IRQS) /* # vectors free for IRQs */
void (*x86_irq_funcs[NR_IRQ_VECTORS])(void *);
void *x86_irq_args[NR_IRQ_VECTORS];
void (*x86_irq_funcs[NR_IRQ_VECTORS])(const void *);
const void *x86_irq_args[NR_IRQ_VECTORS];
static void irq_spurious(void *arg)
static void irq_spurious(const void *arg)
{
LOG_ERR("Spurious interrupt, vector %d\n", (uint32_t)(uint64_t)arg);
z_fatal_error(K_ERR_SPURIOUS_IRQ, NULL);
@ -37,7 +37,7 @@ void x86_64_irq_init(void)
{
for (int i = 0; i < NR_IRQ_VECTORS; i++) {
x86_irq_funcs[i] = irq_spurious;
x86_irq_args[i] = (void *)(long)(i + IV_IRQS);
x86_irq_args[i] = (const void *)(long)(i + IV_IRQS);
}
}
@ -83,7 +83,7 @@ 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)(void *arg), void *arg, uint32_t flags)
{
uint32_t key;
int vector;
@ -107,7 +107,7 @@ int arch_irq_connect_dynamic(unsigned int irq, unsigned int priority,
#ifdef CONFIG_IRQ_OFFLOAD
#include <irq_offload.h>
void arch_irq_offload(irq_offload_routine_t routine, void *parameter)
void arch_irq_offload(irq_offload_routine_t routine, const void *parameter)
{
x86_irq_funcs[CONFIG_IRQ_OFFLOAD_VECTOR - IV_IRQS] = routine;
x86_irq_args[CONFIG_IRQ_OFFLOAD_VECTOR - IV_IRQS] = parameter;

View file

@ -14,7 +14,7 @@
*/
static irq_offload_routine_t offload_routine;
static void *offload_param;
static const void *offload_param;
/* Called by ISR dispatcher */
void z_irq_do_offload(void *unused)
@ -23,7 +23,7 @@ void z_irq_do_offload(void *unused)
offload_routine(offload_param);
}
void arch_irq_offload(irq_offload_routine_t routine, void *parameter)
void arch_irq_offload(irq_offload_routine_t routine, const void *parameter)
{
IRQ_CONNECT(CONFIG_IRQ_OFFLOAD_INTNUM, XCHAL_EXCM_LEVEL,
z_irq_do_offload, NULL, 0);