ia64/xen-unstable

changeset 17602:f23e7e07bf1d

[IA64] define VHPT_ENABLED in Rules.mk instead of the header file, vhpt.h.

VHPT_ENABLED is defined in vhpt.h, but it is intended for compile time
option. Defining in the header file caused that VHPT_ENABLED
is undefined in some files resulting in unintentional compilation.
Define the macro in Rules.mk resolves it. And minor modifications to
remove compilation error/warning.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
author Isaku Yamahata <yamahata@valinux.co.jp>
date Wed May 07 17:15:32 2008 +0900 (2008-05-07)
parents 6df8dcf48d9d
children 705e203ba905
files xen/arch/ia64/Rules.mk xen/arch/ia64/asm-offsets.c xen/arch/ia64/xen/domain.c xen/include/asm-ia64/vhpt.h
line diff
     1.1 --- a/xen/arch/ia64/Rules.mk	Mon May 12 11:24:47 2008 +0900
     1.2 +++ b/xen/arch/ia64/Rules.mk	Wed May 07 17:15:32 2008 +0900
     1.3 @@ -8,6 +8,7 @@ xenoprof := y
     1.4  no_warns ?= n
     1.5  vti_debug ?= n
     1.6  vmx_panic ?= n
     1.7 +vhpt_disable ?= n
     1.8  xen_ia64_expose_p2m	?= y
     1.9  xen_ia64_pervcpu_vhpt	?= y
    1.10  xen_ia64_tlb_track	?= y
    1.11 @@ -45,6 +46,9 @@ CFLAGS	+= -DCONFIG_XEN_IA64_EXPOSE_P2M
    1.12  endif
    1.13  ifeq ($(xen_ia64_pervcpu_vhpt),y)
    1.14  CFLAGS	+= -DCONFIG_XEN_IA64_PERVCPU_VHPT
    1.15 +ifeq ($(vhpt_disable),y)
    1.16 +$(error "both xen_ia64_pervcpu_vhpt=y and vhpt_disable=y are enabled. they can't be enabled simultaneously. disable one of them.")
    1.17 +endif
    1.18  endif
    1.19  ifeq ($(xen_ia64_tlb_track),y)
    1.20  CFLAGS	+= -DCONFIG_XEN_IA64_TLB_TRACK
    1.21 @@ -58,6 +62,11 @@ endif
    1.22  ifeq ($(no_warns),y)
    1.23  CFLAGS	+= -Wa,--fatal-warnings -Werror -Wno-uninitialized
    1.24  endif
    1.25 +ifneq ($(vhpt_disable),y)
    1.26 +CFLAGS += -DVHPT_ENABLED=1
    1.27 +else
    1.28 +CFLAGS += -DVHPT_ENABLED=0
    1.29 +endif
    1.30  
    1.31  LDFLAGS := -g
    1.32  
     2.1 --- a/xen/arch/ia64/asm-offsets.c	Mon May 12 11:24:47 2008 +0900
     2.2 +++ b/xen/arch/ia64/asm-offsets.c	Wed May 07 17:15:32 2008 +0900
     2.3 @@ -254,10 +254,12 @@ void foo(void)
     2.4  	DEFINE(IA64_MCA_CPU_RBSTORE_OFFSET,
     2.5  	       offsetof(struct ia64_mca_cpu, rbstore));
     2.6  
     2.7 +#if VHPT_ENABLED
     2.8  	DEFINE(IA64_VCPU_VHPT_PAGE_OFFSET,
     2.9  	       offsetof(struct vcpu, arch.vhpt_page));
    2.10  	DEFINE(IA64_VCPU_VHPT_MADDR_OFFSET,
    2.11  	       offsetof(struct vcpu, arch.vhpt_maddr));
    2.12 +#endif
    2.13  
    2.14  	BLANK();
    2.15  	DEFINE(IA64_MCA_TLB_INFO_SIZE, sizeof(struct ia64_mca_tlb_info));
     3.1 --- a/xen/arch/ia64/xen/domain.c	Mon May 12 11:24:47 2008 +0900
     3.2 +++ b/xen/arch/ia64/xen/domain.c	Wed May 07 17:15:32 2008 +0900
     3.3 @@ -499,10 +499,9 @@ static void vcpu_share_privregs_with_gue
     3.4  
     3.5  int vcpu_late_initialise(struct vcpu *v)
     3.6  {
     3.7 -	struct domain *d = v->domain;
     3.8  	int rc, order;
     3.9  
    3.10 -	if (HAS_PERVCPU_VHPT(d)) {
    3.11 +	if (HAS_PERVCPU_VHPT(v->domain)) {
    3.12  		rc = pervcpu_vhpt_alloc(v);
    3.13  		if (rc != 0)
    3.14  			return rc;
     4.1 --- a/xen/include/asm-ia64/vhpt.h	Mon May 12 11:24:47 2008 +0900
     4.2 +++ b/xen/include/asm-ia64/vhpt.h	Wed May 07 17:15:32 2008 +0900
     4.3 @@ -1,8 +1,6 @@
     4.4  #ifndef ASM_VHPT_H
     4.5  #define ASM_VHPT_H
     4.6  
     4.7 -#define VHPT_ENABLED 1
     4.8 -
     4.9  /* Size of the VHPT.  */
    4.10  // XXX work around to avoid trigerring xenLinux software lock up detection.
    4.11  # define	VHPT_SIZE_LOG2			16	// 64KB