1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-18 10:35:55 +00:00

Aling to new console and gdb_port semantics

This commit is contained in:
Poul-Henning Kamp 2006-05-26 13:33:28 +00:00
parent cc042607e3
commit a67173a28a
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=158957

View File

@ -3452,15 +3452,13 @@ static void siocnclose(struct siocnstate *sp, Port_t iobase);
static void siocnopen(struct siocnstate *sp, Port_t iobase, int speed); static void siocnopen(struct siocnstate *sp, Port_t iobase, int speed);
static void siocntxwait(Port_t iobase); static void siocntxwait(Port_t iobase);
static cn_probe_t siocnprobe; static cn_probe_t sio_cnprobe;
static cn_init_t siocninit; static cn_init_t sio_cninit;
static cn_term_t siocnterm; static cn_term_t sio_cnterm;
static cn_checkc_t siocncheckc; static cn_getc_t sio_cngetc;
static cn_getc_t siocngetc; static cn_putc_t sio_cnputc;
static cn_putc_t siocnputc;
CONS_DRIVER(sio, siocnprobe, siocninit, siocnterm, siocngetc, siocncheckc, CONSOLE_DRIVER(sio);
siocnputc, NULL);
static void static void
siocntxwait(iobase) siocntxwait(iobase)
@ -3582,7 +3580,7 @@ siocnclose(sp, iobase)
} }
static void static void
siocnprobe(cp) sio_cnprobe(cp)
struct consdev *cp; struct consdev *cp;
{ {
speed_t boot_speed; speed_t boot_speed;
@ -3665,21 +3663,21 @@ siocnprobe(cp)
} }
static void static void
siocninit(cp) sio_cninit(cp)
struct consdev *cp; struct consdev *cp;
{ {
comconsole = cp->cn_unit; comconsole = cp->cn_unit;
} }
static void static void
siocnterm(cp) sio_cnterm(cp)
struct consdev *cp; struct consdev *cp;
{ {
comconsole = -1; comconsole = -1;
} }
static int static int
siocncheckc(struct consdev *cd) sio_cngetc(struct consdev *cd)
{ {
int c; int c;
Port_t iobase; Port_t iobase;
@ -3709,38 +3707,8 @@ siocncheckc(struct consdev *cd)
return (c); return (c);
} }
static int
siocngetc(struct consdev *cd)
{
int c;
Port_t iobase;
int s;
struct siocnstate sp;
speed_t speed;
if (cd != NULL && cd->cn_unit == siocnunit) {
iobase = siocniobase;
speed = comdefaultrate;
} else {
#ifdef GDB
iobase = siogdbiobase;
speed = gdbdefaultrate;
#else
return (-1);
#endif
}
s = spltty();
siocnopen(&sp, iobase, speed);
while (!(inb(iobase + com_lsr) & LSR_RXRDY))
;
c = inb(iobase + com_data);
siocnclose(&sp, iobase);
splx(s);
return (c);
}
static void static void
siocnputc(struct consdev *cd, int c) sio_cnputc(struct consdev *cd, int c)
{ {
int need_unlock; int need_unlock;
int s; int s;
@ -3786,11 +3754,9 @@ static gdb_probe_f siogdbprobe;
static gdb_init_f siogdbinit; static gdb_init_f siogdbinit;
static gdb_term_f siogdbterm; static gdb_term_f siogdbterm;
static gdb_getc_f siogdbgetc; static gdb_getc_f siogdbgetc;
static gdb_checkc_f siogdbcheckc;
static gdb_putc_f siogdbputc; static gdb_putc_f siogdbputc;
GDB_DBGPORT(sio, siogdbprobe, siogdbinit, siogdbterm, siogdbcheckc, GDB_DBGPORT(sio, siogdbprobe, siogdbinit, siogdbterm, siogdbgetc, siogdbputc);
siogdbgetc, siogdbputc);
static int static int
siogdbprobe(void) siogdbprobe(void)
@ -3811,19 +3777,13 @@ siogdbterm(void)
static void static void
siogdbputc(int c) siogdbputc(int c)
{ {
siocnputc(NULL, c); sio__cnputc(NULL, c);
}
static int
siogdbcheckc(void)
{
return (siocncheckc(NULL));
} }
static int static int
siogdbgetc(void) siogdbgetc(void)
{ {
return (siocngetc(NULL)); return (sio__cngetc(NULL));
} }
#endif #endif