Changeset 0867321 in mainline
- Timestamp:
- 2009-02-02T18:06:15Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- cdda403
- Parents:
- 7b187ef
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
boot/arch/ppc32/loader/regname.h
r7b187ef r0867321 209 209 210 210 /* MSR bits */ 211 #define msr_ir (1 << 4) 212 #define msr_dr (1 << 5) 211 #define msr_dr (1 << 4) 212 #define msr_ir (1 << 5) 213 #define msr_pr (1 << 14) 213 214 #define msr_ee (1 << 15) 214 215 215 216 /* HID0 bits */ 217 #define hid0_sten (1 << 24) 216 218 #define hid0_ice (1 << 15) 217 219 #define hid0_dce (1 << 14) 218 220 #define hid0_icfi (1 << 11) 219 221 #define hid0_dci (1 << 10) 220 #define hid0_sten (1 << 7)221 222 222 223 #endif -
kernel/arch/ppc32/include/asm/regname.h
r7b187ef r0867321 212 212 #define dbat3u 542 213 213 #define dbat3l 543 214 #define tlbmiss 980 215 #define ptehi 981 216 #define ptelo 982 214 217 #define hid0 1008 215 218 … … 221 224 222 225 /* HID0 bits */ 226 #define hid0_sten (1 << 24) 223 227 #define hid0_ice (1 << 15) 224 228 #define hid0_dce (1 << 14) 225 229 #define hid0_icfi (1 << 11) 226 230 #define hid0_dci (1 << 10) 227 #define hid0_sten (1 << 7)228 231 229 232 #endif -
kernel/arch/ppc32/include/mm/tlb.h
r7b187ef r0867321 59 59 } phte_t; 60 60 61 typedef struct { 62 unsigned v : 1; 63 unsigned vsid : 24; 64 unsigned reserved0 : 1; 65 unsigned api : 6; 66 } ptehi_t; 67 68 typedef struct { 69 unsigned rpn : 20; 70 unsigned xpn : 3; 71 unsigned reserved0 : 1; 72 unsigned c : 1; 73 unsigned wimg : 4; 74 unsigned x : 1; 75 unsigned pp : 2; 76 } ptelo_t; 77 78 extern void pht_init(void); 61 79 extern void pht_refill(int n, istate_t *istate); 62 80 extern bool pht_refill_real(int n, istate_t *istate) __attribute__ ((section("K_UNMAPPED_TEXT_START"))); 63 extern void pht_init(void);81 extern void tlb_refill_real(int n, uint32_t tlbmiss, ptehi_t ptehi, ptelo_t ptelo, istate_t *istate) __attribute__ ((section("K_UNMAPPED_TEXT_START"))); 64 82 65 83 #endif -
kernel/arch/ppc32/src/exception.S
r7b187ef r0867321 209 209 .global exc_syscall 210 210 exc_syscall: 211 CONTEXT_STORE 211 CONTEXT_STORE 212 212 213 213 b jump_to_kernel_syscall … … 220 220 li r3, 12 221 221 b jump_to_kernel 222 223 .org 0x1000 224 .global exc_itlb_miss 225 exc_itlb_miss: 226 CONTEXT_STORE 227 228 b tlb_miss 229 230 .org 0x1100 231 .global exc_dtlb_miss_load 232 exc_dtlb_miss_load: 233 CONTEXT_STORE 234 235 b tlb_miss 236 237 .org 0x1200 238 .global exc_dtlb_miss_store 239 exc_dtlb_miss_store: 240 CONTEXT_STORE 241 242 b tlb_miss 222 243 223 244 .org 0x4000 … … 245 266 li r3, 3 246 267 b jump_to_kernel 268 269 tlb_miss: 270 li r3, 16 271 mfspr r4, tlbmiss 272 mfspr r5, ptehi 273 mfspr r6, ptelo 274 mr r7, sp 275 addi r7, r7, 20 276 277 bl tlb_refill_real 278 b iret_real 247 279 248 280 jump_to_kernel: -
kernel/arch/ppc32/src/mm/tlb.c
r7b187ef r0867321 228 228 229 229 230 /** Process Instruction/Data Storage Interrupt231 * 232 * @param n Interruptvector number.233 * @param istate 230 /** Process Instruction/Data Storage Exception 231 * 232 * @param n Exception vector number. 233 * @param istate Interrupted register context. 234 234 * 235 235 */ … … 288 288 289 289 290 /** Process Instruction/Data Storage Interruptin Real Mode291 * 292 * @param n Interruptvector number.293 * @param istate 290 /** Process Instruction/Data Storage Exception in Real Mode 291 * 292 * @param n Exception vector number. 293 * @param istate Interrupted register context. 294 294 * 295 295 */ … … 406 406 407 407 return true; 408 } 409 410 411 /** Process ITLB/DTLB Miss Exception in Real Mode 412 * 413 * 414 */ 415 void tlb_refill_real(int n, uint32_t tlbmiss, ptehi_t ptehi, ptelo_t ptelo, istate_t *istate) 416 { 417 uint32_t badvaddr = tlbmiss & 0xfffffffc; 418 419 uint32_t physmem; 420 asm volatile ( 421 "mfsprg3 %0\n" 422 : "=r" (physmem) 423 ); 424 425 if ((badvaddr < PA2KA(0)) || (badvaddr >= PA2KA(physmem))) 426 return; // FIXME 427 428 ptelo.rpn = KA2PA(badvaddr) >> 12; 429 ptelo.wimg = 0; 430 ptelo.pp = 2; // FIXME 431 432 uint32_t index = 0; 433 asm volatile ( 434 "mtspr 981, %0\n" 435 "mtspr 982, %1\n" 436 "tlbld %2\n" 437 "tlbli %2\n" 438 : "=r" (index) 439 : "r" (ptehi), 440 "r" (ptelo) 441 ); 408 442 } 409 443
Note:
See TracChangeset
for help on using the changeset viewer.