Module Name: src
Committed By: uebayasi
Date: Sun Apr 25 10:15:41 UTC 2010
Modified Files:
src/sys/uvm [uebayasi-xip]: uvm_page.c
Log Message:
Make uvm_page_physload() return the registered struct vm_physseg *.
To generate a diff of this commit:
cvs rdiff -u -r1.153.2.16 -r1.153.2.17 src/sys/uvm/uvm_page.c
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.16 src/sys/uvm/uvm_page.c:1.153.2.17
--- src/sys/uvm/uvm_page.c:1.153.2.16 Sun Feb 28 06:29:19 2010
+++ src/sys/uvm/uvm_page.c Sun Apr 25 10:15:41 2010
@@ -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;
}
/*