Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/uvm Use uvm_physseg.h:uvm_page_physload() instead of uvm...



details:   https://anonhg.NetBSD.org/src/rev/4b85e466a610
branches:  trunk
changeset: 819904:4b85e466a610
user:      cherry <cherry%NetBSD.org@localhost>
date:      Thu Dec 22 13:26:24 2016 +0000

description:
Use uvm_physseg.h:uvm_page_physload() instead of uvm_extern.h

For this, include uvm_physseg.h in the build and include tree, make a
cosmetic modification to the prototype for uvm_page_physload().

diffstat:

 sys/uvm/Makefile     |   4 ++--
 sys/uvm/uvm.h        |   3 ++-
 sys/uvm/uvm_extern.h |  13 +++++++++----
 sys/uvm/uvm_page.c   |  10 ++++++----
 4 files changed, 19 insertions(+), 11 deletions(-)

diffs (113 lines):

diff -r 859d54abc187 -r 4b85e466a610 sys/uvm/Makefile
--- a/sys/uvm/Makefile  Thu Dec 22 12:57:18 2016 +0000
+++ b/sys/uvm/Makefile  Thu Dec 22 13:26:24 2016 +0000
@@ -1,11 +1,11 @@
-#      $NetBSD: Makefile,v 1.9 2006/02/11 12:45:07 yamt Exp $
+#      $NetBSD: Makefile,v 1.10 2016/12/22 13:26:24 cherry Exp $
 
 INCSDIR= /usr/include/uvm
 
 INCS=  uvm.h uvm_amap.h uvm_anon.h uvm_aobj.h uvm_device.h \
        uvm_extern.h uvm_fault.h uvm_fault_i.h uvm_glue.h \
        uvm_km.h uvm_loan.h \
-       uvm_map.h uvm_object.h uvm_page.h \
+       uvm_map.h uvm_object.h uvm_page.h uvm_physseg.h \
        uvm_pager.h uvm_param.h uvm_pdaemon.h uvm_pglist.h \
        uvm_pmap.h uvm_prot.h uvm_stat.h \
        uvm_swap.h
diff -r 859d54abc187 -r 4b85e466a610 sys/uvm/uvm.h
--- a/sys/uvm/uvm.h     Thu Dec 22 12:57:18 2016 +0000
+++ b/sys/uvm/uvm.h     Thu Dec 22 13:26:24 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uvm.h,v 1.66 2015/04/13 22:04:44 riastradh Exp $       */
+/*     $NetBSD: uvm.h,v 1.67 2016/12/22 13:26:24 cherry Exp $  */
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -57,6 +57,7 @@
 #include <uvm/uvm_object.h>
 #include <uvm/uvm_page.h>
 #include <uvm/uvm_pager.h>
+#include <uvm/uvm_physseg.h>
 #include <uvm/uvm_pdaemon.h>
 #include <uvm/uvm_swap.h>
 
diff -r 859d54abc187 -r 4b85e466a610 sys/uvm/uvm_extern.h
--- a/sys/uvm/uvm_extern.h      Thu Dec 22 12:57:18 2016 +0000
+++ b/sys/uvm/uvm_extern.h      Thu Dec 22 13:26:24 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uvm_extern.h,v 1.199 2016/12/22 12:55:21 cherry Exp $  */
+/*     $NetBSD: uvm_extern.h,v 1.200 2016/12/22 13:26:24 cherry Exp $  */
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -475,6 +475,14 @@
 #endif
 
 /*
+ * Include the uvm_hotplug(9) API unconditionally until
+ * uvm_page_physload() et. al. are obsoleted
+ *
+ * After this, MD code will have to explicitly include it if needed.
+ */
+#include <uvm/uvm_physseg.h> 
+
+/*
  * helpers for calling ubc_release()
  */
 #ifdef PMAP_CACHE_VIVT
@@ -709,9 +717,6 @@
                            struct vm_page *);
 void                   uvm_pagerealloc(struct vm_page *,
                            struct uvm_object *, voff_t);
-/* Actually, uvm_page_physload takes PF#s which need their own type */
-void                   uvm_page_physload(paddr_t, paddr_t, paddr_t,
-                           paddr_t, int);
 void                   uvm_setpagesize(void);
 
 /* uvm_pager.c */
diff -r 859d54abc187 -r 4b85e466a610 sys/uvm/uvm_page.c
--- a/sys/uvm/uvm_page.c        Thu Dec 22 12:57:18 2016 +0000
+++ b/sys/uvm/uvm_page.c        Thu Dec 22 13:26:24 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uvm_page.c,v 1.187 2015/04/11 19:24:13 joerg Exp $     */
+/*     $NetBSD: uvm_page.c,v 1.188 2016/12/22 13:26:25 cherry Exp $    */
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -66,7 +66,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.187 2015/04/11 19:24:13 joerg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.188 2016/12/22 13:26:25 cherry Exp $");
 
 #include "opt_ddb.h"
 #include "opt_uvm.h"
@@ -735,7 +735,7 @@
  * => we are limited to VM_PHYSSEG_MAX physical memory segments
  */
 
-void
+uvm_physseg_t
 uvm_page_physload(paddr_t start, paddr_t end, paddr_t avail_start,
     paddr_t avail_end, int free_list)
 {
@@ -761,7 +761,7 @@
                printf("\t%d segments allocated, ignoring 0x%llx -> 0x%llx\n",
                    VM_PHYSSEG_MAX, (long long)start, (long long)end);
                printf("\tincrease VM_PHYSSEG_MAX\n");
-               return;
+               return 0;
        }
 
        /*
@@ -840,6 +840,8 @@
        if (!preload) {
                uvmpdpol_reinit();
        }
+
+       return 0;
 }
 
 /*



Home | Main Index | Thread Index | Old Index