ofw_console.c (131016) | ofw_console.c (131916) |
---|---|
1/* 2 * Copyright (C) 2001 Benno Rice. 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 --- 10 unchanged lines hidden (view full) --- 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 20 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 21 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 22 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 23 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 */ 25 26#include <sys/cdefs.h> | 1/* 2 * Copyright (C) 2001 Benno Rice. 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 --- 10 unchanged lines hidden (view full) --- 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 20 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 21 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 22 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 23 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 */ 25 26#include <sys/cdefs.h> |
27__FBSDID("$FreeBSD: head/sys/dev/ofw/ofw_console.c 131016 2004-06-24 02:57:11Z obrien $"); | 27__FBSDID("$FreeBSD: head/sys/dev/ofw/ofw_console.c 131916 2004-07-10 21:07:44Z marcel $"); |
28 | 28 |
29#include "opt_ddb.h" | |
30#include "opt_comconsole.h" 31#include "opt_ofw.h" 32 33#include <sys/param.h> | 29#include "opt_comconsole.h" 30#include "opt_ofw.h" 31 32#include <sys/param.h> |
33#include <sys/kdb.h> |
|
34#include <sys/kernel.h> 35#include <sys/systm.h> 36#include <sys/types.h> 37#include <sys/conf.h> 38#include <sys/cons.h> 39#include <sys/consio.h> 40#include <sys/tty.h> 41 --- 17 unchanged lines hidden (view full) --- 59 .d_flags = D_TTY | D_NEEDGIANT, 60}; 61 62static struct tty *ofw_tp = NULL; 63static int polltime; 64static struct callout_handle ofw_timeouthandle 65 = CALLOUT_HANDLE_INITIALIZER(&ofw_timeouthandle); 66 | 34#include <sys/kernel.h> 35#include <sys/systm.h> 36#include <sys/types.h> 37#include <sys/conf.h> 38#include <sys/cons.h> 39#include <sys/consio.h> 40#include <sys/tty.h> 41 --- 17 unchanged lines hidden (view full) --- 59 .d_flags = D_TTY | D_NEEDGIANT, 60}; 61 62static struct tty *ofw_tp = NULL; 63static int polltime; 64static struct callout_handle ofw_timeouthandle 65 = CALLOUT_HANDLE_INITIALIZER(&ofw_timeouthandle); 66 |
67#if defined(DDB) && defined(ALT_BREAK_TO_DEBUGGER) | 67#if defined(KDB) && defined(ALT_BREAK_TO_DEBUGGER) |
68static int alt_break_state; 69#endif 70 71static void ofw_tty_start(struct tty *); 72static int ofw_tty_param(struct tty *, struct termios *); 73static void ofw_tty_stop(struct tty *, int); 74static void ofw_timeout(void *); 75 --- 195 unchanged lines hidden (view full) --- 271 ch = '\0'; 272 273 while ((l = OF_read(stdin, &ch, 1)) != 1) { 274 if (l != -2 && l != 0) { 275 return (-1); 276 } 277 } 278 | 68static int alt_break_state; 69#endif 70 71static void ofw_tty_start(struct tty *); 72static int ofw_tty_param(struct tty *, struct termios *); 73static void ofw_tty_stop(struct tty *, int); 74static void ofw_timeout(void *); 75 --- 195 unchanged lines hidden (view full) --- 271 ch = '\0'; 272 273 while ((l = OF_read(stdin, &ch, 1)) != 1) { 274 if (l != -2 && l != 0) { 275 return (-1); 276 } 277 } 278 |
279#if defined(DDB) && defined(ALT_BREAK_TO_DEBUGGER) 280 if (db_alt_break(ch, &alt_break_state)) 281 breakpoint(); | 279#if defined(KDB) && defined(ALT_BREAK_TO_DEBUGGER) 280 if (kdb_alt_break(ch, &alt_break_state)) 281 kdb_enter("Break sequence on console"); |
282#endif 283 284 return (ch); 285} 286 287static int 288ofw_cons_checkc(struct consdev *cp) 289{ 290 unsigned char ch; 291 292 if (OF_read(stdin, &ch, 1) > 0) { | 282#endif 283 284 return (ch); 285} 286 287static int 288ofw_cons_checkc(struct consdev *cp) 289{ 290 unsigned char ch; 291 292 if (OF_read(stdin, &ch, 1) > 0) { |
293#if defined(DDB) && defined(ALT_BREAK_TO_DEBUGGER) 294 if (db_alt_break(ch, &alt_break_state)) 295 breakpoint(); | 293#if defined(KDB) && defined(ALT_BREAK_TO_DEBUGGER) 294 if (kdb_alt_break(ch, &alt_break_state)) 295 kdb_enter("Break sequence on console"); |
296#endif 297 return (ch); 298 } 299 300 return (-1); 301} 302 303static void --- 12 unchanged lines hidden --- | 296#endif 297 return (ch); 298 } 299 300 return (-1); 301} 302 303static void --- 12 unchanged lines hidden --- |