1139825Simp/*-
21541Srgrimes * Copyright (c) 1991, 1993
31541Srgrimes *	The Regents of the University of California.  All rights reserved.
41541Srgrimes *
51541Srgrimes * This code is derived from software contributed to Berkeley by
61541Srgrimes * The Mach Operating System project at Carnegie-Mellon University.
71541Srgrimes *
81541Srgrimes * Redistribution and use in source and binary forms, with or without
91541Srgrimes * modification, are permitted provided that the following conditions
101541Srgrimes * are met:
111541Srgrimes * 1. Redistributions of source code must retain the above copyright
121541Srgrimes *    notice, this list of conditions and the following disclaimer.
131541Srgrimes * 2. Redistributions in binary form must reproduce the above copyright
141541Srgrimes *    notice, this list of conditions and the following disclaimer in the
151541Srgrimes *    documentation and/or other materials provided with the distribution.
161541Srgrimes * 4. Neither the name of the University nor the names of its contributors
171541Srgrimes *    may be used to endorse or promote products derived from this software
181541Srgrimes *    without specific prior written permission.
191541Srgrimes *
201541Srgrimes * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
211541Srgrimes * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
221541Srgrimes * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
231541Srgrimes * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
241541Srgrimes * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
251541Srgrimes * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
261541Srgrimes * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
271541Srgrimes * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
281541Srgrimes * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
291541Srgrimes * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
301541Srgrimes * SUCH DAMAGE.
311541Srgrimes *
321817Sdg *	from: @(#)vm_param.h	8.1 (Berkeley) 6/11/93
331541Srgrimes *
341541Srgrimes *
351541Srgrimes * Copyright (c) 1987, 1990 Carnegie-Mellon University.
361541Srgrimes * All rights reserved.
371541Srgrimes *
381541Srgrimes * Authors: Avadis Tevanian, Jr., Michael Wayne Young
395455Sdg *
401541Srgrimes * Permission to use, copy, modify and distribute this software and
411541Srgrimes * its documentation is hereby granted, provided that both the copyright
421541Srgrimes * notice and this permission notice appear in all copies of the
431541Srgrimes * software, derivative works or modified versions, and any portions
441541Srgrimes * thereof, and that both notices appear in supporting documentation.
455455Sdg *
465455Sdg * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
475455Sdg * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
481541Srgrimes * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
495455Sdg *
501541Srgrimes * Carnegie Mellon requests users of this software to return to
511541Srgrimes *
521541Srgrimes *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
531541Srgrimes *  School of Computer Science
541541Srgrimes *  Carnegie Mellon University
551541Srgrimes *  Pittsburgh PA 15213-3890
561541Srgrimes *
571541Srgrimes * any improvements or extensions that they make and grant Carnegie the
581541Srgrimes * rights to redistribute these changes.
591817Sdg *
6050477Speter * $FreeBSD$
611541Srgrimes */
621541Srgrimes
631541Srgrimes/*
641541Srgrimes *	Machine independent virtual memory parameters.
651541Srgrimes */
661541Srgrimes
671541Srgrimes#ifndef	_VM_PARAM_
681541Srgrimes#define	_VM_PARAM_
691541Srgrimes
701541Srgrimes#include <machine/vmparam.h>
711541Srgrimes
721541Srgrimes/*
731541Srgrimes * CTL_VM identifiers
741541Srgrimes */
75109097Sdillon#define	VM_TOTAL		1	/* struct vmtotal */
76109496Sobrien#define	VM_METER                VM_TOTAL/* deprecated, use VM_TOTAL */
775455Sdg#define	VM_LOADAVG	 	2	/* struct loadavg */
785455Sdg#define VM_V_FREE_MIN		3	/* cnt.v_free_min */
795455Sdg#define VM_V_FREE_TARGET	4	/* cnt.v_free_target */
805455Sdg#define VM_V_FREE_RESERVED	5	/* cnt.v_free_reserved */
815455Sdg#define VM_V_INACTIVE_TARGET	6	/* cnt.v_inactive_target */
82168851Salc#define	VM_V_CACHE_MIN		7	/* cnt.v_cache_min */
83168851Salc#define	VM_V_CACHE_MAX		8	/* cnt.v_cache_max */
845455Sdg#define VM_V_PAGEOUT_FREE_MIN	9	/* cnt.v_pageout_free_min */
85253775Szont#define	VM_OBSOLETE_10		10	/* pageout algorithm */
86253775Szont#define VM_SWAPPING_ENABLED	11	/* swapping enabled */
87253775Szont#define	VM_MAXID		12	/* number of valid vm ids */
881541Srgrimes
895455Sdg/*
9077604Stmm * Structure for swap device statistics
9177604Stmm */
9277604Stmm#define XSWDEV_VERSION	1
9377604Stmmstruct xswdev {
9477604Stmm	u_int	xsw_version;
95130640Sphk	dev_t	xsw_dev;
9677604Stmm	int	xsw_flags;
9777604Stmm	int	xsw_nblks;
9877604Stmm	int     xsw_used;
9977604Stmm};
10077604Stmm
10177604Stmm/*
1021541Srgrimes *	Return values from the VM routines.
1031541Srgrimes */
1041541Srgrimes#define	KERN_SUCCESS		0
1051541Srgrimes#define	KERN_INVALID_ADDRESS	1
1061541Srgrimes#define	KERN_PROTECTION_FAILURE	2
1071541Srgrimes#define	KERN_NO_SPACE		3
1081541Srgrimes#define	KERN_INVALID_ARGUMENT	4
1091541Srgrimes#define	KERN_FAILURE		5
1101541Srgrimes#define	KERN_RESOURCE_SHORTAGE	6
1111541Srgrimes#define	KERN_NOT_RECEIVER	7
1121541Srgrimes#define	KERN_NO_ACCESS		8
1131541Srgrimes
114207410Skmacy#ifndef PA_LOCK_COUNT
115207410Skmacy#ifdef SMP
116207410Skmacy#define	PA_LOCK_COUNT	32
117207410Skmacy#else
118207410Skmacy#define PA_LOCK_COUNT	1
119207410Skmacy#endif	/* !SMP */
120207410Skmacy#endif	/* !PA_LOCK_COUNT */
121207410Skmacy
1221541Srgrimes#ifndef ASSEMBLER
12355206Speter#ifdef _KERNEL
1241541Srgrimes#define num_pages(x) \
1251541Srgrimes	((vm_offset_t)((((vm_offset_t)(x)) + PAGE_MASK) >> PAGE_SHIFT))
126137393Sdesextern	unsigned long maxtsiz;
127137393Sdesextern	unsigned long dfldsiz;
128137393Sdesextern	unsigned long maxdsiz;
129137393Sdesextern	unsigned long dflssiz;
130137393Sdesextern	unsigned long maxssiz;
131137393Sdesextern	unsigned long sgrowsiz;
13255206Speter#endif				/* _KERNEL */
1335455Sdg#endif				/* ASSEMBLER */
1345455Sdg#endif				/* _VM_PARAM_ */
135