summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2009-01-11 16:12:16 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2009-01-11 16:12:16 +0000
commit0e526b608e92adabcc72c59e7bdcdc35ce1cd4ae (patch)
tree5b74300629ede656269c50d79dc0bc0c1647a637 /sys/arch
parente0da449a4c028352b876410600579b9836e82522 (diff)
Define a limit to the input which can be fed to sunkbd_input() at once,
will be necessary for rawkbd mode.
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/sparc/dev/z8530kbd.c4
-rw-r--r--sys/arch/sparc64/dev/comkbd_ebus.c12
-rw-r--r--sys/arch/sparc64/dev/z8530kbd.c4
3 files changed, 13 insertions, 7 deletions
diff --git a/sys/arch/sparc/dev/z8530kbd.c b/sys/arch/sparc/dev/z8530kbd.c
index 07f768ceeca..1738294377c 100644
--- a/sys/arch/sparc/dev/z8530kbd.c
+++ b/sys/arch/sparc/dev/z8530kbd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: z8530kbd.c,v 1.11 2009/01/11 15:53:56 miod Exp $ */
+/* $OpenBSD: z8530kbd.c,v 1.12 2009/01/11 16:12:14 miod Exp $ */
/* $NetBSD: z8530tty.c,v 1.77 2001/05/30 15:24:24 lukem Exp $ */
/*-
@@ -941,7 +941,7 @@ zskbd_rxsoft(zst)
u_char rr1;
int code;
int s;
- u_int8_t cbuf[64], *c;
+ u_int8_t cbuf[SUNKBD_MAX_INPUT_SIZE], *c;
end = zst->zst_ebuf;
get = zst->zst_rbget;
diff --git a/sys/arch/sparc64/dev/comkbd_ebus.c b/sys/arch/sparc64/dev/comkbd_ebus.c
index 67177de29ed..1ee82f962bd 100644
--- a/sys/arch/sparc64/dev/comkbd_ebus.c
+++ b/sys/arch/sparc64/dev/comkbd_ebus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: comkbd_ebus.c,v 1.19 2009/01/11 15:53:58 miod Exp $ */
+/* $OpenBSD: comkbd_ebus.c,v 1.20 2009/01/11 16:12:15 miod Exp $ */
/*
* Copyright (c) 2002 Jason L. Wright (jason@thought.net)
@@ -354,16 +354,22 @@ comkbd_soft(vsc)
{
struct comkbd_softc *sc = vsc;
struct sunkbd_softc *ss = (void *)sc;
- u_int8_t cbuf[COMK_RX_RING], *cptr = cbuf;
+ u_int8_t cbuf[SUNKBD_MAX_INPUT_SIZE], *cptr;
u_int8_t c;
+ cptr = cbuf;
while (sc->sc_rxcnt) {
*cptr++ = *sc->sc_rxget;
if (++sc->sc_rxget == sc->sc_rxend)
sc->sc_rxget = sc->sc_rxbeg;
sc->sc_rxcnt--;
- sunkbd_input(ss, cbuf, cptr - cbuf);
+ if (cptr - cbuf == sizeof cbuf) {
+ sunkbd_input(ss, cbuf, cptr - cbuf);
+ cptr = cbuf;
+ }
}
+ if (cptr != cbuf)
+ sunkbd_input(ss, cbuf, cptr - cbuf);
if (sc->sc_txcnt) {
c = sc->sc_ier | IER_ETXRDY;
diff --git a/sys/arch/sparc64/dev/z8530kbd.c b/sys/arch/sparc64/dev/z8530kbd.c
index cfb6f74f30c..9509e79797e 100644
--- a/sys/arch/sparc64/dev/z8530kbd.c
+++ b/sys/arch/sparc64/dev/z8530kbd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: z8530kbd.c,v 1.21 2009/01/11 15:53:58 miod Exp $ */
+/* $OpenBSD: z8530kbd.c,v 1.22 2009/01/11 16:12:15 miod Exp $ */
/* $NetBSD: z8530tty.c,v 1.77 2001/05/30 15:24:24 lukem Exp $ */
/*-
@@ -924,7 +924,7 @@ zskbd_rxsoft(zst)
u_char rr1;
int code;
int s;
- u_int8_t cbuf[64], *c;
+ u_int8_t cbuf[SUNKBD_MAX_INPUT_SIZE], *c;
end = zst->zst_ebuf;
get = zst->zst_rbget;