CVS commit: [uebayasi-xip] src/share/man/man9
Module Name:src Committed By: uebayasi Date: Tue Nov 9 06:03:30 UTC 2010 Modified Files: src/share/man/man9 [uebayasi-xip]: uvm.9 Log Message: Sync with HEAD. To generate a diff of this commit: cvs rdiff -u -r1.102.2.2 -r1.102.2.3 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.2.2 src/share/man/man9/uvm.9:1.102.2.3 --- src/share/man/man9/uvm.9:1.102.2.2 Tue Nov 2 14:05:27 2010 +++ src/share/man/man9/uvm.9 Tue Nov 9 06:03:29 2010 @@ -1,4 +1,4 @@ -.\" $NetBSD: uvm.9,v 1.102.2.2 2010/11/02 14:05:27 uebayasi Exp $ +.\" $NetBSD: uvm.9,v 1.102.2.3 2010/11/09 06:03:29 uebayasi Exp $ .\" .\" Copyright (c) 2010 The NetBSD Froundation, Inc. .\" Copyright (c) 1998 Matthew R. Green @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd November 2, 2010 +.Dd November 7, 2010 .Dt UVM 9 .Os .Sh NAME @@ -1008,8 +1008,6 @@ /* vm_page counters */ int npages; /* number of pages we manage */ int free; /* number of free pages */ -int active; /* number of active pages */ -int inactive; /* number of pages that we free'd but may want back */ int paging; /* number of pages in the process of being paged out */ int wired; /* number of wired pages */ int reserve_pagedaemon; /* number of pages reserved for pagedaemon */
CVS commit: [uebayasi-xip] src/share/man/man9
Module Name:src Committed By: uebayasi Date: Sat Nov 6 08:07:36 UTC 2010 Modified Files: src/share/man/man9 [uebayasi-xip]: KASSERT.9 Log Message: Sync with HEAD. To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.7.10.1 src/share/man/man9/KASSERT.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/KASSERT.9 diff -u src/share/man/man9/KASSERT.9:1.7 src/share/man/man9/KASSERT.9:1.7.10.1 --- src/share/man/man9/KASSERT.9:1.7 Fri Jul 11 13:20:17 2008 +++ src/share/man/man9/KASSERT.9 Sat Nov 6 08:07:36 2010 @@ -1,4 +1,4 @@ -.\" $NetBSD: KASSERT.9,v 1.7 2008/07/11 13:20:17 gdt Exp $ +.\" $NetBSD: KASSERT.9,v 1.7.10.1 2010/11/06 08:07:36 uebayasi Exp $ .\" .\" Copyright (c) 2006 Igor Sobrado .\" All rights reserved. @@ -24,7 +24,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd December 10, 2006 +.Dd October 28, 2010 .Dt KASSERT 9 .Os .Sh NAME @@ -68,6 +68,7 @@ number the failure happened on. .Sh SEE ALSO .Xr config 1 , +.Xr CTASSERT 9 , .Xr panic 9 , .Xr printf 9 .Sh AUTHORS
CVS commit: [uebayasi-xip] src/share/man/man9
Module Name:src Committed By: uebayasi Date: Fri Nov 5 08:55:57 UTC 2010 Modified Files: src/share/man/man9 [uebayasi-xip]: disk.9 Log Message: Document DIOCGPHYSSEG. To generate a diff of this commit: cvs rdiff -u -r1.35 -r1.35.2.1 src/share/man/man9/disk.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/disk.9 diff -u src/share/man/man9/disk.9:1.35 src/share/man/man9/disk.9:1.35.2.1 --- src/share/man/man9/disk.9:1.35 Wed Dec 30 14:53:02 2009 +++ src/share/man/man9/disk.9 Fri Nov 5 08:55:57 2010 @@ -1,4 +1,4 @@ -.\" $NetBSD: disk.9,v 1.35 2009/12/30 14:53:02 wiz Exp $ +.\" $NetBSD: disk.9,v 1.35.2.1 2010/11/05 08:55:57 uebayasi Exp $ .\" .\" Copyright (c) 1995, 1996 Jason R. Thorpe. .\" All rights reserved. @@ -30,7 +30,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd December 30, 2009 +.Dd November 5, 2010 .Dt DISK 9 .Os .Sh NAME @@ -299,6 +299,11 @@ Set disk buffer queue strategy. .It Dv DIOCGDISKINFO "struct plistref" Get disk-info dictionary. +.It Dv DIOCGPHYSSEG "void *phys" +Return a VM physical segment cookie allocated for the device to +VFS, to support +.Xr xip 4 +functionality. .El .Sh USING THE FRAMEWORK This section includes a description on basic use of the framework
CVS commit: [uebayasi-xip] src/share/man/man9/man9.i386
Module Name:src Committed By: uebayasi Date: Fri Oct 22 07:37:27 UTC 2010 Removed Files: src/share/man/man9/man9.i386 [uebayasi-xip]: nmi.9 Log Message: Merge botch. To generate a diff of this commit: cvs rdiff -u -r1.2 -r0 src/share/man/man9/man9.i386/nmi.9 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: [uebayasi-xip] src/share/man/man9
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
CVS commit: [uebayasi-xip] src/share/man/man9
Module Name:src Committed By: uebayasi Date: Thu Jul 29 04:44:34 UTC 2010 Modified Files: src/share/man/man9 [uebayasi-xip]: bus_space.9 Log Message: Document bus_space_physload(9), bus_space_physunload(9), bus_space_physload_device(9), and bus_space_physunload_device(9). To generate a diff of this commit: cvs rdiff -u -r1.40 -r1.40.2.1 src/share/man/man9/bus_space.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/bus_space.9 diff -u src/share/man/man9/bus_space.9:1.40 src/share/man/man9/bus_space.9:1.40.2.1 --- src/share/man/man9/bus_space.9:1.40 Fri Apr 16 20:05:37 2010 +++ src/share/man/man9/bus_space.9 Thu Jul 29 04:44:34 2010 @@ -1,4 +1,4 @@ -.\" $NetBSD: bus_space.9,v 1.40 2010/04/16 20:05:37 dyoung Exp $ +.\" $NetBSD: bus_space.9,v 1.40.2.1 2010/07/29 04:44:34 uebayasi Exp $ .\" .\" Copyright (c) 1997 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -27,7 +27,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd April 16, 2010 +.Dd July 29, 2010 .Dt BUS_SPACE 9 .Os .Sh NAME @@ -45,6 +45,10 @@ .Nm bus_space_peek_2 , .Nm bus_space_peek_4 , .Nm bus_space_peek_8 , +.Nm bus_space_physload , +.Nm bus_space_physload_device , +.Nm bus_space_physunload , +.Nm bus_space_physunload_device , .Nm bus_space_poke_1 , .Nm bus_space_poke_2 , .Nm bus_space_poke_4 , @@ -144,6 +148,16 @@ .Ft int .Fn bus_space_peek_8 "bus_space_tag_t space" "bus_space_handle_t handle" \ "bus_size_t offset" "uint64_t *datap" +.Ft void * +.Fn bus_space_physload "bus_space_tag_t space" "bus_addr_t addr" "bus_size_t size" \ +"int freelist" +.Ft void +.Fn bus_space_physunload "bus_space_tag_t space" "void *phys" +.Ft void * +.Fn bus_space_physload_device "bus_space_tag_t space" "bus_addr_t addr" "bus_size_t size" \ +"int prot" "int flags" +.Ft void +.Fn bus_space_physunload_device "bus_space_tag_t space" "void *phys" .Ft int .Fn bus_space_poke_1 "bus_space_tag_t space" "bus_space_handle_t handle" \ "bus_size_t offset" "uint8_t data" @@ -732,7 +746,7 @@ .Fn bus_space_free is called on a handle, all subregions of that handle become invalid. .Pp -.It Fn bus_space_vaddr "tag" "handle" +.It Fn bus_space_vaddr "space" "handle" .Pp This method returns the kernel virtual address of a mapped bus space if and only if it was mapped with the @@ -745,7 +759,7 @@ .Fn bus_space_barrier method must be used to force a particular access order. .Pp -.It Fn bus_space_mmap "tag" "addr" "off" "prot" "flags" +.It Fn bus_space_mmap "space" "addr" "off" "prot" "flags" .Pp This method is used to provide support for memory mapping bus space into user applications. @@ -783,6 +797,91 @@ .Fa prot argument indicates the memory protection requested by the user application for the range. +.Pp +.It Fn bus_space_physload "space" "addr" "size" "freelist" +.Pp +This method is used to register a bus space range as part of general purpose +memory. +The +.Xr uvm 9 +internally allocates a single segment object, +.Fa struct vm_physseg , +with per-page objects, +.Fa struct vm_page , +to manage the corresponding physical address region indicated by +.Fa addr +and +.Fa size . +.Fa addr +is the base address of the device memory region, and +.Fa size +is the size of that region. +The added pages are queued in the freelist specified by +.Fa freelist +in the +.Xr uvm 9 . +.Pp +If the registered memory is meant to be truely general purpose, users would +want to add those pages to a pre-defined freelist. +In other cases where device's memory needs special treatment, its platform has +to define a dedicated freelist. +The actual usage of such a special freelist and its pages is up to respective +users. +.Pp +If successful, +.Fn bus_space_physload +returns an opaque handle to the allocated segment object. +It returns NULL to indicate failure. +.Pp +.It Fn bus_space_physunload "space" "phys" +.Pp +This method frees the memory segment returned by +.Fn bus_space_physload , +and specified by +.Fa phys . +This function will never fail. +.Pp +.It Fn bus_space_physload_device "space" "addr" "size" "prot" "flags" +.Pp +This method is used to register a bus space range as part of managed memory +indicated by +.Fa addr +and +.Fa size . +.Fa addr +is the base address of the device memory region, and +.Fa size +is the size of that region. +.Fa prot +is the device's capable access protection of the region, in cases where some +devices allow read-only or write-only access. +This information is referencial. +.Fa flags +is reserved for future use. +.Pp +Unlike +.Fn bus_space_physload +which registers pages as general purpose memory, this function only allocates +a segment object and per-page objects. +The registered pages can be accessed only by +.Xr mmap 2 +interface from userland, or XIP, where pages are implicitly mapped into user +address space by +.Xr uvm 9 +a