Module Name: src Committed By: uebayasi Date: Fri Nov 5 08:55:26 UTC 2010
Added Files: src/share/man/man4 [uebayasi-xip]: xip.4 Log Message: Brief introduction of xip(4). To generate a diff of this commit: cvs rdiff -u -r0 -r1.1.2.1 src/share/man/man4/xip.4 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Added files: Index: src/share/man/man4/xip.4 diff -u /dev/null src/share/man/man4/xip.4:1.1.2.1 --- /dev/null Fri Nov 5 08:55:26 2010 +++ src/share/man/man4/xip.4 Fri Nov 5 08:55:26 2010 @@ -0,0 +1,94 @@ +.\" $NetBSD: xip.4,v 1.1.2.1 2010/11/05 08:55:26 uebayasi Exp $ +.\" +.\" Copyright (c) 2010 The NetBSD Foundation, Inc. +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS +.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS +.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +.\" POSSIBILITY OF SUCH DAMAGE. +.\" +.Dd November 4, 2010 +.Dt XIP 4 +.Os +. +.Sh NAME +.Nm XIP +.Nd eXecute-In-Place +. +.Sh SYNOPSIS +.Cd options XIP +. +.Sh DESCRIPTION +The +.Nm +option enables a functionality for the kernel to execute programs +directly from memory-addressable device pages. +Normally the kernel allocates memory pages (page cache) and copies +file contents onto them, because most filesystem storage devices +are accessed by I/O. +There are devices whole data can be memory-mapped. +.Pp +By using +.Nm , +the kernel maps those file contents directly into user process's +address space. +This brings us to save memory used for page caches, and shorten +program load time compared to slow I/O storage devices. +.Pp +Needless to say, not all block devices can be capable of XIP. +Only memory-mappable block devices, i.e., NOR FlashROM, and RAM +based memory disk. +To support XIP, block device drivers need to allocate a VM device +physical segment beforehand, and return it at the request of +DIOCGPHYSSEG ioctl, called from VFS. +VM device physical segment is allocated by calling the +.Xr bus_space_physload_device +function in +.Xr bus_space 9 +API. +. +.Sh SEE ALSO +.Xr flash 4 , +.Xr xmd 4 , +.Xr mount 8 , +.Xr bus_space 9 , +.Xr disk 9 , +.Xr uvm 9 +. +.Sh CAVEATS +.Pp +Don't confuse memory-mappable NOR FlashROM and FlashROM based +storage device. To access the latter, CPU uses I/O instead of +MMIO. +. +.Sh HISTORY +.Pp +.Nm +first appeared in +.Nx 6.0 . +. +.Sh AUTHORS +The +.Nm +support was added by Masao Uebayashi. +. +.Sh BUGS +.Pp +Write operation is not supported.