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