Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 7 May 2011 17:23:13 +0000 (UTC)
From:      Marcel Moolenaar <marcel@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r221606 - head/sys/ia64/ia64
Message-ID:  <201105071723.p47HNDpR008034@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: marcel
Date: Sat May  7 17:23:13 2011
New Revision: 221606
URL: http://svn.freebsd.org/changeset/base/221606

Log:
  In pmap_kextract(), return the physical address for PBVM virtual
  addresses as well (incl. the PBVM page table).

Modified:
  head/sys/ia64/ia64/pmap.c

Modified: head/sys/ia64/ia64/pmap.c
==============================================================================
--- head/sys/ia64/ia64/pmap.c	Sat May  7 16:32:59 2011	(r221605)
+++ head/sys/ia64/ia64/pmap.c	Sat May  7 17:23:13 2011	(r221606)
@@ -65,6 +65,7 @@ __FBSDID("$FreeBSD$");
 #include <vm/vm_pageout.h>
 #include <vm/uma.h>
 
+#include <machine/bootinfo.h>
 #include <machine/md_var.h>
 #include <machine/pal.h>
 
@@ -1206,6 +1207,8 @@ vm_paddr_t
 pmap_kextract(vm_offset_t va)
 {
 	struct ia64_lpte *pte;
+	uint64_t *pbvm_pgtbl;
+	u_int idx;
 
 	KASSERT(va >= VM_MAXUSER_ADDRESS, ("Must be kernel VA"));
 
@@ -1222,6 +1225,25 @@ pmap_kextract(vm_offset_t va)
 		return (pmap_present(pte) ? pmap_ppn(pte)|(va&PAGE_MASK) : 0);
 	}
 
+	/* PBVM page table. */
+	if (va >= IA64_PBVM_PGTBL + bootinfo->bi_pbvm_pgtblsz);
+		return (0);
+	if (va >= IA64_PBVM_PGTBL)
+		return (va - IA64_PBVM_PGTBL) + bootinfo->bi_pbvm_pgtbl;
+
+	/* PBVM. */
+	if (va >= IA64_PBVM_BASE) {
+		pbvm_pgtbl = (void *)IA64_PBVM_PGTBL;
+		idx = (va - IA64_PBVM_BASE) >> IA64_PBVM_PAGE_SHIFT;
+		if (idx >= (bootinfo->bi_pbvm_pgtblsz >> 3))
+			return (0);
+		if ((pbvm_pgtbl[idx] & PTE_PRESENT) == 0)
+			return (0);
+		return ((pbvm_pgtbl[idx] & PTE_PPN_MASK) +
+		    (va & IA64_PBVM_PAGE_MASK));
+	}
+
+	printf("XXX: %s: va=%#lx\n", __func__, va);
 	return (0);
 }
 



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