aboutsummaryrefslogtreecommitdiff
path: root/sys/ia64
diff options
context:
space:
mode:
authorMarcel Moolenaar <marcel@FreeBSD.org>2003-04-22 01:48:43 +0000
committerMarcel Moolenaar <marcel@FreeBSD.org>2003-04-22 01:48:43 +0000
commit148eac48f142b1f0af49ef83abadc81dffd1d97c (patch)
treea75aed5589f05d7eee03c498e98551d29ccbc8fb /sys/ia64
parent44d993e38abe74635d491115dc7b1b2986cca373 (diff)
downloadsrc-148eac48f142b1f0af49ef83abadc81dffd1d97c.tar.gz
src-148eac48f142b1f0af49ef83abadc81dffd1d97c.zip
Don't use the tpa instruction to implement pmap_kextract. The tpa
instruction requires that a translation is present in the TC. This may trigger a TLB miss and a subsequent call to vm_fault(). This implementation is deliberately non-inline for debugging and profiling purposes. Partial or full inlining should eventually be done. Valuable insights by: jake
Notes
Notes: svn path=/head/; revision=113831
Diffstat (limited to 'sys/ia64')
-rw-r--r--sys/ia64/ia64/pmap.c25
-rw-r--r--sys/ia64/include/pmap.h9
2 files changed, 26 insertions, 8 deletions
diff --git a/sys/ia64/ia64/pmap.c b/sys/ia64/ia64/pmap.c
index 738fefc6b974..288838e66c43 100644
--- a/sys/ia64/ia64/pmap.c
+++ b/sys/ia64/ia64/pmap.c
@@ -1334,6 +1334,31 @@ pmap_remove_pte(pmap_t pmap, struct ia64_lpte *pte, vm_offset_t va,
}
/*
+ * Extract the physical page address associated with a kernel
+ * virtual address.
+ */
+vm_paddr_t
+pmap_kextract(vm_offset_t va)
+{
+ struct ia64_lpte *pte;
+
+ KASSERT(va >= IA64_RR_BASE(5), ("Must be kernel VA"));
+
+ /* Regions 6 and 7 are direct mapped. */
+ if (va >= IA64_RR_BASE(6))
+ return (IA64_RR_MASK(va));
+
+ /* Bail out if the virtual address is beyond our limits. */
+ if (IA64_RR_MASK(va) >= nkpt * PAGE_SIZE * NKPTEPG)
+ return (0);
+
+ pte = pmap_find_kpte(va);
+ if (!pte->pte_p)
+ return (0);
+ return ((pte->pte_ppn << 12) | (va & PAGE_MASK));
+}
+
+/*
* Add a list of wired pages to the kva
* this routine is only used for temporary
* kernel mappings that do not need to have
diff --git a/sys/ia64/include/pmap.h b/sys/ia64/include/pmap.h
index 2644899e24b6..4ee712d36e56 100644
--- a/sys/ia64/include/pmap.h
+++ b/sys/ia64/include/pmap.h
@@ -59,14 +59,6 @@
#endif
#define MAXKPT (PAGE_SIZE/sizeof(vm_offset_t))
-/*
- * Routine: pmap_kextract
- * Function:
- * Extract the physical page address associated
- * kernel virtual address.
- */
-#define pmap_kextract ia64_tpa
-
#define vtophys(va) pmap_kextract(((vm_offset_t) (va)))
#endif /* _KERNEL */
@@ -127,6 +119,7 @@ extern vm_offset_t virtual_end;
vm_offset_t pmap_steal_memory(vm_size_t);
void pmap_bootstrap(void);
void pmap_kenter(vm_offset_t va, vm_offset_t pa);
+vm_paddr_t pmap_kextract(vm_offset_t va);
void pmap_kremove(vm_offset_t);
void pmap_setdevram(unsigned long long basea, vm_offset_t sizea);
int pmap_uses_prom_console(void);