ia64/xen-unstable

changeset 7499:ebc92fd2fac8

Code reordering for (partial) gcc3.4 compatibility
Signed-off-by Akio Takabe <takebe_akio@jp.fujitsu.com>
author djm@kirby.fc.hp.com
date Mon Oct 24 11:41:27 2005 -0600 (2005-10-24)
parents eb1ae533d480
children 935a81f86348
files xen/arch/ia64/vmx/vmx_phy_mode.c xen/arch/ia64/vmx/vmx_process.c xen/arch/ia64/xen/xentime.c
line diff
     1.1 --- a/xen/arch/ia64/vmx/vmx_phy_mode.c	Mon Oct 24 11:32:45 2005 -0600
     1.2 +++ b/xen/arch/ia64/vmx/vmx_phy_mode.c	Mon Oct 24 11:41:27 2005 -0600
     1.3 @@ -157,13 +157,6 @@ physical_itlb_miss_domn(VCPU *vcpu, u64 
     1.4  #endif
     1.5  
     1.6  void
     1.7 -physical_itlb_miss(VCPU *vcpu, u64 vadr)
     1.8 -{
     1.9 -        physical_itlb_miss_dom0(vcpu, vadr);
    1.10 -}
    1.11 -
    1.12 -
    1.13 -void
    1.14  physical_itlb_miss_dom0(VCPU *vcpu, u64 vadr)
    1.15  {
    1.16      u64 psr;
    1.17 @@ -187,6 +180,13 @@ physical_itlb_miss_dom0(VCPU *vcpu, u64 
    1.18  
    1.19  
    1.20  void
    1.21 +physical_itlb_miss(VCPU *vcpu, u64 vadr)
    1.22 +{
    1.23 +        physical_itlb_miss_dom0(vcpu, vadr);
    1.24 +}
    1.25 +
    1.26 +
    1.27 +void
    1.28  physical_dtlb_miss(VCPU *vcpu, u64 vadr)
    1.29  {
    1.30      u64 psr;
     2.1 --- a/xen/arch/ia64/vmx/vmx_process.c	Mon Oct 24 11:32:45 2005 -0600
     2.2 +++ b/xen/arch/ia64/vmx/vmx_process.c	Mon Oct 24 11:41:27 2005 -0600
     2.3 @@ -56,6 +56,38 @@ extern struct ia64_sal_retval pal_emulat
     2.4  extern struct ia64_sal_retval sal_emulator(UINT64,UINT64,UINT64,UINT64,UINT64,UINT64,UINT64,UINT64);
     2.5  extern void rnat_consumption (VCPU *vcpu);
     2.6  #define DOMN_PAL_REQUEST    0x110000
     2.7 +
     2.8 +static UINT64 vec2off[68] = {0x0,0x400,0x800,0xc00,0x1000, 0x1400,0x1800,
     2.9 +    0x1c00,0x2000,0x2400,0x2800,0x2c00,0x3000,0x3400,0x3800,0x3c00,0x4000,
    2.10 +    0x4400,0x4800,0x4c00,0x5000,0x5100,0x5200,0x5300,0x5400,0x5500,0x5600,
    2.11 +    0x5700,0x5800,0x5900,0x5a00,0x5b00,0x5c00,0x5d00,0x5e00,0x5f00,0x6000,
    2.12 +    0x6100,0x6200,0x6300,0x6400,0x6500,0x6600,0x6700,0x6800,0x6900,0x6a00,
    2.13 +    0x6b00,0x6c00,0x6d00,0x6e00,0x6f00,0x7000,0x7100,0x7200,0x7300,0x7400,
    2.14 +    0x7500,0x7600,0x7700,0x7800,0x7900,0x7a00,0x7b00,0x7c00,0x7d00,0x7e00,
    2.15 +    0x7f00,
    2.16 +};
    2.17 +
    2.18 +
    2.19 +
    2.20 +void vmx_reflect_interruption(UINT64 ifa,UINT64 isr,UINT64 iim,
    2.21 +     UINT64 vector,REGS *regs)
    2.22 +{
    2.23 +    VCPU *vcpu = current;
    2.24 +    UINT64 viha,vpsr = vmx_vcpu_get_psr(vcpu);
    2.25 +    if(!(vpsr&IA64_PSR_IC)&&(vector!=5)){
    2.26 +        panic("Guest nested fault!");
    2.27 +    }
    2.28 +    VCPU(vcpu,isr)=isr;
    2.29 +    VCPU(vcpu,iipa) = regs->cr_iip;
    2.30 +    vector=vec2off[vector];
    2.31 +    if (vector == IA64_BREAK_VECTOR || vector == IA64_SPECULATION_VECTOR)
    2.32 +        VCPU(vcpu,iim) = iim;
    2.33 +    else {
    2.34 +        set_ifa_itir_iha(vcpu,ifa,1,1,1);
    2.35 +    }
    2.36 +    inject_guest_interruption(vcpu, vector);
    2.37 +}
    2.38 +
    2.39  IA64FAULT
    2.40  vmx_ia64_handle_break (unsigned long ifa, struct pt_regs *regs, unsigned long isr, unsigned long iim)
    2.41  {
    2.42 @@ -157,37 +189,6 @@ vmx_ia64_handle_break (unsigned long ifa
    2.43  		vmx_reflect_interruption(ifa,isr,iim,11,regs);
    2.44  }
    2.45  
    2.46 -static UINT64 vec2off[68] = {0x0,0x400,0x800,0xc00,0x1000, 0x1400,0x1800,
    2.47 -    0x1c00,0x2000,0x2400,0x2800,0x2c00,0x3000,0x3400,0x3800,0x3c00,0x4000,
    2.48 -    0x4400,0x4800,0x4c00,0x5000,0x5100,0x5200,0x5300,0x5400,0x5500,0x5600,
    2.49 -    0x5700,0x5800,0x5900,0x5a00,0x5b00,0x5c00,0x5d00,0x5e00,0x5f00,0x6000,
    2.50 -    0x6100,0x6200,0x6300,0x6400,0x6500,0x6600,0x6700,0x6800,0x6900,0x6a00,
    2.51 -    0x6b00,0x6c00,0x6d00,0x6e00,0x6f00,0x7000,0x7100,0x7200,0x7300,0x7400,
    2.52 -    0x7500,0x7600,0x7700,0x7800,0x7900,0x7a00,0x7b00,0x7c00,0x7d00,0x7e00,
    2.53 -    0x7f00,
    2.54 -};
    2.55 -
    2.56 -
    2.57 -
    2.58 -void vmx_reflect_interruption(UINT64 ifa,UINT64 isr,UINT64 iim,
    2.59 -     UINT64 vector,REGS *regs)
    2.60 -{
    2.61 -    VCPU *vcpu = current;
    2.62 -    UINT64 viha,vpsr = vmx_vcpu_get_psr(vcpu);
    2.63 -    if(!(vpsr&IA64_PSR_IC)&&(vector!=5)){
    2.64 -        panic("Guest nested fault!");
    2.65 -    }
    2.66 -    VCPU(vcpu,isr)=isr;
    2.67 -    VCPU(vcpu,iipa) = regs->cr_iip;
    2.68 -    vector=vec2off[vector];
    2.69 -    if (vector == IA64_BREAK_VECTOR || vector == IA64_SPECULATION_VECTOR)
    2.70 -        VCPU(vcpu,iim) = iim;
    2.71 -    else {
    2.72 -        set_ifa_itir_iha(vcpu,ifa,1,1,1);
    2.73 -    }
    2.74 -    inject_guest_interruption(vcpu, vector);
    2.75 -}
    2.76 -
    2.77  
    2.78  void save_banked_regs_to_vpd(VCPU *v, REGS *regs)
    2.79  {
    2.80 @@ -274,7 +275,7 @@ void vmx_hpw_miss(u64 vadr , u64 vec, RE
    2.81      u64 vhpt_adr, gppa;
    2.82      ISR misr;
    2.83      ia64_rr vrr;
    2.84 -    REGS *regs;
    2.85 +//    REGS *regs;
    2.86      thash_cb_t *vtlb, *vhpt;
    2.87      thash_data_t *data, me;
    2.88      VCPU *v = current;
     3.1 --- a/xen/arch/ia64/xen/xentime.c	Mon Oct 24 11:32:45 2005 -0600
     3.2 +++ b/xen/arch/ia64/xen/xentime.c	Mon Oct 24 11:41:27 2005 -0600
     3.3 @@ -38,6 +38,20 @@ static s_time_t        stime_irq = 0x0; 
     3.4  unsigned long itc_scale, ns_scale;
     3.5  unsigned long itc_at_irq;
     3.6  
     3.7 +/* We don't expect an absolute cycle value here, since then no way
     3.8 + * to prevent overflow for large norminator. Normally this conversion
     3.9 + * is used for relative offset.
    3.10 + */
    3.11 +u64 cycle_to_ns(u64 cycle)
    3.12 +{
    3.13 +    return (cycle * itc_scale) >> 32;
    3.14 +}
    3.15 +
    3.16 +u64 ns_to_cycle(u64 ns)
    3.17 +{
    3.18 +    return (ns * ns_scale) >> 32;
    3.19 +}
    3.20 +
    3.21  static inline u64 get_time_delta(void)
    3.22  {
    3.23      s64      delta_itc;
    3.24 @@ -52,19 +66,6 @@ static inline u64 get_time_delta(void)
    3.25      return cycle_to_ns(delta_itc);
    3.26  }
    3.27  
    3.28 -/* We don't expect an absolute cycle value here, since then no way
    3.29 - * to prevent overflow for large norminator. Normally this conversion
    3.30 - * is used for relative offset.
    3.31 - */
    3.32 -u64 cycle_to_ns(u64 cycle)
    3.33 -{
    3.34 -    return (cycle * itc_scale) >> 32;
    3.35 -}
    3.36 -
    3.37 -u64 ns_to_cycle(u64 ns)
    3.38 -{
    3.39 -    return (ns * ns_scale) >> 32;
    3.40 -}
    3.41  
    3.42  s_time_t get_s_time(void)
    3.43  {