Author: nwhitehorn
Date: Thu Feb 25 03:49:17 2010
New Revision: 204296
URL: http://svn.freebsd.org/changeset/base/204296

Log:
  Provide an implementation of pmap_dev_direct_mapped() on OEA64. This is
  required in order to be able to mmap the running kernel, which is turn
  required to avoid fstat returning gibberish.

Modified:
  head/sys/powerpc/aim/mmu_oea64.c

Modified: head/sys/powerpc/aim/mmu_oea64.c
==============================================================================
--- head/sys/powerpc/aim/mmu_oea64.c    Thu Feb 25 00:46:51 2010        
(r204295)
+++ head/sys/powerpc/aim/mmu_oea64.c    Thu Feb 25 03:49:17 2010        
(r204296)
@@ -2410,7 +2410,22 @@ moea64_clear_bit(vm_page_t m, u_int64_t 
 boolean_t
 moea64_dev_direct_mapped(mmu_t mmu, vm_offset_t pa, vm_size_t size)
 {
-       return (EFAULT);
+       struct pvo_entry *pvo;
+       vm_offset_t ppa;
+       int error = 0;
+
+       PMAP_LOCK(kernel_pmap);
+       for (ppa = pa & ~ADDR_POFF; ppa < pa + size; ppa += PAGE_SIZE) {
+               pvo = moea64_pvo_find_va(kernel_pmap, ppa, NULL);
+               if (pvo == NULL ||
+                   (pvo->pvo_pte.lpte.pte_lo & LPTE_RPGN) != ppa) {
+                       error = EFAULT;
+                       break;
+               }
+       }
+       PMAP_UNLOCK(kernel_pmap);
+
+       return (error);
 }
 
 /*
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "[email protected]"

Reply via email to