ia64/xen-unstable

changeset 10890:b786bfb058eb

[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@xensource.com>
author kfraser@localhost.localdomain
date Tue Aug 01 15:28:09 2006 +0100 (2006-08-01)
parents d8d66e2c19b2
children e351aace191e
files xen/Makefile xen/Rules.mk xen/arch/ia64/xen/dom_fw.c xen/arch/ia64/xen/domain.c xen/arch/ia64/xen/xensetup.c xen/arch/powerpc/boot_of.c xen/arch/powerpc/domain_build.c xen/arch/powerpc/mpic_init.c xen/arch/powerpc/ofd_fixup.c xen/arch/powerpc/powerpc64/traps.c xen/arch/x86/domain_build.c xen/arch/x86/setup.c xen/arch/x86/x86_32/traps.c xen/arch/x86/x86_64/traps.c xen/common/Makefile xen/common/kernel.c xen/common/version.c xen/drivers/char/Makefile xen/drivers/char/console.c xen/include/xen/version.h
line diff
     1.1 --- a/xen/Makefile	Tue Aug 01 14:34:18 2006 +0100
     1.2 +++ b/xen/Makefile	Tue Aug 01 15:28:09 2006 +0100
     1.3 @@ -72,7 +72,7 @@ build install debug clean distclean csco
     1.4  .PHONY: delete-unfresh-files
     1.5  delete-unfresh-files:
     1.6  	@if [ ! -r include/xen/compile.h -o -O include/xen/compile.h ]; then \
     1.7 -		rm -f include/xen/{banner,compile}.h; \
     1.8 +		rm -f include/xen/compile.h; \
     1.9  	fi
    1.10  
    1.11  # acm_policy.h contains security policy for Xen
    1.12 @@ -91,7 +91,7 @@ include/xen/acm_policy.h:
    1.13  
    1.14  # compile.h contains dynamic build info. Rebuilt on every 'make' invocation.
    1.15  include/xen/compile.h: LANG=C
    1.16 -include/xen/compile.h: include/xen/compile.h.in include/xen/banner.h
    1.17 +include/xen/compile.h: include/xen/compile.h.in
    1.18  	@sed -e 's/@@date@@/$(shell date)/g' \
    1.19  	    -e 's/@@time@@/$(shell date +%T)/g' \
    1.20  	    -e 's/@@whoami@@/$(shell whoami)/g' \
    1.21 @@ -103,11 +103,7 @@ include/xen/compile.h: include/xen/compi
    1.22  	    -e 's/@@extraversion@@/$(XEN_EXTRAVERSION)/g' \
    1.23  	    -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' \
    1.24  	    < include/xen/compile.h.in > $@.new
    1.25 -	@cat include/xen/banner.h >> $@.new
    1.26 -	@mv -f $@.new $@
    1.27 -
    1.28 -include/xen/banner.h:
    1.29 -	tools/figlet/figlet -d tools/figlet Xen $(XEN_FULLVERSION) > $@.new
    1.30 +	tools/figlet/figlet -d tools/figlet Xen $(XEN_FULLVERSION) >> $@.new
    1.31  	@mv -f $@.new $@
    1.32  
    1.33  include/asm-$(TARGET_ARCH)/asm-offsets.h: arch/$(TARGET_ARCH)/asm-offsets.s
     2.1 --- a/xen/Rules.mk	Tue Aug 01 14:34:18 2006 +0100
     2.2 +++ b/xen/Rules.mk	Tue Aug 01 15:28:09 2006 +0100
     2.3 @@ -43,7 +43,6 @@ include $(BASEDIR)/arch/$(TARGET_ARCH)/R
     2.4  
     2.5  # Do not depend on auto-generated header files.
     2.6  HDRS := $(subst $(BASEDIR)/include/asm-$(TARGET_ARCH)/asm-offsets.h,,$(HDRS))
     2.7 -HDRS := $(subst $(BASEDIR)/include/xen/banner.h,,$(HDRS))
     2.8  HDRS := $(subst $(BASEDIR)/include/xen/compile.h,,$(HDRS))
     2.9  
    2.10  # Note that link order matters!
     3.1 --- a/xen/arch/ia64/xen/dom_fw.c	Tue Aug 01 14:34:18 2006 +0100
     3.2 +++ b/xen/arch/ia64/xen/dom_fw.c	Tue Aug 01 15:28:09 2006 +0100
     3.3 @@ -19,7 +19,7 @@
     3.4  #include <asm/sal.h>
     3.5  #include <asm/meminit.h>
     3.6  #include <asm/fpswa.h>
     3.7 -#include <xen/compile.h>
     3.8 +#include <xen/version.h>
     3.9  #include <xen/acpi.h>
    3.10  
    3.11  #include <asm/dom_fw.h>
    3.12 @@ -353,7 +353,8 @@ dom_fw_fake_acpi(struct domain *d, struc
    3.13  	strcpy(xsdt->oem_id, "XEN");
    3.14  	strcpy(xsdt->oem_table_id, "Xen/ia64");
    3.15  	strcpy(xsdt->asl_compiler_id, "XEN");
    3.16 -	xsdt->asl_compiler_revision = (XEN_VERSION<<16)|(XEN_SUBVERSION);
    3.17 +	xsdt->asl_compiler_revision = (xen_major_version() << 16) |
    3.18 +		xen_minor_version();
    3.19  
    3.20  	xsdt->table_offset_entry[0] = dom_pa((unsigned long) fadt);
    3.21  	tables->madt_ptr = dom_pa((unsigned long) madt);
    3.22 @@ -367,7 +368,8 @@ dom_fw_fake_acpi(struct domain *d, struc
    3.23  	strcpy(fadt->oem_id, "XEN");
    3.24  	strcpy(fadt->oem_table_id, "Xen/ia64");
    3.25  	strcpy(fadt->asl_compiler_id, "XEN");
    3.26 -	fadt->asl_compiler_revision = (XEN_VERSION<<16)|(XEN_SUBVERSION);
    3.27 +	fadt->asl_compiler_revision = (xen_major_version() << 16) |
    3.28 +		xen_minor_version();
    3.29  
    3.30  	strncpy(facs->signature, FACS_SIG, 4);
    3.31  	facs->version = 1;
    3.32 @@ -413,7 +415,8 @@ dom_fw_fake_acpi(struct domain *d, struc
    3.33  	strcpy(dsdt->oem_id, "XEN");
    3.34  	strcpy(dsdt->oem_table_id, "Xen/ia64");
    3.35  	strcpy(dsdt->asl_compiler_id, "XEN");
    3.36 -	dsdt->asl_compiler_revision = (XEN_VERSION<<16)|(XEN_SUBVERSION);
    3.37 +	dsdt->asl_compiler_revision = (xen_major_version() << 16) |
    3.38 +		xen_minor_version();
    3.39  
    3.40  	/* Trivial namespace, avoids ACPI CA complaints */
    3.41  	tables->aml[0] = 0x10; /* Scope */
    3.42 @@ -454,7 +457,8 @@ dom_fw_fake_acpi(struct domain *d, struc
    3.43  	strcpy(madt->header.oem_id, "XEN");
    3.44  	strcpy(madt->header.oem_table_id, "Xen/ia64");
    3.45  	strcpy(madt->header.asl_compiler_id, "XEN");
    3.46 -	madt->header.asl_compiler_revision = (XEN_VERSION<<16)|(XEN_SUBVERSION);
    3.47 +	madt->header.asl_compiler_revision = (xen_major_version() << 16) |
    3.48 +		xen_minor_version();
    3.49  
    3.50  	/* An LSAPIC entry describes a CPU.  */
    3.51  	for (i = 0; i < MAX_VIRT_CPUS; i++) {
     4.1 --- a/xen/arch/ia64/xen/domain.c	Tue Aug 01 14:34:18 2006 +0100
     4.2 +++ b/xen/arch/ia64/xen/domain.c	Tue Aug 01 15:28:09 2006 +0100
     4.3 @@ -30,7 +30,7 @@
     4.4  #include <asm/processor.h>
     4.5  #include <xen/event.h>
     4.6  #include <xen/console.h>
     4.7 -#include <xen/compile.h>
     4.8 +#include <xen/version.h>
     4.9  #include <xen/elf.h>
    4.10  #include <asm/pgalloc.h>
    4.11  #include <asm/offsets.h>  /* for IA64_THREAD_INFO_SIZE */
    4.12 @@ -1069,7 +1069,8 @@ int construct_dom0(struct domain *d,
    4.13  		panic("can't allocate start info page");
    4.14  	si = page_to_virt(start_info_page);
    4.15  	memset(si, 0, PAGE_SIZE);
    4.16 -	sprintf(si->magic, "xen-%i.%i-ia64", XEN_VERSION, XEN_SUBVERSION);
    4.17 +	sprintf(si->magic, "xen-%i.%i-ia64",
    4.18 +		xen_major_version(), xen_minor_version());
    4.19  	si->nr_pages     = max_pages;
    4.20  	si->flags = SIF_INITDOMAIN|SIF_PRIVILEGED;
    4.21  
     5.1 --- a/xen/arch/ia64/xen/xensetup.c	Tue Aug 01 14:34:18 2006 +0100
     5.2 +++ b/xen/arch/ia64/xen/xensetup.c	Tue Aug 01 15:28:09 2006 +0100
     5.3 @@ -13,7 +13,7 @@
     5.4  #include <xen/mm.h>
     5.5  #include <public/version.h>
     5.6  #include <xen/gdbstub.h>
     5.7 -#include <xen/compile.h>
     5.8 +#include <xen/version.h>
     5.9  #include <xen/console.h>
    5.10  #include <xen/domain.h>
    5.11  #include <xen/serial.h>
    5.12 @@ -547,11 +547,13 @@ printk("num_online_cpus=%d, max_cpus=%d\
    5.13  void arch_get_xen_caps(xen_capabilities_info_t info)
    5.14  {
    5.15      char *p=info;
    5.16 +    int major = xen_major_version();
    5.17 +    int minor = xen_minor_version();
    5.18  
    5.19 -    p += sprintf(p,"xen-%d.%d-ia64 ", XEN_VERSION, XEN_SUBVERSION);
    5.20 +    p += sprintf(p,"xen-%d.%d-ia64 ", major, minor);
    5.21  
    5.22      if (vmx_enabled)
    5.23 -        p += sprintf(p,"hvm-%d.%d-ia64 ", XEN_VERSION, XEN_SUBVERSION);
    5.24 +        p += sprintf(p,"hvm-%d.%d-ia64 ", major, minor);
    5.25  
    5.26      *(p-1) = 0;
    5.27  
     6.1 --- a/xen/arch/powerpc/boot_of.c	Tue Aug 01 14:34:18 2006 +0100
     6.2 +++ b/xen/arch/powerpc/boot_of.c	Tue Aug 01 15:28:09 2006 +0100
     6.3 @@ -22,7 +22,7 @@
     6.4  #include <xen/init.h>
     6.5  #include <xen/lib.h>
     6.6  #include <xen/multiboot.h>
     6.7 -#include <xen/compile.h>
     6.8 +#include <xen/version.h>
     6.9  #include <xen/spinlock.h>
    6.10  #include <xen/serial.h>
    6.11  #include <xen/time.h>
    6.12 @@ -976,9 +976,9 @@ multiboot_info_t __init *boot_of_init(
    6.13  
    6.14      of_printf("%s\n", "---------------------------------------------------");
    6.15      of_printf("OF: Xen/PPC version %d.%d%s (%s@%s) (%s) %s\n",
    6.16 -              XEN_VERSION, XEN_SUBVERSION, XEN_EXTRAVERSION,
    6.17 -              XEN_COMPILE_BY, XEN_COMPILE_DOMAIN,
    6.18 -              XEN_COMPILER, XEN_COMPILE_DATE);
    6.19 +              xen_major_version(), xen_minor_version(), xen_extra_version(),
    6.20 +              xen_compile_by(), xen_compile_domain(),
    6.21 +              xen_compiler(), xen_compile_date());
    6.22  
    6.23      of_printf("%s args: 0x%lx 0x%lx 0x%lx 0x%lx 0x%lx\n"
    6.24              "boot msr: 0x%lx\n",
     7.1 --- a/xen/arch/powerpc/domain_build.c	Tue Aug 01 14:34:18 2006 +0100
     7.2 +++ b/xen/arch/powerpc/domain_build.c	Tue Aug 01 15:28:09 2006 +0100
     7.3 @@ -25,7 +25,7 @@
     7.4  #include <xen/init.h>
     7.5  #include <xen/ctype.h>
     7.6  #include <xen/iocap.h>
     7.7 -#include <xen/compile.h>
     7.8 +#include <xen/version.h>
     7.9  #include <asm/processor.h>
    7.10  #include <asm/papr.h>
    7.11  #include "oftree.h"
    7.12 @@ -153,7 +153,7 @@ int construct_dom0(struct domain *d,
    7.13      printk("xen_start_info: %p\n", si);
    7.14  
    7.15      sprintf(si->magic, "xen-%i.%i-powerpc%d%s",
    7.16 -            XEN_VERSION, XEN_SUBVERSION, BITS_PER_LONG, "HV");
    7.17 +            xen_major_version(), xen_minor_version(), BITS_PER_LONG, "HV");
    7.18      si->flags = SIF_PRIVILEGED | SIF_INITDOMAIN;
    7.19  
    7.20      si->shared_info = ((ulong)d->shared_info) - rma;
     8.1 --- a/xen/arch/powerpc/mpic_init.c	Tue Aug 01 14:34:18 2006 +0100
     8.2 +++ b/xen/arch/powerpc/mpic_init.c	Tue Aug 01 15:28:09 2006 +0100
     8.3 @@ -21,7 +21,6 @@
     8.4  #include <xen/config.h>
     8.5  #include <xen/init.h>
     8.6  #include <xen/lib.h>
     8.7 -#include <xen/compile.h>
     8.8  #include <asm/mpic.h>
     8.9  #include "mpic_init.h"
    8.10  #include "oftree.h"
     9.1 --- a/xen/arch/powerpc/ofd_fixup.c	Tue Aug 01 14:34:18 2006 +0100
     9.2 +++ b/xen/arch/powerpc/ofd_fixup.c	Tue Aug 01 15:28:09 2006 +0100
     9.3 @@ -21,7 +21,7 @@
     9.4  #include <xen/config.h>
     9.5  #include <xen/lib.h>
     9.6  #include <xen/sched.h>
     9.7 -#include <xen/compile.h>
     9.8 +#include <xen/version.h>
     9.9  #include <public/xen.h>
    9.10  #include "of-devtree.h"
    9.11  
    9.12 @@ -420,7 +420,7 @@ static ofdn_t ofd_xen_props(void *m, str
    9.13          ofd_prop_add(m, n, "name", &path[1], sizeof (path) - 1);
    9.14  
    9.15          xl = snprintf(xen, sizeof (xen), "Xen-%d.%d%s",
    9.16 -                XEN_VERSION, XEN_SUBVERSION, XEN_EXTRAVERSION);
    9.17 +                xen_major_version(), xen_minor_version(), xen_extra_version());
    9.18          ASSERT(xl < sizeof (xen));
    9.19          ofd_prop_add(m, n, "version", xen, xl + 1);
    9.20  
    10.1 --- a/xen/arch/powerpc/powerpc64/traps.c	Tue Aug 01 14:34:18 2006 +0100
    10.2 +++ b/xen/arch/powerpc/powerpc64/traps.c	Tue Aug 01 15:28:09 2006 +0100
    10.3 @@ -22,7 +22,7 @@
    10.4  #include <xen/lib.h>
    10.5  #include <xen/console.h>
    10.6  #include <public/xen.h>
    10.7 -#include <xen/compile.h>
    10.8 +#include <xen/version.h>
    10.9  #include <xen/sched.h>
   10.10  
   10.11  void show_registers(struct cpu_user_regs *regs)
   10.12 @@ -32,7 +32,7 @@ void show_registers(struct cpu_user_regs
   10.13      console_start_sync();
   10.14      
   10.15      printk("----[ Xen-%d.%d%s     ]----\n",
   10.16 -           XEN_VERSION, XEN_SUBVERSION, XEN_EXTRAVERSION);
   10.17 +           xen_major_version(), xen_minor_version(), xen_extra_version());
   10.18      printk("CPU: %08x   DOMID: %08x\n",
   10.19             smp_processor_id(), current->domain->domain_id);
   10.20      printk("pc %016lx msr %016lx\n"
    11.1 --- a/xen/arch/x86/domain_build.c	Tue Aug 01 14:34:18 2006 +0100
    11.2 +++ b/xen/arch/x86/domain_build.c	Tue Aug 01 15:28:09 2006 +0100
    11.3 @@ -15,7 +15,7 @@
    11.4  #include <xen/elf.h>
    11.5  #include <xen/kernel.h>
    11.6  #include <xen/domain.h>
    11.7 -#include <xen/compile.h>
    11.8 +#include <xen/version.h>
    11.9  #include <xen/iocap.h>
   11.10  #include <xen/bitops.h>
   11.11  #include <asm/regs.h>
   11.12 @@ -726,7 +726,8 @@ int construct_dom0(struct domain *d,
   11.13      si->nr_pt_frames = nr_pt_pages;
   11.14      si->mfn_list     = vphysmap_start;
   11.15      sprintf(si->magic, "xen-%i.%i-x86_%d%s",
   11.16 -            XEN_VERSION, XEN_SUBVERSION, BITS_PER_LONG, xen_pae ? "p" : "");
   11.17 +            xen_major_version(), xen_minor_version(),
   11.18 +            BITS_PER_LONG, xen_pae ? "p" : "");
   11.19  
   11.20      /* Write the phys->machine and machine->phys table entries. */
   11.21      for ( pfn = 0; pfn < d->tot_pages; pfn++ )
    12.1 --- a/xen/arch/x86/setup.c	Tue Aug 01 14:34:18 2006 +0100
    12.2 +++ b/xen/arch/x86/setup.c	Tue Aug 01 15:28:09 2006 +0100
    12.3 @@ -12,7 +12,7 @@
    12.4  #include <xen/trace.h>
    12.5  #include <xen/multiboot.h>
    12.6  #include <xen/domain_page.h>
    12.7 -#include <xen/compile.h>
    12.8 +#include <xen/version.h>
    12.9  #include <xen/gdbstub.h>
   12.10  #include <xen/percpu.h>
   12.11  #include <public/version.h>
   12.12 @@ -612,30 +612,32 @@ void __init __start_xen(multiboot_info_t
   12.13  void arch_get_xen_caps(xen_capabilities_info_t info)
   12.14  {
   12.15      char *p = info;
   12.16 +    int major = xen_major_version();
   12.17 +    int minor = xen_minor_version();
   12.18  
   12.19  #if defined(CONFIG_X86_32) && !defined(CONFIG_X86_PAE)
   12.20  
   12.21 -    p += sprintf(p, "xen-%d.%d-x86_32 ", XEN_VERSION, XEN_SUBVERSION);
   12.22 +    p += sprintf(p, "xen-%d.%d-x86_32 ", major, minor);
   12.23      if ( hvm_enabled )
   12.24 -        p += sprintf(p, "hvm-%d.%d-x86_32 ", XEN_VERSION, XEN_SUBVERSION);
   12.25 +        p += sprintf(p, "hvm-%d.%d-x86_32 ", major, minor);
   12.26  
   12.27  #elif defined(CONFIG_X86_32) && defined(CONFIG_X86_PAE)
   12.28  
   12.29 -    p += sprintf(p, "xen-%d.%d-x86_32p ", XEN_VERSION, XEN_SUBVERSION);
   12.30 +    p += sprintf(p, "xen-%d.%d-x86_32p ", major, minor);
   12.31      if ( hvm_enabled )
   12.32      {
   12.33 -        p += sprintf(p, "hvm-%d.%d-x86_32 ", XEN_VERSION, XEN_SUBVERSION);
   12.34 -        p += sprintf(p, "hvm-%d.%d-x86_32p ", XEN_VERSION, XEN_SUBVERSION);
   12.35 +        p += sprintf(p, "hvm-%d.%d-x86_32 ", major, minor);
   12.36 +        p += sprintf(p, "hvm-%d.%d-x86_32p ", major, minor);
   12.37      }
   12.38  
   12.39  #elif defined(CONFIG_X86_64)
   12.40  
   12.41 -    p += sprintf(p, "xen-%d.%d-x86_64 ", XEN_VERSION, XEN_SUBVERSION);
   12.42 +    p += sprintf(p, "xen-%d.%d-x86_64 ", major, minor);
   12.43      if ( hvm_enabled )
   12.44      {
   12.45 -        p += sprintf(p, "hvm-%d.%d-x86_32 ", XEN_VERSION, XEN_SUBVERSION);
   12.46 -        p += sprintf(p, "hvm-%d.%d-x86_32p ", XEN_VERSION, XEN_SUBVERSION);
   12.47 -        p += sprintf(p, "hvm-%d.%d-x86_64 ", XEN_VERSION, XEN_SUBVERSION);
   12.48 +        p += sprintf(p, "hvm-%d.%d-x86_32 ", major, minor);
   12.49 +        p += sprintf(p, "hvm-%d.%d-x86_32p ", major, minor);
   12.50 +        p += sprintf(p, "hvm-%d.%d-x86_64 ", major, minor);
   12.51      }
   12.52  
   12.53  #else
    13.1 --- a/xen/arch/x86/x86_32/traps.c	Tue Aug 01 14:34:18 2006 +0100
    13.2 +++ b/xen/arch/x86/x86_32/traps.c	Tue Aug 01 15:28:09 2006 +0100
    13.3 @@ -1,6 +1,6 @@
    13.4  
    13.5  #include <xen/config.h>
    13.6 -#include <xen/compile.h>
    13.7 +#include <xen/version.h>
    13.8  #include <xen/domain_page.h>
    13.9  #include <xen/init.h>
   13.10  #include <xen/sched.h>
   13.11 @@ -52,7 +52,7 @@ void show_registers(struct cpu_user_regs
   13.12      }
   13.13  
   13.14      printk("----[ Xen-%d.%d%s    %s ]----\n",
   13.15 -           XEN_VERSION, XEN_SUBVERSION, XEN_EXTRAVERSION,
   13.16 +           xen_major_version(), xen_minor_version(), xen_extra_version(),
   13.17             print_tainted(taint_str));
   13.18      printk("CPU:    %d\nEIP:    %04x:[<%08x>]",
   13.19             smp_processor_id(), fault_regs.cs, fault_regs.eip);
   13.20 @@ -131,7 +131,7 @@ asmlinkage void do_double_fault(void)
   13.21      /* Find information saved during fault and dump it to the console. */
   13.22      tss = &init_tss[cpu];
   13.23      printk("*** DOUBLE FAULT: Xen-%d.%d%s    %s\n",
   13.24 -           XEN_VERSION, XEN_SUBVERSION, XEN_EXTRAVERSION,
   13.25 +           xen_major_version(), xen_minor_version(), xen_extra_version(),
   13.26             print_tainted(taint_str));
   13.27      printk("CPU:    %d\nEIP:    %04x:[<%08x>]",
   13.28             cpu, tss->cs, tss->eip);
    14.1 --- a/xen/arch/x86/x86_64/traps.c	Tue Aug 01 14:34:18 2006 +0100
    14.2 +++ b/xen/arch/x86/x86_64/traps.c	Tue Aug 01 15:28:09 2006 +0100
    14.3 @@ -1,6 +1,6 @@
    14.4  
    14.5  #include <xen/config.h>
    14.6 -#include <xen/compile.h>
    14.7 +#include <xen/version.h>
    14.8  #include <xen/init.h>
    14.9  #include <xen/sched.h>
   14.10  #include <xen/lib.h>
   14.11 @@ -45,7 +45,7 @@ void show_registers(struct cpu_user_regs
   14.12      }
   14.13  
   14.14      printk("----[ Xen-%d.%d%s    %s ]----\n",
   14.15 -           XEN_VERSION, XEN_SUBVERSION, XEN_EXTRAVERSION,
   14.16 +           xen_major_version(), xen_minor_version(), xen_extra_version(),
   14.17             print_tainted(taint_str));
   14.18      printk("CPU:    %d\nRIP:    %04x:[<%016lx>]",
   14.19             smp_processor_id(), fault_regs.cs, fault_regs.rip);
   14.20 @@ -128,7 +128,7 @@ asmlinkage void do_double_fault(struct c
   14.21  
   14.22      /* Find information saved during fault and dump it to the console. */
   14.23      printk("*** DOUBLE FAULT: Xen-%d.%d%s    %s\n",
   14.24 -           XEN_VERSION, XEN_SUBVERSION, XEN_EXTRAVERSION,
   14.25 +           xen_major_version(), xen_minor_version(), xen_extra_version(),
   14.26             print_tainted(taint_str));
   14.27      printk("CPU:    %d\nRIP:    %04x:[<%016lx>]",
   14.28             cpu, regs->cs, regs->rip);
    15.1 --- a/xen/common/Makefile	Tue Aug 01 14:34:18 2006 +0100
    15.2 +++ b/xen/common/Makefile	Tue Aug 01 15:28:09 2006 +0100
    15.3 @@ -21,6 +21,7 @@ obj-y += string.o
    15.4  obj-y += symbols.o
    15.5  obj-y += trace.o
    15.6  obj-y += timer.o
    15.7 +obj-y += version.o
    15.8  obj-y += vsprintf.o
    15.9  obj-y += xmalloc.o
   15.10  
   15.11 @@ -28,4 +29,4 @@ obj-$(perfc)       += perfc.o
   15.12  obj-$(crash_debug) += gdbstub.o
   15.13  
   15.14  # Object file contains changeset and compiler information.
   15.15 -kernel.o: $(BASEDIR)/include/xen/compile.h
   15.16 +version.o: $(BASEDIR)/include/xen/compile.h
    16.1 --- a/xen/common/kernel.c	Tue Aug 01 14:34:18 2006 +0100
    16.2 +++ b/xen/common/kernel.c	Tue Aug 01 15:28:09 2006 +0100
    16.3 @@ -8,7 +8,7 @@
    16.4  #include <xen/init.h>
    16.5  #include <xen/lib.h>
    16.6  #include <xen/errno.h>
    16.7 -#include <xen/compile.h>
    16.8 +#include <xen/version.h>
    16.9  #include <xen/sched.h>
   16.10  #include <xen/shadow.h>
   16.11  #include <xen/guest_access.h>
   16.12 @@ -125,13 +125,13 @@ long do_xen_version(int cmd, XEN_GUEST_H
   16.13      {
   16.14      case XENVER_version:
   16.15      {
   16.16 -        return (XEN_VERSION<<16) | (XEN_SUBVERSION);
   16.17 +        return (xen_major_version() << 16) | xen_minor_version();
   16.18      }
   16.19  
   16.20      case XENVER_extraversion:
   16.21      {
   16.22          xen_extraversion_t extraversion;
   16.23 -        safe_strcpy(extraversion, XEN_EXTRAVERSION);
   16.24 +        safe_strcpy(extraversion, xen_extra_version());
   16.25          if ( copy_to_guest(arg, (char *)extraversion, sizeof(extraversion)) )
   16.26              return -EFAULT;
   16.27          return 0;
   16.28 @@ -140,10 +140,10 @@ long do_xen_version(int cmd, XEN_GUEST_H
   16.29      case XENVER_compile_info:
   16.30      {
   16.31          struct xen_compile_info info;
   16.32 -        safe_strcpy(info.compiler,       XEN_COMPILER);
   16.33 -        safe_strcpy(info.compile_by,     XEN_COMPILE_BY);
   16.34 -        safe_strcpy(info.compile_domain, XEN_COMPILE_DOMAIN);
   16.35 -        safe_strcpy(info.compile_date,   XEN_COMPILE_DATE);
   16.36 +        safe_strcpy(info.compiler,       xen_compiler());
   16.37 +        safe_strcpy(info.compile_by,     xen_compile_by());
   16.38 +        safe_strcpy(info.compile_domain, xen_compile_domain());
   16.39 +        safe_strcpy(info.compile_date,   xen_compile_date());
   16.40          if ( copy_to_guest(arg, &info, 1) )
   16.41              return -EFAULT;
   16.42          return 0;
   16.43 @@ -176,7 +176,7 @@ long do_xen_version(int cmd, XEN_GUEST_H
   16.44      case XENVER_changeset:
   16.45      {
   16.46          xen_changeset_info_t chgset;
   16.47 -        safe_strcpy(chgset, XEN_CHANGESET);
   16.48 +        safe_strcpy(chgset, xen_changeset());
   16.49          if ( copy_to_guest(arg, (char *)chgset, sizeof(chgset)) )
   16.50              return -EFAULT;
   16.51          return 0;
    17.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    17.2 +++ b/xen/common/version.c	Tue Aug 01 15:28:09 2006 +0100
    17.3 @@ -0,0 +1,56 @@
    17.4 +#include <xen/compile.h>
    17.5 +
    17.6 +const char *xen_compile_date(void)
    17.7 +{
    17.8 +    return XEN_COMPILE_DATE;
    17.9 +}
   17.10 +
   17.11 +const char *xen_compile_time(void)
   17.12 +{
   17.13 +    return XEN_COMPILE_TIME;
   17.14 +}
   17.15 +
   17.16 +const char *xen_compile_by(void)
   17.17 +{
   17.18 +    return XEN_COMPILE_BY;
   17.19 +}
   17.20 +
   17.21 +const char *xen_compile_domain(void)
   17.22 +{
   17.23 +    return XEN_COMPILE_DOMAIN;
   17.24 +}
   17.25 +
   17.26 +const char *xen_compile_host(void)
   17.27 +{
   17.28 +    return XEN_COMPILE_HOST;
   17.29 +}
   17.30 +
   17.31 +const char *xen_compiler(void)
   17.32 +{
   17.33 +    return XEN_COMPILER;
   17.34 +}
   17.35 +
   17.36 +unsigned int xen_major_version(void)
   17.37 +{
   17.38 +    return XEN_VERSION;
   17.39 +}
   17.40 +
   17.41 +unsigned int xen_minor_version(void)
   17.42 +{
   17.43 +    return XEN_SUBVERSION;
   17.44 +}
   17.45 +
   17.46 +const char *xen_extra_version(void)
   17.47 +{
   17.48 +    return XEN_EXTRAVERSION;
   17.49 +}
   17.50 +
   17.51 +const char *xen_changeset(void)
   17.52 +{
   17.53 +    return XEN_CHANGESET;
   17.54 +}
   17.55 +
   17.56 +const char *xen_banner(void)
   17.57 +{
   17.58 +    return XEN_BANNER;
   17.59 +}
    18.1 --- a/xen/drivers/char/Makefile	Tue Aug 01 14:34:18 2006 +0100
    18.2 +++ b/xen/drivers/char/Makefile	Tue Aug 01 15:28:09 2006 +0100
    18.3 @@ -1,6 +1,3 @@
    18.4  obj-y += console.o
    18.5  obj-y += ns16550.o
    18.6  obj-y += serial.o
    18.7 -
    18.8 -# Object file contains changeset and compiler information.
    18.9 -console.o: $(BASEDIR)/include/xen/compile.h
    19.1 --- a/xen/drivers/char/console.c	Tue Aug 01 14:34:18 2006 +0100
    19.2 +++ b/xen/drivers/char/console.c	Tue Aug 01 15:28:09 2006 +0100
    19.3 @@ -8,7 +8,7 @@
    19.4  
    19.5  #include <stdarg.h>
    19.6  #include <xen/config.h>
    19.7 -#include <xen/compile.h>
    19.8 +#include <xen/version.h>
    19.9  #include <xen/init.h>
   19.10  #include <xen/lib.h>
   19.11  #include <xen/errno.h>
   19.12 @@ -488,14 +488,14 @@ void init_console(void)
   19.13      serial_set_rx_handler(sercon_handle, serial_rx);
   19.14  
   19.15      /* HELLO WORLD --- start-of-day banner text. */
   19.16 -    printk(XEN_BANNER);
   19.17 +    printk(xen_banner());
   19.18      printk(" http://www.cl.cam.ac.uk/netos/xen\n");
   19.19      printk(" University of Cambridge Computer Laboratory\n\n");
   19.20      printk(" Xen version %d.%d%s (%s@%s) (%s) %s\n",
   19.21 -           XEN_VERSION, XEN_SUBVERSION, XEN_EXTRAVERSION,
   19.22 -           XEN_COMPILE_BY, XEN_COMPILE_DOMAIN,
   19.23 -           XEN_COMPILER, XEN_COMPILE_DATE);
   19.24 -    printk(" Latest ChangeSet: %s\n\n", XEN_CHANGESET);
   19.25 +           xen_major_version(), xen_minor_version(), xen_extra_version(),
   19.26 +           xen_compile_by(), xen_compile_domain(),
   19.27 +           xen_compiler(), xen_compile_date());
   19.28 +    printk(" Latest ChangeSet: %s\n\n", xen_changeset());
   19.29      set_printk_prefix("(XEN) ");
   19.30  
   19.31      if ( opt_sync_console )
    20.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    20.2 +++ b/xen/include/xen/version.h	Tue Aug 01 15:28:09 2006 +0100
    20.3 @@ -0,0 +1,16 @@
    20.4 +#ifndef __XEN_VERSION_H__
    20.5 +#define __XEN_VERSION_H__
    20.6 +
    20.7 +const char *xen_compile_date(void);
    20.8 +const char *xen_compile_time(void);
    20.9 +const char *xen_compile_by(void);
   20.10 +const char *xen_compile_domain(void);
   20.11 +const char *xen_compile_host(void);
   20.12 +const char *xen_compiler(void);
   20.13 +unsigned int xen_major_version(void);
   20.14 +unsigned int xen_minor_version(void);
   20.15 +const char *xen_extra_version(void);
   20.16 +const char *xen_changeset(void);
   20.17 +const char *xen_banner(void);
   20.18 +
   20.19 +#endif /* __XEN_VERSION_H__ */