Lines Matching +full:int +full:- +full:a
2 * Copyright (c) 2017 Oticon A/S
4 * SPDX-License-Identifier: Apache-2.0
26 typedef int (*direct_irq_f_ptr)(void);
30 static int currently_running_irq = -1;
32 static inline void vector_to_irq(int irq_nbr, int *may_swap) in vector_to_irq()
52 posix_print_error_and_exit("Received irq %i without a " in vector_to_irq()
78 * needed, swap to a re-enabled thread
80 * Note that even that this function is executing in a Zephyr thread, it is
87 int irq_nbr; in posix_irq_handler()
88 static int may_swap; in posix_irq_handler()
89 const int cpu_n = CONFIG_NATIVE_SIMULATOR_MCU_N; in posix_irq_handler()
100 if (irq_nbr == -1) { in posix_irq_handler()
101 /* This is a phony interrupt during a busy wait, no need for more */ in posix_irq_handler()
112 int last_current_running_prio = hw_irq_ctrl_get_cur_prio(cpu_n); in posix_irq_handler()
113 int last_running_irq = currently_running_irq; in posix_irq_handler()
125 } while ((irq_nbr = hw_irq_ctrl_get_highest_prio_irq(cpu_n)) != -1); in posix_irq_handler()
127 _kernel.cpus[0].nested--; in posix_irq_handler()
133 * 4) we are in a irq postfix (not just in a WFE) in posix_irq_handler()
152 * if a higher priority interrupt than the possibly currently running is in posix_irq_handler_im_from_sw()
156 if (hw_irq_ctrl_get_highest_prio_irq(CONFIG_NATIVE_SIMULATOR_MCU_N) != -1) { in posix_irq_handler_im_from_sw()
160 "called from a HW model thread\n", in posix_irq_handler_im_from_sw()
172 * task or fiber level. This routine returns an architecture-dependent
173 * lock-out key representing the "interrupt disable state" prior to the call;
174 * this key can be passed to irq_unlock() to re-enable interrupts.
176 * The lock-out key should only be used as the argument to the irq_unlock()
177 * API. It should never be used to manually re-enable interrupts or to inspect
180 * This function can be called recursively: it will return a key to return the
184 * Invoking a kernel routine with interrupts locked may result in
185 * interrupts being re-enabled for an unspecified period of time. If the
186 * called routine blocks, interrupts will be re-enabled while another
189 * The "interrupt disable state" is an attribute of a thread. Thus, if a
190 * fiber or task disables interrupts and subsequently invokes a kernel
195 * @return An architecture-dependent lock-out key representing the
199 unsigned int posix_irq_lock(void) in posix_irq_lock()
207 * This routine re-enables interrupts on the CPU. The @a key parameter is a
208 * board-dependent lock-out key that is returned by a previous invocation of
213 void posix_irq_unlock(unsigned int key) in posix_irq_unlock()
223 void posix_irq_enable(unsigned int irq) in posix_irq_enable()
228 void posix_irq_disable(unsigned int irq) in posix_irq_disable()
233 int posix_irq_is_enabled(unsigned int irq) in posix_irq_is_enabled()
238 int posix_get_current_irq(void) in posix_get_current_irq()
244 * Configure a static interrupt.
253 * @param flags [plug it directly (1), or as a SW managed interrupt (0)]
258 void posix_isr_declare(unsigned int irq_p, int flags, void isr_p(const void *), in posix_isr_declare()
279 void posix_irq_priority_set(unsigned int irq, unsigned int prio, uint32_t flags) in posix_irq_priority_set()
286 * set a pending IRQ from SW
289 * IRQs are not locked, and this interrupt has higher priority than a possibly
292 void posix_sw_set_pending_IRQ(unsigned int IRQn) in posix_sw_set_pending_IRQ()
299 * clear a pending irq from SW
301 void posix_sw_clear_pending_IRQ(unsigned int IRQn) in posix_sw_clear_pending_IRQ()
316 static void offload_sw_irq_handler(const void *a) in offload_sw_irq_handler() argument
318 ARG_UNUSED(a); in offload_sw_irq_handler()
323 * @brief Run a function in interrupt context