Module Name: src Committed By: uebayasi Date: Thu Oct 21 17:16:28 UTC 2010
Modified Files: src/share/man/man9 [uebayasi-xip]: uvm.9 Log Message: Document uvm_page_physload_device(9). To generate a diff of this commit: cvs rdiff -u -r1.102 -r1.102.2.1 src/share/man/man9/uvm.9 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/share/man/man9/uvm.9 diff -u src/share/man/man9/uvm.9:1.102 src/share/man/man9/uvm.9:1.102.2.1 --- src/share/man/man9/uvm.9:1.102 Sat Apr 17 06:38:13 2010 +++ src/share/man/man9/uvm.9 Thu Oct 21 17:16:28 2010 @@ -1,4 +1,4 @@ -.\" $NetBSD: uvm.9,v 1.102 2010/04/17 06:38:13 jruoho Exp $ +.\" $NetBSD: uvm.9,v 1.102.2.1 2010/10/21 17:16:28 uebayasi Exp $ .\" .\" Copyright (c) 1998 Matthew R. Green .\" All rights reserved. @@ -24,7 +24,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd April 17, 2010 +.Dd October 21, 2010 .Dt UVM 9 .Os .Sh NAME @@ -556,8 +556,6 @@ .Fn uvm_pglistalloc "psize_t size" "paddr_t low" "paddr_t high" "paddr_t alignment" "paddr_t boundary" "struct pglist *rlist" "int nsegs" "int waitok" ; .It Ft void .Fn uvm_pglistfree "struct pglist *list" ; -.It Ft void -.Fn uvm_page_physload "paddr_t start" "paddr_t end" "paddr_t avail_start" "paddr_t avail_end" "int free_list" ; .El .Pp .Fn uvm_pagealloc @@ -654,6 +652,17 @@ the page to serve future .Dv UVM_PGA_ZERO requests efficiently. +.Sh PHYSICAL PAGE REGISTRATION +.Bl -ohang +.It Ft void * +.Fn uvm_page_physload "paddr_t start" "paddr_t end" "paddr_t avail_start" "paddr_t avail_end" "int free_list" ; +.It Ft void +.Fn uvm_page_physunload "void *physseg" ; +.It Ft void * +.Fn uvm_page_physload_device "paddr_t start" "paddr_t end" "paddr_t avail_start" "paddr_t avail_end" "int prot" "int flags" ; +.It Ft void +.Fn uvm_page_physunload_device "void *physseg" ; +.El .Pp .Fn uvm_page_physload loads physical memory segments into VM space on the specified @@ -664,13 +673,70 @@ .Fa start and .Fa end -of the physical addresses of the segment, and the available start and end +of the physical addresses of the segment, and the +.Fa avail_start +and +.Fa avail_end addresses of pages not already in use. If a system has memory banks of different speeds the slower memory should be given a higher .Fa free_list value. .\" XXX expand on "system boot time"! +.Fn uvm_page_physload +returns a cookie pointing to the allocated physical memory segment +object. +.Pp +.Fn uvm_page_physunload +unloads a physical memory segment given as +.Fa physseg , +which is returned by +.Fn uvm_page_physload . +.Pp +.Fn uvm_page_physload_device +loads physical device segments into VM space. +The loaded pages are registered as device pages, not as general +purpose physical memory pages. +Device pages are pages that exist in a device, are accessible as +memory-mapped I/O, and are potentially mapped into user's address +spaces with cache enabled. +Typical use case is XIP, where files in a device are directly +executed without being copied onto RAM (page cache). +.Pp +The arguments describe the +.Fa start +and +.Fa end +of the physical addresses of the segment, and the +.Fa avail_start +and +.Fa avail_end +addresses of pages not already in use. +The +.Fa prot +describes the potential protection (region accessibility) of the +segment specified by OR'ing the following values: +.Bl -tag -width UVM_PROT_WRITEXX +.It Dv UVM_PROT_READ +Pages may be read. +.It Dv UVM_PROT_WRITE +Pages may be written. +.It Dv UVM_PROT_EXEC +Pages may be executed. +.El +.Pp +The +.Fa flags +argument is reserved for future use. +.Fn uvm_page_physload_device +returns a cookie pointing to the allocated physical device segment +object. +.Pp +.Fn uvm_page_physunload_device +unloads a physical device segment given as +.Fa physseg , +which is returned by +.Fn uvm_page_physload_device . .Sh PROCESSES .Bl -ohang .It Ft void