vm_extern.h revision 5283
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 * 3. All advertising materials mentioning features or use of this software
141541Srgrimes *    must display the following acknowledgement:
151541Srgrimes *	This product includes software developed by the University of
161541Srgrimes *	California, Berkeley and its contributors.
171541Srgrimes * 4. Neither the name of the University nor the names of its contributors
181541Srgrimes *    may be used to endorse or promote products derived from this software
191541Srgrimes *    without specific prior written permission.
201541Srgrimes *
211541Srgrimes * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
221541Srgrimes * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
231541Srgrimes * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
241541Srgrimes * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
251541Srgrimes * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
261541Srgrimes * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
271541Srgrimes * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
281541Srgrimes * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
291541Srgrimes * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
301541Srgrimes * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
311541Srgrimes * SUCH DAMAGE.
321541Srgrimes *
331541Srgrimes *	@(#)vm_extern.h	8.2 (Berkeley) 1/12/94
345283Sbde * $Id: vm_extern.h,v 1.6 1994/09/27 18:00:26 davidg Exp $
351541Srgrimes */
361541Srgrimes
375283Sbde#ifndef _VM_EXTERN_H_
385283Sbde#define	_VM_EXTERN_H_
392177Spaul
401541Srgrimesstruct buf;
411541Srgrimesstruct loadavg;
421541Srgrimesstruct proc;
431541Srgrimesstruct vmspace;
441541Srgrimesstruct vmtotal;
451541Srgrimesstruct mount;
461541Srgrimesstruct vnode;
471541Srgrimes
481541Srgrimes#ifdef KGDB
491541Srgrimesvoid		 chgkprot __P((caddr_t, int, int));
501541Srgrimes#endif
511541Srgrimes
521549Srgrimes/*
531549Srgrimes * Try to get semi-meaningful wait messages into thread_sleep...
541549Srgrimes */
555283Sbdevoid thread_sleep_ __P((int, simple_lock_t, char *));
561549Srgrimes#if __GNUC__ >= 2
571549Srgrimes#define thread_sleep(a,b,c) thread_sleep_((a), (b), __FUNCTION__)
581549Srgrimes#else
591549Srgrimes#define thread_sleep(a,b,c) thread_sleep_((a), (b), "vmslp")
601549Srgrimes#endif
611549Srgrimes
621541Srgrimes#ifdef KERNEL
631541Srgrimes#ifdef TYPEDEF_FOR_UAP
641541Srgrimesint		 getpagesize __P((struct proc *p, void *, int *));
651541Srgrimesint		 madvise __P((struct proc *, void *, int *));
661541Srgrimesint		 mincore __P((struct proc *, void *, int *));
671541Srgrimesint		 mprotect __P((struct proc *, void *, int *));
681541Srgrimesint		 msync __P((struct proc *, void *, int *));
691541Srgrimesint		 munmap __P((struct proc *, void *, int *));
701541Srgrimesint		 obreak __P((struct proc *, void *, int *));
711541Srgrimesint		 sbrk __P((struct proc *, void *, int *));
721541Srgrimesint		 smmap __P((struct proc *, void *, int *));
731541Srgrimesint		 sstk __P((struct proc *, void *, int *));
741541Srgrimes#endif
751541Srgrimes
761541Srgrimesvoid		 assert_wait __P((int, boolean_t));
771541Srgrimesint		 grow __P((struct proc *, u_int));
781541Srgrimesvoid		 iprintf __P((const char *, ...));
791541Srgrimesint		 kernacc __P((caddr_t, int, int));
801541Srgrimesint		 kinfo_loadavg __P((int, char *, int *, int, int *));
811541Srgrimesint		 kinfo_meter __P((int, caddr_t, int *, int, int *));
821541Srgrimesvm_offset_t	 kmem_alloc __P((vm_map_t, vm_size_t));
831541Srgrimesvm_offset_t	 kmem_alloc_pageable __P((vm_map_t, vm_size_t));
841541Srgrimesvm_offset_t	 kmem_alloc_wait __P((vm_map_t, vm_size_t));
851541Srgrimesvoid		 kmem_free __P((vm_map_t, vm_offset_t, vm_size_t));
861541Srgrimesvoid		 kmem_free_wakeup __P((vm_map_t, vm_offset_t, vm_size_t));
871541Srgrimesvoid		 kmem_init __P((vm_offset_t, vm_offset_t));
881541Srgrimesvm_offset_t	 kmem_malloc __P((vm_map_t, vm_size_t, boolean_t));
891541Srgrimesvm_map_t	 kmem_suballoc __P((vm_map_t, vm_offset_t *, vm_offset_t *,
901541Srgrimes		    vm_size_t, boolean_t));
911541Srgrimesvoid		 loadav __P((struct loadavg *));
922462Sdgvoid		 munmapfd __P((struct proc *, int));
931541Srgrimesint		 pager_cache __P((vm_object_t, boolean_t));
941541Srgrimesvoid		 sched __P((void));
951541Srgrimesint		 svm_allocate __P((struct proc *, void *, int *));
961541Srgrimesint		 svm_deallocate __P((struct proc *, void *, int *));
971541Srgrimesint		 svm_inherit __P((struct proc *, void *, int *));
981541Srgrimesint		 svm_protect __P((struct proc *, void *, int *));
991541Srgrimesvoid		 swapinit __P((void));
1001541Srgrimesint		 swapon __P((struct proc *, void *, int *));
1011541Srgrimesvoid		 swapout __P((struct proc *));
1021541Srgrimesvoid		 swapout_threads __P((void));
1031541Srgrimesint		 swfree __P((struct proc *, int));
1041541Srgrimesvoid		 swstrategy __P((struct buf *));
1051549Srgrimesvoid		 thread_block __P((char *));
1061541Srgrimesvoid		 thread_sleep __P((int, simple_lock_t, boolean_t));
1071541Srgrimesvoid		 thread_wakeup __P((int));
1081541Srgrimesint		 useracc __P((caddr_t, int, int));
1091541Srgrimesint		 vm_allocate __P((vm_map_t,
1101541Srgrimes		    vm_offset_t *, vm_size_t, boolean_t));
1111541Srgrimesint		 vm_allocate_with_pager __P((vm_map_t, vm_offset_t *,
1121541Srgrimes		    vm_size_t, boolean_t, vm_pager_t, vm_offset_t, boolean_t));
1131541Srgrimesint		 vm_deallocate __P((vm_map_t, vm_offset_t, vm_size_t));
1141541Srgrimesint		 vm_fault __P((vm_map_t, vm_offset_t, vm_prot_t, boolean_t));
1151541Srgrimesvoid		 vm_fault_copy_entry __P((vm_map_t,
1161541Srgrimes		    vm_map_t, vm_map_entry_t, vm_map_entry_t));
1171541Srgrimesvoid		 vm_fault_unwire __P((vm_map_t, vm_offset_t, vm_offset_t));
1181541Srgrimesint		 vm_fault_wire __P((vm_map_t, vm_offset_t, vm_offset_t));
1191541Srgrimesint		 vm_fork __P((struct proc *, struct proc *, int));
1201541Srgrimesint		 vm_inherit __P((vm_map_t,
1211541Srgrimes		    vm_offset_t, vm_size_t, vm_inherit_t));
1221541Srgrimesvoid		 vm_init_limits __P((struct proc *));
1231541Srgrimesvoid		 vm_mem_init __P((void));
1241541Srgrimesint		 vm_mmap __P((vm_map_t, vm_offset_t *, vm_size_t,
1251541Srgrimes		    vm_prot_t, vm_prot_t, int, caddr_t, vm_offset_t));
1265283Sbdevm_offset_t	 vm_page_alloc_contig __P((vm_offset_t, vm_offset_t,
1275283Sbde		    vm_offset_t, vm_offset_t));
1281541Srgrimesint		 vm_protect __P((vm_map_t,
1291541Srgrimes		    vm_offset_t, vm_size_t, boolean_t, vm_prot_t));
1301541Srgrimesvoid		 vm_set_page_size __P((void));
1311541Srgrimesvoid		 vmmeter __P((void));
1321541Srgrimesstruct vmspace	*vmspace_alloc __P((vm_offset_t, vm_offset_t, int));
1331541Srgrimesstruct vmspace	*vmspace_fork __P((struct vmspace *));
1341541Srgrimesvoid		 vmspace_free __P((struct vmspace *));
1351541Srgrimesvoid		 vmtotal __P((struct vmtotal *));
1361541Srgrimesvoid		 vnode_pager_setsize __P((struct vnode *, u_long));
1371541Srgrimesvoid		 vnode_pager_umount __P((struct mount *));
1381541Srgrimesboolean_t	 vnode_pager_uncache __P((struct vnode *));
1391541Srgrimesvoid		 vslock __P((caddr_t, u_int));
1401541Srgrimesvoid		 vsunlock __P((caddr_t, u_int, int));
1415283Sbde#endif /* KERNEL */
1422177Spaul
1435283Sbde#endif /* !_VM_EXTERN_H_ */
144