Beispiel #1
0
void
sti_end_attach(struct sti_softc *sc)
{
	struct sti_screen *scr = sc->sc_scr;

	if (scr == NULL)
		return;
#if NWSDISPLAY > 0
	else {
		struct wsemuldisplaydev_attach_args waa;
		scr->scr_wsmode = WSDISPLAYIO_MODE_EMUL;

		waa.console = sc->sc_flags & STI_CONSOLE ? 1 : 0;
		waa.scrdata = &scr->scr_screenlist;
		waa.accessops = &sti_accessops;
		waa.accesscookie = scr;

		/* attach as console if required */
		if (waa.console && !ISSET(sc->sc_flags, STI_ATTACHED)) {
			long defattr;

			sti_alloc_attr(scr, 0, 0, 0, &defattr);
			wsdisplay_cnattach(&scr->scr_wsd, scr,
			    0, scr->scr_wsd.nrows - 1, defattr);
			sc->sc_flags |= STI_ATTACHED;
		}

		config_found(sc->sc_dev, &waa, wsemuldisplaydevprint);
	}
#endif
}
Beispiel #2
0
void
sti_end_attach_screen(struct sti_softc *sc, struct sti_screen *scr, int console)
{
	struct wsemuldisplaydev_attach_args waa;

	scr->scr_wsmode = WSDISPLAYIO_MODE_EMUL;

	waa.console = console;
	waa.scrdata = &scr->scr_screenlist;
	waa.accessops = &sti_accessops;
	waa.accesscookie = scr;
	waa.defaultscreens = 0;

	/* attach as console if required */
	if (console && !ISSET(sc->sc_flags, STI_ATTACHED)) {
		long defattr;

		sti_alloc_attr(scr, 0, 0, 0, &defattr);
		wsdisplay_cnattach(&scr->scr_wsd, scr,
		    0, scr->scr_wsd.nrows - 1, defattr);
		sc->sc_flags |= STI_ATTACHED;
	}

	config_found(&sc->sc_dev, &waa, wsemuldisplaydevprint);
}
Beispiel #3
0
/*
 * Early console support.  Only used on hp300.
 */
int
sti_cnattach(struct sti_rom *rom, struct sti_screen *scr, bus_space_tag_t memt,
    bus_addr_t *bases, u_int codebase)
{
	bus_space_handle_t romh;
	u_int romend;
	int error;
	long defattr;

	if ((error = bus_space_map(memt, bases[0], PAGE_SIZE, 0, &romh)) != 0)
		return error;

	/*
	 * Compute real PROM size
	 */
	romend = sti_rom_size(memt, romh);

	bus_space_unmap(memt, romh, PAGE_SIZE);

	if ((error = bus_space_map(memt, bases[0], romend, 0, &romh)) != 0)
		return error;

	bases[0] = romh;
	if (sti_rom_setup(rom, memt, memt, romh, bases, codebase) != 0)
		return -1;
	scr->scr_rom = rom;
	if (sti_screen_setup(scr, STI_CLEARSCR) != 0)
		return -1;

	sti_alloc_attr(scr, 0, 0, 0, &defattr);
	wsdisplay_cnattach(&scr->scr_wsd, scr, 0, 0, defattr);

	return 0;
}
Beispiel #4
0
int
sti_alloc_screen(void *v, const struct wsscreen_descr *type, void **cookiep,
    int *cxp, int *cyp, long *defattr)
{
	struct sti_screen *scr = (struct sti_screen *)v;

	if (scr->scr_nscreens > 0)
		return ENOMEM;

	*cookiep = scr;
	*cxp = 0;
	*cyp = 0;
	sti_alloc_attr(scr, 0, 0, 0, defattr);
	scr->scr_nscreens++;
	return 0;
}