static void ofb_init_screen(void *cookie, struct vcons_screen *scr, int existing, long *defattr) { struct ofb_softc *sc = cookie; struct rasops_info *ri = &scr->scr_ri; if (scr != &rascons_console_screen) { rascons_init_rasops(sc->sc_node, ri); } }
int rascons_cnattach(void) { struct rasops_info *ri = &rascons_console_screen.scr_ri; long defattr; int crow = 0; /* get current cursor position */ OF_interpret("line#", 0, 1, &crow); /* move (rom monitor) cursor to the lowest line - 1 */ OF_interpret("#lines 2 - to line#", 0, 0); wsfont_init(); if (copy_rom_font() == 0) { romfont_loaded = 1; } /* set up rasops */ rascons_init_rasops(console_node, ri); /* * no need to clear the screen here when we're mimicing firmware * output anyway */ #if 0 if (ri->ri_width >= 1024 && ri->ri_height >= 768) { int i, screenbytes = ri->ri_stride * ri->ri_height; for (i = 0; i < screenbytes; i += sizeof(u_int32_t)) *(u_int32_t *)(fbaddr + i) = 0xffffffff; crow = 0; } #endif rascons_stdscreen.nrows = ri->ri_rows; rascons_stdscreen.ncols = ri->ri_cols; rascons_stdscreen.textops = &ri->ri_ops; rascons_stdscreen.capabilities = ri->ri_caps; ri->ri_ops.allocattr(ri, 0, 0, 0, &defattr); wsdisplay_preattach(&rascons_stdscreen, ri, 0, max(0, min(crow, ri->ri_rows - 1)), defattr); #if notyet rascons_init_cmap(NULL); #endif return 0; }