--- zzzz-none-000/linux-2.6.13.1/arch/mips/mm/tlbex.c 2005-09-10 02:42:58.000000000 +0000 +++ ohio-7170-487/linux-2.6.13.1/arch/mips/mm/tlbex.c 2006-11-06 16:02:03.000000000 +0000 @@ -25,7 +25,7 @@ #include #include -/* #define DEBUG_TLB */ +/*--- #define DEBUG_TLB ---*/ static __init int __attribute__((unused)) r45k_bvahwbug(void) { @@ -170,7 +170,7 @@ static __init u32 build_rs(u32 arg) { if (arg & ~RS_MASK) - printk(KERN_WARNING "TLB synthesizer field overflow\n"); + printk(KERN_WARNING "TLB synthesizer field overflow (rs)\n"); return (arg & RS_MASK) << RS_SH; } @@ -178,7 +178,7 @@ static __init u32 build_rt(u32 arg) { if (arg & ~RT_MASK) - printk(KERN_WARNING "TLB synthesizer field overflow\n"); + printk(KERN_WARNING "TLB synthesizer field overflow (rt)\n"); return (arg & RT_MASK) << RT_SH; } @@ -186,7 +186,7 @@ static __init u32 build_rd(u32 arg) { if (arg & ~RD_MASK) - printk(KERN_WARNING "TLB synthesizer field overflow\n"); + printk(KERN_WARNING "TLB synthesizer field overflow (rd)\n"); return (arg & RD_MASK) << RD_SH; } @@ -194,7 +194,7 @@ static __init u32 build_re(u32 arg) { if (arg & ~RE_MASK) - printk(KERN_WARNING "TLB synthesizer field overflow\n"); + printk(KERN_WARNING "TLB synthesizer field overflow (re)\n"); return (arg & RE_MASK) << RE_SH; } @@ -202,7 +202,7 @@ static __init u32 build_simm(s32 arg) { if (arg > 0x7fff || arg < -0x8000) - printk(KERN_WARNING "TLB synthesizer field overflow\n"); + printk(KERN_WARNING "TLB synthesizer field overflow (simm)\n"); return arg & 0xffff; } @@ -210,7 +210,7 @@ static __init u32 build_uimm(u32 arg) { if (arg & ~IMM_MASK) - printk(KERN_WARNING "TLB synthesizer field overflow\n"); + printk(KERN_WARNING "TLB synthesizer field overflow (uimm)\n"); return arg & IMM_MASK; } @@ -218,10 +218,10 @@ static __init u32 build_bimm(s32 arg) { if (arg > 0x1ffff || arg < -0x20000) - printk(KERN_WARNING "TLB synthesizer field overflow\n"); + printk(KERN_WARNING "TLB synthesizer field overflow (bimm)\n"); if (arg & 0x3) - printk(KERN_WARNING "Invalid TLB synthesizer branch target\n"); + printk(KERN_WARNING "Invalid TLB synthesizer branch target (bimm)\n"); return ((arg < 0) ? (1 << 15) : 0) | ((arg >> 2) & 0x7fff); } @@ -229,7 +229,7 @@ static __init u32 build_jimm(u32 arg) { if (arg & ~((JIMM_MASK) << 2)) - printk(KERN_WARNING "TLB synthesizer field overflow\n"); + printk(KERN_WARNING "TLB synthesizer field overflow (jimm)\n"); return (arg >> 2) & JIMM_MASK; } @@ -237,7 +237,7 @@ static __init u32 build_func(u32 arg) { if (arg & ~FUNC_MASK) - printk(KERN_WARNING "TLB synthesizer field overflow\n"); + printk(KERN_WARNING "TLB synthesizer field overflow (func)\n"); return arg & FUNC_MASK; } @@ -734,14 +734,14 @@ if (p > tlb_handler + 32) panic("TLB refill handler space exceeded"); - printk("Synthesized TLB handler (%u instructions).\n", - (unsigned int)(p - tlb_handler)); + printk("Synthesized TLB handler (%u instructions). base=0x%p\n", + (unsigned int)(p - tlb_handler), tlb_handler); #ifdef DEBUG_TLB { int i; for (i = 0; i < (p - tlb_handler); i++) - printk("%08x\n", tlb_handler[i]); + printk("0x%08x: %08x\n", CAC_BASE + 0x80 + (4 * i), tlb_handler[i]); } #endif @@ -1238,15 +1238,15 @@ #endif /* CONFIG_MIPS64 */ resolve_relocs(relocs, labels); - printk("Synthesized TLB refill handler (%u instructions).\n", - final_len); + printk("Synthesized TLB refill handler (%u instructions). Base=0x%p\n", + final_len, final_handler); #ifdef DEBUG_TLB { int i; for (i = 0; i < 64; i++) - printk("%08x\n", final_handler[i]); + printk("0x%08x: %08x\n", CAC_BASE + (4 * i), final_handler[i]); } #endif @@ -1492,22 +1492,31 @@ build_r3000_tlbchange_handler_tail(&p, K0); l_nopage_tlbl(&l, p); +#if defined(CONFIG_MIPS_OHIO) || defined(CONFIG_MIPS_AR7) || defined(CONFIG_MIPS_UR8) + i_lui(&p, K0, (unsigned short)((unsigned int)tlb_do_page_fault_0 >> 16)); + i_ori(&p, K0, K0, ((unsigned short)tlb_do_page_fault_0)); + i_jr(&p, K0); +#else /*--- #if defined(CONFIG_MIPS_OHIO) || defined(CONFIG_MIPS_AR7) || defined(CONFIG_MIPS_UR8) ---*/ i_j(&p, (unsigned long)tlb_do_page_fault_0 & 0x0fffffff); +#endif /*--- #else ---*/ /*--- #if defined(CONFIG_MIPS_OHIO) || defined(CONFIG_MIPS_AR7) || defined(CONFIG_MIPS_UR8) ---*/ i_nop(&p); if ((p - handle_tlbl) > FASTPATH_SIZE) panic("TLB load handler fastpath space exceeded"); resolve_relocs(relocs, labels); - printk("Synthesized TLB load handler fastpath (%u instructions).\n", - (unsigned int)(p - handle_tlbl)); + printk("Synthesized TLB load handler fastpath (%u instructions) Base=0x%p.\n", + (unsigned int)(p - handle_tlbl), handle_tlbl); #ifdef DEBUG_TLB { int i; - for (i = 0; i < FASTPATH_SIZE; i++) + for (i = 0; i < FASTPATH_SIZE; i++) { printk("%08x\n", handle_tlbl[i]); + if(handle_tlbl[i] == 0 && handle_tlbl[i + 1] == 0) + break; + } } #endif @@ -1533,22 +1542,31 @@ build_r3000_tlbchange_handler_tail(&p, K0); l_nopage_tlbs(&l, p); +#if defined(CONFIG_MIPS_OHIO) || defined(CONFIG_MIPS_AR7) || defined(CONFIG_MIPS_UR8) + i_lui(&p, K0, (unsigned short)((unsigned int)tlb_do_page_fault_0 >> 16)); + i_ori(&p, K0, K0, ((unsigned short)tlb_do_page_fault_1)); + i_jr(&p, K0); +#else /*--- #if defined(CONFIG_MIPS_OHIO) || defined(CONFIG_MIPS_AR7) || defined(CONFIG_MIPS_UR8) ---*/ i_j(&p, (unsigned long)tlb_do_page_fault_1 & 0x0fffffff); +#endif /*--- #else ---*/ /*--- #if defined(CONFIG_MIPS_OHIO) || defined(CONFIG_MIPS_AR7) || defined(CONFIG_MIPS_UR8) ---*/ i_nop(&p); if ((p - handle_tlbs) > FASTPATH_SIZE) panic("TLB store handler fastpath space exceeded"); resolve_relocs(relocs, labels); - printk("Synthesized TLB store handler fastpath (%u instructions).\n", - (unsigned int)(p - handle_tlbs)); + printk("Synthesized TLB store handler fastpath (%u instructions) Base=0x%p.\n", + (unsigned int)(p - handle_tlbs), handle_tlbs); #ifdef DEBUG_TLB { int i; - for (i = 0; i < FASTPATH_SIZE; i++) + for (i = 0; i < FASTPATH_SIZE; i++) { printk("%08x\n", handle_tlbs[i]); + if(handle_tlbs[i] == 0 && handle_tlbs[i + 1] == 0) + break; + } } #endif @@ -1574,22 +1592,31 @@ build_r3000_tlbchange_handler_tail(&p, K0); l_nopage_tlbm(&l, p); +#if defined(CONFIG_MIPS_OHIO) || defined(CONFIG_MIPS_AR7) || defined(CONFIG_MIPS_UR8) + i_lui(&p, K0, (unsigned short)((unsigned int)tlb_do_page_fault_1 >> 16)); + i_ori(&p, K0, K0, ((unsigned short)tlb_do_page_fault_1)); + i_jr(&p, K0); +#else /*--- #if defined(CONFIG_MIPS_OHIO) || defined(CONFIG_MIPS_AR7) || defined(CONFIG_MIPS_UR8) ---*/ i_j(&p, (unsigned long)tlb_do_page_fault_1 & 0x0fffffff); +#endif /*--- #else ---*/ /*--- #if defined(CONFIG_MIPS_OHIO) || defined(CONFIG_MIPS_AR7) || defined(CONFIG_MIPS_UR8) ---*/ i_nop(&p); if ((p - handle_tlbm) > FASTPATH_SIZE) panic("TLB modify handler fastpath space exceeded"); resolve_relocs(relocs, labels); - printk("Synthesized TLB modify handler fastpath (%u instructions).\n", - (unsigned int)(p - handle_tlbm)); + printk("Synthesized TLB modify handler fastpath (%u instructions) Base=0x%p.\n", + (unsigned int)(p - handle_tlbm), handle_tlbm); #ifdef DEBUG_TLB { int i; - for (i = 0; i < FASTPATH_SIZE; i++) + for (i = 0; i < FASTPATH_SIZE; i++) { printk("%08x\n", handle_tlbm[i]); + if(handle_tlbm[i] == 0 && handle_tlbm[i + 1] == 0) + break; + } } #endif @@ -1666,22 +1693,31 @@ build_r4000_tlbchange_handler_tail(&p, &l, &r, K0, K1); l_nopage_tlbl(&l, p); +#if defined(CONFIG_MIPS_OHIO) || defined(CONFIG_MIPS_AR7) || defined(CONFIG_MIPS_UR8) + i_lui(&p, K0, (unsigned short)((unsigned int)tlb_do_page_fault_0 >> 16)); + i_ori(&p, K0, K0, ((unsigned short)tlb_do_page_fault_0)); + i_jr(&p, K0); +#else /*--- #if defined(CONFIG_MIPS_OHIO) || defined(CONFIG_MIPS_AR7) || defined(CONFIG_MIPS_UR8) ---*/ i_j(&p, (unsigned long)tlb_do_page_fault_0 & 0x0fffffff); +#endif /*--- #else ---*/ /*--- #if defined(CONFIG_MIPS_OHIO) || defined(CONFIG_MIPS_AR7) || defined(CONFIG_MIPS_UR8) ---*/ i_nop(&p); if ((p - handle_tlbl) > FASTPATH_SIZE) panic("TLB load handler fastpath space exceeded"); resolve_relocs(relocs, labels); - printk("Synthesized TLB load handler fastpath (%u instructions).\n", - (unsigned int)(p - handle_tlbl)); + printk("Synthesized TLB load handler fastpath (%u instructions) Base=0x%p.\n", + (unsigned int)(p - handle_tlbl), handle_tlbl); #ifdef DEBUG_TLB { int i; - for (i = 0; i < FASTPATH_SIZE; i++) + for (i = 0; i < FASTPATH_SIZE; i++) { printk("%08x\n", handle_tlbl[i]); + if(handle_tlbl[i] == 0 && handle_tlbl[i + 1] == 0) + break; + } } #endif @@ -1705,22 +1741,31 @@ build_r4000_tlbchange_handler_tail(&p, &l, &r, K0, K1); l_nopage_tlbs(&l, p); +#if defined(CONFIG_MIPS_OHIO) || defined(CONFIG_MIPS_AR7) || defined(CONFIG_MIPS_UR8) + i_lui(&p, K0, (unsigned short)((unsigned int)tlb_do_page_fault_1 >> 16)); + i_ori(&p, K0, K0, ((unsigned short)tlb_do_page_fault_1)); + i_jr(&p, K0); +#else /*--- #if defined(CONFIG_MIPS_OHIO) || defined(CONFIG_MIPS_AR7) || defined(CONFIG_MIPS_UR8) ---*/ i_j(&p, (unsigned long)tlb_do_page_fault_1 & 0x0fffffff); +#endif /*--- #else ---*/ /*--- #if defined(CONFIG_MIPS_OHIO) || defined(CONFIG_MIPS_AR7) || defined(CONFIG_MIPS_UR8) ---*/ i_nop(&p); if ((p - handle_tlbs) > FASTPATH_SIZE) panic("TLB store handler fastpath space exceeded"); resolve_relocs(relocs, labels); - printk("Synthesized TLB store handler fastpath (%u instructions).\n", - (unsigned int)(p - handle_tlbs)); + printk("Synthesized TLB store handler fastpath (%u instructions) Base=0x%p.\n", + (unsigned int)(p - handle_tlbs), handle_tlbs); #ifdef DEBUG_TLB { int i; - for (i = 0; i < FASTPATH_SIZE; i++) + for (i = 0; i < FASTPATH_SIZE; i++) { printk("%08x\n", handle_tlbs[i]); + if(handle_tlbs[i] == 0 && handle_tlbs[i + 1] == 0) + break; + } } #endif @@ -1745,22 +1790,31 @@ build_r4000_tlbchange_handler_tail(&p, &l, &r, K0, K1); l_nopage_tlbm(&l, p); +#if defined(CONFIG_MIPS_OHIO) || defined(CONFIG_MIPS_AR7) || defined(CONFIG_MIPS_UR8) + i_lui(&p, K0, (unsigned short)((unsigned int)tlb_do_page_fault_1 >> 16)); + i_ori(&p, K0, K0, ((unsigned short)tlb_do_page_fault_1)); + i_jr(&p, K0); +#else /*--- #if defined(CONFIG_MIPS_OHIO) || defined(CONFIG_MIPS_AR7) || defined(CONFIG_MIPS_UR8) ---*/ i_j(&p, (unsigned long)tlb_do_page_fault_1 & 0x0fffffff); +#endif /*--- #else ---*/ /*--- #if defined(CONFIG_MIPS_OHIO) || defined(CONFIG_MIPS_AR7) || defined(CONFIG_MIPS_UR8) ---*/ i_nop(&p); if ((p - handle_tlbm) > FASTPATH_SIZE) panic("TLB modify handler fastpath space exceeded"); resolve_relocs(relocs, labels); - printk("Synthesized TLB modify handler fastpath (%u instructions).\n", - (unsigned int)(p - handle_tlbm)); + printk("Synthesized TLB modify handler fastpath (%u instructions) Base=0x%p.\n", + (unsigned int)(p - handle_tlbm), handle_tlbm); #ifdef DEBUG_TLB { int i; - for (i = 0; i < FASTPATH_SIZE; i++) + for (i = 0; i < FASTPATH_SIZE; i++) { printk("%08x\n", handle_tlbm[i]); + if(handle_tlbm[i] == 0 && handle_tlbm[i + 1] == 0) + break; + } } #endif