diff options
author | jhb <jhb@FreeBSD.org> | 2007-05-08 21:29:14 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2007-05-08 21:29:14 +0000 |
commit | 23cec608a68684526dc8d307c87222af3aa2e0bf (patch) | |
tree | b0dfc79e653fe3855596822772a53089b1187f41 /sys/amd64/include/apicvar.h | |
parent | 3b37bd02b406660a3b4ae896f7eb37e0450a6ada (diff) | |
download | FreeBSD-src-23cec608a68684526dc8d307c87222af3aa2e0bf.zip FreeBSD-src-23cec608a68684526dc8d307c87222af3aa2e0bf.tar.gz |
Minor fixes and tweaks to the x86 interrupt code:
- Split the intr_table_lock into an sx lock used for most things, and a
spin lock to protect intrcnt_index. Originally I had this as a spin lock
so interrupt code could use it to lookup sources. However, we don't
actually do that because it would add a lot of overhead to interrupts,
and if we ever do support removing interrupt sources, we can use other
means to safely do so w/o locking in the interrupt handling code.
- Replace is_enabled (boolean) with is_handlers (a count of handlers) to
determine if a source is enabled or not. This allows us to notice when
a source is no longer in use. When that happens, we now invoke a new
PIC method (pic_disable_intr()) to inform the PIC driver that the
source is no longer in use. The I/O APIC driver frees the APIC IDT
vector when this happens. The MSI driver no longer needs to have a
hack to clear is_enabled during msi_alloc() and msix_alloc() as a result
of this change as well.
- Add an apic_disable_vector() to reset an IDT vector back to Xrsvd to
complement apic_enable_vector() and use it in the I/O APIC and MSI code
when freeing an IDT vector.
- Add a new nexus hook: nexus_add_irq() to ask the nexus driver to add an
IRQ to its irq_rman. The MSI code uses this when it creates new
interrupt sources to let the nexus know about newly valid IRQs.
Previously the msi_alloc() and msix_alloc() passed some extra stuff
back to the nexus methods which then added the IRQs. This approach is
a bit cleaner.
- Change the MSI sx lock to a mutex. If we need to create new sources,
drop the lock, create the required number of sources, then get the lock
and try the allocation again.
Diffstat (limited to 'sys/amd64/include/apicvar.h')
-rw-r--r-- | sys/amd64/include/apicvar.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/amd64/include/apicvar.h b/sys/amd64/include/apicvar.h index 9ffe17c..107656b 100644 --- a/sys/amd64/include/apicvar.h +++ b/sys/amd64/include/apicvar.h @@ -178,6 +178,7 @@ extern vm_paddr_t lapic_paddr; u_int apic_alloc_vector(u_int irq); u_int apic_alloc_vectors(u_int *irqs, u_int count, u_int align); +void apic_disable_vector(u_int vector); void apic_enable_vector(u_int vector); void apic_free_vector(u_int vector, u_int irq); u_int apic_idt_to_irq(u_int vector); |