1*22ce4affSfengbojiang /*- 2*22ce4affSfengbojiang * SPDX-License-Identifier: BSD-2-Clause-FreeBSD 3*22ce4affSfengbojiang * 4*22ce4affSfengbojiang * Copyright (c) 2002-2006 Rice University 5*22ce4affSfengbojiang * Copyright (c) 2007 Alan L. Cox <[email protected]> 6*22ce4affSfengbojiang * All rights reserved. 7*22ce4affSfengbojiang * 8*22ce4affSfengbojiang * This software was developed for the FreeBSD Project by Alan L. Cox, 9*22ce4affSfengbojiang * Olivier Crameri, Peter Druschel, Sitaram Iyer, and Juan Navarro. 10*22ce4affSfengbojiang * 11*22ce4affSfengbojiang * Redistribution and use in source and binary forms, with or without 12*22ce4affSfengbojiang * modification, are permitted provided that the following conditions 13*22ce4affSfengbojiang * are met: 14*22ce4affSfengbojiang * 1. Redistributions of source code must retain the above copyright 15*22ce4affSfengbojiang * notice, this list of conditions and the following disclaimer. 16*22ce4affSfengbojiang * 2. Redistributions in binary form must reproduce the above copyright 17*22ce4affSfengbojiang * notice, this list of conditions and the following disclaimer in the 18*22ce4affSfengbojiang * documentation and/or other materials provided with the distribution. 19*22ce4affSfengbojiang * 20*22ce4affSfengbojiang * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21*22ce4affSfengbojiang * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22*22ce4affSfengbojiang * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23*22ce4affSfengbojiang * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24*22ce4affSfengbojiang * HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 25*22ce4affSfengbojiang * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 26*22ce4affSfengbojiang * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS 27*22ce4affSfengbojiang * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 28*22ce4affSfengbojiang * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29*22ce4affSfengbojiang * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY 30*22ce4affSfengbojiang * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 31*22ce4affSfengbojiang * POSSIBILITY OF SUCH DAMAGE. 32*22ce4affSfengbojiang * 33*22ce4affSfengbojiang * $FreeBSD$ 34*22ce4affSfengbojiang */ 35*22ce4affSfengbojiang 36*22ce4affSfengbojiang #ifndef __VM_PHYS_H_ 37*22ce4affSfengbojiang #define __VM_PHYS_H_ 38*22ce4affSfengbojiang 39*22ce4affSfengbojiang #include <machine/vmparam.h> 40*22ce4affSfengbojiang 41*22ce4affSfengbojiang #ifndef VM_NFREEORDER_MAX 42*22ce4affSfengbojiang #define VM_NFREEORDER_MAX VM_NFREEORDER 43*22ce4affSfengbojiang #endif 44*22ce4affSfengbojiang 45*22ce4affSfengbojiang struct vm_page; 46*22ce4affSfengbojiang #ifndef VM_PAGE_HAVE_PGLIST 47*22ce4affSfengbojiang TAILQ_HEAD(pglist, vm_page); 48*22ce4affSfengbojiang #define VM_PAGE_HAVE_PGLIST 49*22ce4affSfengbojiang #endif 50*22ce4affSfengbojiang 51*22ce4affSfengbojiang struct vm_freelist { 52*22ce4affSfengbojiang struct pglist pl; 53*22ce4affSfengbojiang int lcnt; 54*22ce4affSfengbojiang }; 55*22ce4affSfengbojiang 56*22ce4affSfengbojiang struct vm_phys_seg { 57*22ce4affSfengbojiang vm_paddr_t start; 58*22ce4affSfengbojiang vm_paddr_t end; 59*22ce4affSfengbojiang vm_page_t first_page; 60*22ce4affSfengbojiang #if VM_NRESERVLEVEL > 0 61*22ce4affSfengbojiang vm_reserv_t first_reserv; 62*22ce4affSfengbojiang #endif 63*22ce4affSfengbojiang #ifdef __aarch64__ 64*22ce4affSfengbojiang void *md_first; 65*22ce4affSfengbojiang #endif 66*22ce4affSfengbojiang int domain; 67*22ce4affSfengbojiang struct vm_freelist (*free_queues)[VM_NFREEPOOL][VM_NFREEORDER_MAX]; 68*22ce4affSfengbojiang }; 69*22ce4affSfengbojiang 70*22ce4affSfengbojiang extern struct vm_phys_seg vm_phys_segs[]; 71*22ce4affSfengbojiang extern int vm_phys_nsegs; 72*22ce4affSfengbojiang 73*22ce4affSfengbojiang #endif /* !__VM_PHYS_H_ */ 74