From ceec40c98f1865eeddf40b8de3570ed778e7c663 Mon Sep 17 00:00:00 2001 From: deraadt Date: Tue, 6 Jul 1993 06:06:26 +0000 Subject: [PATCH] clean up code for timeout/untimeout/wakeup prototypes. --- sys/arch/i386/isa/aha1542.c | 19 +++++++++++-------- sys/arch/i386/isa/clock.c | 4 +++- sys/arch/i386/isa/fd.c | 23 +++++++++++++---------- sys/arch/i386/isa/isa.c | 15 ++++++++------- sys/arch/i386/isa/pccons.c | 4 ++-- sys/dev/isa/aha1542.c | 19 +++++++++++-------- sys/dev/isa/isa.c | 15 ++++++++------- 7 files changed, 56 insertions(+), 43 deletions(-) diff --git a/sys/arch/i386/isa/aha1542.c b/sys/arch/i386/isa/aha1542.c index 1f5064e77beb..207b71b8d819 100644 --- a/sys/arch/i386/isa/aha1542.c +++ b/sys/arch/i386/isa/aha1542.c @@ -12,13 +12,16 @@ * on the understanding that TFS is not responsible for the correct * functioning of this software in any circumstances. * - * $Id: aha1542.c,v 1.11 1993/06/14 04:16:03 andrew Exp $ + * $Id: aha1542.c,v 1.12 1993/07/06 06:06:26 deraadt Exp $ */ /* * HISTORY * $Log: aha1542.c,v $ - * Revision 1.11 1993/06/14 04:16:03 andrew + * Revision 1.12 1993/07/06 06:06:26 deraadt + * clean up code for timeout/untimeout/wakeup prototypes. + * + * Revision 1.11 1993/06/14 04:16:03 andrew * Reduced bus-on time from the default of 11ms -> 9ms, to prevent floppy from * becoming data-starved during simultaneous fd & scsi activity. * @@ -666,7 +669,7 @@ aha_free_ccb(int unit, struct aha_ccb *ccb, int flags) * one to come free, starting with queued entries* */ if (!ccb->next) - wakeup(&aha_ccb_free[unit]); + wakeup( (caddr_t)&aha_ccb_free[unit]); if (!(flags & SCSI_NOMASK)) splx(opri); } @@ -689,7 +692,7 @@ aha_get_ccb(int unit, int flags) * to come free */ while ((!(rc = aha_ccb_free[unit])) && (!(flags & SCSI_NOSLEEP))) - sleep(&aha_ccb_free[unit], PRIBIO); + sleep((caddr_t)&aha_ccb_free[unit], PRIBIO); if (rc) { aha_ccb_free[unit] = aha_ccb_free[unit]->next; rc->flags = CCB_ACTIVE; @@ -1255,8 +1258,8 @@ aha_bus_speed_check(int unit, int speed) * put the test data into the buffer and calculate * it's address. Read it onto the board */ - strcpy(aha_scratch_buf,aha_test_string); - lto3b(KVTOPHYS(aha_scratch_buf),ad); + strcpy((char *)aha_scratch_buf, (char *)aha_test_string); + lto3b(KVTOPHYS(aha_scratch_buf), ad); aha_cmd(unit,3, 0, 0, (u_char *)0, AHA_WRITE_FIFO, ad[0], ad[1], ad[2]); @@ -1275,7 +1278,7 @@ aha_bus_speed_check(int unit, int speed) * return the correct value depending upon the result * if copy fails.. assume too fast */ - if(strcmp(aha_test_string,aha_scratch_buf)) + if(strcmp(aha_test_string, (char *)aha_scratch_buf)) return(0); return(aha_bus_speeds[speed].nsecs); } @@ -1415,5 +1418,5 @@ aha_timeout(int arg) } } splx(s); - timeout(aha_timeout, arg, SLEEPTIME); + timeout((timeout_t)aha_timeout, (caddr_t)arg, SLEEPTIME); } diff --git a/sys/arch/i386/isa/clock.c b/sys/arch/i386/isa/clock.c index 26575c4c9a31..9350e8c2d400 100644 --- a/sys/arch/i386/isa/clock.c +++ b/sys/arch/i386/isa/clock.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)clock.c 7.2 (Berkeley) 5/12/91 - * $Id: clock.c,v 1.10 1993/07/03 12:32:38 cgd Exp $ + * $Id: clock.c,v 1.11 1993/07/06 06:06:28 deraadt Exp $ */ /* @@ -50,6 +50,8 @@ #include "i386/isa/rtc.h" #include "i386/isa/timerreg.h" +void spinwait __P((int)); + /* XXX all timezone stuff should be moved out of the kernel */ #if 1 #define DAYST 119 diff --git a/sys/arch/i386/isa/fd.c b/sys/arch/i386/isa/fd.c index 426b5110dbae..1b0231233ec3 100644 --- a/sys/arch/i386/isa/fd.c +++ b/sys/arch/i386/isa/fd.c @@ -35,14 +35,17 @@ * SUCH DAMAGE. * * from: @(#)fd.c 7.4 (Berkeley) 5/25/91 - * $Id: fd.c,v 1.17 1993/06/29 19:12:44 deraadt Exp $ + * $Id: fd.c,v 1.18 1993/07/06 06:06:29 deraadt Exp $ * * Largely rewritten to handle multiple controllers and drives * By Julian Elischer, Sun Apr 4 16:34:33 WST 1993 */ /* * $Log: fd.c,v $ - * Revision 1.17 1993/06/29 19:12:44 deraadt + * Revision 1.18 1993/07/06 06:06:29 deraadt + * clean up code for timeout/untimeout/wakeup prototypes. + * + * Revision 1.17 1993/06/29 19:12:44 deraadt * uninitialized variable reported by * * Revision 1.16 1993/06/21 09:39:52 deraadt @@ -404,7 +407,7 @@ fdstrategy(bp) dp = &(fdc->head); s = splbio(); disksort(dp, bp); - untimeout(fd_turnoff,fdu); /* a good idea */ + untimeout((timeout_t)fd_turnoff, (caddr_t)fdu); /* a good idea */ fdstart(fdcu); splx(s); return; @@ -468,7 +471,7 @@ fd_turnon(fdu_t fdu) { fd_turnon1(fdu); fd->flags |= FD_MOTOR_WAIT; - timeout(fd_motor_on,fdu,hz); /* in 1 sec its ok */ + timeout((timeout_t)fd_motor_on, (caddr_t)fdu, hz); /* in 1 sec its ok */ } } @@ -668,8 +671,8 @@ int fdstate(fdcu_t fdcu, fdc_p fdc) TRACE1("fd%d",fdu); TRACE1("[%s]",fdstates[fdc->state]); TRACE1("(0x%x)",fd->flags); - untimeout(fd_turnoff, fdu); - timeout(fd_turnoff,fdu,4 * hz); + untimeout((timeout_t)fd_turnoff, (caddr_t)fdu); + timeout((timeout_t)fd_turnoff, (caddr_t)fdu, 4 * hz); switch (fdc->state) { case DEVIDLE: @@ -716,7 +719,7 @@ int fdstate(fdcu_t fdcu, fdc_p fdc) return(0); /* will return later */ case SEEKWAIT: /* allow heads to settle */ - timeout(fd_pseudointr,fdcu,hz/50); + timeout((timeout_t)fd_pseudointr, (caddr_t)fdcu, hz/50); fdc->state = SEEKCOMPLETE; return(0); /* will return later */ break; @@ -765,10 +768,10 @@ int fdstate(fdcu_t fdcu, fdc_p 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((timeout_t)fd_timeout, (caddr_t)fdcu, 2 * hz); return(0); /* will return later */ case IOCOMPLETE: /* IO DONE, post-analyze */ - untimeout(fd_timeout,fdcu); + untimeout((timeout_t)fd_timeout, (caddr_t)fdcu); for(i=0;i<7;i++) { fdc->status[i] = in_fdc(fdcu); @@ -822,7 +825,7 @@ int fdstate(fdcu_t fdcu, fdc_p fdc) return(0); /* will return later */ case RECALWAIT: /* allow heads to settle */ - timeout(fd_pseudointr,fdcu,hz/30); + timeout((timeout_t)fd_pseudointr, (caddr_t)fdcu, hz/30); fdc->state = RECALCOMPLETE; return(0); /* will return later */ case RECALCOMPLETE: diff --git a/sys/arch/i386/isa/isa.c b/sys/arch/i386/isa/isa.c index 31e9f9464cdb..38d1f7fa0e9e 100644 --- a/sys/arch/i386/isa/isa.c +++ b/sys/arch/i386/isa/isa.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)isa.c 7.2 (Berkeley) 5/13/91 - * $Id: isa.c,v 1.23 1993/07/06 00:31:52 cgd Exp $ + * $Id: isa.c,v 1.24 1993/07/06 06:06:31 deraadt Exp $ */ /* @@ -55,6 +55,7 @@ #include "uio.h" #include "syslog.h" #include "malloc.h" +#include "rlist.h" #include "machine/segments.h" #include "machine/cpufunc.h" #include "vm/vm.h" @@ -467,7 +468,7 @@ isa_allocphysmem(caddr_t va, unsigned length, void (*func)()) { isaphysmemunblock = func; while (isaphysmemflag & B_BUSY) { isaphysmemflag |= B_WANTED; - sleep(&isaphysmemflag, PRIBIO); + sleep((caddr_t)&isaphysmemflag, PRIBIO); } isaphysmemflag |= B_BUSY; @@ -484,7 +485,7 @@ isa_freephysmem(caddr_t va, unsigned length) { isaphysmemflag &= ~B_BUSY; if (isaphysmemflag & B_WANTED) { isaphysmemflag &= B_WANTED; - wakeup(&isaphysmemflag); + wakeup((caddr_t)&isaphysmemflag); if (isaphysmemunblock) (*isaphysmemunblock)(); } @@ -634,7 +635,7 @@ sysbeepstop(int f) outb(0x61, inb(0x61) & 0xFC); enable_intr(); if (f) - timeout(sysbeepstop, 0, f); + timeout((timeout_t)sysbeepstop, (caddr_t)0, f); else beeping = 0; @@ -648,8 +649,8 @@ sysbeep(int pitch, int period) static int last_pitch, last_period; if (beeping) { - untimeout(sysbeepstop, last_period/2); - untimeout(sysbeepstop, 0); + untimeout((timeout_t)sysbeepstop, (caddr_t)(last_period/2)); + untimeout((timeout_t)sysbeepstop, (caddr_t)0); } if (!beeping || last_pitch != pitch) { /* @@ -664,7 +665,7 @@ sysbeep(int pitch, int period) } last_pitch = pitch; beeping = last_period = period; - timeout(sysbeepstop, period/2, period); + timeout((timeout_t)sysbeepstop, (caddr_t)(period/2), period); splx(s); } diff --git a/sys/arch/i386/isa/pccons.c b/sys/arch/i386/isa/pccons.c index 2096c86ca11a..a505edcd0f8c 100644 --- a/sys/arch/i386/isa/pccons.c +++ b/sys/arch/i386/isa/pccons.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)pccons.c 5.11 (Berkeley) 5/21/91 - * $Id: pccons.c,v 1.21 1993/06/16 02:57:20 mycroft Exp $ + * $Id: pccons.c,v 1.22 1993/07/06 06:06:32 deraadt Exp $ */ /* @@ -614,7 +614,7 @@ cursor(int a) outb(addr_6845+1, 18); #endif FAT_CURSOR if (a == 0) - timeout(cursor, 0, hz/10); + timeout((timeout_t)cursor, (caddr_t)0, hz/10); #ifdef XSERVER /* 15 Aug 92*/ } #endif /* XSERVER */ diff --git a/sys/dev/isa/aha1542.c b/sys/dev/isa/aha1542.c index 1f5064e77beb..207b71b8d819 100644 --- a/sys/dev/isa/aha1542.c +++ b/sys/dev/isa/aha1542.c @@ -12,13 +12,16 @@ * on the understanding that TFS is not responsible for the correct * functioning of this software in any circumstances. * - * $Id: aha1542.c,v 1.11 1993/06/14 04:16:03 andrew Exp $ + * $Id: aha1542.c,v 1.12 1993/07/06 06:06:26 deraadt Exp $ */ /* * HISTORY * $Log: aha1542.c,v $ - * Revision 1.11 1993/06/14 04:16:03 andrew + * Revision 1.12 1993/07/06 06:06:26 deraadt + * clean up code for timeout/untimeout/wakeup prototypes. + * + * Revision 1.11 1993/06/14 04:16:03 andrew * Reduced bus-on time from the default of 11ms -> 9ms, to prevent floppy from * becoming data-starved during simultaneous fd & scsi activity. * @@ -666,7 +669,7 @@ aha_free_ccb(int unit, struct aha_ccb *ccb, int flags) * one to come free, starting with queued entries* */ if (!ccb->next) - wakeup(&aha_ccb_free[unit]); + wakeup( (caddr_t)&aha_ccb_free[unit]); if (!(flags & SCSI_NOMASK)) splx(opri); } @@ -689,7 +692,7 @@ aha_get_ccb(int unit, int flags) * to come free */ while ((!(rc = aha_ccb_free[unit])) && (!(flags & SCSI_NOSLEEP))) - sleep(&aha_ccb_free[unit], PRIBIO); + sleep((caddr_t)&aha_ccb_free[unit], PRIBIO); if (rc) { aha_ccb_free[unit] = aha_ccb_free[unit]->next; rc->flags = CCB_ACTIVE; @@ -1255,8 +1258,8 @@ aha_bus_speed_check(int unit, int speed) * put the test data into the buffer and calculate * it's address. Read it onto the board */ - strcpy(aha_scratch_buf,aha_test_string); - lto3b(KVTOPHYS(aha_scratch_buf),ad); + strcpy((char *)aha_scratch_buf, (char *)aha_test_string); + lto3b(KVTOPHYS(aha_scratch_buf), ad); aha_cmd(unit,3, 0, 0, (u_char *)0, AHA_WRITE_FIFO, ad[0], ad[1], ad[2]); @@ -1275,7 +1278,7 @@ aha_bus_speed_check(int unit, int speed) * return the correct value depending upon the result * if copy fails.. assume too fast */ - if(strcmp(aha_test_string,aha_scratch_buf)) + if(strcmp(aha_test_string, (char *)aha_scratch_buf)) return(0); return(aha_bus_speeds[speed].nsecs); } @@ -1415,5 +1418,5 @@ aha_timeout(int arg) } } splx(s); - timeout(aha_timeout, arg, SLEEPTIME); + timeout((timeout_t)aha_timeout, (caddr_t)arg, SLEEPTIME); } diff --git a/sys/dev/isa/isa.c b/sys/dev/isa/isa.c index 31e9f9464cdb..38d1f7fa0e9e 100644 --- a/sys/dev/isa/isa.c +++ b/sys/dev/isa/isa.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)isa.c 7.2 (Berkeley) 5/13/91 - * $Id: isa.c,v 1.23 1993/07/06 00:31:52 cgd Exp $ + * $Id: isa.c,v 1.24 1993/07/06 06:06:31 deraadt Exp $ */ /* @@ -55,6 +55,7 @@ #include "uio.h" #include "syslog.h" #include "malloc.h" +#include "rlist.h" #include "machine/segments.h" #include "machine/cpufunc.h" #include "vm/vm.h" @@ -467,7 +468,7 @@ isa_allocphysmem(caddr_t va, unsigned length, void (*func)()) { isaphysmemunblock = func; while (isaphysmemflag & B_BUSY) { isaphysmemflag |= B_WANTED; - sleep(&isaphysmemflag, PRIBIO); + sleep((caddr_t)&isaphysmemflag, PRIBIO); } isaphysmemflag |= B_BUSY; @@ -484,7 +485,7 @@ isa_freephysmem(caddr_t va, unsigned length) { isaphysmemflag &= ~B_BUSY; if (isaphysmemflag & B_WANTED) { isaphysmemflag &= B_WANTED; - wakeup(&isaphysmemflag); + wakeup((caddr_t)&isaphysmemflag); if (isaphysmemunblock) (*isaphysmemunblock)(); } @@ -634,7 +635,7 @@ sysbeepstop(int f) outb(0x61, inb(0x61) & 0xFC); enable_intr(); if (f) - timeout(sysbeepstop, 0, f); + timeout((timeout_t)sysbeepstop, (caddr_t)0, f); else beeping = 0; @@ -648,8 +649,8 @@ sysbeep(int pitch, int period) static int last_pitch, last_period; if (beeping) { - untimeout(sysbeepstop, last_period/2); - untimeout(sysbeepstop, 0); + untimeout((timeout_t)sysbeepstop, (caddr_t)(last_period/2)); + untimeout((timeout_t)sysbeepstop, (caddr_t)0); } if (!beeping || last_pitch != pitch) { /* @@ -664,7 +665,7 @@ sysbeep(int pitch, int period) } last_pitch = pitch; beeping = last_period = period; - timeout(sysbeepstop, period/2, period); + timeout((timeout_t)sysbeepstop, (caddr_t)(period/2), period); splx(s); }