diff --git a/MAINTAINERS b/MAINTAINERS index d8a02a6c19..a0805d35cd 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -601,6 +601,7 @@ F: xen/arch/x86/ F: xen/include/public/arch-x86/ F: xen/include/xen/lib/x86 F: xen/lib/x86 +F: xen/tools/gen-cpuid.py F: tools/firmware/hvmloader/ F: tools/firmware/rombios/ F: tools/firmware/vgabios/ diff --git a/xen/tools/gen-cpuid.py b/xen/tools/gen-cpuid.py index 72cf11654b..4a1ca58905 100755 --- a/xen/tools/gen-cpuid.py +++ b/xen/tools/gen-cpuid.py @@ -363,8 +363,8 @@ def crunch_numbers(state): state.deep_features = deps.keys() state.nr_deep_deps = len(state.deep_deps.keys()) - # Calculate the bitfield name declarations - for word in range(state.nr_entries): + # Calculate the bitfield name declarations. Leave 4 placeholders on the end + for word in range(state.nr_entries + 4): names = [] for bit in range(32): @@ -382,7 +382,10 @@ def crunch_numbers(state): names.append(name.lower()) - state.bitfields.append("bool " + ":1, ".join(names) + ":1") + if any(names): + state.bitfields.append("bool " + ":1, ".join(names) + ":1") + else: + state.bitfields.append("uint32_t _placeholder_%u" % (word, )) def write_results(state): @@ -464,8 +467,6 @@ def write_results(state): """) - state.bitfields += ["uint32_t :32 /* placeholder */"] * 4 - for idx, text in enumerate(state.bitfields): state.output.write( "#define CPUID_BITFIELD_%d \\\n %s\n\n"