From: NIIBE Y. <gn...@ch...> - 2000-04-30 04:40:19
|
While chasing the bug which stops SH-4 running, I've found two more bugs. But this doesn't fix my problem... I'll commit this tomorrow. Index: ChangeLog =================================================================== RCS file: /cvsroot/linuxsh/kernel/ChangeLog,v retrieving revision 1.11 diff -u -r1.11 ChangeLog --- ChangeLog 2000/04/30 00:51:08 1.11 +++ ChangeLog 2000/04/30 03:45:38 @@ -1,3 +1,11 @@ +2000-04-30 NIIBE Yutaka <gn...@m1...> + + * arch/sh/mm/fault.c (update_mmu_cache): Bug fix. We need to + flush ITLB. + + * arch/sh/kernel/time.c (time_init): Bug fix. The interval + should depend on HZ. + 2000-04-29 NIIBE Yutaka <gn...@m1...> * arch/sh/mm/cache.c (flush_cache_all): Don't touch CCR. Index: arch/sh/kernel/time.c =================================================================== RCS file: /cvsroot/linuxsh/kernel/arch/sh/kernel/time.c,v retrieving revision 1.4 diff -u -r1.4 time.c --- arch/sh/kernel/time.c 2000/04/28 17:58:50 1.4 +++ arch/sh/kernel/time.c 2000/04/30 03:45:39 @@ -436,7 +436,7 @@ module_clock = master_clock/pfc; printk("Module clock: %d.%02dMHz\n", (module_clock/1000000), (module_clock % 1000000)/10000); - interval = (module_clock/400); + interval = (module_clock/(HZ*4)); printk("Interval = %ld\n", interval); Index: arch/sh/mm/fault.c =================================================================== RCS file: /cvsroot/linuxsh/kernel/arch/sh/mm/fault.c,v retrieving revision 1.7 diff -u -r1.7 fault.c --- arch/sh/mm/fault.c 2000/04/30 00:50:23 1.7 +++ arch/sh/mm/fault.c 2000/04/30 03:45:39 @@ -261,18 +261,24 @@ unsigned long pteaddr; save_and_cli(flags); +#if defined(__SH4__) /* - * We don't need to set PTEH register. - * It's automatically set by the hardware. + * ITLB is not affected by "ldtlb" instruction. + * So, we need to flush the entry by ourselves. */ + __flush_tlb_page(vma->vm_mm, address&PAGE_MASK); +#endif + + /* Set PTEH register */ + pteaddr = (address & MMU_VPN_MASK) | + (vma->vm_mm->context & MMU_CONTEXT_ASID_MASK); + ctrl_outl(pteaddr, MMU_PTEH); + + /* Set PTEL register */ pteval = pte_val(pte); pteval &= _PAGE_FLAGS_HARDWARE_MASK; /* drop software flags */ pteval |= _PAGE_FLAGS_HARDWARE_DEFAULT; /* add default flags */ - /* Set PTEL register */ ctrl_outl(pteval, MMU_PTEL); - /* Set PTEH register */ - pteaddr = (address & MMU_VPN_MASK) | (vma->vm_mm->context & MMU_CONTEXT_ASID_MASK); - ctrl_outl(pteaddr, MMU_PTEH); /* Load the TLB */ asm volatile("ldtlb": /* no output */ : /* no input */ : "memory"); Bug fix for standard kernel. -------------------------------------- Index: fs/super.c =================================================================== RCS file: /cvsroot/linuxsh/kernel/fs/super.c,v retrieving revision 1.1.1.6 diff -u -r1.1.1.6 super.c --- fs/super.c 2000/04/29 15:46:02 1.1.1.6 +++ fs/super.c 2000/04/30 03:45:40 @@ -1562,7 +1562,7 @@ } ROOT_DEV = new_root_dev; mount_root(); -#if 1 +#if 0 shrink_dcache(); printk("change_root: old root has d_count=%d\n", old_root->d_count); #endif Index: mm/vmscan.c =================================================================== RCS file: /cvsroot/linuxsh/kernel/mm/vmscan.c,v retrieving revision 1.1.1.3 diff -u -r1.1.1.3 vmscan.c --- mm/vmscan.c 2000/04/29 15:46:04 1.1.1.3 +++ mm/vmscan.c 2000/04/30 03:45:48 @@ -388,7 +388,7 @@ continue; /* small processes are swapped out less */ while ((mm->swap_cnt << 2 * (i + 1) < max_cnt) - && i++ < 10) + && i++ < 10); mm->swap_cnt >>= i; mm->swap_cnt += i; /* if swap_cnt reaches 0 */ /* we're big -> hog treatment */ |