aboutsummaryrefslogtreecommitdiff
path: root/target/s390x/gen-features.c
diff options
context:
space:
mode:
authorMichael Mueller <mimu@linux.ibm.com>2018-07-25 16:36:17 +0200
committerCornelia Huck <cohuck@redhat.com>2018-08-20 14:18:49 +0200
commita5f9ecc49d63a905da6598900e0a0eeec1ef269d (patch)
treea7a74e060c65fc9515ef51303508e1beb3e3228a /target/s390x/gen-features.c
parent9ca056d68f82726bda7f0b57d6a94c302d0f3b19 (diff)
s390x/cpumodel: enum type S390FeatGroup now gets generated
The enumeration type S390FeatGroup is now generated as well. This shall simplify the definition of new feature groups without the requirement to modify existing code. Signed-off-by: Michael Mueller <mimu@linux.ibm.com> Message-Id: <20180725143617.8731-1-mimu@linux.ibm.com> Acked-by: David Hildenbrand <david@redhat.com> Acked-by: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: Cornelia Huck <cohuck@redhat.com>
Diffstat (limited to 'target/s390x/gen-features.c')
-rw-r--r--target/s390x/gen-features.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/target/s390x/gen-features.c b/target/s390x/gen-features.c
index 6626b6f565..2ca5ededb3 100644
--- a/target/s390x/gen-features.c
+++ b/target/s390x/gen-features.c
@@ -661,6 +661,7 @@ static CpuFeatDefSpec CpuFeatDef[] = {
#define FEAT_GROUP_INITIALIZER(_name) \
{ \
.name = "S390_FEAT_GROUP_LIST_" #_name, \
+ .enum_name = "S390_FEAT_GROUP_" #_name, \
.bits = \
{ .data = group_##_name, \
.len = ARRAY_SIZE(group_##_name) }, \
@@ -668,6 +669,7 @@ static CpuFeatDefSpec CpuFeatDef[] = {
typedef struct {
const char *name;
+ const char *enum_name;
BitSpec bits;
} FeatGroupDefSpec;
@@ -678,7 +680,6 @@ static FeatGroupDefSpec FeatGroupDef[] = {
FEAT_GROUP_INITIALIZER(PLO),
FEAT_GROUP_INITIALIZER(TOD_CLOCK_STEERING),
FEAT_GROUP_INITIALIZER(GEN13_PTFF),
- FEAT_GROUP_INITIALIZER(MULTIPLE_EPOCH_PTFF),
FEAT_GROUP_INITIALIZER(MSA),
FEAT_GROUP_INITIALIZER(MSA_EXT_1),
FEAT_GROUP_INITIALIZER(MSA_EXT_2),
@@ -688,6 +689,7 @@ static FeatGroupDefSpec FeatGroupDef[] = {
FEAT_GROUP_INITIALIZER(MSA_EXT_6),
FEAT_GROUP_INITIALIZER(MSA_EXT_7),
FEAT_GROUP_INITIALIZER(MSA_EXT_8),
+ FEAT_GROUP_INITIALIZER(MULTIPLE_EPOCH_PTFF),
};
#define QEMU_FEAT_INITIALIZER(_name) \
@@ -810,6 +812,19 @@ static void print_feature_group_defs(void)
}
}
+static void print_feature_group_enum_type(void)
+{
+ int i;
+
+ printf("\n/* CPU feature group enum type */\n"
+ "typedef enum {\n");
+ for (i = 0; i < ARRAY_SIZE(FeatGroupDef); i++) {
+ printf("\t%s,\n", FeatGroupDef[i].enum_name);
+ }
+ printf("\tS390_FEAT_GROUP_MAX,\n"
+ "} S390FeatGroup;\n");
+}
+
int main(int argc, char *argv[])
{
printf("/*\n"
@@ -826,6 +841,7 @@ int main(int argc, char *argv[])
print_feature_defs();
print_feature_group_defs();
print_qemu_feature_defs();
+ print_feature_group_enum_type();
printf("\n#endif\n");
return 0;
}