vm_extern.h revision 132638
158314Sache/*-
221308Sache * Copyright (c) 1992, 1993
321308Sache *	The Regents of the University of California.  All rights reserved.
4165675Sache *
521308Sache * Redistribution and use in source and binary forms, with or without
621308Sache * modification, are permitted provided that the following conditions
721308Sache * are met:
821308Sache * 1. Redistributions of source code must retain the above copyright
921308Sache *    notice, this list of conditions and the following disclaimer.
1021308Sache * 2. Redistributions in binary form must reproduce the above copyright
1158314Sache *    notice, this list of conditions and the following disclaimer in the
1221308Sache *    documentation and/or other materials provided with the distribution.
1321308Sache * 4. Neither the name of the University nor the names of its contributors
1421308Sache *    may be used to endorse or promote products derived from this software
1521308Sache *    without specific prior written permission.
1621308Sache *
1721308Sache * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
1821308Sache * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1921308Sache * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2021308Sache * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
2121308Sache * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2258314Sache * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2321308Sache * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2421308Sache * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2521308Sache * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2621308Sache * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2721308Sache * SUCH DAMAGE.
2821308Sache *
2921308Sache *	@(#)vm_extern.h	8.2 (Berkeley) 1/12/94
3021308Sache * $FreeBSD: head/sys/vm/vm_extern.h 132638 2004-07-25 20:08:59Z alc $
3121308Sache */
3221308Sache
3321308Sache#ifndef _VM_EXTERN_H_
3421308Sache#define	_VM_EXTERN_H_
3526497Sache
3626497Sachestruct buf;
3721308Sachestruct proc;
3821308Sachestruct vmspace;
3921308Sachestruct vmtotal;
4021308Sachestruct mount;
4121308Sachestruct vnode;
4221308Sache
4326497Sache#ifdef _KERNEL
4421308Sache
4521308Sache#ifdef TYPEDEF_FOR_UAP
4621308Sacheint getpagesize(struct thread *, void *, int *);
47119614Sacheint madvise(struct thread *, void *, int *);
4821308Sacheint mincore(struct thread *, void *, int *);
4921308Sacheint mprotect(struct thread *, void *, int *);
5021308Sacheint msync(struct thread *, void *, int *);
5121308Sacheint munmap(struct thread *, void *, int *);
5221308Sacheint obreak(struct thread *, void *, int *);
5321308Sacheint sbrk(struct thread *, void *, int *);
5421308Sacheint sstk(struct thread *, void *, int *);
5521308Sacheint swapon(struct thread *, void *, int *);
5658314Sache#endif			/* TYPEDEF_FOR_UAP */
5758314Sache
5858314Sacheint kernacc(void *, int, int);
5921308Sachevm_offset_t kmem_alloc(vm_map_t, vm_size_t);
6021308Sachevm_offset_t kmem_alloc_nofault(vm_map_t, vm_size_t);
6121308Sachevm_offset_t kmem_alloc_wait(vm_map_t, vm_size_t);
6221308Sachevoid kmem_free(vm_map_t, vm_offset_t, vm_size_t);
63119614Sachevoid kmem_free_wakeup(vm_map_t, vm_offset_t, vm_size_t);
64119614Sachevoid kmem_init(vm_offset_t, vm_offset_t);
65119614Sachevm_offset_t kmem_malloc(vm_map_t, vm_size_t, boolean_t);
66119614Sachevm_map_t kmem_suballoc(vm_map_t, vm_offset_t *, vm_offset_t *, vm_size_t);
67119614Sachevoid swapout_procs(int);
6821308Sacheint useracc(void *, int, int);
69119614Sacheint vm_fault(vm_map_t, vm_offset_t, vm_prot_t, int);
70136759Spetervoid vm_fault_copy_entry(vm_map_t, vm_map_t, vm_map_entry_t, vm_map_entry_t);
71119614Sachevoid vm_fault_unwire(vm_map_t, vm_offset_t, vm_offset_t, boolean_t);
72119614Sacheint vm_fault_wire(vm_map_t, vm_offset_t, vm_offset_t, boolean_t, boolean_t);
73119614Sachevoid vm_forkproc(struct thread *, struct proc *, struct thread *, int);
74119614Sachevoid vm_waitproc(struct proc *);
75119614Sacheint vm_mmap(vm_map_t, vm_offset_t *, vm_size_t, vm_prot_t, vm_prot_t, int, void *, vm_ooffset_t);
7621308Sachevoid vm_set_page_size(void);
7758314Sachestruct vmspace *vmspace_alloc(vm_offset_t, vm_offset_t);
7821308Sachestruct vmspace *vmspace_fork(struct vmspace *);
7921308Sachevoid vmspace_exec(struct proc *, vm_offset_t, vm_offset_t);
80165675Sachevoid vmspace_unshare(struct proc *);
81165675Sachevoid vmspace_free(struct vmspace *);
8221308Sachevoid vmspace_exitfree(struct proc *);
8321308Sachevoid vnode_pager_setsize(struct vnode *, vm_ooffset_t);
84165675Sacheint vslock(void *, size_t);
85165675Sachevoid vsunlock(void *, size_t);
86165675Sachevoid vm_object_print(/* db_expr_t */ long, boolean_t, /* db_expr_t */ long,
87165675Sache			  char *);
88165675Sacheint vm_fault_quick(caddr_t v, int prot);
89165675Sachevoid vm_proc_new(struct proc *p);
90165675Sachevoid vm_proc_dispose(struct proc *p);
91165675Sachevoid vm_thread_dispose(struct thread *td);
9221308Sachevoid vm_thread_dispose_altkstack(struct thread *td);
9321308Sachevoid vm_thread_new(struct thread *td, int pages);
9421308Sachevoid vm_thread_new_altkstack(struct thread *td, int pages);
9521308Sachevoid vm_thread_swapin(struct thread *td);
9621308Sachevoid vm_thread_swapout(struct thread *td);
9721308Sache#endif				/* _KERNEL */
9821308Sache#endif				/* !_VM_EXTERN_H_ */
9921308Sache