WRITE -> F_WRITE, add kbd interrupt code
authorKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Sun, 5 May 1991 06:41:09 +0000 (22:41 -0800)
committerKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Sun, 5 May 1991 06:41:09 +0000 (22:41 -0800)
SCCS-vsn: sys/stand.att/dev.c 7.11

usr/src/sys/stand.att/dev.c

index e9e49ad..9bcdd4d 100644 (file)
@@ -4,18 +4,21 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)dev.c       7.10 (Berkeley) %G%
+ *     @(#)dev.c       7.11 (Berkeley) %G%
  */
 
 #include "sys/param.h"
 #include "stand/saio.h"                        /* used from machine/stand dir */
  */
 
 #include "sys/param.h"
 #include "stand/saio.h"                        /* used from machine/stand dir */
+#include <setjmp.h>
 
 /*
 
 /*
- * NB: the value "io->i_dev", used to offset the devsw[] array
- * in the routines below, is munged by the vaxstand Makefile to work
- * for certain boots.
+ * NB: the value "io->i_dev", used to offset the devsw[] array in the
+ * routines below, is munged by the machine specific stand Makefiles
+ * to work for certain boots.
  */
 
  */
 
+jmp_buf exception;
+
 devread(io)
        register struct iob *io;
 {
 devread(io)
        register struct iob *io;
 {
@@ -25,6 +28,8 @@ devread(io)
        io->i_error = 0;
        cc = (*devsw[io->i_dev].dv_strategy)(io, F_READ);
        io->i_flgs &= ~F_TYPEMASK;
        io->i_error = 0;
        cc = (*devsw[io->i_dev].dv_strategy)(io, F_READ);
        io->i_flgs &= ~F_TYPEMASK;
+       if (scankbd())
+               _longjmp(&exception, 1);
        return (cc);
 }
 
        return (cc);
 }
 
@@ -35,8 +40,10 @@ devwrite(io)
 
        io->i_flgs |= F_WRDATA;
        io->i_error = 0;
 
        io->i_flgs |= F_WRDATA;
        io->i_error = 0;
-       cc = (*devsw[io->i_dev].dv_strategy)(io, WRITE);
+       cc = (*devsw[io->i_dev].dv_strategy)(io, F_WRITE);
        io->i_flgs &= ~F_TYPEMASK;
        io->i_flgs &= ~F_TYPEMASK;
+       if (scankbd())
+               _longjmp(&exception, 1);
        return (cc);
 }
 
        return (cc);
 }
 
@@ -94,19 +101,19 @@ devioctl(io, cmd, arg)
        return ((*devsw[io->i_dev].dv_ioctl)(io, cmd, arg));
 }
 
        return ((*devsw[io->i_dev].dv_ioctl)(io, cmd, arg));
 }
 
-/*ARGSUSED*/
+/* ARGSUSED */
 nullsys(io)
        struct iob *io;
 {}
 
 nullsys(io)
        struct iob *io;
 {}
 
-/*ARGSUSED*/
+/* ARGSUSED */
 nodev(io)
        struct iob *io;
 {
        errno = EBADF;
 }
 
 nodev(io)
        struct iob *io;
 {
        errno = EBADF;
 }
 
-/*ARGSUSED*/
+/* ARGSUSED */
 noioctl(io, cmd, arg)
        struct iob *io;
        int cmd;
 noioctl(io, cmd, arg)
        struct iob *io;
        int cmd;