32enum irq_exception:
unsigned int;
49typedef enum irq_exception
irq_t;
67typedef struct irq_cb {
106 return arch_irq_disable();
120 arch_irq_restore(state);
129#define irq_disable_scoped() __irq_disable_scoped(__LINE__)
138 return arch_irq_inside_int();
166 uintptr_t stack_pointer,
168 const uintptr_t *args) {
169 arch_irq_create_context(context, stack_pointer, routine, args);
182 arch_irq_set_context(
cxt);
195 return arch_irq_get_context();
224 return arch_irq_set_handler(code,
hnd,
data);
237 return arch_irq_get_handler(code);
255 return arch_irq_set_global_handler(
hnd,
data);
264 return arch_irq_get_global_handler();
285void irq_shutdown(
void);
287static inline void __irq_scoped_cleanup(
irq_mask_t *state) {
291#define ___irq_disable_scoped(l) \
292 irq_mask_t __scoped_irq_##l __attribute__((cleanup(__irq_scoped_cleanup))) = irq_disable()
294#define __irq_disable_scoped(l) ___irq_disable_scoped(l)
void hnd(const char *file, int line, const char *expr, const char *msg, const char *func)
Definition asserthnd.c:53
static struct @69 data[BARRIER_COUNT]
static pvr_poly_cxt_t cxt
Definition bubbles.c:28
static irq_context_t * irq_get_context(void)
Get the current IRQ context.
Definition irq.h:194
static void irq_create_context(irq_context_t *context, uintptr_t stack_pointer, uintptr_t routine, const uintptr_t *args)
Fill a newly allocated context block.
Definition irq.h:165
static void irq_set_context(irq_context_t *cxt)
Switch out contexts (for interrupt return).
Definition irq.h:181
static irq_cb_t irq_get_handler(irq_t code)
Get the address of the current handler for the IRQ type.
Definition irq.h:236
static irq_cb_t irq_get_global_handler(void)
Get the global exception handler.
Definition irq.h:263
static int irq_set_global_handler(irq_hdl_t hnd, void *data)
Set a global exception handler.
Definition irq.h:254
static int irq_set_handler(irq_t code, irq_hdl_t hnd, void *data)
Set or remove an IRQ handler.
Definition irq.h:223
static void irq_enable(void)
Enable all interrupts.
Definition irq.h:91
static irq_mask_t irq_disable(void)
Disable interrupts.
Definition irq.h:105
static void irq_restore(irq_mask_t state)
Restore interrupt state.
Definition irq.h:119
static bool irq_inside_int(void)
Returns whether inside of an interrupt context.
Definition irq.h:137
enum irq_exception irq_t
Architecture-specific interrupt exception codes.
Definition irq.h:49
struct irq_context irq_context_t
Architecture-specific structure for holding the processor state.
Definition irq.h:43
uint32_t irq_mask_t
Type representing an interrupt mask state.
Definition irq.h:52
void(* irq_hdl_t)(irq_t code, irq_context_t *context, void *data)
The type of an IRQ handler.
Definition irq.h:60
Interrupt and exception handling.
The type of a full callback of an IRQ handler and userdata.
Definition irq.h:67
void * data
A pointer that will be passed along to the callback.
Definition irq.h:69
irq_hdl_t hdl
A pointer to a procedure to handle an exception.
Definition irq.h:68