docs/54632: [PATCH] introduce man pages for vm_map(9) functions

Bruce M Simpson bms at spc.org
Sat Jul 19 11:40:22 UTC 2003


>Number:         54632
>Category:       docs
>Synopsis:       [PATCH] introduce man pages for vm_map(9) functions
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-doc
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sat Jul 19 04:40:18 PDT 2003
>Closed-Date:
>Last-Modified:
>Originator:     Bruce M Simpson
>Release:        FreeBSD 5.1-RELEASE i386
>Organization:
>Environment:
System: FreeBSD saboteur.dek.spc.org 5.1-RELEASE FreeBSD 5.1-RELEASE #3: Mon Jun 23 06:55:01 BST 2003 root at saboteur.dek.spc.org:/usr/src/sys/i386/compile/SABOTEUR i386


	
>Description:
	Here is a rollup patch to introduce documentation for the
	vm_map portion of the VM into -CURRENT.
>How-To-Repeat:
	
>Fix:

	

--- vm_map_man.col.patch begins here ---
Generated by diffcoll on Sat 19 Jul 2003 09:26:29 BST

diff -uN src/share/man/man9/Makefile.orig src/share/man/man9/Makefile
--- /usr/src/share/man/man9/Makefile.orig	Sat Jul 19 09:16:29 2003
+++ /usr/src/share/man/man9/Makefile	Sat Jul 19 09:23:46 2003
@@ -74,6 +74,12 @@
 	vfsconf.9 \
 	vget.9 vgone.9 vhold.9 vinvalbuf.9 \
 	vflush.9 \
+	vm_map.9 vm_map_check_protection.9 vm_map_clean.9 vm_map_create.9 \
+	vm_map_delete.9 vm_map_find.9 vm_map_findspace.9 vm_map_inherit.9 \
+	vm_map_init.9 vm_map_insert.9 vm_map_lock.9 vm_map_lookup.9 \
+	vm_map_madvise.9 vm_map_max.9 vm_map_pmap.9 vm_map_protect.9 \
+	vm_map_remove.9 vm_map_simplify_entry.9 vm_map_stack.9 \
+	vm_map_submap.9 vm_map_wire.9 \
 	vm_page_alloc.9 vm_page_bits.9 vm_page_cache.9 \
 	vm_page_copy.9 vm_page_deactivate.9 vm_page_dontneed.9 \
 	vm_page_flag.9 vm_page_free.9 vm_page_grab.9 vm_page_hold.9 \
@@ -433,6 +439,20 @@
 MLINKS+=sbuf.9 sbuf_delete.9
 
 MLINKS+=vcount.9 count_dev.9
+
+MLINKS+=vm_map_lock.9 vm_map_unlock.9
+MLINKS+=vm_map_lock.9 vm_map_lock_read.9
+MLINKS+=vm_map_lock.9 vm_map_unlock_read.9
+MLINKS+=vm_map_lock.9 vm_map_trylock_read.9
+MLINKS+=vm_map_lock.9 vm_map_lock_upgrade.9
+MLINKS+=vm_map_lock.9 vm_map_lock_downgrade.9
+
+MLINKS+=vm_map_lookup.9 vm_map_lookup_done.9
+
+MLINKS+=vm_map_max.9 vm_map_min.9
+MLINKS+=vm_map_max.9 vm_map_pmap.9
+
+MLINKS+=vm_map_stack.9 vm_map_growstack.9
 
 MLINKS+=zone.9 uma.9
 MLINKS+=zone.9 uma_zalloc.9

diff -uN src/share/man/man9/vm_map.9.orig src/share/man/man9/vm_map.9
--- /usr/src/share/man/man9/vm_map.9.orig	Sat Jul 19 09:25:56 2003
+++ /usr/src/share/man/man9/vm_map.9	Sat Jul 19 09:25:56 2003
@@ -0,0 +1,69 @@
+.\"
+.\" Copyright (c) 2003 Bruce M Simpson <bms at spc.org>
+.\" 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 AUTHOR 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 AUTHOR 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.
+.\"
+.\" $FreeBSD$
+.\"
+.Dd July 19, 2003
+.Dt vm_map 9
+.Sh NAME
+.Nm vm_map
+.Nd virtual address space portion of virtual memory subsystem
+.Sh SYNOPSIS
+.In sys/param.h
+.In vm/vm.h
+.In vm/vm_map.h
+.Sh DESCRIPTION
+The
+.Nm
+subsystem is used to manage virtual address spaces.
+It is part of the
+.Fx
+VM.
+.Sh BUGS
+This manual page does not yet include the vm_map data structures.
+.Sh SEE ALSO
+.Xr vm_map_check_protection 9 ,
+.Xr vm_map_clean 9 ,
+.Xr vm_map_create 9 ,
+.Xr vm_map_delete 9 ,
+.Xr vm_map_find 9 ,
+.Xr vm_map_findspace 9 ,
+.Xr vm_map_inherit 9 ,
+.Xr vm_map_init 9 ,
+.Xr vm_map_insert 9 ,
+.Xr vm_map_lock 9 ,
+.Xr vm_map_lookup 9 ,
+.Xr vm_map_madvise 9 ,
+.Xr vm_map_max 9 ,
+.Xr vm_map_pmap 9 ,
+.Xr vm_map_protect 9 ,
+.Xr vm_map_remove 9 ,
+.Xr vm_map_simplify_entry 9 ,
+.Xr vm_map_stack 9 ,
+.Xr vm_map_submap 9 ,
+.Xr vm_map_wire 9
+.Sh AUTHORS
+This man page was written by
+.An Bruce M Simpson Aq bms at spc.org .

diff -uN src/share/man/man9/vm_map_check_protection.9.orig src/share/man/man9/vm_map_check_protection.9
--- /usr/src/share/man/man9/vm_map_check_protection.9.orig	Sat Jul 19 09:25:56 2003
+++ /usr/src/share/man/man9/vm_map_check_protection.9	Sat Jul 19 09:25:56 2003
@@ -0,0 +1,66 @@
+.\"
+.\" Copyright (c) 2003 Bruce M Simpson <bms at spc.org>
+.\" 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 AUTHOR 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 AUTHOR 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.
+.\"
+.\" $FreeBSD$
+.\"
+.Dd July 19, 2003
+.Dt vm_map_check_protection 9
+.Sh NAME
+.Nm vm_map_check_protection
+.Nd check memory protection for a vm_map
+.Sh SYNOPSIS
+.In sys/param.h
+.In vm/vm.h
+.In vm/vm_map.h
+.Ft boolean_t
+.Fn vm_map_check_protection "vm_map_t map" "vm_offset_t start" "vm_offset_t end" "vm_prot_t protection"
+.Sh DESCRIPTION
+The
+.Fn vm_map_check_protection
+function asserts that the target
+.Fa map
+allows the specified privilege
+.Fa protection
+over the entire address range from
+.Fa start
+to
+.Fa end .
+.Sh RETURN VALUES
+The
+.Fn vm_map_check_protection
+function returns TRUE if the privilege is allowed; otherwise the value
+FALSE is returned.
+.Sh NOTES
+This code does not and SHOULD not check whether the contents of
+the region is accessible.
+For example, a small file may be mapped into an address space which
+is significantly larger in size.
+.Sh SEE ALSO
+.Xr munmap 2 ,
+.Xr vm_map 9 ,
+.Xr vm_map_protect 9
+.Sh AUTHORS
+This man page was written by
+.An Bruce M Simpson Aq bms at spc.org .

diff -uN src/share/man/man9/vm_map_clean.9.orig src/share/man/man9/vm_map_clean.9
--- /usr/src/share/man/man9/vm_map_clean.9.orig	Sat Jul 19 09:25:56 2003
+++ /usr/src/share/man/man9/vm_map_clean.9	Sat Jul 19 09:25:56 2003
@@ -0,0 +1,70 @@
+.\"
+.\" Copyright (c) 2003 Bruce M Simpson <bms at spc.org>
+.\" 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 AUTHOR 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 AUTHOR 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.
+.\"
+.\" $FreeBSD$
+.\"
+.Dd July 19, 2003
+.Dt vm_map_clean 9
+.Sh NAME
+.Nm vm_map_clean
+.Nd push dirty pages to their pager
+.Sh SYNOPSIS
+.In sys/param.h
+.In vm/vm.h
+.In vm/vm_map.h
+.Ft int
+.Fn vm_map_clean "vm_map_t map" "vm_offset_t start" "vm_offset_t end" "boolean_t syncio" "boolean_t invalidate"
+.Sh DESCRIPTION
+The
+.Fn vm_map_clean
+function forces any dirty cached pages in the range
+.Fa start
+to
+.Fa end
+within the
+.Fa map
+to be pushed to their underlying pager.
+.Pp
+If
+.Fa syncio
+is TRUE, dirty pages are written synchronously.
+.Pp
+If
+.Fa invalidate
+is TRUE, any cached pages are also freed.
+.Sh RETURN VALUES
+The
+.Fn vm_map_clean
+function returns KERN_SUCCESS if successful; otherwise, it returns an
+appropriate error code.
+.Sh NOTES
+This function acquires the
+.Li Giant
+lock.
+.Sh SEE ALSO
+.Xr vm_map 9
+.Sh AUTHORS
+This man page was written by
+.An Bruce M Simpson Aq bms at spc.org .

diff -uN src/share/man/man9/vm_map_create.9.orig src/share/man/man9/vm_map_create.9
--- /usr/src/share/man/man9/vm_map_create.9.orig	Sat Jul 19 09:25:56 2003
+++ /usr/src/share/man/man9/vm_map_create.9	Sat Jul 19 09:25:56 2003
@@ -0,0 +1,61 @@
+.\"
+.\" Copyright (c) 2003 Bruce M Simpson <bms at spc.org>
+.\" 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 AUTHOR 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 AUTHOR 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.
+.\"
+.\" $FreeBSD$
+.\"
+.Dd July 19, 2003
+.Dt vm_map_create 9
+.Sh NAME
+.Nm vm_map_create
+.Nd create a new vm_map structure
+.Sh SYNOPSIS
+.In sys/param.h
+.In vm/vm.h
+.In vm/vm_map.h
+.Ft vm_map_t
+.Fn vm_map_create "pmap_t pmap" "vm_offset_t min" "vm_offset_t max"
+.Sh DESCRIPTION
+The
+.Fn vm_map_create
+function creates and returns a new, empty map structure, associated
+with the physical map
+.Fa pmap ,
+and with the
+upper and lower address bounds specified by
+.Fa max
+and
+.Fa min
+respectively.
+.Sh RETURN VALUES
+The
+.Fn vm_map_create
+function returns a pointer to the newly allocated map if successful.
+If the function is unsuccessful, the return value is undefined.
+.Sh SEE ALSO
+.Xr vm_map 9 ,
+.Xr vm_map_init 9
+.Sh AUTHORS
+This man page was written by
+.An Bruce M Simpson Aq bms at spc.org .

diff -uN src/share/man/man9/vm_map_delete.9.orig src/share/man/man9/vm_map_delete.9
--- /usr/src/share/man/man9/vm_map_delete.9.orig	Sat Jul 19 09:25:56 2003
+++ /usr/src/share/man/man9/vm_map_delete.9	Sat Jul 19 09:25:56 2003
@@ -0,0 +1,67 @@
+.\"
+.\" Copyright (c) 2003 Bruce M Simpson <bms at spc.org>
+.\" 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 AUTHOR 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 AUTHOR 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.
+.\"
+.\" $FreeBSD$
+.\"
+.Dd July 19, 2003
+.Dt vm_map_delete 9
+.Sh NAME
+.Nm vm_map_delete
+.Nd deallocate an address range from a map
+.Sh SYNOPSIS
+.In sys/param.h
+.In vm/vm.h
+.In vm/vm_map.h
+.Ft int
+.Fn vm_map_delete "vm_map_t map" "vm_offset_t start" "vm_offset_t end"
+.Sh DESCRIPTION
+The
+.Fn vm_map_delete
+function deallocates the address range bounded by
+.Fa start
+and
+.Fa end
+from the
+.Fa map .
+.Sh RETURN VALUES
+The
+.Fn vm_map_delete
+function returns KERN_SUCCESS if the range could be deleted succesfully;
+otherwise, its return value is undefined.
+.Sh NOTES
+This function is for
+.Fx
+VM internal use only.
+The
+.Xr vm_map_remove 9
+function should be called by 
+.Fx
+VM consumers.
+.Sh SEE ALSO
+.Xr vm_map 9 ,
+.Xr vm_map_remove 9
+.Sh AUTHORS
+This man page was written by
+.An Bruce M Simpson Aq bms at spc.org .

diff -uN src/share/man/man9/vm_map_find.9.orig src/share/man/man9/vm_map_find.9
--- /usr/src/share/man/man9/vm_map_find.9.orig	Sat Jul 19 09:25:56 2003
+++ /usr/src/share/man/man9/vm_map_find.9	Sat Jul 19 09:25:56 2003
@@ -0,0 +1,91 @@
+.\"
+.\" Copyright (c) 2003 Bruce M Simpson <bms at spc.org>
+.\" 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 AUTHOR 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 AUTHOR 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.
+.\"
+.\" $FreeBSD$
+.\"
+.Dd July 19, 2003
+.Dt vm_map_find 9
+.Sh NAME
+.Nm vm_map_find
+.Nd find a free region within a map, and optionally map a vm_object
+.Sh SYNOPSIS
+.In sys/param.h
+.In vm/vm.h
+.In vm/vm_map.h
+.Ft int
+.Fn vm_map_find "vm_map_t map" "vm_object_t object" "vm_ooffset_t offset" "vm_offset_t *addr" "vm_size_t length" "boolean_t find_space" "vm_prot_t prot" "vm_prot_t max" "int cow"
+.Sh DESCRIPTION
+The
+.Fn vm_map_find
+function attempts to find a free region in the target
+.Fa map ,
+with the given
+.Fa length ,
+and will also optionally create a mapping of
+.Fa object .
+.Pp
+The search is defined to be first-fit from the address
+.Fa addr
+onwards.
+.Pp
+The arguments
+.Fa offset ,
+.Fa prot ,
+.Fa max ,
+and
+.Fa cow
+are passed unchanged to
+.Xr vm_map_insert 9
+when creating the mapping, if and only if a free region is found.
+.Pp
+If
+.Fa object
+is non-NULL, the reference count on the object must be incremented
+by the caller before calling this function to account for the new entry.
+.Pp
+If
+.Fa find_space
+is TRUE, the function will call
+.Xr vm_map_findspace 9
+to discover a free region.
+.Sh RETURN VALUES
+The
+.Fn
+function returns KERN_SUCCESS if space for the mapping could be found and
+the mapping was successfully created; otherwise, an appropriate error code
+is returned.
+.Sh NOTES
+This function acquires a lock on
+.Fa map
+by calling
+.Xr vm_map_lock 9 .
+.Sh SEE ALSO
+.Xr vm_map 9 ,
+.Xr vm_map_findspace 9 ,
+.Xr vm_map_insert 9 ,
+.Xr vm_map_lock 9
+.Sh AUTHORS
+This man page was written by
+.An Bruce M Simpson Aq bms at spc.org .

diff -uN src/share/man/man9/vm_map_findspace.9.orig src/share/man/man9/vm_map_findspace.9
--- /usr/src/share/man/man9/vm_map_findspace.9.orig	Sat Jul 19 09:25:56 2003
+++ /usr/src/share/man/man9/vm_map_findspace.9	Sat Jul 19 09:25:56 2003
@@ -0,0 +1,75 @@
+.\"
+.\" Copyright (c) 2003 Bruce M Simpson <bms at spc.org>
+.\" 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 AUTHOR 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 AUTHOR 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.
+.\"
+.\" $FreeBSD$
+.\"
+.Dd July 19, 2003
+.Dt vm_map_findspace 9
+.Sh NAME
+.Nm vm_map_findspace
+.Nd find a free region within a map
+.Sh SYNOPSIS
+.In sys/param.h
+.In vm/vm.h
+.In vm/vm_map.h
+.Ft int
+.Fn vm_map_findspace "vm_map_t map" "vm_offset_t start" "vm_size_t length" "vm_offset_t *addr"
+.Sh DESCRIPTION
+The
+.Fn vm_map_findspace
+function attempts to find a region with sufficient space in the
+.Fa map
+for an object of size
+.Fa length
+at the address
+.Fa addr .
+.Pp
+.Sh RETURN VALUES
+The
+.Fn vm_map_findspace
+function returns the value 0 if successful, and
+.Fa *addr
+will contain the first virtual address in the found region;
+otherwise, the value 1 is returned.
+.Sh NOTES
+It is the caller's responsibility to obtain a lock on the
+.Fa map
+using
+.Xr vm_map_lock 9
+before calling this function.
+.Pp
+This routine may call
+.Xr pmap_growkernel 9
+to grow the kernel's address space, if and only if the mapping is being
+made within the kernel address space, and if insufficient space remains
+in the
+.Li kernel_map .
+.Sh SEE ALSO
+.Xr pmap_growkernel 9 ,
+.Xr vm_map 9 ,
+.Xr vm_map_lock 9
+.Sh AUTHORS
+This man page was written by
+.An Bruce M Simpson Aq bms at spc.org .

diff -uN src/share/man/man9/vm_map_inherit.9.orig src/share/man/man9/vm_map_inherit.9
--- /usr/src/share/man/man9/vm_map_inherit.9.orig	Sat Jul 19 09:25:56 2003
+++ /usr/src/share/man/man9/vm_map_inherit.9	Sat Jul 19 09:25:56 2003
@@ -0,0 +1,61 @@
+.\"
+.\" Copyright (c) 2003 Bruce M Simpson <bms at spc.org>
+.\" 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 AUTHOR 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 AUTHOR 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.
+.\"
+.\" $FreeBSD$
+.\"
+.Dd July 19, 2003
+.Dt vm_map_inherit 9
+.Sh NAME
+.Nm vm_map_inherit
+.Nd set fork inheritance flags for a range within a map
+.Sh SYNOPSIS
+.In sys/param.h
+.In vm/vm.h
+.In vm/vm_map.h
+.Ft int
+.Fn vm_map_inherit "vm_map_t map" "vm_offset_t start" "vm_offset_t end" "vm_inherit_t new_inheritance"
+.Sh DESCRIPTION
+The
+.Fn vm_map_inherit
+function sets the inheritance flags for the range
+.Fa start
+to
+.Fa end
+within the target
+.Fa map
+to the value
+.Fa new_inheritance .
+This affects how the map will be shared with child maps when the
+associated process forks.
+.Sh RETURN VALUES
+The
+.Fn vm_map_inherit
+function returns KERN_SUCCESS if the inheritance flags could be set;
+otherwise, an appropriate error code is returned.
+.Sh SEE ALSO
+.Xr fork 2
+.Sh AUTHORS
+This man page was written by
+.An Bruce M Simpson Aq bms at spc.org .

diff -uN src/share/man/man9/vm_map_init.9.orig src/share/man/man9/vm_map_init.9
--- /usr/src/share/man/man9/vm_map_init.9.orig	Sat Jul 19 09:25:56 2003
+++ /usr/src/share/man/man9/vm_map_init.9	Sat Jul 19 09:25:56 2003
@@ -0,0 +1,58 @@
+.\"
+.\" Copyright (c) 2003 Bruce M Simpson <bms at spc.org>
+.\" 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 AUTHOR 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 AUTHOR 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.
+.\"
+.\" $FreeBSD$
+.\"
+.Dd July 19, 2003
+.Dt vm_map_init 9
+.Sh NAME
+.Nm vm_map_init
+.Nd initialize a vm_map structure for process zero
+.Sh SYNOPSIS
+.In sys/param.h
+.In vm/vm.h
+.In vm/vm_map.h
+.Ft void
+.Fn vm_map_init "vm_map_t map" "vm_offset_t min" "vm_offset_t max"
+.Sh DESCRIPTION
+The
+.Fn vm_map_init
+function initializes the system map
+.Fa map
+by setting its upper and lower address bounds to
+.Fa max
+and
+.Fa min
+respectively.
+.Pp
+It also initializes the system map mutex.
+.Sh NOTES
+This routine is for internal use only.
+It is called during early system initialization.
+.Sh SEE ALSO
+.Xr vm_map 9
+.Sh AUTHORS
+This man page was written by
+.An Bruce M Simpson Aq bms at spc.org .

diff -uN src/share/man/man9/vm_map_insert.9.orig src/share/man/man9/vm_map_insert.9
--- /usr/src/share/man/man9/vm_map_insert.9.orig	Sat Jul 19 09:25:56 2003
+++ /usr/src/share/man/man9/vm_map_insert.9	Sat Jul 19 09:25:56 2003
@@ -0,0 +1,80 @@
+.\"
+.\" Copyright (c) 2003 Bruce M Simpson <bms at spc.org>
+.\" 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 AUTHOR 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 AUTHOR 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.
+.\"
+.\" $FreeBSD$
+.\"
+.Dd July 19, 2003
+.Dt vm_map_insert 9
+.Sh NAME
+.Nm vm_map_insert
+.Nd insert an object into a map
+.Sh SYNOPSIS
+.In sys/param.h
+.In vm/vm.h
+.In vm/vm_map.h
+.Ft int
+.Fn vm_map_insert "vm_map_t map" "vm_object_t object" "vm_ooffset_t offset" "vm_offset_t start" "vm_offset_t end" "vm_prot_t prot" "vm_prot_t max" "int cow"
+.Sh DESCRIPTION
+The
+.Fn vm_map_insert
+function inserts a mapping for the entire vm_object
+.Fa object
+into the target map
+.Fa map .
+.Pp
+The
+.Fa offset
+argument specifies the offset into the
+.Fa object
+at which to begin mapping.
+The object's size should match that of the specified address range.
+.Pp
+The
+.Fa start
+and
+.Fa end
+arguments specify the bounds of the mapped object's window in the
+address space of
+.Fa map .
+.Pp
+The
+.Fa cow
+argment specifies the flags which should be propagated to the new entry,
+for example, to indicate that this is a copy-on-write mapping.
+.Sh RETURN VALUES
+The
+.Fn vm_map_insert
+function returns KERN_SUCCESS if the mapping could be made successfully;
+otherwise, an appropriate error code is returned.
+.Sh NOTES
+This function implicity creates a new
+.Li vm_map_entry
+by calling the internal function
+.Fn vm_map_entry_create .
+.Sh SEE ALSO
+.Xr vm_map 9
+.Sh AUTHORS
+This man page was written by
+.An Bruce M Simpson Aq bms at spc.org .

diff -uN src/share/man/man9/vm_map_lock.9.orig src/share/man/man9/vm_map_lock.9
--- /usr/src/share/man/man9/vm_map_lock.9.orig	Sat Jul 19 09:25:56 2003
+++ /usr/src/share/man/man9/vm_map_lock.9	Sat Jul 19 09:25:56 2003
@@ -0,0 +1,116 @@
+.\"
+.\" Copyright (c) 2003 Bruce M Simpson <bms at spc.org>
+.\" 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 AUTHOR 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 AUTHOR 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.
+.\"
+.\" $FreeBSD$
+.\"
+.Dd July 19, 2003
+.Dt vm_map_lock 9
+.Sh NAME
+.Nm vm_map_lock ,
+.Nm vm_map_unlock ,
+.Nm vm_map_lock_read ,
+.Nm vm_map_unlock_read ,
+.Nm vm_map_trylock ,
+.Nm vm_map_trylock_read ,
+.Nm vm_map_lock_upgrade ,
+.Nm vm_map_lock_downgrade
+.Nd vm_map locking macros
+.Sh SYNOPSIS
+.In sys/param.h
+.In vm/vm.h
+.In vm/vm_map.h
+.Ft void
+.Fn vm_map_lock "vm_map_t map"
+.Ft void
+.Fn vm_map_unlock "vm_map_t map"
+.Ft void
+.Fn vm_map_lock_read "vm_map_t map"
+.Ft void
+.Fn vm_map_unlock_read "vm_map_t map"
+.Ft int
+.Fn vm_map_trylock "vm_map_t map"
+.Ft int
+.Fn vm_map_trylock_read "vm_map_t map"
+.Ft int
+.Fn vm_map_lock_upgrade "vm_map_t map"
+.Ft int
+.Fn vm_map_lock_downgrade "vm_map_t map"
+.Sh DESCRIPTION
+The
+.Fn vm_map_lock
+macro obtains an exclusive lock on
+.Fa map .
+.Pp
+The
+.Fn vm_map_unlock
+macro releases an exclusive lock on
+.Fa map .
+.Pp
+The
+.Fn vm_map_lock_read
+macro obtains a read-lock on
+.Fa map .
+Currently this is implemented as an exclusive lock.
+.Pp
+The
+.Fn vm_map_unlock_read
+macro releases a read-lock on
+.Fa map .
+.Pp
+The
+.Fn vm_map_trylock
+macro attempts to obtain an exclusive lock on
+.Fa map .
+It returns FALSE if the lock cannot be immediately acquired;
+otherwise return TRUE with the lock acquired.
+.Pp
+The
+.Fn vm_map_trylock_read
+macro attempts to obtain a read-lock on
+.Fa map .
+It returns FALSE if the lock cannot be immediately acquired;
+otherwise return TRUE with the lock acquired.
+Currently this is implemented as an exclusive lock.
+.Pp
+The
+.Fn vm_map_lock_upgrade
+macro attempts to atomically upgrade a read-lock on
+.Fa map
+to an exclusive lock.
+As read-locks are currently implemented as exclusive locks,
+this macro is a no-op.
+.Pp
+The
+.Fn vm_map_lock_downgrade
+macro attempts to downgrade an exclusive lock on
+.Fa map
+to a read-lock.
+As read-locks are currently implemented as exclusive locks,
+this macro is a no-op.
+.Sh SEE ALSO
+.Xr vm_map 9
+.Sh AUTHORS
+This man page was written by
+.An Bruce M Simpson Aq bms at spc.org .

diff -uN src/share/man/man9/vm_map_lookup.9.orig src/share/man/man9/vm_map_lookup.9
--- /usr/src/share/man/man9/vm_map_lookup.9.orig	Sat Jul 19 09:25:56 2003
+++ /usr/src/share/man/man9/vm_map_lookup.9	Sat Jul 19 09:25:56 2003
@@ -0,0 +1,81 @@
+.\"
+.\" Copyright (c) 2003 Bruce M Simpson <bms at spc.org>
+.\" 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 AUTHOR 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 AUTHOR 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.
+.\"
+.\" $FreeBSD$
+.\"
+.Dd July 19, 2003
+.Dt vm_map_lookup 9
+.Sh NAME
+.Nm vm_map_lookup ,
+.Nm vm_map_lookup_done
+.Nd lookup the vm_object backing a given virtual region
+.Sh SYNOPSIS
+.In sys/param.h
+.In vm/vm.h
+.In vm/vm_map.h
+.Ft int
+.Fn vm_map_lookup "vm_map_t *var_map" "vm_offset_t vaddr" "vm_prot_t fault_type" "vm_map_entry_t *out_entry" "vm_object_t *object" "vm_pindex_t *pindex" "vm_prot_t *out_prot" "boolean_t *wired"
+.Ft void
+.Fn vm_map_lookup_done "vm_map_t map" "vm_map_entry_t entry"
+.Sh DESCRIPTION
+The
+.Fn vm_map_lookup
+function attempts to find the
+vm_object, page index and protection, for the given virtual address
+.Fa vaddr ,
+in the map
+.Fa var_map ,
+assuming a page fault of the type
+.Fa fault_type
+had occurred.
+.Pp
+Return values are guaranteed until
+.Fn vm_map_lookup_done
+is called to release the lock.
+.Sh RETURN VALUES
+If successful, the
+.Fn vm_map_lookup
+function returns KERN_SUCCESS, and sets the
+.Fa *object ,
+.Fa *pindex ,
+.Fa *out_prot ,
+and
+.Fa *out_entry
+arguments appropriately for the hypothetical page fault.
+If unsuccessful, an appropriate error code is returned.
+.Sh NOTES
+The function
+.Fn vm_map_lookup
+acquires a read-lock on the map
+.Fa *var_map ,
+but does not release it.
+The caller should invoke
+.Fn vm_map_lookup_done
+in order to release this lock.
+.Sh SEE ALSO
+.Xr vm_map 9
+.Sh AUTHORS
+This man page was written by
+.An Bruce M Simpson Aq bms at spc.org .

diff -uN src/share/man/man9/vm_map_madvise.9.orig src/share/man/man9/vm_map_madvise.9
--- /usr/src/share/man/man9/vm_map_madvise.9.orig	Sat Jul 19 09:25:56 2003
+++ /usr/src/share/man/man9/vm_map_madvise.9	Sat Jul 19 09:25:56 2003
@@ -0,0 +1,70 @@
+.\"
+.\" Copyright (c) 2003 Bruce M Simpson <bms at spc.org>
+.\" 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 AUTHOR 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 AUTHOR 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.
+.\"
+.\" $FreeBSD$
+.\"
+.Dd July 19, 2003
+.Dt vm_map_madvise 9
+.Sh NAME
+.Nm vm_map_madvise
+.Nd apply advice about use of memory to map entries
+.Sh SYNOPSIS
+.In sys/param.h
+.In vm/vm.h
+.In vm/vm_map.h
+.Ft int
+.Fn vm_map_madvise "vm_map_t map" "vm_offset_t start" "vm_offset_t end" "int behav"
+.Sh DESCRIPTION
+The
+.Fn vm_map_madvise
+function applies the flags
+.Fa behav
+to the entries within
+.Fa map
+between
+.Fa start
+and
+.Fa end .
+.Pp
+Advisories are classified as either those affecting the
+.Li vm_map_entry
+structure, or those affecting the underlying objects.
+.Pp
+The
+.Fn vm_map_madvise
+function is used by the
+.Fn madvise
+system call.
+.Sh RETURN VALUES
+The
+.Fn vm_map_madvise
+function returns 0 if successful; otherwise, an appropriate error code is
+returned.
+.Sh SEE ALSO
+.Xr madvise 2 ,
+.Xr vm_map 9
+.Sh AUTHORS
+This man page was written by
+.An Bruce M Simpson Aq bms at spc.org .

diff -uN src/share/man/man9/vm_map_max.9.orig src/share/man/man9/vm_map_max.9
--- /usr/src/share/man/man9/vm_map_max.9.orig	Sat Jul 19 09:25:56 2003
+++ /usr/src/share/man/man9/vm_map_max.9	Sat Jul 19 09:25:56 2003
@@ -0,0 +1,64 @@
+.\"
+.\" Copyright (c) 2003 Bruce M Simpson <bms at spc.org>
+.\" 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 AUTHOR 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 AUTHOR 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.
+.\"
+.\" $FreeBSD$
+.\"
+.Dd July 19, 2003
+.Dt vm_map_max 9
+.Sh NAME
+.Nm vm_map_max ,
+.Nm vm_map_min ,
+.Nm vm_map_pmap
+.Nd return map properties
+.Sh SYNOPSIS
+.In sys/param.h
+.In vm/vm.h
+.In vm/vm_map.h
+.Ft vm_offset_t
+.Fn vm_map_max "vm_map_t map"
+.Ft vm_offset_t
+.Fn vm_map_min "vm_map_t map"
+.Ft pmap_t
+.Fn vm_map_pmap "vm_map_t map"
+.Sh DESCRIPTION
+The function
+.Fn vm_map_min
+returns the upper address bound of the map
+.Fa map .
+.Pp
+The function
+.Fn vm_map_max
+returns the lower address bound of the map
+.Fa map .
+.Pp
+The function
+.Fn vm_map_pmap
+returns a pointer to the physical map associated with the virtual map
+.Fa map .
+.Sh SEE ALSO
+.Xr vm_map 9
+.Sh AUTHORS
+This man page was written by
+.An Bruce M Simpson Aq bms at spc.org .

diff -uN src/share/man/man9/vm_map_pmap.9.orig src/share/man/man9/vm_map_pmap.9
--- /usr/src/share/man/man9/vm_map_pmap.9.orig	Sat Jul 19 09:25:56 2003
+++ /usr/src/share/man/man9/vm_map_pmap.9	Sat Jul 19 09:25:56 2003
@@ -0,0 +1,44 @@
+.\"
+.\" Copyright (c) 2003 Bruce M Simpson <bms at spc.org>
+.\" 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 AUTHOR 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 AUTHOR 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.
+.\"
+.\" $FreeBSD$
+.\"
+.Dd July 19, 2003
+.Dt vm_map 9
+.Sh NAME
+.Nm vm_map
+.Nd virtual address space portion of virtual memory subsystem
+.Sh SYNOPSIS
+.In sys/param.h
+.In vm/vm.h
+.In vm/vm_map.h
+.Sh DESCRIPTION
+.Sh RETURN VALUES
+.Sh NOTES
+.Sh BUGS
+.Sh SEE ALSO
+.Sh AUTHORS
+This man page was written by
+.An Bruce M Simpson Aq bms at spc.org .

diff -uN src/share/man/man9/vm_map_protect.9.orig src/share/man/man9/vm_map_protect.9
--- /usr/src/share/man/man9/vm_map_protect.9.orig	Sat Jul 19 09:25:56 2003
+++ /usr/src/share/man/man9/vm_map_protect.9	Sat Jul 19 09:25:56 2003
@@ -0,0 +1,72 @@
+.\"
+.\" Copyright (c) 2003 Bruce M Simpson <bms at spc.org>
+.\" 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 AUTHOR 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 AUTHOR 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.
+.\"
+.\" $FreeBSD$
+.\"
+.Dd July 19, 2003
+.Dt vm_map_protect 9
+.Sh NAME
+.Nm vm_map_protect
+.Nd apply protection bits to a virtual region
+.Sh SYNOPSIS
+.In sys/param.h
+.In vm/vm.h
+.In vm/vm_map.h
+.Ft int
+.Fn vm_map_protect "vm_map_t map" "vm_offset_t start" "vm_offset_t end" "vm_prot_t new_prot" "boolean_t set_max"
+.Sh DESCRIPTION
+The
+.Fn vm_map_protect
+function sets the protection bits of the address region bounded by
+.Fa start
+and
+.Fa end
+within the map
+.Fa map
+to
+.Fa new_prot .
+.Pp
+If
+.Fa set_max
+is TRUE,
+.Fa new_prot
+is treated as the new
+.Li max_protection
+setting for each underlying entry.
+Otherwise, only the
+.Li protection
+field is affected.
+.Sh RETURN VALUES
+The
+.Fn vm_map_protect
+function returns
+.Li KERN_SUCCESS
+if the protection bits could be set successfully; otherwise, the return
+value is undefined.
+.Sh SEE ALSO
+.Xr vm_map 9
+.Sh AUTHORS
+This man page was written by
+.An Bruce M Simpson Aq bms at spc.org .

diff -uN src/share/man/man9/vm_map_remove.9.orig src/share/man/man9/vm_map_remove.9
--- /usr/src/share/man/man9/vm_map_remove.9.orig	Sat Jul 19 09:25:56 2003
+++ /usr/src/share/man/man9/vm_map_remove.9	Sat Jul 19 09:25:56 2003
@@ -0,0 +1,58 @@
+.\"
+.\" Copyright (c) 2003 Bruce M Simpson <bms at spc.org>
+.\" 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 AUTHOR 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 AUTHOR 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.
+.\"
+.\" $FreeBSD$
+.\"
+.Dd July 19, 2003
+.Dt vm_map_remove 9
+.Sh NAME
+.Nm vm_map_remove
+.Nd remove a virtual address range from a map
+.Sh SYNOPSIS
+.In sys/param.h
+.In vm/vm.h
+.In vm/vm_map.h
+.Ft int
+.Fn vm_map_remove "vm_map_t map" "vm_offset_t start" "vm_offset_t end"
+.Sh DESCRIPTION
+The
+.Fn vm_map_remove
+function removes the given address range bounded by
+.Fa start
+and
+.Fa end
+from the target
+.Fa map .
+.Sh RETURN VALUES
+The
+.Fn vm_map_remove
+returns
+.Li KERN_SUCCESS
+if successful; otherwise, the return value is undefined.
+.Sh SEE ALSO
+.Xr vm_map 9
+.Sh AUTHORS
+This man page was written by
+.An Bruce M Simpson Aq bms at spc.org .

diff -uN src/share/man/man9/vm_map_simplify_entry.9.orig src/share/man/man9/vm_map_simplify_entry.9
--- /usr/src/share/man/man9/vm_map_simplify_entry.9.orig	Sat Jul 19 09:25:56 2003
+++ /usr/src/share/man/man9/vm_map_simplify_entry.9	Sat Jul 19 09:25:56 2003
@@ -0,0 +1,59 @@
+.\"
+.\" Copyright (c) 2003 Bruce M Simpson <bms at spc.org>
+.\" 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 AUTHOR 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 AUTHOR 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.
+.\"
+.\" $FreeBSD$
+.\"
+.Dd July 19, 2003
+.Dt vm_map_simplify_entry 9
+.Sh NAME
+.Nm vm_map_simplify_entry
+.Nd simplify a vm_map_entry
+.Sh SYNOPSIS
+.In sys/param.h
+.In vm/vm.h
+.In vm/vm_map.h
+.Ft void
+.Fn vm_map_simplify_entry "vm_map_t map" "vm_map_entry_t entry"
+.Sh DESCRIPTION
+The
+.Fn vm_map_simplify_entry
+function simplifies the given
+.Fa entry
+by merging with either neighbour.
+This routine also has the ability to merge with both neighbours.
+.Sh NOTES
+This routine guarantees that the passed entry remains valid, although
+possibly extended.
+.Pp
+The
+.Fa map
+must be locked upon entry.
+.Sh SEE ALSO
+.Xr vm_map 9 ,
+.Xr vm_map_insert 9 ,
+.Xr vm_map_remove 9
+.Sh AUTHORS
+This man page was written by
+.An Bruce M Simpson Aq bms at spc.org .

diff -uN src/share/man/man9/vm_map_stack.9.orig src/share/man/man9/vm_map_stack.9
--- /usr/src/share/man/man9/vm_map_stack.9.orig	Sat Jul 19 09:25:56 2003
+++ /usr/src/share/man/man9/vm_map_stack.9	Sat Jul 19 09:25:56 2003
@@ -0,0 +1,107 @@
+.\"
+.\" Copyright (c) 2003 Bruce M Simpson <bms at spc.org>
+.\" 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 AUTHOR 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 AUTHOR 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.
+.\"
+.\" $FreeBSD$
+.\"
+.Dd July 19, 2003
+.Dt vm_map_stack 9
+.Sh NAME
+.Nm vm_map_stack ,
+.Nm vm_map_growstack
+.Nd manage process stacks
+.Sh SYNOPSIS
+.In sys/param.h
+.In vm/vm.h
+.In vm/vm_map.h
+.Ft int
+.Fn vm_map_stack "vm_map_t map" "vm_offset_t addrbos" "vm_size_t max_ssize" "vm_prot_t prot" "vm_prot_t max" "int cow"
+.Ft int
+.Fn vm_map_growstack "struct proc *p" "vm_offset_t addr"
+.Sh DESCRIPTION
+The
+.Fn
+function maps a process stack for a new process image.
+The stack is mapped
+.Fa addrbos
+in
+.Fa map ,
+with a maximum size of
+.Fa max_ssize .
+Copy-on-write flags passed in
+.Fa cow
+are also applied to the new mapping.
+Protection bits are supplied by
+.Fa prot
+and
+.Fa max .
+.Pp
+It is typically called by
+.Xr exec 2 .
+.Pp
+The
+.Fn vm_map_growstack
+function is responsible for growing a stack for the process
+.Fa p
+to the desired address
+.Fa addr ,
+similar to the legacy
+.Xr sbrk 2
+call.
+.Sh RETURN VALUES
+The
+.Fn vm_map_stack
+function returns
+.Li KERN_SUCCESS
+if the mapping was allocated successfully; otherwise, it returns an
+appropriate error code.
+.Pp
+The
+.Fn vm_map_growstack
+function returns
+.Li KERN_SUCCESS
+if
+.Fa addr
+is already mapped, or if the stack was grown successfully.
+.Pp
+It also returns
+.Li KERN_SUCCESS
+if
+.Fa addr
+is outside the stack range; this is done in order to preserve
+compatibility with the depracated grow function previously located in
+.Li vm_machdep.c .
+.Sh NOTES
+The
+.Fn vm_map_growstack
+function acquires the
+.Li Giant
+lock, and the process lock on
+.Fa p .
+.Sh SEE ALSO
+.Xr vm_map 9 ,
+.Xr vm_map_insert 9
+.Sh AUTHORS
+This man page was written by
+.An Bruce M Simpson Aq bms at spc.org .

diff -uN src/share/man/man9/vm_map_submap.9.orig src/share/man/man9/vm_map_submap.9
--- /usr/src/share/man/man9/vm_map_submap.9.orig	Sat Jul 19 09:25:56 2003
+++ /usr/src/share/man/man9/vm_map_submap.9	Sat Jul 19 09:25:56 2003
@@ -0,0 +1,84 @@
+.\"
+.\" Copyright (c) 2003 Bruce M Simpson <bms at spc.org>
+.\" 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 AUTHOR 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 AUTHOR 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.
+.\"
+.\" $FreeBSD$
+.\"
+.Dd July 19, 2003
+.Dt vm_map_submap 9
+.Sh NAME
+.Nm vm_map_submap
+.Nd create a subordinate map
+.Sh SYNOPSIS
+.In sys/param.h
+.In vm/vm.h
+.In vm/vm_map.h
+.Ft int
+.Fn vm_map_submap "vm_map_t map" "vm_offset_t start" "vm_offset_t end" "vm_map_t submap"
+.Sh DESCRIPTION
+The
+.Fn vm_map_submap
+function marks the range bounded by
+.Fa start
+and
+.Fa end
+within the map
+.Fa map
+as being handled by a subordinate map
+.Fa sub_map .
+.Pp
+It is generally called by the kernel memory allocator.
+.Sh RETURN VALUES
+The
+.Fn vm_map_submap
+function returns
+.Li KERN_SUCCESS
+if successful; otherwise, it returns an appropriate error code.
+.Sh NOTES
+This function is for internal use only.
+.Pp
+Both maps must exist.
+The range must have been created with
+.Xr vm_map_find 9
+previously.
+.Pp
+No other operations may have been performed on this range
+before calling this function.
+Only the
+.Fn vm_fault
+operation may be performed within this range after calling
+this function.
+.Pp
+To remove a submapping, one must first remove the range from
+the parent
+.Fa map ,
+and then destroy the
+.Fa sub_map .
+This procedure is not recommended.
+.Sh SEE ALSO
+.Xr vm_map 9 ,
+.Xr vm_map_find 9
+.Sh AUTHORS
+This man page was written by
+.An Bruce M Simpson Aq bms at spc.org .

diff -uN src/share/man/man9/vm_map_wire.9.orig src/share/man/man9/vm_map_wire.9
--- /usr/src/share/man/man9/vm_map_wire.9.orig	Sat Jul 19 09:25:56 2003
+++ /usr/src/share/man/man9/vm_map_wire.9	Sat Jul 19 09:25:56 2003
@@ -0,0 +1,99 @@
+.\"
+.\" Copyright (c) 2003 Bruce M Simpson <bms at spc.org>
+.\" 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 AUTHOR 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 AUTHOR 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.
+.\"
+.\" $FreeBSD$
+.\"
+.Dd July 19, 2003
+.Dt vm_map_wire 9
+.Sh NAME
+.Nm vm_map_wire ,
+.Nm vm_map_unwire
+.Nd manage page wiring within an address space map
+.Sh SYNOPSIS
+.In sys/param.h
+.In vm/vm.h
+.In vm/vm_map.h
+.Ft int
+.Fn vm_map_wire "vm_map_t map" "vm_offset_t start" "vm_offset_t end" "int flags"
+.Ft int
+.Fn vm_map_unwire "vm_map_t map" "vm_offset_t start" "vm_offset_t end" "int flags"
+.Sh DESCRIPTION
+The
+.Fn vm_map_wire
+function is responsible for wiring pages in the range between
+.Fa start
+and
+.Fa end
+within the map
+.Fa map .
+Wired pages are locked into physical memory, and may not be paged out
+as long as their wire count remains above zero.
+.Pp
+The
+.Fn vm_map_unwire
+function performs the corresponding unwire operation.
+.Pp
+The
+.Fa flags
+argument is a bit mask, consisting of the following flags:
+.Pp
+If the
+.Li VM_MAP_WIRE_USER
+flag is set, the function operates within user address space.
+.Pp
+If the
+.Li VM_MAP_WIRE_NONCONTIG
+flag is set, it may operate upon an arbitrary range within the
+address space of
+.Fa map ;
+otherwise, the specified range must be contiguous.
+This is the flag used by the
+.Fn mlockall
+and
+.Fn munlockall
+system calls.
+.Sh RETURN VALUES
+The
+.Fn vm_map_wire
+function returns
+.Li KERN_SUCCESS
+if all pages within the range were wired successfully; otherwise, it returns
+an appropriate error code.
+.Pp
+The
+.Fn vm_map_unwire
+function returns
+.Li KERN_SUCCESS
+if all pages within the range were unwired successfully; otherwise, it returns
+an appropriate error code.
+.Sh NOTES
+.Sh BUGS
+.Sh SEE ALSO
+.Xr mlockall 2 ,
+.Xr munlockall 2 ,
+.Xr vm_map 9
+.Sh AUTHORS
+This man page was written by
+.An Bruce M Simpson Aq bms at spc.org .
--- vm_map_man.col.patch ends here ---


>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-doc mailing list