Module Name: src
Committed By: uebayasi
Date: Fri Feb 12 04:33:05 UTC 2010
Modified Files:
src/sys/uvm [uebayasi-xip]: uvm_page.c uvm_page.h
Log Message:
Enable the newly added VM_PAGE_TO_MD() only #ifdef __HAVE_VM_PAGE_MD.
Pointed out by m...@.
To generate a diff of this commit:
cvs rdiff -u -r1.153.2.11 -r1.153.2.12 src/sys/uvm/uvm_page.c
cvs rdiff -u -r1.59.2.10 -r1.59.2.11 src/sys/uvm/uvm_page.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/uvm/uvm_page.c
diff -u src/sys/uvm/uvm_page.c:1.153.2.11 src/sys/uvm/uvm_page.c:1.153.2.12
--- src/sys/uvm/uvm_page.c:1.153.2.11 Wed Feb 10 14:18:31 2010
+++ src/sys/uvm/uvm_page.c Fri Feb 12 04:33:05 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: uvm_page.c,v 1.153.2.11 2010/02/10 14:18:31 uebayasi Exp $ */
+/* $NetBSD: uvm_page.c,v 1.153.2.12 2010/02/12 04:33:05 uebayasi Exp $ */
/*
* Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -71,7 +71,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.153.2.11 2010/02/10 14:18:31 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.153.2.12 2010/02/12 04:33:05 uebayasi Exp $");
#include "opt_ddb.h"
#include "opt_uvmhist.h"
@@ -1047,6 +1047,7 @@
*/
/* Assume struct vm_page * is aligned to 4 bytes. */
+/* XXXUEBS Consider to improve this. */
#define VM_PAGE_DEVICE_MAGIC 0x2
#define VM_PAGE_DEVICE_MAGIC_MASK 0x3
#define VM_PAGE_DEVICE_MAGIC_SHIFT 2
@@ -1117,13 +1118,15 @@
}
+#ifdef __HAVE_VM_PAGE_MD
#ifdef XIP
/*
* Device page's mdpage lookup.
*
+ * - Needed when promoting an XIP vnode page and invalidating its old mapping.
+ *
* - Hashing code is based on sys/arch/x86/x86/pmap.c.
*
- * -
* XXX Consider to allocate slots on-demand.
*/
@@ -1236,6 +1239,7 @@
return &mde->mde_mdpage;
}
#endif
+#endif
/*
Index: src/sys/uvm/uvm_page.h
diff -u src/sys/uvm/uvm_page.h:1.59.2.10 src/sys/uvm/uvm_page.h:1.59.2.11
--- src/sys/uvm/uvm_page.h:1.59.2.10 Wed Feb 10 14:18:31 2010
+++ src/sys/uvm/uvm_page.h Fri Feb 12 04:33:05 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: uvm_page.h,v 1.59.2.10 2010/02/10 14:18:31 uebayasi Exp $ */
+/* $NetBSD: uvm_page.h,v 1.59.2.11 2010/02/12 04:33:05 uebayasi Exp $ */
/*
* Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -322,12 +322,14 @@
#define VM_PAGE_TO_PHYS(entry) uvm_vm_page_to_phys(entry)
+#ifdef __HAVE_VM_PAGE_MD
#ifndef XIP
#define VM_PAGE_TO_MD(pg) (&(pg)->mdpage)
#else
#define VM_PAGE_TO_MD(pg) \
(uvm_pageisdevice_p(pg) ? vm_page_device_mdpage_lookup(pg) : &(pg)->mdpage)
#endif
+#endif
/*
* Compute the page color bucket for a given page.