patch-2.4.22 linux-2.4.22/arch/mips/lib/dump_tlb.c

Next file: linux-2.4.22/arch/mips/lib/ide-no.c
Previous file: linux-2.4.22/arch/mips/lib/Makefile
Back to the patch index
Back to the overall index

diff -urN linux-2.4.21/arch/mips/lib/dump_tlb.c linux-2.4.22/arch/mips/lib/dump_tlb.c
@@ -41,11 +41,11 @@
 	unsigned long long entrylo0, entrylo1;
 	unsigned long entryhi;
 
-	asid = get_entryhi() & 0xff;
+	asid = read_c0_entryhi() & 0xff;
 
 	printk("\n");
 	for(i=first;i<=last;i++) {
-		write_32bit_cp0_register(CP0_INDEX, i);
+		write_c0_index(i);
 		__asm__ __volatile__(
 			".set\tmips3\n\t"
 			".set\tnoreorder\n\t"
@@ -54,10 +54,10 @@
 			"nop;nop;nop;nop\n\t"
 			".set\treorder\n\t"
 			".set\tmips0\n\t");
-		pagemask = read_32bit_cp0_register(CP0_PAGEMASK);
-		entryhi  = read_32bit_cp0_register(CP0_ENTRYHI);
-		entrylo0 = get_entrylo0();
-		entrylo1 = get_entrylo1();
+		pagemask = read_c0_pagemask();
+		entryhi  = read_c0_entryhi();
+		entrylo0 = read_c0_entrylo0();
+		entrylo1 = read_c0_entrylo1();
 
 		/* Unused entries have a virtual address in KSEG0.  */
 		if ((entryhi & 0xf0000000) != 0x80000000
@@ -86,21 +86,21 @@
 		}
 	}
 
-	set_entryhi(asid);
+	write_c0_entryhi(asid);
 }
 
 void dump_tlb_all(void)
 {
-	dump_tlb(0, mips_cpu.tlbsize - 1);
+	dump_tlb(0, current_cpu_data.tlbsize - 1);
 }
 
 void dump_tlb_wired(void)
 {
 	int	wired;
 
-	wired = read_32bit_cp0_register(CP0_WIRED);
+	wired = read_c0_wired();
 	printk("Wired: %d", wired);
-	dump_tlb(0, read_32bit_cp0_register(CP0_WIRED));
+	dump_tlb(0, read_c0_wired());
 }
 
 #define BARRIER						\
@@ -112,19 +112,19 @@
 void
 dump_tlb_addr(unsigned long addr)
 {
-	unsigned int flags, oldpid;
+	unsigned long flags, oldpid;
 	int index;
 
-	__save_and_cli(flags);
-	oldpid = get_entryhi() & 0xff;
+	local_irq_save(flags);
+	oldpid = read_c0_entryhi() & 0xff;
 	BARRIER;
-	set_entryhi((addr & PAGE_MASK) | oldpid);
+	write_c0_entryhi((addr & PAGE_MASK) | oldpid);
 	BARRIER;
 	tlb_probe();
 	BARRIER;
-	index = get_index();
-	set_entryhi(oldpid);
-	__restore_flags(flags);
+	index = read_c0_index();
+	write_c0_entryhi(oldpid);
+	local_irq_restore(flags);
 
 	if (index < 0) {
 		printk("No entry for address 0x%08lx in TLB\n", addr);
@@ -138,7 +138,7 @@
 void
 dump_tlb_nonwired(void)
 {
-	dump_tlb(read_32bit_cp0_register(CP0_WIRED), mips_cpu.tlbsize - 1);
+	dump_tlb(read_c0_wired(), current_cpu_data.tlbsize - 1);
 }
 
 void
@@ -153,8 +153,8 @@
 	addr = (unsigned int) address;
 
 	printk("Addr                 == %08x\n", addr);
-	printk("task                 == %08p\n", t);
-	printk("task->mm             == %08p\n", t->mm);
+	printk("task                 == %8p\n", t);
+	printk("task->mm             == %8p\n", t->mm);
 	//printk("tasks->mm.pgd        == %08x\n", (unsigned int) t->mm->pgd);
 
 	if (addr > KSEG0)
@@ -177,9 +177,9 @@
 
 	page = *pte;
 #ifdef CONFIG_64BIT_PHYS_ADDR
-	printk("page == %08Lx\n", (unsigned long long) pte_val(page));
+	printk("page == %08Lx\n", pte_val(page));
 #else
-	printk("page == %08lx\n", (unsigned int) pte_val(page));
+	printk("page == %08lx\n", pte_val(page));
 #endif
 
 	val = pte_val(page);
@@ -225,9 +225,7 @@
 
 	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++);
+		printk("*%8p = %08lx, ", p, *p); p++;
+		printk("*%8p = %08lx\n", p, *p); p++;
 	}
 }

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)