1 /*- 2 * SPDX-License-Identifier: BSD-2-Clause 3 * 4 * Copyright (c) 2002-2006 Rice University 5 * Copyright (c) 2007 Alan L. Cox <alc@cs.rice.edu> 6 * All rights reserved. 7 * 8 * This software was developed for the FreeBSD Project by Alan L. Cox, 9 * Olivier Crameri, Peter Druschel, Sitaram Iyer, and Juan Navarro. 10 * 11 * Redistribution and use in source and binary forms, with or without 12 * modification, are permitted provided that the following conditions 13 * are met: 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. 19 * 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. 32 */ 33 34 #ifndef __VM_PHYS_H_ 35 #define __VM_PHYS_H_ 36 37 #include <machine/vmparam.h> 38 39 #ifndef VM_NFREEORDER_MAX 40 #define VM_NFREEORDER_MAX VM_NFREEORDER 41 #endif 42 43 struct vm_page; 44 #ifndef VM_PAGE_HAVE_PGLIST 45 TAILQ_HEAD(pglist, vm_page); 46 #define VM_PAGE_HAVE_PGLIST 47 #endif 48 49 struct vm_freelist { 50 struct pglist pl; 51 int lcnt; 52 }; 53 54 struct vm_phys_seg { 55 vm_paddr_t start; 56 vm_paddr_t end; 57 vm_page_t first_page; 58 #if VM_NRESERVLEVEL > 0 59 vm_reserv_t first_reserv; 60 #endif 61 #ifdef __aarch64__ 62 void *md_first; 63 #endif 64 int domain; 65 struct vm_freelist (*free_queues)[VM_NFREEPOOL][VM_NFREEORDER_MAX]; 66 }; 67 68 extern struct vm_phys_seg vm_phys_segs[]; 69 extern int vm_phys_nsegs; 70 71 #endif /* !__VM_PHYS_H_ */ 72