]> err.no Git - linux-2.6/blobdiff - include/asm-mips/system.h
Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
[linux-2.6] / include / asm-mips / system.h
index 384f0bd854c4a0d5b9a92cce1a467276c3a660df..330c4e497af38d248d3ff5e6a8ff584040ffd6f1 100644 (file)
@@ -71,7 +71,7 @@
  * does not enforce ordering, since there is no data dependency between
  * the read of "a" and the read of "b".  Therefore, on some CPUs, such
  * as Alpha, "y" could be set to 3 and "x" to 0.  Use rmb()
- * in cases like thiswhere there are no data dependencies.
+ * in cases like this where there are no data dependencies.
  */
 
 #define read_barrier_depends() do { } while(0)
@@ -164,10 +164,6 @@ do {                                                                       \
                __restore_dsp(current);                                 \
 } while(0)
 
-#define ROT_IN_PIECES                                                  \
-       "       .set    noreorder       \n"                             \
-       "       .set    reorder         \n"
-
 static inline unsigned long __xchg_u32(volatile int * m, unsigned int val)
 {
        __u32 retval;
@@ -183,7 +179,6 @@ static inline unsigned long __xchg_u32(volatile int * m, unsigned int val)
                "       .set    mips3                                   \n"
                "       sc      %2, %1                                  \n"
                "       beqzl   %2, 1b                                  \n"
-               ROT_IN_PIECES
 #ifdef CONFIG_SMP
                "       sync                                            \n"
 #endif
@@ -235,7 +230,6 @@ static inline __u64 __xchg_u64(volatile __u64 * m, __u64 val)
                "       move    %2, %z4                                 \n"
                "       scd     %2, %1                                  \n"
                "       beqzl   %2, 1b                                  \n"
-               ROT_IN_PIECES
 #ifdef CONFIG_SMP
                "       sync                                            \n"
 #endif
@@ -308,10 +302,11 @@ static inline unsigned long __cmpxchg_u32(volatile int * m, unsigned long old,
                "       .set    mips3                                   \n"
                "1:     ll      %0, %2                  # __cmpxchg_u32 \n"
                "       bne     %0, %z3, 2f                             \n"
+               "       .set    mips0                                   \n"
                "       move    $1, %z4                                 \n"
+               "       .set    mips3                                   \n"
                "       sc      $1, %1                                  \n"
                "       beqzl   $1, 1b                                  \n"
-               ROT_IN_PIECES
 #ifdef CONFIG_SMP
                "       sync                                            \n"
 #endif
@@ -327,7 +322,9 @@ static inline unsigned long __cmpxchg_u32(volatile int * m, unsigned long old,
                "       .set    mips3                                   \n"
                "1:     ll      %0, %2                  # __cmpxchg_u32 \n"
                "       bne     %0, %z3, 2f                             \n"
+               "       .set    mips0                                   \n"
                "       move    $1, %z4                                 \n"
+               "       .set    mips3                                   \n"
                "       sc      $1, %1                                  \n"
                "       beqz    $1, 1b                                  \n"
 #ifdef CONFIG_SMP
@@ -367,7 +364,6 @@ static inline unsigned long __cmpxchg_u64(volatile int * m, unsigned long old,
                "       move    $1, %z4                                 \n"
                "       scd     $1, %1                                  \n"
                "       beqzl   $1, 1b                                  \n"
-               ROT_IN_PIECES
 #ifdef CONFIG_SMP
                "       sync                                            \n"
 #endif
@@ -438,15 +434,13 @@ extern void *set_vi_srs_handler (int n, void *addr, int regset);
 extern void *set_except_vector(int n, void *addr);
 extern void per_cpu_trap_init(void);
 
-extern NORET_TYPE void __die(const char *, struct pt_regs *, const char *file,
-       const char *func, unsigned long line) ATTRIB_NORET;
-extern void __die_if_kernel(const char *, struct pt_regs *, const char *file,
-       const char *func, unsigned long line);
+extern NORET_TYPE void die(const char *, struct pt_regs *);
 
-#define die(msg, regs)                                                 \
-       __die(msg, regs, __FILE__ ":", __FUNCTION__, __LINE__)
-#define die_if_kernel(msg, regs)                                       \
-       __die_if_kernel(msg, regs, __FILE__ ":", __FUNCTION__, __LINE__)
+static inline void die_if_kernel(const char *str, struct pt_regs *regs)
+{
+       if (unlikely(!user_mode(regs)))
+               die(str, regs);
+}
 
 extern int stop_a_enabled;