1*a9643ea8Slogwang /*- 2*a9643ea8Slogwang * Copyright (c) 1991, 1993 3*a9643ea8Slogwang * The Regents of the University of California. All rights reserved. 4*a9643ea8Slogwang * 5*a9643ea8Slogwang * This code is derived from software contributed to Berkeley by 6*a9643ea8Slogwang * The Mach Operating System project at Carnegie-Mellon University. 7*a9643ea8Slogwang * 8*a9643ea8Slogwang * Redistribution and use in source and binary forms, with or without 9*a9643ea8Slogwang * modification, are permitted provided that the following conditions 10*a9643ea8Slogwang * are met: 11*a9643ea8Slogwang * 1. Redistributions of source code must retain the above copyright 12*a9643ea8Slogwang * notice, this list of conditions and the following disclaimer. 13*a9643ea8Slogwang * 2. Redistributions in binary form must reproduce the above copyright 14*a9643ea8Slogwang * notice, this list of conditions and the following disclaimer in the 15*a9643ea8Slogwang * documentation and/or other materials provided with the distribution. 16*a9643ea8Slogwang * 4. Neither the name of the University nor the names of its contributors 17*a9643ea8Slogwang * may be used to endorse or promote products derived from this software 18*a9643ea8Slogwang * without specific prior written permission. 19*a9643ea8Slogwang * 20*a9643ea8Slogwang * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 21*a9643ea8Slogwang * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22*a9643ea8Slogwang * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23*a9643ea8Slogwang * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 24*a9643ea8Slogwang * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25*a9643ea8Slogwang * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26*a9643ea8Slogwang * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27*a9643ea8Slogwang * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28*a9643ea8Slogwang * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29*a9643ea8Slogwang * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30*a9643ea8Slogwang * SUCH DAMAGE. 31*a9643ea8Slogwang * 32*a9643ea8Slogwang * from: @(#)vm_param.h 8.1 (Berkeley) 6/11/93 33*a9643ea8Slogwang * 34*a9643ea8Slogwang * 35*a9643ea8Slogwang * Copyright (c) 1987, 1990 Carnegie-Mellon University. 36*a9643ea8Slogwang * All rights reserved. 37*a9643ea8Slogwang * 38*a9643ea8Slogwang * Authors: Avadis Tevanian, Jr., Michael Wayne Young 39*a9643ea8Slogwang * 40*a9643ea8Slogwang * Permission to use, copy, modify and distribute this software and 41*a9643ea8Slogwang * its documentation is hereby granted, provided that both the copyright 42*a9643ea8Slogwang * notice and this permission notice appear in all copies of the 43*a9643ea8Slogwang * software, derivative works or modified versions, and any portions 44*a9643ea8Slogwang * thereof, and that both notices appear in supporting documentation. 45*a9643ea8Slogwang * 46*a9643ea8Slogwang * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" 47*a9643ea8Slogwang * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND 48*a9643ea8Slogwang * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. 49*a9643ea8Slogwang * 50*a9643ea8Slogwang * Carnegie Mellon requests users of this software to return to 51*a9643ea8Slogwang * 52*a9643ea8Slogwang * Software Distribution Coordinator or [email protected] 53*a9643ea8Slogwang * School of Computer Science 54*a9643ea8Slogwang * Carnegie Mellon University 55*a9643ea8Slogwang * Pittsburgh PA 15213-3890 56*a9643ea8Slogwang * 57*a9643ea8Slogwang * any improvements or extensions that they make and grant Carnegie the 58*a9643ea8Slogwang * rights to redistribute these changes. 59*a9643ea8Slogwang * 60*a9643ea8Slogwang * $FreeBSD$ 61*a9643ea8Slogwang */ 62*a9643ea8Slogwang 63*a9643ea8Slogwang /* 64*a9643ea8Slogwang * Machine independent virtual memory parameters. 65*a9643ea8Slogwang */ 66*a9643ea8Slogwang 67*a9643ea8Slogwang #ifndef _VM_PARAM_ 68*a9643ea8Slogwang #define _VM_PARAM_ 69*a9643ea8Slogwang 70*a9643ea8Slogwang #include <machine/vmparam.h> 71*a9643ea8Slogwang 72*a9643ea8Slogwang /* 73*a9643ea8Slogwang * CTL_VM identifiers 74*a9643ea8Slogwang */ 75*a9643ea8Slogwang #define VM_TOTAL 1 /* struct vmtotal */ 76*a9643ea8Slogwang #define VM_METER VM_TOTAL/* deprecated, use VM_TOTAL */ 77*a9643ea8Slogwang #define VM_LOADAVG 2 /* struct loadavg */ 78*a9643ea8Slogwang #define VM_V_FREE_MIN 3 /* vm_cnt.v_free_min */ 79*a9643ea8Slogwang #define VM_V_FREE_TARGET 4 /* vm_cnt.v_free_target */ 80*a9643ea8Slogwang #define VM_V_FREE_RESERVED 5 /* vm_cnt.v_free_reserved */ 81*a9643ea8Slogwang #define VM_V_INACTIVE_TARGET 6 /* vm_cnt.v_inactive_target */ 82*a9643ea8Slogwang #define VM_OBSOLETE_7 7 /* unused, formerly v_cache_min */ 83*a9643ea8Slogwang #define VM_OBSOLETE_8 8 /* unused, formerly v_cache_max */ 84*a9643ea8Slogwang #define VM_V_PAGEOUT_FREE_MIN 9 /* vm_cnt.v_pageout_free_min */ 85*a9643ea8Slogwang #define VM_OBSOLETE_10 10 /* pageout algorithm */ 86*a9643ea8Slogwang #define VM_SWAPPING_ENABLED 11 /* swapping enabled */ 87*a9643ea8Slogwang #define VM_MAXID 12 /* number of valid vm ids */ 88*a9643ea8Slogwang 89*a9643ea8Slogwang /* 90*a9643ea8Slogwang * Structure for swap device statistics 91*a9643ea8Slogwang */ 92*a9643ea8Slogwang #define XSWDEV_VERSION 1 93*a9643ea8Slogwang struct xswdev { 94*a9643ea8Slogwang u_int xsw_version; 95*a9643ea8Slogwang dev_t xsw_dev; 96*a9643ea8Slogwang int xsw_flags; 97*a9643ea8Slogwang int xsw_nblks; 98*a9643ea8Slogwang int xsw_used; 99*a9643ea8Slogwang }; 100*a9643ea8Slogwang 101*a9643ea8Slogwang /* 102*a9643ea8Slogwang * Return values from the VM routines. 103*a9643ea8Slogwang */ 104*a9643ea8Slogwang #define KERN_SUCCESS 0 105*a9643ea8Slogwang #define KERN_INVALID_ADDRESS 1 106*a9643ea8Slogwang #define KERN_PROTECTION_FAILURE 2 107*a9643ea8Slogwang #define KERN_NO_SPACE 3 108*a9643ea8Slogwang #define KERN_INVALID_ARGUMENT 4 109*a9643ea8Slogwang #define KERN_FAILURE 5 110*a9643ea8Slogwang #define KERN_RESOURCE_SHORTAGE 6 111*a9643ea8Slogwang #define KERN_NOT_RECEIVER 7 112*a9643ea8Slogwang #define KERN_NO_ACCESS 8 113*a9643ea8Slogwang 114*a9643ea8Slogwang #ifndef PA_LOCK_COUNT 115*a9643ea8Slogwang #ifdef SMP 116*a9643ea8Slogwang #define PA_LOCK_COUNT 32 117*a9643ea8Slogwang #else 118*a9643ea8Slogwang #define PA_LOCK_COUNT 1 119*a9643ea8Slogwang #endif /* !SMP */ 120*a9643ea8Slogwang #endif /* !PA_LOCK_COUNT */ 121*a9643ea8Slogwang 122*a9643ea8Slogwang #ifndef ASSEMBLER 123*a9643ea8Slogwang #ifdef _KERNEL 124*a9643ea8Slogwang #define num_pages(x) \ 125*a9643ea8Slogwang ((vm_offset_t)((((vm_offset_t)(x)) + PAGE_MASK) >> PAGE_SHIFT)) 126*a9643ea8Slogwang extern unsigned long maxtsiz; 127*a9643ea8Slogwang extern unsigned long dfldsiz; 128*a9643ea8Slogwang extern unsigned long maxdsiz; 129*a9643ea8Slogwang extern unsigned long dflssiz; 130*a9643ea8Slogwang extern unsigned long maxssiz; 131*a9643ea8Slogwang extern unsigned long sgrowsiz; 132*a9643ea8Slogwang #endif /* _KERNEL */ 133*a9643ea8Slogwang #endif /* ASSEMBLER */ 134*a9643ea8Slogwang #endif /* _VM_PARAM_ */ 135