Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch Revert previous DPRINTF changes since gcc3 properly...



details:   https://anonhg.NetBSD.org/src/rev/57490c40a8f2
branches:  trunk
changeset: 555562:57490c40a8f2
user:      tsutsui <tsutsui%NetBSD.org@localhost>
date:      Fri Nov 21 19:44:53 2003 +0000

description:
Revert previous DPRINTF changes since gcc3 properly removes text strings
in while(0) statements during optimization.

diffstat:

 sys/arch/news68k/stand/boot/boot.c      |  22 +++++++++---------
 sys/arch/news68k/stand/boot/devopen.c   |  14 ++++++------
 sys/arch/news68k/stand/bootxx/bootxx.c  |  30 +++++++++++++-------------
 sys/arch/newsmips/stand/boot/boot.c     |  38 ++++++++++++++++----------------
 sys/arch/newsmips/stand/boot/devopen.c  |  14 ++++++------
 sys/arch/newsmips/stand/bootxx/bootxx.c |  32 +++++++++++++-------------
 6 files changed, 75 insertions(+), 75 deletions(-)

diffs (truncated from 407 to 300 lines):

diff -r eb3060b8f034 -r 57490c40a8f2 sys/arch/news68k/stand/boot/boot.c
--- a/sys/arch/news68k/stand/boot/boot.c        Fri Nov 21 19:39:19 2003 +0000
+++ b/sys/arch/news68k/stand/boot/boot.c        Fri Nov 21 19:44:53 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: boot.c,v 1.8 2003/04/19 21:30:14 tsutsui Exp $ */
+/*     $NetBSD: boot.c,v 1.9 2003/11/21 19:44:53 tsutsui Exp $ */
 
 /*-
  * Copyright (C) 1999 Izumi Tsutsui.  All rights reserved.
@@ -45,9 +45,9 @@
 char *kernels[] = { "/netbsd", "/netbsd.gz", NULL };
 
 #ifdef BOOT_DEBUG
-# define DPRINTF(x) printf x
+# define DPRINTF printf
 #else
-# define DPRINTF(x)
+# define DPRINTF while (0) printf
 #endif
 
 void
@@ -71,10 +71,10 @@
                              strcmp(netbsd, "/boot") == 0)
                netbsd = "";
 
-       DPRINTF(("howto = 0x%x\n", d7));
-       DPRINTF(("bootdev = 0x%x\n", bootdev));
-       DPRINTF(("bootname = %s\n", netbsd));
-       DPRINTF(("maxmem = 0x%x\n", d4));
+       DPRINTF("howto = 0x%x\n", d7);
+       DPRINTF("bootdev = 0x%x\n", bootdev);
+       DPRINTF("bootname = %s\n", netbsd);
+       DPRINTF("maxmem = 0x%x\n", d4);
 
 #define        SET_MAGIC(bootdev, magic) ((bootdev & 0x0fffffff)| (magic << 28))
        /* PROM monitor passes 0xa, but NEWS-OS /boot passed 0x5... */
@@ -103,7 +103,7 @@
 
        for (i = 0; kernels[i]; i++) {
                sprintf(file, "%s%s", devname, kernels[i]);
-               DPRINTF(("trying %s...\n", file));
+               DPRINTF("trying %s...\n", file);
                fd = loadfile(file, marks, LOAD_KERNEL);
                if (fd != -1)
                        break;
@@ -117,9 +117,9 @@
 #endif
        }
 
-       DPRINTF(("entry = 0x%x\n", (int)marks[MARK_ENTRY]));
-       DPRINTF(("ssym = 0x%x\n", (int)marks[MARK_SYM]));
-       DPRINTF(("esym = 0x%x\n", (int)marks[MARK_END]));
+       DPRINTF("entry = 0x%x\n", (int)marks[MARK_ENTRY]);
+       DPRINTF("ssym = 0x%x\n", (int)marks[MARK_SYM]);
+       DPRINTF("esym = 0x%x\n", (int)marks[MARK_END]);
 
        entry = (void *)marks[MARK_ENTRY];
 
diff -r eb3060b8f034 -r 57490c40a8f2 sys/arch/news68k/stand/boot/devopen.c
--- a/sys/arch/news68k/stand/boot/devopen.c     Fri Nov 21 19:39:19 2003 +0000
+++ b/sys/arch/news68k/stand/boot/devopen.c     Fri Nov 21 19:44:53 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: devopen.c,v 1.4 2002/12/20 16:56:23 tsutsui Exp $      */
+/*     $NetBSD: devopen.c,v 1.5 2003/11/21 19:44:53 tsutsui Exp $      */
 
 /*-
  * Copyright (C) 1999 Tsubai Masanari.  All rights reserved.
@@ -34,9 +34,9 @@
 #include <machine/romcall.h>
 
 #ifdef BOOT_DEBUG
-# define DPRINTF(x) printf x
+# define DPRINTF printf
 #else
-# define DPRINTF(x)
+# define DPRINTF while (0) printf
 #endif
 
 int dkopen(struct open_file *, ...);
@@ -69,14 +69,14 @@
        char devname[32];
        char *cp;
 
-       DPRINTF(("devopen: %s\n", fname));
+       DPRINTF("devopen: %s\n", fname);
 
        strcpy(devname, fname);
        cp = strchr(devname, ')') + 1;
        *cp = 0;
        fd = rom_open(devname, 0);
 
-       DPRINTF(("devname = %s, fd = %d\n", devname, fd));
+       DPRINTF("devname = %s, fd = %d\n", devname, fd);
        if (fd == -1)
                return -1;
 
@@ -92,7 +92,7 @@
 int
 dkopen(struct open_file *f, ...)
 {
-       DPRINTF(("dkopen\n"));
+       DPRINTF("dkopen\n");
        return 0;
 }
 
@@ -102,7 +102,7 @@
 {
        struct romdev *dev = f->f_devdata;
 
-       DPRINTF(("dkclose\n"));
+       DPRINTF("dkclose\n");
        rom_close(dev->fd);
        return 0;
 }
diff -r eb3060b8f034 -r 57490c40a8f2 sys/arch/news68k/stand/bootxx/bootxx.c
--- a/sys/arch/news68k/stand/bootxx/bootxx.c    Fri Nov 21 19:39:19 2003 +0000
+++ b/sys/arch/news68k/stand/bootxx/bootxx.c    Fri Nov 21 19:44:53 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bootxx.c,v 1.4 2002/05/20 14:05:22 lukem Exp $ */
+/*     $NetBSD: bootxx.c,v 1.5 2003/11/21 19:44:53 tsutsui Exp $       */
 
 /*-
  * Copyright (C) 1999 Izumi Tsutsui.  All rights reserved.
@@ -47,9 +47,9 @@
     (void *)DEFAULT_ENTRY_POINT;
 
 #ifdef BOOTXX_DEBUG
-# define DPRINTF(x) printf x
+# define DPRINTF printf
 #else
-# define DPRINTF(x)
+# define DPRINTF while (0) printf
 #endif
 
 char *devs[] = { "hd", "fh", "fd", NULL, NULL, "rd", "st" };
@@ -67,15 +67,15 @@
 
        printf("NetBSD/news68k Primary Boot\n");
 
-       DPRINTF(("\n"));
-       DPRINTF(("d4 %x\n", d4));
-       DPRINTF(("d5 %x (%s)\n", d5, (char *)d5));
-       DPRINTF(("d6 %x\n", d6));
-       DPRINTF(("d7 %x\n", d7));
+       DPRINTF("\n");
+       DPRINTF("d4 %x\n", d4);
+       DPRINTF("d5 %x (%s)\n", d5, (char *)d5);
+       DPRINTF("d6 %x\n", d6);
+       DPRINTF("d7 %x\n", d7);
 
-       DPRINTF(("block_size  = %d\n", bbinfo.bbi_block_size));
-       DPRINTF(("block_count = %d\n", bbinfo.bbi_block_count));
-       DPRINTF(("entry_point = %p\n", entry_point));
+       DPRINTF("block_size  = %d\n", bbinfo.bbi_block_size);
+       DPRINTF("block_count = %d\n", bbinfo.bbi_block_count);
+       DPRINTF("entry_point = %p\n", entry_point);
 
        /* sd(ctlr, lun, part, bus?, host) */
 
@@ -99,19 +99,19 @@
 
        addr = (char *)entry_point;
        bs = bbinfo.bbi_block_size;
-       DPRINTF(("reading block:"));
+       DPRINTF("reading block:");
        for (i = 0; i < bbinfo.bbi_block_count; i++) {
                blk = bbinfo.bbi_block_table[i];
 
-               DPRINTF((" %d", blk));
+               DPRINTF(" %d", blk);
 
                rom_lseek(fd, blk * 512, 0);
                rom_read(fd, addr, bs);
                addr += bs;
        }
-       DPRINTF((" done\n"));
+       DPRINTF(" done\n");
        rom_close(fd);
 
        (*entry_point)(d4, d5, d6, d7);
-       DPRINTF(("bootxx returned?\n"));
+       DPRINTF("bootxx returned?\n");
 }
diff -r eb3060b8f034 -r 57490c40a8f2 sys/arch/newsmips/stand/boot/boot.c
--- a/sys/arch/newsmips/stand/boot/boot.c       Fri Nov 21 19:39:19 2003 +0000
+++ b/sys/arch/newsmips/stand/boot/boot.c       Fri Nov 21 19:44:53 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: boot.c,v 1.12 2002/11/22 16:27:07 tsutsui Exp $        */
+/*     $NetBSD: boot.c,v 1.13 2003/11/21 19:44:53 tsutsui Exp $        */
 
 /*-
  * Copyright (C) 1999 Tsubai Masanari.  All rights reserved.
@@ -54,9 +54,9 @@
 char *kernels[] = { "/netbsd", "/netbsd.gz", NULL };
 
 #ifdef BOOT_DEBUG
-# define DPRINTF(x) printf x
+# define DPRINTF printf
 #else
-# define DPRINTF(x)
+# define DPRINTF while (0) printf
 #endif
 
 void
@@ -100,21 +100,21 @@
                int argc = a2;
                char **argv = (char **)a3;
 
-               DPRINTF(("APbus-based system\n"));
+               DPRINTF("APbus-based system\n");
 
-               DPRINTF(("argc = %d\n", argc));
+               DPRINTF("argc = %d\n", argc);
                for (i = 0; i < argc; i++) {
-                       DPRINTF(("argv[%d] = %s\n", i, argv[i]));
+                       DPRINTF("argv[%d] = %s\n", i, argv[i]);
                        if (argv[i][0] != '-' && *netbsd == 0)
                                netbsd = argv[i];
                }
                maxmem = _sip->apbsi_memsize;
                maxmem -= 0x100000;     /* reserve 1MB for ROM monitor */
 
-               DPRINTF(("howto = 0x%x\n", a0));
-               DPRINTF(("bootdev = %s\n", (char *)a1));
-               DPRINTF(("bootname = %s\n", netbsd));
-               DPRINTF(("maxmem = 0x%x\n", maxmem));
+               DPRINTF("howto = 0x%x\n", a0);
+               DPRINTF("bootdev = %s\n", (char *)a1);
+               DPRINTF("bootname = %s\n", netbsd);
+               DPRINTF("maxmem = 0x%x\n", maxmem);
 
                /* XXX use "sonic()" instead of "tftp()" */
                if (strncmp(bootdev, "tftp", 4) == 0)
@@ -128,17 +128,17 @@
                char *bootname = (char *)a2;
                int ctlr, unit, part, type;
 
-               DPRINTF(("HB system.\n"));
+               DPRINTF("HB system.\n");
 
                /* bootname is "/boot" by default on HB system. */
                if (bootname && strcmp(bootname, "/boot") != 0)
                        netbsd = bootname;
                maxmem = a3;
 
-               DPRINTF(("howto = 0x%x\n", a0));
-               DPRINTF(("bootdev = 0x%x\n", a1));
-               DPRINTF(("bootname = %s\n", netbsd));
-               DPRINTF(("maxmem = 0x%x\n", maxmem));
+               DPRINTF("howto = 0x%x\n", a0);
+               DPRINTF("bootdev = 0x%x\n", a1);
+               DPRINTF("bootname = %s\n", netbsd);
+               DPRINTF("maxmem = 0x%x\n", maxmem);
 
                ctlr = BOOTDEV_CTLR(bootdev);
                unit = BOOTDEV_UNIT(bootdev);
@@ -165,7 +165,7 @@
 
        for (i = 0; kernels[i]; i++) {
                sprintf(file, "%s%s", devname, kernels[i]);
-               DPRINTF(("trying %s...\n", file));
+               DPRINTF("trying %s...\n", file);
                fd = loadfile(file, marks, LOAD_KERNEL);
                if (fd != -1)
                        break;
@@ -173,9 +173,9 @@
        if (kernels[i] == NULL)
                _rtt();
 
-       DPRINTF(("entry = 0x%x\n", (int)marks[MARK_ENTRY]));
-       DPRINTF(("ssym = 0x%x\n", (int)marks[MARK_SYM]));
-       DPRINTF(("esym = 0x%x\n", (int)marks[MARK_END]));
+       DPRINTF("entry = 0x%x\n", (int)marks[MARK_ENTRY]);
+       DPRINTF("ssym = 0x%x\n", (int)marks[MARK_SYM]);
+       DPRINTF("esym = 0x%x\n", (int)marks[MARK_END]);
 
        bi_init(BOOTINFO_ADDR);
 
diff -r eb3060b8f034 -r 57490c40a8f2 sys/arch/newsmips/stand/boot/devopen.c
--- a/sys/arch/newsmips/stand/boot/devopen.c    Fri Nov 21 19:39:19 2003 +0000
+++ b/sys/arch/newsmips/stand/boot/devopen.c    Fri Nov 21 19:44:53 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: devopen.c,v 1.5 2002/11/22 16:27:08 tsutsui Exp $      */
+/*     $NetBSD: devopen.c,v 1.6 2003/11/21 19:44:53 tsutsui Exp $      */
 
 /*-
  * Copyright (C) 1999 Tsubai Masanari.  All rights reserved.
@@ -38,9 +38,9 @@
 #include <promdev.h>
 
 #ifdef BOOT_DEBUG
-# define DPRINTF(x) printf x
+# define DPRINTF printf
 #else
-# define DPRINTF(x)
+# define DPRINTF while (0) printf
 #endif
 
 int dkopen __P((struct open_file *, ...));
@@ -86,7 +86,7 @@



Home | Main Index | Thread Index | Old Index