Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/mips/mips adapt to DDB constification, and fix a sh...



details:   https://anonhg.NetBSD.org/src/rev/0234e34efa62
branches:  trunk
changeset: 581437:0234e34efa62
user:      drochner <drochner%NetBSD.org@localhost>
date:      Wed Jun 01 16:26:59 2005 +0000

description:
adapt to DDB constification, and fix a shadow warning

diffstat:

 sys/arch/mips/mips/db_disasm.c    |  24 ++++++++++++------------
 sys/arch/mips/mips/db_interface.c |  39 +++++++++++++++++++++------------------
 2 files changed, 33 insertions(+), 30 deletions(-)

diffs (237 lines):

diff -r 2bfd3176aff1 -r 0234e34efa62 sys/arch/mips/mips/db_disasm.c
--- a/sys/arch/mips/mips/db_disasm.c    Wed Jun 01 16:17:40 2005 +0000
+++ b/sys/arch/mips/mips/db_disasm.c    Wed Jun 01 16:26:59 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: db_disasm.c,v 1.14 2005/05/30 02:26:17 simonb Exp $    */
+/*     $NetBSD: db_disasm.c,v 1.15 2005/06/01 16:26:59 drochner Exp $  */
 
 /*-
  * Copyright (c) 1991, 1993
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: db_disasm.c,v 1.14 2005/05/30 02:26:17 simonb Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_disasm.c,v 1.15 2005/06/01 16:26:59 drochner Exp $");
 
 #include <sys/types.h>
 #include <sys/systm.h>
@@ -52,7 +52,7 @@
 #include <ddb/db_extern.h>
 #include <ddb/db_sym.h>
 
-static char *op_name[64] = {
+static const char *op_name[64] = {
 /* 0 */ "spec", "bcond","j",   "jal",  "beq",  "bne",  "blez", "bgtz",
 /* 8 */ "addi", "addiu","slti", "sltiu","andi", "ori", "xori", "lui",
 /*16 */ "cop0", "cop1", "cop2", "cop3", "beql", "bnel", "blezl","bgtzl",
@@ -63,7 +63,7 @@
 /*56 */ "sc",  "swc1", "swc2", "swc3", "scd",  "sdc1", "sdc2", "sd"
 };
 
-static char *spec_name[64] = {
+static const char *spec_name[64] = {
 /* 0 */ "sll", "spec01","srl", "sra",  "sllv", "spec05","srlv","srav",
 /* 8 */ "jr",  "jalr", "spec12","spec13","syscall","break","spec16","sync",
 /*16 */ "mfhi", "mthi", "mflo", "mtlo", "dsllv","spec25","dsrlv","dsrav",
@@ -74,18 +74,18 @@
 /*56 */ "dsll","spec71","dsrl","dsra","dsll32","spec75","dsrl32","dsra32"
 };
 
-static char *spec2_name[4] = {         /* QED RM4650, R5000, etc. */
+static const char *spec2_name[4] = {           /* QED RM4650, R5000, etc. */
 /* 0 */ "mad", "madu", "mul", "spec3"
 };
 
-static char *bcond_name[32] = {
+static const char *bcond_name[32] = {
 /* 0 */ "bltz", "bgez", "bltzl", "bgezl", "?", "?", "?", "?",
 /* 8 */ "tgei", "tgeiu", "tlti", "tltiu", "teqi", "?", "tnei", "?",
 /*16 */ "bltzal", "bgezal", "bltzall", "bgezall", "?", "?", "?", "?",
 /*24 */ "?", "?", "?", "?", "?", "?", "?", "?",
 };
 
-static char *cop1_name[64] = {
+static const char *cop1_name[64] = {
 /* 0 */ "fadd",  "fsub", "fmpy", "fdiv", "fsqrt","fabs", "fmov", "fneg",
 /* 8 */ "fop08","fop09","fop0a","fop0b","fop0c","fop0d","fop0e","fop0f",
 /*16 */ "fop10","fop11","fop12","fop13","fop14","fop15","fop16","fop17",
@@ -98,7 +98,7 @@
        "fcmp.le","fcmp.ngt"
 };
 
-static char *fmt_name[16] = {
+static const char *fmt_name[16] = {
        "s",    "d",    "e",    "fmt3",
        "w",    "fmt5", "fmt6", "fmt7",
        "fmt8", "fmt9", "fmta", "fmtb",
@@ -106,14 +106,14 @@
 };
 
 #if defined(__mips_n32) || defined(__mips_n64)
-static char *reg_name[32] = {
+static const char *reg_name[32] = {
        "zero", "at",   "v0",   "v1",   "a0",   "a1",   "a2",   "a3",
        "a4",   "a5",   "a6",   "a7",   "t0",   "t1",   "t2",   "t3",
        "s0",   "s1",   "s2",   "s3",   "s4",   "s5",   "s6",   "s7",
        "t8",   "t9",   "k0",   "k1",   "gp",   "sp",   "s8",   "ra"
 };
 #else
-static char *reg_name[32] = {
+static const char *reg_name[32] = {
        "zero", "at",   "v0",   "v1",   "a0",   "a1",   "a2",   "a3",
        "t0",   "t1",   "t2",   "t3",   "t4",   "t5",   "t6",   "t7",
        "s0",   "s1",   "s2",   "s3",   "s4",   "s5",   "s6",   "s7",
@@ -121,7 +121,7 @@
 };
 #endif /* __mips_n32 || __mips_n64 */
 
-static char *c0_opname[64] = {
+static const char *c0_opname[64] = {
        "c0op00","tlbr",  "tlbwi", "c0op03","c0op04","c0op05","tlbwr", "c0op07",
        "tlbp",  "c0op11","c0op12","c0op13","c0op14","c0op15","c0op16","c0op17",
        "rfe",   "c0op21","c0op22","c0op23","c0op24","c0op25","c0op26","c0op27",
@@ -132,7 +132,7 @@
        "c0op70","c0op71","c0op72","c0op73","c0op74","c0op75","c0op77","c0op77",
 };
 
-static char *c0_reg[32] = {
+static const char *c0_reg[32] = {
        "index",    "random",   "tlblo0",  "tlblo1",
        "context",  "pagemask", "wired",   "cp0r7",
        "badvaddr", "count",    "tlbhi",   "compare",
diff -r 2bfd3176aff1 -r 0234e34efa62 sys/arch/mips/mips/db_interface.c
--- a/sys/arch/mips/mips/db_interface.c Wed Jun 01 16:17:40 2005 +0000
+++ b/sys/arch/mips/mips/db_interface.c Wed Jun 01 16:26:59 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: db_interface.c,v 1.52 2005/01/01 03:25:46 simonb Exp $ */
+/*     $NetBSD: db_interface.c,v 1.53 2005/06/01 16:26:59 drochner Exp $       */
 
 /*
  * Mach Operating System
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.52 2005/01/01 03:25:46 simonb Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.53 2005/06/01 16:26:59 drochner Exp $");
 
 #include "opt_cputype.h"       /* which mips CPUs do we support? */
 #include "opt_ddb.h"
@@ -63,9 +63,9 @@
 db_regs_t      ddb_regs;
 mips_reg_t     kdbaux[11]; /* XXX struct switchframe: better inside curpcb? XXX */
 
-void db_tlbdump_cmd(db_expr_t, int, db_expr_t, char *);
-void db_kvtophys_cmd(db_expr_t, int, db_expr_t, char *);
-void db_cp0dump_cmd(db_expr_t, int, db_expr_t, char *);
+void db_tlbdump_cmd(db_expr_t, int, db_expr_t, const char *);
+void db_kvtophys_cmd(db_expr_t, int, db_expr_t, const char *);
+void db_cp0dump_cmd(db_expr_t, int, db_expr_t, const char *);
 
 static void    kdbpoke_4(vaddr_t addr, int newval);
 static void    kdbpoke_2(vaddr_t addr, short newval);
@@ -290,7 +290,7 @@
  * Write bytes to kernel address space for debugger.
  */
 void
-db_write_bytes(vaddr_t addr, size_t size, char *data)
+db_write_bytes(vaddr_t addr, size_t size, const char *data)
 {
        vaddr_t p = addr;
        size_t n = size;
@@ -301,19 +301,19 @@
 #endif
 
        while (n >= 4) {
-               kdbpoke_4(p, *(int*)data);
+               kdbpoke_4(p, *(const int *)data);
                p += 4;
                data += 4;
                n -= 4;
        }
        if (n >= 2) {
-               kdbpoke_2(p, *(short*)data);
+               kdbpoke_2(p, *(const short *)data);
                p += 2;
                data += 2;
                n -= 2;
        }
        if (n == 1) {
-               kdbpoke_1(p, *(char*)data);
+               kdbpoke_1(p, *(const char *)data);
        }
 
        mips_icache_sync_range((vaddr_t) addr, size);
@@ -321,7 +321,8 @@
 
 #ifndef KGDB
 void
-db_tlbdump_cmd(db_expr_t addr, int have_addr, db_expr_t count, char *modif)
+db_tlbdump_cmd(db_expr_t addr, int have_addr, db_expr_t count,
+              const char *modif)
 {
 
 #ifdef MIPS1
@@ -383,7 +384,8 @@
 }
 
 void
-db_kvtophys_cmd(db_expr_t addr, int have_addr, db_expr_t count, char *modif)
+db_kvtophys_cmd(db_expr_t addr, int have_addr, db_expr_t count,
+               const char *modif)
 {
 
        if (!have_addr)
@@ -429,7 +431,8 @@
 } while (0)
 
 void
-db_cp0dump_cmd(db_expr_t addr, int have_addr, db_expr_t count, char *modif)
+db_cp0dump_cmd(db_expr_t addr, int have_addr, db_expr_t count,
+              const char *modif)
 {
 
        SHOW32(MIPS_COP_0_TLB_INDEX, "index");
@@ -550,10 +553,10 @@
 inst_branch(int inst)
 {
        InstFmt i;
-       int delay;
+       int delslt;
 
        i.word = inst;
-       delay = 0;
+       delslt = 0;
        switch (i.JType.op) {
        case OP_BCOND:
        case OP_J:
@@ -566,7 +569,7 @@
        case OP_BNEL:
        case OP_BLEZL:
        case OP_BGTZL:
-               delay = 1;
+               delslt = 1;
                break;
 
        case OP_COP0:
@@ -574,16 +577,16 @@
                switch (i.RType.rs) {
                case OP_BCx:
                case OP_BCy:
-                       delay = 1;
+                       delslt = 1;
                }
                break;
 
        case OP_SPECIAL:
                if (i.RType.op == OP_JR || i.RType.op == OP_JALR)
-                       delay = 1;
+                       delslt = 1;
                break;
        }
-       return delay;
+       return delslt;
 }
 
 /*



Home | Main Index | Thread Index | Old Index