patch-2.4.0-test7 linux/include/asm-arm/proc-armo/assembler.h

Next file: linux/include/asm-arm/proc-armo/cache.h
Previous file: linux/include/asm-arm/pgtable.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.0-test6/linux/include/asm-arm/proc-armo/assembler.h linux/include/asm-arm/proc-armo/assembler.h
@@ -6,10 +6,6 @@
  * This file contains arm architecture specific defines
  * for the different processors
  */
-#ifndef __ASSEMBLY__
-#error "Only include this from assembly code"
-#endif
-
 #define MODE_USR	USR26_MODE
 #define MODE_FIQ	FIQ26_MODE
 #define MODE_IRQ	IRQ26_MODE
@@ -60,3 +56,25 @@
 #define SVCMODE(tmpreg)\
 	teqp	pc, $0x00000003;\
 	mov	r0, r0
+
+
+/*
+ * Save the current IRQ state and disable IRQs
+ * Note that this macro assumes FIQs are enabled, and
+ * that the processor is in SVC mode.
+ */
+	.macro	save_and_disable_irqs, oldcpsr, temp
+  mov \oldcpsr, pc
+  orr \temp, \oldcpsr, #0x08000000
+  teqp \temp, #0
+  .endm
+
+/*
+ * Restore interrupt state previously stored in
+ * a register
+ * ** Actually do nothing on Arc - hope that the caller uses a MOVS PC soon
+ * after!
+ */
+	.macro	restore_irqs, oldcpsr
+  @ This be restore_irqs
+  .endm

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