Changeset a0d74fd in mainline for arch/ia64/src
- Timestamp:
- 2006-03-01T11:07:04Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 9ad03fe
- Parents:
- 2c49fbbe
- Location:
- arch/ia64/src
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
arch/ia64/src/dummy.s
r2c49fbbe ra0d74fd 32 32 .global asm_delay_loop 33 33 .global userspace 34 .global before_thread_runs_arch35 .global after_thread_ran_arch36 34 .global cpu_sleep 37 35 .global dummy … … 40 38 .global fpu_init 41 39 42 before_thread_runs_arch:43 after_thread_ran_arch:44 40 userspace: 45 41 calibrate_delay_loop: -
arch/ia64/src/mm/page.c
r2c49fbbe ra0d74fd 56 56 void set_environment(void) 57 57 { 58 59 58 region_register rr; 60 59 pta_register pta; … … 63 62 /* 64 63 * First set up kernel region register. 65 * This action is redundand (see start.S) but I would to keep it to make sure that 66 *no unexpected changes will be made. 64 * This is redundant (see start.S) but we keep it here just for sure. 67 65 */ 68 66 rr.word = rr_read(VRN_KERNEL); 69 67 rr.map.ve = 0; /* disable VHPT walker */ 70 68 rr.map.ps = PAGE_WIDTH; 71 rr.map.rid = ASID2RID(ASID_KERNEL, VRN_KERNEL);69 rr.map.rid = ASID2RID(ASID_KERNEL, VRN_KERNEL); 72 70 rr_write(VRN_KERNEL, rr.word); 73 71 srlz_i(); 74 72 srlz_d(); 75 73 76 74 /* 77 75 * And invalidate the rest of region register. … … 84 82 rr.word == rr_read(i); 85 83 rr.map.ve = 0; /* disable VHPT walker */ 86 rr.map.rid = ASID2RID(ASID_INVALID,i);84 rr.map.rid = RID_INVALID; 87 85 rr_write(i, rr.word); 88 86 srlz_i(); … … 101 99 srlz_i(); 102 100 srlz_d(); 103 104 105 return ;106 107 101 } 108 102 -
arch/ia64/src/mm/tlb.c
r2c49fbbe ra0d74fd 32 32 33 33 #include <mm/tlb.h> 34 #include <mm/asid.h> 34 35 #include <arch/mm/tlb.h> 36 #include <arch/mm/page.h> 35 37 #include <arch/barrier.h> 36 38 #include <arch/interrupt.h> 37 39 #include <typedefs.h> 38 40 #include <panic.h> 41 #include <print.h> 39 42 40 43 /** Invalidate all TLB entries. */ … … 85 88 bool restore_rr = false; 86 89 87 if (!(entry. not_present.p))90 if (!(entry.p)) 88 91 return; 89 92 90 rr.word = rr_read(VA _REGION(va));91 if ((restore_rr = (rr.map.rid != ASID2RID(asid, VA _REGION(va))))) {93 rr.word = rr_read(VA2VRN(va)); 94 if ((restore_rr = (rr.map.rid != ASID2RID(asid, VA2VRN(va))))) { 92 95 /* 93 96 * The selected region register does not contain required RID. … … 97 100 98 101 rr0 = rr; 99 rr0.map.rid = ASID2RID(asid, VA _REGION(va));100 rr_write(VA _REGION(va), rr0.word);102 rr0.map.rid = ASID2RID(asid, VA2VRN(va)); 103 rr_write(VA2VRN(va), rr0.word); 101 104 srlz_d(); 102 105 srlz_i(); … … 121 124 122 125 if (restore_rr) { 123 rr_write(VA _REGION(va),rr.word);126 rr_write(VA2VRN(va), rr.word); 124 127 srlz_d(); 125 128 srlz_i(); … … 164 167 bool restore_rr = false; 165 168 166 if (!(entry. not_present.p))169 if (!(entry.p)) 167 170 return; 168 171 169 rr.word = rr_read(VA _REGION(va));170 if ((restore_rr = (rr.map.rid != ASID2RID(asid, VA _REGION(va))))) {172 rr.word = rr_read(VA2VRN(va)); 173 if ((restore_rr = (rr.map.rid != ASID2RID(asid, VA2VRN(va))))) { 171 174 /* 172 175 * The selected region register does not contain required RID. … … 176 179 177 180 rr0 = rr; 178 rr0.map.rid = ASID2RID(asid, VA _REGION(va));179 rr_write(VA _REGION(va), rr0.word);181 rr0.map.rid = ASID2RID(asid, VA2VRN(va)); 182 rr_write(VA2VRN(va), rr0.word); 180 183 srlz_d(); 181 184 srlz_i(); … … 200 203 201 204 if (restore_rr) { 202 rr_write(VA_REGION(va),rr.word); 203 srlz_d(); 204 srlz_i(); 205 } 205 rr_write(VA2VRN(va), rr.word); 206 srlz_d(); 207 srlz_i(); 208 } 209 } 210 211 /** Insert data into DTLB. 212 * 213 * @param va Virtual page address. 214 * @param asid Address space identifier. 215 * @param entry The rest of TLB entry as required by TLB insertion format. 216 * @param dtr If true, insert into data translation register, use data translation cache otherwise. 217 * @param tr Translation register if dtr is true, ignored otherwise. 218 */ 219 void dtlb_mapping_insert(__address page, __address frame, bool dtr, index_t tr) 220 { 221 tlb_entry_t entry; 222 223 entry.word[0] = 0; 224 entry.word[1] = 0; 225 226 entry.p = true; /* present */ 227 entry.ma = MA_WRITEBACK; 228 entry.a = true; /* already accessed */ 229 entry.d = true; /* already dirty */ 230 entry.pl = PL_KERNEL; 231 entry.ar = AR_READ | AR_WRITE; 232 entry.ppn = frame >> PPN_SHIFT; 233 entry.ps = PAGE_WIDTH; 234 235 if (dtr) 236 dtr_mapping_insert(page, ASID_KERNEL, entry, tr); 237 else 238 dtc_mapping_insert(page, ASID_KERNEL, entry); 206 239 } 207 240 … … 211 244 } 212 245 246 /** Data TLB fault with VHPT turned off. 247 * 248 * @param vector Interruption vector. 249 * @param pstate Structure with saved interruption state. 250 */ 213 251 void alternate_data_tlb_fault(__u64 vector, struct exception_regdump *pstate) 214 252 { 215 panic("%s: %P\n", __FUNCTION__, pstate->cr_ifa); 253 region_register rr; 254 rid_t rid; 255 __address va; 256 257 va = pstate->cr_ifa; /* faulting address */ 258 rr.word = rr_read(VA2VRN(va)); 259 rid = rr.map.rid; 260 if (RID2ASID(rid) == ASID_KERNEL) { 261 if (VA2VRN(va) == VRN_KERNEL) { 262 /* 263 * Provide KA2PA(identity) mapping for faulting piece of 264 * kernel address space. 265 */ 266 dtlb_mapping_insert(va, KA2PA(va), false, 0); 267 return; 268 } 269 } 270 panic("%s: va=%P, rid=%d\n", __FUNCTION__, pstate->cr_ifa, rr.map.rid); 216 271 } 217 272 -
arch/ia64/src/start.S
r2c49fbbe ra0d74fd 53 53 movl r10=(RR_MASK) 54 54 and r9=r10,r9 55 movl r10=(( ASID2RID(ASID_KERNEL,VRN_KERNEL)<<RID_SHIFT)|(KERNEL_PAGE_WIDTH<<PS_SHIFT))55 movl r10=((RID_KERNEL<<RID_SHIFT)|(KERNEL_PAGE_WIDTH<<PS_SHIFT)) 56 56 or r9=r10,r9 57 57 mov rr[r8]=r9
Note:
See TracChangeset
for help on using the changeset viewer.