summaryrefslogtreecommitdiffstats
path: root/arch/mips64/kernel/r4k_tlb_debug.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>1999-12-04 03:58:56 +0000
committerRalf Baechle <ralf@linux-mips.org>1999-12-04 03:58:56 +0000
commit1d67e90f19a7acfd9a05dc59678e7d0c5090bd0d (patch)
tree357efc7b93f8f5102110d20d293f41360ec212fc /arch/mips64/kernel/r4k_tlb_debug.c
parentaea27b2e18d69af87e673972246e66657b4fa274 (diff)
Merge with Linux 2.3.21.
Diffstat (limited to 'arch/mips64/kernel/r4k_tlb_debug.c')
-rw-r--r--arch/mips64/kernel/r4k_tlb_debug.c90
1 files changed, 90 insertions, 0 deletions
diff --git a/arch/mips64/kernel/r4k_tlb_debug.c b/arch/mips64/kernel/r4k_tlb_debug.c
new file mode 100644
index 000000000..f14725189
--- /dev/null
+++ b/arch/mips64/kernel/r4k_tlb_debug.c
@@ -0,0 +1,90 @@
+/* $Id: r4k_tlb_debug.c,v 1.6 1999/11/23 17:12:49 ralf Exp $
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License. See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (C) 1999 Ralf Baechle
+ * Copyright (C) 1999 Silicon Graphics, Inc.
+ */
+#include <linux/linkage.h>
+#include <linux/kernel.h>
+#include <linux/sched.h>
+#include <linux/mm.h>
+#include <asm/page.h>
+#include <asm/pgtable.h>
+#include <asm/ptrace.h>
+#include <asm/system.h>
+
+asmlinkage void tlb_refill_debug(struct pt_regs regs)
+{
+ show_regs(&regs);
+ panic(__FUNCTION__ " called. This Does Not Happen (TM).");
+}
+
+asmlinkage void xtlb_refill_debug(struct pt_regs *regs)
+{
+ unsigned long addr;
+ pgd_t *pgd;
+ pmd_t *pmd;
+ pte_t *pte;
+
+ addr = regs->cp0_badvaddr & ~((PAGE_SIZE << 1) - 1);
+ pgd = pgd_offset(current->active_mm, addr);
+ pmd = pmd_offset(pgd, addr);
+ pte = pte_offset(pmd, addr);
+
+ set_entrylo0(pte_val(pte[0]) >> 6);
+ set_entrylo1(pte_val(pte[1]) >> 6);
+ __asm__ __volatile__("nop;nop;nop");
+
+ tlb_write_random();
+}
+
+asmlinkage void xtlb_mod_debug(struct pt_regs *regs)
+{
+ show_regs(regs);
+ panic(__FUNCTION__ " called.");
+}
+
+asmlinkage void xtlb_tlbl_debug(struct pt_regs *regs)
+{
+ unsigned long addr;
+
+ addr = regs->cp0_badvaddr;
+#if 0
+ printk(__FUNCTION__ " called.\n");
+ show_regs(regs);
+ printk("TLB Dump:\n");
+ dump_tlb_all();
+ printk("c0_badvaddr = %08lx\n", addr);
+#endif
+ do_page_fault(regs, 0, addr);
+
+#if 0
+ printk("TLB Dump:\n");
+ dump_tlb_all();
+ printk("\n");
+#endif
+}
+
+asmlinkage void xtlb_tlbs_debug(struct pt_regs *regs)
+{
+ unsigned long addr;
+
+ addr = regs->cp0_badvaddr;
+#if 0
+ printk(__FUNCTION__ " called.\n");
+ show_regs(regs);
+ printk("TLB Dump:\n");
+ dump_tlb_all();
+ printk("c0_badvaddr = %08lx\n", addr);
+#endif
+ do_page_fault(regs, 1, addr);
+
+#if 0
+ printk("TLB Dump:\n");
+ dump_tlb_all();
+ printk("\n");
+#endif
+}