patch-2.3.99-pre6 linux/include/asm-sh/system.h

Next file: linux/include/asm-sh/unistd.h
Previous file: linux/include/asm-sh/softirq.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.99-pre5/linux/include/asm-sh/system.h linux/include/asm-sh/system.h
@@ -5,6 +5,8 @@
  * Copyright (C) 1999, 2000  Niibe Yutaka  &  Kaz Kojima
  */
 
+#include <linux/config.h>
+
 /*
  *	switch_to() should switch tasks to task nr n, first
  */
@@ -13,7 +15,7 @@
 	unsigned long seg;
 } mm_segment_t;
 
-#ifdef __SMP__
+#ifdef CONFIG_SMP
 #error no SMP SuperH
 #else
 #define prepare_to_switch()	do { } while(0)
@@ -97,11 +99,11 @@
 
 	__asm__ __volatile__("stc	$sr, %0\n\t"
 			     "and	%1, %0\n\t"
-			     "stc	$r5_bank, %1\n\t"
+			     "stc	$r6_bank, %1\n\t"
 			     "or	%1, %0\n\t"
 			     "ldc	%0, $sr"
 			     : "=&r" (__dummy0), "=r" (__dummy1)
-			     : "1" (~0xf0)
+			     : "1" (~0x000000f0)
 			     : "memory");
 }
 
@@ -137,17 +139,8 @@
 		: "memory"); (__sr & 0x000000f0); }))
 
 #define __restore_flags(x) do { 			\
-	unsigned long __dummy0, __dummy1;		\
-	if (x != 0xf0)	/* not CLI-ed? */		\
-		__asm__ __volatile__(		       	\
-		"stc	$sr, %0\n\t"			\
-		"and	%1, %0\n\t"			\
-		"stc	$r5_bank, %1\n\t"		\
-		"or	%1, %0\n\t"			\
-		"ldc	%0, $sr"			\
-		: "=&r" (__dummy0), "=r" (__dummy1)	\
-		: "1" (0xffffff0f)	 		\
-		: "memory"); 				\
+	if (x != 0x000000f0)	/* not CLI-ed? */		\
+		__sti();				\
 } while (0)
 
 /*
@@ -192,7 +185,7 @@
 #define local_irq_disable()	__cli()
 #define local_irq_enable()	__sti()
 
-#ifdef __SMP__
+#ifdef CONFIG_SMP
 
 extern void __global_cli(void);
 extern void __global_sti(void);

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