Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/news68k - add const



details:   https://anonhg.NetBSD.org/src/rev/9648e6729222
branches:  trunk
changeset: 581562:9648e6729222
user:      tsutsui <tsutsui%NetBSD.org@localhost>
date:      Thu Jun 02 15:26:35 2005 +0000

description:
- add const
- u_char -> uint8_t
- sccport0a is not used as pointer, so make it uint32_t address
- idrom is stored in ROM, so make it const rather than volatile

diffstat:

 sys/arch/news68k/dev/if_le.c       |  12 +++---
 sys/arch/news68k/dev/zs.c          |   6 +-
 sys/arch/news68k/news68k/machdep.c |  61 +++++++++++++++++++------------------
 3 files changed, 41 insertions(+), 38 deletions(-)

diffs (190 lines):

diff -r 19ab73db5087 -r 9648e6729222 sys/arch/news68k/dev/if_le.c
--- a/sys/arch/news68k/dev/if_le.c      Thu Jun 02 15:24:04 2005 +0000
+++ b/sys/arch/news68k/dev/if_le.c      Thu Jun 02 15:26:35 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_le.c,v 1.12 2005/02/27 09:27:31 tsutsui Exp $       */
+/*     $NetBSD: if_le.c,v 1.13 2005/06/02 15:26:35 tsutsui Exp $       */
 
 /*-
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -41,7 +41,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_le.c,v 1.12 2005/02/27 09:27:31 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_le.c,v 1.13 2005/06/02 15:26:35 tsutsui Exp $");
 
 #include "opt_inet.h"
 #include "bpfilter.h"
@@ -97,7 +97,7 @@
 CFATTACH_DECL(le, sizeof(struct le_softc),
     le_match, le_attach, NULL, NULL);
 
-extern volatile u_char *idrom_addr;
+extern const uint8_t *idrom_addr;
 extern uint32_t lance_mem_phys;
 
 #if defined(_KERNEL_OPT)
@@ -159,16 +159,16 @@
        struct le_softc *lesc = (struct le_softc *)self;
        struct lance_softc *sc = &lesc->sc_am7990.lsc;
        struct hb_attach_args *ha = aux;
-       u_char *p;
+       const uint8_t *p;
 
        lesc->sc_r1 = (void *)IIOV(ha->ha_address);
 
        if (ISIIOPA(ha->ha_address)) {
                sc->sc_mem = (u_char *)IIOV(lance_mem_phys);
-               p = (u_char *)(idrom_addr + 0x10);
+               p = idrom_addr + 0x10;
        } else {
                sc->sc_mem = lesc->sc_r1 - 0x10000;
-               p = (u_char *)(lesc->sc_r1 + 0x8010);
+               p = (const uint8_t *)(lesc->sc_r1 + 0x8010);
        }
 
        sc->sc_memsize = 0x4000;        /* 16K */
diff -r 19ab73db5087 -r 9648e6729222 sys/arch/news68k/dev/zs.c
--- a/sys/arch/news68k/dev/zs.c Thu Jun 02 15:24:04 2005 +0000
+++ b/sys/arch/news68k/dev/zs.c Thu Jun 02 15:26:35 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: zs.c,v 1.20 2004/09/04 13:43:11 tsutsui Exp $  */
+/*     $NetBSD: zs.c,v 1.21 2005/06/02 15:26:35 tsutsui Exp $  */
 
 /*-
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -48,7 +48,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: zs.c,v 1.20 2004/09/04 13:43:11 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: zs.c,v 1.21 2005/06/02 15:26:35 tsutsui Exp $");
 
 #include "opt_ddb.h"
 
@@ -582,7 +582,7 @@
 
        extern const struct cdevsw zstty_cdevsw;
        extern int tty00_is_console;
-       extern volatile u_char *sccport0a;
+       extern uint32_t sccport0a;
 
        cn->cn_dev = makedev(cdevsw_lookup_major(&zstty_cdevsw), 0);
        if (tty00_is_console)
diff -r 19ab73db5087 -r 9648e6729222 sys/arch/news68k/news68k/machdep.c
--- a/sys/arch/news68k/news68k/machdep.c        Thu Jun 02 15:24:04 2005 +0000
+++ b/sys/arch/news68k/news68k/machdep.c        Thu Jun 02 15:26:35 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: machdep.c,v 1.59 2005/04/25 15:02:06 lukem Exp $       */
+/*     $NetBSD: machdep.c,v 1.60 2005/06/02 15:26:35 tsutsui Exp $     */
 
 /*
  * Copyright (c) 1982, 1986, 1990, 1993
@@ -77,7 +77,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.59 2005/04/25 15:02:06 lukem Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.60 2005/06/02 15:26:35 tsutsui Exp $");
 
 #include "opt_ddb.h"
 #include "opt_compat_netbsd.h"
@@ -806,11 +806,12 @@
  *  System dependent initilization
  */
 
-static volatile u_char *dip_switch, *int_status;
+static volatile uint8_t *dip_switch, *int_status;
 
-volatile u_char *idrom_addr, *ctrl_ast, *ctrl_int2;
-volatile u_char *ctrl_led, *sccport0a;
-uint32_t lance_mem_phys;
+const uint8_t *idrom_addr;
+volatile uint8_t *ctrl_ast, *ctrl_int2;
+volatile uint8_t *ctrl_led;
+uint32_t sccport0a, lance_mem_phys;
 
 #ifdef news1700
 static volatile u_char *ctrl_parity, *ctrl_parity_clr, *parity_vector;
@@ -870,22 +871,23 @@
 {
        struct oidrom idrom;
        const char *t;
-       u_char *p, *q;
+       const uint8_t *p;
+       uint8_t *q;
        u_int i;
 
-       dip_switch      = (u_char *)IIOV(0xe1c00100);
-       int_status      = (u_char *)IIOV(0xe1c00200);
+       dip_switch      = (uint8_t *)IIOV(0xe1c00100);
+       int_status      = (uint8_t *)IIOV(0xe1c00200);
 
-       idrom_addr      = (u_char *)IIOV(0xe1c00000);
-       ctrl_ast        = (u_char *)IIOV(0xe1280000);
-       ctrl_int2       = (u_char *)IIOV(0xe1180000);
+       idrom_addr      = (uint8_t *)IIOV(0xe1c00000);
+       ctrl_ast        = (uint8_t *)IIOV(0xe1280000);
+       ctrl_int2       = (uint8_t *)IIOV(0xe1180000);
+       ctrl_led        = (uint8_t *)IIOV(ctrl_led_phys);
 
-       sccport0a       = (u_char *)IIOV(0xe0d40002);
-       ctrl_led        = (u_char *)IIOV(ctrl_led_phys);
+       sccport0a       = IIOV(0xe0d40002);
        lance_mem_phys  = 0xe0e00000;
 
-       p = (u_char *)idrom_addr;
-       q = (u_char *)&idrom;
+       p = idrom_addr;
+       q = (uint8_t *)&idrom;
 
        for (i = 0; i < sizeof(idrom); i++, p += 2)
                *q++ = ((*p & 0x0f) << 4) | (*(p + 1) & 0x0f);
@@ -902,9 +904,9 @@
        strcat(cpu_model, t);
        news_machine_id = (idrom.id_serial[0] << 8) + idrom.id_serial[1];
 
-       ctrl_parity     = (u_char *)IIOV(0xe1080000);
-       ctrl_parity_clr = (u_char *)IIOV(0xe1a00000);
-       parity_vector   = (u_char *)IIOV(0xe1c00200);
+       ctrl_parity     = (uint8_t *)IIOV(0xe1080000);
+       ctrl_parity_clr = (uint8_t *)IIOV(0xe1a00000);
+       parity_vector   = (uint8_t *)IIOV(0xe1c00200);
 
        parityenable();
 
@@ -961,22 +963,23 @@
 news1200_init(void)
 {
        struct idrom idrom;
-       u_char *p, *q;
+       const uint8_t *p;
+       uint8_t *q;
        int i;
 
-       dip_switch      = (u_char *)IIOV(0xe1680000);
-       int_status      = (u_char *)IIOV(0xe1200000);
+       dip_switch      = (uint8_t *)IIOV(0xe1680000);
+       int_status      = (uint8_t *)IIOV(0xe1200000);
 
-       idrom_addr      = (u_char *)IIOV(0xe1400000);
-       ctrl_ast        = (u_char *)IIOV(0xe1100000);
-       ctrl_int2       = (u_char *)IIOV(0xe10c0000);
+       idrom_addr      = (uint8_t *)IIOV(0xe1400000);
+       ctrl_ast        = (uint8_t *)IIOV(0xe1100000);
+       ctrl_int2       = (uint8_t *)IIOV(0xe10c0000);
+       ctrl_led        = (uint8_t *)IIOV(ctrl_led_phys);
 
-       sccport0a       = (u_char *)IIOV(0xe1780002);
-       ctrl_led        = (u_char *)IIOV(ctrl_led_phys);
+       sccport0a       = IIOV(0xe1780002);
        lance_mem_phys  = 0xe1a00000;
 
-       p = (u_char *)idrom_addr;
-       q = (u_char *)&idrom;
+       p = idrom_addr;
+       q = (uint8_t *)&idrom;
        for (i = 0; i < sizeof(idrom); i++, p += 2)
                *q++ = ((*p & 0x0f) << 4) | (*(p + 1) & 0x0f);
 



Home | Main Index | Thread Index | Old Index