View | Details | Raw Unified | Return to bug 54632
Collapse All | Expand All

(-)/usr/src/share/man/man9/Makefile (+20 lines)
Lines 74-79 Link Here
74
	vfsconf.9 \
74
	vfsconf.9 \
75
	vget.9 vgone.9 vhold.9 vinvalbuf.9 \
75
	vget.9 vgone.9 vhold.9 vinvalbuf.9 \
76
	vflush.9 \
76
	vflush.9 \
77
	vm_map.9 vm_map_check_protection.9 vm_map_clean.9 vm_map_create.9 \
78
	vm_map_delete.9 vm_map_find.9 vm_map_findspace.9 vm_map_inherit.9 \
79
	vm_map_init.9 vm_map_insert.9 vm_map_lock.9 vm_map_lookup.9 \
80
	vm_map_madvise.9 vm_map_max.9 vm_map_pmap.9 vm_map_protect.9 \
81
	vm_map_remove.9 vm_map_simplify_entry.9 vm_map_stack.9 \
82
	vm_map_submap.9 vm_map_wire.9 \
77
	vm_page_alloc.9 vm_page_bits.9 vm_page_cache.9 \
83
	vm_page_alloc.9 vm_page_bits.9 vm_page_cache.9 \
78
	vm_page_copy.9 vm_page_deactivate.9 vm_page_dontneed.9 \
84
	vm_page_copy.9 vm_page_deactivate.9 vm_page_dontneed.9 \
79
	vm_page_flag.9 vm_page_free.9 vm_page_grab.9 vm_page_hold.9 \
85
	vm_page_flag.9 vm_page_free.9 vm_page_grab.9 vm_page_hold.9 \
Lines 433-438 Link Here
433
MLINKS+=sbuf.9 sbuf_delete.9
439
MLINKS+=sbuf.9 sbuf_delete.9
434
440
435
MLINKS+=vcount.9 count_dev.9
441
MLINKS+=vcount.9 count_dev.9
442
443
MLINKS+=vm_map_lock.9 vm_map_unlock.9
444
MLINKS+=vm_map_lock.9 vm_map_lock_read.9
445
MLINKS+=vm_map_lock.9 vm_map_unlock_read.9
446
MLINKS+=vm_map_lock.9 vm_map_trylock_read.9
447
MLINKS+=vm_map_lock.9 vm_map_lock_upgrade.9
448
MLINKS+=vm_map_lock.9 vm_map_lock_downgrade.9
449
450
MLINKS+=vm_map_lookup.9 vm_map_lookup_done.9
451
452
MLINKS+=vm_map_max.9 vm_map_min.9
453
MLINKS+=vm_map_max.9 vm_map_pmap.9
454
455
MLINKS+=vm_map_stack.9 vm_map_growstack.9
436
456
437
MLINKS+=zone.9 uma.9
457
MLINKS+=zone.9 uma.9
438
MLINKS+=zone.9 uma_zalloc.9
458
MLINKS+=zone.9 uma_zalloc.9
(-)/usr/src/share/man/man9/vm_map.9 (+69 lines)
Line 0 Link Here
1
.\"
2
.\" Copyright (c) 2003 Bruce M Simpson <bms@spc.org>
3
.\" All rights reserved.
4
.\"
5
.\" Redistribution and use in source and binary forms, with or without
6
.\" modification, are permitted provided that the following conditions
7
.\" are met:
8
.\" 1. Redistributions of source code must retain the above copyright
9
.\"    notice, this list of conditions and the following disclaimer.
10
.\" 2. Redistributions in binary form must reproduce the above copyright
11
.\"    notice, this list of conditions and the following disclaimer in the
12
.\"    documentation and/or other materials provided with the distribution.
13
.\"
14
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17
.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24
.\" SUCH DAMAGE.
25
.\"
26
.\" $FreeBSD$
27
.\"
28
.Dd July 19, 2003
29
.Dt vm_map 9
30
.Sh NAME
31
.Nm vm_map
32
.Nd virtual address space portion of virtual memory subsystem
33
.Sh SYNOPSIS
34
.In sys/param.h
35
.In vm/vm.h
36
.In vm/vm_map.h
37
.Sh DESCRIPTION
38
The
39
.Nm
40
subsystem is used to manage virtual address spaces.
41
It is part of the
42
.Fx
43
VM.
44
.Sh BUGS
45
This manual page does not yet include the vm_map data structures.
46
.Sh SEE ALSO
47
.Xr vm_map_check_protection 9 ,
48
.Xr vm_map_clean 9 ,
49
.Xr vm_map_create 9 ,
50
.Xr vm_map_delete 9 ,
51
.Xr vm_map_find 9 ,
52
.Xr vm_map_findspace 9 ,
53
.Xr vm_map_inherit 9 ,
54
.Xr vm_map_init 9 ,
55
.Xr vm_map_insert 9 ,
56
.Xr vm_map_lock 9 ,
57
.Xr vm_map_lookup 9 ,
58
.Xr vm_map_madvise 9 ,
59
.Xr vm_map_max 9 ,
60
.Xr vm_map_pmap 9 ,
61
.Xr vm_map_protect 9 ,
62
.Xr vm_map_remove 9 ,
63
.Xr vm_map_simplify_entry 9 ,
64
.Xr vm_map_stack 9 ,
65
.Xr vm_map_submap 9 ,
66
.Xr vm_map_wire 9
67
.Sh AUTHORS
68
This man page was written by
69
.An Bruce M Simpson Aq bms@spc.org .
(-)/usr/src/share/man/man9/vm_map_check_protection.9 (+66 lines)
Line 0 Link Here
1
.\"
2
.\" Copyright (c) 2003 Bruce M Simpson <bms@spc.org>
3
.\" All rights reserved.
4
.\"
5
.\" Redistribution and use in source and binary forms, with or without
6
.\" modification, are permitted provided that the following conditions
7
.\" are met:
8
.\" 1. Redistributions of source code must retain the above copyright
9
.\"    notice, this list of conditions and the following disclaimer.
10
.\" 2. Redistributions in binary form must reproduce the above copyright
11
.\"    notice, this list of conditions and the following disclaimer in the
12
.\"    documentation and/or other materials provided with the distribution.
13
.\"
14
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17
.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24
.\" SUCH DAMAGE.
25
.\"
26
.\" $FreeBSD$
27
.\"
28
.Dd July 19, 2003
29
.Dt vm_map_check_protection 9
30
.Sh NAME
31
.Nm vm_map_check_protection
32
.Nd check memory protection for a vm_map
33
.Sh SYNOPSIS
34
.In sys/param.h
35
.In vm/vm.h
36
.In vm/vm_map.h
37
.Ft boolean_t
38
.Fn vm_map_check_protection "vm_map_t map" "vm_offset_t start" "vm_offset_t end" "vm_prot_t protection"
39
.Sh DESCRIPTION
40
The
41
.Fn vm_map_check_protection
42
function asserts that the target
43
.Fa map
44
allows the specified privilege
45
.Fa protection
46
over the entire address range from
47
.Fa start
48
to
49
.Fa end .
50
.Sh RETURN VALUES
51
The
52
.Fn vm_map_check_protection
53
function returns TRUE if the privilege is allowed; otherwise the value
54
FALSE is returned.
55
.Sh NOTES
56
This code does not and SHOULD not check whether the contents of
57
the region is accessible.
58
For example, a small file may be mapped into an address space which
59
is significantly larger in size.
60
.Sh SEE ALSO
61
.Xr munmap 2 ,
62
.Xr vm_map 9 ,
63
.Xr vm_map_protect 9
64
.Sh AUTHORS
65
This man page was written by
66
.An Bruce M Simpson Aq bms@spc.org .
(-)/usr/src/share/man/man9/vm_map_clean.9 (+70 lines)
Line 0 Link Here
1
.\"
2
.\" Copyright (c) 2003 Bruce M Simpson <bms@spc.org>
3
.\" All rights reserved.
4
.\"
5
.\" Redistribution and use in source and binary forms, with or without
6
.\" modification, are permitted provided that the following conditions
7
.\" are met:
8
.\" 1. Redistributions of source code must retain the above copyright
9
.\"    notice, this list of conditions and the following disclaimer.
10
.\" 2. Redistributions in binary form must reproduce the above copyright
11
.\"    notice, this list of conditions and the following disclaimer in the
12
.\"    documentation and/or other materials provided with the distribution.
13
.\"
14
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17
.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24
.\" SUCH DAMAGE.
25
.\"
26
.\" $FreeBSD$
27
.\"
28
.Dd July 19, 2003
29
.Dt vm_map_clean 9
30
.Sh NAME
31
.Nm vm_map_clean
32
.Nd push dirty pages to their pager
33
.Sh SYNOPSIS
34
.In sys/param.h
35
.In vm/vm.h
36
.In vm/vm_map.h
37
.Ft int
38
.Fn vm_map_clean "vm_map_t map" "vm_offset_t start" "vm_offset_t end" "boolean_t syncio" "boolean_t invalidate"
39
.Sh DESCRIPTION
40
The
41
.Fn vm_map_clean
42
function forces any dirty cached pages in the range
43
.Fa start
44
to
45
.Fa end
46
within the
47
.Fa map
48
to be pushed to their underlying pager.
49
.Pp
50
If
51
.Fa syncio
52
is TRUE, dirty pages are written synchronously.
53
.Pp
54
If
55
.Fa invalidate
56
is TRUE, any cached pages are also freed.
57
.Sh RETURN VALUES
58
The
59
.Fn vm_map_clean
60
function returns KERN_SUCCESS if successful; otherwise, it returns an
61
appropriate error code.
62
.Sh NOTES
63
This function acquires the
64
.Li Giant
65
lock.
66
.Sh SEE ALSO
67
.Xr vm_map 9
68
.Sh AUTHORS
69
This man page was written by
70
.An Bruce M Simpson Aq bms@spc.org .
(-)/usr/src/share/man/man9/vm_map_create.9 (+61 lines)
Line 0 Link Here
1
.\"
2
.\" Copyright (c) 2003 Bruce M Simpson <bms@spc.org>
3
.\" All rights reserved.
4
.\"
5
.\" Redistribution and use in source and binary forms, with or without
6
.\" modification, are permitted provided that the following conditions
7
.\" are met:
8
.\" 1. Redistributions of source code must retain the above copyright
9
.\"    notice, this list of conditions and the following disclaimer.
10
.\" 2. Redistributions in binary form must reproduce the above copyright
11
.\"    notice, this list of conditions and the following disclaimer in the
12
.\"    documentation and/or other materials provided with the distribution.
13
.\"
14
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17
.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24
.\" SUCH DAMAGE.
25
.\"
26
.\" $FreeBSD$
27
.\"
28
.Dd July 19, 2003
29
.Dt vm_map_create 9
30
.Sh NAME
31
.Nm vm_map_create
32
.Nd create a new vm_map structure
33
.Sh SYNOPSIS
34
.In sys/param.h
35
.In vm/vm.h
36
.In vm/vm_map.h
37
.Ft vm_map_t
38
.Fn vm_map_create "pmap_t pmap" "vm_offset_t min" "vm_offset_t max"
39
.Sh DESCRIPTION
40
The
41
.Fn vm_map_create
42
function creates and returns a new, empty map structure, associated
43
with the physical map
44
.Fa pmap ,
45
and with the
46
upper and lower address bounds specified by
47
.Fa max
48
and
49
.Fa min
50
respectively.
51
.Sh RETURN VALUES
52
The
53
.Fn vm_map_create
54
function returns a pointer to the newly allocated map if successful.
55
If the function is unsuccessful, the return value is undefined.
56
.Sh SEE ALSO
57
.Xr vm_map 9 ,
58
.Xr vm_map_init 9
59
.Sh AUTHORS
60
This man page was written by
61
.An Bruce M Simpson Aq bms@spc.org .
(-)/usr/src/share/man/man9/vm_map_delete.9 (+67 lines)
Line 0 Link Here
1
.\"
2
.\" Copyright (c) 2003 Bruce M Simpson <bms@spc.org>
3
.\" All rights reserved.
4
.\"
5
.\" Redistribution and use in source and binary forms, with or without
6
.\" modification, are permitted provided that the following conditions
7
.\" are met:
8
.\" 1. Redistributions of source code must retain the above copyright
9
.\"    notice, this list of conditions and the following disclaimer.
10
.\" 2. Redistributions in binary form must reproduce the above copyright
11
.\"    notice, this list of conditions and the following disclaimer in the
12
.\"    documentation and/or other materials provided with the distribution.
13
.\"
14
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17
.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24
.\" SUCH DAMAGE.
25
.\"
26
.\" $FreeBSD$
27
.\"
28
.Dd July 19, 2003
29
.Dt vm_map_delete 9
30
.Sh NAME
31
.Nm vm_map_delete
32
.Nd deallocate an address range from a map
33
.Sh SYNOPSIS
34
.In sys/param.h
35
.In vm/vm.h
36
.In vm/vm_map.h
37
.Ft int
38
.Fn vm_map_delete "vm_map_t map" "vm_offset_t start" "vm_offset_t end"
39
.Sh DESCRIPTION
40
The
41
.Fn vm_map_delete
42
function deallocates the address range bounded by
43
.Fa start
44
and
45
.Fa end
46
from the
47
.Fa map .
48
.Sh RETURN VALUES
49
The
50
.Fn vm_map_delete
51
function returns KERN_SUCCESS if the range could be deleted succesfully;
52
otherwise, its return value is undefined.
53
.Sh NOTES
54
This function is for
55
.Fx
56
VM internal use only.
57
The
58
.Xr vm_map_remove 9
59
function should be called by 
60
.Fx
61
VM consumers.
62
.Sh SEE ALSO
63
.Xr vm_map 9 ,
64
.Xr vm_map_remove 9
65
.Sh AUTHORS
66
This man page was written by
67
.An Bruce M Simpson Aq bms@spc.org .
(-)/usr/src/share/man/man9/vm_map_find.9 (+91 lines)
Line 0 Link Here
1
.\"
2
.\" Copyright (c) 2003 Bruce M Simpson <bms@spc.org>
3
.\" All rights reserved.
4
.\"
5
.\" Redistribution and use in source and binary forms, with or without
6
.\" modification, are permitted provided that the following conditions
7
.\" are met:
8
.\" 1. Redistributions of source code must retain the above copyright
9
.\"    notice, this list of conditions and the following disclaimer.
10
.\" 2. Redistributions in binary form must reproduce the above copyright
11
.\"    notice, this list of conditions and the following disclaimer in the
12
.\"    documentation and/or other materials provided with the distribution.
13
.\"
14
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17
.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24
.\" SUCH DAMAGE.
25
.\"
26
.\" $FreeBSD$
27
.\"
28
.Dd July 19, 2003
29
.Dt vm_map_find 9
30
.Sh NAME
31
.Nm vm_map_find
32
.Nd find a free region within a map, and optionally map a vm_object
33
.Sh SYNOPSIS
34
.In sys/param.h
35
.In vm/vm.h
36
.In vm/vm_map.h
37
.Ft int
38
.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"
39
.Sh DESCRIPTION
40
The
41
.Fn vm_map_find
42
function attempts to find a free region in the target
43
.Fa map ,
44
with the given
45
.Fa length ,
46
and will also optionally create a mapping of
47
.Fa object .
48
.Pp
49
The search is defined to be first-fit from the address
50
.Fa addr
51
onwards.
52
.Pp
53
The arguments
54
.Fa offset ,
55
.Fa prot ,
56
.Fa max ,
57
and
58
.Fa cow
59
are passed unchanged to
60
.Xr vm_map_insert 9
61
when creating the mapping, if and only if a free region is found.
62
.Pp
63
If
64
.Fa object
65
is non-NULL, the reference count on the object must be incremented
66
by the caller before calling this function to account for the new entry.
67
.Pp
68
If
69
.Fa find_space
70
is TRUE, the function will call
71
.Xr vm_map_findspace 9
72
to discover a free region.
73
.Sh RETURN VALUES
74
The
75
.Fn
76
function returns KERN_SUCCESS if space for the mapping could be found and
77
the mapping was successfully created; otherwise, an appropriate error code
78
is returned.
79
.Sh NOTES
80
This function acquires a lock on
81
.Fa map
82
by calling
83
.Xr vm_map_lock 9 .
84
.Sh SEE ALSO
85
.Xr vm_map 9 ,
86
.Xr vm_map_findspace 9 ,
87
.Xr vm_map_insert 9 ,
88
.Xr vm_map_lock 9
89
.Sh AUTHORS
90
This man page was written by
91
.An Bruce M Simpson Aq bms@spc.org .
(-)/usr/src/share/man/man9/vm_map_findspace.9 (+75 lines)
Line 0 Link Here
1
.\"
2
.\" Copyright (c) 2003 Bruce M Simpson <bms@spc.org>
3
.\" All rights reserved.
4
.\"
5
.\" Redistribution and use in source and binary forms, with or without
6
.\" modification, are permitted provided that the following conditions
7
.\" are met:
8
.\" 1. Redistributions of source code must retain the above copyright
9
.\"    notice, this list of conditions and the following disclaimer.
10
.\" 2. Redistributions in binary form must reproduce the above copyright
11
.\"    notice, this list of conditions and the following disclaimer in the
12
.\"    documentation and/or other materials provided with the distribution.
13
.\"
14
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17
.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24
.\" SUCH DAMAGE.
25
.\"
26
.\" $FreeBSD$
27
.\"
28
.Dd July 19, 2003
29
.Dt vm_map_findspace 9
30
.Sh NAME
31
.Nm vm_map_findspace
32
.Nd find a free region within a map
33
.Sh SYNOPSIS
34
.In sys/param.h
35
.In vm/vm.h
36
.In vm/vm_map.h
37
.Ft int
38
.Fn vm_map_findspace "vm_map_t map" "vm_offset_t start" "vm_size_t length" "vm_offset_t *addr"
39
.Sh DESCRIPTION
40
The
41
.Fn vm_map_findspace
42
function attempts to find a region with sufficient space in the
43
.Fa map
44
for an object of size
45
.Fa length
46
at the address
47
.Fa addr .
48
.Pp
49
.Sh RETURN VALUES
50
The
51
.Fn vm_map_findspace
52
function returns the value 0 if successful, and
53
.Fa *addr
54
will contain the first virtual address in the found region;
55
otherwise, the value 1 is returned.
56
.Sh NOTES
57
It is the caller's responsibility to obtain a lock on the
58
.Fa map
59
using
60
.Xr vm_map_lock 9
61
before calling this function.
62
.Pp
63
This routine may call
64
.Xr pmap_growkernel 9
65
to grow the kernel's address space, if and only if the mapping is being
66
made within the kernel address space, and if insufficient space remains
67
in the
68
.Li kernel_map .
69
.Sh SEE ALSO
70
.Xr pmap_growkernel 9 ,
71
.Xr vm_map 9 ,
72
.Xr vm_map_lock 9
73
.Sh AUTHORS
74
This man page was written by
75
.An Bruce M Simpson Aq bms@spc.org .
(-)/usr/src/share/man/man9/vm_map_inherit.9 (+61 lines)
Line 0 Link Here
1
.\"
2
.\" Copyright (c) 2003 Bruce M Simpson <bms@spc.org>
3
.\" All rights reserved.
4
.\"
5
.\" Redistribution and use in source and binary forms, with or without
6
.\" modification, are permitted provided that the following conditions
7
.\" are met:
8
.\" 1. Redistributions of source code must retain the above copyright
9
.\"    notice, this list of conditions and the following disclaimer.
10
.\" 2. Redistributions in binary form must reproduce the above copyright
11
.\"    notice, this list of conditions and the following disclaimer in the
12
.\"    documentation and/or other materials provided with the distribution.
13
.\"
14
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17
.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24
.\" SUCH DAMAGE.
25
.\"
26
.\" $FreeBSD$
27
.\"
28
.Dd July 19, 2003
29
.Dt vm_map_inherit 9
30
.Sh NAME
31
.Nm vm_map_inherit
32
.Nd set fork inheritance flags for a range within a map
33
.Sh SYNOPSIS
34
.In sys/param.h
35
.In vm/vm.h
36
.In vm/vm_map.h
37
.Ft int
38
.Fn vm_map_inherit "vm_map_t map" "vm_offset_t start" "vm_offset_t end" "vm_inherit_t new_inheritance"
39
.Sh DESCRIPTION
40
The
41
.Fn vm_map_inherit
42
function sets the inheritance flags for the range
43
.Fa start
44
to
45
.Fa end
46
within the target
47
.Fa map
48
to the value
49
.Fa new_inheritance .
50
This affects how the map will be shared with child maps when the
51
associated process forks.
52
.Sh RETURN VALUES
53
The
54
.Fn vm_map_inherit
55
function returns KERN_SUCCESS if the inheritance flags could be set;
56
otherwise, an appropriate error code is returned.
57
.Sh SEE ALSO
58
.Xr fork 2
59
.Sh AUTHORS
60
This man page was written by
61
.An Bruce M Simpson Aq bms@spc.org .
(-)/usr/src/share/man/man9/vm_map_init.9 (+58 lines)
Line 0 Link Here
1
.\"
2
.\" Copyright (c) 2003 Bruce M Simpson <bms@spc.org>
3
.\" All rights reserved.
4
.\"
5
.\" Redistribution and use in source and binary forms, with or without
6
.\" modification, are permitted provided that the following conditions
7
.\" are met:
8
.\" 1. Redistributions of source code must retain the above copyright
9
.\"    notice, this list of conditions and the following disclaimer.
10
.\" 2. Redistributions in binary form must reproduce the above copyright
11
.\"    notice, this list of conditions and the following disclaimer in the
12
.\"    documentation and/or other materials provided with the distribution.
13
.\"
14
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17
.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24
.\" SUCH DAMAGE.
25
.\"
26
.\" $FreeBSD$
27
.\"
28
.Dd July 19, 2003
29
.Dt vm_map_init 9
30
.Sh NAME
31
.Nm vm_map_init
32
.Nd initialize a vm_map structure for process zero
33
.Sh SYNOPSIS
34
.In sys/param.h
35
.In vm/vm.h
36
.In vm/vm_map.h
37
.Ft void
38
.Fn vm_map_init "vm_map_t map" "vm_offset_t min" "vm_offset_t max"
39
.Sh DESCRIPTION
40
The
41
.Fn vm_map_init
42
function initializes the system map
43
.Fa map
44
by setting its upper and lower address bounds to
45
.Fa max
46
and
47
.Fa min
48
respectively.
49
.Pp
50
It also initializes the system map mutex.
51
.Sh NOTES
52
This routine is for internal use only.
53
It is called during early system initialization.
54
.Sh SEE ALSO
55
.Xr vm_map 9
56
.Sh AUTHORS
57
This man page was written by
58
.An Bruce M Simpson Aq bms@spc.org .
(-)/usr/src/share/man/man9/vm_map_insert.9 (+80 lines)
Line 0 Link Here
1
.\"
2
.\" Copyright (c) 2003 Bruce M Simpson <bms@spc.org>
3
.\" All rights reserved.
4
.\"
5
.\" Redistribution and use in source and binary forms, with or without
6
.\" modification, are permitted provided that the following conditions
7
.\" are met:
8
.\" 1. Redistributions of source code must retain the above copyright
9
.\"    notice, this list of conditions and the following disclaimer.
10
.\" 2. Redistributions in binary form must reproduce the above copyright
11
.\"    notice, this list of conditions and the following disclaimer in the
12
.\"    documentation and/or other materials provided with the distribution.
13
.\"
14
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17
.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24
.\" SUCH DAMAGE.
25
.\"
26
.\" $FreeBSD$
27
.\"
28
.Dd July 19, 2003
29
.Dt vm_map_insert 9
30
.Sh NAME
31
.Nm vm_map_insert
32
.Nd insert an object into a map
33
.Sh SYNOPSIS
34
.In sys/param.h
35
.In vm/vm.h
36
.In vm/vm_map.h
37
.Ft int
38
.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"
39
.Sh DESCRIPTION
40
The
41
.Fn vm_map_insert
42
function inserts a mapping for the entire vm_object
43
.Fa object
44
into the target map
45
.Fa map .
46
.Pp
47
The
48
.Fa offset
49
argument specifies the offset into the
50
.Fa object
51
at which to begin mapping.
52
The object's size should match that of the specified address range.
53
.Pp
54
The
55
.Fa start
56
and
57
.Fa end
58
arguments specify the bounds of the mapped object's window in the
59
address space of
60
.Fa map .
61
.Pp
62
The
63
.Fa cow
64
argment specifies the flags which should be propagated to the new entry,
65
for example, to indicate that this is a copy-on-write mapping.
66
.Sh RETURN VALUES
67
The
68
.Fn vm_map_insert
69
function returns KERN_SUCCESS if the mapping could be made successfully;
70
otherwise, an appropriate error code is returned.
71
.Sh NOTES
72
This function implicity creates a new
73
.Li vm_map_entry
74
by calling the internal function
75
.Fn vm_map_entry_create .
76
.Sh SEE ALSO
77
.Xr vm_map 9
78
.Sh AUTHORS
79
This man page was written by
80
.An Bruce M Simpson Aq bms@spc.org .
(-)/usr/src/share/man/man9/vm_map_lock.9 (+116 lines)
Line 0 Link Here
1
.\"
2
.\" Copyright (c) 2003 Bruce M Simpson <bms@spc.org>
3
.\" All rights reserved.
4
.\"
5
.\" Redistribution and use in source and binary forms, with or without
6
.\" modification, are permitted provided that the following conditions
7
.\" are met:
8
.\" 1. Redistributions of source code must retain the above copyright
9
.\"    notice, this list of conditions and the following disclaimer.
10
.\" 2. Redistributions in binary form must reproduce the above copyright
11
.\"    notice, this list of conditions and the following disclaimer in the
12
.\"    documentation and/or other materials provided with the distribution.
13
.\"
14
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17
.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24
.\" SUCH DAMAGE.
25
.\"
26
.\" $FreeBSD$
27
.\"
28
.Dd July 19, 2003
29
.Dt vm_map_lock 9
30
.Sh NAME
31
.Nm vm_map_lock ,
32
.Nm vm_map_unlock ,
33
.Nm vm_map_lock_read ,
34
.Nm vm_map_unlock_read ,
35
.Nm vm_map_trylock ,
36
.Nm vm_map_trylock_read ,
37
.Nm vm_map_lock_upgrade ,
38
.Nm vm_map_lock_downgrade
39
.Nd vm_map locking macros
40
.Sh SYNOPSIS
41
.In sys/param.h
42
.In vm/vm.h
43
.In vm/vm_map.h
44
.Ft void
45
.Fn vm_map_lock "vm_map_t map"
46
.Ft void
47
.Fn vm_map_unlock "vm_map_t map"
48
.Ft void
49
.Fn vm_map_lock_read "vm_map_t map"
50
.Ft void
51
.Fn vm_map_unlock_read "vm_map_t map"
52
.Ft int
53
.Fn vm_map_trylock "vm_map_t map"
54
.Ft int
55
.Fn vm_map_trylock_read "vm_map_t map"
56
.Ft int
57
.Fn vm_map_lock_upgrade "vm_map_t map"
58
.Ft int
59
.Fn vm_map_lock_downgrade "vm_map_t map"
60
.Sh DESCRIPTION
61
The
62
.Fn vm_map_lock
63
macro obtains an exclusive lock on
64
.Fa map .
65
.Pp
66
The
67
.Fn vm_map_unlock
68
macro releases an exclusive lock on
69
.Fa map .
70
.Pp
71
The
72
.Fn vm_map_lock_read
73
macro obtains a read-lock on
74
.Fa map .
75
Currently this is implemented as an exclusive lock.
76
.Pp
77
The
78
.Fn vm_map_unlock_read
79
macro releases a read-lock on
80
.Fa map .
81
.Pp
82
The
83
.Fn vm_map_trylock
84
macro attempts to obtain an exclusive lock on
85
.Fa map .
86
It returns FALSE if the lock cannot be immediately acquired;
87
otherwise return TRUE with the lock acquired.
88
.Pp
89
The
90
.Fn vm_map_trylock_read
91
macro attempts to obtain a read-lock on
92
.Fa map .
93
It returns FALSE if the lock cannot be immediately acquired;
94
otherwise return TRUE with the lock acquired.
95
Currently this is implemented as an exclusive lock.
96
.Pp
97
The
98
.Fn vm_map_lock_upgrade
99
macro attempts to atomically upgrade a read-lock on
100
.Fa map
101
to an exclusive lock.
102
As read-locks are currently implemented as exclusive locks,
103
this macro is a no-op.
104
.Pp
105
The
106
.Fn vm_map_lock_downgrade
107
macro attempts to downgrade an exclusive lock on
108
.Fa map
109
to a read-lock.
110
As read-locks are currently implemented as exclusive locks,
111
this macro is a no-op.
112
.Sh SEE ALSO
113
.Xr vm_map 9
114
.Sh AUTHORS
115
This man page was written by
116
.An Bruce M Simpson Aq bms@spc.org .
(-)/usr/src/share/man/man9/vm_map_lookup.9 (+81 lines)
Line 0 Link Here
1
.\"
2
.\" Copyright (c) 2003 Bruce M Simpson <bms@spc.org>
3
.\" All rights reserved.
4
.\"
5
.\" Redistribution and use in source and binary forms, with or without
6
.\" modification, are permitted provided that the following conditions
7
.\" are met:
8
.\" 1. Redistributions of source code must retain the above copyright
9
.\"    notice, this list of conditions and the following disclaimer.
10
.\" 2. Redistributions in binary form must reproduce the above copyright
11
.\"    notice, this list of conditions and the following disclaimer in the
12
.\"    documentation and/or other materials provided with the distribution.
13
.\"
14
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17
.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24
.\" SUCH DAMAGE.
25
.\"
26
.\" $FreeBSD$
27
.\"
28
.Dd July 19, 2003
29
.Dt vm_map_lookup 9
30
.Sh NAME
31
.Nm vm_map_lookup ,
32
.Nm vm_map_lookup_done
33
.Nd lookup the vm_object backing a given virtual region
34
.Sh SYNOPSIS
35
.In sys/param.h
36
.In vm/vm.h
37
.In vm/vm_map.h
38
.Ft int
39
.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"
40
.Ft void
41
.Fn vm_map_lookup_done "vm_map_t map" "vm_map_entry_t entry"
42
.Sh DESCRIPTION
43
The
44
.Fn vm_map_lookup
45
function attempts to find the
46
vm_object, page index and protection, for the given virtual address
47
.Fa vaddr ,
48
in the map
49
.Fa var_map ,
50
assuming a page fault of the type
51
.Fa fault_type
52
had occurred.
53
.Pp
54
Return values are guaranteed until
55
.Fn vm_map_lookup_done
56
is called to release the lock.
57
.Sh RETURN VALUES
58
If successful, the
59
.Fn vm_map_lookup
60
function returns KERN_SUCCESS, and sets the
61
.Fa *object ,
62
.Fa *pindex ,
63
.Fa *out_prot ,
64
and
65
.Fa *out_entry
66
arguments appropriately for the hypothetical page fault.
67
If unsuccessful, an appropriate error code is returned.
68
.Sh NOTES
69
The function
70
.Fn vm_map_lookup
71
acquires a read-lock on the map
72
.Fa *var_map ,
73
but does not release it.
74
The caller should invoke
75
.Fn vm_map_lookup_done
76
in order to release this lock.
77
.Sh SEE ALSO
78
.Xr vm_map 9
79
.Sh AUTHORS
80
This man page was written by
81
.An Bruce M Simpson Aq bms@spc.org .
(-)/usr/src/share/man/man9/vm_map_madvise.9 (+70 lines)
Line 0 Link Here
1
.\"
2
.\" Copyright (c) 2003 Bruce M Simpson <bms@spc.org>
3
.\" All rights reserved.
4
.\"
5
.\" Redistribution and use in source and binary forms, with or without
6
.\" modification, are permitted provided that the following conditions
7
.\" are met:
8
.\" 1. Redistributions of source code must retain the above copyright
9
.\"    notice, this list of conditions and the following disclaimer.
10
.\" 2. Redistributions in binary form must reproduce the above copyright
11
.\"    notice, this list of conditions and the following disclaimer in the
12
.\"    documentation and/or other materials provided with the distribution.
13
.\"
14
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17
.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24
.\" SUCH DAMAGE.
25
.\"
26
.\" $FreeBSD$
27
.\"
28
.Dd July 19, 2003
29
.Dt vm_map_madvise 9
30
.Sh NAME
31
.Nm vm_map_madvise
32
.Nd apply advice about use of memory to map entries
33
.Sh SYNOPSIS
34
.In sys/param.h
35
.In vm/vm.h
36
.In vm/vm_map.h
37
.Ft int
38
.Fn vm_map_madvise "vm_map_t map" "vm_offset_t start" "vm_offset_t end" "int behav"
39
.Sh DESCRIPTION
40
The
41
.Fn vm_map_madvise
42
function applies the flags
43
.Fa behav
44
to the entries within
45
.Fa map
46
between
47
.Fa start
48
and
49
.Fa end .
50
.Pp
51
Advisories are classified as either those affecting the
52
.Li vm_map_entry
53
structure, or those affecting the underlying objects.
54
.Pp
55
The
56
.Fn vm_map_madvise
57
function is used by the
58
.Fn madvise
59
system call.
60
.Sh RETURN VALUES
61
The
62
.Fn vm_map_madvise
63
function returns 0 if successful; otherwise, an appropriate error code is
64
returned.
65
.Sh SEE ALSO
66
.Xr madvise 2 ,
67
.Xr vm_map 9
68
.Sh AUTHORS
69
This man page was written by
70
.An Bruce M Simpson Aq bms@spc.org .
(-)/usr/src/share/man/man9/vm_map_max.9 (+64 lines)
Line 0 Link Here
1
.\"
2
.\" Copyright (c) 2003 Bruce M Simpson <bms@spc.org>
3
.\" All rights reserved.
4
.\"
5
.\" Redistribution and use in source and binary forms, with or without
6
.\" modification, are permitted provided that the following conditions
7
.\" are met:
8
.\" 1. Redistributions of source code must retain the above copyright
9
.\"    notice, this list of conditions and the following disclaimer.
10
.\" 2. Redistributions in binary form must reproduce the above copyright
11
.\"    notice, this list of conditions and the following disclaimer in the
12
.\"    documentation and/or other materials provided with the distribution.
13
.\"
14
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17
.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24
.\" SUCH DAMAGE.
25
.\"
26
.\" $FreeBSD$
27
.\"
28
.Dd July 19, 2003
29
.Dt vm_map_max 9
30
.Sh NAME
31
.Nm vm_map_max ,
32
.Nm vm_map_min ,
33
.Nm vm_map_pmap
34
.Nd return map properties
35
.Sh SYNOPSIS
36
.In sys/param.h
37
.In vm/vm.h
38
.In vm/vm_map.h
39
.Ft vm_offset_t
40
.Fn vm_map_max "vm_map_t map"
41
.Ft vm_offset_t
42
.Fn vm_map_min "vm_map_t map"
43
.Ft pmap_t
44
.Fn vm_map_pmap "vm_map_t map"
45
.Sh DESCRIPTION
46
The function
47
.Fn vm_map_min
48
returns the upper address bound of the map
49
.Fa map .
50
.Pp
51
The function
52
.Fn vm_map_max
53
returns the lower address bound of the map
54
.Fa map .
55
.Pp
56
The function
57
.Fn vm_map_pmap
58
returns a pointer to the physical map associated with the virtual map
59
.Fa map .
60
.Sh SEE ALSO
61
.Xr vm_map 9
62
.Sh AUTHORS
63
This man page was written by
64
.An Bruce M Simpson Aq bms@spc.org .
(-)/usr/src/share/man/man9/vm_map_pmap.9 (+44 lines)
Line 0 Link Here
1
.\"
2
.\" Copyright (c) 2003 Bruce M Simpson <bms@spc.org>
3
.\" All rights reserved.
4
.\"
5
.\" Redistribution and use in source and binary forms, with or without
6
.\" modification, are permitted provided that the following conditions
7
.\" are met:
8
.\" 1. Redistributions of source code must retain the above copyright
9
.\"    notice, this list of conditions and the following disclaimer.
10
.\" 2. Redistributions in binary form must reproduce the above copyright
11
.\"    notice, this list of conditions and the following disclaimer in the
12
.\"    documentation and/or other materials provided with the distribution.
13
.\"
14
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17
.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24
.\" SUCH DAMAGE.
25
.\"
26
.\" $FreeBSD$
27
.\"
28
.Dd July 19, 2003
29
.Dt vm_map 9
30
.Sh NAME
31
.Nm vm_map
32
.Nd virtual address space portion of virtual memory subsystem
33
.Sh SYNOPSIS
34
.In sys/param.h
35
.In vm/vm.h
36
.In vm/vm_map.h
37
.Sh DESCRIPTION
38
.Sh RETURN VALUES
39
.Sh NOTES
40
.Sh BUGS
41
.Sh SEE ALSO
42
.Sh AUTHORS
43
This man page was written by
44
.An Bruce M Simpson Aq bms@spc.org .
(-)/usr/src/share/man/man9/vm_map_protect.9 (+72 lines)
Line 0 Link Here
1
.\"
2
.\" Copyright (c) 2003 Bruce M Simpson <bms@spc.org>
3
.\" All rights reserved.
4
.\"
5
.\" Redistribution and use in source and binary forms, with or without
6
.\" modification, are permitted provided that the following conditions
7
.\" are met:
8
.\" 1. Redistributions of source code must retain the above copyright
9
.\"    notice, this list of conditions and the following disclaimer.
10
.\" 2. Redistributions in binary form must reproduce the above copyright
11
.\"    notice, this list of conditions and the following disclaimer in the
12
.\"    documentation and/or other materials provided with the distribution.
13
.\"
14
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17
.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24
.\" SUCH DAMAGE.
25
.\"
26
.\" $FreeBSD$
27
.\"
28
.Dd July 19, 2003
29
.Dt vm_map_protect 9
30
.Sh NAME
31
.Nm vm_map_protect
32
.Nd apply protection bits to a virtual region
33
.Sh SYNOPSIS
34
.In sys/param.h
35
.In vm/vm.h
36
.In vm/vm_map.h
37
.Ft int
38
.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"
39
.Sh DESCRIPTION
40
The
41
.Fn vm_map_protect
42
function sets the protection bits of the address region bounded by
43
.Fa start
44
and
45
.Fa end
46
within the map
47
.Fa map
48
to
49
.Fa new_prot .
50
.Pp
51
If
52
.Fa set_max
53
is TRUE,
54
.Fa new_prot
55
is treated as the new
56
.Li max_protection
57
setting for each underlying entry.
58
Otherwise, only the
59
.Li protection
60
field is affected.
61
.Sh RETURN VALUES
62
The
63
.Fn vm_map_protect
64
function returns
65
.Li KERN_SUCCESS
66
if the protection bits could be set successfully; otherwise, the return
67
value is undefined.
68
.Sh SEE ALSO
69
.Xr vm_map 9
70
.Sh AUTHORS
71
This man page was written by
72
.An Bruce M Simpson Aq bms@spc.org .
(-)/usr/src/share/man/man9/vm_map_remove.9 (+58 lines)
Line 0 Link Here
1
.\"
2
.\" Copyright (c) 2003 Bruce M Simpson <bms@spc.org>
3
.\" All rights reserved.
4
.\"
5
.\" Redistribution and use in source and binary forms, with or without
6
.\" modification, are permitted provided that the following conditions
7
.\" are met:
8
.\" 1. Redistributions of source code must retain the above copyright
9
.\"    notice, this list of conditions and the following disclaimer.
10
.\" 2. Redistributions in binary form must reproduce the above copyright
11
.\"    notice, this list of conditions and the following disclaimer in the
12
.\"    documentation and/or other materials provided with the distribution.
13
.\"
14
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17
.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24
.\" SUCH DAMAGE.
25
.\"
26
.\" $FreeBSD$
27
.\"
28
.Dd July 19, 2003
29
.Dt vm_map_remove 9
30
.Sh NAME
31
.Nm vm_map_remove
32
.Nd remove a virtual address range from a map
33
.Sh SYNOPSIS
34
.In sys/param.h
35
.In vm/vm.h
36
.In vm/vm_map.h
37
.Ft int
38
.Fn vm_map_remove "vm_map_t map" "vm_offset_t start" "vm_offset_t end"
39
.Sh DESCRIPTION
40
The
41
.Fn vm_map_remove
42
function removes the given address range bounded by
43
.Fa start
44
and
45
.Fa end
46
from the target
47
.Fa map .
48
.Sh RETURN VALUES
49
The
50
.Fn vm_map_remove
51
returns
52
.Li KERN_SUCCESS
53
if successful; otherwise, the return value is undefined.
54
.Sh SEE ALSO
55
.Xr vm_map 9
56
.Sh AUTHORS
57
This man page was written by
58
.An Bruce M Simpson Aq bms@spc.org .
(-)/usr/src/share/man/man9/vm_map_simplify_entry.9 (+59 lines)
Line 0 Link Here
1
.\"
2
.\" Copyright (c) 2003 Bruce M Simpson <bms@spc.org>
3
.\" All rights reserved.
4
.\"
5
.\" Redistribution and use in source and binary forms, with or without
6
.\" modification, are permitted provided that the following conditions
7
.\" are met:
8
.\" 1. Redistributions of source code must retain the above copyright
9
.\"    notice, this list of conditions and the following disclaimer.
10
.\" 2. Redistributions in binary form must reproduce the above copyright
11
.\"    notice, this list of conditions and the following disclaimer in the
12
.\"    documentation and/or other materials provided with the distribution.
13
.\"
14
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17
.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24
.\" SUCH DAMAGE.
25
.\"
26
.\" $FreeBSD$
27
.\"
28
.Dd July 19, 2003
29
.Dt vm_map_simplify_entry 9
30
.Sh NAME
31
.Nm vm_map_simplify_entry
32
.Nd simplify a vm_map_entry
33
.Sh SYNOPSIS
34
.In sys/param.h
35
.In vm/vm.h
36
.In vm/vm_map.h
37
.Ft void
38
.Fn vm_map_simplify_entry "vm_map_t map" "vm_map_entry_t entry"
39
.Sh DESCRIPTION
40
The
41
.Fn vm_map_simplify_entry
42
function simplifies the given
43
.Fa entry
44
by merging with either neighbour.
45
This routine also has the ability to merge with both neighbours.
46
.Sh NOTES
47
This routine guarantees that the passed entry remains valid, although
48
possibly extended.
49
.Pp
50
The
51
.Fa map
52
must be locked upon entry.
53
.Sh SEE ALSO
54
.Xr vm_map 9 ,
55
.Xr vm_map_insert 9 ,
56
.Xr vm_map_remove 9
57
.Sh AUTHORS
58
This man page was written by
59
.An Bruce M Simpson Aq bms@spc.org .
(-)/usr/src/share/man/man9/vm_map_stack.9 (+107 lines)
Line 0 Link Here
1
.\"
2
.\" Copyright (c) 2003 Bruce M Simpson <bms@spc.org>
3
.\" All rights reserved.
4
.\"
5
.\" Redistribution and use in source and binary forms, with or without
6
.\" modification, are permitted provided that the following conditions
7
.\" are met:
8
.\" 1. Redistributions of source code must retain the above copyright
9
.\"    notice, this list of conditions and the following disclaimer.
10
.\" 2. Redistributions in binary form must reproduce the above copyright
11
.\"    notice, this list of conditions and the following disclaimer in the
12
.\"    documentation and/or other materials provided with the distribution.
13
.\"
14
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17
.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24
.\" SUCH DAMAGE.
25
.\"
26
.\" $FreeBSD$
27
.\"
28
.Dd July 19, 2003
29
.Dt vm_map_stack 9
30
.Sh NAME
31
.Nm vm_map_stack ,
32
.Nm vm_map_growstack
33
.Nd manage process stacks
34
.Sh SYNOPSIS
35
.In sys/param.h
36
.In vm/vm.h
37
.In vm/vm_map.h
38
.Ft int
39
.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"
40
.Ft int
41
.Fn vm_map_growstack "struct proc *p" "vm_offset_t addr"
42
.Sh DESCRIPTION
43
The
44
.Fn
45
function maps a process stack for a new process image.
46
The stack is mapped
47
.Fa addrbos
48
in
49
.Fa map ,
50
with a maximum size of
51
.Fa max_ssize .
52
Copy-on-write flags passed in
53
.Fa cow
54
are also applied to the new mapping.
55
Protection bits are supplied by
56
.Fa prot
57
and
58
.Fa max .
59
.Pp
60
It is typically called by
61
.Xr exec 2 .
62
.Pp
63
The
64
.Fn vm_map_growstack
65
function is responsible for growing a stack for the process
66
.Fa p
67
to the desired address
68
.Fa addr ,
69
similar to the legacy
70
.Xr sbrk 2
71
call.
72
.Sh RETURN VALUES
73
The
74
.Fn vm_map_stack
75
function returns
76
.Li KERN_SUCCESS
77
if the mapping was allocated successfully; otherwise, it returns an
78
appropriate error code.
79
.Pp
80
The
81
.Fn vm_map_growstack
82
function returns
83
.Li KERN_SUCCESS
84
if
85
.Fa addr
86
is already mapped, or if the stack was grown successfully.
87
.Pp
88
It also returns
89
.Li KERN_SUCCESS
90
if
91
.Fa addr
92
is outside the stack range; this is done in order to preserve
93
compatibility with the depracated grow function previously located in
94
.Li vm_machdep.c .
95
.Sh NOTES
96
The
97
.Fn vm_map_growstack
98
function acquires the
99
.Li Giant
100
lock, and the process lock on
101
.Fa p .
102
.Sh SEE ALSO
103
.Xr vm_map 9 ,
104
.Xr vm_map_insert 9
105
.Sh AUTHORS
106
This man page was written by
107
.An Bruce M Simpson Aq bms@spc.org .
(-)/usr/src/share/man/man9/vm_map_submap.9 (+84 lines)
Line 0 Link Here
1
.\"
2
.\" Copyright (c) 2003 Bruce M Simpson <bms@spc.org>
3
.\" All rights reserved.
4
.\"
5
.\" Redistribution and use in source and binary forms, with or without
6
.\" modification, are permitted provided that the following conditions
7
.\" are met:
8
.\" 1. Redistributions of source code must retain the above copyright
9
.\"    notice, this list of conditions and the following disclaimer.
10
.\" 2. Redistributions in binary form must reproduce the above copyright
11
.\"    notice, this list of conditions and the following disclaimer in the
12
.\"    documentation and/or other materials provided with the distribution.
13
.\"
14
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17
.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24
.\" SUCH DAMAGE.
25
.\"
26
.\" $FreeBSD$
27
.\"
28
.Dd July 19, 2003
29
.Dt vm_map_submap 9
30
.Sh NAME
31
.Nm vm_map_submap
32
.Nd create a subordinate map
33
.Sh SYNOPSIS
34
.In sys/param.h
35
.In vm/vm.h
36
.In vm/vm_map.h
37
.Ft int
38
.Fn vm_map_submap "vm_map_t map" "vm_offset_t start" "vm_offset_t end" "vm_map_t submap"
39
.Sh DESCRIPTION
40
The
41
.Fn vm_map_submap
42
function marks the range bounded by
43
.Fa start
44
and
45
.Fa end
46
within the map
47
.Fa map
48
as being handled by a subordinate map
49
.Fa sub_map .
50
.Pp
51
It is generally called by the kernel memory allocator.
52
.Sh RETURN VALUES
53
The
54
.Fn vm_map_submap
55
function returns
56
.Li KERN_SUCCESS
57
if successful; otherwise, it returns an appropriate error code.
58
.Sh NOTES
59
This function is for internal use only.
60
.Pp
61
Both maps must exist.
62
The range must have been created with
63
.Xr vm_map_find 9
64
previously.
65
.Pp
66
No other operations may have been performed on this range
67
before calling this function.
68
Only the
69
.Fn vm_fault
70
operation may be performed within this range after calling
71
this function.
72
.Pp
73
To remove a submapping, one must first remove the range from
74
the parent
75
.Fa map ,
76
and then destroy the
77
.Fa sub_map .
78
This procedure is not recommended.
79
.Sh SEE ALSO
80
.Xr vm_map 9 ,
81
.Xr vm_map_find 9
82
.Sh AUTHORS
83
This man page was written by
84
.An Bruce M Simpson Aq bms@spc.org .
(-)/usr/src/share/man/man9/vm_map_wire.9 (+99 lines)
Line 0 Link Here
1
.\"
2
.\" Copyright (c) 2003 Bruce M Simpson <bms@spc.org>
3
.\" All rights reserved.
4
.\"
5
.\" Redistribution and use in source and binary forms, with or without
6
.\" modification, are permitted provided that the following conditions
7
.\" are met:
8
.\" 1. Redistributions of source code must retain the above copyright
9
.\"    notice, this list of conditions and the following disclaimer.
10
.\" 2. Redistributions in binary form must reproduce the above copyright
11
.\"    notice, this list of conditions and the following disclaimer in the
12
.\"    documentation and/or other materials provided with the distribution.
13
.\"
14
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17
.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24
.\" SUCH DAMAGE.
25
.\"
26
.\" $FreeBSD$
27
.\"
28
.Dd July 19, 2003
29
.Dt vm_map_wire 9
30
.Sh NAME
31
.Nm vm_map_wire ,
32
.Nm vm_map_unwire
33
.Nd manage page wiring within an address space map
34
.Sh SYNOPSIS
35
.In sys/param.h
36
.In vm/vm.h
37
.In vm/vm_map.h
38
.Ft int
39
.Fn vm_map_wire "vm_map_t map" "vm_offset_t start" "vm_offset_t end" "int flags"
40
.Ft int
41
.Fn vm_map_unwire "vm_map_t map" "vm_offset_t start" "vm_offset_t end" "int flags"
42
.Sh DESCRIPTION
43
The
44
.Fn vm_map_wire
45
function is responsible for wiring pages in the range between
46
.Fa start
47
and
48
.Fa end
49
within the map
50
.Fa map .
51
Wired pages are locked into physical memory, and may not be paged out
52
as long as their wire count remains above zero.
53
.Pp
54
The
55
.Fn vm_map_unwire
56
function performs the corresponding unwire operation.
57
.Pp
58
The
59
.Fa flags
60
argument is a bit mask, consisting of the following flags:
61
.Pp
62
If the
63
.Li VM_MAP_WIRE_USER
64
flag is set, the function operates within user address space.
65
.Pp
66
If the
67
.Li VM_MAP_WIRE_NONCONTIG
68
flag is set, it may operate upon an arbitrary range within the
69
address space of
70
.Fa map ;
71
otherwise, the specified range must be contiguous.
72
This is the flag used by the
73
.Fn mlockall
74
and
75
.Fn munlockall
76
system calls.
77
.Sh RETURN VALUES
78
The
79
.Fn vm_map_wire
80
function returns
81
.Li KERN_SUCCESS
82
if all pages within the range were wired successfully; otherwise, it returns
83
an appropriate error code.
84
.Pp
85
The
86
.Fn vm_map_unwire
87
function returns
88
.Li KERN_SUCCESS
89
if all pages within the range were unwired successfully; otherwise, it returns
90
an appropriate error code.
91
.Sh NOTES
92
.Sh BUGS
93
.Sh SEE ALSO
94
.Xr mlockall 2 ,
95
.Xr munlockall 2 ,
96
.Xr vm_map 9
97
.Sh AUTHORS
98
This man page was written by
99
.An Bruce M Simpson Aq bms@spc.org .

Return to bug 54632