void pcdisplay_attach(device_t parent, device_t self, void *aux) { struct isa_attach_args *ia = aux; struct pcdisplay_softc *sc = device_private(self); int console; struct pcdisplay_config *dc; struct wsemuldisplaydev_attach_args aa; printf("\n"); console = pcdisplay_is_console(ia->ia_iot); if (console) { dc = &pcdisplay_console_dc; sc->nscreens = 1; pcdisplay_console_attached = 1; } else { dc = malloc(sizeof(struct pcdisplay_config), M_DEVBUF, M_WAITOK); if (ia->ia_io[0].ir_addr != 0x3b0 && ia->ia_iomem[0].ir_addr != 0xb0000 && pcdisplay_probe_col(ia->ia_iot, ia->ia_memt)) pcdisplay_init(dc, ia->ia_iot, ia->ia_memt, 0); else if (ia->ia_io[0].ir_addr != 0x3d0 && ia->ia_iomem[0].ir_addr != 0xb8000 && pcdisplay_probe_mono(ia->ia_iot, ia->ia_memt)) pcdisplay_init(dc, ia->ia_iot, ia->ia_memt, 1); else panic("pcdisplay_attach: display disappeared"); } sc->sc_dc = dc; #if NPCWEASEL > 0 /* * If the display is monochrome, check to see if we have * a PC-Weasel, and initialize its special features. */ if (dc->mono) { sc->sc_weasel.wh_st = dc->dc_ph.ph_memt; sc->sc_weasel.wh_sh = dc->dc_ph.ph_memh; sc->sc_weasel.wh_parent = self; weasel_isa_init(&sc->sc_weasel); } #endif /* NPCWEASEL > 0 */ aa.console = console; aa.scrdata = &pcdisplay_screenlist; aa.accessops = &pcdisplay_accessops; aa.accesscookie = sc; config_found(self, &aa, wsemuldisplaydevprint); }
void pcdisplay_attach(struct device *parent, struct device *self, void *aux) { struct isa_attach_args *ia = aux; struct pcdisplay_softc *sc = (struct pcdisplay_softc *)self; int console; struct pcdisplay_config *dc; struct wsemuldisplaydev_attach_args aa; printf("\n"); console = pcdisplay_is_console(ia->ia_iot); if (console) { dc = &pcdisplay_console_dc; sc->nscreens = 1; pcdisplay_console_attached = 1; } else { dc = malloc(sizeof(struct pcdisplay_config), M_DEVBUF, M_WAITOK); if (ia->ia_iobase != 0x3b0 && ia->ia_maddr != 0xb0000 && pcdisplay_probe_col(ia->ia_iot, ia->ia_memt)) pcdisplay_init(dc, ia->ia_iot, ia->ia_memt, 0); else if (ia->ia_iobase != 0x3d0 && ia->ia_maddr != 0xb8000 && pcdisplay_probe_mono(ia->ia_iot, ia->ia_memt)) pcdisplay_init(dc, ia->ia_iot, ia->ia_memt, 1); else panic("pcdisplay_attach: display disappeared"); } sc->sc_dc = dc; aa.console = console; aa.scrdata = &pcdisplay_screenlist; aa.accessops = &pcdisplay_accessops; aa.accesscookie = sc; aa.defaultscreens = 0; config_found(self, &aa, wsemuldisplaydevprint); }
int pcdisplay_cnattach(bus_space_tag_t iot, bus_space_tag_t memt) { int mono; if (pcdisplay_probe_col(iot, memt)) mono = 0; else if (pcdisplay_probe_mono(iot, memt)) mono = 1; else return (ENXIO); pcdisplay_init(&pcdisplay_console_dc, iot, memt, mono); wsdisplay_cnattach(&pcdisplay_scr, &pcdisplay_console_dc, pcdisplay_console_dc.pcs.cursorcol, pcdisplay_console_dc.pcs.cursorrow, FG_LIGHTGREY | BG_BLACK); pcdisplayconsole = 1; return (0); }