@@ -12,6 +12,7 @@
#include <asm/facility.h>
#include <asm/arch_def.h>
#include <bitops.h>
+#include <sclp.h>
#define NB_STFL_DOUBLEWORDS 32
extern uint64_t stfl_doublewords[];
@@ -42,4 +43,24 @@ static inline void setup_facilities(void)
stfle(stfl_doublewords, NB_STFL_DOUBLEWORDS);
}
+enum supp_on_prot_facility {
+ SOP_NONE,
+ SOP_BASIC,
+ SOP_ENHANCED_1,
+ SOP_ENHANCED_2,
+};
+
+static inline enum supp_on_prot_facility get_supp_on_prot_facility(void)
+{
+ if (sclp_facilities.has_esop) {
+ if (test_facility(131)) /* side-effect-access facility */
+ return SOP_ENHANCED_2;
+ else
+ return SOP_ENHANCED_1;
+ }
+ if (sclp_facilities.has_sop)
+ return SOP_BASIC;
+ return SOP_NONE;
+}
+
#endif
@@ -123,7 +123,9 @@ struct sclp_facilities {
uint64_t has_cei : 1;
uint64_t has_diag318 : 1;
+ uint64_t has_sop : 1;
uint64_t has_gsls : 1;
+ uint64_t has_esop : 1;
uint64_t has_cmma : 1;
uint64_t has_64bscao : 1;
uint64_t has_esca : 1;
@@ -134,7 +136,9 @@ struct sclp_facilities {
};
/* bit number within a certain byte */
+#define SCLP_FEAT_80_BIT_SOP 2
#define SCLP_FEAT_85_BIT_GSLS 0
+#define SCLP_FEAT_85_BIT_ESOP 6
#define SCLP_FEAT_98_BIT_KSS 7
#define SCLP_FEAT_116_BIT_64BSCAO 0
#define SCLP_FEAT_116_BIT_CMMA 1
@@ -152,7 +152,9 @@ void sclp_facilities_setup(void)
cpu = sclp_get_cpu_entries();
if (read_info->offset_cpu > 134)
sclp_facilities.has_diag318 = read_info->byte_134_diag318;
+ sclp_facilities.has_sop = sclp_feat_check(80, SCLP_FEAT_80_BIT_SOP);
sclp_facilities.has_gsls = sclp_feat_check(85, SCLP_FEAT_85_BIT_GSLS);
+ sclp_facilities.has_esop = sclp_feat_check(85, SCLP_FEAT_85_BIT_ESOP);
sclp_facilities.has_kss = sclp_feat_check(98, SCLP_FEAT_98_BIT_KSS);
sclp_facilities.has_cmma = sclp_feat_check(116, SCLP_FEAT_116_BIT_CMMA);
sclp_facilities.has_64bscao = sclp_feat_check(116, SCLP_FEAT_116_BIT_64BSCAO);