33 LOG_WARN(
"unhandled irq %llu (vector=0x%x)\n", irq, frame->
vector);
46 panic(
NULL,
"IRQ handler limit exceeded for irq=%d\n", irq);
60 LOG_INFO(
"installed handler for irq=%d slot=%u\n", irq, slot);
71 if (callback->
func == func)
76 LOG_INFO(
"uninstalled handler for irq=%d slot=%u\n", irq, i);
@ EXTERNAL_INTERRUPT_BASE
void irq_install(irq_t irq, irq_callback_func_t func, void *data)
Install an IRQ handler.
#define IRQ_MAX_CALLBACK
Maximum amount of callbacks per IRQ.
void irq_dispatch(interrupt_frame_t *frame)
Dispatch an IRQ.
void irq_uninstall(irq_t irq, irq_callback_func_t func)
Uninstall an IRQ handler.
void(* irq_callback_func_t)(irq_t irq, void *data)
Callback function type for IRQs.
static cpu_t * smp_self_unsafe(void)
Returns a pointer to the cpu_t structure of the current CPU.
void lapic_eoi(void)
Send an End Of Interrupt (EOI) signal to the local apic.
void ioapic_set_redirect(interrupt_t vector, ioapic_gsi_t gsi, ioapic_delivery_mode_t deliveryMode, ioapic_polarity_t polarity, ioapic_trigger_mode_t triggerMode, cpu_t *cpu, bool enable)
Set an IOAPIC redirection entry.
NORETURN void panic(const interrupt_frame_t *frame, const char *format,...)
Panic the kernel, printing a message and halting.
#define LOG_WARN(format,...)
#define LOG_INFO(format,...)
#define RWLOCK_CREATE
Create a rwlock initializer.
#define RWLOCK_READ_SCOPE(lock)
Acquires a rwlock for reading for the reminder of the current scope.
#define RWLOCK_WRITE_SCOPE(lock)
Acquires a rwlock for writing for the reminder of the current scope.
#define NULL
Pointer error value.
static irq_handler_t handlers[IRQ_AMOUNT]
Structure to hold an IRQ callback and its data.
Structure to hold all callbacks for an IRQ.
irq_callback_t callbacks[IRQ_MAX_CALLBACK]
Read-Write Ticket Lock structure.