aboutsummaryrefslogtreecommitdiffstats
path: root/tools/include/xen-foreign/mkchecker.py
diff options
context:
space:
mode:
Diffstat (limited to 'tools/include/xen-foreign/mkchecker.py')
-rw-r--r--tools/include/xen-foreign/mkchecker.py21
1 files changed, 19 insertions, 2 deletions
diff --git a/tools/include/xen-foreign/mkchecker.py b/tools/include/xen-foreign/mkchecker.py
index 66c17b19e9..fdad869a91 100644
--- a/tools/include/xen-foreign/mkchecker.py
+++ b/tools/include/xen-foreign/mkchecker.py
@@ -1,7 +1,7 @@
#!/usr/bin/python
import sys;
-from structs import structs;
+from structs import structs, compat_arches;
# command line arguments
outfile = sys.argv[1];
@@ -37,10 +37,27 @@ for struct in structs:
f.write('\tprintf("%%-25s |", "%s");\n' % struct);
for a in archs:
s = struct + "_" + a;
+ if compat_arches.has_key(a):
+ compat = compat_arches[a]
+ c = struct + "_" + compat;
+ else:
+ compat = None
f.write('#ifdef %s_has_no_%s\n' % (a, struct));
- f.write('\tprintf("%8s", "-");\n');
+ f.write('\tprintf("%8s",\n');
+ if compat:
+ f.write('# ifndef %s_has_no_%s\n' % (compat, struct));
+ f.write('\t\t"!"\n');
+ f.write('# else\n')
+ f.write('\t\t"-"\n');
+ f.write('# endif\n')
+ else:
+ f.write('\t\t"-"\n');
+ f.write('\t);\n')
f.write("#else\n");
f.write('\tprintf("%%8zd", sizeof(struct %s));\n' % s);
+ if compat:
+ f.write('\tif (sizeof(struct %s) != sizeof(struct %s))\n' % (s, c))
+ f.write('\t\tprintf("!");\n')
f.write("#endif\n");
f.write('\tprintf("\\n");\n\n');