Lines Matching +full:irq +full:- +full:prio

4  * SPDX-License-Identifier: Apache-2.0
6 * HW IRQ controller model
27 * irq handler
41 static bool lock_ignore; /* For the hard fake IRQ, temporarily ignore lock */
44 /* note that prio = 0 == highest, prio=255 == lowest */
46 static int currently_running_prio = 256; /* 255 is the lowest prio interrupt */
75 void hw_irq_ctrl_prio_set(unsigned int irq, unsigned int prio) in hw_irq_ctrl_prio_set() argument
77 irq_prio[irq] = prio; in hw_irq_ctrl_prio_set()
80 uint8_t hw_irq_ctrl_get_prio(unsigned int irq) in hw_irq_ctrl_get_prio() argument
82 return irq_prio[irq]; in hw_irq_ctrl_get_prio()
89 * If none, return -1
94 return -1; in hw_irq_ctrl_get_highest_prio_irq()
98 int winner = -1; in hw_irq_ctrl_get_highest_prio_irq()
102 int irq_nbr = find_lsb_set(hw_irq_status) - 1; in hw_irq_ctrl_get_highest_prio_irq()
151 void hw_irq_ctrl_disable_irq(unsigned int irq) in hw_irq_ctrl_disable_irq() argument
153 irq_mask &= ~((uint64_t)1<<irq); in hw_irq_ctrl_disable_irq()
156 int hw_irq_ctrl_is_irq_enabled(unsigned int irq) in hw_irq_ctrl_is_irq_enabled() argument
158 return (irq_mask & ((uint64_t)1 << irq))?1:0; in hw_irq_ctrl_is_irq_enabled()
166 void hw_irq_ctrl_clear_irq(unsigned int irq) in hw_irq_ctrl_clear_irq() argument
168 irq_status &= ~((uint64_t)1<<irq); in hw_irq_ctrl_clear_irq()
169 irq_premask &= ~((uint64_t)1<<irq); in hw_irq_ctrl_clear_irq()
181 void hw_irq_ctrl_enable_irq(unsigned int irq) in hw_irq_ctrl_enable_irq() argument
183 irq_mask |= ((uint64_t)1<<irq); in hw_irq_ctrl_enable_irq()
184 if (irq_premask & ((uint64_t)1<<irq)) { /* if IRQ is pending */ in hw_irq_ctrl_enable_irq()
185 hw_irq_ctrl_raise_im_from_sw(irq); in hw_irq_ctrl_enable_irq()
190 static inline void hw_irq_ctrl_irq_raise_prefix(unsigned int irq) in hw_irq_ctrl_irq_raise_prefix() argument
192 if (irq < N_IRQS) { in hw_irq_ctrl_irq_raise_prefix()
193 irq_premask |= ((uint64_t)1<<irq); in hw_irq_ctrl_irq_raise_prefix()
195 if (irq_mask & (1 << irq)) { in hw_irq_ctrl_irq_raise_prefix()
196 irq_status |= ((uint64_t)1<<irq); in hw_irq_ctrl_irq_raise_prefix()
198 } else if (irq == PHONY_HARD_IRQ) { in hw_irq_ctrl_irq_raise_prefix()
206 * This function is meant to be used by either the SW manual IRQ raising
207 * or by HW which wants the IRQ to be raised in one delta cycle from now
209 void hw_irq_ctrl_set_irq(unsigned int irq) in hw_irq_ctrl_set_irq() argument
211 hw_irq_ctrl_irq_raise_prefix(irq); in hw_irq_ctrl_set_irq()
215 * Note that we awake the CPU even if the IRQ is disabled in hw_irq_ctrl_set_irq()
217 * instruction and the CPU is allowed to awake just with the irq in hw_irq_ctrl_set_irq()
230 * We always awake the CPU even if the IRQ was masked, in irq_raising_from_hw_now()
247 void hw_irq_ctrl_raise_im(unsigned int irq) in hw_irq_ctrl_raise_im() argument
249 hw_irq_ctrl_irq_raise_prefix(irq); in hw_irq_ctrl_raise_im()
258 void hw_irq_ctrl_raise_im_from_sw(unsigned int irq) in hw_irq_ctrl_raise_im_from_sw() argument
260 hw_irq_ctrl_irq_raise_prefix(irq); in hw_irq_ctrl_raise_im_from_sw()