Commit | Line | Data |
---|---|---|
15637ed4 RG |
1 | /* |
2 | * Copyright (c) 1991 Regents of the University of California. | |
3 | * All rights reserved. | |
4 | * | |
5 | * This code is derived from software contributed to Berkeley by | |
6 | * The Mach Operating System project at Carnegie-Mellon University. | |
7 | * | |
8 | * Redistribution and use in source and binary forms, with or without | |
9 | * modification, are permitted provided that the following conditions | |
10 | * are met: | |
11 | * 1. Redistributions of source code must retain the above copyright | |
12 | * notice, this list of conditions and the following disclaimer. | |
13 | * 2. Redistributions in binary form must reproduce the above copyright | |
14 | * notice, this list of conditions and the following disclaimer in the | |
15 | * documentation and/or other materials provided with the distribution. | |
16 | * 3. All advertising materials mentioning features or use of this software | |
17 | * must display the following acknowledgement: | |
18 | * This product includes software developed by the University of | |
19 | * California, Berkeley and its contributors. | |
20 | * 4. Neither the name of the University nor the names of its contributors | |
21 | * may be used to endorse or promote products derived from this software | |
22 | * without specific prior written permission. | |
23 | * | |
24 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | |
25 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |
26 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |
27 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | |
28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |
29 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | |
30 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
31 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
32 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
33 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
34 | * SUCH DAMAGE. | |
35 | * | |
1284e777 | 36 | * from: @(#)vm_user.h 7.2 (Berkeley) 4/21/91 |
fde1aeb2 | 37 | * $Id: vm_user.h,v 1.3 1993/11/07 17:54:29 wollman Exp $ |
1284e777 RG |
38 | */ |
39 | ||
40 | /* | |
15637ed4 RG |
41 | * Copyright (c) 1987, 1990 Carnegie-Mellon University. |
42 | * All rights reserved. | |
43 | * | |
44 | * Authors: Avadis Tevanian, Jr., Michael Wayne Young | |
45 | * | |
46 | * Permission to use, copy, modify and distribute this software and | |
47 | * its documentation is hereby granted, provided that both the copyright | |
48 | * notice and this permission notice appear in all copies of the | |
49 | * software, derivative works or modified versions, and any portions | |
50 | * thereof, and that both notices appear in supporting documentation. | |
51 | * | |
52 | * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" | |
53 | * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND | |
54 | * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. | |
55 | * | |
56 | * Carnegie Mellon requests users of this software to return to | |
57 | * | |
58 | * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU | |
59 | * School of Computer Science | |
60 | * Carnegie Mellon University | |
61 | * Pittsburgh PA 15213-3890 | |
62 | * | |
63 | * any improvements or extensions that they make and grant Carnegie the | |
64 | * rights to redistribute these changes. | |
65 | */ | |
66 | ||
67 | /* | |
68 | * Kernel memory management definitions. | |
69 | */ | |
70 | ||
71 | #ifndef _VM_USER_ | |
72 | #define _VM_USER_ | |
73 | ||
fde1aeb2 GW |
74 | #ifdef KERNEL |
75 | ||
76 | #include "sys/cdefs.h" | |
77 | #include "vm/vm_param.h" | |
78 | #include "vm/vm_inherit.h" | |
79 | #include "vm/vm_prot.h" | |
80 | ||
81 | struct vm_map; struct vm_object; struct pager_struct; | |
82 | ||
83 | extern int munmapfd(struct proc *, int); | |
84 | extern int vm_mmap(struct vm_map *, vm_offset_t *, vm_size_t, vm_prot_t, | |
85 | vm_prot_t, int, caddr_t, vm_offset_t); | |
86 | extern int vm_region(struct vm_map *, vm_offset_t *, vm_size_t *, vm_prot_t *, | |
87 | vm_prot_t *, vm_inherit_t *, boolean_t *, | |
88 | struct vm_object **, | |
89 | vm_offset_t *); | |
90 | extern int vm_allocate_with_pager(struct vm_map *, vm_offset_t *, vm_size_t, | |
91 | boolean_t, struct pager_struct *, | |
92 | vm_offset_t, boolean_t); | |
93 | ||
94 | ||
95 | extern int vm_allocate(struct vm_map *, vm_offset_t *, vm_size_t, boolean_t); | |
96 | extern int vm_deallocate(struct vm_map *, vm_offset_t, vm_size_t); | |
97 | extern int vm_inherit(struct vm_map *, vm_offset_t, vm_size_t, vm_inherit_t); | |
98 | extern int vm_protect(struct vm_map *, vm_offset_t, vm_size_t, boolean_t, | |
99 | vm_prot_t); | |
100 | ||
101 | #else /* not KERNEL */ | |
bbc3f849 | 102 | #include <sys/cdefs.h> |
fde1aeb2 GW |
103 | #include <vm/vm_param.h> |
104 | #include <vm/vm_inherit.h> | |
105 | #include <vm/vm_prot.h> | |
bbc3f849 | 106 | |
bbc3f849 GW |
107 | __BEGIN_DECLS |
108 | ||
fde1aeb2 GW |
109 | int vm_allocate __P((void *, vm_offset_t *, vm_size_t, boolean_t)); |
110 | int vm_deallocate __P((void *, vm_offset_t, vm_size_t)); | |
111 | int vm_inherit __P((void *, vm_offset_t, vm_size_t, vm_inherit_t)); | |
112 | int vm_protect __P((void *, vm_offset_t, vm_size_t, boolean_t, vm_prot_t)); | |
bbc3f849 GW |
113 | |
114 | __END_DECLS | |
15637ed4 | 115 | |
fde1aeb2 | 116 | #endif /* not KERNEL */ |
bbc3f849 | 117 | #endif /* _VM_USER_ */ |