summaryrefslogtreecommitdiffstats
path: root/sys/amd64/include/apicvar.h
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2005-11-02 20:11:47 +0000
committerjhb <jhb@FreeBSD.org>2005-11-02 20:11:47 +0000
commit830d2103fbe6636ab7adf8d4fb308b9a383be46f (patch)
tree0abf84b2a71d8deda27b993addab30eae0f16b6a /sys/amd64/include/apicvar.h
parentc104267c1a97cafb9b2e7707382601a452ced831 (diff)
downloadFreeBSD-src-830d2103fbe6636ab7adf8d4fb308b9a383be46f.zip
FreeBSD-src-830d2103fbe6636ab7adf8d4fb308b9a383be46f.tar.gz
Change the x86 code to allocate IDT vectors on-demand when an interrupt
source is first enabled similar to how intr_event's now allocate ithreads on-demand. Previously, we would map IDT vectors 1:1 to IRQs. Since we only have 191 available IDT vectors for I/O interrupts, this limited us to only supporting IRQs 0-190 corresponding to the first 190 I/O APIC intpins. On many machines, however, each PCI-X bus has its own APIC even though it only has 1 or 2 devices, thus, we were reserving between 24 and 32 IRQs just for 1 or 2 devices and thus 24 or 32 IDT vectors. With this change, a machine with 100 IRQs but only 5 in use will only use up 5 IDT vectors. Also, this change provides an API (apic_alloc_vector() and apic_free_vector()) that will allow a future MSI interrupt source driver to request IDT vectors for use by MSI interrupts on x86 machines. Tested on: amd64, i386
Diffstat (limited to 'sys/amd64/include/apicvar.h')
-rw-r--r--sys/amd64/include/apicvar.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/amd64/include/apicvar.h b/sys/amd64/include/apicvar.h
index eb05c6a..10dae1e 100644
--- a/sys/amd64/include/apicvar.h
+++ b/sys/amd64/include/apicvar.h
@@ -173,7 +173,9 @@ inthand_t
IDTVEC(apic_isr4), IDTVEC(apic_isr5), IDTVEC(apic_isr6),
IDTVEC(apic_isr7), IDTVEC(spuriousint), IDTVEC(timerint);
-u_int apic_irq_to_idt(u_int irq);
+u_int apic_alloc_vector(u_int irq);
+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);
void apic_register_enumerator(struct apic_enumerator *enumerator);
void *ioapic_create(uintptr_t addr, int32_t id, int intbase);
@@ -192,7 +194,6 @@ int ioapic_set_smi(void *cookie, u_int pin);
void lapic_create(u_int apic_id, int boot_cpu);
void lapic_disable(void);
void lapic_dump(const char *str);
-void lapic_enable_intr(u_int vector);
void lapic_eoi(void);
int lapic_id(void);
void lapic_init(uintptr_t addr);
OpenPOWER on IntegriCloud