Source-Changes-HG archive

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

[src/trunk]: src/sys/arch Reduce the diff between amd64 and i386.



details:   https://anonhg.NetBSD.org/src/rev/8f9dad0991a1
branches:  trunk
changeset: 826094:8f9dad0991a1
user:      maxv <maxv%NetBSD.org@localhost>
date:      Tue Aug 15 06:57:53 2017 +0000

description:
Reduce the diff between amd64 and i386.

diffstat:

 sys/arch/amd64/amd64/db_interface.c |  17 ++++++++---------
 sys/arch/i386/i386/db_interface.c   |  23 ++++++++---------------
 2 files changed, 16 insertions(+), 24 deletions(-)

diffs (160 lines):

diff -r f0c4c135f563 -r 8f9dad0991a1 sys/arch/amd64/amd64/db_interface.c
--- a/sys/arch/amd64/amd64/db_interface.c       Tue Aug 15 06:39:37 2017 +0000
+++ b/sys/arch/amd64/amd64/db_interface.c       Tue Aug 15 06:57:53 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: db_interface.c,v 1.25 2017/05/23 08:54:38 nonaka Exp $ */
+/*     $NetBSD: db_interface.c,v 1.26 2017/08/15 06:57:53 maxv Exp $   */
 
 /*
  * Mach Operating System
@@ -33,7 +33,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.25 2017/05/23 08:54:38 nonaka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.26 2017/08/15 06:57:53 maxv Exp $");
 
 #include "opt_ddb.h"
 #include "opt_multiprocessor.h"
@@ -66,9 +66,9 @@
 extern const char *const trap_type[];
 extern int trap_types;
 
-int    db_active;
+int    db_active = 0;
 db_regs_t ddb_regs;    /* register state */
-db_regs_t *ddb_regp;
+db_regs_t *ddb_regp = NULL;
 
 void db_mach_cpu (db_expr_t, bool, db_expr_t, const char *);
 
@@ -77,7 +77,7 @@
        { DDB_ADD_CMD("cpu",    db_mach_cpu,    0,
          "switch to another cpu", "cpu-no", NULL) },
 #endif
-       { DDB_ADD_CMD(NULL,     NULL,          0,NULL,NULL,NULL) },
+       { DDB_ADD_CMD(NULL, NULL, 0, NULL, NULL, NULL) },
 };
 
 void kdbprinttrap(int, int);
@@ -143,7 +143,6 @@
 #else
                x86_ipi(ddb_vec, LAPIC_DEST_ALLEXCL, LAPIC_DLMODE_FIXED);
 #endif /* XEN */
-
        }
        ddb_mp_online = x86_mp_online;
        x86_mp_online = false;
@@ -201,7 +200,7 @@
        case -1:        /* keyboard interrupt */
                break;
        default:
-               if (!db_onpanic && db_recover==0)
+               if (!db_onpanic && db_recover == 0)
                        return (0);
 
                kdbprinttrap(type, code);
@@ -235,10 +234,10 @@
        cnpollc(false);
        db_active--;
        splx(s);
-#ifdef MULTIPROCESSOR  
+#ifdef MULTIPROCESSOR
        db_resume_others();
        }
-#endif  
+#endif
        ddb_regp = &dbreg;
 
        *regs = ddb_regs;
diff -r f0c4c135f563 -r 8f9dad0991a1 sys/arch/i386/i386/db_interface.c
--- a/sys/arch/i386/i386/db_interface.c Tue Aug 15 06:39:37 2017 +0000
+++ b/sys/arch/i386/i386/db_interface.c Tue Aug 15 06:57:53 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: db_interface.c,v 1.72 2017/05/23 08:54:38 nonaka Exp $ */
+/*     $NetBSD: db_interface.c,v 1.73 2017/08/15 06:57:53 maxv Exp $   */
 
 /*
  * Mach Operating System
@@ -33,7 +33,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.72 2017/05/23 08:54:38 nonaka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.73 2017/08/15 06:57:53 maxv Exp $");
 
 #include "opt_ddb.h"
 #include "opt_multiprocessor.h"
@@ -48,8 +48,6 @@
 #include <sys/atomic.h>
 #include <sys/cpu.h>
 
-#include <uvm/uvm_extern.h>
-
 #include <dev/cons.h>
 
 #include <machine/cpufunc.h>
@@ -75,6 +73,7 @@
 
 int    db_active = 0;
 db_regs_t ddb_regs;    /* register state */
+db_regs_t *ddb_regp = NULL;
 
 void db_mach_cpu (db_expr_t, bool, db_expr_t, const char *);
 
@@ -83,8 +82,7 @@
        { DDB_ADD_CMD("cpu",    db_mach_cpu,    0,
          "switch to another cpu", "cpu-no", NULL) },
 #endif
-               
-       { DDB_ADD_CMD(NULL, NULL, 0,  NULL,NULL,NULL) },
+       { DDB_ADD_CMD(NULL, NULL, 0, NULL, NULL, NULL) },
 };
 
 void kdbprinttrap(int, int);
@@ -98,9 +96,7 @@
 static bool ddb_mp_online;
 #endif
 
-db_regs_t *ddb_regp = 0;
-
-#define NOCPU -1
+#define NOCPU  -1
 
 int ddb_cpu = NOCPU;
 
@@ -246,6 +242,7 @@
        ddb_regs.tf_fs &= 0xffff;
        ddb_regs.tf_gs &= 0xffff;
        ddb_regs.tf_ss &= 0xffff;
+
        s = splhigh();
        db_active++;
        cnpollc(true);
@@ -356,6 +353,7 @@
        ci->ci_ddb_regs = &regs;
 
        atomic_or_32(&ci->ci_flags, CPUF_PAUSE);
+
        while (ci->ci_flags & CPUF_PAUSE)
                ;
        ci->ci_ddb_regs = 0;
@@ -366,11 +364,7 @@
 extern void cpu_debug_dump(void); /* XXX */
 
 void
-db_mach_cpu(
-       db_expr_t       addr,
-       bool            have_addr,
-       db_expr_t       count,
-       const char *    modif)
+db_mach_cpu(db_expr_t addr, bool have_addr, db_expr_t count, const char *modif)
 {
        struct cpu_info *ci;
        if (!have_addr) {
@@ -401,5 +395,4 @@
        ddb_regp = ci->ci_ddb_regs;
 }
 
-
 #endif



Home | Main Index | Thread Index | Old Index