summaryrefslogtreecommitdiffstats
path: root/sys/ia64
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2003-04-22 01:48:43 +0000
committermarcel <marcel@FreeBSD.org>2003-04-22 01:48:43 +0000
commitbbf5306d5f9c1d8bdeb772e78f14c2b586537ca6 (patch)
treea75aed5589f05d7eee03c498e98551d29ccbc8fb /sys/ia64
parenteea2b01ecc9290198c033df5726fece0029096cb (diff)
downloadFreeBSD-src-bbf5306d5f9c1d8bdeb772e78f14c2b586537ca6.zip
FreeBSD-src-bbf5306d5f9c1d8bdeb772e78f14c2b586537ca6.tar.gz
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
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 738fefc..288838e 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 2644899..4ee712d 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);
OpenPOWER on IntegriCloud