linux-cvs-patches
[Top] [All Lists]

CVS Update@linux-mips.org: linux

To: linux-cvs-patches@linux-mips.org
Subject: CVS Update@linux-mips.org: linux
From: ralf@linux-mips.org
Date: Tue, 23 Aug 2005 16:12:55 +0100
Reply-to: linux-mips@linux-mips.org
Sender: linux-cvs-patches-bounce@linux-mips.org
CVSROOT:        /home/cvs
Module name:    linux
Changes by:     ralf@ftp.linux-mips.org 05/08/23 16:12:49

Modified files:
        arch/mips/kernel: traps.c smp_mt.c vpe.c 
        include/asm-mips: mipsmtregs.h mipsregs.h 

Log message:
        Cleanup cp0 MT bitfiddling.

diff -urN linux/arch/mips/kernel/traps.c linux/arch/mips/kernel/traps.c
--- linux/arch/mips/kernel/traps.c      2005/08/17 17:44:09     1.224
+++ linux/arch/mips/kernel/traps.c      2005/08/23 15:12:49     1.225
@@ -28,6 +28,8 @@
 #include <asm/cpu.h>
 #include <asm/dsp.h>
 #include <asm/fpu.h>
+#include <asm/mipsregs.h>
+#include <asm/mipsmtregs.h>
 #include <asm/module.h>
 #include <asm/pgtable.h>
 #include <asm/ptrace.h>
diff -urN linux/arch/mips/kernel/smp_mt.c linux/arch/mips/kernel/smp_mt.c
--- linux/arch/mips/kernel/smp_mt.c     2005/08/20 13:58:43     1.2
+++ linux/arch/mips/kernel/smp_mt.c     2005/08/23 15:12:49     1.3
@@ -32,6 +32,7 @@
 #include <asm/smp.h>
 #include <asm/time.h>
 #include <asm/mipsregs.h>
+#include <asm/mipsmtregs.h>
 #include <asm/cacheflush.h>
 #include <asm/mips-boards/maltaint.h>
 
@@ -65,10 +66,10 @@
        if (!cpu_has_mipsmt)
                return;
 
-       write_c0_mvpcontrol( read_c0_mvpcontrol() | MVPCONTROL_VPC );
+       set_c0_mvpcontrol(MVPCONTROL_VPC);
 
        /* Disable TLB sharing */
-       write_c0_mvpcontrol( read_c0_mvpcontrol() & ~MVPCONTROL_STLB );
+       clear_c0_mvpcontrol(MVPCONTROL_STLB);
 
        mvpconf0 = read_c0_mvpconf0();
 
@@ -98,7 +99,7 @@
                }
        }
 
-       write_c0_mvpcontrol(read_c0_mvpcontrol() & ~MVPCONTROL_VPC);
+       clear_c0_mvpcontrol(MVPCONTROL_VPC);
 }
 
 #if 0
@@ -182,7 +183,7 @@
        dmt();
 
        /* Put MVPE's into 'configuration state' */
-       write_c0_mvpcontrol( read_c0_mvpcontrol() | MVPCONTROL_VPC );
+       set_c0_mvpcontrol(MVPCONTROL_VPC);
 
        val = read_c0_mvpconf0();
 
@@ -253,7 +254,7 @@
        }
 
        /* Release config state */
-       write_c0_mvpcontrol(read_c0_mvpcontrol() & ~ MVPCONTROL_VPC);
+       clear_c0_mvpcontrol(MVPCONTROL_VPC);
 
        /* We'll wait until starting the secondaries before starting MVPE */
 
@@ -287,7 +288,7 @@
 void prom_boot_secondary(int cpu, struct task_struct *idle)
 {
        dvpe();
-       write_c0_mvpcontrol(read_c0_mvpcontrol() | MVPCONTROL_VPC);
+       set_c0_mvpcontrol(MVPCONTROL_VPC);
 
        settc(cpu);
 
@@ -313,7 +314,7 @@
                                           sizeof(struct thread_info));
 
        /* finally out of configuration and into chaos */
-       write_c0_mvpcontrol(read_c0_mvpcontrol() & ~MVPCONTROL_VPC);
+       clear_c0_mvpcontrol(MVPCONTROL_VPC);
 
        evpe(EVPE_ENABLE);
 }
diff -urN linux/arch/mips/kernel/vpe.c linux/arch/mips/kernel/vpe.c
--- linux/arch/mips/kernel/vpe.c        2005/07/14 15:57:16     1.1
+++ linux/arch/mips/kernel/vpe.c        2005/08/23 15:12:49     1.2
@@ -49,6 +49,7 @@
 #include <linux/poll.h>
 #include <linux/bootmem.h>
 #include <asm/mipsregs.h>
+#include <asm/mipsmtregs.h>
 #include <asm/cacheflush.h>
 #include <asm/atomic.h>
 #include <asm/cpu.h>
@@ -698,7 +699,7 @@
        dvpe();
 
        /* Put MVPE's into 'configuration state' */
-       write_c0_mvpcontrol(read_c0_mvpcontrol() | MVPCONTROL_VPC);
+       set_c0_mvpcontrol(MVPCONTROL_VPC);
 
        if (!list_empty(&v->tc)) {
                if ((t = list_entry(v->tc.next, struct tc, tc)) == NULL) {
@@ -758,7 +759,7 @@
        write_vpe_c0_cause(0);
 
        /* take system out of configuration state */
-       write_c0_mvpcontrol(read_c0_mvpcontrol() & ~MVPCONTROL_VPC);
+       clear_c0_mvpcontrol(MVPCONTROL_VPC);
 
        /* clear interrupts enabled IE, ERL, EXL, and KSU from c0 status */
        write_vpe_c0_status(read_vpe_c0_status() & ~(ST0_ERL | ST0_KSU | ST0_IE 
| ST0_EXL));
@@ -1132,7 +1133,7 @@
        evpe_flags = dvpe();
 
        /* Put MVPE's into 'configuration state' */
-       write_c0_mvpcontrol(read_c0_mvpcontrol() | MVPCONTROL_VPC);
+       set_c0_mvpcontrol(MVPCONTROL_VPC);
 
        settc(t->index);
        write_vpe_c0_vpeconf0(read_vpe_c0_vpeconf0() & ~VPECONF0_VPA);
@@ -1143,7 +1144,7 @@
 
        v->state = VPE_STATE_UNUSED;
 
-       write_c0_mvpcontrol(read_c0_mvpcontrol() & ~MVPCONTROL_VPC);
+       clear_c0_mvpcontrol(MVPCONTROL_VPC);
        evpe(evpe_flags);
 
        return 0;
@@ -1189,7 +1190,7 @@
        dvpe();
 
        /* Put MVPE's into 'configuration state' */
-       write_c0_mvpcontrol(read_c0_mvpcontrol() | MVPCONTROL_VPC);
+       set_c0_mvpcontrol(MVPCONTROL_VPC);
 
        /* dump_mtregs(); */
 
@@ -1268,7 +1269,7 @@
        }
 
        /* release config state */
-       write_c0_mvpcontrol(read_c0_mvpcontrol() & ~MVPCONTROL_VPC);
+       clear_c0_mvpcontrol(MVPCONTROL_VPC);
 
        return 0;
 }
diff -urN linux/include/asm-mips/mipsmtregs.h 
linux/include/asm-mips/mipsmtregs.h
--- linux/include/asm-mips/mipsmtregs.h 2005/08/20 13:52:31     1.5
+++ linux/include/asm-mips/mipsmtregs.h 2005/08/23 15:12:49     1.6
@@ -7,6 +7,7 @@
 #ifndef _ASM_MIPSMTREGS_H
 #define _ASM_MIPSMTREGS_H
 
+#include <asm/mipsregs.h>
 #include <asm/war.h>
 
 #ifndef __ASSEMBLY__
@@ -383,6 +384,7 @@
 #define read_tc_gpr_gp()               mftgpr(28)
 #define write_tc_gpr_gp(val)           mttgpr(28, val)
 
+__BUILD_SET_C0(mvpcontrol)
 
 #endif /* Not __ASSEMBLY__ */
 
diff -urN linux/include/asm-mips/mipsregs.h linux/include/asm-mips/mipsregs.h
--- linux/include/asm-mips/mipsregs.h   2005/08/17 10:03:03     1.81
+++ linux/include/asm-mips/mipsregs.h   2005/08/23 15:12:49     1.82
@@ -37,8 +37,6 @@
 #define _ULCAST_ (unsigned long)
 #endif
 
-#include <asm/mipsmtregs.h>
-
 /*
  * Coprocessor 0 register names
  */

<Prev in Thread] Current Thread [Next in Thread>