Source-Changes-HG archive

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

[src/uebayasi-xip]: src/sys/uvm Fix thinko in previous.



details:   https://anonhg.NetBSD.org/src/rev/2fb1180918f3
branches:  uebayasi-xip
changeset: 751702:2fb1180918f3
user:      uebayasi <uebayasi%NetBSD.org@localhost>
date:      Thu Apr 29 03:00:47 2010 +0000

description:
Fix thinko in previous.

diffstat:

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

diffs (88 lines):

diff -r d9918aebb44e -r 2fb1180918f3 sys/uvm/uvm_page.c
--- a/sys/uvm/uvm_page.c        Thu Apr 29 02:37:09 2010 +0000
+++ b/sys/uvm/uvm_page.c        Thu Apr 29 03:00:47 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uvm_page.c,v 1.153.2.31 2010/04/29 02:37:09 uebayasi Exp $     */
+/*     $NetBSD: uvm_page.c,v 1.153.2.32 2010/04/29 03:00:47 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.31 2010/04/29 02:37:09 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.153.2.32 2010/04/29 03:00:47 uebayasi Exp $");
 
 #include "opt_ddb.h"
 #include "opt_uvmhist.h"
@@ -757,8 +757,9 @@
  */
 
 static struct vm_physseg *
-uvm_page_physload_common(struct vm_physseg_freelist * const, struct vm_physseg **, int,
-    const paddr_t, const paddr_t, const paddr_t, const paddr_t, const int);
+uvm_page_physload_common(struct vm_physseg_freelist * const,
+    struct vm_physseg **, int,
+    const paddr_t, const paddr_t, const paddr_t, const paddr_t);
 static void
 uvm_page_physunload_common(struct vm_physseg_freelist *,
     struct vm_physseg **, struct vm_physseg *);
@@ -778,8 +779,11 @@
        struct vm_physseg *seg;
        int lcv;
 
+       if (free_list >= VM_NFREELIST || free_list < VM_FREELIST_DEFAULT)
+               panic("uvm_page_physload: bad free list %d", free_list);
+
        seg = uvm_page_physload_common(&vm_physmem_freelist, vm_physmem_ptrs,
-           vm_nphysmem, start, end, avail_start, avail_end, free_list);
+           vm_nphysmem, start, end, avail_start, avail_end);
        KASSERT(seg != NULL);
 
        seg->avail_start = avail_start;
@@ -820,14 +824,16 @@
 #ifdef DEVICE_PAGE
 void *
 uvm_page_physload_device(paddr_t start, paddr_t end, paddr_t avail_start,
-    paddr_t avail_end, int free_list)
+    paddr_t avail_end, int prot, int flags)
 {
        struct vm_physseg *seg;
 
        seg = uvm_page_physload_common(&vm_physdev_freelist, vm_physdev_ptrs,
-           vm_nphysdev, start, end, avail_start, avail_end, free_list);
+           vm_nphysdev, start, end, avail_start, avail_end);
        KASSERT(seg != NULL);
 
+       seg->prot = prot;
+       seg->flags = flags;     /* XXXUEBS BUS_SPACE_MAP_* */
        for (paddr_t pf = start; pf < end; pf++)
                vm_page_device_mdpage_insert(pf);
        vm_nphysdev++;
@@ -850,15 +856,13 @@
 uvm_page_physload_common(struct vm_physseg_freelist *freelist,
     struct vm_physseg **segs, int nsegs,
     const paddr_t start, const paddr_t end,
-    const paddr_t avail_start, const paddr_t avail_end, const int free_list)
+    const paddr_t avail_start, const paddr_t avail_end)
 {
        struct vm_physseg *ps;
        static int uvm_page_physseg_inited;
 
        if (uvmexp.pagesize == 0)
                panic("uvm_page_physload: page size not set!");
-       if (free_list >= VM_NFREELIST || free_list < VM_FREELIST_DEFAULT)
-               panic("uvm_page_physload: bad free list %d", free_list);
        if (start >= end)
                panic("uvm_page_physload: start >= end");
        if (nsegs == VM_PHYSSEG_MAX)
@@ -968,7 +972,7 @@
                *segp = *(segp + 1);
                segp++;
        }
-       *(segp + VM_PHYSSEG_MAX - 1) = NULL;
+       *segp = NULL;
 }
 
 /*



Home | Main Index | Thread Index | Old Index