|
AquilaOS documentation
How it works, and its code
|
The interrupts' handlers on the virt machine, installed by their drivers (see dev/irq.h). More...
#include <core/system.h>#include <core/string.h>#include <mm/mm.h>#include <dev/irq.h>#include <platform/virt.h>#include <aquila/errno.h>Go to the source code of this file.
Data Structures | |
| struct | handler |
| An installed handler, on its interrupt's list. More... | |
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. | |
| void | irq_handle (void) |
| Runs the handlers of the interrupt that came, then tells the GIC it's done, before any thread switch, so that the next interrupts keep coming. | |
| int | arch_interrupts_info (char *buf, size_t size) |
Variables | |
| static struct handler * | handlers [IRQ_NR] |
| static uint64_t | counts [IRQ_NR] |
The interrupts' handlers on the virt machine, installed by their drivers (see dev/irq.h).
An interrupt may have several handlers (a shared line), and each is called. The GIC says which interrupt came; the first handler installed enables it, and the last one uninstalled disables it.
Definition in file irq.c.
| int arch_interrupts_info | ( | char * | buf, |
| size_t | size ) |
Definition at line 105 of file irq.c.
References arch_interrupts_info(), counts, IRQ_NR, and snprintf().
Referenced by arch_interrupts_info(), and procfs_interrupts().
| void irq_handle | ( | void | ) |
Runs the handlers of the interrupt that came, then tells the GIC it's done, before any thread switch, so that the next interrupts keep coming.
Definition at line 84 of file irq.c.
References counts, gic_ack(), gic_eoi(), handlers, irq_handle(), IRQ_NR, and handler::next.
Referenced by __x86_irq_handler(), aarch64_irq(), irq_dispatch(), irq_handle(), and irq_handle().
| 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.
| irq | the IRQ, the platform's number for it |
| fn | the handler |
| arg | the argument the handler is called with |
Definition at line 32 of file irq.c.
References handler::arg, handler::fn, gic_enable(), handlers, irq_install(), IRQ_NR, kmalloc(), M_ZERO, and handler::next.
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().
| 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.
| irq | the IRQ |
| fn | the handler, as it was installed |
| arg | its argument, as it was installed |
Definition at line 62 of file irq.c.
References handler::arg, handler::fn, gic_disable(), handlers, IRQ_NR, irq_uninstall(), kfree(), and handler::next.
Referenced by irq_uninstall().
Definition at line 27 of file irq.c.
Referenced by arch_interrupts_info(), and irq_handle().
Definition at line 26 of file irq.c.
Referenced by arch_interrupts_info(), irq_handle(), irq_handle(), irq_install(), irq_uninstall(), and x86_irq_alloc().