summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>1994-10-20 00:45:36 +0000
committerphk <phk@FreeBSD.org>1994-10-20 00:45:36 +0000
commitccc81f66b716a6456d3e5954073f4947cd60e923 (patch)
tree57d4932b1dbf6882ab74f09a1b3b8e359ac9c3de /sys
parentca4c47b8ecd38e527c593755f6ab41785de48697 (diff)
downloadFreeBSD-src-ccc81f66b716a6456d3e5954073f4947cd60e923.zip
FreeBSD-src-ccc81f66b716a6456d3e5954073f4947cd60e923.tar.gz
A missing bit from Peter Dufaults patches, as best I could guess...
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/sio/sio.c23
-rw-r--r--sys/i386/isa/sio.c23
-rw-r--r--sys/isa/sio.c23
3 files changed, 66 insertions, 3 deletions
diff --git a/sys/dev/sio/sio.c b/sys/dev/sio/sio.c
index 1f359c2..54133ab 100644
--- a/sys/dev/sio/sio.c
+++ b/sys/dev/sio/sio.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)com.c 7.5 (Berkeley) 5/16/91
- * $Id: sio.c,v 1.55 1994/10/15 18:05:25 ache Exp $
+ * $Id: sio.c,v 1.56 1994/10/19 21:38:19 bde Exp $
*/
#include "sio.h"
@@ -263,6 +263,7 @@ int sioselect __P((dev_t dev, int rw, struct proc *p));
/* Console device entry points. */
int siocngetc __P((dev_t dev));
+int siocncheckc __P((dev_t dev));
struct consdev;
void siocninit __P((struct consdev *cp));
void siocnprobe __P((struct consdev *cp));
@@ -2001,6 +2002,26 @@ siocninit(cp)
}
int
+siocncheckc(dev)
+ dev_t dev;
+{
+ int c=0;
+ Port_t iobase;
+ int s;
+ struct siocnstate sp;
+
+ iobase = siocniobase;
+ s = spltty();
+ siocnopen(&sp);
+ if (inb(iobase + com_lsr) & LSR_RXRDY)
+ c = inb(iobase + com_data);
+ siocnclose(&sp);
+ splx(s);
+ return (c);
+}
+
+
+int
siocngetc(dev)
dev_t dev;
{
diff --git a/sys/i386/isa/sio.c b/sys/i386/isa/sio.c
index 1f359c2..54133ab 100644
--- a/sys/i386/isa/sio.c
+++ b/sys/i386/isa/sio.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)com.c 7.5 (Berkeley) 5/16/91
- * $Id: sio.c,v 1.55 1994/10/15 18:05:25 ache Exp $
+ * $Id: sio.c,v 1.56 1994/10/19 21:38:19 bde Exp $
*/
#include "sio.h"
@@ -263,6 +263,7 @@ int sioselect __P((dev_t dev, int rw, struct proc *p));
/* Console device entry points. */
int siocngetc __P((dev_t dev));
+int siocncheckc __P((dev_t dev));
struct consdev;
void siocninit __P((struct consdev *cp));
void siocnprobe __P((struct consdev *cp));
@@ -2001,6 +2002,26 @@ siocninit(cp)
}
int
+siocncheckc(dev)
+ dev_t dev;
+{
+ int c=0;
+ Port_t iobase;
+ int s;
+ struct siocnstate sp;
+
+ iobase = siocniobase;
+ s = spltty();
+ siocnopen(&sp);
+ if (inb(iobase + com_lsr) & LSR_RXRDY)
+ c = inb(iobase + com_data);
+ siocnclose(&sp);
+ splx(s);
+ return (c);
+}
+
+
+int
siocngetc(dev)
dev_t dev;
{
diff --git a/sys/isa/sio.c b/sys/isa/sio.c
index 1f359c2..54133ab 100644
--- a/sys/isa/sio.c
+++ b/sys/isa/sio.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)com.c 7.5 (Berkeley) 5/16/91
- * $Id: sio.c,v 1.55 1994/10/15 18:05:25 ache Exp $
+ * $Id: sio.c,v 1.56 1994/10/19 21:38:19 bde Exp $
*/
#include "sio.h"
@@ -263,6 +263,7 @@ int sioselect __P((dev_t dev, int rw, struct proc *p));
/* Console device entry points. */
int siocngetc __P((dev_t dev));
+int siocncheckc __P((dev_t dev));
struct consdev;
void siocninit __P((struct consdev *cp));
void siocnprobe __P((struct consdev *cp));
@@ -2001,6 +2002,26 @@ siocninit(cp)
}
int
+siocncheckc(dev)
+ dev_t dev;
+{
+ int c=0;
+ Port_t iobase;
+ int s;
+ struct siocnstate sp;
+
+ iobase = siocniobase;
+ s = spltty();
+ siocnopen(&sp);
+ if (inb(iobase + com_lsr) & LSR_RXRDY)
+ c = inb(iobase + com_data);
+ siocnclose(&sp);
+ splx(s);
+ return (c);
+}
+
+
+int
siocngetc(dev)
dev_t dev;
{
OpenPOWER on IntegriCloud