1 /* $NetBSD: pmap_pv.h,v 1.3 2011/06/12 03:35:50 rmind Exp $ */
4 * Copyright (c)2008 YAMAMOTO Takashi,
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
20 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 #ifndef _X86_PMAP_PV_H_
30 #define _X86_PMAP_PV_H_
32 #include <sys/mutex.h>
33 #include <sys/queue.h>
38 * structures to track P->V mapping
40 * this file is intended to be minimum as it's included by <machine/vmparam.h>.
44 * pv_pte: describe a pte
48 struct vm_page
*pte_ptp
; /* PTP; NULL for pmap_kernel() */
49 vaddr_t pte_va
; /* VA */
53 * pv_entry: plug pv_pte into lists.
57 struct pv_pte pve_pte
; /* should be the first member */
58 LIST_ENTRY(pv_entry
) pve_list
; /* on pv_head::pvh_list */
59 SLIST_ENTRY(pv_entry
) pve_hash
;
61 #define pve_next pve_list.le_next
64 * pmap_page: a structure which is embedded in each vm_page.
74 LIST_HEAD(, pv_entry
) pvh_list
;
78 struct vm_page
*u_link
;
80 #define pp_pte pp_u.u_pte
81 #define pp_head pp_u.u_head
82 #define pp_link pp_u.u_link
84 uint8_t pp_attrs
; /* saved PG_M and PG_U */
90 #define PMAP_PAGE_INIT(pp) /* none */
92 #endif /* !_X86_PMAP_PV_H_ */