mirror of
https://github.com/freebsd/freebsd-src
synced 2024-09-23 18:25:19 +00:00
Implement promcncheckc.
This commit is contained in:
parent
a85c203100
commit
2895b128c7
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=37589
|
@ -50,7 +50,7 @@
|
|||
#include <machine/cons.h>
|
||||
|
||||
/* XXX this is to fake out the console routines, while booting. */
|
||||
struct consdev promcons = { NULL, NULL, promcngetc, NULL, promcnputc,
|
||||
struct consdev promcons = { NULL, NULL, promcngetc, promcncheckc, promcnputc,
|
||||
NULL, makedev(97,0), CN_NORMAL };
|
||||
|
||||
struct rpb *hwrpb;
|
||||
|
@ -231,14 +231,13 @@ promcngetc(dev)
|
|||
}
|
||||
|
||||
/*
|
||||
* promcnlookc:
|
||||
* promcncheckc
|
||||
*
|
||||
* See if prom has a real char and pass it back.
|
||||
* If a char is ready, return it, otherwise return -1.
|
||||
*/
|
||||
int
|
||||
promcnlookc(dev, cp)
|
||||
promcncheckc(dev)
|
||||
dev_t dev;
|
||||
char *cp;
|
||||
{
|
||||
prom_return_t ret;
|
||||
int s;
|
||||
|
@ -246,11 +245,10 @@ promcnlookc(dev, cp)
|
|||
s = enter_prom();
|
||||
ret.bits = prom_getc(alpha_console);
|
||||
leave_prom(s);
|
||||
if (ret.u.status == 0 || ret.u.status == 1) {
|
||||
*cp = ret.u.retval;
|
||||
return 1;
|
||||
} else
|
||||
return 0;
|
||||
if (ret.u.status == 0 || ret.u.status == 1)
|
||||
return (ret.u.retval);
|
||||
else
|
||||
return (-1);
|
||||
}
|
||||
|
||||
int
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id$ */
|
||||
/* $Id: promcons.c,v 1.2 1998/07/05 11:59:44 dfr Exp $ */
|
||||
/* $NetBSD: promcons.c,v 1.13 1998/03/21 22:52:59 mycroft Exp $ */
|
||||
|
||||
/*
|
||||
|
@ -245,9 +245,9 @@ promtimeout(v)
|
|||
void *v;
|
||||
{
|
||||
struct tty *tp = v;
|
||||
u_char c;
|
||||
int c;
|
||||
|
||||
while (promcnlookc(tp->t_dev, &c)) {
|
||||
while ((c = promcncheckc(tp->t_dev)) != -1) {
|
||||
if (tp->t_state & TS_ISOPEN)
|
||||
(*linesw[tp->t_line].l_rint)(c, tp);
|
||||
}
|
||||
|
|
|
@ -95,7 +95,7 @@ int prom_getenv __P((int, char *, int));
|
|||
#ifdef KERNEL
|
||||
void promcnputc __P((dev_t, int));
|
||||
int promcngetc __P((dev_t));
|
||||
int promcnlookc __P((dev_t, char *));
|
||||
int promcncheckc __P((dev_t));
|
||||
|
||||
u_int64_t prom_dispatch __P((u_int64_t, u_int64_t, u_int64_t, u_int64_t,
|
||||
u_int64_t));
|
||||
|
|
Loading…
Reference in a new issue