s390/facilities: add helper tool to generate facility lists
[cascardo/linux.git] / arch / s390 / include / asm / facility.h
index 0aa6a7e..007163f 100644 (file)
@@ -7,6 +7,10 @@
 #ifndef __ASM_FACILITY_H
 #define __ASM_FACILITY_H
 
+#include <generated/facilities.h>
+
+#ifndef __ASSEMBLY__
+
 #include <linux/string.h>
 #include <linux/preempt.h>
 #include <asm/lowcore.h>
@@ -44,10 +48,8 @@ static inline void stfle(u64 *stfle_fac_list, int size)
 
        preempt_disable();
        asm volatile(
-               "       .insn s,0xb2b10000,0(0)\n" /* stfl */
-               "0:\n"
-               EX_TABLE(0b, 0b)
-               : "+m" (S390_lowcore.stfl_fac_list));
+               "       stfl    0(0)\n"
+               : "=m" (S390_lowcore.stfl_fac_list));
        nr = 4; /* bytes stored by stfl */
        memcpy(stfle_fac_list, &S390_lowcore.stfl_fac_list, 4);
        if (S390_lowcore.stfl_fac_list & 0x01000000) {
@@ -64,4 +66,5 @@ static inline void stfle(u64 *stfle_fac_list, int size)
        preempt_enable();
 }
 
+#endif /* __ASSEMBLY__ */
 #endif /* __ASM_FACILITY_H */