vm.h revision 55206
11541Srgrimes/* 21541Srgrimes * Copyright (c) 1991, 1993 31541Srgrimes * The Regents of the University of California. All rights reserved. 41541Srgrimes * 51541Srgrimes * Redistribution and use in source and binary forms, with or without 61541Srgrimes * modification, are permitted provided that the following conditions 71541Srgrimes * are met: 81541Srgrimes * 1. Redistributions of source code must retain the above copyright 91541Srgrimes * notice, this list of conditions and the following disclaimer. 101541Srgrimes * 2. Redistributions in binary form must reproduce the above copyright 111541Srgrimes * notice, this list of conditions and the following disclaimer in the 121541Srgrimes * documentation and/or other materials provided with the distribution. 131541Srgrimes * 3. All advertising materials mentioning features or use of this software 141541Srgrimes * must display the following acknowledgement: 151541Srgrimes * This product includes software developed by the University of 161541Srgrimes * California, Berkeley and its contributors. 171541Srgrimes * 4. Neither the name of the University nor the names of its contributors 181541Srgrimes * may be used to endorse or promote products derived from this software 191541Srgrimes * without specific prior written permission. 201541Srgrimes * 211541Srgrimes * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 221541Srgrimes * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 231541Srgrimes * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 241541Srgrimes * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 251541Srgrimes * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 261541Srgrimes * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 271541Srgrimes * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 281541Srgrimes * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 291541Srgrimes * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 301541Srgrimes * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 311541Srgrimes * SUCH DAMAGE. 321541Srgrimes * 331541Srgrimes * @(#)vm.h 8.2 (Berkeley) 12/13/93 3452635Sphk * @(#)vm_prot.h 8.1 (Berkeley) 6/11/93 3552635Sphk * @(#)vm_inherit.h 8.1 (Berkeley) 6/11/93 3652635Sphk * 3752635Sphk * Copyright (c) 1987, 1990 Carnegie-Mellon University. 3852635Sphk * All rights reserved. 3952635Sphk * 4052635Sphk * Authors: Avadis Tevanian, Jr., Michael Wayne Young 4152635Sphk * 4252635Sphk * Permission to use, copy, modify and distribute this software and 4352635Sphk * its documentation is hereby granted, provided that both the copyright 4452635Sphk * notice and this permission notice appear in all copies of the 4552635Sphk * software, derivative works or modified versions, and any portions 4652635Sphk * thereof, and that both notices appear in supporting documentation. 4752635Sphk * 4852635Sphk * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" 4952635Sphk * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND 5052635Sphk * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. 5152635Sphk * 5252635Sphk * Carnegie Mellon requests users of this software to return to 5352635Sphk * 5452635Sphk * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU 5552635Sphk * School of Computer Science 5652635Sphk * Carnegie Mellon University 5752635Sphk * Pittsburgh PA 15213-3890 5852635Sphk * 5952635Sphk * any improvements or extensions that they make and grant Carnegie the 6052635Sphk * rights to redistribute these changes. 6152635Sphk * 6250477Speter * $FreeBSD: head/sys/vm/vm.h 55206 1999-12-29 05:07:58Z peter $ 631541Srgrimes */ 641541Srgrimes 651541Srgrimes#ifndef VM_H 661541Srgrimes#define VM_H 671541Srgrimes 6852635Sphktypedef char vm_inherit_t; /* inheritance codes */ 6952635Sphk 7052635Sphk#define VM_INHERIT_SHARE ((vm_inherit_t) 0) 7152635Sphk#define VM_INHERIT_COPY ((vm_inherit_t) 1) 7252635Sphk#define VM_INHERIT_NONE ((vm_inherit_t) 2) 7352635Sphk#define VM_INHERIT_DEFAULT VM_INHERIT_COPY 7452635Sphk 7512662Sdgtypedef u_char vm_prot_t; /* protection codes */ 761541Srgrimes 7752635Sphk#define VM_PROT_NONE ((vm_prot_t) 0x00) 7852635Sphk#define VM_PROT_READ ((vm_prot_t) 0x01) 7952635Sphk#define VM_PROT_WRITE ((vm_prot_t) 0x02) 8052635Sphk#define VM_PROT_EXECUTE ((vm_prot_t) 0x04) 8152635Sphk#define VM_PROT_OVERRIDE_WRITE ((vm_prot_t) 0x08) /* copy-on-write */ 8252635Sphk 8352635Sphk#define VM_PROT_ALL (VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE) 8452635Sphk#define VM_PROT_DEFAULT VM_PROT_ALL 8552635Sphk 861541Srgrimesunion vm_map_object; 871541Srgrimestypedef union vm_map_object vm_map_object_t; 881541Srgrimes 891541Srgrimesstruct vm_map_entry; 901541Srgrimestypedef struct vm_map_entry *vm_map_entry_t; 911541Srgrimes 921541Srgrimesstruct vm_map; 931541Srgrimestypedef struct vm_map *vm_map_t; 941541Srgrimes 951541Srgrimesstruct vm_object; 961541Srgrimestypedef struct vm_object *vm_object_t; 971541Srgrimes 9855206Speter#ifndef _KERNEL 9912642Sbde/* 10012710Sbde * This is defined in <sys/types.h> for the kernel so that non-vm kernel 10112710Sbde * sources (mainly Mach-derived ones such as ddb) don't have to include 10212710Sbde * vm stuff. Defining it there for applications might break things. 10312710Sbde * Define it here for "applications" that include vm headers (e.g., 10412710Sbde * genassym). 10512710Sbde */ 10612710Sbdetypedef int boolean_t; 10712710Sbde 10812710Sbde/* 10912642Sbde * This is defined in <sys/types.h> for the kernel so that vnode_if.h 11012642Sbde * doesn't have to include <vm/vm.h>. 11112642Sbde */ 1121541Srgrimesstruct vm_page; 1135455Sdgtypedef struct vm_page *vm_page_t; 11412642Sbde#endif 1151541Srgrimes 1165455Sdg#endif /* VM_H */ 117