From 3ede362d063931308f469768e27e096bafc34589 Mon Sep 17 00:00:00 2001 From: Marin Ramesa Date: Fri, 29 Nov 2013 22:53:48 +0100 Subject: i386/i386at/autoconf.c, com.c, lpr.c: remove forward declarations * i386/i386/autoconf.c (comintr, lprintr): Remove forward declarations. Include i386at/com.h. Include i386at/lprreg.h. * i386/i386at/com.c (comprobe, commctl, comstart, comstop, comattach, comintr, comgetstat, comsetstat): Remove forward declarations. * i386/i386at/com.h: Include device/tty.h. (comprobe, commctl, comstart, comstop, comattach, comintr, comgetstat, comsetstat): Add prototypes. * i386/i386at/lpr.c (lprprobe, lprstop, lprintr, lprstart, lprattach, lprgetstat, lprsetstat, lprpr_addr): Remove forward declarations. (lprprobe): Fix argument list. (lprpr): Define argument type. lprpr_addr): Likewise. * i386/i386at/lprreg.h (lprprobe, lprstop, lprintr, lprstart, lprattach, lprgetstat, lprsetstat, lprpr_addr): Add prototypes. --- i386/Makefrag.am | 2 +- i386/i386at/autoconf.c | 4 ++-- i386/i386at/com.c | 4 ---- i386/i386at/com.h | 22 ++++++++++++++++++ i386/i386at/lpr.c | 14 +++--------- i386/i386at/lpr.h | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++ i386/i386at/lprreg.h | 38 -------------------------------- 7 files changed, 88 insertions(+), 56 deletions(-) create mode 100644 i386/i386at/lpr.h delete mode 100644 i386/i386at/lprreg.h diff --git a/i386/Makefrag.am b/i386/Makefrag.am index 32730a5..15b867f 100644 --- a/i386/Makefrag.am +++ b/i386/Makefrag.am @@ -62,7 +62,7 @@ endif if enable_lpr libkernel_a_SOURCES += \ i386/i386at/lpr.c \ - i386/i386at/lprreg.h + i386/i386at/lpr.h endif diff --git a/i386/i386at/autoconf.c b/i386/i386at/autoconf.c index 66493b0..31bb73c 100644 --- a/i386/i386at/autoconf.c +++ b/i386/i386at/autoconf.c @@ -38,12 +38,12 @@ #if NCOM > 0 extern struct bus_driver comdriver; -extern void comintr(); +#include #endif /* NCOM */ #if NLPR > 0 extern struct bus_driver lprdriver; -extern void lprintr(); +#include #endif /* NLPR */ struct bus_ctlr bus_master_init[] = { diff --git a/i386/i386at/com.c b/i386/i386at/com.c index 90e1d0b..7b184e3 100644 --- a/i386/i386at/com.c +++ b/i386/i386at/com.c @@ -49,11 +49,7 @@ #include -int comprobe(), commctl(); -void comstart(struct tty *); -void comstop(), comattach(), comintr(); static void comparam(); -int comgetstat(), comsetstat(); static vm_offset_t com_std[NCOM] = { 0 }; struct bus_device *cominfo[NCOM]; diff --git a/i386/i386at/com.h b/i386/i386at/com.h index 49f23ee..7d5ee5e 100644 --- a/i386/i386at/com.h +++ b/i386/i386at/com.h @@ -28,6 +28,7 @@ #include #include +#include /* * Set receive modem state from modem status register. @@ -47,5 +48,26 @@ extern int comcnprobe(struct consdev *cp); extern int comcninit(struct consdev *cp); extern int comcngetc(dev_t dev, int wait); extern int comcnputc(dev_t dev, int c); +extern void comintr(int unit); + +int comprobe(int port, struct bus_device *dev); +int commctl(struct tty *tp, int bits, int how); +void comstart(struct tty *tp); +void comstop(struct tty *tp, int flags); +void comattach(struct bus_device *dev); + +io_return_t +comgetstat( + dev_t dev, + int flavor, + int *data, + natural_t *count); + +io_return_t +comsetstat( + dev_t dev, + int flavor, + int *data, + natural_t count); #endif /* _COM_H_ */ diff --git a/i386/i386at/lpr.c b/i386/i386at/lpr.c index 557eb15..4431c37 100644 --- a/i386/i386at/lpr.c +++ b/i386/i386at/lpr.c @@ -44,20 +44,12 @@ #include #include #include -#include +#include - /* * Driver information for auto-configuration stuff. */ -int lprprobe(); -void lprstop(); -void lprintr(), lprstart(); -void lprattach(struct bus_device *); -int lprgetstat(), lprsetstat(); -void lprpr_addr(); - struct bus_device *lprinfo[NLPR]; /* ??? */ static vm_offset_t lpr_std[NLPR] = { 0 }; @@ -282,14 +274,14 @@ int flags; tp->t_state |= TS_FLUSH; } int -lprpr(unit) +lprpr(int unit) { lprpr_addr(lprinfo[unit]->address); return 0; } void -lprpr_addr(addr) +lprpr_addr(unsigned short addr) { printf("DATA(%x) %x, STATUS(%x) %x, INTR_ENAB(%x) %x\n", DATA(addr), inb(DATA(addr)), diff --git a/i386/i386at/lpr.h b/i386/i386at/lpr.h new file mode 100644 index 0000000..ca7aeea --- /dev/null +++ b/i386/i386at/lpr.h @@ -0,0 +1,60 @@ +/* + * Mach Operating System + * Copyright (c) 1991,1990 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + * Parallel port printer driver v1.0 + * All rights reserved. + */ + +#ifndef _LPRREG_H_ +#define _LPRREG_H_ + +#define DATA(addr) (addr + 0) +#define STATUS(addr) (addr + 1) +#define INTR_ENAB(addr) (addr + 2) + +extern void lprintr(int unit); +int lprprobe(int port, struct bus_device *dev); +void lprstop(struct tty *tp, int flags); +void lprstart(struct tty *tp); +void lprattach(struct bus_device *dev); + +io_return_t +lprgetstat( + dev_t dev, + int flavor, + int *data, + natural_t *count); + +io_return_t +lprsetstat( + dev_t dev, + int flavor, + int *data, + natural_t count); + +void lprpr_addr(unsigned short addr); + +#endif /* _LPRREG_H_ */ diff --git a/i386/i386at/lprreg.h b/i386/i386at/lprreg.h deleted file mode 100644 index 1fb6230..0000000 --- a/i386/i386at/lprreg.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Mach Operating System - * Copyright (c) 1991,1990 Carnegie Mellon University - * All Rights Reserved. - * - * Permission to use, copy, modify and distribute this software and its - * documentation is hereby granted, provided that both the copyright - * notice and this permission notice appear in all copies of the - * software, derivative works or modified versions, and any portions - * thereof, and that both notices appear in supporting documentation. - * - * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" - * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR - * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * - * Carnegie Mellon requests users of this software to return to - * - * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU - * School of Computer Science - * Carnegie Mellon University - * Pittsburgh PA 15213-3890 - * - * any improvements or extensions that they make and grant Carnegie Mellon - * the rights to redistribute these changes. - */ -/* - * Parallel port printer driver v1.0 - * All rights reserved. - */ - -#ifndef _LPRREG_H_ -#define _LPRREG_H_ - -#define DATA(addr) (addr + 0) -#define STATUS(addr) (addr + 1) -#define INTR_ENAB(addr) (addr + 2) - -#endif /* _LPRREG_H_ */ -- cgit v1.2.3