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-devel

[Xen-devel] [patch rfc 3/3] xen arch header rework, check utility.

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [patch rfc 3/3] xen arch header rework, check utility.
From: kraxel@xxxxxxx
Date: Thu, 05 Oct 2006 11:05:46 +0200
Cc: jbeulich@xxxxxxxxxx
Delivery-date: Thu, 05 Oct 2006 02:23:10 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <20061005090543.625074000@xxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: quilt/0.44-15
This adds a tiny utility to verify the patch is correct, by printing the
sizes of the structures.  Compile once on 32bit and once on 64bit,
compare the results, it they don't match something is wrong ...

Signed-off-by: Gerd Hoffmann <kraxel@xxxxxxx>
Cc: Jan Beulich <jbeulich@xxxxxxxxxx>
---
 tools/xcutils/Makefile        |    1 +
 tools/xcutils/check-structs.c |   32 ++++++++++++++++++++++++++++++++
 2 files changed, 33 insertions(+)

Index: build-64-unstable-11624/tools/xcutils/Makefile
===================================================================
--- build-64-unstable-11624.orig/tools/xcutils/Makefile
+++ build-64-unstable-11624/tools/xcutils/Makefile
@@ -27,6 +27,7 @@ CFLAGS += -Wp,-MD,.$(@F).d
 PROG_DEP = .*.d
 
 PROGRAMS               = xc_restore xc_save readnotes
+PROGRAMS               += check-structs
 
 LDLIBS                 = -L$(XEN_LIBXC) -lxenguest -lxenctrl
 
Index: build-64-unstable-11624/tools/xcutils/check-structs.c
===================================================================
--- /dev/null
+++ build-64-unstable-11624/tools/xcutils/check-structs.c
@@ -0,0 +1,32 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+#include <xenctrl.h>
+#include <xen/arch-x86_32.h>
+#include <xen/arch-x86_64.h>
+
+int main(int argc, char *argv[])
+{
+       printf("%-20s %-6s %-6s\n", "struct", "x86_32", "x86_64");
+       printf("----------------------------------\n");
+       printf("%-20s %6zd %6zd\n", "trap_info_t",
+              sizeof(trap_info_x86_32_t),
+              sizeof(trap_info_x86_64_t));
+       printf("%-20s %6zd %6zd\n", "cpu_user_regs_t",
+              sizeof(cpu_user_regs_x86_32_t),
+              sizeof(cpu_user_regs_x86_64_t));
+       printf("%-20s %6zd %6zd\n", "vcpu_guest_context_t",
+              sizeof(vcpu_guest_context_x86_32_t),
+              sizeof(vcpu_guest_context_x86_64_t));
+       printf("%-20s %6zd %6zd\n", "arch_shared_info_t",
+              sizeof(arch_shared_info_x86_32_t),
+              sizeof(arch_shared_info_x86_64_t));
+       printf("%-20s %6zd %6zd\n", "arch_vcpu_info_t",
+              sizeof(arch_vcpu_info_x86_32_t),
+              sizeof(arch_vcpu_info_x86_64_t));
+       printf("%-20s %6zd %6zd\n", "xen_callback_t",
+              sizeof(xen_callback_x86_32_t),
+              sizeof(xen_callback_x86_64_t));
+       return 0;
+}

--

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