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