fdisk - Use heads = 255 on file images
[dragonfly.git] / sys / cpu / i386 / include / pmap.h
blobf7f0deff4ea7b5a0705ba04a1923e3048cd63533
1 /*
2 * Copyright (c) 1991 Regents of the University of California.
3 * All rights reserved.
5 * This code is derived from software contributed to Berkeley by
6 * the Systems Programming Group of the University of Utah Computer
7 * Science Department and William Jolitz of UUNET Technologies Inc.
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. All advertising materials mentioning features or use of this software
18 * must display the following acknowledgement:
19 * This product includes software developed by the University of
20 * California, Berkeley and its contributors.
21 * 4. Neither the name of the University nor the names of its contributors
22 * may be used to endorse or promote products derived from this software
23 * without specific prior written permission.
25 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
26 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 * SUCH DAMAGE.
37 * Derived from hp300 version by Mike Hibler, this version by William
38 * Jolitz uses a recursive map [a pde points to the page directory] to
39 * map the page tables using the pagetables themselves. This is done to
40 * reduce the impact on kernel virtual memory for lots of sparse address
41 * space, and to reduce the cost of memory to each process.
43 * from: hp300: @(#)pmap.h 7.2 (Berkeley) 12/16/90
44 * from: @(#)pmap.h 7.4 (Berkeley) 5/12/91
45 * $FreeBSD: src/sys/i386/include/pmap.h,v 1.65.2.3 2001/10/03 07:15:37 peter Exp $
46 * $DragonFly: src/sys/cpu/i386/include/pmap.h,v 1.14 2007/01/14 20:07:11 dillon Exp $
49 #ifndef _CPU_PMAP_H_
50 #define _CPU_PMAP_H_
53 * Page-directory and page-table entires follow this format, with a few
54 * of the fields not present here and there, depending on a lot of things.
56 /* ---- Intel Nomenclature ---- */
57 #define PG_V 0x001 /* P Valid */
58 #define PG_RW 0x002 /* R/W Read/Write */
59 #define PG_U 0x004 /* U/S User/Supervisor */
60 #define PG_NC_PWT 0x008 /* PWT Write through */
61 #define PG_NC_PCD 0x010 /* PCD Cache disable */
62 #define PG_A 0x020 /* A Accessed */
63 #define PG_M 0x040 /* D Dirty */
64 #define PG_PS 0x080 /* PS Page size (0=4k,1=4M) */
65 #define PG_G 0x100 /* G Global */
66 #define PG_AVAIL1 0x200 /* / Available for system */
67 #define PG_AVAIL2 0x400 /* < programmers use */
68 #define PG_AVAIL3 0x800 /* \ */
71 /* Our various interpretations of the above */
72 #define PG_W PG_AVAIL1 /* "Wired" pseudoflag */
73 #define PG_MANAGED PG_AVAIL2
74 #define PG_FRAME (~((vm_paddr_t)PAGE_MASK))
75 #define PG_PROT (PG_RW|PG_U) /* all protection bits . */
76 #define PG_N (PG_NC_PWT|PG_NC_PCD) /* Non-cacheable */
79 * Page Protection Exception bits, stored in tf_err on a real fault
80 * and in tf_xflags on a signal frame or virtual kernel's trap frame.
81 * These only apply to T_PAGEFLT faults.
83 * PGEX_U is also used internally by the virtual kernel to indicate
84 * whether the frame is a userland frame or a supervisor frame.
86 #define PGEX_P 0x01 /* Protection violation vs. not present */
87 #define PGEX_W 0x02 /* during a Write cycle */
88 #define PGEX_U 0x04 /* access from User mode (UPL) */
91 * Virtual kernel bits, managed by software. Stored in tf_xflags.
93 * PGEX_FPFAULT - Force the FP unit to generate a T_DNA fault if an
94 * emulated user process tried to use it. This bit is
95 * only used by vmspace_ctl().
97 * PGEX_MAILBOX - Set in xflags by signal code to indicate that a mailbox
98 * signal was pending. Remerged on signal return. This
99 * bit is only used in a signal vector frame.
101 #define PGEX_MAILBOX 0x40
102 #define PGEX_FPFAULT 0x80
104 #endif /* !_CPU_PMAP_H_ */