vm_extern.h revision 195329
11541Srgrimes/*-
21541Srgrimes * Copyright (c) 1992, 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 * 4. Neither the name of the University nor the names of its contributors
141541Srgrimes *    may be used to endorse or promote products derived from this software
151541Srgrimes *    without specific prior written permission.
161541Srgrimes *
171541Srgrimes * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
181541Srgrimes * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
191541Srgrimes * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
201541Srgrimes * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
211541Srgrimes * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
221541Srgrimes * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
231541Srgrimes * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
241541Srgrimes * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
251541Srgrimes * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
261541Srgrimes * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
271541Srgrimes * SUCH DAMAGE.
281541Srgrimes *
291541Srgrimes *	@(#)vm_extern.h	8.2 (Berkeley) 1/12/94
3050477Speter * $FreeBSD: head/sys/vm/vm_extern.h 195329 2009-07-03 22:17:37Z kib $
311541Srgrimes */
321541Srgrimes
335283Sbde#ifndef _VM_EXTERN_H_
345283Sbde#define	_VM_EXTERN_H_
352177Spaul
361541Srgrimesstruct proc;
371541Srgrimesstruct vmspace;
381541Srgrimesstruct vnode;
391541Srgrimes
4055206Speter#ifdef _KERNEL
417090Sbde
42109630Salfredint kernacc(void *, int, int);
4392727Salfredvm_offset_t kmem_alloc(vm_map_t, vm_size_t);
44194376Salcvm_offset_t kmem_alloc_contig(vm_map_t map, vm_size_t size, int flags,
45194376Salc    vm_paddr_t low, vm_paddr_t high, unsigned long alignment,
46195033Salc    unsigned long boundary, vm_cache_mode_t mode);
4792727Salfredvm_offset_t kmem_alloc_nofault(vm_map_t, vm_size_t);
4892727Salfredvm_offset_t kmem_alloc_wait(vm_map_t, vm_size_t);
4992727Salfredvoid kmem_free(vm_map_t, vm_offset_t, vm_size_t);
5092727Salfredvoid kmem_free_wakeup(vm_map_t, vm_offset_t, vm_size_t);
5192727Salfredvoid kmem_init(vm_offset_t, vm_offset_t);
5292727Salfredvm_offset_t kmem_malloc(vm_map_t, vm_size_t, boolean_t);
53178933Salcvm_map_t kmem_suballoc(vm_map_t, vm_offset_t *, vm_offset_t *, vm_size_t,
54178933Salc    boolean_t);
5592727Salfredvoid swapout_procs(int);
56109630Salfredint useracc(void *, int, int);
5792727Salfredint vm_fault(vm_map_t, vm_offset_t, vm_prot_t, int);
58195329Skibvoid vm_fault_copy_entry(vm_map_t, vm_map_t, vm_map_entry_t, vm_map_entry_t,
59195329Skib    vm_ooffset_t *);
60129571Salcvoid vm_fault_unwire(vm_map_t, vm_offset_t, vm_offset_t, boolean_t);
61129571Salcint vm_fault_wire(vm_map_t, vm_offset_t, vm_offset_t, boolean_t, boolean_t);
62173361Skibint vm_forkproc(struct thread *, struct proc *, struct thread *, struct vmspace *, int);
6392727Salfredvoid vm_waitproc(struct proc *);
64144501Sjhbint vm_mmap(vm_map_t, vm_offset_t *, vm_size_t, vm_prot_t, vm_prot_t, int, objtype_t, void *, vm_ooffset_t);
6592727Salfredvoid vm_set_page_size(void);
6692727Salfredstruct vmspace *vmspace_alloc(vm_offset_t, vm_offset_t);
67194766Skibstruct vmspace *vmspace_fork(struct vmspace *, vm_ooffset_t *);
68173361Skibint vmspace_exec(struct proc *, vm_offset_t, vm_offset_t);
69173361Skibint vmspace_unshare(struct proc *);
70159054Steggevoid vmspace_exit(struct thread *);
71159054Steggestruct vmspace *vmspace_acquire_ref(struct proc *);
7292727Salfredvoid vmspace_free(struct vmspace *);
7392727Salfredvoid vmspace_exitfree(struct proc *);
7492727Salfredvoid vnode_pager_setsize(struct vnode *, vm_ooffset_t);
75127007Struckmanint vslock(void *, size_t);
76127007Struckmanvoid vsunlock(void *, size_t);
7792727Salfredvoid vm_object_print(/* db_expr_t */ long, boolean_t, /* db_expr_t */ long,
7892727Salfred			  char *);
7992727Salfredint vm_fault_quick(caddr_t v, int prot);
80153485Salcstruct sf_buf *vm_imgact_map_page(vm_object_t object, vm_ooffset_t offset);
81153485Salcvoid vm_imgact_unmap_page(struct sf_buf *sf);
82116355Salcvoid vm_thread_dispose(struct thread *td);
83116355Salcvoid vm_thread_dispose_altkstack(struct thread *td);
84173361Skibint vm_thread_new(struct thread *td, int pages);
85173361Skibint vm_thread_new_altkstack(struct thread *td, int pages);
86116355Salcvoid vm_thread_swapin(struct thread *td);
87116355Salcvoid vm_thread_swapout(struct thread *td);
8855206Speter#endif				/* _KERNEL */
895455Sdg#endif				/* !_VM_EXTERN_H_ */
90