Source-Changes-HG archive

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

[src/uebayasi-xip]: src/sys/uvm "int free_list" (VM_FREELIST_*) is specific t...



details:   https://anonhg.NetBSD.org/src/rev/bd94444fa08c
branches:  uebayasi-xip
changeset: 751705:bd94444fa08c
user:      uebayasi <uebayasi%NetBSD.org@localhost>
date:      Thu Apr 29 03:15:10 2010 +0000

description:
"int free_list" (VM_FREELIST_*) is specific to struct vm_page (memory
page).  Handle it only in memory physseg parts.

Record device page's properties in struct vm_physseg for future uses.
For example, framebuffers that is capable of some accelarated bus access
(e.g. write-combining) should register its capability through "int
flags".

diffstat:

 sys/uvm/uvm_extern.h |   4 ++--
 sys/uvm/uvm_page.c   |  24 ++++++++++++++----------
 sys/uvm/uvm_page.h   |   9 ++++++++-
 3 files changed, 24 insertions(+), 13 deletions(-)

diffs (129 lines):

diff -r 684801a86eae -r bd94444fa08c sys/uvm/uvm_extern.h
--- a/sys/uvm/uvm_extern.h      Thu Apr 29 03:10:13 2010 +0000
+++ b/sys/uvm/uvm_extern.h      Thu Apr 29 03:15:10 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uvm_extern.h,v 1.161.2.4 2010/04/28 13:28:42 uebayasi Exp $    */
+/*     $NetBSD: uvm_extern.h,v 1.161.2.5 2010/04/29 03:15:10 uebayasi Exp $    */
 
 /*
  *
@@ -724,7 +724,7 @@
                            paddr_t, paddr_t, int);
 void                   uvm_page_physunload(void *);
 void                   *uvm_page_physload_device(paddr_t, paddr_t,
-                           paddr_t, paddr_t, int);
+                           paddr_t, paddr_t, int, int);
 void                   uvm_page_physunload_device(void *);
 void                   uvm_setpagesize(void);
 
diff -r 684801a86eae -r bd94444fa08c sys/uvm/uvm_page.c
--- a/sys/uvm/uvm_page.c        Thu Apr 29 03:10:13 2010 +0000
+++ b/sys/uvm/uvm_page.c        Thu Apr 29 03:15:10 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uvm_page.c,v 1.153.2.34 2010/04/29 03:10:13 uebayasi Exp $     */
+/*     $NetBSD: uvm_page.c,v 1.153.2.35 2010/04/29 03:15:11 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.34 2010/04/29 03:10:13 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.153.2.35 2010/04/29 03:15:11 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)
diff -r 684801a86eae -r bd94444fa08c sys/uvm/uvm_page.h
--- a/sys/uvm/uvm_page.h        Thu Apr 29 03:10:13 2010 +0000
+++ b/sys/uvm/uvm_page.h        Thu Apr 29 03:15:10 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uvm_page.h,v 1.59.2.19 2010/04/28 09:27:47 uebayasi Exp $      */
+/*     $NetBSD: uvm_page.h,v 1.59.2.20 2010/04/29 03:15:11 uebayasi Exp $      */
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -235,15 +235,22 @@
 struct vm_physseg {
        paddr_t start;                  /* PF# of first page in segment */
        paddr_t end;                    /* (PF# of last page in segment) + 1 */
+
+       /* memory properties */
        paddr_t avail_start;            /* PF# of first free page in segment */
        paddr_t avail_end;              /* (PF# of last free page in segment) +1  */
        int     free_list;              /* which free list they belong on */
        struct  vm_page *pgs;           /* vm_page structures (from start) */
        struct  vm_page *endpg;         /* vm_page structure for end */
+
 #ifdef __HAVE_PMAP_PHYSSEG
        struct  pmap_physseg pmseg;     /* pmap specific (MD) data */
 #endif
        SIMPLEQ_ENTRY(vm_physseg) list;
+
+       /* device properties */
+       int     prot;                   /* protection of device region */
+       int     flags;                  /* XXXUEBS BUS_SPACE_MAP_* */
 };
 
 #ifdef _KERNEL



Home | Main Index | Thread Index | Old Index