Page MenuHomeFreeBSD

D26314.id76623.diff
No OneTemporary

D26314.id76623.diff

Index: sys/powerpc/aim/mmu_oea64.c
===================================================================
--- sys/powerpc/aim/mmu_oea64.c
+++ sys/powerpc/aim/mmu_oea64.c
@@ -66,12 +66,13 @@
#include <sys/vmmeter.h>
#include <sys/smp.h>
#include <sys/reboot.h>
-
+#include <sys/mman.h>
#include <sys/kdb.h>
#include <dev/ofw/openfirm.h>
#include <vm/vm.h>
+#include <vm/pmap.h>
#include <vm/vm_param.h>
#include <vm/vm_kern.h>
#include <vm/vm_page.h>
@@ -315,7 +316,7 @@
#ifdef __powerpc64__
static void moea64_page_array_startup(long);
#endif
-
+static int moea64_mincore(pmap_t, vm_offset_t, vm_paddr_t *);
static struct pmap_funcs moea64_methods = {
.clear_modify = moea64_clear_modify,
@@ -332,6 +333,7 @@
.is_referenced = moea64_is_referenced,
.ts_referenced = moea64_ts_referenced,
.map = moea64_map,
+ .mincore = moea64_mincore,
.page_exists_quick = moea64_page_exists_quick,
.page_init = moea64_page_init,
.page_wired_mappings = moea64_page_wired_mappings,
@@ -1223,6 +1225,50 @@
PMAP_UNLOCK(pm);
}
+static int
+moea64_mincore(pmap_t pmap, vm_offset_t addr, vm_paddr_t *pap)
+{
+ struct pvo_entry *pvo;
+ vm_paddr_t pa;
+ vm_page_t m;
+ int val;
+ bool managed;
+
+ PMAP_LOCK(pmap);
+
+ pvo = moea64_pvo_find_va(pmap, addr);
+ if (pvo != NULL) {
+ pa = PVO_PADDR(pvo);
+ m = PHYS_TO_VM_PAGE(pa);
+ managed = (pvo->pvo_vaddr & PVO_MANAGED) == PVO_MANAGED;
+ val = MINCORE_INCORE;
+ } else {
+ PMAP_UNLOCK(pmap);
+ return (0);
+ }
+
+ PMAP_UNLOCK(pmap);
+
+ if (m == NULL)
+ return (0);
+
+ if (managed) {
+ if (moea64_is_modified(m))
+ val |= MINCORE_MODIFIED | MINCORE_MODIFIED_OTHER;
+
+ if (moea64_is_referenced(m))
+ val |= MINCORE_REFERENCED | MINCORE_REFERENCED_OTHER;
+ }
+
+ if ((val & (MINCORE_MODIFIED_OTHER | MINCORE_REFERENCED_OTHER)) !=
+ (MINCORE_MODIFIED_OTHER | MINCORE_REFERENCED_OTHER) &&
+ managed) {
+ *pap = pa;
+ }
+
+ return (val);
+}
+
/*
* This goes through and sets the physical address of our
* special scratch PTE to the PA we want to zero or copy. Because

File Metadata

Mime Type
text/plain
Expires
Thu, Mar 19, 10:51 AM (6 h, 1 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29960944
Default Alt Text
D26314.id76623.diff (2 KB)

Event Timeline