blob: dc5207abe6bdec44166e1da3be8bbff5c2a0fe12 [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
Andrew Boie979b17f2019-10-03 15:20:41 -070018#ifdef CONFIG_IRQ_OFFLOAD
Tomasz Bursztyka84942e42020-07-10 10:51:37 +020019 typedef void (*irq_offload_routine_t)(const void *parameter);
Andrew Boiee09a0252019-11-06 14:17:17 -080020
Andrew Boiebba95102015-11-17 14:08:45 -080021/**
22 * @brief Run a function in interrupt context
23 *
24 * This function synchronously runs the provided function in interrupt
Tomasz Bursztyka84942e42020-07-10 10:51:37 +020025 * context, passing in the supplied device. Useful for test code
Andrew Boiebba95102015-11-17 14:08:45 -080026 * which needs to show that kernel objects work correctly in interrupt
27 * context.
28 *
29 * @param routine The function to run
30 * @param parameter Argument to pass to the function when it is run as an
31 * interrupt
32 */
Tomasz Bursztyka84942e42020-07-10 10:51:37 +020033void irq_offload(irq_offload_routine_t routine, const void *parameter);
Andrew Boie979b17f2019-10-03 15:20:41 -070034#endif
Andrew Boiebba95102015-11-17 14:08:45 -080035
Peter Mitsisa0e45682016-01-22 12:38:49 -050036#ifdef __cplusplus
37}
38#endif
39
Andrew Boiebba95102015-11-17 14:08:45 -080040#endif /* _SW_IRQ_H_ */