xref: /onnv-gate/usr/src/uts/common/vm/seg_enum.h (revision 6695:12d7dd4459fd)
10Sstevel@tonic-gate /*
20Sstevel@tonic-gate  * CDDL HEADER START
30Sstevel@tonic-gate  *
40Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*6695Saguzovsk  * Common Development and Distribution License (the "License").
6*6695Saguzovsk  * You may not use this file except in compliance with the License.
70Sstevel@tonic-gate  *
80Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
90Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
100Sstevel@tonic-gate  * See the License for the specific language governing permissions
110Sstevel@tonic-gate  * and limitations under the License.
120Sstevel@tonic-gate  *
130Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
140Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
150Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
160Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
170Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
180Sstevel@tonic-gate  *
190Sstevel@tonic-gate  * CDDL HEADER END
200Sstevel@tonic-gate  */
210Sstevel@tonic-gate /*
22*6695Saguzovsk  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
230Sstevel@tonic-gate  * Use is subject to license terms.
240Sstevel@tonic-gate  */
250Sstevel@tonic-gate /*	Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T	*/
260Sstevel@tonic-gate /*	  All Rights Reserved  	*/
270Sstevel@tonic-gate 
280Sstevel@tonic-gate /*
290Sstevel@tonic-gate  * Portions of this source code were derived from Berkeley 4.3 BSD
300Sstevel@tonic-gate  * under license from the Regents of the University of California.
310Sstevel@tonic-gate  */
320Sstevel@tonic-gate 
330Sstevel@tonic-gate #ifndef	_VM_SEG_ENUM_H
340Sstevel@tonic-gate #define	_VM_SEG_ENUM_H
350Sstevel@tonic-gate 
360Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
370Sstevel@tonic-gate 
380Sstevel@tonic-gate #ifdef	__cplusplus
390Sstevel@tonic-gate extern "C" {
400Sstevel@tonic-gate #endif
410Sstevel@tonic-gate 
420Sstevel@tonic-gate /*
430Sstevel@tonic-gate  * These enumerations are needed in both <vm/seg.h> and
440Sstevel@tonic-gate  * <sys/vnode.h> in order to declare function prototypes.
450Sstevel@tonic-gate  */
460Sstevel@tonic-gate 
470Sstevel@tonic-gate /*
480Sstevel@tonic-gate  * Fault information passed to the seg fault handling routine.
490Sstevel@tonic-gate  * The F_SOFTLOCK and F_SOFTUNLOCK are used by software
500Sstevel@tonic-gate  * to lock and unlock pages for physical I/O.
510Sstevel@tonic-gate  */
520Sstevel@tonic-gate enum fault_type {
530Sstevel@tonic-gate 	F_INVAL,		/* invalid page */
540Sstevel@tonic-gate 	F_PROT,			/* protection fault */
550Sstevel@tonic-gate 	F_SOFTLOCK,		/* software requested locking */
560Sstevel@tonic-gate 	F_SOFTUNLOCK		/* software requested unlocking */
570Sstevel@tonic-gate };
580Sstevel@tonic-gate 
590Sstevel@tonic-gate /*
600Sstevel@tonic-gate  * Lock information passed to the seg pagelock handling routine.
610Sstevel@tonic-gate  */
620Sstevel@tonic-gate enum lock_type {
630Sstevel@tonic-gate 	L_PAGELOCK,		/* lock pages */
64*6695Saguzovsk 	L_PAGEUNLOCK		/* unlock pages */
650Sstevel@tonic-gate };
660Sstevel@tonic-gate 
670Sstevel@tonic-gate /*
680Sstevel@tonic-gate  * seg_rw gives the access type for a fault operation
690Sstevel@tonic-gate  */
700Sstevel@tonic-gate enum seg_rw {
710Sstevel@tonic-gate 	S_OTHER,		/* unknown or not touched */
720Sstevel@tonic-gate 	S_READ,			/* read access attempted */
730Sstevel@tonic-gate 	S_WRITE,		/* write access attempted */
740Sstevel@tonic-gate 	S_EXEC,			/* execution access attempted */
750Sstevel@tonic-gate 	S_CREATE,		/* create if page doesn't exist */
760Sstevel@tonic-gate 	S_READ_NOCOW		/* read access, don't do a copy on write */
770Sstevel@tonic-gate };
780Sstevel@tonic-gate 
79670Selowe /*
80670Selowe  * Capabilities for capability segment op.
81670Selowe  */
82670Selowe typedef enum {
83670Selowe 	S_CAPABILITY_NOMINFLT	/* supports non-faulting page renaming */
84670Selowe } segcapability_t;
85670Selowe 
860Sstevel@tonic-gate #ifdef	__cplusplus
870Sstevel@tonic-gate }
880Sstevel@tonic-gate #endif
890Sstevel@tonic-gate 
900Sstevel@tonic-gate #endif	/* _VM_SEG_ENUM_H */
91