blob: 1a651b2dcfd4d9e56c98ee89cb12d43a0311293d [file] [log] [blame]
Andrew Boiebba95102015-11-17 14:08:45 -08001/*
2 * Copyright (c) 2015 Intel corporation
3 *
David B. Kinderac74d8b2017-01-18 17:01:01 -08004 * SPDX-License-Identifier: Apache-2.0
Andrew Boiebba95102015-11-17 14:08:45 -08005 */
6
7/**
Peter Mitsis8413e1f2016-02-11 11:53:03 -05008 * @file
9 * @brief IRQ Offload interface
Andrew Boiebba95102015-11-17 14:08:45 -080010 */
Flavio Ceolin67ca1762018-09-14 10:43:44 -070011#ifndef ZEPHYR_INCLUDE_IRQ_OFFLOAD_H_
12#define ZEPHYR_INCLUDE_IRQ_OFFLOAD_H_
Andrew Boiebba95102015-11-17 14:08:45 -080013
Peter Mitsisa0e45682016-01-22 12:38:49 -050014#ifdef __cplusplus
15extern "C" {
16#endif
17
Krzysztof Chruscinskia1829cf2021-04-19 11:35:44 +020018typedef void (*irq_offload_routine_t)(const void *parameter);
Andrew Boiee09a0252019-11-06 14:17:17 -080019
Andrew Boiebba95102015-11-17 14:08:45 -080020/**
21 * @brief Run a function in interrupt context
22 *
23 * This function synchronously runs the provided function in interrupt
Tomasz Bursztyka84942e42020-07-10 10:51:37 +020024 * context, passing in the supplied device. Useful for test code
Andrew Boiebba95102015-11-17 14:08:45 -080025 * which needs to show that kernel objects work correctly in interrupt
26 * context.
27 *
28 * @param routine The function to run
29 * @param parameter Argument to pass to the function when it is run as an
30 * interrupt
31 */
Tomasz Bursztyka84942e42020-07-10 10:51:37 +020032void irq_offload(irq_offload_routine_t routine, const void *parameter);
Andrew Boiebba95102015-11-17 14:08:45 -080033
Peter Mitsisa0e45682016-01-22 12:38:49 -050034#ifdef __cplusplus
35}
36#endif
37
Andrew Boiebba95102015-11-17 14:08:45 -080038#endif /* _SW_IRQ_H_ */