Module Name:    src
Committed By:   maxv
Date:           Tue Aug 15 08:35:56 UTC 2017

Modified Files:
        src/sys/arch/amd64/amd64: kgdb_machdep.c
        src/sys/arch/i386/i386: kgdb_machdep.c

Log Message:
Reduce the diff between amd64 and i386. It also fixes a bug in amd64, where
large pages were not handled correctly.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/amd64/amd64/kgdb_machdep.c
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/i386/i386/kgdb_machdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/amd64/amd64/kgdb_machdep.c
diff -u src/sys/arch/amd64/amd64/kgdb_machdep.c:1.10 src/sys/arch/amd64/amd64/kgdb_machdep.c:1.11
--- src/sys/arch/amd64/amd64/kgdb_machdep.c:1.10	Sun Nov 22 13:41:24 2015
+++ src/sys/arch/amd64/amd64/kgdb_machdep.c	Tue Aug 15 08:35:56 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: kgdb_machdep.c,v 1.10 2015/11/22 13:41:24 maxv Exp $	*/
+/*	$NetBSD: kgdb_machdep.c,v 1.11 2017/08/15 08:35:56 maxv Exp $	*/
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -56,7 +56,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kgdb_machdep.c,v 1.10 2015/11/22 13:41:24 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kgdb_machdep.c,v 1.11 2017/08/15 08:35:56 maxv Exp $");
 
 #include "opt_ddb.h"
 
@@ -93,7 +93,10 @@ kgdb_acc(vaddr_t va, size_t len)
 			pte = kvtopte(va);
 		if ((*pte & PG_V) == 0)
 			return (0);
-		va += PAGE_SIZE;
+		if (*pte & PG_PS)
+			va = (va & PG_LGFRAME) + NBPD_L2;
+		else
+			va += PAGE_SIZE;
 	} while (va < last_va);
 
 	return (1);
@@ -217,7 +220,6 @@ kgdb_setregs(db_regs_t *regs, kgdb_reg_t
 void
 kgdb_connect(int verbose)
 {
-
 	if (kgdb_dev == NODEV)
 		return;
 

Index: src/sys/arch/i386/i386/kgdb_machdep.c
diff -u src/sys/arch/i386/i386/kgdb_machdep.c:1.22 src/sys/arch/i386/i386/kgdb_machdep.c:1.23
--- src/sys/arch/i386/i386/kgdb_machdep.c:1.22	Sun Apr  3 22:29:26 2011
+++ src/sys/arch/i386/i386/kgdb_machdep.c	Tue Aug 15 08:35:56 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: kgdb_machdep.c,v 1.22 2011/04/03 22:29:26 dyoung Exp $	*/
+/*	$NetBSD: kgdb_machdep.c,v 1.23 2017/08/15 08:35:56 maxv Exp $	*/
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -56,7 +56,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kgdb_machdep.c,v 1.22 2011/04/03 22:29:26 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kgdb_machdep.c,v 1.23 2017/08/15 08:35:56 maxv Exp $");
 
 #include "opt_ddb.h"
 
@@ -70,10 +70,7 @@ __KERNEL_RCSID(0, "$NetBSD: kgdb_machdep
 #include <sys/kgdb.h>
 #include <sys/systm.h>
 
-#include <uvm/uvm_extern.h>
-
 #include <machine/pte.h>
-#include <machine/reg.h>
 #include <machine/trap.h>
 
 /*
@@ -116,7 +113,7 @@ kgdb_entry_notice(int type, db_regs_t *r
  * Translate a trap number into a unix compatible signal value.
  * (gdb only understands unix signal numbers).
  */
-int 
+int
 kgdb_signal(int type)
 {
 	switch (type) {

Reply via email to