AquilaOS documentation
How it works, and its code
Loading...
Searching...
No Matches
irq.h File Reference
#include <core/types.h>

Go to the source code of this file.

Typedefs

typedef void(*) irq_handler_t(void *arg)

Functions

int irq_install (unsigned irq, irq_handler_t fn, void *arg)
 Installs a handler for an IRQ.
void irq_uninstall (unsigned irq, irq_handler_t fn, void *arg)
 Removes a handler that irq_install() installed.

Typedef Documentation

◆ irq_handler_t

typedef void(*) irq_handler_t(void *arg)

Definition at line 21 of file irq.h.

Function Documentation

◆ irq_install()

int irq_install ( unsigned irq,
irq_handler_t fn,
void * arg )

Installs a handler for an IRQ.

The first handler installed unmasks the IRQ at its interrupt controller.

Parameters
irqthe IRQ, the platform's number for it
fnthe handler
argthe argument the handler is called with
Returns
0, -EINVAL if there's no such IRQ, or -ENOMEM if there was no memory for the handler

Definition at line 32 of file irq.c.

References handler::arg, chip_of(), handler::fn, gic_enable(), handlers, irq_install(), IRQ_NR, irqs, kmalloc(), M_ZERO, handler::next, x86_irq_chip::unmask, X86_IRQ_NR, and X86_IRQ_TIMER.

Referenced by arch_msi_alloc(), ata_probe(), e1000_probe(), i8042_init(), irq_install(), pl011_init(), platform_timer_setup(), timer_setup(), uart_8250_attach(), and x86_lapic_timer_setup().

◆ irq_uninstall()

void irq_uninstall ( unsigned irq,
irq_handler_t fn,
void * arg )

Removes a handler that irq_install() installed.

The last handler removed masks the IRQ at its interrupt controller.

Parameters
irqthe IRQ
fnthe handler, as it was installed
argits argument, as it was installed

Definition at line 62 of file irq.c.

References handler::arg, chip_of(), handler::fn, gic_disable(), handlers, IRQ_NR, irq_uninstall(), irqs, kfree(), x86_irq_chip::mask, handler::next, X86_IRQ_NR, and X86_IRQ_TIMER.

Referenced by irq_uninstall().