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 #pragma ident "%Z%%M% %I% %E% SMI" 37 38 #ifdef __cplusplus 39 extern "C" { 40 #endif 41 42 /* 43 * These enumerations are needed in both <vm/seg.h> and 44 * <sys/vnode.h> in order to declare function prototypes. 45 */ 46 47 /* 48 * Fault information passed to the seg fault handling routine. 49 * The F_SOFTLOCK and F_SOFTUNLOCK are used by software 50 * to lock and unlock pages for physical I/O. 51 */ 52 enum fault_type { 53 F_INVAL, /* invalid page */ 54 F_PROT, /* protection fault */ 55 F_SOFTLOCK, /* software requested locking */ 56 F_SOFTUNLOCK /* software requested unlocking */ 57 }; 58 59 /* 60 * Lock information passed to the seg pagelock handling routine. 61 */ 62 enum lock_type { 63 L_PAGELOCK, /* lock pages */ 64 L_PAGEUNLOCK /* unlock pages */ 65 }; 66 67 /* 68 * seg_rw gives the access type for a fault operation 69 */ 70 enum seg_rw { 71 S_OTHER, /* unknown or not touched */ 72 S_READ, /* read access attempted */ 73 S_WRITE, /* write access attempted */ 74 S_EXEC, /* execution access attempted */ 75 S_CREATE, /* create if page doesn't exist */ 76 S_READ_NOCOW /* read access, don't do a copy on write */ 77 }; 78 79 /* 80 * Capabilities for capability segment op. 81 */ 82 typedef enum { 83 S_CAPABILITY_NOMINFLT /* supports non-faulting page renaming */ 84 } segcapability_t; 85 86 #ifdef __cplusplus 87 } 88 #endif 89 90 #endif /* _VM_SEG_ENUM_H */ 91