1 /* 2 * Copyright (c) 2017 Oticon A/S 3 * Copyright (c) 2023 Nordic Semiconductor ASA 4 * 5 * SPDX-License-Identifier: Apache-2.0 6 */ 7 8 /** 9 * @file 10 * @brief API to the native simulator - native interrupt controller 11 */ 12 13 #ifndef NATIVE_SIMULATOR_NATIVE_SRC_IRQ_CTRL_H 14 #define NATIVE_SIMULATOR_NATIVE_SRC_IRQ_CTRL_H 15 16 #include <stdint.h> 17 18 #ifdef __cplusplus 19 extern "C" { 20 #endif 21 22 void hw_irq_ctrl_set_cur_prio(int new); 23 int hw_irq_ctrl_get_cur_prio(void); 24 25 void hw_irq_ctrl_prio_set(unsigned int irq, unsigned int prio); 26 uint8_t hw_irq_ctrl_get_prio(unsigned int irq); 27 28 int hw_irq_ctrl_get_highest_prio_irq(void); 29 uint32_t hw_irq_ctrl_get_current_lock(void); 30 uint32_t hw_irq_ctrl_change_lock(uint32_t new_lock); 31 uint64_t hw_irq_ctrl_get_irq_status(void); 32 void hw_irq_ctrl_disable_irq(unsigned int irq); 33 int hw_irq_ctrl_is_irq_enabled(unsigned int irq); 34 void hw_irq_ctrl_clear_irq(unsigned int irq); 35 void hw_irq_ctrl_enable_irq(unsigned int irq); 36 void hw_irq_ctrl_set_irq(unsigned int irq); 37 void hw_irq_ctrl_raise_im(unsigned int irq); 38 void hw_irq_ctrl_raise_im_from_sw(unsigned int irq); 39 40 #define N_IRQS 32 41 42 #ifdef __cplusplus 43 } 44 #endif 45 46 #endif /* NATIVE_SIMULATOR_NATIVE_SRC_IRQ_CTRL_H */ 47