summaryrefslogtreecommitdiffstats
path: root/sys/amd64
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2013-05-21 11:07:12 +0000
committerkib <kib@FreeBSD.org>2013-05-21 11:07:12 +0000
commit5ee265a48b9d84470be16cf6a33fb09cd280a92a (patch)
tree461a41eef9da99ee38d9ea58f56be7b2fe696451 /sys/amd64
parentf8c66c9055c669f366e04b67bc673f48e8793869 (diff)
downloadFreeBSD-src-5ee265a48b9d84470be16cf6a33fb09cd280a92a.zip
FreeBSD-src-5ee265a48b9d84470be16cf6a33fb09cd280a92a.tar.gz
Add amd64-specific ddb command 'show phys2dmap', which calculates the
address in the direct map corresponding to the given physical address. Reviewed by: jhb Sponsored by: The FreeBSD Foundation MFC after: 1 week
Diffstat (limited to 'sys/amd64')
-rw-r--r--sys/amd64/amd64/pmap.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c
index 1b1c86c..ebb184e 100644
--- a/sys/amd64/amd64/pmap.c
+++ b/sys/amd64/amd64/pmap.c
@@ -5535,4 +5535,16 @@ DB_SHOW_COMMAND(pte, pmap_print_pte)
pte = pmap_pde_to_pte(pde, va);
db_printf(" pte %#016lx\n", *pte);
}
+
+DB_SHOW_COMMAND(phys2dmap, pmap_phys2dmap)
+{
+ vm_paddr_t a;
+
+ if (have_addr) {
+ a = (vm_paddr_t)addr;
+ db_printf("0x%jx\n", (uintmax_t)PHYS_TO_DMAP(a));
+ } else {
+ db_printf("show phys2dmap addr\n");
+ }
+}
#endif
OpenPOWER on IntegriCloud