Eliminate gdb_checkc member from GDB_DBGPORT(), it is never used.

Use polling behaviour for gdb_getc() where convenient, this edges us
closer to the console code.
This commit is contained in:
Poul-Henning Kamp 2006-05-26 11:54:32 +00:00
parent e8d86c0e50
commit 9b188af13c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=158950
4 changed files with 9 additions and 33 deletions

View File

@ -183,11 +183,10 @@ static gdb_probe_f dcons_dbg_probe;
static gdb_init_f dcons_dbg_init;
static gdb_term_f dcons_dbg_term;
static gdb_getc_f dcons_dbg_getc;
static gdb_checkc_f dcons_dbg_checkc;
static gdb_putc_f dcons_dbg_putc;
GDB_DBGPORT(dcons, dcons_dbg_probe, dcons_dbg_init, dcons_dbg_term,
dcons_dbg_checkc, dcons_dbg_getc, dcons_dbg_putc);
dcons_dbg_getc, dcons_dbg_putc);
extern struct gdb_dbgport *gdb_cur;
#endif
@ -732,13 +731,6 @@ dcons_dbg_putc(int c)
dcons_os_putc(dc, c);
}
static int
dcons_dbg_checkc(void)
{
struct dcons_softc *dc = &sc[DCONS_GDB];
return (dcons_os_checkc(dc));
}
static int
dcons_dbg_getc(void)
{

View File

@ -2577,8 +2577,7 @@ static gdb_term_f siogdbterm;
static gdb_getc_f siogdbgetc;
static gdb_putc_f siogdbputc;
GDB_DBGPORT(sio, siogdbprobe, siogdbinit, siogdbterm, NULL,
siogdbgetc, siogdbputc);
GDB_DBGPORT(sio, siogdbprobe, siogdbinit, siogdbterm, siogdbgetc, siogdbputc);
static int
siogdbprobe(void)
@ -2605,12 +2604,7 @@ siogdbputc(int c)
static int
siogdbgetc(void)
{
int c;
do
c = sio_cngetc(NULL);
while (c == -1);
return (c);
return (sio_cngetc(NULL));
}
#endif

View File

@ -42,11 +42,10 @@ static gdb_probe_f uart_dbg_probe;
static gdb_init_f uart_dbg_init;
static gdb_term_f uart_dbg_term;
static gdb_getc_f uart_dbg_getc;
static gdb_checkc_f uart_dbg_checkc;
static gdb_putc_f uart_dbg_putc;
GDB_DBGPORT(uart, uart_dbg_probe, uart_dbg_init, uart_dbg_term,
uart_dbg_checkc, uart_dbg_getc, uart_dbg_putc);
uart_dbg_getc, uart_dbg_putc);
static struct uart_devinfo uart_dbgport;
@ -87,15 +86,8 @@ uart_dbg_putc(int c)
}
static int
uart_dbg_checkc(void)
uart_dbg_getc(void)
{
return (uart_poll(&uart_dbgport));
}
static int
uart_dbg_getc(void)
{
return (uart_getc(&uart_dbgport));
}

View File

@ -38,7 +38,6 @@ typedef void gdb_term_f(void);
struct gdb_dbgport {
const char *gdb_name;
gdb_checkc_f *gdb_checkc;
gdb_getc_f *gdb_getc;
gdb_init_f *gdb_init;
gdb_probe_f *gdb_probe;
@ -47,15 +46,14 @@ struct gdb_dbgport {
int gdb_active;
};
#define GDB_DBGPORT(name, probe, init, term, checkc, getc, putc) \
#define GDB_DBGPORT(name, probe, init, term, getc, putc) \
static struct gdb_dbgport name##_gdb_dbgport = { \
.gdb_name = #name, \
.gdb_checkc = checkc, \
.gdb_getc = getc, \
.gdb_init = init, \
.gdb_probe = probe, \
.gdb_init = init, \
.gdb_term = term, \
.gdb_getc = getc, \
.gdb_putc = putc, \
.gdb_term = term \
}; \
DATA_SET(gdb_dbgport_set, name##_gdb_dbgport)