xref: /illumos-gate/usr/src/uts/common/vm/seg_enum.h (revision 069e6b7e31ba5dcbc5441b98af272714d9a5455c)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 /*
22  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
23  * Use is subject to license terms.
24  */
25 /*	Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T	*/
26 /*	  All Rights Reserved	*/
27 
28 /*
29  * Portions of this source code were derived from Berkeley 4.3 BSD
30  * under license from the Regents of the University of California.
31  */
32 
33 #ifndef	_VM_SEG_ENUM_H
34 #define	_VM_SEG_ENUM_H
35 
36 #ifdef	__cplusplus
37 extern "C" {
38 #endif
39 
40 /*
41  * These enumerations are needed in both <vm/seg.h> and
42  * <sys/vnode.h> in order to declare function prototypes.
43  */
44 
45 /*
46  * Fault information passed to the seg fault handling routine.
47  * The F_SOFTLOCK and F_SOFTUNLOCK are used by software
48  * to lock and unlock pages for physical I/O.
49  */
50 enum fault_type {
51 	F_INVAL,		/* invalid page */
52 	F_PROT,			/* protection fault */
53 	F_SOFTLOCK,		/* software requested locking */
54 	F_SOFTUNLOCK		/* software requested unlocking */
55 };
56 
57 /*
58  * Lock information passed to the seg pagelock handling routine.
59  */
60 enum lock_type {
61 	L_PAGELOCK,		/* lock pages */
62 	L_PAGEUNLOCK		/* unlock pages */
63 };
64 
65 /*
66  * seg_rw gives the access type for a fault operation
67  */
68 enum seg_rw {
69 	S_OTHER,		/* unknown or not touched */
70 	S_READ,			/* read access attempted */
71 	S_WRITE,		/* write access attempted */
72 	S_EXEC,			/* execution access attempted */
73 	S_CREATE,		/* create if page doesn't exist */
74 	S_READ_NOCOW		/* read access, don't do a copy on write */
75 };
76 
77 /*
78  * Capabilities for capability segment op.
79  */
80 typedef enum {
81 	S_CAPABILITY_NOMINFLT	/* supports non-faulting page renaming */
82 } segcapability_t;
83 
84 #ifdef	__cplusplus
85 }
86 #endif
87 
88 #endif	/* _VM_SEG_ENUM_H */
89