diff options
author | jhb <jhb@FreeBSD.org> | 2003-11-03 21:53:38 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2003-11-03 21:53:38 +0000 |
commit | dcec7e1907fe867da713052f8c91d79bbfe68000 (patch) | |
tree | c7dc6abe8f136cde7b0dbbc6ce1152f91bb42ad1 /sys/i386/pci | |
parent | aac4b7181cbed34861c76ff9d9142c7fdf212008 (diff) | |
download | FreeBSD-src-dcec7e1907fe867da713052f8c91d79bbfe68000.zip FreeBSD-src-dcec7e1907fe867da713052f8c91d79bbfe68000.tar.gz |
New APIC support code:
- The apic interrupt entry points have been rewritten so that each entry
point can serve 32 different vectors. When the entry is executed, it
uses one of the 32-bit ISR registers to determine which vector in its
assigned range was triggered. Thus, the apic code can support 159
different interrupt vectors with only 5 entry points.
- We now always to disable the local APIC to work around an errata in
certain PPros and then re-enable it again if we decide to use the APICs
to route interrupts.
- We no longer map IO APICs or local APICs using special page table
entries. Instead, we just use pmap_mapdev(). We also no longer
export the virtual address of the local APIC as a global symbol to
the rest of the system, but only in local_apic.c. To aid this, the
APIC ID of each CPU is exported as a per-CPU variable.
- Interrupt sources are provided for each intpin on each IO APIC.
Currently, each source is given a unique interrupt vector meaning that
PCI interrupts are not shared on most machines with an I/O APIC.
That mapping for interrupt sources to interrupt vectors is up to the
APIC enumerator driver however.
- We no longer probe to see if we need to use mixed mode to route IRQ 0,
instead we always use mixed mode to route IRQ 0 for now. This can be
disabled via the 'NO_MIXED_MODE' kernel option.
- The npx(4) driver now always probes to see if a built-in FPU is present
since this test can now be performed with the new APIC code. However,
an SMP kernel will panic if there is more than one CPU and a built-in
FPU is not found.
- PCI interrupts are now properly routed when using APICs to route
interrupts, so remove the hack to psuedo-route interrupts when the
intpin register was read.
- The apic.h header was moved to apicreg.h and a new apicvar.h header
that declares the APIs used by the new APIC code was added.
Diffstat (limited to 'sys/i386/pci')
-rw-r--r-- | sys/i386/pci/pci_cfgreg.c | 51 | ||||
-rw-r--r-- | sys/i386/pci/pci_pir.c | 51 |
2 files changed, 4 insertions, 98 deletions
diff --git a/sys/i386/pci/pci_cfgreg.c b/sys/i386/pci/pci_cfgreg.c index ec5def9..91746fe 100644 --- a/sys/i386/pci/pci_cfgreg.c +++ b/sys/i386/pci/pci_cfgreg.c @@ -48,10 +48,6 @@ __FBSDID("$FreeBSD$"); #include <machine/segments.h> #include <machine/pc/bios.h> -#ifdef APIC_IO -#include <machine/smp.h> -#endif /* APIC_IO */ - #include "pcib_if.h" #define PRVERB(a) do { \ @@ -201,49 +197,7 @@ u_int32_t pci_cfgregread(int bus, int slot, int func, int reg, int bytes) { uint32_t line; -#ifdef APIC_IO - uint32_t pin; - - /* - * If we are using the APIC, the contents of the intline - * register will probably be wrong (since they are set up for - * use with the PIC. Rather than rewrite these registers - * (maybe that would be smarter) we trap attempts to read them - * and translate to our private vector numbers. - */ - if ((reg == PCIR_INTLINE) && (bytes == 1)) { - - pin = pcireg_cfgread(bus, slot, func, PCIR_INTPIN, 1); - line = pcireg_cfgread(bus, slot, func, PCIR_INTLINE, 1); - if (pin != 0) { - int airq; - - airq = pci_apic_irq(bus, slot, pin); - if (airq >= 0) { - /* PCI specific entry found in MP table */ - if (airq != line) - undirect_pci_irq(line); - return(airq); - } else { - /* - * PCI interrupts might be redirected - * to the ISA bus according to some MP - * tables. Use the same methods as - * used by the ISA devices devices to - * find the proper IOAPIC int pin. - */ - airq = isa_apic_irq(line); - if ((airq >= 0) && (airq != line)) { - /* XXX: undirect_pci_irq() ? */ - undirect_isa_irq(line); - return(airq); - } - } - } - return(line); - } -#else /* * Some BIOS writers seem to want to ignore the spec and put * 0 in the intline rather than 255 to indicate none. The rest of @@ -251,10 +205,9 @@ pci_cfgregread(int bus, int slot, int func, int reg, int bytes) */ if (reg == PCIR_INTLINE && bytes == 1) { line = pcireg_cfgread(bus, slot, func, PCIR_INTLINE, 1); - return pci_i386_map_intline(line); + return (pci_i386_map_intline(line)); } -#endif /* APIC_IO */ - return(pcireg_cfgread(bus, slot, func, reg, bytes)); + return (pcireg_cfgread(bus, slot, func, reg, bytes)); } /* diff --git a/sys/i386/pci/pci_pir.c b/sys/i386/pci/pci_pir.c index ec5def9..91746fe 100644 --- a/sys/i386/pci/pci_pir.c +++ b/sys/i386/pci/pci_pir.c @@ -48,10 +48,6 @@ __FBSDID("$FreeBSD$"); #include <machine/segments.h> #include <machine/pc/bios.h> -#ifdef APIC_IO -#include <machine/smp.h> -#endif /* APIC_IO */ - #include "pcib_if.h" #define PRVERB(a) do { \ @@ -201,49 +197,7 @@ u_int32_t pci_cfgregread(int bus, int slot, int func, int reg, int bytes) { uint32_t line; -#ifdef APIC_IO - uint32_t pin; - - /* - * If we are using the APIC, the contents of the intline - * register will probably be wrong (since they are set up for - * use with the PIC. Rather than rewrite these registers - * (maybe that would be smarter) we trap attempts to read them - * and translate to our private vector numbers. - */ - if ((reg == PCIR_INTLINE) && (bytes == 1)) { - - pin = pcireg_cfgread(bus, slot, func, PCIR_INTPIN, 1); - line = pcireg_cfgread(bus, slot, func, PCIR_INTLINE, 1); - if (pin != 0) { - int airq; - - airq = pci_apic_irq(bus, slot, pin); - if (airq >= 0) { - /* PCI specific entry found in MP table */ - if (airq != line) - undirect_pci_irq(line); - return(airq); - } else { - /* - * PCI interrupts might be redirected - * to the ISA bus according to some MP - * tables. Use the same methods as - * used by the ISA devices devices to - * find the proper IOAPIC int pin. - */ - airq = isa_apic_irq(line); - if ((airq >= 0) && (airq != line)) { - /* XXX: undirect_pci_irq() ? */ - undirect_isa_irq(line); - return(airq); - } - } - } - return(line); - } -#else /* * Some BIOS writers seem to want to ignore the spec and put * 0 in the intline rather than 255 to indicate none. The rest of @@ -251,10 +205,9 @@ pci_cfgregread(int bus, int slot, int func, int reg, int bytes) */ if (reg == PCIR_INTLINE && bytes == 1) { line = pcireg_cfgread(bus, slot, func, PCIR_INTLINE, 1); - return pci_i386_map_intline(line); + return (pci_i386_map_intline(line)); } -#endif /* APIC_IO */ - return(pcireg_cfgread(bus, slot, func, reg, bytes)); + return (pcireg_cfgread(bus, slot, func, reg, bytes)); } /* |