From 2479ac60b94bb399213a473504ca4c0390bc3475 Mon Sep 17 00:00:00 2001 From: Steve Passe Date: Mon, 5 May 1997 22:56:37 +0000 Subject: [PATCH] Code to handle SMP/APIC_IO mapping of ISA INTs to APIC pins above IRQ15. - doesn't break my system. - NOT yet verified on the affected motherboard. Submitted by: "John S. Dyson" --- sys/amd64/amd64/mp_machdep.c | 39 ++++++++++++++++++++++++++++++------ sys/amd64/amd64/mptable.c | 39 ++++++++++++++++++++++++++++++------ sys/amd64/include/mptable.h | 39 ++++++++++++++++++++++++++++++------ sys/amd64/include/smp.h | 5 +++-- sys/i386/i386/mp_machdep.c | 39 ++++++++++++++++++++++++++++++------ sys/i386/i386/mptable.c | 39 ++++++++++++++++++++++++++++++------ sys/i386/include/mptable.h | 39 ++++++++++++++++++++++++++++++------ sys/i386/include/smp.h | 5 +++-- sys/kern/subr_smp.c | 39 ++++++++++++++++++++++++++++++------ sys/sys/smp.h | 5 +++-- 10 files changed, 240 insertions(+), 48 deletions(-) diff --git a/sys/amd64/amd64/mp_machdep.c b/sys/amd64/amd64/mp_machdep.c index ea2f991ac504..8f26040490a2 100644 --- a/sys/amd64/amd64/mp_machdep.c +++ b/sys/amd64/amd64/mp_machdep.c @@ -22,7 +22,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: mp_machdep.c,v 1.6 1997/05/01 19:27:58 fsmp Exp $ + * $Id: mp_machdep.c,v 1.7 1997/05/03 17:42:01 fsmp Exp $ */ #include "opt_smp.h" @@ -889,8 +889,8 @@ get_isa_apic_irq(int isaIRQ) /* * */ -int -get_isa_apic_mask(int isaMASK) +u_int +get_isa_apic_mask(u_int isaMASK) { int apicpin, isairq; @@ -966,17 +966,44 @@ get_pci_apic_irq(int pciBus, int pciDevice, int pciInt) #undef INTTYPE +/* + * Reprogram the MB chipset to NOT redirect a PCI INTerrupt + */ int undirect_pci_irq(int rirq) { #if defined(READY) - printf("Freeing irq %d for ISA cards.\n", rirq); + printf("Freeing redirected PCI irq %d.\n", rirq); /** FIXME: tickle the MB redirector chip */ return ???; #else - printf("Freeing (NOT implemented) irq %d for ISA cards.\n", rirq); + printf("Freeing (NOT implemented) redirected PCI irq %d.\n", rirq); return 0; -#endif /* READY */ +#endif /* READY */ +} + + +/* + * Reprogram the MB chipset to NOT redirect an ISA INTerrupt. + * + * XXX FIXME: + * Exactly what this means is unclear at this point. It is a solution + * for motherboards that redirect the MBIRQ0 pin. Generically a motherboard + * could route any of the ISA INTs to upper (>15) IRQ values. But most would + * NOT be redirected via MBIRQ0, thus "undirect()ing" them would NOT be an + * option. + */ +int +undirect_isa_irq(int rirq) +{ +#if defined(READY) + printf("Freeing redirected ISA irq %d.\n", rirq); + /** FIXME: tickle the MB redirector chip */ + return ???; +#else + printf("Freeing (NOT implemented) redirected ISA irq %d.\n", rirq); + return 0; +#endif /* READY */ } diff --git a/sys/amd64/amd64/mptable.c b/sys/amd64/amd64/mptable.c index ea2f991ac504..8f26040490a2 100644 --- a/sys/amd64/amd64/mptable.c +++ b/sys/amd64/amd64/mptable.c @@ -22,7 +22,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: mp_machdep.c,v 1.6 1997/05/01 19:27:58 fsmp Exp $ + * $Id: mp_machdep.c,v 1.7 1997/05/03 17:42:01 fsmp Exp $ */ #include "opt_smp.h" @@ -889,8 +889,8 @@ get_isa_apic_irq(int isaIRQ) /* * */ -int -get_isa_apic_mask(int isaMASK) +u_int +get_isa_apic_mask(u_int isaMASK) { int apicpin, isairq; @@ -966,17 +966,44 @@ get_pci_apic_irq(int pciBus, int pciDevice, int pciInt) #undef INTTYPE +/* + * Reprogram the MB chipset to NOT redirect a PCI INTerrupt + */ int undirect_pci_irq(int rirq) { #if defined(READY) - printf("Freeing irq %d for ISA cards.\n", rirq); + printf("Freeing redirected PCI irq %d.\n", rirq); /** FIXME: tickle the MB redirector chip */ return ???; #else - printf("Freeing (NOT implemented) irq %d for ISA cards.\n", rirq); + printf("Freeing (NOT implemented) redirected PCI irq %d.\n", rirq); return 0; -#endif /* READY */ +#endif /* READY */ +} + + +/* + * Reprogram the MB chipset to NOT redirect an ISA INTerrupt. + * + * XXX FIXME: + * Exactly what this means is unclear at this point. It is a solution + * for motherboards that redirect the MBIRQ0 pin. Generically a motherboard + * could route any of the ISA INTs to upper (>15) IRQ values. But most would + * NOT be redirected via MBIRQ0, thus "undirect()ing" them would NOT be an + * option. + */ +int +undirect_isa_irq(int rirq) +{ +#if defined(READY) + printf("Freeing redirected ISA irq %d.\n", rirq); + /** FIXME: tickle the MB redirector chip */ + return ???; +#else + printf("Freeing (NOT implemented) redirected ISA irq %d.\n", rirq); + return 0; +#endif /* READY */ } diff --git a/sys/amd64/include/mptable.h b/sys/amd64/include/mptable.h index ea2f991ac504..8f26040490a2 100644 --- a/sys/amd64/include/mptable.h +++ b/sys/amd64/include/mptable.h @@ -22,7 +22,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: mp_machdep.c,v 1.6 1997/05/01 19:27:58 fsmp Exp $ + * $Id: mp_machdep.c,v 1.7 1997/05/03 17:42:01 fsmp Exp $ */ #include "opt_smp.h" @@ -889,8 +889,8 @@ get_isa_apic_irq(int isaIRQ) /* * */ -int -get_isa_apic_mask(int isaMASK) +u_int +get_isa_apic_mask(u_int isaMASK) { int apicpin, isairq; @@ -966,17 +966,44 @@ get_pci_apic_irq(int pciBus, int pciDevice, int pciInt) #undef INTTYPE +/* + * Reprogram the MB chipset to NOT redirect a PCI INTerrupt + */ int undirect_pci_irq(int rirq) { #if defined(READY) - printf("Freeing irq %d for ISA cards.\n", rirq); + printf("Freeing redirected PCI irq %d.\n", rirq); /** FIXME: tickle the MB redirector chip */ return ???; #else - printf("Freeing (NOT implemented) irq %d for ISA cards.\n", rirq); + printf("Freeing (NOT implemented) redirected PCI irq %d.\n", rirq); return 0; -#endif /* READY */ +#endif /* READY */ +} + + +/* + * Reprogram the MB chipset to NOT redirect an ISA INTerrupt. + * + * XXX FIXME: + * Exactly what this means is unclear at this point. It is a solution + * for motherboards that redirect the MBIRQ0 pin. Generically a motherboard + * could route any of the ISA INTs to upper (>15) IRQ values. But most would + * NOT be redirected via MBIRQ0, thus "undirect()ing" them would NOT be an + * option. + */ +int +undirect_isa_irq(int rirq) +{ +#if defined(READY) + printf("Freeing redirected ISA irq %d.\n", rirq); + /** FIXME: tickle the MB redirector chip */ + return ???; +#else + printf("Freeing (NOT implemented) redirected ISA irq %d.\n", rirq); + return 0; +#endif /* READY */ } diff --git a/sys/amd64/include/smp.h b/sys/amd64/include/smp.h index c32f3cb30961..d6da4f2eddd0 100644 --- a/sys/amd64/include/smp.h +++ b/sys/amd64/include/smp.h @@ -6,7 +6,7 @@ * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp * ---------------------------------------------------------------------------- * - * $Id: smp.h,v 1.4 1997/05/01 19:33:06 fsmp Exp $ + * $Id: smp.h,v 1.5 1997/05/03 18:05:31 fsmp Exp $ * */ @@ -61,7 +61,8 @@ u_int mp_bootaddress __P((u_int)); void mp_start __P((void)); void mp_announce __P((void)); int get_isa_apic_irq __P((int)); -int get_isa_apic_mask __P((int)); +u_int get_isa_apic_mask __P((u_int)); +int undirect_isa_irq __P((int)); int get_eisa_apic_irq __P((int)); int get_pci_apic_irq __P((int, int, int)); int undirect_pci_irq __P((int)); diff --git a/sys/i386/i386/mp_machdep.c b/sys/i386/i386/mp_machdep.c index ea2f991ac504..8f26040490a2 100644 --- a/sys/i386/i386/mp_machdep.c +++ b/sys/i386/i386/mp_machdep.c @@ -22,7 +22,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: mp_machdep.c,v 1.6 1997/05/01 19:27:58 fsmp Exp $ + * $Id: mp_machdep.c,v 1.7 1997/05/03 17:42:01 fsmp Exp $ */ #include "opt_smp.h" @@ -889,8 +889,8 @@ get_isa_apic_irq(int isaIRQ) /* * */ -int -get_isa_apic_mask(int isaMASK) +u_int +get_isa_apic_mask(u_int isaMASK) { int apicpin, isairq; @@ -966,17 +966,44 @@ get_pci_apic_irq(int pciBus, int pciDevice, int pciInt) #undef INTTYPE +/* + * Reprogram the MB chipset to NOT redirect a PCI INTerrupt + */ int undirect_pci_irq(int rirq) { #if defined(READY) - printf("Freeing irq %d for ISA cards.\n", rirq); + printf("Freeing redirected PCI irq %d.\n", rirq); /** FIXME: tickle the MB redirector chip */ return ???; #else - printf("Freeing (NOT implemented) irq %d for ISA cards.\n", rirq); + printf("Freeing (NOT implemented) redirected PCI irq %d.\n", rirq); return 0; -#endif /* READY */ +#endif /* READY */ +} + + +/* + * Reprogram the MB chipset to NOT redirect an ISA INTerrupt. + * + * XXX FIXME: + * Exactly what this means is unclear at this point. It is a solution + * for motherboards that redirect the MBIRQ0 pin. Generically a motherboard + * could route any of the ISA INTs to upper (>15) IRQ values. But most would + * NOT be redirected via MBIRQ0, thus "undirect()ing" them would NOT be an + * option. + */ +int +undirect_isa_irq(int rirq) +{ +#if defined(READY) + printf("Freeing redirected ISA irq %d.\n", rirq); + /** FIXME: tickle the MB redirector chip */ + return ???; +#else + printf("Freeing (NOT implemented) redirected ISA irq %d.\n", rirq); + return 0; +#endif /* READY */ } diff --git a/sys/i386/i386/mptable.c b/sys/i386/i386/mptable.c index ea2f991ac504..8f26040490a2 100644 --- a/sys/i386/i386/mptable.c +++ b/sys/i386/i386/mptable.c @@ -22,7 +22,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: mp_machdep.c,v 1.6 1997/05/01 19:27:58 fsmp Exp $ + * $Id: mp_machdep.c,v 1.7 1997/05/03 17:42:01 fsmp Exp $ */ #include "opt_smp.h" @@ -889,8 +889,8 @@ get_isa_apic_irq(int isaIRQ) /* * */ -int -get_isa_apic_mask(int isaMASK) +u_int +get_isa_apic_mask(u_int isaMASK) { int apicpin, isairq; @@ -966,17 +966,44 @@ get_pci_apic_irq(int pciBus, int pciDevice, int pciInt) #undef INTTYPE +/* + * Reprogram the MB chipset to NOT redirect a PCI INTerrupt + */ int undirect_pci_irq(int rirq) { #if defined(READY) - printf("Freeing irq %d for ISA cards.\n", rirq); + printf("Freeing redirected PCI irq %d.\n", rirq); /** FIXME: tickle the MB redirector chip */ return ???; #else - printf("Freeing (NOT implemented) irq %d for ISA cards.\n", rirq); + printf("Freeing (NOT implemented) redirected PCI irq %d.\n", rirq); return 0; -#endif /* READY */ +#endif /* READY */ +} + + +/* + * Reprogram the MB chipset to NOT redirect an ISA INTerrupt. + * + * XXX FIXME: + * Exactly what this means is unclear at this point. It is a solution + * for motherboards that redirect the MBIRQ0 pin. Generically a motherboard + * could route any of the ISA INTs to upper (>15) IRQ values. But most would + * NOT be redirected via MBIRQ0, thus "undirect()ing" them would NOT be an + * option. + */ +int +undirect_isa_irq(int rirq) +{ +#if defined(READY) + printf("Freeing redirected ISA irq %d.\n", rirq); + /** FIXME: tickle the MB redirector chip */ + return ???; +#else + printf("Freeing (NOT implemented) redirected ISA irq %d.\n", rirq); + return 0; +#endif /* READY */ } diff --git a/sys/i386/include/mptable.h b/sys/i386/include/mptable.h index ea2f991ac504..8f26040490a2 100644 --- a/sys/i386/include/mptable.h +++ b/sys/i386/include/mptable.h @@ -22,7 +22,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: mp_machdep.c,v 1.6 1997/05/01 19:27:58 fsmp Exp $ + * $Id: mp_machdep.c,v 1.7 1997/05/03 17:42:01 fsmp Exp $ */ #include "opt_smp.h" @@ -889,8 +889,8 @@ get_isa_apic_irq(int isaIRQ) /* * */ -int -get_isa_apic_mask(int isaMASK) +u_int +get_isa_apic_mask(u_int isaMASK) { int apicpin, isairq; @@ -966,17 +966,44 @@ get_pci_apic_irq(int pciBus, int pciDevice, int pciInt) #undef INTTYPE +/* + * Reprogram the MB chipset to NOT redirect a PCI INTerrupt + */ int undirect_pci_irq(int rirq) { #if defined(READY) - printf("Freeing irq %d for ISA cards.\n", rirq); + printf("Freeing redirected PCI irq %d.\n", rirq); /** FIXME: tickle the MB redirector chip */ return ???; #else - printf("Freeing (NOT implemented) irq %d for ISA cards.\n", rirq); + printf("Freeing (NOT implemented) redirected PCI irq %d.\n", rirq); return 0; -#endif /* READY */ +#endif /* READY */ +} + + +/* + * Reprogram the MB chipset to NOT redirect an ISA INTerrupt. + * + * XXX FIXME: + * Exactly what this means is unclear at this point. It is a solution + * for motherboards that redirect the MBIRQ0 pin. Generically a motherboard + * could route any of the ISA INTs to upper (>15) IRQ values. But most would + * NOT be redirected via MBIRQ0, thus "undirect()ing" them would NOT be an + * option. + */ +int +undirect_isa_irq(int rirq) +{ +#if defined(READY) + printf("Freeing redirected ISA irq %d.\n", rirq); + /** FIXME: tickle the MB redirector chip */ + return ???; +#else + printf("Freeing (NOT implemented) redirected ISA irq %d.\n", rirq); + return 0; +#endif /* READY */ } diff --git a/sys/i386/include/smp.h b/sys/i386/include/smp.h index c32f3cb30961..d6da4f2eddd0 100644 --- a/sys/i386/include/smp.h +++ b/sys/i386/include/smp.h @@ -6,7 +6,7 @@ * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp * ---------------------------------------------------------------------------- * - * $Id: smp.h,v 1.4 1997/05/01 19:33:06 fsmp Exp $ + * $Id: smp.h,v 1.5 1997/05/03 18:05:31 fsmp Exp $ * */ @@ -61,7 +61,8 @@ u_int mp_bootaddress __P((u_int)); void mp_start __P((void)); void mp_announce __P((void)); int get_isa_apic_irq __P((int)); -int get_isa_apic_mask __P((int)); +u_int get_isa_apic_mask __P((u_int)); +int undirect_isa_irq __P((int)); int get_eisa_apic_irq __P((int)); int get_pci_apic_irq __P((int, int, int)); int undirect_pci_irq __P((int)); diff --git a/sys/kern/subr_smp.c b/sys/kern/subr_smp.c index ea2f991ac504..8f26040490a2 100644 --- a/sys/kern/subr_smp.c +++ b/sys/kern/subr_smp.c @@ -22,7 +22,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: mp_machdep.c,v 1.6 1997/05/01 19:27:58 fsmp Exp $ + * $Id: mp_machdep.c,v 1.7 1997/05/03 17:42:01 fsmp Exp $ */ #include "opt_smp.h" @@ -889,8 +889,8 @@ get_isa_apic_irq(int isaIRQ) /* * */ -int -get_isa_apic_mask(int isaMASK) +u_int +get_isa_apic_mask(u_int isaMASK) { int apicpin, isairq; @@ -966,17 +966,44 @@ get_pci_apic_irq(int pciBus, int pciDevice, int pciInt) #undef INTTYPE +/* + * Reprogram the MB chipset to NOT redirect a PCI INTerrupt + */ int undirect_pci_irq(int rirq) { #if defined(READY) - printf("Freeing irq %d for ISA cards.\n", rirq); + printf("Freeing redirected PCI irq %d.\n", rirq); /** FIXME: tickle the MB redirector chip */ return ???; #else - printf("Freeing (NOT implemented) irq %d for ISA cards.\n", rirq); + printf("Freeing (NOT implemented) redirected PCI irq %d.\n", rirq); return 0; -#endif /* READY */ +#endif /* READY */ +} + + +/* + * Reprogram the MB chipset to NOT redirect an ISA INTerrupt. + * + * XXX FIXME: + * Exactly what this means is unclear at this point. It is a solution + * for motherboards that redirect the MBIRQ0 pin. Generically a motherboard + * could route any of the ISA INTs to upper (>15) IRQ values. But most would + * NOT be redirected via MBIRQ0, thus "undirect()ing" them would NOT be an + * option. + */ +int +undirect_isa_irq(int rirq) +{ +#if defined(READY) + printf("Freeing redirected ISA irq %d.\n", rirq); + /** FIXME: tickle the MB redirector chip */ + return ???; +#else + printf("Freeing (NOT implemented) redirected ISA irq %d.\n", rirq); + return 0; +#endif /* READY */ } diff --git a/sys/sys/smp.h b/sys/sys/smp.h index c32f3cb30961..d6da4f2eddd0 100644 --- a/sys/sys/smp.h +++ b/sys/sys/smp.h @@ -6,7 +6,7 @@ * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp * ---------------------------------------------------------------------------- * - * $Id: smp.h,v 1.4 1997/05/01 19:33:06 fsmp Exp $ + * $Id: smp.h,v 1.5 1997/05/03 18:05:31 fsmp Exp $ * */ @@ -61,7 +61,8 @@ u_int mp_bootaddress __P((u_int)); void mp_start __P((void)); void mp_announce __P((void)); int get_isa_apic_irq __P((int)); -int get_isa_apic_mask __P((int)); +u_int get_isa_apic_mask __P((u_int)); +int undirect_isa_irq __P((int)); int get_eisa_apic_irq __P((int)); int get_pci_apic_irq __P((int, int, int)); int undirect_pci_irq __P((int));