Deleted Added
full compact
pmap.h (147671) pmap.h (153179)
1/*-
2 * Copyright (c) 1991 Regents of the University of California.
3 * All rights reserved.
4 *
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.
8 *

--- 24 unchanged lines hidden (view full) ---

33 * Derived from hp300 version by Mike Hibler, this version by William
34 * Jolitz uses a recursive map [a pde points to the page directory] to
35 * map the page tables using the pagetables themselves. This is done to
36 * reduce the impact on kernel virtual memory for lots of sparse address
37 * space, and to reduce the cost of memory to each process.
38 *
39 * from: hp300: @(#)pmap.h 7.2 (Berkeley) 12/16/90
40 * from: @(#)pmap.h 7.4 (Berkeley) 5/12/91
1/*-
2 * Copyright (c) 1991 Regents of the University of California.
3 * All rights reserved.
4 *
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.
8 *

--- 24 unchanged lines hidden (view full) ---

33 * Derived from hp300 version by Mike Hibler, this version by William
34 * Jolitz uses a recursive map [a pde points to the page directory] to
35 * map the page tables using the pagetables themselves. This is done to
36 * reduce the impact on kernel virtual memory for lots of sparse address
37 * space, and to reduce the cost of memory to each process.
38 *
39 * from: hp300: @(#)pmap.h 7.2 (Berkeley) 12/16/90
40 * from: @(#)pmap.h 7.4 (Berkeley) 5/12/91
41 * $FreeBSD: head/sys/i386/include/pmap.h 147671 2005-06-29 22:28:46Z peter $
41 * $FreeBSD: head/sys/i386/include/pmap.h 153179 2005-12-06 21:09:01Z jhb $
42 */
43
44#ifndef _MACHINE_PMAP_H_
45#define _MACHINE_PMAP_H_
46
47/*
42 */
43
44#ifndef _MACHINE_PMAP_H_
45#define _MACHINE_PMAP_H_
46
47/*
48 * Page-directory and page-table entires follow this format, with a few
48 * Page-directory and page-table entries follow this format, with a few
49 * of the fields not present here and there, depending on a lot of things.
50 */
51 /* ---- Intel Nomenclature ---- */
52#define PG_V 0x001 /* P Valid */
53#define PG_RW 0x002 /* R/W Read/Write */
54#define PG_U 0x004 /* U/S User/Supervisor */
55#define PG_NC_PWT 0x008 /* PWT Write through */
56#define PG_NC_PCD 0x010 /* PCD Cache disable */

--- 115 unchanged lines hidden (view full) ---

172extern pdpt_entry_t *IdlePDPT;
173#endif
174extern pd_entry_t *IdlePTD; /* physical address of "Idle" state directory */
175#endif
176
177#ifdef _KERNEL
178/*
179 * virtual address to page table entry and
49 * of the fields not present here and there, depending on a lot of things.
50 */
51 /* ---- Intel Nomenclature ---- */
52#define PG_V 0x001 /* P Valid */
53#define PG_RW 0x002 /* R/W Read/Write */
54#define PG_U 0x004 /* U/S User/Supervisor */
55#define PG_NC_PWT 0x008 /* PWT Write through */
56#define PG_NC_PCD 0x010 /* PCD Cache disable */

--- 115 unchanged lines hidden (view full) ---

172extern pdpt_entry_t *IdlePDPT;
173#endif
174extern pd_entry_t *IdlePTD; /* physical address of "Idle" state directory */
175#endif
176
177#ifdef _KERNEL
178/*
179 * virtual address to page table entry and
180 * to physical address. Likewise for alternate address space.
180 * to physical address.
181 * Note: these work recursively, thus vtopte of a pte will give
182 * the corresponding pde that in turn maps it.
183 */
184#define vtopte(va) (PTmap + i386_btop(va))
181 * Note: these work recursively, thus vtopte of a pte will give
182 * the corresponding pde that in turn maps it.
183 */
184#define vtopte(va) (PTmap + i386_btop(va))
185#define vtophys(va) pmap_kextract((vm_offset_t)(va))
185
186/*
187 * Routine: pmap_kextract
188 * Function:
189 * Extract the physical page address associated
190 * kernel virtual address.
191 */
192static __inline vm_paddr_t

--- 5 unchanged lines hidden (view full) ---

198 pa = (pa & ~(NBPDR - 1)) | (va & (NBPDR - 1));
199 } else {
200 pa = *vtopte(va);
201 pa = (pa & PG_FRAME) | (va & PAGE_MASK);
202 }
203 return pa;
204}
205
186
187/*
188 * Routine: pmap_kextract
189 * Function:
190 * Extract the physical page address associated
191 * kernel virtual address.
192 */
193static __inline vm_paddr_t

--- 5 unchanged lines hidden (view full) ---

199 pa = (pa & ~(NBPDR - 1)) | (va & (NBPDR - 1));
200 } else {
201 pa = *vtopte(va);
202 pa = (pa & PG_FRAME) | (va & PAGE_MASK);
203 }
204 return pa;
205}
206
206#define vtophys(va) pmap_kextract(((vm_offset_t) (va)))
207
208#ifdef PAE
209
210static __inline pt_entry_t
211pte_load(pt_entry_t *ptep)
212{
213 pt_entry_t r;
214
215 __asm __volatile(

--- 159 unchanged lines hidden ---
207#ifdef PAE
208
209static __inline pt_entry_t
210pte_load(pt_entry_t *ptep)
211{
212 pt_entry_t r;
213
214 __asm __volatile(

--- 159 unchanged lines hidden ---