WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] xen: Fix struct-size checker for unions a

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] xen: Fix struct-size checker for unions and long names.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 15 May 2007 08:21:11 -0700
Delivery-date: Tue, 15 May 2007 08:22:36 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir@xxxxxxxxxxxxx>
# Date 1178970196 -3600
# Node ID 6087058857c58499d2953425c4e3fde6a3a5dc15
# Parent  e527b4ff1948bf0a262b6ede167cb88a0303ba8e
xen: Fix struct-size checker for unions and long names.
Signed-off-by: Alex Williamson <alex.williamson@xxxxxx>
---
 xen/include/public/foreign/mkchecker.py   |    4 ++--
 xen/include/public/foreign/mkheader.py    |   16 +++++++++++++++-
 xen/include/public/foreign/reference.size |   28 ++++++++++++++--------------
 xen/include/public/foreign/structs.py     |    2 ++
 4 files changed, 33 insertions(+), 17 deletions(-)

diff -r e527b4ff1948 -r 6087058857c5 xen/include/public/foreign/mkchecker.py
--- a/xen/include/public/foreign/mkchecker.py   Sat May 12 12:41:40 2007 +0100
+++ b/xen/include/public/foreign/mkchecker.py   Sat May 12 12:43:16 2007 +0100
@@ -29,14 +29,14 @@ f.write('int main(int argc, char *argv[]
 f.write('int main(int argc, char *argv[])\n{\n');
 
 f.write('\tprintf("\\n");');
-f.write('printf("%-20s |", "structs");\n');
+f.write('printf("%-25s |", "structs");\n');
 for a in archs:
     f.write('\tprintf("%%8s", "%s");\n' % a);
 f.write('\tprintf("\\n");');
 
 f.write('\tprintf("\\n");');
 for struct in structs:
-    f.write('\tprintf("%%-20s |", "%s");\n' % struct);
+    f.write('\tprintf("%%-25s |", "%s");\n' % struct);
     for a in archs:
         if a == arch:
             s = struct; # native
diff -r e527b4ff1948 -r 6087058857c5 xen/include/public/foreign/mkheader.py
--- a/xen/include/public/foreign/mkheader.py    Sat May 12 12:41:40 2007 +0100
+++ b/xen/include/public/foreign/mkheader.py    Sat May 12 12:43:16 2007 +0100
@@ -1,7 +1,7 @@
 #!/usr/bin/python
 
 import sys, re;
-from structs import structs, defines;
+from structs import unions, structs, defines;
 
 # command line arguments
 arch    = sys.argv[1];
@@ -110,6 +110,16 @@ input = re.compile("/\*(.*?)\*/", re.S).
 input = re.compile("/\*(.*?)\*/", re.S).sub("", input)
 input = re.compile("\n\s*\n", re.S).sub("\n", input);
 
+# add unions to output
+for union in unions:
+    regex = "union\s+%s\s*\{(.*?)\n\};" % union;
+    match = re.search(regex, input, re.S)
+    if None == match:
+        output += "#define %s_has_no_%s 1\n" % (arch, union);
+    else:
+        output += "union %s_%s {%s\n};\n" % (union, arch, match.group(1));
+    output += "\n";
+
 # add structs to output
 for struct in structs:
     regex = "struct\s+%s\s*\{(.*?)\n\};" % struct;
@@ -135,6 +145,10 @@ for define in defines:
         replace = define + "_" + arch;
     output = re.sub("\\b%s\\b" % define, replace, output);
 
+# replace: unions
+for union in unions:
+    output = re.sub("\\b(union\s+%s)\\b" % union, "\\1_%s" % arch, output);
+
 # replace: structs + struct typedefs
 for struct in structs:
     output = re.sub("\\b(struct\s+%s)\\b" % struct, "\\1_%s" % arch, output);
diff -r e527b4ff1948 -r 6087058857c5 xen/include/public/foreign/reference.size
--- a/xen/include/public/foreign/reference.size Sat May 12 12:41:40 2007 +0100
+++ b/xen/include/public/foreign/reference.size Sat May 12 12:43:16 2007 +0100
@@ -1,17 +1,17 @@
 
-structs              |  x86_32  x86_64    ia64
+structs                   |  x86_32  x86_64    ia64
 
-start_info           |    1104    1152    1152
-trap_info            |       8      16       -
-pt_fpreg             |       -       -      16
-cpu_user_regs        |      68     200     496
-xen_ia64_boot_param  |       -       -      96
-ia64_tr_entry        |       -       -      32
-vcpu_extra_regs      |       -       -     536
-vcpu_guest_context   |    2800    5168    1056
-arch_vcpu_info       |      24      16       0
-vcpu_time_info       |      32      32      32
-vcpu_info            |      64      64      48
-arch_shared_info     |     268     280     272
-shared_info          |    2584    3368    4384
+start_info                |    1104    1152    1152
+trap_info                 |       8      16       -
+pt_fpreg                  |       -       -      16
+cpu_user_regs             |      68     200     496
+xen_ia64_boot_param       |       -       -      96
+ia64_tr_entry             |       -       -      32
+vcpu_extra_regs           |       -       -     536
+vcpu_guest_context        |    2800    5168    1056
+arch_vcpu_info            |      24      16       0
+vcpu_time_info            |      32      32      32
+vcpu_info                 |      64      64      48
+arch_shared_info          |     268     280     272
+shared_info               |    2584    3368    4384
 
diff -r e527b4ff1948 -r 6087058857c5 xen/include/public/foreign/structs.py
--- a/xen/include/public/foreign/structs.py     Sat May 12 12:41:40 2007 +0100
+++ b/xen/include/public/foreign/structs.py     Sat May 12 12:43:16 2007 +0100
@@ -1,4 +1,6 @@
 # configuration: what needs translation
+
+unions  = [ ];
 
 structs = [ "start_info",
             "trap_info",

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] xen: Fix struct-size checker for unions and long names., Xen patchbot-unstable <=