aboutsummaryrefslogtreecommitdiff
path: root/sys/amd64/isa
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2007-05-08 21:29:14 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2007-05-08 21:29:14 +0000
commitfb610ca1f90722fd133172ac73ab45c7980ea6e9 (patch)
treeb0dfc79e653fe3855596822772a53089b1187f41 /sys/amd64/isa
parentd287f590628fdf4fbdef05005ce3c2f9c0dc5a8f (diff)
downloadsrc-fb610ca1f90722fd133172ac73ab45c7980ea6e9.tar.gz
src-fb610ca1f90722fd133172ac73ab45c7980ea6e9.zip
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.
Notes
Notes: svn path=/head/; revision=169391
Diffstat (limited to 'sys/amd64/isa')
-rw-r--r--sys/amd64/isa/atpic.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/sys/amd64/isa/atpic.c b/sys/amd64/isa/atpic.c
index 3a88eda4ef10..d9792eb8fcde 100644
--- a/sys/amd64/isa/atpic.c
+++ b/sys/amd64/isa/atpic.c
@@ -107,9 +107,10 @@ inthand_t
#define ATPIC(io, base, eoi, imenptr) \
{ { atpic_enable_source, atpic_disable_source, (eoi), \
- atpic_enable_intr, atpic_vector, atpic_source_pending, NULL, \
- atpic_resume, atpic_config_intr, atpic_assign_cpu }, (io), \
- (base), IDT_IO_INTS + (base), (imenptr) }
+ atpic_enable_intr, atpic_disable_intr, atpic_vector, \
+ atpic_source_pending, NULL, atpic_resume, atpic_config_intr,\
+ atpic_assign_cpu }, (io), (base), IDT_IO_INTS + (base), \
+ (imenptr) }
#define INTSRC(irq) \
{ { &atpics[(irq) / 8].at_pic }, IDTVEC(atpic_intr ## irq ), \
@@ -137,6 +138,7 @@ static void atpic_disable_source(struct intsrc *isrc, int eoi);
static void atpic_eoi_master(struct intsrc *isrc);
static void atpic_eoi_slave(struct intsrc *isrc);
static void atpic_enable_intr(struct intsrc *isrc);
+static void atpic_disable_intr(struct intsrc *isrc);
static int atpic_vector(struct intsrc *isrc);
static void atpic_resume(struct pic *pic);
static int atpic_source_pending(struct intsrc *isrc);
@@ -266,6 +268,12 @@ atpic_enable_intr(struct intsrc *isrc)
{
}
+static void
+atpic_disable_intr(struct intsrc *isrc)
+{
+}
+
+
static int
atpic_vector(struct intsrc *isrc)
{