patch-2.3.48 linux/include/asm-alpha/system.h

Next file: linux/include/asm-arm/arch-arc/io.h
Previous file: linux/include/asm-alpha/spinlock.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.47/linux/include/asm-alpha/system.h linux/include/asm-alpha/system.h
@@ -259,11 +259,31 @@
 __CALL_PAL_W1(wrusp, unsigned long);
 __CALL_PAL_W1(wrvptptr, unsigned long);
 
-#define __cli()			((void) swpipl(7))
-#define __sti()			((void) swpipl(0))
+#define IPL_MIN		0
+#define IPL_SW0		1
+#define IPL_SW1		2
+#define IPL_DEV0	3
+#define IPL_DEV1	4
+#define IPL_TIMER	5
+#define IPL_PERF	6
+#define IPL_POWERFAIL	6
+#define IPL_MCHECK	7
+#define IPL_MAX		7
+
+#ifdef CONFIG_ALPHA_BROKEN_IRQ_MASK
+#undef IPL_MIN
+#define IPL_MIN		__min_ipl
+extern int __min_ipl;
+#endif
+
+#define getipl()		(rdps() & 7)
+#define setipl(ipl)		((void) swpipl(ipl))
+
+#define __cli()			setipl(IPL_MAX)
+#define __sti()			setipl(IPL_MIN)
 #define __save_flags(flags)	((flags) = rdps())
-#define __save_and_cli(flags)	((flags) = swpipl(7))
-#define __restore_flags(flags)	((void) swpipl(flags))
+#define __save_and_cli(flags)	((flags) = swpipl(IPL_MAX))
+#define __restore_flags(flags)	setipl(flags)
 
 #define local_irq_save(flags)		__save_and_cli(flags)
 #define local_irq_restore(flags)	__restore_flags(flags)
@@ -332,7 +352,7 @@
 	"	stl_c %1,%2\n"
 	"	beq %1,2f\n"
 	"	mb\n"
-	".section .text2,\"ax\"\n"
+	".subsection 2\n"
 	"2:	br 1b\n"
 	".previous"
 	: "=&r" (val), "=&r" (dummy), "=m" (*m)
@@ -352,7 +372,7 @@
 	"	stq_c %1,%2\n"
 	"	beq %1,2f\n"
 	"	mb\n"
-	".section .text2,\"ax\"\n"
+	".subsection 2\n"
 	"2:	br 1b\n"
 	".previous"
 	: "=&r" (val), "=&r" (dummy), "=m" (*m)
@@ -408,7 +428,7 @@
 	"	stl_c %1,%2\n"
 	"	beq %1,3f\n"
 	"2:	mb\n"
-	".section .text2,\"ax\"\n"
+	".subsection 2\n"
 	"3:	br 1b\n"
 	".previous"
 	: "=&r"(prev), "=&r"(cmp), "=m"(*m)
@@ -430,7 +450,7 @@
 	"	stq_c %1,%2\n"
 	"	beq %1,3f\n"
 	"2:	mb\n"
-	".section .text2,\"ax\"\n"
+	".subsection 2\n"
 	"3:	br 1b\n"
 	".previous"
 	: "=&r"(prev), "=&r"(cmp), "=m"(*m)

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