vm_extern.h revision 194376
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 194376 2009-06-17 17:19:48Z alc $ 311541Srgrimes */ 321541Srgrimes 335283Sbde#ifndef _VM_EXTERN_H_ 345283Sbde#define _VM_EXTERN_H_ 352177Spaul 361541Srgrimesstruct buf; 371541Srgrimesstruct proc; 381541Srgrimesstruct vmspace; 391541Srgrimesstruct vmtotal; 401541Srgrimesstruct mount; 411541Srgrimesstruct vnode; 421541Srgrimes 4355206Speter#ifdef _KERNEL 447090Sbde 45109630Salfredint kernacc(void *, int, int); 4692727Salfredvm_offset_t kmem_alloc(vm_map_t, vm_size_t); 47194376Salcvm_offset_t kmem_alloc_contig(vm_map_t map, vm_size_t size, int flags, 48194376Salc vm_paddr_t low, vm_paddr_t high, unsigned long alignment, 49194376Salc unsigned long boundary); 5092727Salfredvm_offset_t kmem_alloc_nofault(vm_map_t, vm_size_t); 5192727Salfredvm_offset_t kmem_alloc_wait(vm_map_t, vm_size_t); 5292727Salfredvoid kmem_free(vm_map_t, vm_offset_t, vm_size_t); 5392727Salfredvoid kmem_free_wakeup(vm_map_t, vm_offset_t, vm_size_t); 5492727Salfredvoid kmem_init(vm_offset_t, vm_offset_t); 5592727Salfredvm_offset_t kmem_malloc(vm_map_t, vm_size_t, boolean_t); 56178933Salcvm_map_t kmem_suballoc(vm_map_t, vm_offset_t *, vm_offset_t *, vm_size_t, 57178933Salc boolean_t); 5892727Salfredvoid swapout_procs(int); 59109630Salfredint useracc(void *, int, int); 6092727Salfredint vm_fault(vm_map_t, vm_offset_t, vm_prot_t, int); 6192727Salfredvoid vm_fault_copy_entry(vm_map_t, vm_map_t, vm_map_entry_t, vm_map_entry_t); 62129571Salcvoid vm_fault_unwire(vm_map_t, vm_offset_t, vm_offset_t, boolean_t); 63129571Salcint vm_fault_wire(vm_map_t, vm_offset_t, vm_offset_t, boolean_t, boolean_t); 64173361Skibint vm_forkproc(struct thread *, struct proc *, struct thread *, struct vmspace *, int); 6592727Salfredvoid vm_waitproc(struct proc *); 66144501Sjhbint vm_mmap(vm_map_t, vm_offset_t *, vm_size_t, vm_prot_t, vm_prot_t, int, objtype_t, void *, vm_ooffset_t); 6792727Salfredvoid vm_set_page_size(void); 6892727Salfredstruct vmspace *vmspace_alloc(vm_offset_t, vm_offset_t); 6992727Salfredstruct vmspace *vmspace_fork(struct vmspace *); 70173361Skibint vmspace_exec(struct proc *, vm_offset_t, vm_offset_t); 71173361Skibint vmspace_unshare(struct proc *); 72159054Steggevoid vmspace_exit(struct thread *); 73159054Steggestruct vmspace *vmspace_acquire_ref(struct proc *); 7492727Salfredvoid vmspace_free(struct vmspace *); 7592727Salfredvoid vmspace_exitfree(struct proc *); 7692727Salfredvoid vnode_pager_setsize(struct vnode *, vm_ooffset_t); 77127007Struckmanint vslock(void *, size_t); 78127007Struckmanvoid vsunlock(void *, size_t); 7992727Salfredvoid vm_object_print(/* db_expr_t */ long, boolean_t, /* db_expr_t */ long, 8092727Salfred char *); 8192727Salfredint vm_fault_quick(caddr_t v, int prot); 82153485Salcstruct sf_buf *vm_imgact_map_page(vm_object_t object, vm_ooffset_t offset); 83153485Salcvoid vm_imgact_unmap_page(struct sf_buf *sf); 84116355Salcvoid vm_thread_dispose(struct thread *td); 85116355Salcvoid vm_thread_dispose_altkstack(struct thread *td); 86173361Skibint vm_thread_new(struct thread *td, int pages); 87173361Skibint vm_thread_new_altkstack(struct thread *td, int pages); 88116355Salcvoid vm_thread_swapin(struct thread *td); 89116355Salcvoid vm_thread_swapout(struct thread *td); 9055206Speter#endif /* _KERNEL */ 915455Sdg#endif /* !_VM_EXTERN_H_ */ 92