Fix warnings of printf(9) format.diff -r1.21 -r1.22 src/sys/dev/gpib/ct.c
(tsutsui)
--- src/sys/dev/gpib/ct.c 2009/05/12 14:21:58 1.21
+++ src/sys/dev/gpib/ct.c 2009/09/12 18:44:36 1.22
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: ct.c,v 1.21 2009/05/12 14:21:58 cegger Exp $ */ | 1 | /* $NetBSD: ct.c,v 1.22 2009/09/12 18:44:36 tsutsui Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 1996-2003 The NetBSD Foundation, Inc. | 4 | * Copyright (c) 1996-2003 The NetBSD Foundation, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software contributed to The NetBSD Foundation | 7 | * This code is derived from software contributed to The NetBSD Foundation | |
8 | * by Jason R. Thorpe. | 8 | * by Jason R. Thorpe. | |
9 | * | 9 | * | |
10 | * Redistribution and use in source and binary forms, with or without | 10 | * Redistribution and use in source and binary forms, with or without | |
11 | * modification, are permitted provided that the following conditions | 11 | * modification, are permitted provided that the following conditions | |
12 | * are met: | 12 | * are met: | |
13 | * 1. Redistributions of source code must retain the above copyright | 13 | * 1. Redistributions of source code must retain the above copyright | |
14 | * notice, this list of conditions and the following disclaimer. | 14 | * notice, this list of conditions and the following disclaimer. | |
@@ -111,27 +111,27 @@ | @@ -111,27 +111,27 @@ | |||
111 | * | 111 | * | |
112 | * Reminder: | 112 | * Reminder: | |
113 | * C_CC bit (character count option) when used in the CS/80 command | 113 | * C_CC bit (character count option) when used in the CS/80 command | |
114 | * 'set options' will cause the tape not to stream. | 114 | * 'set options' will cause the tape not to stream. | |
115 | * | 115 | * | |
116 | * TODO: | 116 | * TODO: | |
117 | * make filesystem compatible | 117 | * make filesystem compatible | |
118 | * make block mode work according to mtio(4) spec. (if possible) | 118 | * make block mode work according to mtio(4) spec. (if possible) | |
119 | * merge with CS/80 disk driver | 119 | * merge with CS/80 disk driver | |
120 | * finish support of HP9145 | 120 | * finish support of HP9145 | |
121 | */ | 121 | */ | |
122 | 122 | |||
123 | #include <sys/cdefs.h> | 123 | #include <sys/cdefs.h> | |
124 | __KERNEL_RCSID(0, "$NetBSD: ct.c,v 1.21 2009/05/12 14:21:58 cegger Exp $"); | 124 | __KERNEL_RCSID(0, "$NetBSD: ct.c,v 1.22 2009/09/12 18:44:36 tsutsui Exp $"); | |
125 | 125 | |||
126 | #include <sys/param.h> | 126 | #include <sys/param.h> | |
127 | #include <sys/systm.h> | 127 | #include <sys/systm.h> | |
128 | #include <sys/buf.h> | 128 | #include <sys/buf.h> | |
129 | #include <sys/bufq.h> | 129 | #include <sys/bufq.h> | |
130 | #include <sys/conf.h> | 130 | #include <sys/conf.h> | |
131 | #include <sys/device.h> | 131 | #include <sys/device.h> | |
132 | #include <sys/ioctl.h> | 132 | #include <sys/ioctl.h> | |
133 | #include <sys/mtio.h> | 133 | #include <sys/mtio.h> | |
134 | #include <sys/proc.h> | 134 | #include <sys/proc.h> | |
135 | #include <sys/tprintf.h> | 135 | #include <sys/tprintf.h> | |
136 | 136 | |||
137 | #include <dev/gpib/ctreg.h> /* XXX must be before cs80busvar.h ATM */ | 137 | #include <dev/gpib/ctreg.h> /* XXX must be before cs80busvar.h ATM */ | |
@@ -475,27 +475,28 @@ ctcommand(dev_t dev, int cmd, int cnt) | @@ -475,27 +475,28 @@ ctcommand(dev_t dev, int cmd, int cnt) | |||
475 | } | 475 | } | |
476 | bp->b_flags = 0; | 476 | bp->b_flags = 0; | |
477 | sc->sc_flags &= ~CTF_CMD; | 477 | sc->sc_flags &= ~CTF_CMD; | |
478 | if (nbp) | 478 | if (nbp) | |
479 | brelse(nbp, 0); | 479 | brelse(nbp, 0); | |
480 | } | 480 | } | |
481 | 481 | |||
482 | void | 482 | void | |
483 | ctstrategy(struct buf *bp) | 483 | ctstrategy(struct buf *bp) | |
484 | { | 484 | { | |
485 | struct ct_softc *sc; | 485 | struct ct_softc *sc; | |
486 | int s; | 486 | int s; | |
487 | 487 | |||
488 | DPRINTF(CDB_FOLLOW, ("cdstrategy(%p): dev %x, bn %x, bcount %lx, %c\n", | 488 | DPRINTF(CDB_FOLLOW, ("cdstrategy(%p): dev %" PRIx64 ", bn %" PRIx64 | |
489 | ", bcount %x, %c\n", | |||
489 | bp, bp->b_dev, bp->b_blkno, bp->b_bcount, | 490 | bp, bp->b_dev, bp->b_blkno, bp->b_bcount, | |
490 | (bp->b_flags & B_READ) ? 'R' : 'W')); | 491 | (bp->b_flags & B_READ) ? 'R' : 'W')); | |
491 | 492 | |||
492 | sc = device_lookup_private(&ct_cd, CTUNIT(bp->b_dev)); | 493 | sc = device_lookup_private(&ct_cd, CTUNIT(bp->b_dev)); | |
493 | 494 | |||
494 | s = splbio(); | 495 | s = splbio(); | |
495 | bufq_put(sc->sc_tab, bp); | 496 | bufq_put(sc->sc_tab, bp); | |
496 | if (sc->sc_active == 0) { | 497 | if (sc->sc_active == 0) { | |
497 | sc->sc_active = 1; | 498 | sc->sc_active = 1; | |
498 | ctustart(sc); | 499 | ctustart(sc); | |
499 | } | 500 | } | |
500 | splx(s); | 501 | splx(s); | |
501 | } | 502 | } | |
@@ -631,27 +632,27 @@ cteof(struct ct_softc *sc, struct buf *b | @@ -631,27 +632,27 @@ cteof(struct ct_softc *sc, struct buf *b | |||
631 | * EOT on a write is an error. | 632 | * EOT on a write is an error. | |
632 | */ | 633 | */ | |
633 | if ((bp->b_flags & B_READ) == 0) { | 634 | if ((bp->b_flags & B_READ) == 0) { | |
634 | bp->b_resid = bp->b_bcount; | 635 | bp->b_resid = bp->b_bcount; | |
635 | bp->b_error = ENOSPC; | 636 | bp->b_error = ENOSPC; | |
636 | sc->sc_flags |= CTF_EOT; | 637 | sc->sc_flags |= CTF_EOT; | |
637 | return; | 638 | return; | |
638 | } | 639 | } | |
639 | /* | 640 | /* | |
640 | * Use returned block position to determine how many blocks | 641 | * Use returned block position to determine how many blocks | |
641 | * we really read and update b_resid. | 642 | * we really read and update b_resid. | |
642 | */ | 643 | */ | |
643 | blks = sc->sc_stat.c_blk - sc->sc_blkno - 1; | 644 | blks = sc->sc_stat.c_blk - sc->sc_blkno - 1; | |
644 | DPRINTF(CDB_FILES, ("cteof: bc %ld oblk %d nblk %d read %ld, resid %ld\n", | 645 | DPRINTF(CDB_FILES, ("cteof: bc %d oblk %d nblk %d read %ld, resid %ld\n", | |
645 | bp->b_bcount, sc->sc_blkno, sc->sc_stat.c_blk, | 646 | bp->b_bcount, sc->sc_blkno, sc->sc_stat.c_blk, | |
646 | blks, bp->b_bcount - CTKTOB(blks))); | 647 | blks, bp->b_bcount - CTKTOB(blks))); | |
647 | if (blks == -1) { /* 9145 on EOF does not change sc_stat.c_blk */ | 648 | if (blks == -1) { /* 9145 on EOF does not change sc_stat.c_blk */ | |
648 | blks = 0; | 649 | blks = 0; | |
649 | sc->sc_blkno++; | 650 | sc->sc_blkno++; | |
650 | } | 651 | } | |
651 | else { | 652 | else { | |
652 | sc->sc_blkno = sc->sc_stat.c_blk; | 653 | sc->sc_blkno = sc->sc_stat.c_blk; | |
653 | } | 654 | } | |
654 | bp->b_resid = bp->b_bcount - CTKTOB(blks); | 655 | bp->b_resid = bp->b_bcount - CTKTOB(blks); | |
655 | /* | 656 | /* | |
656 | * If we are at physical EOV or were after an EOF, | 657 | * If we are at physical EOV or were after an EOF, | |
657 | * we are now at logical EOT. | 658 | * we are now at logical EOT. |
--- src/sys/dev/gpib/mt.c 2009/05/18 20:41:57 1.21
+++ src/sys/dev/gpib/mt.c 2009/09/12 18:44:36 1.22
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: mt.c,v 1.21 2009/05/18 20:41:57 ad Exp $ */ | 1 | /* $NetBSD: mt.c,v 1.22 2009/09/12 18:44:36 tsutsui Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 1996-2003 The NetBSD Foundation, Inc. | 4 | * Copyright (c) 1996-2003 The NetBSD Foundation, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software contributed to The NetBSD Foundation | 7 | * This code is derived from software contributed to The NetBSD Foundation | |
8 | * by Jason R. Thorpe. | 8 | * by Jason R. Thorpe. | |
9 | * | 9 | * | |
10 | * Redistribution and use in source and binary forms, with or without | 10 | * Redistribution and use in source and binary forms, with or without | |
11 | * modification, are permitted provided that the following conditions | 11 | * modification, are permitted provided that the following conditions | |
12 | * are met: | 12 | * are met: | |
13 | * 1. Redistributions of source code must retain the above copyright | 13 | * 1. Redistributions of source code must retain the above copyright | |
14 | * notice, this list of conditions and the following disclaimer. | 14 | * notice, this list of conditions and the following disclaimer. | |
@@ -104,27 +104,27 @@ | @@ -104,27 +104,27 @@ | |||
104 | * from: Utah $Hdr: rd.c 1.44 92/12/26$ | 104 | * from: Utah $Hdr: rd.c 1.44 92/12/26$ | |
105 | * | 105 | * | |
106 | * @(#)rd.c 8.2 (Berkeley) 5/19/94 | 106 | * @(#)rd.c 8.2 (Berkeley) 5/19/94 | |
107 | */ | 107 | */ | |
108 | 108 | |||
109 | /* | 109 | /* | |
110 | * Magnetic tape driver (HP7974a, HP7978a/b, HP7979a, HP7980a, HP7980xc) | 110 | * Magnetic tape driver (HP7974a, HP7978a/b, HP7979a, HP7980a, HP7980xc) | |
111 | * Original version contributed by Mt. Xinu. | 111 | * Original version contributed by Mt. Xinu. | |
112 | * Modified for 4.4BSD by Mark Davies and Andrew Vignaux, Department of | 112 | * Modified for 4.4BSD by Mark Davies and Andrew Vignaux, Department of | |
113 | * Computer Science, Victoria University of Wellington | 113 | * Computer Science, Victoria University of Wellington | |
114 | */ | 114 | */ | |
115 | 115 | |||
116 | #include <sys/cdefs.h> | 116 | #include <sys/cdefs.h> | |
117 | __KERNEL_RCSID(0, "$NetBSD: mt.c,v 1.21 2009/05/18 20:41:57 ad Exp $"); | 117 | __KERNEL_RCSID(0, "$NetBSD: mt.c,v 1.22 2009/09/12 18:44:36 tsutsui Exp $"); | |
118 | 118 | |||
119 | #include <sys/param.h> | 119 | #include <sys/param.h> | |
120 | #include <sys/systm.h> | 120 | #include <sys/systm.h> | |
121 | #include <sys/callout.h> | 121 | #include <sys/callout.h> | |
122 | #include <sys/buf.h> | 122 | #include <sys/buf.h> | |
123 | #include <sys/bufq.h> | 123 | #include <sys/bufq.h> | |
124 | #include <sys/ioctl.h> | 124 | #include <sys/ioctl.h> | |
125 | #include <sys/mtio.h> | 125 | #include <sys/mtio.h> | |
126 | #include <sys/file.h> | 126 | #include <sys/file.h> | |
127 | #include <sys/proc.h> | 127 | #include <sys/proc.h> | |
128 | #include <sys/tty.h> | 128 | #include <sys/tty.h> | |
129 | #include <sys/kernel.h> | 129 | #include <sys/kernel.h> | |
130 | #include <sys/tprintf.h> | 130 | #include <sys/tprintf.h> | |
@@ -945,28 +945,29 @@ mtintr(struct mt_softc *sc) | @@ -945,28 +945,29 @@ mtintr(struct mt_softc *sc) | |||
945 | sc->sc_flags |= MTF_ALIVE; | 945 | sc->sc_flags |= MTF_ALIVE; | |
946 | } | 946 | } | |
947 | } else { | 947 | } else { | |
948 | i = gpibrecv(sc->sc_ic, slave, MTT_BCNT, cmdbuf, 2); | 948 | i = gpibrecv(sc->sc_ic, slave, MTT_BCNT, cmdbuf, 2); | |
949 | if (i != 2) { | 949 | if (i != 2) { | |
950 | aprint_error_dev(&sc->sc_dev, "intr: can't get xfer length\n"); | 950 | aprint_error_dev(&sc->sc_dev, "intr: can't get xfer length\n"); | |
951 | goto error; | 951 | goto error; | |
952 | } | 952 | } | |
953 | i = (int) *((u_short *) cmdbuf); | 953 | i = (int) *((u_short *) cmdbuf); | |
954 | if (i <= bp->b_bcount) { | 954 | if (i <= bp->b_bcount) { | |
955 | if (i == 0) | 955 | if (i == 0) | |
956 | sc->sc_flags |= MTF_HITEOF; | 956 | sc->sc_flags |= MTF_HITEOF; | |
957 | bp->b_resid = bp->b_bcount - i; | 957 | bp->b_resid = bp->b_bcount - i; | |
958 | DPRINTF(MDB_ANY, ("%s intr: bcount %ld, resid %ld", | 958 | DPRINTF(MDB_ANY, ("%s intr: bcount %d, resid %d", | |
959 | device_xname(&sc->sc_dev), bp->b_bcount, bp->b_resid)); | 959 | device_xname(&sc->sc_dev), | |
960 | bp->b_bcount, bp->b_resid)); | |||
960 | } else { | 961 | } else { | |
961 | tprintf(sc->sc_ttyp, | 962 | tprintf(sc->sc_ttyp, | |
962 | "%s: record (%d) larger than wanted (%d)\n", | 963 | "%s: record (%d) larger than wanted (%d)\n", | |
963 | device_xname(&sc->sc_dev), i, bp->b_bcount); | 964 | device_xname(&sc->sc_dev), i, bp->b_bcount); | |
964 | error: | 965 | error: | |
965 | sc->sc_flags &= ~MTF_IO; | 966 | sc->sc_flags &= ~MTF_IO; | |
966 | bp->b_error = EIO; | 967 | bp->b_error = EIO; | |
967 | } | 968 | } | |
968 | } | 969 | } | |
969 | /* | 970 | /* | |
970 | * The operation is completely done. | 971 | * The operation is completely done. | |
971 | * Let the drive know with an END command. | 972 | * Let the drive know with an END command. | |
972 | */ | 973 | */ |
--- src/sys/dev/gpib/ppi.c 2009/09/12 18:43:03 1.18
+++ src/sys/dev/gpib/ppi.c 2009/09/12 18:44:36 1.19
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: ppi.c,v 1.18 2009/09/12 18:43:03 tsutsui Exp $ */ | 1 | /* $NetBSD: ppi.c,v 1.19 2009/09/12 18:44:36 tsutsui Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 1996-2003 The NetBSD Foundation, Inc. | 4 | * Copyright (c) 1996-2003 The NetBSD Foundation, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software contributed to The NetBSD Foundation | 7 | * This code is derived from software contributed to The NetBSD Foundation | |
8 | * by Jason R. Thorpe. | 8 | * by Jason R. Thorpe. | |
9 | * | 9 | * | |
10 | * Redistribution and use in source and binary forms, with or without | 10 | * Redistribution and use in source and binary forms, with or without | |
11 | * modification, are permitted provided that the following conditions | 11 | * modification, are permitted provided that the following conditions | |
12 | * are met: | 12 | * are met: | |
13 | * 1. Redistributions of source code must retain the above copyright | 13 | * 1. Redistributions of source code must retain the above copyright | |
14 | * notice, this list of conditions and the following disclaimer. | 14 | * notice, this list of conditions and the following disclaimer. | |
@@ -55,27 +55,27 @@ | @@ -55,27 +55,27 @@ | |||
55 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | 55 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
56 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | 56 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
57 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 57 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
58 | * SUCH DAMAGE. | 58 | * SUCH DAMAGE. | |
59 | * | 59 | * | |
60 | * @(#)ppi.c 8.1 (Berkeley) 6/16/93 | 60 | * @(#)ppi.c 8.1 (Berkeley) 6/16/93 | |
61 | */ | 61 | */ | |
62 | 62 | |||
63 | /* | 63 | /* | |
64 | * Printer/Plotter GPIB interface | 64 | * Printer/Plotter GPIB interface | |
65 | */ | 65 | */ | |
66 | 66 | |||
67 | #include <sys/cdefs.h> | 67 | #include <sys/cdefs.h> | |
68 | __KERNEL_RCSID(0, "$NetBSD: ppi.c,v 1.18 2009/09/12 18:43:03 tsutsui Exp $"); | 68 | __KERNEL_RCSID(0, "$NetBSD: ppi.c,v 1.19 2009/09/12 18:44:36 tsutsui Exp $"); | |
69 | 69 | |||
70 | #include <sys/param.h> | 70 | #include <sys/param.h> | |
71 | #include <sys/systm.h> | 71 | #include <sys/systm.h> | |
72 | #include <sys/callout.h> | 72 | #include <sys/callout.h> | |
73 | #include <sys/conf.h> | 73 | #include <sys/conf.h> | |
74 | #include <sys/device.h> | 74 | #include <sys/device.h> | |
75 | #include <sys/malloc.h> | 75 | #include <sys/malloc.h> | |
76 | #include <sys/proc.h> | 76 | #include <sys/proc.h> | |
77 | #include <sys/uio.h> | 77 | #include <sys/uio.h> | |
78 | 78 | |||
79 | #include <dev/gpib/gpibvar.h> | 79 | #include <dev/gpib/gpibvar.h> | |
80 | 80 | |||
81 | #include <dev/gpib/ppiio.h> | 81 | #include <dev/gpib/ppiio.h> | |
@@ -174,47 +174,47 @@ ppiattach(device_t parent, device_t self | @@ -174,47 +174,47 @@ ppiattach(device_t parent, device_t self | |||
174 | 174 | |||
175 | int | 175 | int | |
176 | ppiopen(dev_t dev, int flags, int fmt, struct lwp *l) | 176 | ppiopen(dev_t dev, int flags, int fmt, struct lwp *l) | |
177 | { | 177 | { | |
178 | struct ppi_softc *sc; | 178 | struct ppi_softc *sc; | |
179 | 179 | |||
180 | sc = device_lookup_private(&ppi_cd, UNIT(dev)); | 180 | sc = device_lookup_private(&ppi_cd, UNIT(dev)); | |
181 | if (sc == NULL) | 181 | if (sc == NULL) | |
182 | return (ENXIO); | 182 | return (ENXIO); | |
183 | 183 | |||
184 | if ((sc->sc_flags & PPIF_ALIVE) == 0) | 184 | if ((sc->sc_flags & PPIF_ALIVE) == 0) | |
185 | return (ENXIO); | 185 | return (ENXIO); | |
186 | 186 | |||
187 | DPRINTF(PDB_FOLLOW, ("ppiopen(%x, %x): flags %x\n", | 187 | DPRINTF(PDB_FOLLOW, ("ppiopen(%" PRIx64 ", %x): flags %x\n", | |
188 | dev, flags, sc->sc_flags)); | 188 | dev, flags, sc->sc_flags)); | |
189 | 189 | |||
190 | if (sc->sc_flags & PPIF_OPEN) | 190 | if (sc->sc_flags & PPIF_OPEN) | |
191 | return (EBUSY); | 191 | return (EBUSY); | |
192 | sc->sc_flags |= PPIF_OPEN; | 192 | sc->sc_flags |= PPIF_OPEN; | |
193 | sc->sc_burst = PPI_BURST; | 193 | sc->sc_burst = PPI_BURST; | |
194 | sc->sc_timo = ppimstohz(PPI_TIMO); | 194 | sc->sc_timo = ppimstohz(PPI_TIMO); | |
195 | sc->sc_delay = ppimstohz(PPI_DELAY); | 195 | sc->sc_delay = ppimstohz(PPI_DELAY); | |
196 | sc->sc_sec = -1; | 196 | sc->sc_sec = -1; | |
197 | return (0); | 197 | return (0); | |
198 | } | 198 | } | |
199 | 199 | |||
200 | int | 200 | int | |
201 | ppiclose(dev_t dev, int flags, int fmt, struct lwp *l) | 201 | ppiclose(dev_t dev, int flags, int fmt, struct lwp *l) | |
202 | { | 202 | { | |
203 | struct ppi_softc *sc; | 203 | struct ppi_softc *sc; | |
204 | 204 | |||
205 | sc = device_lookup_private(&ppi_cd, UNIT(dev)); | 205 | sc = device_lookup_private(&ppi_cd, UNIT(dev)); | |
206 | 206 | |||
207 | DPRINTF(PDB_FOLLOW, ("ppiclose(%x, %x): flags %x\n", | 207 | DPRINTF(PDB_FOLLOW, ("ppiclose(%" PRIx64 ", %x): flags %x\n", | |
208 | dev, flags, sc->sc_flags)); | 208 | dev, flags, sc->sc_flags)); | |
209 | 209 | |||
210 | sc->sc_flags &= ~PPIF_OPEN; | 210 | sc->sc_flags &= ~PPIF_OPEN; | |
211 | return (0); | 211 | return (0); | |
212 | } | 212 | } | |
213 | 213 | |||
214 | void | 214 | void | |
215 | ppicallback(void *v, int action) | 215 | ppicallback(void *v, int action) | |
216 | { | 216 | { | |
217 | struct ppi_softc *sc = v; | 217 | struct ppi_softc *sc = v; | |
218 | 218 | |||
219 | DPRINTF(PDB_FOLLOW, ("ppicallback: v=%p, action=%d\n", v, action)); | 219 | DPRINTF(PDB_FOLLOW, ("ppicallback: v=%p, action=%d\n", v, action)); | |
220 | 220 | |||
@@ -249,57 +249,57 @@ ppitimo(void *arg) | @@ -249,57 +249,57 @@ ppitimo(void *arg) | |||
249 | { | 249 | { | |
250 | struct ppi_softc *sc = arg; | 250 | struct ppi_softc *sc = arg; | |
251 | 251 | |||
252 | DPRINTF(PDB_FOLLOW, ("ppitimo(%x)\n", device_unit(&sc->sc_dev))); | 252 | DPRINTF(PDB_FOLLOW, ("ppitimo(%x)\n", device_unit(&sc->sc_dev))); | |
253 | 253 | |||
254 | sc->sc_flags &= ~(PPIF_UIO|PPIF_TIMO); | 254 | sc->sc_flags &= ~(PPIF_UIO|PPIF_TIMO); | |
255 | wakeup(sc); | 255 | wakeup(sc); | |
256 | } | 256 | } | |
257 | 257 | |||
258 | int | 258 | int | |
259 | ppiread(dev_t dev, struct uio *uio, int flags) | 259 | ppiread(dev_t dev, struct uio *uio, int flags) | |
260 | { | 260 | { | |
261 | 261 | |||
262 | DPRINTF(PDB_FOLLOW, ("ppiread(%x, %p)\n", dev, uio)); | 262 | DPRINTF(PDB_FOLLOW, ("ppiread(%" PRIx64 ", %p)\n", dev, uio)); | |
263 | 263 | |||
264 | return (ppirw(dev, uio)); | 264 | return (ppirw(dev, uio)); | |
265 | } | 265 | } | |
266 | 266 | |||
267 | int | 267 | int | |
268 | ppiwrite(dev_t dev, struct uio *uio, int flags) | 268 | ppiwrite(dev_t dev, struct uio *uio, int flags) | |
269 | { | 269 | { | |
270 | 270 | |||
271 | DPRINTF(PDB_FOLLOW, ("ppiwrite(%x, %p)\n", dev, uio)); | 271 | DPRINTF(PDB_FOLLOW, ("ppiwrite(%" PRIx64 ", %p)\n", dev, uio)); | |
272 | 272 | |||
273 | return (ppirw(dev, uio)); | 273 | return (ppirw(dev, uio)); | |
274 | } | 274 | } | |
275 | 275 | |||
276 | int | 276 | int | |
277 | ppirw(dev_t dev, struct uio *uio) | 277 | ppirw(dev_t dev, struct uio *uio) | |
278 | { | 278 | { | |
279 | struct ppi_softc *sc = device_lookup_private(&ppi_cd, UNIT(dev)); | 279 | struct ppi_softc *sc = device_lookup_private(&ppi_cd, UNIT(dev)); | |
280 | int s1, s2, len, cnt; | 280 | int s1, s2, len, cnt; | |
281 | char *cp; | 281 | char *cp; | |
282 | int error = 0, gotdata = 0; | 282 | int error = 0, gotdata = 0; | |
283 | int buflen, address; | 283 | int buflen, address; | |
284 | char *buf; | 284 | char *buf; | |
285 | 285 | |||
286 | if (uio->uio_resid == 0) | 286 | if (uio->uio_resid == 0) | |
287 | return (0); | 287 | return (0); | |
288 | 288 | |||
289 | address = sc->sc_address; | 289 | address = sc->sc_address; | |
290 | 290 | |||
291 | DPRINTF(PDB_FOLLOW|PDB_IO, | 291 | DPRINTF(PDB_FOLLOW|PDB_IO, | |
292 | ("ppirw(%x, %p, %c): burst %d, timo %d, resid %x\n", | 292 | ("ppirw(%" PRIx64 ", %p, %c): burst %d, timo %d, resid %x\n", | |
293 | dev, uio, uio->uio_rw == UIO_READ ? 'R' : 'W', | 293 | dev, uio, uio->uio_rw == UIO_READ ? 'R' : 'W', | |
294 | sc->sc_burst, sc->sc_timo, uio->uio_resid)); | 294 | sc->sc_burst, sc->sc_timo, uio->uio_resid)); | |
295 | 295 | |||
296 | buflen = min(sc->sc_burst, uio->uio_resid); | 296 | buflen = min(sc->sc_burst, uio->uio_resid); | |
297 | buf = (char *)malloc(buflen, M_DEVBUF, M_WAITOK); | 297 | buf = (char *)malloc(buflen, M_DEVBUF, M_WAITOK); | |
298 | sc->sc_flags |= PPIF_UIO; | 298 | sc->sc_flags |= PPIF_UIO; | |
299 | if (sc->sc_timo > 0) { | 299 | if (sc->sc_timo > 0) { | |
300 | sc->sc_flags |= PPIF_TIMO; | 300 | sc->sc_flags |= PPIF_TIMO; | |
301 | callout_reset(&sc->sc_timo_ch, sc->sc_timo, ppitimo, sc); | 301 | callout_reset(&sc->sc_timo_ch, sc->sc_timo, ppitimo, sc); | |
302 | } | 302 | } | |
303 | len = cnt = 0; | 303 | len = cnt = 0; | |
304 | while (uio->uio_resid > 0) { | 304 | while (uio->uio_resid > 0) { | |
305 | len = min(buflen, uio->uio_resid); | 305 | len = min(buflen, uio->uio_resid); |