xref: /freebsd/sys/vm/_vm_phys.h (revision 4d846d260e2b9a3d4d0a701462568268cbfe7a5b)
1431fb8abSMark Johnston /*-
2*4d846d26SWarner 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  * $FreeBSD$
34431fb8abSMark Johnston  */
35431fb8abSMark Johnston 
36431fb8abSMark Johnston #ifndef	__VM_PHYS_H_
37431fb8abSMark Johnston #define	__VM_PHYS_H_
38431fb8abSMark Johnston 
39431fb8abSMark Johnston #include <machine/vmparam.h>
40431fb8abSMark Johnston 
41431fb8abSMark Johnston #ifndef VM_NFREEORDER_MAX
42431fb8abSMark Johnston #define	VM_NFREEORDER_MAX	VM_NFREEORDER
43431fb8abSMark Johnston #endif
44431fb8abSMark Johnston 
45431fb8abSMark Johnston struct vm_page;
46431fb8abSMark Johnston #ifndef VM_PAGE_HAVE_PGLIST
47431fb8abSMark Johnston TAILQ_HEAD(pglist, vm_page);
48431fb8abSMark Johnston #define VM_PAGE_HAVE_PGLIST
49431fb8abSMark Johnston #endif
50431fb8abSMark Johnston 
51431fb8abSMark Johnston struct vm_freelist {
52431fb8abSMark Johnston 	struct pglist pl;
53431fb8abSMark Johnston 	int lcnt;
54431fb8abSMark Johnston };
55431fb8abSMark Johnston 
56431fb8abSMark Johnston struct vm_phys_seg {
57431fb8abSMark Johnston 	vm_paddr_t	start;
58431fb8abSMark Johnston 	vm_paddr_t	end;
59431fb8abSMark Johnston 	vm_page_t	first_page;
60431fb8abSMark Johnston #if VM_NRESERVLEVEL > 0
61431fb8abSMark Johnston 	vm_reserv_t	first_reserv;
62431fb8abSMark Johnston #endif
63431fb8abSMark Johnston #ifdef __aarch64__
64431fb8abSMark Johnston 	void		*md_first;
65431fb8abSMark Johnston #endif
66431fb8abSMark Johnston 	int		domain;
67431fb8abSMark Johnston 	struct vm_freelist (*free_queues)[VM_NFREEPOOL][VM_NFREEORDER_MAX];
68431fb8abSMark Johnston };
69431fb8abSMark Johnston 
70431fb8abSMark Johnston extern struct vm_phys_seg vm_phys_segs[];
71431fb8abSMark Johnston extern int vm_phys_nsegs;
72431fb8abSMark Johnston 
73431fb8abSMark Johnston #endif /* !__VM_PHYS_H_ */
74