Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/mips Make db_expr_t long long when using the N32 ABI.



details:   https://anonhg.NetBSD.org/src/rev/ed4b8d286254
branches:  trunk
changeset: 338759:ed4b8d286254
user:      matt <matt%NetBSD.org@localhost>
date:      Sat Jun 06 22:19:07 2015 +0000

description:
Make db_expr_t long long when using the N32 ABI.

diffstat:

 sys/arch/mips/include/db_machdep.h |  7 ++++++-
 sys/arch/mips/mips/db_disasm.c     |  6 +++---
 sys/arch/mips/mips/db_interface.c  |  6 +++---
 sys/arch/mips/mips/db_trace.c      |  6 +++---
 4 files changed, 15 insertions(+), 10 deletions(-)

diffs (104 lines):

diff -r 6b325bbe8218 -r ed4b8d286254 sys/arch/mips/include/db_machdep.h
--- a/sys/arch/mips/include/db_machdep.h        Sat Jun 06 22:06:05 2015 +0000
+++ b/sys/arch/mips/include/db_machdep.h        Sat Jun 06 22:19:07 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: db_machdep.h,v 1.28 2011/07/09 16:58:05 matt Exp $ */
+/* $NetBSD: db_machdep.h,v 1.29 2015/06/06 22:19:07 matt Exp $ */
 
 /*
  * Copyright (c) 1997 Jonathan Stone (hereinafter referred to as the author)
@@ -46,8 +46,13 @@
 #endif
 
 typedef        vaddr_t         db_addr_t;      /* address - unsigned */
+#ifdef __mips_n32
+#define        DDB_EXPR_FMT    "ll"            /* expression is long long */
+typedef        int64_t         db_expr_t;      /* expression - signed */
+#else
 #define        DDB_EXPR_FMT    "l"             /* expression is long */
 typedef        long            db_expr_t;      /* expression - signed */
+#endif
 
 typedef struct reg db_regs_t;
 
diff -r 6b325bbe8218 -r ed4b8d286254 sys/arch/mips/mips/db_disasm.c
--- a/sys/arch/mips/mips/db_disasm.c    Sat Jun 06 22:06:05 2015 +0000
+++ b/sys/arch/mips/mips/db_disasm.c    Sat Jun 06 22:19:07 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: db_disasm.c,v 1.27 2015/06/06 04:32:47 matt Exp $      */
+/*     $NetBSD: db_disasm.c,v 1.28 2015/06/06 22:19:07 matt Exp $      */
 
 /*-
  * Copyright (c) 1991, 1993
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: db_disasm.c,v 1.27 2015/06/06 04:32:47 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_disasm.c,v 1.28 2015/06/06 22:19:07 matt Exp $");
 
 #include <sys/param.h>
 #include <sys/cpu.h>
@@ -820,7 +820,7 @@
                if (diff == 0)
                        db_printf("%s", symname);
                else
-                       db_printf("<%s+%lx>", symname, diff);
+                       db_printf("<%s+%"DDB_EXPR_FMT"x>", symname, diff);
                db_printf("\t[addr:%#"PRIxVADDR"]", loc);
        } else {
                db_printf("%#"PRIxVADDR, loc);
diff -r 6b325bbe8218 -r ed4b8d286254 sys/arch/mips/mips/db_interface.c
--- a/sys/arch/mips/mips/db_interface.c Sat Jun 06 22:06:05 2015 +0000
+++ b/sys/arch/mips/mips/db_interface.c Sat Jun 06 22:19:07 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: db_interface.c,v 1.76 2015/06/06 04:38:52 matt Exp $   */
+/*     $NetBSD: db_interface.c,v 1.77 2015/06/06 22:19:07 matt Exp $   */
 
 /*
  * Mach Operating System
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.76 2015/06/06 04:38:52 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.77 2015/06/06 22:19:07 matt Exp $");
 
 #include "opt_multiprocessor.h"
 #include "opt_cputype.h"       /* which mips CPUs do we support? */
@@ -290,7 +290,7 @@
                 * Cast the physical address -- some platforms, while
                 * being ILP32, may be using 64-bit paddr_t's.
                 */
-               db_printf("0x%lx -> 0x%" PRIx64 "\n", addr,
+               db_printf("0x%" DDB_EXPR_FMT "x -> 0x%" PRIx64 "\n", addr,
                    (uint64_t) kvtophys(addr));
        } else
                printf("not a kernel virtual address\n");
diff -r 6b325bbe8218 -r ed4b8d286254 sys/arch/mips/mips/db_trace.c
--- a/sys/arch/mips/mips/db_trace.c     Sat Jun 06 22:06:05 2015 +0000
+++ b/sys/arch/mips/mips/db_trace.c     Sat Jun 06 22:19:07 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: db_trace.c,v 1.42 2011/04/29 22:14:59 matt Exp $       */
+/*     $NetBSD: db_trace.c,v 1.43 2015/06/06 22:19:07 matt Exp $       */
 
 /*
  * Mach Operating System
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: db_trace.c,v 1.42 2011/04/29 22:14:59 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_trace.c,v 1.43 2015/06/06 22:19:07 matt Exp $");
 
 #include "opt_ddb.h"
 
@@ -169,7 +169,7 @@
        }
 
        if (lwpaddr) {
-               l = (struct lwp *)addr;
+               l = (struct lwp *)(intptr_t)addr;
                (*pr)("pid %d.%d ", l->l_proc->p_pid, l->l_lid);
        } else {
                /* "trace/t" */



Home | Main Index | Thread Index | Old Index