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