Changeset 849386a in mainline
- Timestamp:
- 2006-01-27T16:23:40Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 457d18a
- Parents:
- c2b95d3
- Location:
- arch/ia64
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
arch/ia64/include/mm/page.h
rc2b95d3 r849386a 47 47 48 48 /** Implementation of page hash table interface. */ 49 #define HT_ENTRIES_ARCH 050 #define HT_HASH_ARCH(page, asid) 049 #define HT_ENTRIES_ARCH (VHPT_SIZE/sizeof(pte_t)) 50 #define HT_HASH_ARCH(page, asid) vhpt_hash((page), (asid)) 51 51 #define HT_COMPARE_ARCH(page, asid, t) 0 52 52 #define HT_SLOT_EMPTY_ARCH(t) 1 … … 56 56 #define HT_SET_RECORD_ARCH(t, page, asid, frame, flags) 57 57 58 #define VRN_SHIFT 61 59 #define VRN_MASK (7LL << VRN_SHIFT) 60 58 61 #define VRN_KERNEL 0 62 #define VRN_WORK 1LL 59 63 #define REGION_REGISTERS 8 60 64 … … 198 202 __u64 ret; 199 203 200 //ASSERT(i < REGION_REGISTERS);204 ASSERT(i < REGION_REGISTERS); 201 205 __asm__ volatile ("mov %0 = rr[%1]\n" : "=r" (ret) : "r" (i)); 202 206 … … 212 216 static inline void rr_write(index_t i, __u64 v) 213 217 { 214 //ASSERT(i < REGION_REGISTERS);218 ASSERT(i < REGION_REGISTERS); 215 219 __asm__ volatile ("mov rr[%0] = %1\n" : : "r" (i), "r" (v)); 216 220 } … … 239 243 240 244 extern void page_arch_init(void); 245 extern pte_t *vhpt_hash(__address page, asid_t asid); 241 246 242 247 #endif -
arch/ia64/src/mm/page.c
rc2b95d3 r849386a 39 39 #include <arch/asm.h> 40 40 #include <arch/barrier.h> 41 #include <memstr.h> 41 42 42 43 /** Initialize VHPT and region registers. */ … … 67 68 68 69 rr.word == rr_read(i); 70 rr.map.ve = 0; /* disable VHPT walker */ 69 71 rr.map.rid = ASID_INVALID; 70 72 rr_write(i, rr.word); … … 77 79 */ 78 80 page_ht = (pte_t *) frame_alloc(FRAME_KA, VHPT_WIDTH - FRAME_WIDTH, NULL); 79 ht_invalidate_all(); 81 memsetb((__address) page_ht, VHPT_SIZE, 0); 82 ht_invalidate_all(); 80 83 81 84 /* … … 99 102 set_vhpt_environment(); 100 103 } 104 105 /** Calculate address of collision chain from VPN and ASID. 106 * 107 * This is rather non-trivial function. 108 * First, it has to translate ASID to RID. 109 * This is achieved by taking VRN bits of 110 * page into account. 111 * Second, it must preserve the region register 112 * it writes the RID to. 113 * 114 * @param page Address of virtual page including VRN bits. 115 * @param asid Address space identifier. 116 * 117 * @return Head of VHPT collision chain for page and asid. 118 */ 119 pte_t *vhpt_hash(__address page, asid_t asid) 120 { 121 region_register rr_save, rr; 122 pte_t *t; 123 124 rr_save.word = rr_read(VRN_WORK); 125 rr.word = rr_save.word; 126 if ((page >> VRN_SHIFT) != VRN_KERNEL) 127 rr.map.rid = (asid * RIDS_PER_ASID) + (page >> VRN_SHIFT); 128 else 129 rr.map.rid = ASID_KERNEL; 130 rr_write(VRN_WORK, rr.word); 131 srlz_i(); 132 t = (pte_t *) thash((VRN_WORK << VRN_SHIFT) | (~(VRN_MASK) & page)); 133 rr_write(VRN_WORK, rr_save.word); 134 srlz_i(); 135 srlz_d(); 136 137 return t; 138 }
Note:
See TracChangeset
for help on using the changeset viewer.