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] Hide compile-time information value

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] [XEN] Hide compile-time information values behind a
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 01 Aug 2006 19:20:25 +0000
Delivery-date: Tue, 01 Aug 2006 12:24:18 -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 kfraser@xxxxxxxxxxxxxxxxxxxxx
# Node ID b786bfb058eb3ac0806f76094126b2857471d3a7
# Parent  d8d66e2c19b285675c2f30e123105c9f1861dc28
[XEN] Hide compile-time information values behind a
functional interface, so that the values are contained
within a single object file.
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
---
 xen/Makefile                       |   10 +-----
 xen/Rules.mk                       |    1 
 xen/arch/ia64/xen/dom_fw.c         |   14 +++++----
 xen/arch/ia64/xen/domain.c         |    5 +--
 xen/arch/ia64/xen/xensetup.c       |   10 +++---
 xen/arch/powerpc/boot_of.c         |    8 ++---
 xen/arch/powerpc/domain_build.c    |    4 +-
 xen/arch/powerpc/mpic_init.c       |    1 
 xen/arch/powerpc/ofd_fixup.c       |    4 +-
 xen/arch/powerpc/powerpc64/traps.c |    4 +-
 xen/arch/x86/domain_build.c        |    5 +--
 xen/arch/x86/setup.c               |   22 +++++++-------
 xen/arch/x86/x86_32/traps.c        |    6 +--
 xen/arch/x86/x86_64/traps.c        |    6 +--
 xen/common/Makefile                |    3 +
 xen/common/kernel.c                |   16 +++++-----
 xen/common/version.c               |   56 +++++++++++++++++++++++++++++++++++++
 xen/drivers/char/Makefile          |    3 -
 xen/drivers/char/console.c         |   12 +++----
 xen/include/xen/version.h          |   16 ++++++++++
 20 files changed, 140 insertions(+), 66 deletions(-)

diff -r d8d66e2c19b2 -r b786bfb058eb xen/Makefile
--- a/xen/Makefile      Tue Aug 01 14:34:18 2006 +0100
+++ b/xen/Makefile      Tue Aug 01 15:28:09 2006 +0100
@@ -72,7 +72,7 @@ _distclean: clean
 .PHONY: delete-unfresh-files
 delete-unfresh-files:
        @if [ ! -r include/xen/compile.h -o -O include/xen/compile.h ]; then \
-               rm -f include/xen/{banner,compile}.h; \
+               rm -f include/xen/compile.h; \
        fi
 
 # acm_policy.h contains security policy for Xen
@@ -91,7 +91,7 @@ include/xen/acm_policy.h:
 
 # compile.h contains dynamic build info. Rebuilt on every 'make' invocation.
 include/xen/compile.h: LANG=C
-include/xen/compile.h: include/xen/compile.h.in include/xen/banner.h
+include/xen/compile.h: include/xen/compile.h.in
        @sed -e 's/@@date@@/$(shell date)/g' \
            -e 's/@@time@@/$(shell date +%T)/g' \
            -e 's/@@whoami@@/$(shell whoami)/g' \
@@ -103,11 +103,7 @@ include/xen/compile.h: include/xen/compi
            -e 's/@@extraversion@@/$(XEN_EXTRAVERSION)/g' \
            -e 's!@@changeset@@!$(shell ((hg parents || head -n 7 ../ChangeLog 
|| echo date: unavailable) | awk '{FS="changeset:[ 
]+"}/^changeset/{CS=$$2};{FS="date:[ ]+"}/^date/{D=$$2}; END {print D, CS}') 
2>/dev/null)!g' \
            < include/xen/compile.h.in > $@.new
-       @cat include/xen/banner.h >> $@.new
-       @mv -f $@.new $@
-
-include/xen/banner.h:
-       tools/figlet/figlet -d tools/figlet Xen $(XEN_FULLVERSION) > $@.new
+       tools/figlet/figlet -d tools/figlet Xen $(XEN_FULLVERSION) >> $@.new
        @mv -f $@.new $@
 
 include/asm-$(TARGET_ARCH)/asm-offsets.h: arch/$(TARGET_ARCH)/asm-offsets.s
diff -r d8d66e2c19b2 -r b786bfb058eb xen/Rules.mk
--- a/xen/Rules.mk      Tue Aug 01 14:34:18 2006 +0100
+++ b/xen/Rules.mk      Tue Aug 01 15:28:09 2006 +0100
@@ -43,7 +43,6 @@ include $(BASEDIR)/arch/$(TARGET_ARCH)/R
 
 # Do not depend on auto-generated header files.
 HDRS := $(subst $(BASEDIR)/include/asm-$(TARGET_ARCH)/asm-offsets.h,,$(HDRS))
-HDRS := $(subst $(BASEDIR)/include/xen/banner.h,,$(HDRS))
 HDRS := $(subst $(BASEDIR)/include/xen/compile.h,,$(HDRS))
 
 # Note that link order matters!
diff -r d8d66e2c19b2 -r b786bfb058eb xen/arch/ia64/xen/dom_fw.c
--- a/xen/arch/ia64/xen/dom_fw.c        Tue Aug 01 14:34:18 2006 +0100
+++ b/xen/arch/ia64/xen/dom_fw.c        Tue Aug 01 15:28:09 2006 +0100
@@ -19,7 +19,7 @@
 #include <asm/sal.h>
 #include <asm/meminit.h>
 #include <asm/fpswa.h>
-#include <xen/compile.h>
+#include <xen/version.h>
 #include <xen/acpi.h>
 
 #include <asm/dom_fw.h>
@@ -353,7 +353,8 @@ dom_fw_fake_acpi(struct domain *d, struc
        strcpy(xsdt->oem_id, "XEN");
        strcpy(xsdt->oem_table_id, "Xen/ia64");
        strcpy(xsdt->asl_compiler_id, "XEN");
-       xsdt->asl_compiler_revision = (XEN_VERSION<<16)|(XEN_SUBVERSION);
+       xsdt->asl_compiler_revision = (xen_major_version() << 16) |
+               xen_minor_version();
 
        xsdt->table_offset_entry[0] = dom_pa((unsigned long) fadt);
        tables->madt_ptr = dom_pa((unsigned long) madt);
@@ -367,7 +368,8 @@ dom_fw_fake_acpi(struct domain *d, struc
        strcpy(fadt->oem_id, "XEN");
        strcpy(fadt->oem_table_id, "Xen/ia64");
        strcpy(fadt->asl_compiler_id, "XEN");
-       fadt->asl_compiler_revision = (XEN_VERSION<<16)|(XEN_SUBVERSION);
+       fadt->asl_compiler_revision = (xen_major_version() << 16) |
+               xen_minor_version();
 
        strncpy(facs->signature, FACS_SIG, 4);
        facs->version = 1;
@@ -413,7 +415,8 @@ dom_fw_fake_acpi(struct domain *d, struc
        strcpy(dsdt->oem_id, "XEN");
        strcpy(dsdt->oem_table_id, "Xen/ia64");
        strcpy(dsdt->asl_compiler_id, "XEN");
-       dsdt->asl_compiler_revision = (XEN_VERSION<<16)|(XEN_SUBVERSION);
+       dsdt->asl_compiler_revision = (xen_major_version() << 16) |
+               xen_minor_version();
 
        /* Trivial namespace, avoids ACPI CA complaints */
        tables->aml[0] = 0x10; /* Scope */
@@ -454,7 +457,8 @@ dom_fw_fake_acpi(struct domain *d, struc
        strcpy(madt->header.oem_id, "XEN");
        strcpy(madt->header.oem_table_id, "Xen/ia64");
        strcpy(madt->header.asl_compiler_id, "XEN");
-       madt->header.asl_compiler_revision = (XEN_VERSION<<16)|(XEN_SUBVERSION);
+       madt->header.asl_compiler_revision = (xen_major_version() << 16) |
+               xen_minor_version();
 
        /* An LSAPIC entry describes a CPU.  */
        for (i = 0; i < MAX_VIRT_CPUS; i++) {
diff -r d8d66e2c19b2 -r b786bfb058eb xen/arch/ia64/xen/domain.c
--- a/xen/arch/ia64/xen/domain.c        Tue Aug 01 14:34:18 2006 +0100
+++ b/xen/arch/ia64/xen/domain.c        Tue Aug 01 15:28:09 2006 +0100
@@ -30,7 +30,7 @@
 #include <asm/processor.h>
 #include <xen/event.h>
 #include <xen/console.h>
-#include <xen/compile.h>
+#include <xen/version.h>
 #include <xen/elf.h>
 #include <asm/pgalloc.h>
 #include <asm/offsets.h>  /* for IA64_THREAD_INFO_SIZE */
@@ -1069,7 +1069,8 @@ int construct_dom0(struct domain *d,
                panic("can't allocate start info page");
        si = page_to_virt(start_info_page);
        memset(si, 0, PAGE_SIZE);
-       sprintf(si->magic, "xen-%i.%i-ia64", XEN_VERSION, XEN_SUBVERSION);
+       sprintf(si->magic, "xen-%i.%i-ia64",
+               xen_major_version(), xen_minor_version());
        si->nr_pages     = max_pages;
        si->flags = SIF_INITDOMAIN|SIF_PRIVILEGED;
 
diff -r d8d66e2c19b2 -r b786bfb058eb xen/arch/ia64/xen/xensetup.c
--- a/xen/arch/ia64/xen/xensetup.c      Tue Aug 01 14:34:18 2006 +0100
+++ b/xen/arch/ia64/xen/xensetup.c      Tue Aug 01 15:28:09 2006 +0100
@@ -13,7 +13,7 @@
 #include <xen/mm.h>
 #include <public/version.h>
 #include <xen/gdbstub.h>
-#include <xen/compile.h>
+#include <xen/version.h>
 #include <xen/console.h>
 #include <xen/domain.h>
 #include <xen/serial.h>
@@ -547,11 +547,13 @@ void arch_get_xen_caps(xen_capabilities_
 void arch_get_xen_caps(xen_capabilities_info_t info)
 {
     char *p=info;
-
-    p += sprintf(p,"xen-%d.%d-ia64 ", XEN_VERSION, XEN_SUBVERSION);
+    int major = xen_major_version();
+    int minor = xen_minor_version();
+
+    p += sprintf(p,"xen-%d.%d-ia64 ", major, minor);
 
     if (vmx_enabled)
-        p += sprintf(p,"hvm-%d.%d-ia64 ", XEN_VERSION, XEN_SUBVERSION);
+        p += sprintf(p,"hvm-%d.%d-ia64 ", major, minor);
 
     *(p-1) = 0;
 
diff -r d8d66e2c19b2 -r b786bfb058eb xen/arch/powerpc/boot_of.c
--- a/xen/arch/powerpc/boot_of.c        Tue Aug 01 14:34:18 2006 +0100
+++ b/xen/arch/powerpc/boot_of.c        Tue Aug 01 15:28:09 2006 +0100
@@ -22,7 +22,7 @@
 #include <xen/init.h>
 #include <xen/lib.h>
 #include <xen/multiboot.h>
-#include <xen/compile.h>
+#include <xen/version.h>
 #include <xen/spinlock.h>
 #include <xen/serial.h>
 #include <xen/time.h>
@@ -976,9 +976,9 @@ multiboot_info_t __init *boot_of_init(
 
     of_printf("%s\n", "---------------------------------------------------");
     of_printf("OF: Xen/PPC version %d.%d%s (%s@%s) (%s) %s\n",
-              XEN_VERSION, XEN_SUBVERSION, XEN_EXTRAVERSION,
-              XEN_COMPILE_BY, XEN_COMPILE_DOMAIN,
-              XEN_COMPILER, XEN_COMPILE_DATE);
+              xen_major_version(), xen_minor_version(), xen_extra_version(),
+              xen_compile_by(), xen_compile_domain(),
+              xen_compiler(), xen_compile_date());
 
     of_printf("%s args: 0x%lx 0x%lx 0x%lx 0x%lx 0x%lx\n"
             "boot msr: 0x%lx\n",
diff -r d8d66e2c19b2 -r b786bfb058eb xen/arch/powerpc/domain_build.c
--- a/xen/arch/powerpc/domain_build.c   Tue Aug 01 14:34:18 2006 +0100
+++ b/xen/arch/powerpc/domain_build.c   Tue Aug 01 15:28:09 2006 +0100
@@ -25,7 +25,7 @@
 #include <xen/init.h>
 #include <xen/ctype.h>
 #include <xen/iocap.h>
-#include <xen/compile.h>
+#include <xen/version.h>
 #include <asm/processor.h>
 #include <asm/papr.h>
 #include "oftree.h"
@@ -153,7 +153,7 @@ int construct_dom0(struct domain *d,
     printk("xen_start_info: %p\n", si);
 
     sprintf(si->magic, "xen-%i.%i-powerpc%d%s",
-            XEN_VERSION, XEN_SUBVERSION, BITS_PER_LONG, "HV");
+            xen_major_version(), xen_minor_version(), BITS_PER_LONG, "HV");
     si->flags = SIF_PRIVILEGED | SIF_INITDOMAIN;
 
     si->shared_info = ((ulong)d->shared_info) - rma;
diff -r d8d66e2c19b2 -r b786bfb058eb xen/arch/powerpc/mpic_init.c
--- a/xen/arch/powerpc/mpic_init.c      Tue Aug 01 14:34:18 2006 +0100
+++ b/xen/arch/powerpc/mpic_init.c      Tue Aug 01 15:28:09 2006 +0100
@@ -21,7 +21,6 @@
 #include <xen/config.h>
 #include <xen/init.h>
 #include <xen/lib.h>
-#include <xen/compile.h>
 #include <asm/mpic.h>
 #include "mpic_init.h"
 #include "oftree.h"
diff -r d8d66e2c19b2 -r b786bfb058eb xen/arch/powerpc/ofd_fixup.c
--- a/xen/arch/powerpc/ofd_fixup.c      Tue Aug 01 14:34:18 2006 +0100
+++ b/xen/arch/powerpc/ofd_fixup.c      Tue Aug 01 15:28:09 2006 +0100
@@ -21,7 +21,7 @@
 #include <xen/config.h>
 #include <xen/lib.h>
 #include <xen/sched.h>
-#include <xen/compile.h>
+#include <xen/version.h>
 #include <public/xen.h>
 #include "of-devtree.h"
 
@@ -420,7 +420,7 @@ static ofdn_t ofd_xen_props(void *m, str
         ofd_prop_add(m, n, "name", &path[1], sizeof (path) - 1);
 
         xl = snprintf(xen, sizeof (xen), "Xen-%d.%d%s",
-                XEN_VERSION, XEN_SUBVERSION, XEN_EXTRAVERSION);
+                xen_major_version(), xen_minor_version(), xen_extra_version());
         ASSERT(xl < sizeof (xen));
         ofd_prop_add(m, n, "version", xen, xl + 1);
 
diff -r d8d66e2c19b2 -r b786bfb058eb xen/arch/powerpc/powerpc64/traps.c
--- a/xen/arch/powerpc/powerpc64/traps.c        Tue Aug 01 14:34:18 2006 +0100
+++ b/xen/arch/powerpc/powerpc64/traps.c        Tue Aug 01 15:28:09 2006 +0100
@@ -22,7 +22,7 @@
 #include <xen/lib.h>
 #include <xen/console.h>
 #include <public/xen.h>
-#include <xen/compile.h>
+#include <xen/version.h>
 #include <xen/sched.h>
 
 void show_registers(struct cpu_user_regs *regs)
@@ -32,7 +32,7 @@ void show_registers(struct cpu_user_regs
     console_start_sync();
     
     printk("----[ Xen-%d.%d%s     ]----\n",
-           XEN_VERSION, XEN_SUBVERSION, XEN_EXTRAVERSION);
+           xen_major_version(), xen_minor_version(), xen_extra_version());
     printk("CPU: %08x   DOMID: %08x\n",
            smp_processor_id(), current->domain->domain_id);
     printk("pc %016lx msr %016lx\n"
diff -r d8d66e2c19b2 -r b786bfb058eb xen/arch/x86/domain_build.c
--- a/xen/arch/x86/domain_build.c       Tue Aug 01 14:34:18 2006 +0100
+++ b/xen/arch/x86/domain_build.c       Tue Aug 01 15:28:09 2006 +0100
@@ -15,7 +15,7 @@
 #include <xen/elf.h>
 #include <xen/kernel.h>
 #include <xen/domain.h>
-#include <xen/compile.h>
+#include <xen/version.h>
 #include <xen/iocap.h>
 #include <xen/bitops.h>
 #include <asm/regs.h>
@@ -726,7 +726,8 @@ int construct_dom0(struct domain *d,
     si->nr_pt_frames = nr_pt_pages;
     si->mfn_list     = vphysmap_start;
     sprintf(si->magic, "xen-%i.%i-x86_%d%s",
-            XEN_VERSION, XEN_SUBVERSION, BITS_PER_LONG, xen_pae ? "p" : "");
+            xen_major_version(), xen_minor_version(),
+            BITS_PER_LONG, xen_pae ? "p" : "");
 
     /* Write the phys->machine and machine->phys table entries. */
     for ( pfn = 0; pfn < d->tot_pages; pfn++ )
diff -r d8d66e2c19b2 -r b786bfb058eb xen/arch/x86/setup.c
--- a/xen/arch/x86/setup.c      Tue Aug 01 14:34:18 2006 +0100
+++ b/xen/arch/x86/setup.c      Tue Aug 01 15:28:09 2006 +0100
@@ -12,7 +12,7 @@
 #include <xen/trace.h>
 #include <xen/multiboot.h>
 #include <xen/domain_page.h>
-#include <xen/compile.h>
+#include <xen/version.h>
 #include <xen/gdbstub.h>
 #include <xen/percpu.h>
 #include <public/version.h>
@@ -612,30 +612,32 @@ void arch_get_xen_caps(xen_capabilities_
 void arch_get_xen_caps(xen_capabilities_info_t info)
 {
     char *p = info;
+    int major = xen_major_version();
+    int minor = xen_minor_version();
 
 #if defined(CONFIG_X86_32) && !defined(CONFIG_X86_PAE)
 
-    p += sprintf(p, "xen-%d.%d-x86_32 ", XEN_VERSION, XEN_SUBVERSION);
+    p += sprintf(p, "xen-%d.%d-x86_32 ", major, minor);
     if ( hvm_enabled )
-        p += sprintf(p, "hvm-%d.%d-x86_32 ", XEN_VERSION, XEN_SUBVERSION);
+        p += sprintf(p, "hvm-%d.%d-x86_32 ", major, minor);
 
 #elif defined(CONFIG_X86_32) && defined(CONFIG_X86_PAE)
 
-    p += sprintf(p, "xen-%d.%d-x86_32p ", XEN_VERSION, XEN_SUBVERSION);
+    p += sprintf(p, "xen-%d.%d-x86_32p ", major, minor);
     if ( hvm_enabled )
     {
-        p += sprintf(p, "hvm-%d.%d-x86_32 ", XEN_VERSION, XEN_SUBVERSION);
-        p += sprintf(p, "hvm-%d.%d-x86_32p ", XEN_VERSION, XEN_SUBVERSION);
+        p += sprintf(p, "hvm-%d.%d-x86_32 ", major, minor);
+        p += sprintf(p, "hvm-%d.%d-x86_32p ", major, minor);
     }
 
 #elif defined(CONFIG_X86_64)
 
-    p += sprintf(p, "xen-%d.%d-x86_64 ", XEN_VERSION, XEN_SUBVERSION);
+    p += sprintf(p, "xen-%d.%d-x86_64 ", major, minor);
     if ( hvm_enabled )
     {
-        p += sprintf(p, "hvm-%d.%d-x86_32 ", XEN_VERSION, XEN_SUBVERSION);
-        p += sprintf(p, "hvm-%d.%d-x86_32p ", XEN_VERSION, XEN_SUBVERSION);
-        p += sprintf(p, "hvm-%d.%d-x86_64 ", XEN_VERSION, XEN_SUBVERSION);
+        p += sprintf(p, "hvm-%d.%d-x86_32 ", major, minor);
+        p += sprintf(p, "hvm-%d.%d-x86_32p ", major, minor);
+        p += sprintf(p, "hvm-%d.%d-x86_64 ", major, minor);
     }
 
 #else
diff -r d8d66e2c19b2 -r b786bfb058eb xen/arch/x86/x86_32/traps.c
--- a/xen/arch/x86/x86_32/traps.c       Tue Aug 01 14:34:18 2006 +0100
+++ b/xen/arch/x86/x86_32/traps.c       Tue Aug 01 15:28:09 2006 +0100
@@ -1,6 +1,6 @@
 
 #include <xen/config.h>
-#include <xen/compile.h>
+#include <xen/version.h>
 #include <xen/domain_page.h>
 #include <xen/init.h>
 #include <xen/sched.h>
@@ -52,7 +52,7 @@ void show_registers(struct cpu_user_regs
     }
 
     printk("----[ Xen-%d.%d%s    %s ]----\n",
-           XEN_VERSION, XEN_SUBVERSION, XEN_EXTRAVERSION,
+           xen_major_version(), xen_minor_version(), xen_extra_version(),
            print_tainted(taint_str));
     printk("CPU:    %d\nEIP:    %04x:[<%08x>]",
            smp_processor_id(), fault_regs.cs, fault_regs.eip);
@@ -131,7 +131,7 @@ asmlinkage void do_double_fault(void)
     /* Find information saved during fault and dump it to the console. */
     tss = &init_tss[cpu];
     printk("*** DOUBLE FAULT: Xen-%d.%d%s    %s\n",
-           XEN_VERSION, XEN_SUBVERSION, XEN_EXTRAVERSION,
+           xen_major_version(), xen_minor_version(), xen_extra_version(),
            print_tainted(taint_str));
     printk("CPU:    %d\nEIP:    %04x:[<%08x>]",
            cpu, tss->cs, tss->eip);
diff -r d8d66e2c19b2 -r b786bfb058eb xen/arch/x86/x86_64/traps.c
--- a/xen/arch/x86/x86_64/traps.c       Tue Aug 01 14:34:18 2006 +0100
+++ b/xen/arch/x86/x86_64/traps.c       Tue Aug 01 15:28:09 2006 +0100
@@ -1,6 +1,6 @@
 
 #include <xen/config.h>
-#include <xen/compile.h>
+#include <xen/version.h>
 #include <xen/init.h>
 #include <xen/sched.h>
 #include <xen/lib.h>
@@ -45,7 +45,7 @@ void show_registers(struct cpu_user_regs
     }
 
     printk("----[ Xen-%d.%d%s    %s ]----\n",
-           XEN_VERSION, XEN_SUBVERSION, XEN_EXTRAVERSION,
+           xen_major_version(), xen_minor_version(), xen_extra_version(),
            print_tainted(taint_str));
     printk("CPU:    %d\nRIP:    %04x:[<%016lx>]",
            smp_processor_id(), fault_regs.cs, fault_regs.rip);
@@ -128,7 +128,7 @@ asmlinkage void do_double_fault(struct c
 
     /* Find information saved during fault and dump it to the console. */
     printk("*** DOUBLE FAULT: Xen-%d.%d%s    %s\n",
-           XEN_VERSION, XEN_SUBVERSION, XEN_EXTRAVERSION,
+           xen_major_version(), xen_minor_version(), xen_extra_version(),
            print_tainted(taint_str));
     printk("CPU:    %d\nRIP:    %04x:[<%016lx>]",
            cpu, regs->cs, regs->rip);
diff -r d8d66e2c19b2 -r b786bfb058eb xen/common/Makefile
--- a/xen/common/Makefile       Tue Aug 01 14:34:18 2006 +0100
+++ b/xen/common/Makefile       Tue Aug 01 15:28:09 2006 +0100
@@ -21,6 +21,7 @@ obj-y += symbols.o
 obj-y += symbols.o
 obj-y += trace.o
 obj-y += timer.o
+obj-y += version.o
 obj-y += vsprintf.o
 obj-y += xmalloc.o
 
@@ -28,4 +29,4 @@ obj-$(crash_debug) += gdbstub.o
 obj-$(crash_debug) += gdbstub.o
 
 # Object file contains changeset and compiler information.
-kernel.o: $(BASEDIR)/include/xen/compile.h
+version.o: $(BASEDIR)/include/xen/compile.h
diff -r d8d66e2c19b2 -r b786bfb058eb xen/common/kernel.c
--- a/xen/common/kernel.c       Tue Aug 01 14:34:18 2006 +0100
+++ b/xen/common/kernel.c       Tue Aug 01 15:28:09 2006 +0100
@@ -8,7 +8,7 @@
 #include <xen/init.h>
 #include <xen/lib.h>
 #include <xen/errno.h>
-#include <xen/compile.h>
+#include <xen/version.h>
 #include <xen/sched.h>
 #include <xen/shadow.h>
 #include <xen/guest_access.h>
@@ -125,13 +125,13 @@ long do_xen_version(int cmd, XEN_GUEST_H
     {
     case XENVER_version:
     {
-        return (XEN_VERSION<<16) | (XEN_SUBVERSION);
+        return (xen_major_version() << 16) | xen_minor_version();
     }
 
     case XENVER_extraversion:
     {
         xen_extraversion_t extraversion;
-        safe_strcpy(extraversion, XEN_EXTRAVERSION);
+        safe_strcpy(extraversion, xen_extra_version());
         if ( copy_to_guest(arg, (char *)extraversion, sizeof(extraversion)) )
             return -EFAULT;
         return 0;
@@ -140,10 +140,10 @@ long do_xen_version(int cmd, XEN_GUEST_H
     case XENVER_compile_info:
     {
         struct xen_compile_info info;
-        safe_strcpy(info.compiler,       XEN_COMPILER);
-        safe_strcpy(info.compile_by,     XEN_COMPILE_BY);
-        safe_strcpy(info.compile_domain, XEN_COMPILE_DOMAIN);
-        safe_strcpy(info.compile_date,   XEN_COMPILE_DATE);
+        safe_strcpy(info.compiler,       xen_compiler());
+        safe_strcpy(info.compile_by,     xen_compile_by());
+        safe_strcpy(info.compile_domain, xen_compile_domain());
+        safe_strcpy(info.compile_date,   xen_compile_date());
         if ( copy_to_guest(arg, &info, 1) )
             return -EFAULT;
         return 0;
@@ -176,7 +176,7 @@ long do_xen_version(int cmd, XEN_GUEST_H
     case XENVER_changeset:
     {
         xen_changeset_info_t chgset;
-        safe_strcpy(chgset, XEN_CHANGESET);
+        safe_strcpy(chgset, xen_changeset());
         if ( copy_to_guest(arg, (char *)chgset, sizeof(chgset)) )
             return -EFAULT;
         return 0;
diff -r d8d66e2c19b2 -r b786bfb058eb xen/drivers/char/Makefile
--- a/xen/drivers/char/Makefile Tue Aug 01 14:34:18 2006 +0100
+++ b/xen/drivers/char/Makefile Tue Aug 01 15:28:09 2006 +0100
@@ -1,6 +1,3 @@ obj-y += console.o
 obj-y += console.o
 obj-y += ns16550.o
 obj-y += serial.o
-
-# Object file contains changeset and compiler information.
-console.o: $(BASEDIR)/include/xen/compile.h
diff -r d8d66e2c19b2 -r b786bfb058eb xen/drivers/char/console.c
--- a/xen/drivers/char/console.c        Tue Aug 01 14:34:18 2006 +0100
+++ b/xen/drivers/char/console.c        Tue Aug 01 15:28:09 2006 +0100
@@ -8,7 +8,7 @@
 
 #include <stdarg.h>
 #include <xen/config.h>
-#include <xen/compile.h>
+#include <xen/version.h>
 #include <xen/init.h>
 #include <xen/lib.h>
 #include <xen/errno.h>
@@ -488,14 +488,14 @@ void init_console(void)
     serial_set_rx_handler(sercon_handle, serial_rx);
 
     /* HELLO WORLD --- start-of-day banner text. */
-    printk(XEN_BANNER);
+    printk(xen_banner());
     printk(" http://www.cl.cam.ac.uk/netos/xen\n";);
     printk(" University of Cambridge Computer Laboratory\n\n");
     printk(" Xen version %d.%d%s (%s@%s) (%s) %s\n",
-           XEN_VERSION, XEN_SUBVERSION, XEN_EXTRAVERSION,
-           XEN_COMPILE_BY, XEN_COMPILE_DOMAIN,
-           XEN_COMPILER, XEN_COMPILE_DATE);
-    printk(" Latest ChangeSet: %s\n\n", XEN_CHANGESET);
+           xen_major_version(), xen_minor_version(), xen_extra_version(),
+           xen_compile_by(), xen_compile_domain(),
+           xen_compiler(), xen_compile_date());
+    printk(" Latest ChangeSet: %s\n\n", xen_changeset());
     set_printk_prefix("(XEN) ");
 
     if ( opt_sync_console )
diff -r d8d66e2c19b2 -r b786bfb058eb xen/common/version.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/common/version.c      Tue Aug 01 15:28:09 2006 +0100
@@ -0,0 +1,56 @@
+#include <xen/compile.h>
+
+const char *xen_compile_date(void)
+{
+    return XEN_COMPILE_DATE;
+}
+
+const char *xen_compile_time(void)
+{
+    return XEN_COMPILE_TIME;
+}
+
+const char *xen_compile_by(void)
+{
+    return XEN_COMPILE_BY;
+}
+
+const char *xen_compile_domain(void)
+{
+    return XEN_COMPILE_DOMAIN;
+}
+
+const char *xen_compile_host(void)
+{
+    return XEN_COMPILE_HOST;
+}
+
+const char *xen_compiler(void)
+{
+    return XEN_COMPILER;
+}
+
+unsigned int xen_major_version(void)
+{
+    return XEN_VERSION;
+}
+
+unsigned int xen_minor_version(void)
+{
+    return XEN_SUBVERSION;
+}
+
+const char *xen_extra_version(void)
+{
+    return XEN_EXTRAVERSION;
+}
+
+const char *xen_changeset(void)
+{
+    return XEN_CHANGESET;
+}
+
+const char *xen_banner(void)
+{
+    return XEN_BANNER;
+}
diff -r d8d66e2c19b2 -r b786bfb058eb xen/include/xen/version.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/include/xen/version.h Tue Aug 01 15:28:09 2006 +0100
@@ -0,0 +1,16 @@
+#ifndef __XEN_VERSION_H__
+#define __XEN_VERSION_H__
+
+const char *xen_compile_date(void);
+const char *xen_compile_time(void);
+const char *xen_compile_by(void);
+const char *xen_compile_domain(void);
+const char *xen_compile_host(void);
+const char *xen_compiler(void);
+unsigned int xen_major_version(void);
+unsigned int xen_minor_version(void);
+const char *xen_extra_version(void);
+const char *xen_changeset(void);
+const char *xen_banner(void);
+
+#endif /* __XEN_VERSION_H__ */

_______________________________________________
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] Hide compile-time information values behind a, Xen patchbot-unstable <=