Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F106066154
D26314.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D26314.diff
View Options
Index: head/sys/powerpc/aim/mmu_oea64.c
===================================================================
--- head/sys/powerpc/aim/mmu_oea64.c
+++ head/sys/powerpc/aim/mmu_oea64.c
@@ -57,6 +57,7 @@
#include <sys/lock.h>
#include <sys/msgbuf.h>
#include <sys/malloc.h>
+#include <sys/mman.h>
#include <sys/mutex.h>
#include <sys/proc.h>
#include <sys/rwlock.h>
@@ -72,6 +73,7 @@
#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,6 +317,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,
@@ -331,6 +334,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,
@@ -1219,6 +1223,51 @@
pm->pm_stats.wired_count--;
}
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);
+
+ /* XXX Add support for superpages */
+ 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);
}
/*
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Dec 25, 7:55 PM (10 h, 51 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15598331
Default Alt Text
D26314.diff (2 KB)
Attached To
Mode
D26314: Implement pmap_mincore() for Powerpc
Attached
Detach File
Event Timeline
Log In to Comment