Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/uebayasi-xip]: src/sys/uvm Make struct vm_page_md * -> struct vm_page_md...
details: https://anonhg.NetBSD.org/src/rev/cf0accb04c2a
branches: uebayasi-xip
changeset: 751594:cf0accb04c2a
user: uebayasi <uebayasi%NetBSD.org@localhost>
date: Tue Feb 23 08:46:17 2010 +0000
description:
Make struct vm_page_md * -> struct vm_page_md * lookup a real function and
hide its internal. Won't cause much performance loss because results are
usually cached by callers.
diffstat:
sys/uvm/uvm_page.c | 14 ++++++++++++--
sys/uvm/uvm_page.h | 10 +++-------
2 files changed, 15 insertions(+), 9 deletions(-)
diffs (66 lines):
diff -r 0bfe93c4047c -r cf0accb04c2a sys/uvm/uvm_page.c
--- a/sys/uvm/uvm_page.c Tue Feb 23 07:46:28 2010 +0000
+++ b/sys/uvm/uvm_page.c Tue Feb 23 08:46:17 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: uvm_page.c,v 1.153.2.13 2010/02/23 07:44:25 uebayasi Exp $ */
+/* $NetBSD: uvm_page.c,v 1.153.2.14 2010/02/23 08:46:17 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.13 2010/02/23 07:44:25 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.153.2.14 2010/02/23 08:46:17 uebayasi Exp $");
#include "opt_ddb.h"
#include "opt_uvmhist.h"
@@ -1169,6 +1169,16 @@
* XXX Consider to allocate slots on-demand.
*/
+struct vm_page_md *vm_page_device_mdpage_lookup(struct vm_page *);
+
+struct vm_page_md *
+uvm_vm_page_to_md(struct vm_page *pg)
+{
+
+ return uvm_pageisdevice_p(pg) ?
+ vm_page_device_mdpage_lookup(pg) : &pg->mdpage;
+}
+
struct vm_page_device_mdpage_entry {
struct vm_page_md mde_mdpage;
SLIST_ENTRY(vm_page_device_mdpage_entry) mde_hash;
diff -r 0bfe93c4047c -r cf0accb04c2a sys/uvm/uvm_page.h
--- a/sys/uvm/uvm_page.h Tue Feb 23 07:46:28 2010 +0000
+++ b/sys/uvm/uvm_page.h Tue Feb 23 08:46:17 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: uvm_page.h,v 1.59.2.13 2010/02/23 07:44:25 uebayasi Exp $ */
+/* $NetBSD: uvm_page.h,v 1.59.2.14 2010/02/23 08:46:17 uebayasi Exp $ */
/*
* Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -308,10 +308,6 @@
struct vm_page *uvm_phys_to_vm_page_device(paddr_t);
#endif
-#ifdef XIP
-struct vm_page_md *vm_page_device_mdpage_lookup(struct vm_page *);
-#endif
-
/*
* macros
*/
@@ -324,8 +320,8 @@
#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)
+struct vm_page_md *uvm_vm_page_to_md(struct vm_page *);
+#define VM_PAGE_TO_MD(pg) uvm_vm_page_to_md(pg)
#endif
#endif
Home |
Main Index |
Thread Index |
Old Index