[BACK]Return to aapic.c CVS log [TXT][DIR] Up to [local] / sys / arch / amd64 / pci

Annotation of sys/arch/amd64/pci/aapic.c, Revision 1.1

1.1     ! nbrk        1: /*     $OpenBSD: aapic.c,v 1.3 2007/01/15 23:19:05 jsg Exp $   */
        !             2: /*     $NetBSD: aapic.c,v 1.3 2005/01/13 23:40:01 fvdl Exp $   */
        !             3:
        !             4: /*
        !             5:  * The AMD 8131 IO APIC can hang the box when an APIC IRQ is masked.
        !             6:  */
        !             7:
        !             8: #if 0
        !             9: #include <sys/cdefs.h>
        !            10: __KERNEL_RCSID(0, "$NetBSD: aapic.c,v 1.3 2005/01/13 23:40:01 fvdl Exp $");
        !            11: #endif
        !            12:
        !            13: #include <sys/param.h>
        !            14: #include <sys/systm.h>
        !            15: #include <sys/kernel.h>
        !            16: #include <sys/device.h>
        !            17:
        !            18: #include <dev/pci/pcireg.h>
        !            19: #include <dev/pci/pcivar.h>
        !            20: #include <dev/pci/pcidevs.h>
        !            21:
        !            22: #include <arch/amd64/pci/amd8131reg.h>
        !            23:
        !            24: #include "ioapic.h"
        !            25:
        !            26: #if NIOAPIC > 0
        !            27: extern int nioapics;
        !            28: #endif
        !            29:
        !            30: int    aapic_match(struct device *, void *, void *);
        !            31: void   aapic_attach(struct device *, struct device *, void *);
        !            32:
        !            33: struct aapic_softc {
        !            34:        struct device sc_dev;
        !            35: };
        !            36:
        !            37: struct cfattach aapic_ca = {
        !            38:        sizeof(struct aapic_softc), aapic_match, aapic_attach
        !            39: };
        !            40:
        !            41: struct cfdriver aapic_cd = {
        !            42:        0, "aapic", DV_DULL
        !            43: };
        !            44:
        !            45: int
        !            46: aapic_match(struct device *parent, void *match, void *aux)
        !            47: {
        !            48:        struct pci_attach_args *pa = aux;
        !            49:
        !            50:        if (PCI_VENDOR(pa->pa_id) == PCI_VENDOR_AMD &&
        !            51:            PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_AMD_8131_PCIX_IOAPIC)
        !            52:                return (1);
        !            53:
        !            54:        return (0);
        !            55: }
        !            56:
        !            57: void
        !            58: aapic_attach(struct device *parent, struct device *self, void *aux)
        !            59: {
        !            60:        struct pci_attach_args *pa = aux;
        !            61:        int bus, dev, func;
        !            62:        pcitag_t tag;
        !            63:        pcireg_t reg;
        !            64:
        !            65:        printf("\n");
        !            66:
        !            67: #if NIOAPIC > 0
        !            68:        if (nioapics == 0)
        !            69:                return;
        !            70: #else
        !            71:        return;
        !            72: #endif
        !            73:
        !            74:        reg = pci_conf_read(pa->pa_pc, pa->pa_tag, AMD8131_IOAPIC_CTL);
        !            75:        reg |= AMD8131_IOAEN;
        !            76:        pci_conf_write(pa->pa_pc, pa->pa_tag, AMD8131_IOAPIC_CTL, reg);
        !            77:
        !            78:        pci_decompose_tag(pa->pa_pc, pa->pa_tag, &bus, &dev, &func);
        !            79:        func = 0;
        !            80:        tag = pci_make_tag(pa->pa_pc, bus, dev, func);
        !            81:        reg = pci_conf_read(pa->pa_pc, tag, AMD8131_PCIX_MISC);
        !            82:        reg &= ~AMD8131_NIOAMODE;
        !            83:        pci_conf_write(pa->pa_pc, tag, AMD8131_PCIX_MISC, reg);
        !            84: }

CVSweb