2015-11-18 06:08:45 +08:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2015 Intel corporation
|
|
|
|
*
|
2017-01-19 09:01:01 +08:00
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
2015-11-18 06:08:45 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
2016-02-12 00:53:03 +08:00
|
|
|
* @file
|
|
|
|
* @brief IRQ Offload interface
|
2015-11-18 06:08:45 +08:00
|
|
|
*/
|
2018-09-15 01:43:44 +08:00
|
|
|
#ifndef ZEPHYR_INCLUDE_IRQ_OFFLOAD_H_
|
|
|
|
#define ZEPHYR_INCLUDE_IRQ_OFFLOAD_H_
|
2015-11-18 06:08:45 +08:00
|
|
|
|
2016-01-23 01:38:49 +08:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2019-10-04 06:20:41 +08:00
|
|
|
#ifdef CONFIG_IRQ_OFFLOAD
|
2020-07-10 16:51:37 +08:00
|
|
|
typedef void (*irq_offload_routine_t)(const void *parameter);
|
2019-11-07 06:17:17 +08:00
|
|
|
|
2015-11-18 06:08:45 +08:00
|
|
|
/**
|
|
|
|
* @brief Run a function in interrupt context
|
|
|
|
*
|
|
|
|
* This function synchronously runs the provided function in interrupt
|
2020-07-10 16:51:37 +08:00
|
|
|
* context, passing in the supplied device. Useful for test code
|
2015-11-18 06:08:45 +08:00
|
|
|
* which needs to show that kernel objects work correctly in interrupt
|
|
|
|
* context.
|
|
|
|
*
|
|
|
|
* @param routine The function to run
|
|
|
|
* @param parameter Argument to pass to the function when it is run as an
|
|
|
|
* interrupt
|
|
|
|
*/
|
2020-07-10 16:51:37 +08:00
|
|
|
void irq_offload(irq_offload_routine_t routine, const void *parameter);
|
2019-10-04 06:20:41 +08:00
|
|
|
#endif
|
2015-11-18 06:08:45 +08:00
|
|
|
|
2016-01-23 01:38:49 +08:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2015-11-18 06:08:45 +08:00
|
|
|
#endif /* _SW_IRQ_H_ */
|