Line data Source code
1 1 : /* 2 : * Copyright (c) 2015 Intel corporation 3 : * 4 : * SPDX-License-Identifier: Apache-2.0 5 : */ 6 : 7 : /** 8 : * @file 9 : * @brief IRQ Offload interface 10 : */ 11 : #ifndef ZEPHYR_INCLUDE_IRQ_OFFLOAD_H_ 12 : #define ZEPHYR_INCLUDE_IRQ_OFFLOAD_H_ 13 : 14 : #ifdef __cplusplus 15 : extern "C" { 16 : #endif 17 : 18 0 : typedef void (*irq_offload_routine_t)(const void *parameter); 19 : 20 : /** 21 : * @brief Run a function in interrupt context 22 : * 23 : * This function synchronously runs the provided function in interrupt 24 : * context, passing in the supplied device. Useful for test code 25 : * which needs to show that kernel objects work correctly in interrupt 26 : * context. 27 : * 28 : * Additionally, when CONFIG_IRQ_OFFLOAD_NESTED is set by the 29 : * architecture, this routine works to synchronously invoke a nested 30 : * interrupt when called from an ISR context (i.e. when k_is_in_isr() 31 : * is true). Note that not all platforms will have hardware support 32 : * for this capability, and even on those some interrupts may be 33 : * running at unpreemptible priorities. 34 : * 35 : * @param routine The function to run 36 : * @param parameter Argument to pass to the function when it is run as an 37 : * interrupt 38 : */ 39 1 : void irq_offload(irq_offload_routine_t routine, const void *parameter); 40 : 41 : #ifdef __cplusplus 42 : } 43 : #endif 44 : 45 : #endif /* _SW_IRQ_H_ */