irq: Change offload API to take a constant parameter

All ISRs are meant to take a const struct device pointer, but to
simplify the change let's just move the parameter to constant and that
should be fine.

Fixes #27399

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This commit is contained in:
Tomasz Bursztyka 2020-07-10 10:51:37 +02:00 committed by Carles Cufí
commit 84942e4fbc
3 changed files with 5 additions and 5 deletions

View file

@ -32,7 +32,7 @@ void posix_irq_unlock(unsigned int key);
void posix_irq_full_unlock(void); void posix_irq_full_unlock(void);
int posix_get_current_irq(void); int posix_get_current_irq(void);
#ifdef CONFIG_IRQ_OFFLOAD #ifdef CONFIG_IRQ_OFFLOAD
void posix_irq_offload(void (*routine)(void *), void *parameter); void posix_irq_offload(void (*routine)(const void *), const void *parameter);
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus

View file

@ -16,13 +16,13 @@ extern "C" {
#endif #endif
#ifdef CONFIG_IRQ_OFFLOAD #ifdef CONFIG_IRQ_OFFLOAD
typedef void (*irq_offload_routine_t)(void *parameter); typedef void (*irq_offload_routine_t)(const void *parameter);
/** /**
* @brief Run a function in interrupt context * @brief Run a function in interrupt context
* *
* This function synchronously runs the provided function in interrupt * This function synchronously runs the provided function in interrupt
* context, passing in the supplied parameter. Useful for test code * context, passing in the supplied device. Useful for test code
* which needs to show that kernel objects work correctly in interrupt * which needs to show that kernel objects work correctly in interrupt
* context. * context.
* *
@ -30,7 +30,7 @@ typedef void (*irq_offload_routine_t)(void *parameter);
* @param parameter Argument to pass to the function when it is run as an * @param parameter Argument to pass to the function when it is run as an
* interrupt * interrupt
*/ */
void irq_offload(irq_offload_routine_t routine, void *parameter); void irq_offload(irq_offload_routine_t routine, const void *parameter);
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus

View file

@ -351,7 +351,7 @@ int arch_irq_connect_dynamic(unsigned int irq, unsigned int priority,
* @param routine Function to run in interrupt context * @param routine Function to run in interrupt context
* @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, void *parameter); void arch_irq_offload(irq_offload_routine_t routine, const void *parameter);
#endif /* CONFIG_IRQ_OFFLOAD */ #endif /* CONFIG_IRQ_OFFLOAD */
/** @} */ /** @} */