Source-Changes-HG archive

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

[src/trunk]: src/sys/arch adapt to const changes.



details:   https://anonhg.NetBSD.org/src/rev/e005208ff3a2
branches:  trunk
changeset: 581666:e005208ff3a2
user:      chs <chs%NetBSD.org@localhost>
date:      Fri Jun 03 15:21:35 2005 +0000

description:
adapt to const changes.

diffstat:

 sys/arch/hp700/hp700/power.c   |  10 +++++-----
 sys/arch/hppa/hppa/db_disasm.c |  35 +++++++++++++++++------------------
 sys/arch/hppa/hppa/db_memrw.c  |   6 +++---
 3 files changed, 25 insertions(+), 26 deletions(-)

diffs (199 lines):

diff -r 6607084fdc85 -r e005208ff3a2 sys/arch/hp700/hp700/power.c
--- a/sys/arch/hp700/hp700/power.c      Fri Jun 03 15:18:38 2005 +0000
+++ b/sys/arch/hp700/hp700/power.c      Fri Jun 03 15:21:35 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: power.c,v 1.1 2005/01/31 18:17:35 jkunz Exp $ */
+/* $NetBSD: power.c,v 1.2 2005/06/03 15:21:35 chs Exp $ */
 /*
  * Copyright (c) 2004 Jochen Kunz.
  * All rights reserved.
@@ -34,7 +34,7 @@
 
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: power.c,v 1.1 2005/01/31 18:17:35 jkunz Exp $");
+__KERNEL_RCSID(0, "$NetBSD: power.c,v 1.2 2005/06/03 15:21:35 chs Exp $");
 
 
 /*
@@ -95,8 +95,8 @@
 static bus_space_handle_t pwr_sw_reg_bsh;
 int pwr_sw_state;
 static int pwr_sw_control;
-static char *pwr_sw_state_str[] = {"off", "on"};
-static char *pwr_sw_control_str[] = {"disabled", "enabled", "locked"};
+static const char *pwr_sw_state_str[] = {"off", "on"};
+static const char *pwr_sw_control_str[] = {"disabled", "enabled", "locked"};
 static int pwr_sw_poll_interval; 
 static int pwr_sw_count;
 static struct sysmon_pswitch *pwr_sw_sysmon;
@@ -287,7 +287,7 @@
        struct sysctlnode node;
 
        node = *rnode;
-       node.sysctl_data = pwr_sw_state_str[pwr_sw_state];
+       node.sysctl_data = __UNCONST(pwr_sw_state_str[pwr_sw_state]);
        return sysctl_lookup(SYSCTLFN_CALL(&node));
 }
 
diff -r 6607084fdc85 -r e005208ff3a2 sys/arch/hppa/hppa/db_disasm.c
--- a/sys/arch/hppa/hppa/db_disasm.c    Fri Jun 03 15:18:38 2005 +0000
+++ b/sys/arch/hppa/hppa/db_disasm.c    Fri Jun 03 15:21:35 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: db_disasm.c,v 1.6 2004/02/13 11:36:13 wiz Exp $        */
+/*     $NetBSD: db_disasm.c,v 1.7 2005/06/03 15:21:35 chs Exp $        */
 
 /*     $OpenBSD: db_disasm.c,v 1.9 2000/04/18 20:02:45 mickey Exp $    */
 
@@ -51,7 +51,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: db_disasm.c,v 1.6 2004/02/13 11:36:13 wiz Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_disasm.c,v 1.7 2005/06/03 15:21:35 chs Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -909,10 +909,10 @@
 
 /* Disassembly functions */
 int fcoprDasm(union insn, u_int, u_int);
-char *edDCond(u_int);
-char *unitDCond(u_int);
-char *addDCond(u_int);
-char *subDCond(u_int);
+const char *edDCond(u_int);
+const char *unitDCond(u_int);
+const char *addDCond(u_int);
+const char *subDCond(u_int);
 int blDasm(const struct inst *, OFS, union insn);
 int ldDasm(const struct inst *, OFS, union insn);
 int stDasm(const struct inst *, OFS, union insn);
@@ -1155,7 +1155,6 @@
 };
 
 
-static const struct inst illeg = { 0, 0, 0, 0, 0, "???", 0 };
 static const struct inst *so_sysop[0xd0];
 static const struct inst *so_mmuop[0x50];
 static const struct inst *so_arith[0x80];
@@ -1171,7 +1170,7 @@
 static const struct inst *so_shext[0x08];
 static const struct inst *so_deps [0x08];
 
-#define ILLEG (const struct inst **)&illeg
+#define ILLEG NULL
 #define NENTS(a) (sizeof(a)/sizeof(a[0])-1)
 static struct majoropcode majopcs[NMAJOPCS] = {
        { so_sysop, NENTS(so_sysop) }, /* 00 */
@@ -1289,7 +1288,7 @@
        for (i = &instrs[0]; *i->mnem; i++) {
                m = &majopcs[i->majopc];
                if (m->maxsubop == 1)
-                       m->subops = (const struct inst **)i;
+                       m->subops = __UNCONST(i);
                else
                        m->subops[i->opcext] = i;
        }
@@ -1415,7 +1414,7 @@
  *  ascii description of the passed numeric condition.
  *---------------------------------------------------------------------------*/
 
-char *
+const char *
 subDCond(u_int cond)
 {
        switch(cond) {
@@ -1446,7 +1445,7 @@
  *  ascii description of the passed numeric condition.
  *---------------------------------------------------------------------------*/
 
-char *
+const char *
 addDCond(u_int cond)
 {
        switch(cond) {
@@ -1471,7 +1470,7 @@
        }
 }
 
-char *
+const char *
 unitDCond(u_int cond)
 {
        switch(cond) {
@@ -1492,7 +1491,7 @@
        }
 }
 
-char *
+const char *
 edDCond(u_int cond)
 {
        switch(cond) {
@@ -1884,7 +1883,7 @@
 {
        u_int op1, r1, fmt, t;
        u_int op2, r2, dfmt;
-       char *p;
+       const char *p;
 
        op1 = CoprExt1(w);
        op2 = CoprExt2(w);
@@ -1988,7 +1987,7 @@
 fcoprDasm(union insn w, u_int op1, u_int op2)
 {
        u_int r1, r2, t, fmt, dfmt;
-       char *p;
+       const char *p;
 
        if (AstNu(w) && op1 == ((1<<4) | 2)) {
                if (op2 == 0 || op2 == 1 || op2 == 2) {
@@ -2072,7 +2071,7 @@
 {
        u_int uid = Uid(w);
        int load = 0;
-       char *pfx = uid > 1 ? "c" : "f";
+       const char *pfx = uid > 1 ? "c" : "f";
        int dreg = 0;
 
        if (Match("copr")) {
@@ -2274,9 +2273,9 @@
                if (i->dasmfcn)
                        (*i->dasmfcn)(i, ofs, instruct);
                else if (i->mnem[0] == '?')
-                       db_printf(illeg.mnem);
+                       db_printf("???");
        } else
-               db_printf(illeg.mnem);
+               db_printf("???");
 
        db_printf("\n");
        return (loc + sizeof(instruct));
diff -r 6607084fdc85 -r e005208ff3a2 sys/arch/hppa/hppa/db_memrw.c
--- a/sys/arch/hppa/hppa/db_memrw.c     Fri Jun 03 15:18:38 2005 +0000
+++ b/sys/arch/hppa/hppa/db_memrw.c     Fri Jun 03 15:21:35 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: db_memrw.c,v 1.4 2003/11/28 19:02:25 chs Exp $ */
+/*     $NetBSD: db_memrw.c,v 1.5 2005/06/03 15:21:35 chs Exp $ */
 
 /*     $OpenBSD: db_interface.c,v 1.16 2001/03/22 23:31:45 mickey Exp $        */
 
@@ -33,7 +33,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: db_memrw.c,v 1.4 2003/11/28 19:02:25 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_memrw.c,v 1.5 2005/06/03 15:21:35 chs Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -56,7 +56,7 @@
 }
 
 void
-db_write_bytes(vaddr_t addr, size_t size, char *data)
+db_write_bytes(vaddr_t addr, size_t size, const char *data)
 {
        char *dst = (char *)addr;
        extern int etext;



Home | Main Index | Thread Index | Old Index