/*-1* SPDX-License-Identifier: BSD-2-Clause2*3* Copyright (c) 2002-2006 Rice University4* Copyright (c) 2007-2008 Alan L. Cox <[email protected]>5* All rights reserved.6*7* This software was developed for the FreeBSD Project by Alan L. Cox,8* Olivier Crameri, Peter Druschel, Sitaram Iyer, and Juan Navarro.9*10* Redistribution and use in source and binary forms, with or without11* modification, are permitted provided that the following conditions12* are met:13* 1. Redistributions of source code must retain the above copyright14* notice, this list of conditions and the following disclaimer.15* 2. Redistributions in binary form must reproduce the above copyright16* notice, this list of conditions and the following disclaimer in the17* documentation and/or other materials provided with the distribution.18*19* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS20* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT21* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR22* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT23* HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,24* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,25* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS26* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED27* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT28* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY29* WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE30* POSSIBILITY OF SUCH DAMAGE.31*/3233/*34* Superpage reservation management definitions35*/3637#ifndef _VM_RESERV_H_38#define _VM_RESERV_H_3940#ifdef _KERNEL4142#if VM_NRESERVLEVEL > 04344/*45* The following functions are only to be used by the virtual memory system.46*/47vm_page_t vm_reserv_alloc_contig(vm_object_t object, vm_pindex_t pindex,48int domain, int req, u_long npages, vm_paddr_t low,49vm_paddr_t high, u_long alignment, vm_paddr_t boundary,50struct pctrie_iter *pages);51vm_page_t vm_reserv_alloc_page(vm_object_t object, vm_pindex_t pindex,52int domain, int req, struct pctrie_iter *pages);53void vm_reserv_break_all(vm_object_t object);54boolean_t vm_reserv_free_page(vm_page_t m);55void vm_reserv_init(void);56bool vm_reserv_is_page_free(vm_page_t m);57bool vm_reserv_is_populated(vm_page_t m, int npages);58int vm_reserv_level(vm_page_t m);59int vm_reserv_level_iffullpop(vm_page_t m);60vm_page_t vm_reserv_reclaim_contig(int domain, u_long npages,61vm_paddr_t low, vm_paddr_t high, u_long alignment,62vm_paddr_t boundary);63bool vm_reserv_reclaim_inactive(int domain);64void vm_reserv_rename(vm_page_t m, vm_object_t new_object,65vm_object_t old_object, vm_pindex_t old_object_offset);66int vm_reserv_size(int level);67vm_paddr_t vm_reserv_startup(vm_offset_t *vaddr, vm_paddr_t end);68vm_page_t vm_reserv_to_superpage(vm_page_t m);6970#endif /* VM_NRESERVLEVEL > 0 */71#endif /* _KERNEL */72#endif /* !_VM_RESERV_H_ */737475