|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [PATCH] x86/gen-cpuid: avoid violations of Misra rule 1.3
Structures or unions without any named members aren't liked by Misra
(nor the C standard). Avoid emitting such for leaves without any known
bits.
At this occasion also add the script to the X86 section in ./MAINTAINERS.
Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
--- 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/
--- a/xen/tools/gen-cpuid.py
+++ b/xen/tools/gen-cpuid.py
@@ -367,6 +367,7 @@ def crunch_numbers(state):
for word in range(state.nr_entries):
names = []
+ empty = 1
for bit in range(32):
name = state.names.get(word * 32 + bit, "")
@@ -380,9 +381,15 @@ def crunch_numbers(state):
if name in ("APIC", "OSXSAVE", "OSPKE"):
name = ""
+ if name:
+ empty = 0
+
names.append(name.lower())
- state.bitfields.append("bool " + ":1, ".join(names) + ":1")
+ if empty:
+ state.bitfields.append("unsigned int empty_" + str(word) + ":32")
+ else:
+ state.bitfields.append("bool " + ":1, ".join(names) + ":1")
def write_results(state):
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |