pmap.h (237168) | pmap.h (242121) |
---|---|
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 * --- 25 unchanged lines hidden (view full) --- 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 * from: i386 pmap.h,v 1.54 1997/11/20 19:30:35 bde Exp | 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 * --- 25 unchanged lines hidden (view full) --- 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 * from: i386 pmap.h,v 1.54 1997/11/20 19:30:35 bde Exp |
42 * $FreeBSD: head/sys/ia64/include/pmap.h 237168 2012-06-16 18:56:19Z alc $ | 42 * $FreeBSD: head/sys/ia64/include/pmap.h 242121 2012-10-26 03:02:39Z alc $ |
43 */ 44 45#ifndef _MACHINE_PMAP_H_ 46#define _MACHINE_PMAP_H_ 47 48#include <sys/queue.h> 49#include <sys/_lock.h> 50#include <sys/_mutex.h> --- 8 unchanged lines hidden (view full) --- 59#define vtophys(va) pmap_kextract((vm_offset_t)(va)) 60 61#endif /* _KERNEL */ 62 63/* 64 * Pmap stuff 65 */ 66struct pv_entry; | 43 */ 44 45#ifndef _MACHINE_PMAP_H_ 46#define _MACHINE_PMAP_H_ 47 48#include <sys/queue.h> 49#include <sys/_lock.h> 50#include <sys/_mutex.h> --- 8 unchanged lines hidden (view full) --- 59#define vtophys(va) pmap_kextract((vm_offset_t)(va)) 60 61#endif /* _KERNEL */ 62 63/* 64 * Pmap stuff 65 */ 66struct pv_entry; |
67struct pv_chunk; |
|
67 68struct md_page { | 68 69struct md_page { |
69 int pv_list_count; | |
70 TAILQ_HEAD(,pv_entry) pv_list; 71 vm_memattr_t memattr; 72}; 73 74struct pmap { 75 struct mtx pm_mtx; | 70 TAILQ_HEAD(,pv_entry) pv_list; 71 vm_memattr_t memattr; 72}; 73 74struct pmap { 75 struct mtx pm_mtx; |
76 TAILQ_HEAD(,pv_entry) pm_pvlist; /* list of mappings in pmap */ | 76 TAILQ_HEAD(,pv_chunk) pm_pvchunk; /* list of mappings in pmap */ |
77 uint32_t pm_rid[IA64_VM_MINKERN_REGION]; 78 struct pmap_statistics pm_stats; /* pmap statistics */ 79}; 80 81typedef struct pmap *pmap_t; 82 83#ifdef _KERNEL 84extern struct pmap kernel_pmap_store; --- 11 unchanged lines hidden (view full) --- 96#define PMAP_UNLOCK(pmap) mtx_unlock(&(pmap)->pm_mtx) 97#endif 98 99/* 100 * For each vm_page_t, there is a list of all currently valid virtual 101 * mappings of that page. An entry is a pv_entry_t, the list is pv_list. 102 */ 103typedef struct pv_entry { | 77 uint32_t pm_rid[IA64_VM_MINKERN_REGION]; 78 struct pmap_statistics pm_stats; /* pmap statistics */ 79}; 80 81typedef struct pmap *pmap_t; 82 83#ifdef _KERNEL 84extern struct pmap kernel_pmap_store; --- 11 unchanged lines hidden (view full) --- 96#define PMAP_UNLOCK(pmap) mtx_unlock(&(pmap)->pm_mtx) 97#endif 98 99/* 100 * For each vm_page_t, there is a list of all currently valid virtual 101 * mappings of that page. An entry is a pv_entry_t, the list is pv_list. 102 */ 103typedef struct pv_entry { |
104 pmap_t pv_pmap; /* pmap where mapping lies */ | |
105 vm_offset_t pv_va; /* virtual address for mapping */ 106 TAILQ_ENTRY(pv_entry) pv_list; | 104 vm_offset_t pv_va; /* virtual address for mapping */ 105 TAILQ_ENTRY(pv_entry) pv_list; |
107 TAILQ_ENTRY(pv_entry) pv_plist; | |
108} *pv_entry_t; 109 | 106} *pv_entry_t; 107 |
108/* 109 * pv_entries are allocated in chunks per-process. This avoids the 110 * need to track per-pmap assignments. 111 */ 112#define _NPCM 6 113#define _NPCPV 337 114struct pv_chunk { 115 pmap_t pc_pmap; 116 TAILQ_ENTRY(pv_chunk) pc_list; 117 u_long pc_map[_NPCM]; /* bitmap; 1 = free */ 118 TAILQ_ENTRY(pv_chunk) pc_lru; 119 u_long pc_spare[2]; 120 struct pv_entry pc_pventry[_NPCPV]; 121}; 122 |
|
110#ifdef _KERNEL 111 112extern vm_paddr_t phys_avail[]; 113extern vm_offset_t virtual_avail; 114extern vm_offset_t virtual_end; 115 116extern uint64_t pmap_vhpt_base[]; 117extern int pmap_vhpt_log2size; --- 22 unchanged lines hidden --- | 123#ifdef _KERNEL 124 125extern vm_paddr_t phys_avail[]; 126extern vm_offset_t virtual_avail; 127extern vm_offset_t virtual_end; 128 129extern uint64_t pmap_vhpt_base[]; 130extern int pmap_vhpt_log2size; --- 22 unchanged lines hidden --- |