xref: /freebsd/sys/vm/vm_phys.h (revision e35395ce)
111752d88SAlan Cox /*-
211752d88SAlan Cox  * Copyright (c) 2002-2006 Rice University
37bfda801SAlan Cox  * Copyright (c) 2007 Alan L. Cox <alc@cs.rice.edu>
411752d88SAlan Cox  * All rights reserved.
511752d88SAlan Cox  *
611752d88SAlan Cox  * This software was developed for the FreeBSD Project by Alan L. Cox,
711752d88SAlan Cox  * Olivier Crameri, Peter Druschel, Sitaram Iyer, and Juan Navarro.
811752d88SAlan Cox  *
911752d88SAlan Cox  * Redistribution and use in source and binary forms, with or without
1011752d88SAlan Cox  * modification, are permitted provided that the following conditions
1111752d88SAlan Cox  * are met:
1211752d88SAlan Cox  * 1. Redistributions of source code must retain the above copyright
1311752d88SAlan Cox  *    notice, this list of conditions and the following disclaimer.
1411752d88SAlan Cox  * 2. Redistributions in binary form must reproduce the above copyright
1511752d88SAlan Cox  *    notice, this list of conditions and the following disclaimer in the
1611752d88SAlan Cox  *    documentation and/or other materials provided with the distribution.
1711752d88SAlan Cox  *
1811752d88SAlan Cox  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
1911752d88SAlan Cox  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
2011752d88SAlan Cox  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
2111752d88SAlan Cox  * A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT
2211752d88SAlan Cox  * HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
2311752d88SAlan Cox  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
2411752d88SAlan Cox  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
2511752d88SAlan Cox  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
2611752d88SAlan Cox  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2711752d88SAlan Cox  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY
2811752d88SAlan Cox  * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
2911752d88SAlan Cox  * POSSIBILITY OF SUCH DAMAGE.
3011752d88SAlan Cox  *
3111752d88SAlan Cox  * $FreeBSD$
3211752d88SAlan Cox  */
3311752d88SAlan Cox 
3411752d88SAlan Cox /*
3511752d88SAlan Cox  *	Physical memory system definitions
3611752d88SAlan Cox  */
3711752d88SAlan Cox 
3811752d88SAlan Cox #ifndef	_VM_PHYS_H_
3911752d88SAlan Cox #define	_VM_PHYS_H_
4011752d88SAlan Cox 
41e35395ceSAlan Cox #ifdef _KERNEL
42e35395ceSAlan Cox 
4311752d88SAlan Cox void vm_phys_add_page(vm_paddr_t pa);
4411752d88SAlan Cox vm_page_t vm_phys_alloc_contig(unsigned long npages,
4511752d88SAlan Cox     vm_paddr_t low, vm_paddr_t high,
4611752d88SAlan Cox     unsigned long alignment, unsigned long boundary);
4711752d88SAlan Cox vm_page_t vm_phys_alloc_pages(int pool, int order);
4811752d88SAlan Cox vm_paddr_t vm_phys_bootstrap_alloc(vm_size_t size, unsigned long alignment);
4911752d88SAlan Cox void vm_phys_free_pages(vm_page_t m, int order);
5011752d88SAlan Cox void vm_phys_init(void);
517bfda801SAlan Cox void vm_phys_set_pool(int pool, vm_page_t m, int order);
52e35395ceSAlan Cox boolean_t vm_phys_unfree_page(vm_page_t m);
5311752d88SAlan Cox boolean_t vm_phys_zero_pages_idle(void);
5411752d88SAlan Cox 
55e35395ceSAlan Cox #endif	/* _KERNEL */
5611752d88SAlan Cox #endif	/* !_VM_PHYS_H_ */
57