Skip to contentSkip to conversation

EX_TABLE macro.

S390 Martin Schwidefsky 1 participant 1 message Aug 30, 2006

lore
Share & tools
lore
#0 lore raw

From: Martin Schwidefsky <[email protected]>

[S390] EX_TABLE macro.

Add EX_TABLE helper macro to simplify creation of inline assembly exception table entries.

---

 include/asm-s390/processor.h |   17 +++++++++++++++++
 1 files changed, 17 insertions(+)
include/asm-s390/processor.h +17 -0
diff -urpN linux-2.6/include/asm-s390/processor.h linux-2.6-patched/include/asm-s390/processor.h
@@ -339,4 +339,21 @@ int unregister_idle_notifier(struct noti
 
 #endif
 
+/*
+ * Helper macro for exception table entries
+ */
+#ifndef __s390x__
+#define EX_TABLE(_fault,_target)			\
+	".section __ex_table,\"a\"\n"			\
+	"	.align 4\n"				\
+	"	.long  " #_fault "," #_target "\n"	\
+	".previous\n"
+#else
+#define EX_TABLE(_fault,_target)			\
+	".section __ex_table,\"a\"\n"			\
+	"	.align 8\n"				\
+	"	.quad  " #_fault "," #_target "\n"	\
+	".previous\n"
+#endif
+
 #endif                                 /* __ASM_S390_PROCESSOR_H           */