示例#1
0
static int
ofw_cngetc(struct consdev *cp)
{
	unsigned char ch;

	if (OF_read(stdin, &ch, 1) > 0) {
#if defined(KDB)
		kdb_alt_break(ch, &alt_break_state);
#endif
		return (ch);
	}

	return (-1);
}
示例#2
0
static int
bvm_cngetc(struct consdev *cp)
{
	unsigned char ch;

	if (bvm_rcons(&ch) == 0) {
#if defined(KDB)
		kdb_alt_break(ch, &alt_break_state);
#endif
		return (ch);
	}

	return (-1);
}
示例#3
0
static int
cfe_cngetc(struct consdev *cp)
{
    unsigned char ch;

    if (cfe_read(conhandle, &ch, 1) == 1) {
#if defined(KDB)
        kdb_alt_break(ch, &alt_break_state);
#endif
        return (ch);
    }

    return (-1);
}
示例#4
0
static int
uart_phyp_cngetc(struct consdev *cp)
{
	unsigned char c;
	int retval;

	retval = uart_phyp_get(console_sc, &c, 1);
	if (retval != 1)
		return (-1);
#if defined(KDB)
	kdb_alt_break(c, &alt_break_state);
#endif

	return (c);
}
示例#5
0
static int
mambo_cngetc(struct consdev *cp)
{
	int ch;

	ch = mambocall(MAMBO_CONSOLE_READ);

	if (ch > 0 && ch < 0xff) {
#if defined(KDB)
		kdb_alt_break(ch, &alt_break_state);
#endif
		return (ch);
	}

	return (-1);
}
示例#6
0
static int
dcons_check_break(struct dcons_softc *dc, int c)
{

	if (c < 0)
		return (c);

#ifdef GDB
	if ((dc->flags & DC_GDB) != 0 && gdb_cur == &dcons_gdb_dbgport)
		kdb_alt_break_gdb(c, &dc->brk_state);
	else
#endif
		kdb_alt_break(c, &dc->brk_state);

	return (c);
}
示例#7
0
static int
hvcn_cncheckc(struct consdev *cp)
{
	unsigned char ch;
	int l;

	if ((l = hv_cons_getchar(&ch)) == H_EOK) {
#if defined(KDB)
		if (l == H_BREAK || l ==  H_HUP)
			kdb_enter(KDB_WHY_BREAK, "Break sequence on console");
		if (kdb_alt_break(ch, &alt_break_state))
			kdb_enter(KDB_WHY_BREAK, "Break sequence on console");
#endif
		return (ch);
	}

	return (-1);
}
示例#8
0
/*
 * The actual work of checking for, and handling, available reads.  This is
 * used in both polled and interrupt-driven modes, as JTAG UARTs may be hooked
 * up with, or without, IRQs allocated.
 */
static void
aju_handle_input(struct altera_jtag_uart_softc *sc, struct tty *tp)
{
	int c;

	tty_lock_assert(tp, MA_OWNED);
	AJU_LOCK_ASSERT(sc);

	while (aju_readable(sc)) {
		c = aju_read(sc);
		AJU_UNLOCK(sc);
#ifdef KDB
		if (sc->ajus_flags & ALTERA_JTAG_UART_FLAG_CONSOLE)
			kdb_alt_break(c, &sc->ajus_alt_break_state);
#endif
		ttydisc_rint(tp, c, 0);
		AJU_LOCK(sc);
	}
	AJU_UNLOCK(sc);
	ttydisc_rint_done(tp);
	AJU_LOCK(sc);
}
示例#9
0
static int
hvcn_cngetc(struct consdev *cp)
{
	unsigned char ch;
	int l;

	ch = '\0';

	while ((l = hv_cons_getchar(&ch)) != H_EOK) {
#if defined(KDB)
		int kdb_brk;

		if (l == H_BREAK || l ==  H_HUP)
			kdb_enter(KDB_WHY_BREAK, "Break sequence on console");

		if ((kdb_brk = kdb_alt_break(ch, &alt_break_state)) != 0) {
			switch (kdb_brk) {
			case KDB_REQ_DEBUGGER:
				kdb_enter(KDB_WHY_BREAK,
				    "Break sequence on console");
				break;
			case KDB_REQ_PANIC:
				kdb_panic("Panic sequence on console");
				break;
			case KDB_REQ_REBOOT:
				kdb_reboot();
				break;
			}
		}
#endif
		if (l != -2 && l != 0) {
			return (-1);
		}
	}



	return (ch);
}