void npx_hv_attach(struct device *parent, struct device *self, void *aux) { struct npx_softc *sc = (void *)self; sc->sc_type = NPX_EXCEPTION; printf(": using exception 16\n"); npxattach(sc); }
void npx_hv_attach(device_t parent, device_t self, void *aux) { struct npx_softc *sc = device_private(self); sc->sc_dev = self; sc->sc_type = NPX_EXCEPTION; aprint_normal(": using exception 16\n"); npxattach(sc); }
void npx_pnpbios_attach(struct device *parent, struct device *self, void *aux) { struct npx_softc *sc = (void *)self; struct pnpbiosdev_attach_args *aa = aux; int irq, ist; if (pnpbios_io_map(aa->pbt, aa->resc, 0, &sc->sc_iot, &sc->sc_ioh)) { printf(": can't map i/o space\n"); return; } printf("\n"); pnpbios_print_devres(self, aa); if (pnpbios_getirqnum(aa->pbt, aa->resc, 0, &irq, &ist) != 0) { printf("%s: unable to get IRQ number or type\n", sc->sc_dev.dv_xname); return; } sc->sc_type = npxprobe1(sc->sc_iot, sc->sc_ioh, irq); switch (sc->sc_type) { case NPX_INTERRUPT: printf("%s: interrupting at irq %d\n", sc->sc_dev.dv_xname, irq); lcr0(rcr0() & ~CR0_NE); sc->sc_ih = isa_intr_establish(0/*XXX*/, irq, ist, IPL_NONE, npxintr, NULL); break; case NPX_EXCEPTION: printf("%s: using exception 16\n", sc->sc_dev.dv_xname); break; case NPX_BROKEN: printf("%s: error reporting broken; not using\n", sc->sc_dev.dv_xname); sc->sc_type = NPX_NONE; return; case NPX_NONE: panic("npx_pnpbios_attach"); } npxattach(sc); }
void npx_isa_attach(device_t parent, device_t self, void *aux) { struct npx_softc *sc = device_private(self); struct isa_attach_args *ia = aux; aprint_naive("\n"); aprint_normal("\n"); sc->sc_dev = self; sc->sc_type = (u_long) ia->ia_aux; switch (sc->sc_type) { case NPX_INTERRUPT: sc->sc_iot = ia->ia_iot; if (bus_space_map(sc->sc_iot, 0xf0, 16, 0, &sc->sc_ioh)) panic("%s: unable to map I/O space", __func__); lcr0(rcr0() & ~CR0_NE); sc->sc_ih = isa_intr_establish(ia->ia_ic, ia->ia_irq[0].ir_irq, IST_EDGE, IPL_NONE, (int (*)(void *))npxintr, 0); break; case NPX_EXCEPTION: /*FALLTHROUGH*/ case NPX_CPUID: aprint_verbose_dev(sc->sc_dev, "%s using exception 16\n", sc->sc_type == NPX_CPUID ? "reported by CPUID;" : ""); sc->sc_type = NPX_EXCEPTION; break; case NPX_BROKEN: aprint_error_dev(sc->sc_dev, "error reporting broken; not using\n"); sc->sc_type = NPX_NONE; return; case NPX_NONE: return; } npxattach(sc); }