[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-ia64-devel] Re: PATCH: all registers in vcpu_guest_context



On Thu, 2007-05-10 at 09:33 +0200, tgingold@xxxxxxx wrote:
> Quoting Alex Williamson <alex.williamson@xxxxxx>:
> >    I just noticed another problem, checker doesn't build on x86_32/64
> > with this:
> Yes, I saw this yesterday during a cross-make.
> 
> > Could you take a look?  Thanks,
> I won't be able to fix this before 2 or 3 weeks (I am away).
> The fix is not trivial because mkheader.py doesn't handle union yet.
> 
> A simple work-around is not to build ia64.h on x86.
> 
> Sorry for this issue.

Hi Tristan,

   Is something like the patch below what you had in mind?  Thanks,

        Alex


Signed-off-by: Alex Williamson <alex.williamson@xxxxxx>
---

diff -r eabda101b0c5 xen/include/public/foreign/mkheader.py
--- a/xen/include/public/foreign/mkheader.py    Tue May 08 13:12:52 2007 -0600
+++ b/xen/include/public/foreign/mkheader.py    Thu May 10 12:39:21 2007 -0600
@@ -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 eabda101b0c5 xen/include/public/foreign/reference.size
--- a/xen/include/public/foreign/reference.size Tue May 08 13:12:52 2007 -0600
+++ b/xen/include/public/foreign/reference.size Thu May 10 12:53:04 2007 -0600
@@ -7,7 +7,8 @@ cpu_user_regs        |      68     200  
 cpu_user_regs        |      68     200     496
 xen_ia64_boot_param  |       -       -      96
 ia64_tr_entry        |       -       -      32
-vcpu_extra_regs      |       -       -       -
+vcpu_tr_regs         |       -       -     512
+vcpu_guest_context_regs |       -       -   21872
 vcpu_guest_context   |    2800    5168   21904
 arch_vcpu_info       |      24      16       0
 vcpu_time_info       |      32      32      32
diff -r eabda101b0c5 xen/include/public/foreign/structs.py
--- a/xen/include/public/foreign/structs.py     Tue May 08 13:12:52 2007 -0600
+++ b/xen/include/public/foreign/structs.py     Thu May 10 12:49:41 2007 -0600
@@ -1,4 +1,7 @@
 # configuration: what needs translation
+
+unions  = [ "vcpu_cr_regs",
+            "vcpu_ar_regs" ];
 
 structs = [ "start_info",
             "trap_info",
@@ -6,7 +9,8 @@ structs = [ "start_info",
             "cpu_user_regs",
             "xen_ia64_boot_param",
             "ia64_tr_entry",
-            "vcpu_extra_regs",
+            "vcpu_tr_regs",
+            "vcpu_guest_context_regs",
             "vcpu_guest_context",
             "arch_vcpu_info",
             "vcpu_time_info",



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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.