ia64/xen-unstable

changeset 9154:294e032f14af

[IA64] Guarantee VTi guest can get correct frequency base

Because some platforms don't implement pal_freq_base call in PAL,
in this case, call host SAL sal_freq_base instead to get correct
freqency base value.

Signed-off-by: Zhang Xiantao <xiantao.zhang@intel.com>
Signed-off-by: Yu Ke <ke.yu@intel.com>
author awilliam@xenbuild.aw
date Tue Mar 07 17:08:20 2006 -0700 (2006-03-07)
parents c4ac21dc3f16
children 20c1a71383a9
files xen/arch/ia64/vmx/pal_emul.c
line diff
     1.1 --- a/xen/arch/ia64/vmx/pal_emul.c	Mon Mar 06 10:21:35 2006 -0700
     1.2 +++ b/xen/arch/ia64/vmx/pal_emul.c	Tue Mar 07 17:08:20 2006 -0700
     1.3 @@ -20,6 +20,7 @@
     1.4  
     1.5  #include <asm/vmx_vcpu.h>
     1.6  #include <asm/pal.h>
     1.7 +#include <asm/sal.h>
     1.8  
     1.9  static void
    1.10  get_pal_parameters (VCPU *vcpu, UINT64 *gr29,
    1.11 @@ -182,8 +183,16 @@ pal_fixed_addr(VCPU *vcpu){
    1.12  static struct ia64_pal_retval
    1.13  pal_freq_base(VCPU *vcpu){
    1.14      struct ia64_pal_retval result;
    1.15 +    struct ia64_sal_retval isrv;
    1.16  
    1.17      PAL_CALL(result,PAL_FREQ_BASE, 0, 0, 0);
    1.18 +    if(result.v0 == 0){ //PAL_FREQ_BASE may not be implemented in some platforms, call SAL instead.
    1.19 +        SAL_CALL(isrv, SAL_FREQ_BASE, 
    1.20 +                SAL_FREQ_BASE_PLATFORM, 0, 0, 0, 0, 0, 0);
    1.21 +        result.status = isrv.status;
    1.22 +        result.v0 = isrv.v0;
    1.23 +        result.v1 = result.v2 =0;
    1.24 +    }
    1.25      return result;
    1.26  }
    1.27