From mboxrd@z Thu Jan 1 00:00:00 1970 From: kraxel@suse.de Subject: [patch rfc 3/3] xen arch header rework, check utility. Date: Thu, 05 Oct 2006 11:05:46 +0200 Message-ID: <20061005090633.965801000@suse.de> References: <20061005090543.625074000@suse.de> Return-path: Content-Disposition: inline; filename=arch-headers-check.diff List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com Cc: jbeulich@novell.com List-Id: xen-devel@lists.xenproject.org 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 Cc: Jan Beulich --- 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 +#include +#include + +#include +#include +#include + +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; +} --