2 * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
4 * Copyright (c) 2002-2006 Rice University
5 * Copyright (c) 2007-2008 Alan L. Cox <alc@cs.rice.edu>
8 * This software was developed for the FreeBSD Project by Alan L. Cox,
9 * Olivier Crameri, Peter Druschel, Sitaram Iyer, and Juan Navarro.
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
14 * 1. Redistributions of source code must retain the above copyright
15 * notice, this list of conditions and the following disclaimer.
16 * 2. Redistributions in binary form must reproduce the above copyright
17 * notice, this list of conditions and the following disclaimer in the
18 * documentation and/or other materials provided with the distribution.
20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24 * HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
25 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
26 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
27 * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
28 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY
30 * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31 * POSSIBILITY OF SUCH DAMAGE.
37 * Superpage reservation management definitions
45 #if VM_NRESERVLEVEL > 0
48 * The following functions are only to be used by the virtual memory system.
50 vm_page_t vm_reserv_alloc_contig(vm_object_t object, vm_pindex_t pindex,
51 int domain, u_long npages, vm_paddr_t low, vm_paddr_t high,
52 u_long alignment, vm_paddr_t boundary, vm_page_t mpred);
53 vm_page_t vm_reserv_alloc_page(vm_object_t object, vm_pindex_t pindex,
54 int domain, vm_page_t mpred);
55 void vm_reserv_break_all(vm_object_t object);
56 boolean_t vm_reserv_free_page(vm_page_t m);
57 void vm_reserv_init(void);
58 bool vm_reserv_is_page_free(vm_page_t m);
59 int vm_reserv_level(vm_page_t m);
60 int vm_reserv_level_iffullpop(vm_page_t m);
61 boolean_t vm_reserv_reclaim_contig(int domain, u_long npages,
62 vm_paddr_t low, vm_paddr_t high, u_long alignment,
64 boolean_t vm_reserv_reclaim_inactive(int domain);
65 void vm_reserv_rename(vm_page_t m, vm_object_t new_object,
66 vm_object_t old_object, vm_pindex_t old_object_offset);
67 int vm_reserv_size(int level);
68 vm_paddr_t vm_reserv_startup(vm_offset_t *vaddr, vm_paddr_t end,
69 vm_paddr_t high_water);
70 vm_page_t vm_reserv_to_superpage(vm_page_t m);
72 #endif /* VM_NRESERVLEVEL > 0 */
74 #endif /* !_VM_RESERV_H_ */