xref: /netbsd-src/sys/uvm/uvm_aobj.h (revision 777068d6ad4ac0fe1e74c1d3ee021546af15948f)
1*777068d6Schristos /*	$NetBSD: uvm_aobj.h,v 1.23 2013/10/18 17:48:44 christos Exp $	*/
2f2caacc7Smrg 
31f6b921cSmrg /*
47f45dbdfSchs  * Copyright (c) 1998 Chuck Silvers, Charles D. Cranor and
57f45dbdfSchs  *                    Washington University.
67f45dbdfSchs  * All rights reserved.
77f45dbdfSchs  *
87f45dbdfSchs  * Redistribution and use in source and binary forms, with or without
97f45dbdfSchs  * modification, are permitted provided that the following conditions
107f45dbdfSchs  * are met:
117f45dbdfSchs  * 1. Redistributions of source code must retain the above copyright
127f45dbdfSchs  *    notice, this list of conditions and the following disclaimer.
137f45dbdfSchs  * 2. Redistributions in binary form must reproduce the above copyright
147f45dbdfSchs  *    notice, this list of conditions and the following disclaimer in the
157f45dbdfSchs  *    documentation and/or other materials provided with the distribution.
167f45dbdfSchs  *
177f45dbdfSchs  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
187f45dbdfSchs  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
197f45dbdfSchs  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
207f45dbdfSchs  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
217f45dbdfSchs  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
227f45dbdfSchs  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
237f45dbdfSchs  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
247f45dbdfSchs  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
257f45dbdfSchs  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
267f45dbdfSchs  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
277f45dbdfSchs  *
281f6b921cSmrg  * from: Id: uvm_aobj.h,v 1.1.2.4 1998/02/06 05:19:28 chs Exp
291f6b921cSmrg  */
30f2caacc7Smrg /*
317f45dbdfSchs  * uvm_aobj.h: anonymous memory uvm_object pager
32f2caacc7Smrg  *
337f45dbdfSchs  * author: Chuck Silvers <chuq@chuq.com>
347f45dbdfSchs  * started: Jan-1998
357f45dbdfSchs  *
367f45dbdfSchs  * - design mostly from Chuck Cranor
37f2caacc7Smrg  */
38f2caacc7Smrg 
39021fdb64Sperry #ifndef _UVM_UVM_AOBJ_H_
40021fdb64Sperry #define _UVM_UVM_AOBJ_H_
41f2caacc7Smrg 
42f2caacc7Smrg /*
438c260680Srmind  * Flags for uao_create: UAO_FLAG_KERNOBJ and UAO_FLAG_KERNSWAP are
448c260680Srmind  * used only once, to initialise UVM.
45f2caacc7Smrg  */
46f2caacc7Smrg #define	UAO_FLAG_KERNOBJ	0x1	/* create kernel object */
47f2caacc7Smrg #define	UAO_FLAG_KERNSWAP	0x2	/* enable kernel swap */
488c260680Srmind #define	UAO_FLAG_NOSWAP		0x8	/* aobj may not swap */
49f2caacc7Smrg 
50abb48c5bSthorpej #ifdef _KERNEL
516fbf5bf6Syamt #if defined(_KERNEL_OPT)
526fbf5bf6Syamt #include "opt_vmswap.h"
536fbf5bf6Syamt #endif
54abb48c5bSthorpej 
55325f5482Sjunyoung void	uao_init(void);
56325f5482Sjunyoung int	uao_set_swslot(struct uvm_object *, int, int);
578c260680Srmind 
586fbf5bf6Syamt #if	defined(VMSWAP)
59325f5482Sjunyoung int	uao_find_swslot(struct uvm_object *, int);
60325f5482Sjunyoung void	uao_dropswap(struct uvm_object *, int);
6193feeb12Smatt bool	uao_swap_off(int, int);
629df1f09bSyamt void	uao_dropswap_range(struct uvm_object *, voff_t, voff_t);
638c260680Srmind #else
64*777068d6Schristos #define	uao_find_swslot(obj, off)	(__USE(off), 0)
656fbf5bf6Syamt #define	uao_dropswap(obj, off)		/* nothing */
669df1f09bSyamt #define	uao_dropswap_range(obj, lo, hi)	/* nothing */
678c260680Srmind #endif
6839c12db7Schs 
69abb48c5bSthorpej #endif /* _KERNEL */
70abb48c5bSthorpej 
71021fdb64Sperry #endif /* _UVM_UVM_AOBJ_H_ */
72