diff options
author | Harald Koerfgen <hkoerfg@web.de> | 1999-10-12 17:33:49 +0000 |
---|---|---|
committer | Harald Koerfgen <hkoerfg@web.de> | 1999-10-12 17:33:49 +0000 |
commit | f20726c6656eb8412fafe93d7e42bef64819bb99 (patch) | |
tree | 1bb272e9142f126b49fdb26a80d7051eeb6b7e6e /arch | |
parent | d6434e1042f3b0a6dfe1b1f615af369486f9b1fa (diff) |
o R3000 fixes
o moved to original 2.3.19 NCR53C9x driver
o CONFIG_ULTRIX_PARTION is working again and now big endian proof
Diffstat (limited to 'arch')
-rw-r--r-- | arch/mips/kernel/r2300_switch.S | 6 | ||||
-rw-r--r-- | arch/mips/lib/Makefile | 10 | ||||
-rw-r--r-- | arch/mips/lib/r3k_dump_tlb.c | 185 | ||||
-rw-r--r-- | arch/mips/mm/r2300.c | 4 |
4 files changed, 196 insertions, 9 deletions
diff --git a/arch/mips/kernel/r2300_switch.S b/arch/mips/kernel/r2300_switch.S index 710345c00..c94037a24 100644 --- a/arch/mips/kernel/r2300_switch.S +++ b/arch/mips/kernel/r2300_switch.S @@ -1,4 +1,4 @@ -/* $Id: r2300_switch.S,v 1.7 1999/08/09 19:43:14 harald Exp $ +/* $Id: r2300_switch.S,v 1.8 1999/08/18 23:37:44 ralf Exp $ * * r2300_switch.S: R2300 specific task switching code. * @@ -55,12 +55,8 @@ LEAF(resume) lw a2, THREAD_STATUS($28) nor a3, $0, a3 and a2, a3 - lw a3, TASK_MM($28) or a2, t1 - lw a3, MM_CONTEXT(a3) mtc0 a2, CP0_STATUS - andi a3, 0xfc0 - mtc0 a3, CP0_ENTRYHI jr ra move v0, a0 END(resume) diff --git a/arch/mips/lib/Makefile b/arch/mips/lib/Makefile index 5d21e075b..9e2128b49 100644 --- a/arch/mips/lib/Makefile +++ b/arch/mips/lib/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.8 1998/10/18 13:21:50 tsbogend Exp $ +# $Id: Makefile,v 1.9 1999/01/04 16:03:50 ralf Exp $ # # Makefile for MIPS-specific library files.. # @@ -9,8 +9,14 @@ $(CC) $(CFLAGS) -c $< -o $*.o L_TARGET = lib.a -L_OBJS = csum_partial.o csum_partial_copy.o dump_tlb.o floppy-std.o \ +L_OBJS = csum_partial.o csum_partial_copy.o floppy-std.o \ floppy-no.o ide-std.o ide-no.o kbd-std.o kbd-no.o rtc-std.o \ rtc-no.o memset.o memcpy.o strlen_user.o strncpy_user.o watch.o +#ifdef CONFIG_CPU_R3000 + L_OBJS += r3k_dump_tlb.o +#else + L_OBJS += dump_tlb.o +#endif + include $(TOPDIR)/Rules.make diff --git a/arch/mips/lib/r3k_dump_tlb.c b/arch/mips/lib/r3k_dump_tlb.c new file mode 100644 index 000000000..adc4279e6 --- /dev/null +++ b/arch/mips/lib/r3k_dump_tlb.c @@ -0,0 +1,185 @@ +/* + * Dump R3000 TLB for debugging purposes. + * + * Copyright (C) 1994, 1995 by Waldorf Electronics, written by Ralf Baechle. + * Copyright (C) 1999 by Silicon Graphics, Inc. + * Copyright (C) 1999 by Harald Koerfgen + */ +#include <linux/kernel.h> +#include <linux/mm.h> +#include <linux/sched.h> +#include <linux/string.h> + +#include <asm/bootinfo.h> +#include <asm/cachectl.h> +#include <asm/mipsregs.h> +#include <asm/page.h> +#include <asm/pgtable.h> + +#define mips_tlb_entries 64 + +void +dump_tlb(int first, int last) +{ + int i; + unsigned int asid; + unsigned long entryhi, entrylo0; + + asid = get_entryhi() & 0xfc0; + + for(i=first;i<=last;i++) + { + write_32bit_cp0_register(CP0_INDEX, i); + __asm__ __volatile__( + ".set\tnoreorder\n\t" + "tlbr\n\t" + "nop\n\t" + ".set\treorder"); + entryhi = read_32bit_cp0_register(CP0_ENTRYHI); + entrylo0 = read_32bit_cp0_register(CP0_ENTRYLO0); + + /* Unused entries have a virtual address of KSEG0. */ + if ((entryhi & 0xffffe000) != 0x80000000 + && (entryhi & 0xfc0) == asid) { + /* + * Only print entries in use + */ + printk("Index: %2d ", i); + + printk("va=%08lx asid=%08lx" + " [pa=%06lx n=%d d=%d v=%d g=%ld]", + (entryhi & 0xffffe000), + entryhi & 0xfc0, + entrylo0 & PAGE_MASK, + (entrylo0 & (1 << 11)) ? 1 : 0, + (entrylo0 & (1 << 10)) ? 1 : 0, + (entrylo0 & (1 << 9)) ? 1 : 0, + (entrylo0 & (1 << 8)) ? 1 : 0); + } + } + printk("\n"); + + set_entryhi(asid); +} + +void +dump_tlb_all(void) +{ + dump_tlb(0, mips_tlb_entries - 1); +} + +void +dump_tlb_wired(void) +{ + int wired = 7; + + printk("Wired: %d", wired); + dump_tlb(0, read_32bit_cp0_register(CP0_WIRED)); +} + +void +dump_tlb_addr(unsigned long addr) +{ + unsigned int flags, oldpid; + int index; + + __save_and_cli(flags); + oldpid = get_entryhi() & 0xff; + set_entryhi((addr & PAGE_MASK) | oldpid); + tlb_probe(); + index = get_index(); + set_entryhi(oldpid); + __restore_flags(flags); + + if (index < 0) { + printk("No entry for address 0x%08lx in TLB\n", addr); + return; + } + + printk("Entry %d maps address 0x%08lx\n", index, addr); + dump_tlb(index, index); +} + +void +dump_tlb_nonwired(void) +{ + dump_tlb(8, mips_tlb_entries - 1); +} + +void +dump_list_process(struct task_struct *t, void *address) +{ + pgd_t *page_dir, *pgd; + pmd_t *pmd; + pte_t *pte, page; + unsigned int addr; + unsigned long val; + + addr = (unsigned int) address; + + printk("Addr == %08x\n", addr); + printk("tasks->mm.pgd == %08x\n", (unsigned int) t->mm->pgd); + + page_dir = pgd_offset(t->mm, 0); + printk("page_dir == %08x\n", (unsigned int) page_dir); + + pgd = pgd_offset(t->mm, addr); + printk("pgd == %08x, ", (unsigned int) pgd); + + pmd = pmd_offset(pgd, addr); + printk("pmd == %08x, ", (unsigned int) pmd); + + pte = pte_offset(pmd, addr); + printk("pte == %08x, ", (unsigned int) pte); + + page = *pte; + printk("page == %08x\n", (unsigned int) pte_val(page)); + + val = pte_val(page); + if (val & _PAGE_PRESENT) printk("present "); + if (val & _PAGE_READ) printk("read "); + if (val & _PAGE_WRITE) printk("write "); + if (val & _PAGE_ACCESSED) printk("accessed "); + if (val & _PAGE_MODIFIED) printk("modified "); + if (val & _PAGE_GLOBAL) printk("global "); + if (val & _PAGE_VALID) printk("valid "); + printk("\n"); +} + +void +dump_list_current(void *address) +{ + dump_list_process(current, address); +} + +unsigned int +vtop(void *address) +{ + pgd_t *pgd; + pmd_t *pmd; + pte_t *pte; + unsigned int addr, paddr; + + addr = (unsigned long) address; + pgd = pgd_offset(current->mm, addr); + pmd = pmd_offset(pgd, addr); + pte = pte_offset(pmd, addr); + paddr = (KSEG1 | (unsigned int) pte_val(*pte)) & PAGE_MASK; + paddr |= (addr & ~PAGE_MASK); + + return paddr; +} + +void +dump16(unsigned long *p) +{ + int i; + + for(i=0;i<8;i++) + { + printk("*%08lx == %08lx, ", + (unsigned long)p, (unsigned long)*p++); + printk("*%08lx == %08lx\n", + (unsigned long)p, (unsigned long)*p++); + } +} diff --git a/arch/mips/mm/r2300.c b/arch/mips/mm/r2300.c index dcf277129..03e1a16d1 100644 --- a/arch/mips/mm/r2300.c +++ b/arch/mips/mm/r2300.c @@ -7,7 +7,7 @@ * Copyright (C) 1998 Harald Koerfgen * Copyright (C) 1998 Gleb Raiko & Vladimir Roganov * - * $Id: r2300.c,v 1.10 1999/08/09 19:43:16 harald Exp $ + * $Id: r2300.c,v 1.11 1999/10/09 00:00:58 ralf Exp $ */ #include <linux/init.h> #include <linux/kernel.h> @@ -416,7 +416,7 @@ static void r2300_flush_cache_sigtramp(unsigned long page) * This function receives virtual address (from signal.c), * but this moment we have needed mm_struct in 'current' */ - unsigned long phys_page = get_phys_page(page, current->mm); + unsigned long phys_page = get_phys_page(page, current->active_mm); #ifdef DEBUG_CACHE printk("csigtramp[%08lx]", page); #endif |