summaryrefslogtreecommitdiff
path: root/sys/src
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2015-08-05 10:44:03 +0200
committercinap_lenrek <cinap_lenrek@felloff.net>2015-08-05 10:44:03 +0200
commit7304deaec1ed27567dd6c55e245d9d5cc99686bb (patch)
tree4ca6667d466fb440ea33fc2f94b4c8e16c2a4181 /sys/src
parentf7514acc95ee1b7515936a9a7bfd48f72d21025b (diff)
pc, pc64: remove unused psaux driver, cleanup devkbd
the psaux driver is not used in any kernel configuration and theres no userspace mouse daemon. i8042auxcmds() is wrong as access to the user buffer can fault and we are holding an ilocks. little cleanups in devkbd.
Diffstat (limited to 'sys/src')
-rw-r--r--sys/src/9/pc/devkbd.c27
-rw-r--r--sys/src/9/pc/fns.h1
-rw-r--r--sys/src/9/pc/psaux.c57
-rw-r--r--sys/src/9/pc64/fns.h1
4 files changed, 5 insertions, 81 deletions
diff --git a/sys/src/9/pc/devkbd.c b/sys/src/9/pc/devkbd.c
index 96baab79f..5aeaded1f 100644
--- a/sys/src/9/pc/devkbd.c
+++ b/sys/src/9/pc/devkbd.c
@@ -159,24 +159,6 @@ i8042auxcmd(int cmd)
return 0;
}
-int
-i8042auxcmds(uchar *cmd, int ncmd)
-{
- int i;
-
- ilock(&i8042lock);
- for(i=0; i<ncmd; i++){
- if(outready() < 0)
- break;
- outb(Cmd, 0xD4);
- if(outready() < 0)
- break;
- outb(Data, cmd[i]);
- }
- iunlock(&i8042lock);
- return i;
-}
-
/*
* set keyboard's leds for lock states (scroll, numeric, caps).
*
@@ -252,7 +234,7 @@ i8042intr(Ureg*, void*)
void
i8042auxenable(void (*putc)(int, int))
{
- char *err = "i8042: aux init failed\n";
+ static char err[] = "i8042: aux init failed\n";
ilock(&i8042lock);
@@ -293,6 +275,7 @@ kbdshutdown(void)
{
if(nokbd)
return;
+ /* disable kbd and aux xfers and interrupts */
ccc &= ~(Ckbdint|Cauxint);
ccc |= (Cauxdis|Ckbddis);
outready();
@@ -391,7 +374,7 @@ kbdwrite(Chan *c, void *a, long n, vlong)
static void
kbdreset(void)
{
- static char *initfailed = "i8042: init failed\n";
+ static char initfailed[] = "i8042: kbd init failed\n";
int c, try;
kbd.q = qopen(1024, Qcoalesce, 0, 0);
@@ -437,8 +420,8 @@ kbdreset(void)
outready();
nokbd = 0;
- ioalloc(Data, 1, 0, "kbd");
- ioalloc(Cmd, 1, 0, "kbd");
+ ioalloc(Cmd, 1, 0, "i8042.cs");
+ ioalloc(Data, 1, 0, "i8042.data");
intrenable(IrqKBD, i8042intr, 0, BUSUNKNOWN, "kbd");
}
diff --git a/sys/src/9/pc/fns.h b/sys/src/9/pc/fns.h
index 02fac41b8..9701ed547 100644
--- a/sys/src/9/pc/fns.h
+++ b/sys/src/9/pc/fns.h
@@ -58,7 +58,6 @@ void guesscpuhz(int);
void halt(void);
void mwait(void*);
int i8042auxcmd(int);
-int i8042auxcmds(uchar*, int);
void i8042auxenable(void (*)(int, int));
void i8042reset(void);
void i8250console(void);
diff --git a/sys/src/9/pc/psaux.c b/sys/src/9/pc/psaux.c
deleted file mode 100644
index 4d187584c..000000000
--- a/sys/src/9/pc/psaux.c
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Interface to raw PS/2 aux port.
- * Used by user-level mouse daemon.
- */
-
-#include "u.h"
-#include "../port/lib.h"
-#include "mem.h"
-#include "dat.h"
-#include "fns.h"
-#include "../port/error.h"
-#include "io.h"
-
-#define Image IMAGE
-#include <draw.h>
-#include <memdraw.h>
-#include <cursor.h>
-#include "screen.h"
-
-/*
- * BUG: we ignore shift here.
- * we need a more general solution,
- * one that will also work for serial mice.
- */
-Queue *psauxq;
-
-static void
-psauxputc(int c, int)
-{
- uchar uc;
-
- uc = c;
- qproduce(psauxq, &uc, 1);
-}
-
-static long
-psauxread(Chan*, void *a, long n, vlong)
-{
- return qread(psauxq, a, n);
-}
-
-static long
-psauxwrite(Chan*, void *a, long n, vlong)
-{
- return i8042auxcmds(a, n);
-}
-
-void
-psauxlink(void)
-{
- psauxq = qopen(1024, Qcoalesce, 0, 0);
- if(psauxq == nil)
- panic("psauxlink");
- qnoblock(psauxq, 1);
- i8042auxenable(psauxputc);
- addarchfile("psaux", DMEXCL|0660, psauxread, psauxwrite);
-}
diff --git a/sys/src/9/pc64/fns.h b/sys/src/9/pc64/fns.h
index 5cbef27aa..1d92109cd 100644
--- a/sys/src/9/pc64/fns.h
+++ b/sys/src/9/pc64/fns.h
@@ -49,7 +49,6 @@ void guesscpuhz(int);
void halt(void);
void mwait(void*);
int i8042auxcmd(int);
-int i8042auxcmds(uchar*, int);
void i8042auxenable(void (*)(int, int));
void i8042reset(void);
void i8250console(void);