xref: /freebsd/sys/vm/_vm_phys.h (revision e3537f9235ba237b7f35d88c3d8147c164f2a86c)
1431fb8abSMark Johnston /*-
24d846d26SWarner Losh  * SPDX-License-Identifier: BSD-2-Clause
3431fb8abSMark Johnston  *
4431fb8abSMark Johnston  * Copyright (c) 2002-2006 Rice University
5431fb8abSMark Johnston  * Copyright (c) 2007 Alan L. Cox <alc@cs.rice.edu>
6431fb8abSMark Johnston  * All rights reserved.
7431fb8abSMark Johnston  *
8431fb8abSMark Johnston  * This software was developed for the FreeBSD Project by Alan L. Cox,
9431fb8abSMark Johnston  * Olivier Crameri, Peter Druschel, Sitaram Iyer, and Juan Navarro.
10431fb8abSMark Johnston  *
11431fb8abSMark Johnston  * Redistribution and use in source and binary forms, with or without
12431fb8abSMark Johnston  * modification, are permitted provided that the following conditions
13431fb8abSMark Johnston  * are met:
14431fb8abSMark Johnston  * 1. Redistributions of source code must retain the above copyright
15431fb8abSMark Johnston  *    notice, this list of conditions and the following disclaimer.
16431fb8abSMark Johnston  * 2. Redistributions in binary form must reproduce the above copyright
17431fb8abSMark Johnston  *    notice, this list of conditions and the following disclaimer in the
18431fb8abSMark Johnston  *    documentation and/or other materials provided with the distribution.
19431fb8abSMark Johnston  *
20431fb8abSMark Johnston  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21431fb8abSMark Johnston  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22431fb8abSMark Johnston  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23431fb8abSMark Johnston  * A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT
24431fb8abSMark Johnston  * HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
25431fb8abSMark Johnston  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
26431fb8abSMark Johnston  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
27431fb8abSMark Johnston  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
28431fb8abSMark Johnston  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29431fb8abSMark Johnston  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY
30431fb8abSMark Johnston  * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31431fb8abSMark Johnston  * POSSIBILITY OF SUCH DAMAGE.
32431fb8abSMark Johnston  */
33431fb8abSMark Johnston 
34431fb8abSMark Johnston #ifndef	__VM_PHYS_H_
35431fb8abSMark Johnston #define	__VM_PHYS_H_
36431fb8abSMark Johnston 
37431fb8abSMark Johnston #include <machine/vmparam.h>
38431fb8abSMark Johnston 
39431fb8abSMark Johnston #ifndef VM_NFREEORDER_MAX
40431fb8abSMark Johnston #define	VM_NFREEORDER_MAX	VM_NFREEORDER
41431fb8abSMark Johnston #endif
42431fb8abSMark Johnston 
43431fb8abSMark Johnston struct vm_page;
44431fb8abSMark Johnston #ifndef VM_PAGE_HAVE_PGLIST
45431fb8abSMark Johnston TAILQ_HEAD(pglist, vm_page);
46431fb8abSMark Johnston #define VM_PAGE_HAVE_PGLIST
47431fb8abSMark Johnston #endif
48431fb8abSMark Johnston 
49431fb8abSMark Johnston struct vm_freelist {
50431fb8abSMark Johnston 	struct pglist pl;
51431fb8abSMark Johnston 	int lcnt;
52431fb8abSMark Johnston };
53431fb8abSMark Johnston 
54431fb8abSMark Johnston struct vm_phys_seg {
55431fb8abSMark Johnston 	vm_paddr_t	start;
56431fb8abSMark Johnston 	vm_paddr_t	end;
57431fb8abSMark Johnston 	vm_page_t	first_page;
58431fb8abSMark Johnston #if VM_NRESERVLEVEL > 0
59431fb8abSMark Johnston 	vm_reserv_t	first_reserv;
60431fb8abSMark Johnston #endif
61431fb8abSMark Johnston #ifdef __aarch64__
62431fb8abSMark Johnston 	void		*md_first;
63431fb8abSMark Johnston #endif
64431fb8abSMark Johnston 	int		domain;
65*e3537f92SDoug Moore 	struct vm_freelist (*free_queues)[VM_NFREEPOOL][VM_NFREEORDER_MAX];
66431fb8abSMark Johnston };
67431fb8abSMark Johnston 
68431fb8abSMark Johnston extern struct vm_phys_seg vm_phys_segs[];
69431fb8abSMark Johnston extern int vm_phys_nsegs;
70431fb8abSMark Johnston 
71431fb8abSMark Johnston #endif /* !__VM_PHYS_H_ */
72