patch-2.3.43 linux/include/asm-arm/proc-armv/system.h

Next file: linux/include/asm-arm/types.h
Previous file: linux/include/asm-arm/pgalloc.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.42/linux/include/asm-arm/proc-armv/system.h linux/include/asm-arm/proc-armv/system.h
@@ -16,7 +16,6 @@
 	switch (size) {
 		case 1:	__asm__ __volatile__ ("swpb %0, %1, [%2]" : "=r" (x) : "r" (x), "r" (ptr) : "memory");
 			break;
-		case 2:	abort ();
 		case 4:	__asm__ __volatile__ ("swp %0, %1, [%2]" : "=r" (x) : "r" (x), "r" (ptr) : "memory");
 			break;
 		default: arm_invalidptr(xchg_str, size);
@@ -25,11 +24,9 @@
 }
 
 #define set_cr(x)					\
-	do {						\
 	__asm__ __volatile__(				\
 	"mcr	p15, 0, %0, c1, c0	@ set CR"	\
-	  : : "r" (x));					\
-	} while (0)
+	: : "r" (x))
 
 extern unsigned long cr_no_alignment;	/* defined in entry-armv.S */
 extern unsigned long cr_alignment;	/* defined in entry-armv.S */
@@ -42,76 +39,66 @@
  * Save the current interrupt enable state & disable IRQs
  */
 #define __save_flags_cli(x)					\
-	do {							\
-	  unsigned long temp;					\
-	  __asm__ __volatile__(					\
-	"mrs	%1, cpsr		@ save_flags_cli\n"	\
-"	and	%0, %1, #192\n"					\
-"	orr	%1, %1, #128\n"					\
-"	msr	cpsr, %1"					\
-	  : "=r" (x), "=r" (temp)				\
-	  :							\
-	  : "memory");						\
-	} while (0)
+	({							\
+		unsigned long temp;				\
+	__asm__ __volatile__(					\
+	"mrs	%0, cpsr		@ save_flags_cli\n"	\
+"	orr	%1, %0, #128\n"					\
+"	msr	cpsr_c, %1"					\
+	: "=r" (x), "=r" (temp)					\
+	:							\
+	: "memory");						\
+	})
 	
 /*
  * Enable IRQs
  */
 #define __sti()							\
-	do {							\
-	  unsigned long temp;					\
-	  __asm__ __volatile__(					\
+	({							\
+		unsigned long temp;				\
+	__asm__ __volatile__(					\
 	"mrs	%0, cpsr		@ sti\n"		\
 "	bic	%0, %0, #128\n"					\
-"	msr	cpsr, %0"					\
-	  : "=r" (temp)						\
-	  :							\
-	  : "memory");						\
-	} while(0)
+"	msr	cpsr_c, %0"					\
+	: "=r" (temp)						\
+	:							\
+	: "memory");						\
+	})
 
 /*
  * Disable IRQs
  */
 #define __cli()							\
-	do {							\
-	  unsigned long temp;					\
-	  __asm__ __volatile__(					\
+	({							\
+		unsigned long temp;				\
+	__asm__ __volatile__(					\
 	"mrs	%0, cpsr		@ cli\n"		\
 "	orr	%0, %0, #128\n"					\
-"	msr	cpsr, %0"					\
-	  : "=r" (temp)						\
-	  :							\
-	  : "memory");						\
-	} while(0)
+"	msr	cpsr_c, %0"					\
+	: "=r" (temp)						\
+	:							\
+	: "memory");						\
+	})
 
 /*
  * save current IRQ & FIQ state
  */
 #define __save_flags(x)						\
-	do {							\
-	  __asm__ __volatile__(					\
+	__asm__ __volatile__(					\
 	"mrs	%0, cpsr		@ save_flags\n"		\
-"	and	%0, %0, #192"					\
 	  : "=r" (x)						\
 	  :							\
-	  : "memory");						\
-	} while (0)
+	  : "memory")
 
 /*
  * restore saved IRQ & FIQ state
  */
 #define __restore_flags(x)					\
-	do {							\
-	  unsigned long temp;					\
-	  __asm__ __volatile__(					\
-	"mrs	%0, cpsr		@ restore_flags\n"	\
-"	bic	%0, %0, #192\n"					\
-"	orr	%0, %0, %1\n"					\
-"	msr	cpsr, %0"					\
-	  : "=&r" (temp)					\
-	  : "r" (x)						\
-	  : "memory");			\
-	} while (0)
+	__asm__ __volatile__(					\
+	"msr	cpsr_c, %0		@ restore_flags\n"	\
+	:							\
+	: "r" (x)						\
+	: "memory")
 
 /* For spinlocks etc */
 #define local_irq_save(x)	__save_flags_cli(x)

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