diff options
author | Niklas Hallqvist <niklas@cvs.openbsd.org> | 1996-05-02 06:44:48 +0000 |
---|---|---|
committer | Niklas Hallqvist <niklas@cvs.openbsd.org> | 1996-05-02 06:44:48 +0000 |
commit | a1ab0133973a053ec8cb7034b5f525c772d2c6d6 (patch) | |
tree | 348052b6165a33d50f05b52e0989ec9095b81452 /sys/arch/amiga/dev/par.c | |
parent | 357d854e83a35ee1bdb134546c9f0e8b086a8833 (diff) |
Sync with NetBSD 9600430. The port has gone over a major -Wall treat
Diffstat (limited to 'sys/arch/amiga/dev/par.c')
-rw-r--r-- | sys/arch/amiga/dev/par.c | 71 |
1 files changed, 49 insertions, 22 deletions
diff --git a/sys/arch/amiga/dev/par.c b/sys/arch/amiga/dev/par.c index 2021f3617e9..6ae89c2e069 100644 --- a/sys/arch/amiga/dev/par.c +++ b/sys/arch/amiga/dev/par.c @@ -1,5 +1,5 @@ -/* $OpenBSD: par.c,v 1.2 1996/04/21 22:15:41 deraadt Exp $ */ -/* $NetBSD: par.c,v 1.12 1996/03/17 01:17:51 thorpej Exp $ */ +/* $OpenBSD: par.c,v 1.3 1996/05/02 06:44:24 niklas Exp $ */ +/* $NetBSD: par.c,v 1.13 1996/04/21 21:12:18 veego Exp $ */ /* * Copyright (c) 1982, 1990 The Regents of the University of California. @@ -50,11 +50,14 @@ #include <sys/malloc.h> #include <sys/file.h> #include <sys/systm.h> +#include <sys/proc.h> #include <amiga/amiga/device.h> #include <amiga/amiga/cia.h> #include <amiga/dev/parioctl.h> +#include <sys/conf.h> +#include <machine/conf.h> struct par_softc { int sc_flags; @@ -85,6 +88,13 @@ int pardebug = 0; #define PDB_NOCHECK 0x80 #endif +int parrw __P((dev_t, struct uio *)); +int parhztoms __P((int)); +int parmstohz __P((int)); +int parsend __P((u_char *, int)); +int parreceive __P((u_char *, int)); +int parsendch __P((u_char)); + void partimo __P((void *)); void parstart __P((void *)); void parintr __P((void *)); @@ -127,8 +137,12 @@ parattach(pdp, dp, auxp) printf("\n"); } -paropen(dev, flags) +int +paropen(dev, flags, mode, p) dev_t dev; + int flags; + int mode; + struct proc *p; { int unit = UNIT(dev); struct par_softc *sc = getparsp(unit); @@ -164,8 +178,12 @@ paropen(dev, flags) return(0); } -parclose(dev, flags) - dev_t dev; +int +parclose(dev, flags, mode, p) + dev_t dev; + int flags; + int mode; + struct proc *p; { int unit = UNIT(dev); struct par_softc *sc = getparsp(unit); @@ -215,30 +233,37 @@ partimo(arg) wakeup(sc); } -parread(dev, uio) - dev_t dev; - struct uio *uio; +int +parread(dev, uio, flags) + dev_t dev; + struct uio *uio; + int flags; { #ifdef DEBUG - if (pardebug & PDB_FOLLOW) - printf("parread(%x, %x)\n", dev, uio); + if (pardebug & PDB_FOLLOW) + printf("parread(%x, %p)\n", dev, uio); #endif - return (parrw(dev, uio)); + return (parrw(dev, uio)); } -parwrite(dev, uio) - dev_t dev; - struct uio *uio; + +int +parwrite(dev, uio, flags) + dev_t dev; + struct uio *uio; + int flags; { #ifdef DEBUG - if (pardebug & PDB_FOLLOW) - printf("parwrite(%x, %x)\n", dev, uio); + if (pardebug & PDB_FOLLOW) + printf("parwrite(%x, %p)\n", dev, uio); #endif - return (parrw(dev, uio)); + return (parrw(dev, uio)); } + +int parrw(dev, uio) dev_t dev; register struct uio *uio; @@ -251,6 +276,8 @@ parrw(dev, uio) int buflen; char *buf; + len = 0; + cnt = 0; if (!!(sc->sc_flags & PARF_OREAD) ^ (uio->uio_rw == UIO_READ)) return EINVAL; @@ -259,7 +286,7 @@ parrw(dev, uio) #ifdef DEBUG if (pardebug & (PDB_FOLLOW|PDB_IO)) - printf("parrw(%x, %x, %c): burst %d, timo %d, resid %x\n", + printf("parrw(%x, %p, %c): burst %d, timo %d, resid %x\n", dev, uio, uio->uio_rw == UIO_READ ? 'R' : 'W', sc->sc_burst, sc->sc_timo, uio->uio_resid); #endif @@ -327,7 +354,7 @@ again: #endif #ifdef DEBUG if (pardebug & PDB_IO) - printf("parrw: %s(%x, %d) -> %d\n", + printf("parrw: %s(%p, %d) -> %d\n", uio->uio_rw == UIO_READ ? "recv" : "send", cp, len, cnt); #endif splx(s); @@ -367,7 +394,7 @@ again: { sc->sc_flags |= PARF_DELAY; timeout(parstart, (void *)unit, sc->sc_delay); - error = tsleep(sc, PCATCH|PZERO-1, "par-cdelay", 0); + error = tsleep(sc, PCATCH | (PZERO - 1), "par-cdelay", 0); if (error) { splx(s); @@ -556,7 +583,7 @@ parsendch (ch) /* it's quite important that a parallel putc can be interrupted, given the possibility to lock a printer in an offline condition.. */ - if (error = tsleep(parintr, PCATCH|PZERO-1, "parsendch", 0)) + if ((error = tsleep(parintr, PCATCH | (PZERO - 1), "parsendch", 0)) > 0) { #ifdef DEBUG if (pardebug & PDB_INTERRUPT) @@ -600,7 +627,7 @@ parsend (buf, len) ciaa.ddrb = 0xff; for (; len; len--, buf++) - if (err = parsendch (*buf)) + if ((err = parsendch (*buf)) != 0) return err < 0 ? -EINTR : -err; /* either all or nothing.. */ |