xref: /illumos-gate/usr/src/uts/common/vm/seg_enum.h (revision b4203d757c7c247e39c94c09a94021a3a8121062)
17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * CDDL HEADER START
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*a98e9dbfSaguzovsk  * Common Development and Distribution License (the "License").
6*a98e9dbfSaguzovsk  * You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate  *
87c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate  * and limitations under the License.
127c478bd9Sstevel@tonic-gate  *
137c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate  *
197c478bd9Sstevel@tonic-gate  * CDDL HEADER END
207c478bd9Sstevel@tonic-gate  */
217c478bd9Sstevel@tonic-gate /*
22*a98e9dbfSaguzovsk  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
237c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
247c478bd9Sstevel@tonic-gate  */
257c478bd9Sstevel@tonic-gate /*	Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T	*/
267c478bd9Sstevel@tonic-gate /*	  All Rights Reserved	*/
277c478bd9Sstevel@tonic-gate 
287c478bd9Sstevel@tonic-gate /*
297c478bd9Sstevel@tonic-gate  * Portions of this source code were derived from Berkeley 4.3 BSD
307c478bd9Sstevel@tonic-gate  * under license from the Regents of the University of California.
317c478bd9Sstevel@tonic-gate  */
327c478bd9Sstevel@tonic-gate 
337c478bd9Sstevel@tonic-gate #ifndef	_VM_SEG_ENUM_H
347c478bd9Sstevel@tonic-gate #define	_VM_SEG_ENUM_H
357c478bd9Sstevel@tonic-gate 
367c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
377c478bd9Sstevel@tonic-gate extern "C" {
387c478bd9Sstevel@tonic-gate #endif
397c478bd9Sstevel@tonic-gate 
407c478bd9Sstevel@tonic-gate /*
417c478bd9Sstevel@tonic-gate  * These enumerations are needed in both <vm/seg.h> and
427c478bd9Sstevel@tonic-gate  * <sys/vnode.h> in order to declare function prototypes.
437c478bd9Sstevel@tonic-gate  */
447c478bd9Sstevel@tonic-gate 
457c478bd9Sstevel@tonic-gate /*
467c478bd9Sstevel@tonic-gate  * Fault information passed to the seg fault handling routine.
477c478bd9Sstevel@tonic-gate  * The F_SOFTLOCK and F_SOFTUNLOCK are used by software
487c478bd9Sstevel@tonic-gate  * to lock and unlock pages for physical I/O.
497c478bd9Sstevel@tonic-gate  */
507c478bd9Sstevel@tonic-gate enum fault_type {
517c478bd9Sstevel@tonic-gate 	F_INVAL,		/* invalid page */
527c478bd9Sstevel@tonic-gate 	F_PROT,			/* protection fault */
537c478bd9Sstevel@tonic-gate 	F_SOFTLOCK,		/* software requested locking */
547c478bd9Sstevel@tonic-gate 	F_SOFTUNLOCK		/* software requested unlocking */
557c478bd9Sstevel@tonic-gate };
567c478bd9Sstevel@tonic-gate 
577c478bd9Sstevel@tonic-gate /*
587c478bd9Sstevel@tonic-gate  * Lock information passed to the seg pagelock handling routine.
597c478bd9Sstevel@tonic-gate  */
607c478bd9Sstevel@tonic-gate enum lock_type {
617c478bd9Sstevel@tonic-gate 	L_PAGELOCK,		/* lock pages */
62*a98e9dbfSaguzovsk 	L_PAGEUNLOCK		/* unlock pages */
637c478bd9Sstevel@tonic-gate };
647c478bd9Sstevel@tonic-gate 
657c478bd9Sstevel@tonic-gate /*
667c478bd9Sstevel@tonic-gate  * seg_rw gives the access type for a fault operation
677c478bd9Sstevel@tonic-gate  */
687c478bd9Sstevel@tonic-gate enum seg_rw {
697c478bd9Sstevel@tonic-gate 	S_OTHER,		/* unknown or not touched */
707c478bd9Sstevel@tonic-gate 	S_READ,			/* read access attempted */
717c478bd9Sstevel@tonic-gate 	S_WRITE,		/* write access attempted */
727c478bd9Sstevel@tonic-gate 	S_EXEC,			/* execution access attempted */
737c478bd9Sstevel@tonic-gate 	S_CREATE,		/* create if page doesn't exist */
747c478bd9Sstevel@tonic-gate 	S_READ_NOCOW		/* read access, don't do a copy on write */
757c478bd9Sstevel@tonic-gate };
767c478bd9Sstevel@tonic-gate 
771bd5c35fSelowe /*
781bd5c35fSelowe  * Capabilities for capability segment op.
791bd5c35fSelowe  */
801bd5c35fSelowe typedef enum {
811bd5c35fSelowe 	S_CAPABILITY_NOMINFLT	/* supports non-faulting page renaming */
821bd5c35fSelowe } segcapability_t;
831bd5c35fSelowe 
847c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
857c478bd9Sstevel@tonic-gate }
867c478bd9Sstevel@tonic-gate #endif
877c478bd9Sstevel@tonic-gate 
887c478bd9Sstevel@tonic-gate #endif	/* _VM_SEG_ENUM_H */
89