Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 11 Nov 2003 00:15:15 -0800 (PST)
From:      Juli Mallett <jmallett@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 41975 for review
Message-ID:  <200311110815.hAB8FFYG011998@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=41975

Change 41975 by jmallett@jmallett_dalek on 2003/11/11 00:14:14

	Ignore obsessive-compulsive desire to sort includes and just
	commit something which further desorts and happens to make
	the kvtop command available.

Affected files ...

.. //depot/projects/mips/sys/mips/mips/db_interface.c#9 edit

Differences ...

==== //depot/projects/mips/sys/mips/mips/db_interface.c#9 (text+ko) ====

@@ -44,6 +44,9 @@
 #include <machine/locore.h>
 #include <machine/mips_opcode.h>
 
+#include <vm/vm.h>
+#include <vm/pmap.h>
+
 #include <machine/db_machdep.h>
 #include <ddb/ddb.h>
 #include <ddb/db_access.h>
@@ -301,23 +304,14 @@
 	}
 }
 
-#if 0 /* XXX notyet */
-DB_COMMAND(kvtob, db_kvtophys_cmd)
+DB_COMMAND(kvtop, db_kvtophys_cmd)
 {
 
 	if (!have_addr)
 		return;
-	if (MIPS_KSEG2_START <= addr) {
-		/*
-		 * Cast the physical address -- some platforms, while
-		 * being ILP32, may be using 64-bit paddr_t's.
-		 */
-		db_printf("0x%lx -> 0x%qx\n", addr,
-		    (unsigned long long) kvtophys(addr));
-	} else
-		printf("not a kernel virtual address\n");
+	db_printf("%#lx -> %#lx\n", (u_long)addr,
+		  (u_long)pmap_kextract(addr));
 }
-#endif
 
 #define	FLDWIDTH	10
 #define	SHOW32(reg, name)						\



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200311110815.hAB8FFYG011998>