Deleted Added
full compact
syscons.c (111632) syscons.c (111748)
1/*-
2 * Copyright (c) 1992-1998 S�ren Schmidt
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 *
1/*-
2 * Copyright (c) 1992-1998 S�ren Schmidt
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 *
28 * $FreeBSD: head/sys/dev/syscons/syscons.c 111632 2003-02-27 18:24:06Z mux $
28 * $FreeBSD: head/sys/dev/syscons/syscons.c 111748 2003-03-02 16:54:40Z des $
29 */
30
31#include "opt_syscons.h"
32#include "opt_splash.h"
33#include "opt_ddb.h"
34
35#include <sys/param.h>
36#include <sys/systm.h>

--- 970 unchanged lines hidden (view full) ---

1007 s = spltty();
1008 error = sc_clean_up(sc->cur_scp);
1009 splx(s);
1010 if (error)
1011 return error;
1012 scp = SC_STAT(SC_DEV(sc, i));
1013 if (scp == scp->sc->cur_scp)
1014 return 0;
29 */
30
31#include "opt_syscons.h"
32#include "opt_splash.h"
33#include "opt_ddb.h"
34
35#include <sys/param.h>
36#include <sys/systm.h>

--- 970 unchanged lines hidden (view full) ---

1007 s = spltty();
1008 error = sc_clean_up(sc->cur_scp);
1009 splx(s);
1010 if (error)
1011 return error;
1012 scp = SC_STAT(SC_DEV(sc, i));
1013 if (scp == scp->sc->cur_scp)
1014 return 0;
1015 while ((error=tsleep((caddr_t)&scp->smode, PZERO|PCATCH,
1015 while ((error=tsleep(&scp->smode, PZERO|PCATCH,
1016 "waitvt", 0)) == ERESTART) ;
1017 return error;
1018
1019 case VT_GETACTIVE: /* get active vty # */
1020 *(int *)data = sc->cur_scp->index + 1;
1021 return 0;
1022
1023 case VT_GETINDEX: /* get this vty # */

--- 1060 unchanged lines hidden (view full) ---

2084 /* the screen saver may have chosen not to stop after all... */
2085 if (sc->flags & SC_SCRN_BLANKED)
2086 return;
2087
2088 mark_all(sc->cur_scp);
2089 if (sc->delayed_next_scr)
2090 sc_switch_scr(sc, sc->delayed_next_scr - 1);
2091 if (debugger == 0)
1016 "waitvt", 0)) == ERESTART) ;
1017 return error;
1018
1019 case VT_GETACTIVE: /* get active vty # */
1020 *(int *)data = sc->cur_scp->index + 1;
1021 return 0;
1022
1023 case VT_GETINDEX: /* get this vty # */

--- 1060 unchanged lines hidden (view full) ---

2084 /* the screen saver may have chosen not to stop after all... */
2085 if (sc->flags & SC_SCRN_BLANKED)
2086 return;
2087
2088 mark_all(sc->cur_scp);
2089 if (sc->delayed_next_scr)
2090 sc_switch_scr(sc, sc->delayed_next_scr - 1);
2091 if (debugger == 0)
2092 wakeup((caddr_t)&scrn_blanked);
2092 wakeup(&scrn_blanked);
2093}
2094
2095static int
2096wait_scrn_saver_stop(sc_softc_t *sc)
2097{
2098 int error = 0;
2099
2100 while (scrn_blanked > 0) {
2101 run_scrn_saver = FALSE;
2102 if (sc && !(sc->flags & SC_SCRN_BLANKED)) {
2103 error = 0;
2104 break;
2105 }
2093}
2094
2095static int
2096wait_scrn_saver_stop(sc_softc_t *sc)
2097{
2098 int error = 0;
2099
2100 while (scrn_blanked > 0) {
2101 run_scrn_saver = FALSE;
2102 if (sc && !(sc->flags & SC_SCRN_BLANKED)) {
2103 error = 0;
2104 break;
2105 }
2106 error = tsleep((caddr_t)&scrn_blanked, PZERO | PCATCH, "scrsav", 0);
2106 error = tsleep(&scrn_blanked, PZERO | PCATCH, "scrsav", 0);
2107 if ((error != 0) && (error != ERESTART))
2108 break;
2109 }
2110 run_scrn_saver = FALSE;
2111 return error;
2112}
2113#endif /* DEV_SPLASH */
2114

--- 182 unchanged lines hidden (view full) ---

2297 * XXX wakeup() calls mtx_lock(&sched_lock) which will hang if
2298 * sched_lock is in an in-between state, e.g., when we stop at
2299 * a breakpoint at fork_exit. It has always been wrong to call
2300 * wakeup() when the debugger is active. In RELENG_4, wakeup()
2301 * is supposed to be locked by splhigh(), but the debugger may
2302 * be invoked at splhigh().
2303 */
2304 if (debugger == 0)
2107 if ((error != 0) && (error != ERESTART))
2108 break;
2109 }
2110 run_scrn_saver = FALSE;
2111 return error;
2112}
2113#endif /* DEV_SPLASH */
2114

--- 182 unchanged lines hidden (view full) ---

2297 * XXX wakeup() calls mtx_lock(&sched_lock) which will hang if
2298 * sched_lock is in an in-between state, e.g., when we stop at
2299 * a breakpoint at fork_exit. It has always been wrong to call
2300 * wakeup() when the debugger is active. In RELENG_4, wakeup()
2301 * is supposed to be locked by splhigh(), but the debugger may
2302 * be invoked at splhigh().
2303 */
2304 if (debugger == 0)
2305 wakeup((caddr_t)&sc->new_scp->smode);
2305 wakeup(&sc->new_scp->smode);
2306 splx(s);
2307 DPRINTF(5, ("switch done (new == old)\n"));
2308 return 0;
2309 }
2310
2311 /* has controlling process died? */
2312 vt_proc_alive(sc->old_scp);
2313 vt_proc_alive(sc->new_scp);

--- 6 unchanged lines hidden (view full) ---

2320
2321 /* go set up the new vty screen */
2322 splx(s);
2323 exchange_scr(sc);
2324 s = spltty();
2325
2326 /* wake up processes waiting for this vty */
2327 if (debugger == 0)
2306 splx(s);
2307 DPRINTF(5, ("switch done (new == old)\n"));
2308 return 0;
2309 }
2310
2311 /* has controlling process died? */
2312 vt_proc_alive(sc->old_scp);
2313 vt_proc_alive(sc->new_scp);

--- 6 unchanged lines hidden (view full) ---

2320
2321 /* go set up the new vty screen */
2322 splx(s);
2323 exchange_scr(sc);
2324 s = spltty();
2325
2326 /* wake up processes waiting for this vty */
2327 if (debugger == 0)
2328 wakeup((caddr_t)&sc->cur_scp->smode);
2328 wakeup(&sc->cur_scp->smode);
2329
2330 /* wait for the controlling process to acknowledge, if necessary */
2331 if (signal_vt_acq(sc->cur_scp)) {
2332 splx(s);
2333 return 0;
2334 }
2335
2336 sc->switch_in_progress = 0;

--- 9 unchanged lines hidden (view full) ---

2346do_switch_scr(sc_softc_t *sc, int s)
2347{
2348 vt_proc_alive(sc->new_scp);
2349
2350 splx(s);
2351 exchange_scr(sc);
2352 s = spltty();
2353 /* sc->cur_scp == sc->new_scp */
2329
2330 /* wait for the controlling process to acknowledge, if necessary */
2331 if (signal_vt_acq(sc->cur_scp)) {
2332 splx(s);
2333 return 0;
2334 }
2335
2336 sc->switch_in_progress = 0;

--- 9 unchanged lines hidden (view full) ---

2346do_switch_scr(sc_softc_t *sc, int s)
2347{
2348 vt_proc_alive(sc->new_scp);
2349
2350 splx(s);
2351 exchange_scr(sc);
2352 s = spltty();
2353 /* sc->cur_scp == sc->new_scp */
2354 wakeup((caddr_t)&sc->cur_scp->smode);
2354 wakeup(&sc->cur_scp->smode);
2355
2356 /* wait for the controlling process to acknowledge, if necessary */
2357 if (!signal_vt_acq(sc->cur_scp)) {
2358 sc->switch_in_progress = 0;
2359 if (sc->unit == sc_console_unit)
2360 cons_unavail = FALSE;
2361 }
2362

--- 1219 unchanged lines hidden ---
2355
2356 /* wait for the controlling process to acknowledge, if necessary */
2357 if (!signal_vt_acq(sc->cur_scp)) {
2358 sc->switch_in_progress = 0;
2359 if (sc->unit == sc_console_unit)
2360 cons_unavail = FALSE;
2361 }
2362

--- 1219 unchanged lines hidden ---