summaryrefslogtreecommitdiff
path: root/i386/i386at/kd_event.c
diff options
context:
space:
mode:
authorThomas Bushnell <thomas@gnu.org>1999-04-26 05:30:06 +0000
committerThomas Bushnell <thomas@gnu.org>1999-04-26 05:30:06 +0000
commit002b9c7d51f7fdb0fe222d4a6023655687c6e501 (patch)
tree9d7d733df5d6d3d10fa528acea19f17ddbefa615 /i386/i386at/kd_event.c
parent981cfc8ee5a00f03440a5a9a48436277e73096eb (diff)
1999-02-27 OKUJI Yoshinori <okuji@kuicr.kyoto-u.ac.jp>
* i386/i386at/i386at_ds_routines.c: Include <i386/linux/device-drivers.h> instead of <linux/device-drivers.h>. * device/ds_routines.c [LINUX_DEV]: Likewise. * i386/linux/Makefile.in (linux-gen-flags): Fix an extra slash. (distclean): Remove asm links. * linux/src/COPYING: Copied from linux-2.0.36. 1999-02-02 OKUJI Yoshinori <okuji@kuicr.kyoto-u.ac.jp> * i386/i386at/kd_event.c (kbdgetstat): Fix a typo DEV_GET_SIZES -> DEV_GET_SIZE. * i386/i386at/kd_mouse.c (mousegetstat): Likewise. * device/kmsg.c (kmsggetstat): Likewise. 1999-02-01 OKUJI Yoshinori <okuji@kuicr.kyoto-u.ac.jp> * linux/dev/glue/block.c (dev_getstat): Fix a missing `struct'. * device/cons.c (cninit): Don't call kmsginit. * kmsg.c (kmsg_buffer): Defined as static. (kmsg_write_offset): Likewise. (kmsg_read_offset): Likewise. (kmsg_read_queue): Likewise. (kmsg_in_use): Likewise. (kmsg_lock): Likewise. (kmsginit): Likewise, and call queue_init instead of setting PREV and NEXT manually. (kmsg_done_init): New variable. (kmsg_putchar): Call kmsginit if not initialized yet. (kmsggetstat): New function. * kmsg.h (kmsggetstat): Add the prototype. * i386/i386at/kd_event.c (kbdgetstat): Handle DEV_GET_SIZE. (kbdread): Check if the amount a user specify is a multiple of sizeof(kd_event). * i386/i386at/kd_mouse.c (mousegetstat): New function. (mouseread): Check if the amount a user specify is a multiple of sizeof(kd_event). * i386/i386at/conf.c (dev_name_list): Set the mouse getstat entry to mousegetstat and the kmsg getstat entry to kmsggetstat. Use MACH_COM instead of NCOM to determine if com is used. Use MACH_LPR instead of NLPR to determine if lpr is used. * configure.in (--enable-com): New option. (--enable-lpr): Likewise. * Makefile.in (enable_com): New variable. (enable_lpr): Likewise. * i386/Makefrag (i386at-files): Remove com.c. (objfiles): Add com.o if enable_com is yes, and lpr.o if enable_lpr is yes. 1999-01-10 OKUJI Yoshinori <okuji@kuicr.kyoto-u.ac.jp> * i386/i386at/kd.c: Applied a keymap patch. Reported by Marcus Brinkmann <Marcus.Brikmann@ruhr-uni-bochum.de>. * i386/i386at/kd.h: Likewise. 1998-12-06 OKUJI Yoshinori <okuji@kuicr.kyoto-u.ac.jp> Add kmsg device. * Makefile.in (device-files): Add kmsg.c and kmsg.h. * configure.in (--enable-kmsg): New option. * device/cons.c: Include kmsg.h. (cninit): Call kmsginit if MACH_KMSG is defined. (cnputc): Call kmsg_putchar if MACH_KMSG is defined. * device/kmsg.c: New file. * device/kmsg.h: Likewise. * i386/i386at/conf.c (dev_name_list): Add kmsg entry. 1998-12-01 OKUJI Yoshinori <okuji@kuicr.kyoto-u.ac.jp> * i386/i386at/i386at_ds_routines.c: Include <linux/device-drivers.h> only if LINUX_DEV is defined. Reported by UCHIYAMA Yasushi <uch@nop.or.jp>. * device/ds_routines.c: Likewise. * configure.in: AC_CONFIG_SUBDIRS(linux) instead of linuxdev. (--disable-linuxdev): New option. * linux/Makefile.in (CPPFLAGS): Remove -DLINUX_DEV, and add @DEFS@. (objfiles): Add linux.o only if LINUX_DEV is defined. * linux/Drivers.in (--disable-linuxdev): New option. * i386/Makefrag (DEFINES): Remove -DLINUX_DEV.
Diffstat (limited to 'i386/i386at/kd_event.c')
-rw-r--r--i386/i386at/kd_event.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/i386/i386at/kd_event.c b/i386/i386at/kd_event.c
index 9ee4374..304bd7f 100644
--- a/i386/i386at/kd_event.c
+++ b/i386/i386at/kd_event.c
@@ -185,6 +185,11 @@ io_return_t kbdgetstat(dev, flavor, data, count)
*data = KB_VANILLAKB;
*count = 1;
break;
+ case DEV_GET_SIZE:
+ data[DEV_GET_SIZE_DEVICE_SIZE] = 0;
+ data[DEV_GET_SIZE_RECORD_SIZE] = sizeof(kd_event);
+ *count = DEV_GET_SIZE_COUNT;
+ break;
default:
return (D_INVALID_OPERATION);
}
@@ -307,6 +312,10 @@ kbdread(dev, ior)
register int err, count;
register spl_t s;
+ /* Check if IO_COUNT is a multiple of the record size. */
+ if (ior->io_count % sizeof(kd_event) != 0)
+ return D_INVALID_SIZE;
+
err = device_read_alloc(ior, (vm_size_t)ior->io_count);
if (err != KERN_SUCCESS)
return (err);