2019-11-11 00:17:19 +08:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2019 Carlo Caione <ccaione@baylibre.com>
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @file
|
|
|
|
* @brief Software interrupts utility code - ARM64 implementation
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <kernel.h>
|
|
|
|
#include <irq_offload.h>
|
2021-03-25 18:56:15 +08:00
|
|
|
#include <exc.h>
|
2019-11-11 00:17:19 +08:00
|
|
|
|
|
|
|
volatile irq_offload_routine_t offload_routine;
|
2020-07-10 16:57:23 +08:00
|
|
|
static const void *offload_param;
|
2019-11-11 00:17:19 +08:00
|
|
|
|
|
|
|
void z_irq_do_offload(void)
|
|
|
|
{
|
|
|
|
offload_routine(offload_param);
|
|
|
|
}
|
|
|
|
|
2020-07-10 16:57:23 +08:00
|
|
|
void arch_irq_offload(irq_offload_routine_t routine, const void *parameter)
|
2019-11-11 00:17:19 +08:00
|
|
|
{
|
|
|
|
k_sched_lock();
|
|
|
|
offload_routine = routine;
|
|
|
|
offload_param = parameter;
|
|
|
|
|
|
|
|
z_arm64_offload();
|
|
|
|
|
|
|
|
offload_routine = NULL;
|
|
|
|
k_sched_unlock();
|
|
|
|
}
|