Module Name:    src
Committed By:   uebayasi
Date:           Thu Apr 29 03:15:11 UTC 2010

Modified Files:
        src/sys/uvm [uebayasi-xip]: uvm_extern.h uvm_page.c uvm_page.h

Log Message:
"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".


To generate a diff of this commit:
cvs rdiff -u -r1.161.2.4 -r1.161.2.5 src/sys/uvm/uvm_extern.h
cvs rdiff -u -r1.153.2.34 -r1.153.2.35 src/sys/uvm/uvm_page.c
cvs rdiff -u -r1.59.2.19 -r1.59.2.20 src/sys/uvm/uvm_page.h

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_extern.h
diff -u src/sys/uvm/uvm_extern.h:1.161.2.4 src/sys/uvm/uvm_extern.h:1.161.2.5
--- src/sys/uvm/uvm_extern.h:1.161.2.4	Wed Apr 28 13:28:42 2010
+++ src/sys/uvm/uvm_extern.h	Thu Apr 29 03:15:10 2010
@@ -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);
 

Index: src/sys/uvm/uvm_page.c
diff -u src/sys/uvm/uvm_page.c:1.153.2.34 src/sys/uvm/uvm_page.c:1.153.2.35
--- src/sys/uvm/uvm_page.c:1.153.2.34	Thu Apr 29 03:10:13 2010
+++ src/sys/uvm/uvm_page.c	Thu Apr 29 03:15:11 2010
@@ -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)

Index: src/sys/uvm/uvm_page.h
diff -u src/sys/uvm/uvm_page.h:1.59.2.19 src/sys/uvm/uvm_page.h:1.59.2.20
--- src/sys/uvm/uvm_page.h:1.59.2.19	Wed Apr 28 09:27:47 2010
+++ src/sys/uvm/uvm_page.h	Thu Apr 29 03:15:11 2010
@@ -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

Reply via email to