xref: /netbsd-src/sys/uvm/uvm_prot.h (revision 95e1ffb15694e54f29f8baaa4232152b703c2a5a)
1*95e1ffb1Schristos /*	$NetBSD: uvm_prot.h,v 1.4 2005/12/11 12:25:29 christos Exp $	*/
2f5f84f80Smrg 
3f5f84f80Smrg /*
4f5f84f80Smrg  * Copyright (c) 1991, 1993
5f5f84f80Smrg  *	The Regents of the University of California.  All rights reserved.
6f5f84f80Smrg  *
7f5f84f80Smrg  * This code is derived from software contributed to Berkeley by
8f5f84f80Smrg  * The Mach Operating System project at Carnegie-Mellon University.
9f5f84f80Smrg  *
10f5f84f80Smrg  * Redistribution and use in source and binary forms, with or without
11f5f84f80Smrg  * modification, are permitted provided that the following conditions
12f5f84f80Smrg  * are met:
13f5f84f80Smrg  * 1. Redistributions of source code must retain the above copyright
14f5f84f80Smrg  *    notice, this list of conditions and the following disclaimer.
15f5f84f80Smrg  * 2. Redistributions in binary form must reproduce the above copyright
16f5f84f80Smrg  *    notice, this list of conditions and the following disclaimer in the
17f5f84f80Smrg  *    documentation and/or other materials provided with the distribution.
18aad01611Sagc  * 3. Neither the name of the University nor the names of its contributors
19f5f84f80Smrg  *    may be used to endorse or promote products derived from this software
20f5f84f80Smrg  *    without specific prior written permission.
21f5f84f80Smrg  *
22f5f84f80Smrg  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
23f5f84f80Smrg  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24f5f84f80Smrg  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25f5f84f80Smrg  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26f5f84f80Smrg  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27f5f84f80Smrg  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28f5f84f80Smrg  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29f5f84f80Smrg  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30f5f84f80Smrg  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31f5f84f80Smrg  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32f5f84f80Smrg  * SUCH DAMAGE.
33f5f84f80Smrg  *
34f5f84f80Smrg  *	@(#)vm_prot.h	8.1 (Berkeley) 6/11/93
35f5f84f80Smrg  *
36f5f84f80Smrg  *
37f5f84f80Smrg  * Copyright (c) 1987, 1990 Carnegie-Mellon University.
38f5f84f80Smrg  * All rights reserved.
39f5f84f80Smrg  *
40f5f84f80Smrg  * Authors: Avadis Tevanian, Jr., Michael Wayne Young
41f5f84f80Smrg  *
42f5f84f80Smrg  * Permission to use, copy, modify and distribute this software and
43f5f84f80Smrg  * its documentation is hereby granted, provided that both the copyright
44f5f84f80Smrg  * notice and this permission notice appear in all copies of the
45f5f84f80Smrg  * software, derivative works or modified versions, and any portions
46f5f84f80Smrg  * thereof, and that both notices appear in supporting documentation.
47f5f84f80Smrg  *
48f5f84f80Smrg  * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
49f5f84f80Smrg  * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
50f5f84f80Smrg  * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
51f5f84f80Smrg  *
52f5f84f80Smrg  * Carnegie Mellon requests users of this software to return to
53f5f84f80Smrg  *
54f5f84f80Smrg  *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
55f5f84f80Smrg  *  School of Computer Science
56f5f84f80Smrg  *  Carnegie Mellon University
57f5f84f80Smrg  *  Pittsburgh PA 15213-3890
58f5f84f80Smrg  *
59f5f84f80Smrg  * any improvements or extensions that they make and grant Carnegie the
60f5f84f80Smrg  * rights to redistribute these changes.
61f5f84f80Smrg  */
62f5f84f80Smrg 
63f5f84f80Smrg /*
64f5f84f80Smrg  *	Virtual memory protection definitions.
65f5f84f80Smrg  */
66f5f84f80Smrg 
67f5f84f80Smrg #ifndef	_UVM_PROT_
68f5f84f80Smrg #define	_UVM_PROT_
69f5f84f80Smrg 
70f5f84f80Smrg /*
71f5f84f80Smrg  *	Types defined:
72f5f84f80Smrg  *
73f5f84f80Smrg  *	vm_prot_t		VM protection values.
74f5f84f80Smrg  */
75f5f84f80Smrg 
76f5f84f80Smrg typedef int		vm_prot_t;
77f5f84f80Smrg 
78f5f84f80Smrg /*
79f5f84f80Smrg  *	Protection values, defined as bits within the vm_prot_t type
80f5f84f80Smrg  */
81f5f84f80Smrg 
82f5f84f80Smrg #define	VM_PROT_NONE	((vm_prot_t) 0x00)
83f5f84f80Smrg 
84f5f84f80Smrg #define VM_PROT_READ	((vm_prot_t) 0x01)	/* read permission */
85f5f84f80Smrg #define VM_PROT_WRITE	((vm_prot_t) 0x02)	/* write permission */
86f5f84f80Smrg #define VM_PROT_EXECUTE	((vm_prot_t) 0x04)	/* execute permission */
87f5f84f80Smrg 
88f5f84f80Smrg /*
89f5f84f80Smrg  *	The default protection for newly-created virtual memory
90f5f84f80Smrg  */
91f5f84f80Smrg 
92f5f84f80Smrg #define VM_PROT_DEFAULT	(VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE)
93f5f84f80Smrg 
94f5f84f80Smrg /*
95f5f84f80Smrg  *	The maximum privileges possible, for parameter checking.
96f5f84f80Smrg  */
97f5f84f80Smrg 
98f5f84f80Smrg #define VM_PROT_ALL	(VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE)
99f5f84f80Smrg 
100f5f84f80Smrg #endif /* _UVM_PROT_ */
101