Thu Jul 28 03:42:21 2011 UTC ()
dev_t is uint64_t; use PRIx64 to print it.  Fix DEBUG build.


(uebayasi)
diff -r1.42 -r1.43 src/sys/arch/hp300/dev/ppi.c
diff -r1.90 -r1.91 src/sys/arch/hp300/dev/rd.c

cvs diff -r1.42 -r1.43 src/sys/arch/hp300/dev/ppi.c (expand / switch to unified diff)

--- src/sys/arch/hp300/dev/ppi.c 2008/06/18 12:25:13 1.42
+++ src/sys/arch/hp300/dev/ppi.c 2011/07/28 03:42:20 1.43
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: ppi.c,v 1.42 2008/06/18 12:25:13 tsutsui Exp $ */ 1/* $NetBSD: ppi.c,v 1.43 2011/07/28 03:42:20 uebayasi Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc. 4 * Copyright (c) 1996, 1997 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 HPIB interface 64 * Printer/Plotter HPIB interface
65 */ 65 */
66 66
67#include <sys/cdefs.h> 67#include <sys/cdefs.h>
68__KERNEL_RCSID(0, "$NetBSD: ppi.c,v 1.42 2008/06/18 12:25:13 tsutsui Exp $"); 68__KERNEL_RCSID(0, "$NetBSD: ppi.c,v 1.43 2011/07/28 03:42:20 uebayasi 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/errno.h> 75#include <sys/errno.h>
76#include <sys/malloc.h> 76#include <sys/malloc.h>
77#include <sys/proc.h> 77#include <sys/proc.h>
78#include <sys/uio.h> 78#include <sys/uio.h>
79 79
80#include <hp300/dev/hpibvar.h> 80#include <hp300/dev/hpibvar.h>
81 81
@@ -196,47 +196,47 @@ int @@ -196,47 +196,47 @@ int
196ppiopen(dev_t dev, int flags, int fmt, struct lwp *l) 196ppiopen(dev_t dev, int flags, int fmt, struct lwp *l)
197{ 197{
198 struct ppi_softc *sc; 198 struct ppi_softc *sc;
199 199
200 sc = device_lookup_private(&ppi_cd,UNIT(dev)); 200 sc = device_lookup_private(&ppi_cd,UNIT(dev));
201 if (sc == NULL) 201 if (sc == NULL)
202 return ENXIO; 202 return ENXIO;
203 203
204 if ((sc->sc_flags & PPIF_ALIVE) == 0) 204 if ((sc->sc_flags & PPIF_ALIVE) == 0)
205 return ENXIO; 205 return ENXIO;
206 206
207#ifdef DEBUG 207#ifdef DEBUG
208 if (ppidebug & PDB_FOLLOW) 208 if (ppidebug & PDB_FOLLOW)
209 printf("ppiopen(%x, %x): flags %x\n", 209 printf("ppiopen(%"PRIx64", %x): flags %x\n",
210 dev, flags, sc->sc_flags); 210 dev, flags, sc->sc_flags);
211#endif 211#endif
212 if (sc->sc_flags & PPIF_OPEN) 212 if (sc->sc_flags & PPIF_OPEN)
213 return EBUSY; 213 return EBUSY;
214 sc->sc_flags |= PPIF_OPEN; 214 sc->sc_flags |= PPIF_OPEN;
215 sc->sc_burst = PPI_BURST; 215 sc->sc_burst = PPI_BURST;
216 sc->sc_timo = ppimstohz(PPI_TIMO); 216 sc->sc_timo = ppimstohz(PPI_TIMO);
217 sc->sc_delay = ppimstohz(PPI_DELAY); 217 sc->sc_delay = ppimstohz(PPI_DELAY);
218 sc->sc_sec = -1; 218 sc->sc_sec = -1;
219 return 0; 219 return 0;
220} 220}
221 221
222static int 222static int
223ppiclose(dev_t dev, int flags, int fmt, struct lwp *l) 223ppiclose(dev_t dev, int flags, int fmt, struct lwp *l)
224{ 224{
225 struct ppi_softc *sc = device_lookup_private(&ppi_cd, UNIT(dev)); 225 struct ppi_softc *sc = device_lookup_private(&ppi_cd, UNIT(dev));
226 226
227#ifdef DEBUG 227#ifdef DEBUG
228 if (ppidebug & PDB_FOLLOW) 228 if (ppidebug & PDB_FOLLOW)
229 printf("ppiclose(%x, %x): flags %x\n", 229 printf("ppiclose(%"PRIx64", %x): flags %x\n",
230 dev, flags, sc->sc_flags); 230 dev, flags, sc->sc_flags);
231#endif 231#endif
232 sc->sc_flags &= ~PPIF_OPEN; 232 sc->sc_flags &= ~PPIF_OPEN;
233 return 0; 233 return 0;
234} 234}
235 235
236static void 236static void
237ppistart(void *arg) 237ppistart(void *arg)
238{ 238{
239 struct ppi_softc *sc = arg; 239 struct ppi_softc *sc = arg;
240 240
241#ifdef DEBUG 241#ifdef DEBUG
242 if (ppidebug & PDB_FOLLOW) 242 if (ppidebug & PDB_FOLLOW)
@@ -255,61 +255,61 @@ ppitimo(void *arg) @@ -255,61 +255,61 @@ ppitimo(void *arg)
255 if (ppidebug & PDB_FOLLOW) 255 if (ppidebug & PDB_FOLLOW)
256 printf("ppitimo(%x)\n", device_unit(sc->sc_dev)); 256 printf("ppitimo(%x)\n", device_unit(sc->sc_dev));
257#endif 257#endif
258 sc->sc_flags &= ~(PPIF_UIO|PPIF_TIMO); 258 sc->sc_flags &= ~(PPIF_UIO|PPIF_TIMO);
259 wakeup(sc); 259 wakeup(sc);
260} 260}
261 261
262static int 262static int
263ppiread(dev_t dev, struct uio *uio, int flags) 263ppiread(dev_t dev, struct uio *uio, int flags)
264{ 264{
265 265
266#ifdef DEBUG 266#ifdef DEBUG
267 if (ppidebug & PDB_FOLLOW) 267 if (ppidebug & PDB_FOLLOW)
268 printf("ppiread(%x, %p)\n", dev, uio); 268 printf("ppiread(%"PRIx64", %p)\n", dev, uio);
269#endif 269#endif
270 return ppirw(dev, uio); 270 return ppirw(dev, uio);
271} 271}
272 272
273static int 273static int
274ppiwrite(dev_t dev, struct uio *uio, int flags) 274ppiwrite(dev_t dev, struct uio *uio, int flags)
275{ 275{
276 276
277#ifdef DEBUG 277#ifdef DEBUG
278 if (ppidebug & PDB_FOLLOW) 278 if (ppidebug & PDB_FOLLOW)
279 printf("ppiwrite(%x, %p)\n", dev, uio); 279 printf("ppiwrite(%"PRIx64", %p)\n", dev, uio);
280#endif 280#endif
281 return ppirw(dev, uio); 281 return ppirw(dev, uio);
282} 282}
283 283
284static int 284static int
285ppirw(dev_t dev, struct uio *uio) 285ppirw(dev_t dev, struct uio *uio)
286{ 286{
287 struct ppi_softc *sc = device_lookup_private(&ppi_cd, UNIT(dev)); 287 struct ppi_softc *sc = device_lookup_private(&ppi_cd, UNIT(dev));
288 int s, s2, len, cnt; 288 int s, s2, len, cnt;
289 char *cp; 289 char *cp;
290 int error = 0, gotdata = 0; 290 int error = 0, gotdata = 0;
291 int buflen, ctlr, slave; 291 int buflen, ctlr, slave;
292 char *buf; 292 char *buf;
293 293
294 if (uio->uio_resid == 0) 294 if (uio->uio_resid == 0)
295 return 0; 295 return 0;
296 296
297 ctlr = device_unit(device_parent(sc->sc_dev)); 297 ctlr = device_unit(device_parent(sc->sc_dev));
298 slave = sc->sc_slave; 298 slave = sc->sc_slave;
299 299
300#ifdef DEBUG 300#ifdef DEBUG
301 if (ppidebug & (PDB_FOLLOW|PDB_IO)) 301 if (ppidebug & (PDB_FOLLOW|PDB_IO))
302 printf("ppirw(%x, %p, %c): burst %d, timo %d, resid %x\n", 302 printf("ppirw(%"PRIx64", %p, %c): burst %d, timo %d, resid %x\n",
303 dev, uio, uio->uio_rw == UIO_READ ? 'R' : 'W', 303 dev, uio, uio->uio_rw == UIO_READ ? 'R' : 'W',
304 sc->sc_burst, sc->sc_timo, uio->uio_resid); 304 sc->sc_burst, sc->sc_timo, uio->uio_resid);
305#endif 305#endif
306 buflen = min(sc->sc_burst, uio->uio_resid); 306 buflen = min(sc->sc_burst, uio->uio_resid);
307 buf = (char *)malloc(buflen, M_DEVBUF, M_WAITOK); 307 buf = (char *)malloc(buflen, M_DEVBUF, M_WAITOK);
308 sc->sc_flags |= PPIF_UIO; 308 sc->sc_flags |= PPIF_UIO;
309 if (sc->sc_timo > 0) { 309 if (sc->sc_timo > 0) {
310 sc->sc_flags |= PPIF_TIMO; 310 sc->sc_flags |= PPIF_TIMO;
311 callout_reset(&sc->sc_timo_ch, sc->sc_timo, ppitimo, sc); 311 callout_reset(&sc->sc_timo_ch, sc->sc_timo, ppitimo, sc);
312 } 312 }
313 len = cnt = 0; 313 len = cnt = 0;
314 while (uio->uio_resid > 0) { 314 while (uio->uio_resid > 0) {
315 len = min(buflen, uio->uio_resid); 315 len = min(buflen, uio->uio_resid);

cvs diff -r1.90 -r1.91 src/sys/arch/hp300/dev/rd.c (expand / switch to unified diff)

--- src/sys/arch/hp300/dev/rd.c 2011/02/08 20:20:13 1.90
+++ src/sys/arch/hp300/dev/rd.c 2011/07/28 03:42:20 1.91
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: rd.c,v 1.90 2011/02/08 20:20:13 rmind Exp $ */ 1/* $NetBSD: rd.c,v 1.91 2011/07/28 03:42:20 uebayasi Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc. 4 * Copyright (c) 1996, 1997 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.
@@ -62,27 +62,27 @@ @@ -62,27 +62,27 @@
62 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 62 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
63 * SUCH DAMAGE. 63 * SUCH DAMAGE.
64 * 64 *
65 * from: Utah $Hdr: rd.c 1.44 92/12/26$ 65 * from: Utah $Hdr: rd.c 1.44 92/12/26$
66 * 66 *
67 * @(#)rd.c 8.2 (Berkeley) 5/19/94 67 * @(#)rd.c 8.2 (Berkeley) 5/19/94
68 */ 68 */
69 69
70/* 70/*
71 * CS80/SS80 disk driver 71 * CS80/SS80 disk driver
72 */ 72 */
73 73
74#include <sys/cdefs.h> 74#include <sys/cdefs.h>
75__KERNEL_RCSID(0, "$NetBSD: rd.c,v 1.90 2011/02/08 20:20:13 rmind Exp $"); 75__KERNEL_RCSID(0, "$NetBSD: rd.c,v 1.91 2011/07/28 03:42:20 uebayasi Exp $");
76 76
77#include "opt_useleds.h" 77#include "opt_useleds.h"
78#include "rnd.h" 78#include "rnd.h"
79 79
80#include <sys/param.h> 80#include <sys/param.h>
81#include <sys/systm.h> 81#include <sys/systm.h>
82#include <sys/buf.h> 82#include <sys/buf.h>
83#include <sys/bufq.h> 83#include <sys/bufq.h>
84#include <sys/conf.h> 84#include <sys/conf.h>
85#include <sys/device.h> 85#include <sys/device.h>
86#include <sys/disk.h> 86#include <sys/disk.h>
87#include <sys/disklabel.h> 87#include <sys/disklabel.h>
88#include <sys/fcntl.h> 88#include <sys/fcntl.h>
@@ -647,27 +647,27 @@ rdclose(dev_t dev, int flag, int mode, s @@ -647,27 +647,27 @@ rdclose(dev_t dev, int flag, int mode, s
647} 647}
648 648
649static void 649static void
650rdstrategy(struct buf *bp) 650rdstrategy(struct buf *bp)
651{ 651{
652 struct rd_softc *sc = device_lookup_private(&rd_cd, rdunit(bp->b_dev)); 652 struct rd_softc *sc = device_lookup_private(&rd_cd, rdunit(bp->b_dev));
653 struct partition *pinfo; 653 struct partition *pinfo;
654 daddr_t bn; 654 daddr_t bn;
655 int sz, s; 655 int sz, s;
656 int offset; 656 int offset;
657 657
658#ifdef DEBUG 658#ifdef DEBUG
659 if (rddebug & RDB_FOLLOW) 659 if (rddebug & RDB_FOLLOW)
660 printf("rdstrategy(%p): dev %x, bn %llx, bcount %x, %c\n", 660 printf("rdstrategy(%p): dev %"PRIx64", bn %llx, bcount %x, %c\n",
661 bp, bp->b_dev, bp->b_blkno, bp->b_bcount, 661 bp, bp->b_dev, bp->b_blkno, bp->b_bcount,
662 (bp->b_flags & B_READ) ? 'R' : 'W'); 662 (bp->b_flags & B_READ) ? 'R' : 'W');
663#endif 663#endif
664 bn = bp->b_blkno; 664 bn = bp->b_blkno;
665 sz = howmany(bp->b_bcount, DEV_BSIZE); 665 sz = howmany(bp->b_bcount, DEV_BSIZE);
666 pinfo = &sc->sc_dkdev.dk_label->d_partitions[rdpart(bp->b_dev)]; 666 pinfo = &sc->sc_dkdev.dk_label->d_partitions[rdpart(bp->b_dev)];
667 667
668 /* Don't perform partition translation on RAW_PART. */ 668 /* Don't perform partition translation on RAW_PART. */
669 offset = (rdpart(bp->b_dev) == RAW_PART) ? 0 : pinfo->p_offset; 669 offset = (rdpart(bp->b_dev) == RAW_PART) ? 0 : pinfo->p_offset;
670 670
671 if (rdpart(bp->b_dev) != RAW_PART) { 671 if (rdpart(bp->b_dev) != RAW_PART) {
672 /* 672 /*
673 * XXX This block of code belongs in 673 * XXX This block of code belongs in