pmap.h (130399) | pmap.h (130573) |
---|---|
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 130399 2004-06-13 03:44:11Z alc $ | 41 * $FreeBSD: head/sys/i386/include/pmap.h 130573 2004-06-16 07:03:15Z alc $ |
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 49 * of the fields not present here and there, depending on a lot of things. --- 80 unchanged lines hidden (view full) --- 130/* 131 * XXX doesn't really belong here I guess... 132 */ 133#define ISA_HOLE_START 0xa0000 134#define ISA_HOLE_LENGTH (0x100000-ISA_HOLE_START) 135 136#ifndef LOCORE 137 | 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 49 * of the fields not present here and there, depending on a lot of things. --- 80 unchanged lines hidden (view full) --- 130/* 131 * XXX doesn't really belong here I guess... 132 */ 133#define ISA_HOLE_START 0xa0000 134#define ISA_HOLE_LENGTH (0x100000-ISA_HOLE_START) 135 136#ifndef LOCORE 137 |
138#include <sys/_lock.h> 139#include <sys/_mutex.h> |
|
138#include <sys/queue.h> 139 140#ifdef PAE 141 142typedef uint64_t pdpt_entry_t; 143typedef uint64_t pd_entry_t; 144typedef uint64_t pt_entry_t; 145 --- 125 unchanged lines hidden (view full) --- 271struct pv_entry; 272 273struct md_page { 274 int pv_list_count; 275 TAILQ_HEAD(,pv_entry) pv_list; 276}; 277 278struct pmap { | 140#include <sys/queue.h> 141 142#ifdef PAE 143 144typedef uint64_t pdpt_entry_t; 145typedef uint64_t pd_entry_t; 146typedef uint64_t pt_entry_t; 147 --- 125 unchanged lines hidden (view full) --- 273struct pv_entry; 274 275struct md_page { 276 int pv_list_count; 277 TAILQ_HEAD(,pv_entry) pv_list; 278}; 279 280struct pmap { |
281 struct mtx pm_mtx; |
|
279 pd_entry_t *pm_pdir; /* KVA of page directory */ 280 TAILQ_HEAD(,pv_entry) pm_pvlist; /* list of mappings in pmap */ 281 u_int pm_active; /* active on cpus */ 282 struct pmap_statistics pm_stats; /* pmap statistics */ 283 LIST_ENTRY(pmap) pm_list; /* List of all pmaps */ 284#ifdef PAE 285 pdpt_entry_t *pm_pdpt; /* KVA of page director pointer 286 table */ 287#endif 288}; 289 290typedef struct pmap *pmap_t; 291 292#ifdef _KERNEL 293extern struct pmap kernel_pmap_store; 294#define kernel_pmap (&kernel_pmap_store) | 282 pd_entry_t *pm_pdir; /* KVA of page directory */ 283 TAILQ_HEAD(,pv_entry) pm_pvlist; /* list of mappings in pmap */ 284 u_int pm_active; /* active on cpus */ 285 struct pmap_statistics pm_stats; /* pmap statistics */ 286 LIST_ENTRY(pmap) pm_list; /* List of all pmaps */ 287#ifdef PAE 288 pdpt_entry_t *pm_pdpt; /* KVA of page director pointer 289 table */ 290#endif 291}; 292 293typedef struct pmap *pmap_t; 294 295#ifdef _KERNEL 296extern struct pmap kernel_pmap_store; 297#define kernel_pmap (&kernel_pmap_store) |
298 299#define PMAP_LOCK(pmap) mtx_lock(&(pmap)->pm_mtx) 300#define PMAP_LOCK_ASSERT(pmap, type) \ 301 mtx_assert(&(pmap)->pm_mtx, (type)) 302#define PMAP_LOCK_DESTROY(pmap) mtx_destroy(&(pmap)->pm_mtx) 303#define PMAP_LOCK_INIT(pmap) mtx_init(&(pmap)->pm_mtx, "pmap", \ 304 NULL, MTX_DEF) 305#define PMAP_LOCKED(pmap) mtx_owned(&(pmap)->pm_mtx) 306#define PMAP_MTX(pmap) (&(pmap)->pm_mtx) 307#define PMAP_TRYLOCK(pmap) mtx_trylock(&(pmap)->pm_mtx) 308#define PMAP_UNLOCK(pmap) mtx_unlock(&(pmap)->pm_mtx) |
|
295#endif 296 297/* 298 * For each vm_page_t, there is a list of all currently valid virtual 299 * mappings of that page. An entry is a pv_entry_t, the list is pv_table. 300 */ 301typedef struct pv_entry { 302 pmap_t pv_pmap; /* pmap where mapping lies */ --- 45 unchanged lines hidden --- | 309#endif 310 311/* 312 * For each vm_page_t, there is a list of all currently valid virtual 313 * mappings of that page. An entry is a pv_entry_t, the list is pv_table. 314 */ 315typedef struct pv_entry { 316 pmap_t pv_pmap; /* pmap where mapping lies */ --- 45 unchanged lines hidden --- |