ia64/xen-unstable

changeset 8906:062ab30ba434

[IA64] cleanup itir_ps(), itir_mask()

code clean up.
itir_ps(), itir_mask()

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
author awilliam@xenbuild.aw
date Fri Feb 24 08:28:36 2006 -0700 (2006-02-24)
parents 2a2aaef05d70
children 5de0ee4ae76b
files xen/arch/ia64/xen/process.c xen/arch/ia64/xen/vcpu.c xen/include/asm-ia64/vcpu.h
line diff
     1.1 --- a/xen/arch/ia64/xen/process.c	Fri Feb 24 08:24:58 2006 -0700
     1.2 +++ b/xen/arch/ia64/xen/process.c	Fri Feb 24 08:28:36 2006 -0700
     1.3 @@ -94,7 +94,7 @@ unsigned long translate_domain_pte(unsig
     1.4  	extern unsigned long dom0_start, dom0_size;
     1.5  
     1.6  	// FIXME address had better be pre-validated on insert
     1.7 -	mask = (1L << ((itir >> 2) & 0x3f)) - 1;
     1.8 +	mask = itir_mask(itir);
     1.9  	mpaddr = ((pteval & _PAGE_PPN_MASK) & ~mask) | (address & mask);
    1.10  	if (d == dom0) {
    1.11  		if (mpaddr < dom0_start || mpaddr >= dom0_start + dom0_size) {
     2.1 --- a/xen/arch/ia64/xen/vcpu.c	Fri Feb 24 08:24:58 2006 -0700
     2.2 +++ b/xen/arch/ia64/xen/vcpu.c	Fri Feb 24 08:28:36 2006 -0700
     2.3 @@ -1293,9 +1293,6 @@ IA64FAULT vcpu_ttag(VCPU *vcpu, UINT64 v
     2.4  	return (IA64_ILLOP_FAULT);
     2.5  }
     2.6  
     2.7 -#define itir_ps(itir)	((itir >> 2) & 0x3f)
     2.8 -#define itir_mask(itir) (~((1UL << itir_ps(itir)) - 1))
     2.9 -
    2.10  unsigned long vhpt_translate_count = 0;
    2.11  unsigned long fast_vhpt_translate_count = 0;
    2.12  unsigned long recover_to_page_fault_count = 0;
    2.13 @@ -1798,7 +1795,7 @@ void vcpu_itc_no_srlz(VCPU *vcpu, UINT64
    2.14  
    2.15  IA64FAULT vcpu_itc_d(VCPU *vcpu, UINT64 pte, UINT64 itir, UINT64 ifa)
    2.16  {
    2.17 -	unsigned long pteval, logps = (itir >> 2) & 0x3f;
    2.18 +	unsigned long pteval, logps = itir_ps(itir);
    2.19  	unsigned long translate_domain_pte(UINT64,UINT64,UINT64);
    2.20  	BOOLEAN swap_rr0 = (!(ifa>>61) && PSCB(vcpu,metaphysical_mode));
    2.21  
    2.22 @@ -1818,7 +1815,7 @@ IA64FAULT vcpu_itc_d(VCPU *vcpu, UINT64 
    2.23  
    2.24  IA64FAULT vcpu_itc_i(VCPU *vcpu, UINT64 pte, UINT64 itir, UINT64 ifa)
    2.25  {
    2.26 -	unsigned long pteval, logps = (itir >> 2) & 0x3f;
    2.27 +	unsigned long pteval, logps = itir_ps(itir);
    2.28  	unsigned long translate_domain_pte(UINT64,UINT64,UINT64);
    2.29  	BOOLEAN swap_rr0 = (!(ifa>>61) && PSCB(vcpu,metaphysical_mode));
    2.30  
     3.1 --- a/xen/include/asm-ia64/vcpu.h	Fri Feb 24 08:24:58 2006 -0700
     3.2 +++ b/xen/include/asm-ia64/vcpu.h	Fri Feb 24 08:28:36 2006 -0700
     3.3 @@ -149,4 +149,16 @@ extern void vcpu_itc_no_srlz(VCPU *vcpu,
     3.4  extern UINT64 vcpu_get_tmp(VCPU *, UINT64);
     3.5  extern void vcpu_set_tmp(VCPU *, UINT64, UINT64);
     3.6  
     3.7 +static inline UINT64
     3.8 +itir_ps(UINT64 itir)
     3.9 +{
    3.10 +    return ((itir >> 2) & 0x3f);
    3.11 +}
    3.12 +
    3.13 +static inline UINT64
    3.14 +itir_mask(UINT64 itir)
    3.15 +{
    3.16 +    return (~((1UL << itir_ps(itir)) - 1));
    3.17 +}
    3.18 +
    3.19  #endif