diff --git a/sys/arch/x86/x86/vga_post.c b/sys/arch/x86/x86/vga_post.c index 8b06d6a4b521..17a41c876c61 100644 --- a/sys/arch/x86/x86/vga_post.c +++ b/sys/arch/x86/x86/vga_post.c @@ -28,7 +28,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: vga_post.c,v 1.6 2008/01/15 22:15:13 drochner Exp $"); +__KERNEL_RCSID(0, "$NetBSD: vga_post.c,v 1.7 2008/03/12 23:26:18 drochner Exp $"); #include #include @@ -44,6 +44,8 @@ __KERNEL_RCSID(0, "$NetBSD: vga_post.c,v 1.6 2008/01/15 22:15:13 drochner Exp $" #include #include +#include "opt_ddb.h" + struct vga_post { struct X86EMU emu; vaddr_t sys_image; @@ -53,6 +55,11 @@ struct vga_post { struct pglist ram_backing; }; +#ifdef DDB +static struct vga_post *ddb_vgapostp; +void ddb_vgapost(void); +#endif + static uint8_t vm86_emu_inb(struct X86EMU *emu, uint16_t port) { @@ -189,7 +196,9 @@ vga_post_init(int bus, int device, int function) sc->emu.mem_size = 1024 * 1024; sc->initial_eax = bus * 256 + device * 8 + function; - +#ifdef DDB + ddb_vgapostp = sc; +#endif return sc; } @@ -222,3 +231,13 @@ vga_post_free(struct vga_post *sc) pmap_update(pmap_kernel()); kmem_free(sc, sizeof(*sc)); } + +#ifdef DDB +void +ddb_vgapost() +{ + + if (ddb_vgapostp) + vga_post_call(ddb_vgapostp); +} +#endif diff --git a/sys/dev/wscons/wsdisplay.c b/sys/dev/wscons/wsdisplay.c index 4ca7347764f8..17e7a55d332a 100644 --- a/sys/dev/wscons/wsdisplay.c +++ b/sys/dev/wscons/wsdisplay.c @@ -1,4 +1,4 @@ -/* $NetBSD: wsdisplay.c,v 1.118 2008/02/29 06:18:13 dyoung Exp $ */ +/* $NetBSD: wsdisplay.c,v 1.119 2008/03/12 23:26:18 drochner Exp $ */ /* * Copyright (c) 1996, 1997 Christopher G. Demetriou. All rights reserved. @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: wsdisplay.c,v 1.118 2008/02/29 06:18:13 dyoung Exp $"); +__KERNEL_RCSID(0, "$NetBSD: wsdisplay.c,v 1.119 2008/03/12 23:26:18 drochner Exp $"); #include "opt_wsdisplay_compat.h" #include "opt_wsmsgattrs.h" @@ -1817,9 +1817,10 @@ wsdisplay_switch2(device_t dv, int error, int waitok) #endif /* keyboard map??? */ - if (scr->scr_syncops) { + if (scr->scr_syncops && + !(sc->sc_isconsole && wsdisplay_cons_pollmode)) { error = (*scr->scr_syncops->attach)(scr->scr_synccookie, waitok, - sc->sc_isconsole && wsdisplay_cons_pollmode ? 0 : wsdisplay_switch3_cb, dv); + wsdisplay_switch3_cb, dv); if (error == EAGAIN) { /* switch will be done asynchronously */ return (0); @@ -1928,10 +1929,13 @@ wsdisplay_switch(device_t dv, int no, int waitok) sc->sc_oldscreen = sc->sc_focusidx; if (scr->scr_syncops) { - if (!(sc->sc_flags & SC_XATTACHED)) /* nothing to do here */ + if (!(sc->sc_flags & SC_XATTACHED) || + (sc->sc_isconsole && wsdisplay_cons_pollmode)) { + /* nothing to do here */ return (wsdisplay_switch1(dv, 0, waitok)); + } res = (*scr->scr_syncops->detach)(scr->scr_synccookie, waitok, - sc->sc_isconsole && wsdisplay_cons_pollmode ? 0 : wsdisplay_switch1_cb, dv); + wsdisplay_switch1_cb, dv); if (res == EAGAIN) { /* switch will be done asynchronously */ return (0);