Source-Changes-HG archive

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

[src/uebayasi-xip]: src/sys/uvm Unconditionally provide device page segment d...



details:   https://anonhg.NetBSD.org/src/rev/865ac4cce899
branches:  uebayasi-xip
changeset: 751819:865ac4cce899
user:      uebayasi <uebayasi%NetBSD.org@localhost>
date:      Wed Oct 27 14:51:29 2010 +0000

description:
Unconditionally provide device page segment data structures and
functions as suggested by Chuck Silvers.

(Memory and device segments are being merged soon.)

diffstat:

 sys/uvm/uvm_page.c |  16 ++--------------
 sys/uvm/uvm_page.h |   6 +-----
 2 files changed, 3 insertions(+), 19 deletions(-)

diffs (129 lines):

diff -r ff17fbaf1ad6 -r 865ac4cce899 sys/uvm/uvm_page.c
--- a/sys/uvm/uvm_page.c        Wed Oct 27 14:13:56 2010 +0000
+++ b/sys/uvm/uvm_page.c        Wed Oct 27 14:51:29 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uvm_page.c,v 1.153.2.56 2010/10/22 07:22:57 uebayasi Exp $     */
+/*     $NetBSD: uvm_page.c,v 1.153.2.57 2010/10/27 14:51:29 uebayasi Exp $     */
 
 /*
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -97,7 +97,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.153.2.56 2010/10/22 07:22:57 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.153.2.57 2010/10/27 14:51:29 uebayasi Exp $");
 
 #include "opt_ddb.h"
 #include "opt_uvmhist.h"
@@ -134,13 +134,11 @@
 static struct vm_physseg_freelist vm_physmem_freelist =
     SIMPLEQ_HEAD_INITIALIZER(vm_physmem_freelist);
 
-#ifdef XIP
 struct vm_physseg *vm_physdev_ptrs[VM_PHYSSEG_MAX];
 int vm_nphysdev = 0;
 static struct vm_physseg vm_physdev_store[VM_PHYSSEG_MAX];
 static struct vm_physseg_freelist vm_physdev_freelist =
     SIMPLEQ_HEAD_INITIALIZER(vm_physdev_freelist);
-#endif
 
 /*
  * Some supported CPUs in a given architecture don't support all
@@ -832,7 +830,6 @@
        vm_nphysmem--;
 }
 
-#ifdef XIP
 void *
 uvm_page_physload_device(paddr_t start, paddr_t end, paddr_t avail_start,
     paddr_t avail_end, int prot, int flags)
@@ -905,7 +902,6 @@
        uvm_physseg_free(&vm_physdev_freelist, vm_physdev_ptrs, seg);
        vm_nphysdev--;
 }
-#endif
 
 int uvm_physseg_inited;
 
@@ -962,12 +958,10 @@
                SIMPLEQ_INSERT_TAIL(&vm_physmem_freelist,
                    &vm_physmem_store[lcv], list);
        }
-#ifdef XIP
        for (lcv = 0; lcv < VM_PHYSSEG_MAX; lcv++) {
                SIMPLEQ_INSERT_TAIL(&vm_physdev_freelist,
                    &vm_physdev_store[lcv], list);
        }
-#endif
 }
 
 static void
@@ -1059,7 +1053,6 @@
            pframe, NULL, offp);
 }
 
-#ifdef XIP
 int
 vm_physseg_find_device(paddr_t pframe, int *offp)
 {
@@ -1067,7 +1060,6 @@
        return VM_PHYSSEG_FIND(vm_physdev_ptrs, vm_nphysdev, VM_PHYSSEG_OP_PF,
            pframe, NULL, offp);
 }
-#endif
 
 #if VM_PHYSSEG_MAX == 1
 static inline int
@@ -1201,11 +1193,9 @@
        int     off;
        int     psi;
 
-#ifdef XIP
        psi = vm_physseg_find_device(pf, &off);
        if (psi != -1)
                return(&vm_physdev_ptrs[psi]->pgs[off]);
-#endif
        psi = vm_physseg_find(pf, &off);
        if (psi != -1)
                return(&vm_physmem_ptrs[psi]->pgs[off]);
@@ -2221,9 +2211,7 @@
 {
 
        return
-#ifdef XIP
            (vm_physseg_find_device(atop(pa), NULL) != -1) ||
-#endif
            (vm_physseg_find(atop(pa), NULL) != -1);
 }
 
diff -r ff17fbaf1ad6 -r 865ac4cce899 sys/uvm/uvm_page.h
--- a/sys/uvm/uvm_page.h        Wed Oct 27 14:13:56 2010 +0000
+++ b/sys/uvm/uvm_page.h        Wed Oct 27 14:51:29 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uvm_page.h,v 1.59.2.31 2010/10/22 07:22:57 uebayasi Exp $      */
+/*     $NetBSD: uvm_page.h,v 1.59.2.32 2010/10/27 14:51:30 uebayasi Exp $      */
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -269,10 +269,8 @@
 
 extern struct vm_physseg *vm_physmem_ptrs[VM_PHYSSEG_MAX];
 extern int vm_nphysmem;
-#ifdef XIP
 extern struct vm_physseg *vm_physdev_ptrs[VM_PHYSSEG_MAX];
 extern int vm_nphysdev;
-#endif
 
 #define        vm_nphysseg     vm_nphysmem     /* XXX backward compat */
 
@@ -311,9 +309,7 @@
 int vm_physseg_find(paddr_t, int *);
 struct vm_page *uvm_phys_to_vm_page(paddr_t);
 paddr_t uvm_vm_page_to_phys(const struct vm_page *);
-#ifdef XIP
 int vm_physseg_find_device(paddr_t, int *);
-#endif
 
 /*
  * macros



Home | Main Index | Thread Index | Old Index