diff options
author | wollman <wollman@FreeBSD.org> | 1993-11-25 01:38:01 +0000 |
---|---|---|
committer | wollman <wollman@FreeBSD.org> | 1993-11-25 01:38:01 +0000 |
commit | 8e24073a9b2dcc5fd2bcd719dd679f029d4818cb (patch) | |
tree | 5f254571daeb319e5d462e9932f7aff4e6b7ee40 /sys/isa | |
parent | 5465ba6a252350e2c96e04cb61af6d77a3d8d66e (diff) | |
download | FreeBSD-src-8e24073a9b2dcc5fd2bcd719dd679f029d4818cb.zip FreeBSD-src-8e24073a9b2dcc5fd2bcd719dd679f029d4818cb.tar.gz |
Make the LINT kernel compile with -W -Wreturn-type -Wcomment -Werror, and
add same (sans -Werror) to Makefile for future compilations.
Diffstat (limited to 'sys/isa')
-rw-r--r-- | sys/isa/atrtc.c | 19 | ||||
-rw-r--r-- | sys/isa/fd.c | 87 | ||||
-rw-r--r-- | sys/isa/sio.c | 39 |
3 files changed, 79 insertions, 66 deletions
diff --git a/sys/isa/atrtc.c b/sys/isa/atrtc.c index 133f2d1..836bff0 100644 --- a/sys/isa/atrtc.c +++ b/sys/isa/atrtc.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)clock.c 7.2 (Berkeley) 5/12/91 - * $Id: clock.c,v 1.2 1993/10/16 13:45:44 rgrimes Exp $ + * $Id: clock.c,v 1.3 1993/11/04 01:56:31 ache Exp $ */ /* @@ -56,7 +56,11 @@ #define TIMER_FREQ 1193182 /* XXX - should be in isa.h */ #endif -startrtclock() { +static void findcpuspeed(void); + +void +startrtclock() +{ int s; findcpuspeed(); /* use the clock (while it's free) @@ -84,6 +88,7 @@ startrtclock() { unsigned int delaycount; /* calibrated loop variable (1 millisecond) */ #define FIRST_GUESS 0x2000 +static void findcpuspeed() { unsigned char low; @@ -107,8 +112,9 @@ findcpuspeed() /* convert 2 digit BCD number */ +int bcd(i) -int i; + int i; { return ((i/16)*10 + (i%16)); } @@ -157,6 +163,7 @@ int m,leap; * Initialize the time of day register, based on the time base which is, e.g. * from a filesystem. */ +void inittodr(base) time_t base; { @@ -217,6 +224,7 @@ test_inittodr(base) /* * Restart the clock. */ +void resettodr() { } @@ -226,7 +234,10 @@ resettodr() */ #define V(s) __CONCAT(V, s) extern V(clk)(); -enablertclock() { + +void +enablertclock() +{ setidt(ICU_OFFSET+0, &V(clk), SDT_SYS386IGT, SEL_KPL); INTREN(IRQ0); } diff --git a/sys/isa/fd.c b/sys/isa/fd.c index c287ef1..0cde9c6 100644 --- a/sys/isa/fd.c +++ b/sys/isa/fd.c @@ -35,7 +35,7 @@ * SUCH DAMAGE. * * from: @(#)fd.c 7.4 (Berkeley) 5/25/91 - * $Id: fd.c,v 1.5 1993/09/15 23:27:45 rgrimes Exp $ + * $Id: fd.c,v 1.6 1993/09/23 15:22:57 rgrimes Exp $ * */ @@ -45,6 +45,7 @@ #include "param.h" #include "dkbad.h" #include "systm.h" +#include "kernel.h" #include "conf.h" #include "file.h" #include "ioctl.h" @@ -175,18 +176,20 @@ char *fdstates[] = int fd_debug = 1; #define TRACE0(arg) if(fd_debug) printf(arg) #define TRACE1(arg1,arg2) if(fd_debug) printf(arg1,arg2) -#else DEBUG +#else /* DEBUG */ #define TRACE0(arg) #define TRACE1(arg1,arg2) -#endif DEBUG +#endif /* DEBUG */ -extern int hz; -/* state needed for current transfer */ +static void fdstart(fdcu_t); +void fdintr(fdcu_t); +static void fd_turnoff(caddr_t, int); /****************************************************************************/ /* autoconfiguration stuff */ /****************************************************************************/ -int fdprobe(), fdattach(), fd_turnoff(); +static int fdprobe(struct isa_device *); +static int fdattach(struct isa_device *); struct isa_driver fddriver = { fdprobe, fdattach, "fd", @@ -195,8 +198,9 @@ struct isa_driver fddriver = { /* * probe for existance of controller */ +int fdprobe(dev) -struct isa_device *dev; + struct isa_device *dev; { fdcu_t fdcu = dev->id_unit; if(fdc_data[fdcu].flags & FDC_ATTACHED) @@ -220,8 +224,9 @@ struct isa_device *dev; /* * wire controller into system, look for floppy units */ +int fdattach(dev) -struct isa_device *dev; + struct isa_device *dev; { unsigned fdt,st0, cyl; int hdr; @@ -285,17 +290,18 @@ struct isa_device *dev; } fdt <<= 4; - fd_turnoff(fdu); + fd_turnoff((caddr_t)fdu, 0); hdr = 1; } /* Set transfer to 500kbps */ outb(fdc->baseport+fdctl,0); /*XXX*/ + return 1; } int fdsize(dev) -dev_t dev; + dev_t dev; { return(0); } @@ -303,8 +309,7 @@ dev_t dev; /****************************************************************************/ /* fdstrategy */ /****************************************************************************/ -fdstrategy(bp) - register struct buf *bp; /* IO operation to perform */ +void fdstrategy(struct buf *bp) { register struct buf *dp,*dp0,*dp1; long nblocks,blknum; @@ -359,6 +364,7 @@ bad: /* motor control stuff */ /* remember to not deselect the drive we're working on */ /****************************************************************************/ +void set_motor(fdcu, fdu, reset) fdcu_t fdcu; fdu_t fdu; @@ -389,9 +395,10 @@ set_motor(fdcu, fdu, reset) | (m1 ? FDO_MOEN1 : 0))); } -fd_turnoff(fdu) - fdu_t fdu; +static void +fd_turnoff(caddr_t arg1, int arg2) { + fdu_t fdu = (fdu_t)arg1; int s; fd_p fd = fd_data + fdu; @@ -401,9 +408,10 @@ fd_turnoff(fdu) splx(s); } -fd_motor_on(fdu) - fdu_t fdu; +void +fd_motor_on(caddr_t arg1, int arg2) { + fdu_t fdu = (fdu_t)arg1; int s; fd_p fd = fd_data + fdu; @@ -416,6 +424,9 @@ fd_motor_on(fdu) splx(s); } +static void fd_turnon1(fdu_t); + +void fd_turnon(fdu) fdu_t fdu; { @@ -424,12 +435,12 @@ fd_turnon(fdu) { fd_turnon1(fdu); fd->flags |= FD_MOTOR_WAIT; - timeout(fd_motor_on,fdu,hz); /* in 1 sec its ok */ + timeout(fd_motor_on, (caddr_t)fdu, hz); /* in 1 sec its ok */ } } -fd_turnon1(fdu) - fdu_t fdu; +static void +fd_turnon1(fdu_t fdu) { fd_p fd = fd_data + fdu; fd->flags |= FD_MOTOR; @@ -459,6 +470,7 @@ in_fdc(fdcu) #endif } +int out_fdc(fdcu, x) fdcu_t fdcu; int x; @@ -485,6 +497,7 @@ out_fdc(fdcu, x) /****************************************************************************/ /* fdopen/fdclose */ /****************************************************************************/ +int Fdopen(dev, flags) dev_t dev; int flags; @@ -501,8 +514,10 @@ Fdopen(dev, flags) return 0; } +int fdclose(dev, flags) dev_t dev; + int flags; { fdu_t fdu = FDUNIT(minor(dev)); fd_data[fdu].flags &= ~FD_OPEN; @@ -519,6 +534,7 @@ fdclose(dev, flags) * If the controller is already busy, we need do nothing, as it * * will pick up our work when the present work completes * \***************************************************************/ +static void fdstart(fdcu) fdcu_t fdcu; { @@ -534,9 +550,10 @@ fdstart(fdcu) splx(s); } -fd_timeout(fdcu) - fdcu_t fdcu; +static void +fd_timeout(caddr_t arg1, int arg2) { + fdcu_t fdcu = (fdcu_t)arg1; fdu_t fdu = fdc_data[fdcu].fdu; int st0, st3, cyl; struct buf *dp,*bp; @@ -580,9 +597,10 @@ fd_timeout(fdcu) } /* just ensure it has the right spl */ -fd_pseudointr(fdcu) - fdcu_t fdcu; +static void +fd_pseudointr(caddr_t arg1, int arg2) { + fdcu_t fdcu = (fdcu_t)arg1; int s; s = splbio(); fdintr(fdcu); @@ -594,22 +612,24 @@ fd_pseudointr(fdcu) * keep calling the state machine until it returns a 0 * * ALWAYS called at SPLBIO * \***********************************************************************/ -fdintr(fdcu) - fdcu_t fdcu; +void +fdintr(fdcu_t fdcu) { fdc_p fdc = fdc_data + fdcu; - while(fdstate(fdcu, fdc)); + while(fdstate(fdcu, fdc)) + ; } /***********************************************************************\ * The controller state machine. * * if it returns a non zero value, it should be called again immediatly * \***********************************************************************/ -int fdstate(fdcu, fdc) +int +fdstate(fdcu, fdc) fdcu_t fdcu; fdc_p fdc; { - int read,head,trac,sec,i,s,sectrac,cyl,st0; + int read, head, trac, sec = 0, i = 0, s, sectrac, cyl, st0; unsigned long blknum; fdu_t fdu = fdc->fdu; fd_p fd; @@ -645,7 +665,7 @@ int fdstate(fdcu, fdc) TRACE1("[%s]",fdstates[fdc->state]); TRACE1("(0x%x)",fd->flags); untimeout(fd_turnoff, fdu); - timeout(fd_turnoff,fdu,4 * hz); + timeout(fd_turnoff, (caddr_t)fdu, 4 * hz); switch (fdc->state) { case DEVIDLE: @@ -689,12 +709,12 @@ int fdstate(fdcu, fdc) out_fdc(fdcu,bp->b_cylin * fd->ft->steptrac); fd->track = -2; fdc->state = SEEKWAIT; - timeout(fd_timeout,fdcu,2 * hz); + timeout(fd_timeout, (caddr_t)fdcu, 2 * hz); return(0); /* will return later */ case SEEKWAIT: untimeout(fd_timeout,fdcu); /* allow heads to settle */ - timeout(fd_pseudointr,fdcu,hz/50); + timeout(fd_pseudointr, (caddr_t)fdcu, hz / 50); fdc->state = SEEKCOMPLETE; return(0); /* will return later */ break; @@ -743,7 +763,7 @@ int fdstate(fdcu, fdc) out_fdc(fdcu,fd->ft->gap); /* gap size */ out_fdc(fdcu,fd->ft->datalen); /* data length */ fdc->state = IOCOMPLETE; - timeout(fd_timeout,fdcu,2 * hz); + timeout(fd_timeout, (caddr_t)fdcu, 2 * hz); return(0); /* will return later */ case IOCOMPLETE: /* IO DONE, post-analyze */ untimeout(fd_timeout,fdcu); @@ -800,7 +820,7 @@ int fdstate(fdcu, fdc) return(0); /* will return later */ case RECALWAIT: /* allow heads to settle */ - timeout(fd_pseudointr,fdcu,hz/30); + timeout(fd_pseudointr, (caddr_t)fdcu, hz / 30); fdc->state = RECALCOMPLETE; return(0); /* will return later */ case RECALCOMPLETE: @@ -848,6 +868,7 @@ int fdstate(fdcu, fdc) return(1); /* Come back immediatly to new state */ } +int retrier(fdcu) fdcu_t fdcu; { diff --git a/sys/isa/sio.c b/sys/isa/sio.c index 45596ed..39f2e59 100644 --- a/sys/isa/sio.c +++ b/sys/isa/sio.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)com.c 7.5 (Berkeley) 5/16/91 - * $Id: sio.c,v 1.14 1993/11/14 23:29:01 ache Exp $ + * $Id: sio.c,v 1.15 1993/11/17 23:38:23 ache Exp $ */ #include "sio.h" @@ -196,13 +196,6 @@ struct com_s { u_char ibuf2[2 * RS_IBUFSIZE]; }; -/* XXX - these functions ought to be declared in systm.h. */ -#define nonint int -nonint timeout __P((timeout_func_t func, caddr_t arg, int t)); -int tsleep __P((caddr_t chan, int pri, char *wmesg, int timo)); -int ttnread __P((struct tty *tp)); -nonint wakeup __P((caddr_t chan)); - /* * These functions in the com module ought to be declared (with a prototype) * in a com-driver system header. The void ones may need to be int to match @@ -223,23 +216,12 @@ void siocnputc __P((Dev_t dev, int c)); int sioopen __P((Dev_t dev, int oflags, int devtype, struct proc *p)); /* - * sioopen gets compared to the d_open entry in struct cdevsw. d_open and - * other functions are declared in <sys/conf.h> with short types like dev_t - * in the prototype. Such declarations are broken because they vary with - * __P (significantly in theory - the compiler is allowed to push a short - * arg if it has seen the prototype; insignificantly in practice - gcc - * doesn't push short args and it would be slower on 386's to do so). - * * Also, most of the device switch functions are still declared old-style * so they take a Dev_t arg and shorten it to a dev_t. It would be simpler * and faster if dev_t's were always promoted (to ints or whatever) as * early as possible. - * - * Until <sys/conf.h> is fixed, we cast sioopen to the following `wrong' type - * when comparing it to the d_open entry just to avoid compiler warnings. */ -typedef int (*bogus_open_t) __P((dev_t dev, int oflags, int devtype, - struct proc *p)); + int sioread __P((Dev_t dev, struct uio *uio, int ioflag)); int sioselect __P((Dev_t dev, int rw, struct proc *p)); void siostop __P((struct tty *tp, int rw)); @@ -257,8 +239,8 @@ static int commctl __P((struct com_s *com, int bits, int how)); static int comparam __P((struct tty *tp, struct termios *t)); static int sioprobe __P((struct isa_device *dev)); static void compoll __P((void)); -static int comstart __P((struct tty *tp)); -static nonint comwakeup __P((caddr_t chan, int ticks)); +static void comstart __P((struct tty *tp)); +static void comwakeup __P((caddr_t chan, int ticks)); static int tiocm_xxx2mcr __P((int tiocm_xxx)); /* table and macro for fast conversion from a unit number to its com struct */ @@ -724,7 +706,7 @@ bidir_open_top: out: splx(s); if (error == 0) - error = (*linesw[tp->t_line].l_open)(dev, tp); + error = (*linesw[tp->t_line].l_open)(dev, tp, 0); #ifdef COM_BIDIR /* wakeup sleepers */ @@ -1161,7 +1143,7 @@ compoll() s = spltty(); repeat: for (unit = 0; unit < NSIO; ++unit) { - u_char *buf; + u_char *buf = 0; u_char *ibuf; int incc; struct tty *tp; @@ -1447,7 +1429,7 @@ retry: return (0); } -static int /* XXX - should be void */ +static void comstart(tp) struct tty *tp; { @@ -1502,7 +1484,6 @@ comstart(tp) } out: splx(s); - return (1); } void @@ -1555,7 +1536,7 @@ commctl(com, bits, how) return (bits); } -static nonint +static void comwakeup(chan, ticks) caddr_t chan; int ticks; @@ -1577,7 +1558,7 @@ comwakeup(chan, ticks) enable_intr(); } } - return (0); + return; } void @@ -1601,7 +1582,7 @@ siocnprobe(cp) /* locate the major number */ for (commajor = 0; commajor < nchrdev; commajor++) - if (cdevsw[commajor].d_open == (bogus_open_t) sioopen) + if (cdevsw[commajor].d_open == sioopen) break; /* XXX: ick */ |