From 9e2429f5979e6f6e4abfc7e3102878374f981ed0 Mon Sep 17 00:00:00 2001 From: Poul-Henning Kamp Date: Mon, 23 Jan 1995 02:52:28 +0000 Subject: [PATCH] Moved the typedefs of d__t into sys/sys/conf.h and used them in the definition of struct [cb]devsw. Guess Bruce never got around to complete this (?) Poul-Henning --- sys/i386/i386/conf.c | 18 +--------------- sys/sys/conf.h | 51 ++++++++++++++++++++++++-------------------- sys/sys/linedisc.h | 51 ++++++++++++++++++++++++-------------------- 3 files changed, 57 insertions(+), 63 deletions(-) diff --git a/sys/i386/i386/conf.c b/sys/i386/i386/conf.c index b5df6e2376e..36cadb85799 100644 --- a/sys/i386/i386/conf.c +++ b/sys/i386/i386/conf.c @@ -41,7 +41,7 @@ * SUCH DAMAGE. * * from: @(#)conf.c 5.8 (Berkeley) 5/12/91 - * $Id: conf.c,v 1.52 1995/01/20 08:35:02 sos Exp $ + * $Id: conf.c,v 1.53 1995/01/23 02:36:22 phk Exp $ */ #include @@ -53,22 +53,6 @@ #include #include -/* - * XXX move these to conf.h as in 1.1.5. - * d_strategy_t has already been moved (and fixed). - */ -typedef int d_open_t __P((dev_t, int, int, struct proc *)); -typedef int d_close_t __P((dev_t, int, int, struct proc *)); -typedef int d_ioctl_t __P((dev_t, int, caddr_t, int, struct proc *)); -typedef int d_dump_t __P(()); -typedef int d_psize_t __P((dev_t)); - -typedef int d_rdwr_t __P((dev_t, struct uio *, int)); -typedef int d_stop_t __P((struct tty *, int)); -typedef int d_reset_t __P((int)); -typedef int d_select_t __P((dev_t, int, struct proc *)); -typedef int d_mmap_t __P((/* XXX */)); - d_rdwr_t rawread, rawwrite; d_strategy_t swstrategy; diff --git a/sys/sys/conf.h b/sys/sys/conf.h index 0b47c8f204e..9cd3f1aca35 100644 --- a/sys/sys/conf.h +++ b/sys/sys/conf.h @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)conf.h 8.3 (Berkeley) 1/21/94 - * $Id: conf.h,v 1.5 1994/12/05 01:34:54 jkh Exp $ + * $Id: conf.h,v 1.6 1994/12/11 23:05:53 bde Exp $ */ #ifndef _SYS_CONF_H_ @@ -53,18 +53,26 @@ struct uio; struct vnode; typedef void d_strategy_t __P((struct buf *)); +typedef int d_open_t __P((dev_t, int, int, struct proc *)); +typedef int d_close_t __P((dev_t, int, int, struct proc *)); +typedef int d_ioctl_t __P((dev_t, int, caddr_t, int, struct proc *)); +typedef int d_dump_t __P(()); +typedef int d_psize_t __P((dev_t)); + +typedef int d_rdwr_t __P((dev_t, struct uio *, int)); +typedef int d_stop_t __P((struct tty *, int)); +typedef int d_reset_t __P((int)); +typedef int d_select_t __P((dev_t, int, struct proc *)); +typedef int d_mmap_t __P((/* XXX */)); struct bdevsw { - int (*d_open) __P((dev_t dev, int oflags, int devtype, - struct proc *p)); - int (*d_close) __P((dev_t dev, int fflag, int devtype, - struct proc *p)); + d_open_t *d_open; + d_close_t *d_close; d_strategy_t *d_strategy; - int (*d_ioctl) __P((dev_t dev, int cmd, caddr_t data, - int fflag, struct proc *p)); - int (*d_dump) (); /* parameters vary by architecture */ - int (*d_psize) __P((dev_t dev)); - int d_flags; + d_ioctl_t *d_ioctl; + d_dump_t *d_dump; + d_psize_t *d_psize; + int d_flags; }; #ifdef KERNEL @@ -72,19 +80,16 @@ extern struct bdevsw bdevsw[]; #endif struct cdevsw { - int (*d_open) __P((dev_t dev, int oflags, int devtype, - struct proc *p)); - int (*d_close) __P((dev_t dev, int fflag, int devtype, - struct proc *)); - int (*d_read) __P((dev_t dev, struct uio *uio, int ioflag)); - int (*d_write) __P((dev_t dev, struct uio *uio, int ioflag)); - int (*d_ioctl) __P((dev_t dev, int cmd, caddr_t data, - int fflag, struct proc *p)); - int (*d_stop) __P((struct tty *tp, int rw)); - int (*d_reset) __P((int uban)); /* XXX */ - struct tty *d_ttys; - int (*d_select) __P((dev_t dev, int which, struct proc *p)); - int (*d_mmap) __P(()); + d_open_t *d_open; + d_close_t *d_close; + d_rdwr_t *d_read; + d_rdwr_t *d_write; + d_ioctl_t *d_ioctl; + d_stop_t *d_stop; + d_reset_t *d_reset; + struct tty *d_ttys; + d_select_t *d_select; + d_mmap_t *d_mmap; d_strategy_t *d_strategy; }; diff --git a/sys/sys/linedisc.h b/sys/sys/linedisc.h index 0b47c8f204e..9cd3f1aca35 100644 --- a/sys/sys/linedisc.h +++ b/sys/sys/linedisc.h @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)conf.h 8.3 (Berkeley) 1/21/94 - * $Id: conf.h,v 1.5 1994/12/05 01:34:54 jkh Exp $ + * $Id: conf.h,v 1.6 1994/12/11 23:05:53 bde Exp $ */ #ifndef _SYS_CONF_H_ @@ -53,18 +53,26 @@ struct uio; struct vnode; typedef void d_strategy_t __P((struct buf *)); +typedef int d_open_t __P((dev_t, int, int, struct proc *)); +typedef int d_close_t __P((dev_t, int, int, struct proc *)); +typedef int d_ioctl_t __P((dev_t, int, caddr_t, int, struct proc *)); +typedef int d_dump_t __P(()); +typedef int d_psize_t __P((dev_t)); + +typedef int d_rdwr_t __P((dev_t, struct uio *, int)); +typedef int d_stop_t __P((struct tty *, int)); +typedef int d_reset_t __P((int)); +typedef int d_select_t __P((dev_t, int, struct proc *)); +typedef int d_mmap_t __P((/* XXX */)); struct bdevsw { - int (*d_open) __P((dev_t dev, int oflags, int devtype, - struct proc *p)); - int (*d_close) __P((dev_t dev, int fflag, int devtype, - struct proc *p)); + d_open_t *d_open; + d_close_t *d_close; d_strategy_t *d_strategy; - int (*d_ioctl) __P((dev_t dev, int cmd, caddr_t data, - int fflag, struct proc *p)); - int (*d_dump) (); /* parameters vary by architecture */ - int (*d_psize) __P((dev_t dev)); - int d_flags; + d_ioctl_t *d_ioctl; + d_dump_t *d_dump; + d_psize_t *d_psize; + int d_flags; }; #ifdef KERNEL @@ -72,19 +80,16 @@ extern struct bdevsw bdevsw[]; #endif struct cdevsw { - int (*d_open) __P((dev_t dev, int oflags, int devtype, - struct proc *p)); - int (*d_close) __P((dev_t dev, int fflag, int devtype, - struct proc *)); - int (*d_read) __P((dev_t dev, struct uio *uio, int ioflag)); - int (*d_write) __P((dev_t dev, struct uio *uio, int ioflag)); - int (*d_ioctl) __P((dev_t dev, int cmd, caddr_t data, - int fflag, struct proc *p)); - int (*d_stop) __P((struct tty *tp, int rw)); - int (*d_reset) __P((int uban)); /* XXX */ - struct tty *d_ttys; - int (*d_select) __P((dev_t dev, int which, struct proc *p)); - int (*d_mmap) __P(()); + d_open_t *d_open; + d_close_t *d_close; + d_rdwr_t *d_read; + d_rdwr_t *d_write; + d_ioctl_t *d_ioctl; + d_stop_t *d_stop; + d_reset_t *d_reset; + struct tty *d_ttys; + d_select_t *d_select; + d_mmap_t *d_mmap; d_strategy_t *d_strategy; };