void hil_intio_attach(struct device *parent, struct device *self, void *aux) { struct hil_softc *sc = (void *)self; struct intio_attach_args *ia = aux; extern struct consdev wsdisplay_cons; sc->sc_bst = ia->ia_tag; if (bus_space_map(sc->sc_bst, HILADDR, HILMAPSIZE, 0, &sc->sc_bsh) != 0) { printf(": couldn't map hil controller\n"); return; } /* * Check that the configured console device is a wsdisplay. */ if (cn_tab != &wsdisplay_cons) hil_is_console = 0; hil_isr.isr_func = hil_intr; hil_isr.isr_arg = sc; hil_isr.isr_ipl = 1; hil_isr.isr_priority = IPL_TTY; printf(" ipl %d", hil_isr.isr_ipl); hil_attach(sc, &hil_is_console); intr_establish(&hil_isr, self->dv_xname); startuphook_establish(hil_attach_deferred, sc); }
void hil_gsc_attach(device_t parent, device_t self, void *aux) { struct hil_gsc_softc *gsc = device_private(self); struct hil_softc *sc = &gsc->sc_hs; struct gsc_attach_args *ga = aux; int pagezero_cookie; sc->sc_dev = self; sc->sc_bst = ga->ga_iot; if (bus_space_map(ga->ga_iot, ga->ga_hpa, HILMAPSIZE, 0, &sc->sc_bsh)) { aprint_error(": couldn't map hil controller\n"); return; } pagezero_cookie = hp700_pagezero_map(); gsc->sc_hil_console = ga->ga_dp.dp_mod == PAGE0->mem_kbd.pz_dp.dp_mod && memcmp(ga->ga_dp.dp_bc, PAGE0->mem_kbd.pz_dp.dp_bc, 6) == 0; hp700_pagezero_unmap(pagezero_cookie); hil_attach(sc, &gsc->sc_hil_console); gsc->sc_ih = hp700_intr_establish(IPL_TTY, hil_intr, sc, ga->ga_ir, ga->ga_irq); config_interrupts(self, hil_attach_deferred); }
void hil_gsc_attach(struct device *parent, struct device *self, void *aux) { struct hil_softc *sc = (void *)self; struct gsc_attach_args *ga = aux; int hil_is_console; sc->sc_bst = ga->ga_iot; if (bus_space_map(ga->ga_iot, ga->ga_hpa, HILMAPSIZE, 0, &sc->sc_bsh)) { printf(": couldn't map hil controller\n"); return; } hil_is_console = ga->ga_dp.dp_mod == PAGE0->mem_kbd.pz_dp.dp_mod && bcmp(ga->ga_dp.dp_bc, PAGE0->mem_kbd.pz_dp.dp_bc, 6) == 0; hil_attach(sc, hil_is_console); gsc_intr_establish((struct gsc_softc *)parent, IPL_TTY, ga->ga_irq, hil_intr, sc, &sc->sc_dev); startuphook_establish(hil_attach_deferred, sc); }