1 /* 2 * Copyright (c) 2023, Meta 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 */ 6 7 /** 8 * @file 9 * @brief Private header for the software-managed ISR table's functions 10 */ 11 12 #ifndef ZEPHYR_ARCH_COMMON_INCLUDE_SW_ISR_COMMON_H_ 13 #define ZEPHYR_ARCH_COMMON_INCLUDE_SW_ISR_COMMON_H_ 14 15 #if !defined(_ASMLANGUAGE) 16 #include <zephyr/device.h> 17 18 #ifdef __cplusplus 19 extern "C" { 20 #endif 21 22 /** 23 * @brief Helper function used to compute the index in _sw_isr_table 24 * based on passed IRQ. 25 * 26 * @param irq IRQ number in its zephyr format 27 * 28 * @return corresponding index in _sw_isr_table 29 */ 30 unsigned int z_get_sw_isr_table_idx(unsigned int irq); 31 32 /** 33 * @brief Helper function used to get the parent interrupt controller device based on passed IRQ. 34 * 35 * @param irq IRQ number in its zephyr format 36 * 37 * @return corresponding interrupt controller device in _sw_isr_table 38 */ 39 const struct device *z_get_sw_isr_device_from_irq(unsigned int irq); 40 41 /** 42 * @brief Helper function used to get the IRQN of the passed in parent interrupt 43 * controller device. 44 * 45 * @param dev parent interrupt controller device 46 * 47 * @return IRQN of the interrupt controller 48 */ 49 unsigned int z_get_sw_isr_irq_from_device(const struct device *dev); 50 51 #ifdef __cplusplus 52 } 53 #endif 54 55 #endif /* _ASMLANGUAGE */ 56 57 #endif /* ZEPHYR_ARCH_COMMON_INCLUDE_SW_ISR_COMMON_H_ */ 58