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 avoid build failure on !DBB kernels.



details:   https://anonhg.NetBSD.org/src/rev/3ba26b9fe79e
branches:  trunk
changeset: 942743:3ba26b9fe79e
user:      mrg <mrg%NetBSD.org@localhost>
date:      Mon Aug 17 21:50:14 2020 +0000

description:
avoid build failure on !DBB kernels.

should fix arc, emips, ews4800mips, mipsco, newsmips and pmax builds.

diffstat:

 sys/arch/mips/mips/mips_stacktrace.c |  16 +++++++++++++---
 1 files changed, 13 insertions(+), 3 deletions(-)

diffs (57 lines):

diff -r 372d39a437e4 -r 3ba26b9fe79e sys/arch/mips/mips/mips_stacktrace.c
--- a/sys/arch/mips/mips/mips_stacktrace.c      Mon Aug 17 21:25:12 2020 +0000
+++ b/sys/arch/mips/mips/mips_stacktrace.c      Mon Aug 17 21:50:14 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mips_stacktrace.c,v 1.3 2020/08/17 04:15:34 mrg Exp $  */
+/*     $NetBSD: mips_stacktrace.c,v 1.4 2020/08/17 21:50:14 mrg Exp $  */
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -40,7 +40,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mips_stacktrace.c,v 1.3 2020/08/17 04:15:34 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mips_stacktrace.c,v 1.4 2020/08/17 21:50:14 mrg Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -62,9 +62,9 @@
 #ifdef DDB
 #include <machine/db_machdep.h>
 #include <ddb/db_sym.h>
-#endif
 #include <ddb/db_user.h>
 #include <ddb/db_access.h>
+#endif
 
 #ifdef KGDB
 #include <sys/kgdb.h>
@@ -201,7 +201,11 @@
                printf("kdbpeek: NULL\n");
                return false;
        } else {
+#if _KERNEL
+               *valp = *(unsigned *)addr;
+#else
                db_read_bytes((db_addr_t)addr, sizeof(unsigned), (char *)valp);
+#endif
                return true;
        }
 }
@@ -223,9 +227,15 @@
                rc = 0xdeadfeed;
        } else {
                if (sizeof(mips_reg_t) == 8 && n == 8)
+#if _KERNEL
                        db_read_bytes((db_addr_t)addr, sizeof(int64_t), (char *)&rc);
                else
                        db_read_bytes((db_addr_t)addr, sizeof(int32_t), (char *)&rc);
+#else
+                       rc = *(int64_t *)addr;
+               else
+                       rc = *(int32_t *)addr;
+#endif
        }
        return rc;
 }



Home | Main Index | Thread Index | Old Index