Deleted Added
full compact
pmap.h (147671) pmap.h (153179)
1/*-
2 * Copyright (c) 2003 Peter Wemm.
3 * Copyright (c) 1991 Regents of the University of California.
4 * All rights reserved.
5 *
6 * This code is derived from software contributed to Berkeley by
7 * the Systems Programming Group of the University of Utah Computer
8 * Science Department and William Jolitz of UUNET Technologies Inc.

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

34 * Derived from hp300 version by Mike Hibler, this version by William
35 * Jolitz uses a recursive map [a pde points to the page directory] to
36 * map the page tables using the pagetables themselves. This is done to
37 * reduce the impact on kernel virtual memory for lots of sparse address
38 * space, and to reduce the cost of memory to each process.
39 *
40 * from: hp300: @(#)pmap.h 7.2 (Berkeley) 12/16/90
41 * from: @(#)pmap.h 7.4 (Berkeley) 5/12/91
1/*-
2 * Copyright (c) 2003 Peter Wemm.
3 * Copyright (c) 1991 Regents of the University of California.
4 * All rights reserved.
5 *
6 * This code is derived from software contributed to Berkeley by
7 * the Systems Programming Group of the University of Utah Computer
8 * Science Department and William Jolitz of UUNET Technologies Inc.

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

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

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

166#define PML4pml4e ((pd_entry_t *)(addr_PML4pml4e))
167
168extern u_int64_t KPML4phys; /* physical address of kernel level 4 */
169#endif
170
171#ifdef _KERNEL
172/*
173 * virtual address to page table entry and
50 * of the fields not present here and there, depending on a lot of things.
51 */
52 /* ---- Intel Nomenclature ---- */
53#define PG_V 0x001 /* P Valid */
54#define PG_RW 0x002 /* R/W Read/Write */
55#define PG_U 0x004 /* U/S User/Supervisor */
56#define PG_NC_PWT 0x008 /* PWT Write through */
57#define PG_NC_PCD 0x010 /* PCD Cache disable */

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

166#define PML4pml4e ((pd_entry_t *)(addr_PML4pml4e))
167
168extern u_int64_t KPML4phys; /* physical address of kernel level 4 */
169#endif
170
171#ifdef _KERNEL
172/*
173 * virtual address to page table entry and
174 * to physical address. Likewise for alternate address space.
174 * to physical address.
175 * Note: these work recursively, thus vtopte of a pte will give
176 * the corresponding pde that in turn maps it.
177 */
178pt_entry_t *vtopte(vm_offset_t);
175 * Note: these work recursively, thus vtopte of a pte will give
176 * the corresponding pde that in turn maps it.
177 */
178pt_entry_t *vtopte(vm_offset_t);
179vm_paddr_t pmap_kextract(vm_offset_t);
179#define vtophys(va) pmap_kextract((vm_offset_t)(va))
180
180
181#define vtophys(va) pmap_kextract(((vm_offset_t) (va)))
182
183static __inline pt_entry_t
184pte_load(pt_entry_t *ptep)
185{
186 pt_entry_t r;
187
188 r = *ptep;
189 return (r);
190}

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

286extern vm_offset_t virtual_avail;
287extern vm_offset_t virtual_end;
288
289#define pmap_page_is_mapped(m) (!TAILQ_EMPTY(&(m)->md.pv_list))
290
291void pmap_bootstrap(vm_paddr_t *);
292void pmap_kenter(vm_offset_t va, vm_paddr_t pa);
293void *pmap_kenter_temporary(vm_paddr_t pa, int i);
181static __inline pt_entry_t
182pte_load(pt_entry_t *ptep)
183{
184 pt_entry_t r;
185
186 r = *ptep;
187 return (r);
188}

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

284extern vm_offset_t virtual_avail;
285extern vm_offset_t virtual_end;
286
287#define pmap_page_is_mapped(m) (!TAILQ_EMPTY(&(m)->md.pv_list))
288
289void pmap_bootstrap(vm_paddr_t *);
290void pmap_kenter(vm_offset_t va, vm_paddr_t pa);
291void *pmap_kenter_temporary(vm_paddr_t pa, int i);
292vm_paddr_t pmap_kextract(vm_offset_t);
294void pmap_kremove(vm_offset_t);
295void *pmap_mapdev(vm_paddr_t, vm_size_t);
296void pmap_unmapdev(vm_offset_t, vm_size_t);
297void pmap_invalidate_page(pmap_t, vm_offset_t);
298void pmap_invalidate_range(pmap_t, vm_offset_t, vm_offset_t);
299void pmap_invalidate_all(pmap_t);
300
301#endif /* _KERNEL */
302
303#endif /* !LOCORE */
304
305#endif /* !_MACHINE_PMAP_H_ */
293void pmap_kremove(vm_offset_t);
294void *pmap_mapdev(vm_paddr_t, vm_size_t);
295void pmap_unmapdev(vm_offset_t, vm_size_t);
296void pmap_invalidate_page(pmap_t, vm_offset_t);
297void pmap_invalidate_range(pmap_t, vm_offset_t, vm_offset_t);
298void pmap_invalidate_all(pmap_t);
299
300#endif /* _KERNEL */
301
302#endif /* !LOCORE */
303
304#endif /* !_MACHINE_PMAP_H_ */