[S390] EX_TABLE macro.
[firefly-linux-kernel-4.4.55.git] / include / asm-s390 / processor.h
index c5cbc4bd8414e12c571982cb5c5d0f85bec31406..a3a4e5fd30d70ffc51b685a756b01b69321a0b24 100644 (file)
@@ -199,15 +199,13 @@ unsigned long get_wchan(struct task_struct *p);
 /*
  * Give up the time slice of the virtual PU.
  */
-#ifndef __s390x__
-# define cpu_relax()   asm volatile ("diag 0,0,68" : : : "memory")
-#else /* __s390x__ */
-# define cpu_relax() \
-       do { \
-               if (MACHINE_HAS_DIAG44) \
-                       asm volatile ("diag 0,0,68" : : : "memory"); \
-       } while (0)
-#endif /* __s390x__ */
+static inline void cpu_relax(void)
+{
+       if (MACHINE_HAS_DIAG44)
+               asm volatile ("diag 0,0,68" : : : "memory");
+       else
+               barrier();
+}
 
 /*
  * Set PSW to specified value.
@@ -341,4 +339,21 @@ int unregister_idle_notifier(struct notifier_block *nb);
 
 #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           */