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 uvm_page_physload() return the registere...



details:   https://anonhg.NetBSD.org/src/rev/4f73c49e8049
branches:  uebayasi-xip
changeset: 751672:4f73c49e8049
user:      uebayasi <uebayasi%NetBSD.org@localhost>
date:      Sun Apr 25 10:15:41 2010 +0000

description:
Make uvm_page_physload() return the registered struct vm_physseg *.

diffstat:

 sys/uvm/uvm_page.c |  27 ++++++++++++++++-----------
 1 files changed, 16 insertions(+), 11 deletions(-)

diffs (100 lines):

diff -r 665e98bb4beb -r 4f73c49e8049 sys/uvm/uvm_page.c
--- a/sys/uvm/uvm_page.c        Sun Apr 25 07:12:11 2010 +0000
+++ b/sys/uvm/uvm_page.c        Sun Apr 25 10:15:41 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uvm_page.c,v 1.153.2.16 2010/02/28 06:29:19 uebayasi Exp $     */
+/*     $NetBSD: uvm_page.c,v 1.153.2.17 2010/04/25 10:15:41 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.16 2010/02/28 06:29:19 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.153.2.17 2010/04/25 10:15:41 uebayasi Exp $");
 
 #include "opt_ddb.h"
 #include "opt_uvmhist.h"
@@ -747,36 +747,40 @@
  * => we are limited to VM_PHYSSEG_MAX physical memory segments
  */
 
-static void
+static struct vm_physseg *
 uvm_page_physload_common(struct vm_physseg * const, const int,
     const paddr_t, const paddr_t, const paddr_t, const paddr_t, const int);
 
-void
+void *
 uvm_page_physload(paddr_t start, paddr_t end, paddr_t avail_start,
     paddr_t avail_end, int free_list)
 {
+       struct vm_physseg *seg;
 
-       uvm_page_physload_common(vm_physmem, vm_nphysmem, start, end,
+       seg = uvm_page_physload_common(vm_physmem, vm_nphysmem, start, end,
            avail_start, avail_end, free_list);
        vm_nphysmem++;
+       return seg;
 }
 
 #ifdef DEVICE_PAGE
-void
+void *
 uvm_page_physload_device(paddr_t start, paddr_t end, paddr_t avail_start,
     paddr_t avail_end, int free_list)
 {
+       struct vm_physseg *seg;
 
-       uvm_page_physload_common(vm_physdev, vm_nphysdev, start, end,
+       seg = uvm_page_physload_common(vm_physdev, vm_nphysdev, start, end,
            avail_start, avail_end, free_list);
        vm_nphysdev++;
 
        for (paddr_t pf = start; pf < end; pf++)
                vm_page_device_mdpage_insert(pf);
+       return seg;
 }
 #endif
 
-static void
+static struct vm_physseg *
 uvm_page_physload_common(struct vm_physseg * const segs, const int nsegs,
     const paddr_t start, const paddr_t end,
     const paddr_t avail_start, const paddr_t avail_end, const int free_list)
@@ -803,7 +807,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 NULL;
        }
 
 #ifdef DEVICE_PAGE
@@ -842,7 +846,7 @@
                        printf("uvm_page_physload: can not malloc vm_page "
                            "structs for segment\n");
                        printf("\tignoring 0x%lx -> 0x%lx\n", start, end);
-                       return;
+                       return NULL;
                }
                /* zero data, init phys_addr, free_list, and free pages */
                memset(pgs, 0, sizeof(struct vm_page) * npages);
@@ -910,7 +914,7 @@
 
 #ifdef DEVICE_PAGE
        if (segs == vm_physdev)
-               return;
+               return ps;
 #endif
 
        /* XXXUEBS ugly */
@@ -923,6 +927,7 @@
        if (!preload) {
                uvmpdpol_reinit();
        }
+       return ps;
 }
 
 /*



Home | Main Index | Thread Index | Old Index