ia64/xen-unstable

changeset 8586:c055d76ec559

Rename ac_timer_* interfaces -> timer_*. The ac_ is
meaningless and unnecessary.

Rename rem_timer -> stop_timer.

Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Thu Jan 12 23:39:14 2006 +0100 (2006-01-12)
parents bcf188da3ea1
children d32797209632
files xen/arch/ia64/vmx/vlsapic.c xen/arch/ia64/xen/xenmisc.c xen/arch/ia64/xen/xensetup.c xen/arch/ia64/xen/xentime.c xen/arch/x86/apic.c xen/arch/x86/nmi.c xen/arch/x86/setup.c xen/arch/x86/time.c xen/arch/x86/vmx.c xen/arch/x86/vmx_intercept.c xen/arch/x86/vmx_io.c xen/arch/x86/vmx_vlapic.c xen/arch/x86/vmx_vmcs.c xen/common/sched_bvt.c xen/common/sched_sedf.c xen/common/schedule.c xen/common/xmalloc.c xen/drivers/char/ns16550.c xen/include/asm-ia64/config.h xen/include/asm-ia64/vtm.h xen/include/asm-x86/vmx_vlapic.h xen/include/asm-x86/vmx_vmcs.h xen/include/asm-x86/vmx_vpit.h xen/include/xen/perfc_defn.h xen/include/xen/sched-if.h xen/include/xen/sched.h xen/include/xen/softirq.h
line diff
     1.1 --- a/xen/arch/ia64/vmx/vlsapic.c	Thu Jan 12 23:25:02 2006 +0100
     1.2 +++ b/xen/arch/ia64/vmx/vlsapic.c	Thu Jan 12 23:39:14 2006 +0100
     1.3 @@ -119,7 +119,7 @@ void vtm_init(VCPU *vcpu)
     1.4      itc_freq = local_cpu_data->itc_freq;
     1.5      vtm->cfg_max_jump=itc_freq*MAX_JUMP_STEP/1000;
     1.6      vtm->cfg_min_grun=itc_freq*MIN_GUEST_RUNNING_TIME/1000;
     1.7 -    init_ac_timer(&vtm->vtm_timer, vtm_timer_fn, vcpu, 0);
     1.8 +    init_timer(&vtm->vtm_timer, vtm_timer_fn, vcpu, 0);
     1.9      vtm_reset(vcpu);
    1.10  }
    1.11  
    1.12 @@ -163,20 +163,20 @@ void vtm_set_itv(VCPU *vcpu)
    1.13      local_irq_save(spsr);
    1.14      itv = VCPU(vcpu, itv);
    1.15      if ( ITV_IRQ_MASK(itv) )
    1.16 -        rem_ac_timer(&vtm->vtm_timer);
    1.17 +        stop_timer(&vtm->vtm_timer);
    1.18      vtm_interruption_update(vcpu, vtm);
    1.19      local_irq_restore(spsr);
    1.20  }
    1.21  
    1.22  
    1.23  /*
    1.24 - * Update interrupt or hook the vtm ac_timer for fire 
    1.25 + * Update interrupt or hook the vtm timer for fire 
    1.26   * At this point vtm_timer should be removed if itv is masked.
    1.27   */
    1.28  /* Interrupt must be disabled at this point */
    1.29  
    1.30  extern u64 cycle_to_ns(u64 cyle);
    1.31 -#define TIMER_SLOP (50*1000) /* ns */  /* copy from ac_timer.c */
    1.32 +#define TIMER_SLOP (50*1000) /* ns */  /* copy from timer.c */
    1.33  void vtm_interruption_update(VCPU *vcpu, vtime_t* vtm)
    1.34  {
    1.35      uint64_t    cur_itc,vitm,vitv;
    1.36 @@ -198,7 +198,7 @@ void vtm_interruption_update(VCPU *vcpu,
    1.37      
    1.38      if ( diff_last >= 0 ) {
    1.39          // interrupt already fired.
    1.40 -        rem_ac_timer(&vtm->vtm_timer);
    1.41 +        stop_timer(&vtm->vtm_timer);
    1.42      }
    1.43      else if ( diff_now >= 0 ) {
    1.44          // ITV is fired.
    1.45 @@ -207,24 +207,24 @@ void vtm_interruption_update(VCPU *vcpu,
    1.46      /* Both last_itc & cur_itc < itm, wait for fire condition */
    1.47      else {
    1.48          expires = NOW() + cycle_to_ns(0-diff_now) + TIMER_SLOP;
    1.49 -        set_ac_timer(&vtm->vtm_timer, expires);
    1.50 +        set_timer(&vtm->vtm_timer, expires);
    1.51      }
    1.52      local_irq_restore(spsr);
    1.53  }
    1.54  
    1.55  /*
    1.56   * Action for vtm when the domain is scheduled out.
    1.57 - * Remove the ac_timer for vtm.
    1.58 + * Remove the timer for vtm.
    1.59   */
    1.60  void vtm_domain_out(VCPU *vcpu)
    1.61  {
    1.62      if(!is_idle_domain(vcpu->domain))
    1.63 -	rem_ac_timer(&vcpu->arch.arch_vmx.vtm.vtm_timer);
    1.64 +	stop_timer(&vcpu->arch.arch_vmx.vtm.vtm_timer);
    1.65  }
    1.66  
    1.67  /*
    1.68   * Action for vtm when the domain is scheduled in.
    1.69 - * Fire vtm IRQ or add the ac_timer for vtm.
    1.70 + * Fire vtm IRQ or add the timer for vtm.
    1.71   */
    1.72  void vtm_domain_in(VCPU *vcpu)
    1.73  {
     2.1 --- a/xen/arch/ia64/xen/xenmisc.c	Thu Jan 12 23:25:02 2006 +0100
     2.2 +++ b/xen/arch/ia64/xen/xenmisc.c	Thu Jan 12 23:39:14 2006 +0100
     2.3 @@ -75,7 +75,7 @@ struct pt_regs *guest_cpu_user_regs(void
     2.4  
     2.5  void raise_actimer_softirq(void)
     2.6  {
     2.7 -	raise_softirq(AC_TIMER_SOFTIRQ);
     2.8 +	raise_softirq(TIMER_SOFTIRQ);
     2.9  }
    2.10  
    2.11  unsigned long
     3.1 --- a/xen/arch/ia64/xen/xensetup.c	Thu Jan 12 23:25:02 2006 +0100
     3.2 +++ b/xen/arch/ia64/xen/xensetup.c	Thu Jan 12 23:39:14 2006 +0100
     3.3 @@ -291,8 +291,8 @@ printk("About to call scheduler_init()\n
     3.4      init_IRQ ();
     3.5  printk("About to call init_xen_time()\n");
     3.6      init_xen_time(); /* initialise the time */
     3.7 -printk("About to call ac_timer_init()\n");
     3.8 -    ac_timer_init();
     3.9 +printk("About to call timer_init()\n");
    3.10 +    timer_init();
    3.11  
    3.12  #ifdef CONFIG_XEN_CONSOLE_INPUT	/* CONFIG_SERIAL_8250_CONSOLE=n in dom0! */
    3.13      initialize_keytable();
     4.1 --- a/xen/arch/ia64/xen/xentime.c	Thu Jan 12 23:25:02 2006 +0100
     4.2 +++ b/xen/arch/ia64/xen/xentime.c	Thu Jan 12 23:39:14 2006 +0100
     4.3 @@ -196,7 +196,7 @@ xen_timer_interrupt (int irq, void *dev_
     4.4  //#endif
     4.5  		/* double check, in case we got hit by a (slow) PMI: */
     4.6  	} while (time_after_eq(ia64_get_itc(), new_itm));
     4.7 -	raise_softirq(AC_TIMER_SOFTIRQ);
     4.8 +	raise_softirq(TIMER_SOFTIRQ);
     4.9  
    4.10  	return IRQ_HANDLED;
    4.11  }
    4.12 @@ -235,7 +235,7 @@ int __init init_xen_time()
    4.13      return 0;
    4.14  }
    4.15  
    4.16 -int reprogram_ac_timer(s_time_t timeout)
    4.17 +int reprogram_timer(s_time_t timeout)
    4.18  {
    4.19  	struct vcpu *v = current;
    4.20  	s_time_t expire;
     5.1 --- a/xen/arch/x86/apic.c	Thu Jan 12 23:25:02 2006 +0100
     5.2 +++ b/xen/arch/x86/apic.c	Thu Jan 12 23:39:14 2006 +0100
     5.3 @@ -870,7 +870,7 @@ void enable_APIC_timer(void)
     5.4   * returns 1 on success
     5.5   * returns 0 if the timeout value is too small or in the past.
     5.6   */
     5.7 -int reprogram_ac_timer(s_time_t timeout)
     5.8 +int reprogram_timer(s_time_t timeout)
     5.9  {
    5.10      s_time_t    now;
    5.11      s_time_t    expire;
    5.12 @@ -931,7 +931,7 @@ void smp_apic_timer_interrupt(struct cpu
    5.13  {
    5.14      ack_APIC_irq();
    5.15      perfc_incrc(apic_timer);
    5.16 -    raise_softirq(AC_TIMER_SOFTIRQ);
    5.17 +    raise_softirq(TIMER_SOFTIRQ);
    5.18  }
    5.19  
    5.20  /*
     6.1 --- a/xen/arch/x86/nmi.c	Thu Jan 12 23:25:02 2006 +0100
     6.2 +++ b/xen/arch/x86/nmi.c	Thu Jan 12 23:39:14 2006 +0100
     6.3 @@ -34,7 +34,7 @@ unsigned int nmi_watchdog = NMI_NONE;
     6.4  static unsigned int nmi_hz = HZ;
     6.5  static unsigned int nmi_perfctr_msr;	/* the MSR to reset in NMI handler */
     6.6  static unsigned int nmi_p4_cccr_val;
     6.7 -static struct ac_timer nmi_timer[NR_CPUS];
     6.8 +static struct timer nmi_timer[NR_CPUS];
     6.9  static unsigned int nmi_timer_ticks[NR_CPUS];
    6.10  
    6.11  /*
    6.12 @@ -132,7 +132,7 @@ static void nmi_timer_fn(void *unused)
    6.13  {
    6.14      int cpu = smp_processor_id();
    6.15      nmi_timer_ticks[cpu]++;
    6.16 -    set_ac_timer(&nmi_timer[cpu], NOW() + MILLISECS(1000));
    6.17 +    set_timer(&nmi_timer[cpu], NOW() + MILLISECS(1000));
    6.18  }
    6.19  
    6.20  static void disable_lapic_nmi_watchdog(void)
    6.21 @@ -345,7 +345,7 @@ void __pminit setup_apic_nmi_watchdog(vo
    6.22      lapic_nmi_owner = LAPIC_NMI_WATCHDOG;
    6.23      nmi_active = 1;
    6.24  
    6.25 -    init_ac_timer(&nmi_timer[cpu], nmi_timer_fn, NULL, cpu);
    6.26 +    init_timer(&nmi_timer[cpu], nmi_timer_fn, NULL, cpu);
    6.27  }
    6.28  
    6.29  static unsigned int
    6.30 @@ -383,7 +383,7 @@ void watchdog_enable(void)
    6.31           * during setup because the timer infrastructure is not available. 
    6.32           */
    6.33          for_each_online_cpu ( cpu )
    6.34 -            set_ac_timer(&nmi_timer[cpu], NOW());
    6.35 +            set_timer(&nmi_timer[cpu], NOW());
    6.36      }
    6.37  
    6.38      spin_unlock_irqrestore(&watchdog_lock, flags);
     7.1 --- a/xen/arch/x86/setup.c	Thu Jan 12 23:25:02 2006 +0100
     7.2 +++ b/xen/arch/x86/setup.c	Thu Jan 12 23:39:14 2006 +0100
     7.3 @@ -423,7 +423,7 @@ void __init __start_xen(multiboot_info_t
     7.4  
     7.5      trap_init();
     7.6  
     7.7 -    ac_timer_init();
     7.8 +    timer_init();
     7.9  
    7.10      early_time_init();
    7.11  
     8.1 --- a/xen/arch/x86/time.c	Thu Jan 12 23:25:02 2006 +0100
     8.2 +++ b/xen/arch/x86/time.c	Thu Jan 12 23:39:14 2006 +0100
     8.3 @@ -17,7 +17,7 @@
     8.4  #include <xen/config.h>
     8.5  #include <xen/init.h>
     8.6  #include <xen/time.h>
     8.7 -#include <xen/ac_timer.h>
     8.8 +#include <xen/timer.h>
     8.9  #include <xen/smp.h>
    8.10  #include <xen/irq.h>
    8.11  #include <xen/softirq.h>
    8.12 @@ -56,7 +56,7 @@ struct cpu_time {
    8.13      s_time_t stime_local_stamp;
    8.14      s_time_t stime_master_stamp;
    8.15      struct time_scale tsc_scale;
    8.16 -    struct ac_timer calibration_timer;
    8.17 +    struct timer calibration_timer;
    8.18  } __cacheline_aligned;
    8.19  
    8.20  static struct cpu_time cpu_time[NR_CPUS];
    8.21 @@ -163,7 +163,7 @@ void timer_interrupt(int irq, void *dev_
    8.22  
    8.23      /* Rough hack to allow accurate timers to sort-of-work with no APIC. */
    8.24      if ( !cpu_has_apic )
    8.25 -        raise_softirq(AC_TIMER_SOFTIRQ);
    8.26 +        raise_softirq(TIMER_SOFTIRQ);
    8.27  
    8.28      if ( using_pit )
    8.29          pit_overflow();
    8.30 @@ -342,7 +342,7 @@ static void init_pit(void)
    8.31  /* Protected by platform_timer_lock. */
    8.32  static u64 hpet_counter64, hpet_overflow_period;
    8.33  static u32 hpet_stamp;
    8.34 -static struct ac_timer hpet_overflow_timer;
    8.35 +static struct timer hpet_overflow_timer;
    8.36  
    8.37  static void hpet_overflow(void *unused)
    8.38  {
    8.39 @@ -354,7 +354,7 @@ static void hpet_overflow(void *unused)
    8.40      hpet_stamp = counter;
    8.41      spin_unlock_irq(&platform_timer_lock);
    8.42  
    8.43 -    set_ac_timer(&hpet_overflow_timer, NOW() + hpet_overflow_period);
    8.44 +    set_timer(&hpet_overflow_timer, NOW() + hpet_overflow_period);
    8.45  }
    8.46  
    8.47  static u64 read_hpet_count(void)
    8.48 @@ -430,7 +430,7 @@ static int init_hpet(void)
    8.49          (void)do_div(hpet_overflow_period, (u32)hpet_rate);
    8.50      }
    8.51  
    8.52 -    init_ac_timer(&hpet_overflow_timer, hpet_overflow, NULL, 0);
    8.53 +    init_timer(&hpet_overflow_timer, hpet_overflow, NULL, 0);
    8.54      hpet_overflow(NULL);
    8.55      platform_timer_stamp = hpet_counter64;
    8.56  
    8.57 @@ -459,7 +459,7 @@ int use_cyclone;
    8.58  /* Protected by platform_timer_lock. */
    8.59  static u64 cyclone_counter64;
    8.60  static u32 cyclone_stamp;
    8.61 -static struct ac_timer cyclone_overflow_timer;
    8.62 +static struct timer cyclone_overflow_timer;
    8.63  static volatile u32 *cyclone_timer; /* Cyclone MPMC0 register */
    8.64  
    8.65  static void cyclone_overflow(void *unused)
    8.66 @@ -472,7 +472,7 @@ static void cyclone_overflow(void *unuse
    8.67      cyclone_stamp = counter;
    8.68      spin_unlock_irq(&platform_timer_lock);
    8.69  
    8.70 -    set_ac_timer(&cyclone_overflow_timer, NOW() + MILLISECS(20000));
    8.71 +    set_timer(&cyclone_overflow_timer, NOW() + MILLISECS(20000));
    8.72  }
    8.73  
    8.74  static u64 read_cyclone_count(void)
    8.75 @@ -510,7 +510,7 @@ static int init_cyclone(void)
    8.76  
    8.77      read_platform_count = read_cyclone_count;
    8.78  
    8.79 -    init_ac_timer(&cyclone_overflow_timer, cyclone_overflow, NULL, 0);
    8.80 +    init_timer(&cyclone_overflow_timer, cyclone_overflow, NULL, 0);
    8.81      cyclone_overflow(NULL);
    8.82      platform_timer_stamp = cyclone_counter64;
    8.83      set_time_scale(&platform_timer_scale, CYCLONE_TIMER_FREQ);
    8.84 @@ -876,7 +876,7 @@ static void local_time_calibration(void 
    8.85      cpu_time[cpu].stime_master_stamp = curr_master_stime;
    8.86  
    8.87   out:
    8.88 -    set_ac_timer(&cpu_time[cpu].calibration_timer, NOW() + EPOCH);
    8.89 +    set_timer(&cpu_time[cpu].calibration_timer, NOW() + EPOCH);
    8.90  
    8.91      if ( cpu == 0 )
    8.92          platform_time_calibration();
    8.93 @@ -896,9 +896,9 @@ void init_percpu_time(void)
    8.94      cpu_time[cpu].stime_master_stamp = now;
    8.95      cpu_time[cpu].stime_local_stamp  = now;
    8.96  
    8.97 -    init_ac_timer(&cpu_time[cpu].calibration_timer,
    8.98 +    init_timer(&cpu_time[cpu].calibration_timer,
    8.99                    local_time_calibration, NULL, cpu);
   8.100 -    set_ac_timer(&cpu_time[cpu].calibration_timer, NOW() + EPOCH);
   8.101 +    set_timer(&cpu_time[cpu].calibration_timer, NOW() + EPOCH);
   8.102  }
   8.103  
   8.104  /* Late init function (after all CPUs are booted). */
     9.1 --- a/xen/arch/x86/vmx.c	Thu Jan 12 23:25:02 2006 +0100
     9.2 +++ b/xen/arch/x86/vmx.c	Thu Jan 12 23:39:14 2006 +0100
     9.3 @@ -105,13 +105,13 @@ void vmx_relinquish_resources(struct vcp
     9.4      destroy_vmcs(&v->arch.arch_vmx);
     9.5      free_monitor_pagetable(v);
     9.6      vpit = &v->domain->arch.vmx_platform.vmx_pit;
     9.7 -    if ( active_ac_timer(&(vpit->pit_timer)) )
     9.8 -        rem_ac_timer(&vpit->pit_timer);
     9.9 -    if ( active_ac_timer(&v->arch.arch_vmx.hlt_timer) )
    9.10 -        rem_ac_timer(&v->arch.arch_vmx.hlt_timer);
    9.11 +    if ( active_timer(&(vpit->pit_timer)) )
    9.12 +        stop_timer(&vpit->pit_timer);
    9.13 +    if ( active_timer(&v->arch.arch_vmx.hlt_timer) )
    9.14 +        stop_timer(&v->arch.arch_vmx.hlt_timer);
    9.15      if ( vmx_apic_support(v->domain) && (VLAPIC(v) != NULL) )
    9.16      {
    9.17 -        rem_ac_timer(&VLAPIC(v)->vlapic_timer);
    9.18 +        stop_timer(&VLAPIC(v)->vlapic_timer);
    9.19          xfree(VLAPIC(v));
    9.20      }
    9.21  }
    9.22 @@ -1600,7 +1600,7 @@ void vmx_vmexit_do_hlt(void)
    9.23          next_wakeup = next_pit;
    9.24      }
    9.25      if ( next_wakeup != - 1 ) 
    9.26 -        set_ac_timer(&current->arch.arch_vmx.hlt_timer, next_wakeup);
    9.27 +        set_timer(&current->arch.arch_vmx.hlt_timer, next_wakeup);
    9.28      do_block();
    9.29  }
    9.30  
    10.1 --- a/xen/arch/x86/vmx_intercept.c	Thu Jan 12 23:25:02 2006 +0100
    10.2 +++ b/xen/arch/x86/vmx_intercept.c	Thu Jan 12 23:39:14 2006 +0100
    10.3 @@ -356,19 +356,19 @@ static void pit_timer_fn(void *data)
    10.4      vpit->pending_intr_nr++;
    10.5      if ( test_bit(_VCPUF_running, &v->vcpu_flags) ) {
    10.6          vpit->scheduled += vpit->period;
    10.7 -        set_ac_timer(&vpit->pit_timer, vpit->scheduled);
    10.8 +        set_timer(&vpit->pit_timer, vpit->scheduled);
    10.9      }
   10.10  }
   10.11  
   10.12  void pickup_deactive_ticks(struct vmx_virpit *vpit)
   10.13  {
   10.14  
   10.15 -    if ( !active_ac_timer(&(vpit->pit_timer)) ) {
   10.16 +    if ( !active_timer(&(vpit->pit_timer)) ) {
   10.17          /* pick up missed timer tick */
   10.18          missed_ticks(vpit);
   10.19      
   10.20          vpit->scheduled += vpit->period;
   10.21 -        set_ac_timer(&vpit->pit_timer, vpit->scheduled);
   10.22 +        set_timer(&vpit->pit_timer, vpit->scheduled);
   10.23      }
   10.24  }
   10.25  
   10.26 @@ -385,14 +385,14 @@ void vmx_hooks_assist(struct vcpu *v)
   10.27      /* load init count*/
   10.28      if (p->state == STATE_IORESP_HOOK) {
   10.29          /* set up actimer, handle re-init */
   10.30 -        if ( active_ac_timer(&(vpit->pit_timer)) ) {
   10.31 +        if ( active_timer(&(vpit->pit_timer)) ) {
   10.32              VMX_DBG_LOG(DBG_LEVEL_1, "VMX_PIT: guest reset PIT with channel %lx!\n", (unsigned long) ((p->u.data >> 24) & 0x3) );
   10.33 -            rem_ac_timer(&(vpit->pit_timer));
   10.34 +            stop_timer(&(vpit->pit_timer));
   10.35              reinit = 1;
   10.36   
   10.37          }
   10.38          else {
   10.39 -            init_ac_timer(&vpit->pit_timer, pit_timer_fn, v, v->processor);
   10.40 +            init_timer(&vpit->pit_timer, pit_timer_fn, v, v->processor);
   10.41          }
   10.42  
   10.43          /* init count for this channel */
   10.44 @@ -431,7 +431,7 @@ void vmx_hooks_assist(struct vcpu *v)
   10.45          }
   10.46  
   10.47          vpit->scheduled = NOW() + vpit->period;
   10.48 -        set_ac_timer(&vpit->pit_timer, vpit->scheduled);
   10.49 +        set_timer(&vpit->pit_timer, vpit->scheduled);
   10.50  
   10.51          /*restore the state*/
   10.52          p->state = STATE_IORESP_READY;
    11.1 --- a/xen/arch/x86/vmx_io.c	Thu Jan 12 23:25:02 2006 +0100
    11.2 +++ b/xen/arch/x86/vmx_io.c	Thu Jan 12 23:39:14 2006 +0100
    11.3 @@ -819,7 +819,7 @@ interrupt_post_injection(struct vcpu * v
    11.4          if ( !vpit->first_injected ) {
    11.5              vpit->pending_intr_nr = 0;
    11.6              vpit->scheduled = NOW() + vpit->period;
    11.7 -            set_ac_timer(&vpit->pit_timer, vpit->scheduled);
    11.8 +            set_timer(&vpit->pit_timer, vpit->scheduled);
    11.9              vpit->first_injected = 1;
   11.10          } else {
   11.11              vpit->pending_intr_nr--;
    12.1 --- a/xen/arch/x86/vmx_vlapic.c	Thu Jan 12 23:25:02 2006 +0100
    12.2 +++ b/xen/arch/x86/vmx_vlapic.c	Thu Jan 12 23:39:14 2006 +0100
    12.3 @@ -391,7 +391,7 @@ static void vlapic_begin_timer(struct vl
    12.4        (262144 / get_apic_bus_scale()) * vlapic->timer_divide_counter;
    12.5      vlapic->vlapic_timer.expires = cur + offset;
    12.6  
    12.7 -    set_ac_timer(&(vlapic->vlapic_timer), vlapic->vlapic_timer.expires );
    12.8 +    set_timer(&(vlapic->vlapic_timer), vlapic->vlapic_timer.expires );
    12.9  
   12.10      VMX_DBG_LOG(DBG_LEVEL_VLAPIC, "vlapic_begin_timer: "
   12.11                  "bus_scale %x now %08x%08x expire %08x%08x "
   12.12 @@ -739,7 +739,7 @@ static void vlapic_write(struct vcpu *v,
   12.13  
   12.14      case APIC_TMICT:
   12.15          if (vlapic_timer_active(vlapic))
   12.16 -            rem_ac_timer(&(vlapic->vlapic_timer));
   12.17 +            stop_timer(&(vlapic->vlapic_timer));
   12.18  
   12.19          vlapic->timer_initial = val;
   12.20          vlapic->timer_current = val;
   12.21 @@ -846,7 +846,7 @@ void vlapic_timer_fn(void *data)
   12.22          vlapic->timer_current = vlapic->timer_initial;
   12.23          offset = vlapic->timer_current * (262144/get_apic_bus_scale()) * vlapic->timer_divide_counter;
   12.24          vlapic->vlapic_timer.expires = NOW() + offset;
   12.25 -        set_ac_timer(&(vlapic->vlapic_timer), vlapic->vlapic_timer.expires);
   12.26 +        set_timer(&(vlapic->vlapic_timer), vlapic->vlapic_timer.expires);
   12.27      }else {
   12.28          vlapic->timer_current = 0;
   12.29      }
   12.30 @@ -986,7 +986,7 @@ static int vlapic_reset(struct vlapic *v
   12.31  
   12.32      vmx_vioapic_add_lapic(vlapic, v);
   12.33  
   12.34 -    init_ac_timer(&vlapic->vlapic_timer,
   12.35 +    init_timer(&vlapic->vlapic_timer,
   12.36                    vlapic_timer_fn, vlapic, v->processor);
   12.37  
   12.38  #ifdef VLAPIC_NO_BIOS
    13.1 --- a/xen/arch/x86/vmx_vmcs.c	Thu Jan 12 23:25:02 2006 +0100
    13.2 +++ b/xen/arch/x86/vmx_vmcs.c	Thu Jan 12 23:39:14 2006 +0100
    13.3 @@ -341,7 +341,7 @@ static void vmx_do_launch(struct vcpu *v
    13.4          vlapic_init(v);
    13.5  
    13.6      vmx_set_host_env(v);
    13.7 -    init_ac_timer(&v->arch.arch_vmx.hlt_timer, hlt_timer_fn, v, v->processor);
    13.8 +    init_timer(&v->arch.arch_vmx.hlt_timer, hlt_timer_fn, v, v->processor);
    13.9  
   13.10      error |= __vmwrite(GUEST_LDTR_SELECTOR, 0);
   13.11      error |= __vmwrite(GUEST_LDTR_BASE, 0);
    14.1 --- a/xen/common/ac_timer.c	Thu Jan 12 23:25:02 2006 +0100
    14.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    14.3 @@ -1,286 +0,0 @@
    14.4 -/******************************************************************************
    14.5 - * ac_timer.c
    14.6 - * 
    14.7 - * Copyright (c) 2002-2003 Rolf Neugebauer
    14.8 - * Copyright (c) 2002-2005 K A Fraser
    14.9 - */
   14.10 -
   14.11 -#include <xen/config.h>
   14.12 -#include <xen/init.h>
   14.13 -#include <xen/types.h>
   14.14 -#include <xen/errno.h>
   14.15 -#include <xen/sched.h>
   14.16 -#include <xen/lib.h>
   14.17 -#include <xen/smp.h>
   14.18 -#include <xen/perfc.h>
   14.19 -#include <xen/time.h>
   14.20 -#include <xen/softirq.h>
   14.21 -#include <xen/ac_timer.h>
   14.22 -#include <xen/keyhandler.h>
   14.23 -#include <asm/system.h>
   14.24 -#include <asm/desc.h>
   14.25 -
   14.26 -/*
   14.27 - * We pull handlers off the timer list this far in future,
   14.28 - * rather than reprogramming the time hardware.
   14.29 - */
   14.30 -#define TIMER_SLOP (50*1000) /* ns */
   14.31 -
   14.32 -struct ac_timers {
   14.33 -    spinlock_t        lock;
   14.34 -    struct ac_timer **heap;
   14.35 -    unsigned int      softirqs;
   14.36 -} __cacheline_aligned;
   14.37 -
   14.38 -struct ac_timers ac_timers[NR_CPUS];
   14.39 -
   14.40 -extern int reprogram_ac_timer(s_time_t timeout);
   14.41 -
   14.42 -/****************************************************************************
   14.43 - * HEAP OPERATIONS.
   14.44 - */
   14.45 -
   14.46 -#define GET_HEAP_SIZE(_h)     ((int)(((u16 *)(_h))[0]))
   14.47 -#define SET_HEAP_SIZE(_h,_v)  (((u16 *)(_h))[0] = (u16)(_v))
   14.48 -
   14.49 -#define GET_HEAP_LIMIT(_h)    ((int)(((u16 *)(_h))[1]))
   14.50 -#define SET_HEAP_LIMIT(_h,_v) (((u16 *)(_h))[1] = (u16)(_v))
   14.51 -
   14.52 -/* Sink down element @pos of @heap. */
   14.53 -static void down_heap(struct ac_timer **heap, int pos)
   14.54 -{
   14.55 -    int sz = GET_HEAP_SIZE(heap), nxt;
   14.56 -    struct ac_timer *t = heap[pos];
   14.57 -
   14.58 -    while ( (nxt = (pos << 1)) <= sz )
   14.59 -    {
   14.60 -        if ( ((nxt+1) <= sz) && (heap[nxt+1]->expires < heap[nxt]->expires) )
   14.61 -            nxt++;
   14.62 -        if ( heap[nxt]->expires > t->expires )
   14.63 -            break;
   14.64 -        heap[pos] = heap[nxt];
   14.65 -        heap[pos]->heap_offset = pos;
   14.66 -        pos = nxt;
   14.67 -    }
   14.68 -
   14.69 -    heap[pos] = t;
   14.70 -    t->heap_offset = pos;
   14.71 -}
   14.72 -
   14.73 -/* Float element @pos up @heap. */
   14.74 -static void up_heap(struct ac_timer **heap, int pos)
   14.75 -{
   14.76 -    struct ac_timer *t = heap[pos];
   14.77 -
   14.78 -    while ( (pos > 1) && (t->expires < heap[pos>>1]->expires) )
   14.79 -    {
   14.80 -        heap[pos] = heap[pos>>1];
   14.81 -        heap[pos]->heap_offset = pos;
   14.82 -        pos >>= 1;
   14.83 -    }
   14.84 -
   14.85 -    heap[pos] = t;
   14.86 -    t->heap_offset = pos;
   14.87 -}
   14.88 -
   14.89 -
   14.90 -/* Delete @t from @heap. Return TRUE if new top of heap. */
   14.91 -static int remove_entry(struct ac_timer **heap, struct ac_timer *t)
   14.92 -{
   14.93 -    int sz = GET_HEAP_SIZE(heap);
   14.94 -    int pos = t->heap_offset;
   14.95 -
   14.96 -    t->heap_offset = 0;
   14.97 -
   14.98 -    if ( unlikely(pos == sz) )
   14.99 -    {
  14.100 -        SET_HEAP_SIZE(heap, sz-1);
  14.101 -        goto out;
  14.102 -    }
  14.103 -
  14.104 -    heap[pos] = heap[sz];
  14.105 -    heap[pos]->heap_offset = pos;
  14.106 -
  14.107 -    SET_HEAP_SIZE(heap, --sz);
  14.108 -
  14.109 -    if ( (pos > 1) && (heap[pos]->expires < heap[pos>>1]->expires) )
  14.110 -        up_heap(heap, pos);
  14.111 -    else
  14.112 -        down_heap(heap, pos);
  14.113 -
  14.114 - out:
  14.115 -    return (pos == 1);
  14.116 -}
  14.117 -
  14.118 -
  14.119 -/* Add new entry @t to @heap. Return TRUE if new top of heap. */
  14.120 -static int add_entry(struct ac_timer ***pheap, struct ac_timer *t)
  14.121 -{
  14.122 -    struct ac_timer **heap = *pheap;
  14.123 -    int sz = GET_HEAP_SIZE(heap);
  14.124 -
  14.125 -    /* Copy the heap if it is full. */
  14.126 -    if ( unlikely(sz == GET_HEAP_LIMIT(heap)) )
  14.127 -    {
  14.128 -        /* old_limit == (2^n)-1; new_limit == (2^(n+4))-1 */
  14.129 -        int old_limit = GET_HEAP_LIMIT(heap);
  14.130 -        int new_limit = ((old_limit + 1) << 4) - 1;
  14.131 -        heap = xmalloc_array(struct ac_timer *, new_limit + 1);
  14.132 -        BUG_ON(heap == NULL);
  14.133 -        memcpy(heap, *pheap, (old_limit + 1) * sizeof(*heap));
  14.134 -        SET_HEAP_LIMIT(heap, new_limit);
  14.135 -        if ( old_limit != 0 )
  14.136 -            xfree(*pheap);
  14.137 -        *pheap = heap;
  14.138 -    }
  14.139 -
  14.140 -    SET_HEAP_SIZE(heap, ++sz);
  14.141 -    heap[sz] = t;
  14.142 -    t->heap_offset = sz;
  14.143 -    up_heap(heap, sz);
  14.144 -    return (t->heap_offset == 1);
  14.145 -}
  14.146 -
  14.147 -
  14.148 -/****************************************************************************
  14.149 - * TIMER OPERATIONS.
  14.150 - */
  14.151 -
  14.152 -static inline void __add_ac_timer(struct ac_timer *timer)
  14.153 -{
  14.154 -    int cpu = timer->cpu;
  14.155 -    if ( add_entry(&ac_timers[cpu].heap, timer) )
  14.156 -        cpu_raise_softirq(cpu, AC_TIMER_SOFTIRQ);
  14.157 -}
  14.158 -
  14.159 -
  14.160 -static inline void __rem_ac_timer(struct ac_timer *timer)
  14.161 -{
  14.162 -    int cpu = timer->cpu;
  14.163 -    if ( remove_entry(ac_timers[cpu].heap, timer) )
  14.164 -        cpu_raise_softirq(cpu, AC_TIMER_SOFTIRQ);
  14.165 -}
  14.166 -
  14.167 -
  14.168 -void set_ac_timer(struct ac_timer *timer, s_time_t expires)
  14.169 -{
  14.170 -    int           cpu = timer->cpu;
  14.171 -    unsigned long flags;
  14.172 -
  14.173 -    spin_lock_irqsave(&ac_timers[cpu].lock, flags);
  14.174 -    ASSERT(timer != NULL);
  14.175 -    if ( active_ac_timer(timer) )
  14.176 -        __rem_ac_timer(timer);
  14.177 -    timer->expires = expires;
  14.178 -    __add_ac_timer(timer);
  14.179 -    spin_unlock_irqrestore(&ac_timers[cpu].lock, flags);
  14.180 -}
  14.181 -
  14.182 -
  14.183 -void rem_ac_timer(struct ac_timer *timer)
  14.184 -{
  14.185 -    int           cpu = timer->cpu;
  14.186 -    unsigned long flags;
  14.187 -
  14.188 -    spin_lock_irqsave(&ac_timers[cpu].lock, flags);
  14.189 -    ASSERT(timer != NULL);
  14.190 -    if ( active_ac_timer(timer) )
  14.191 -        __rem_ac_timer(timer);
  14.192 -    spin_unlock_irqrestore(&ac_timers[cpu].lock, flags);
  14.193 -}
  14.194 -
  14.195 -
  14.196 -static void ac_timer_softirq_action(void)
  14.197 -{
  14.198 -    int              cpu = smp_processor_id();
  14.199 -    struct ac_timer *t, **heap;
  14.200 -    s_time_t         now;
  14.201 -    void             (*fn)(void *);
  14.202 -
  14.203 -    spin_lock_irq(&ac_timers[cpu].lock);
  14.204 -    
  14.205 -    do {
  14.206 -        heap = ac_timers[cpu].heap;
  14.207 -        now  = NOW();
  14.208 -
  14.209 -        while ( (GET_HEAP_SIZE(heap) != 0) &&
  14.210 -                ((t = heap[1])->expires < (now + TIMER_SLOP)) )
  14.211 -        {
  14.212 -            remove_entry(heap, t);
  14.213 -
  14.214 -            if ( (fn = t->function) != NULL )
  14.215 -            {
  14.216 -                void *data = t->data;
  14.217 -                spin_unlock_irq(&ac_timers[cpu].lock);
  14.218 -                (*fn)(data);
  14.219 -                spin_lock_irq(&ac_timers[cpu].lock);
  14.220 -            }
  14.221 -
  14.222 -            /* Heap may have grown while the lock was released. */
  14.223 -            heap = ac_timers[cpu].heap;
  14.224 -        }
  14.225 -    }
  14.226 -    while ( !reprogram_ac_timer(GET_HEAP_SIZE(heap) ? heap[1]->expires : 0) );
  14.227 -
  14.228 -    spin_unlock_irq(&ac_timers[cpu].lock);
  14.229 -}
  14.230 -
  14.231 -
  14.232 -static void dump_timerq(unsigned char key)
  14.233 -{
  14.234 -    struct ac_timer *t;
  14.235 -    unsigned long    flags; 
  14.236 -    s_time_t         now = NOW();
  14.237 -    int              i, j;
  14.238 -
  14.239 -    printk("Dumping ac_timer queues: NOW=0x%08X%08X\n",
  14.240 -           (u32)(now>>32), (u32)now); 
  14.241 -
  14.242 -    for_each_online_cpu( i )
  14.243 -    {
  14.244 -        printk("CPU[%02d] ", i);
  14.245 -        spin_lock_irqsave(&ac_timers[i].lock, flags);
  14.246 -        for ( j = 1; j <= GET_HEAP_SIZE(ac_timers[i].heap); j++ )
  14.247 -        {
  14.248 -            t = ac_timers[i].heap[j];
  14.249 -            printk ("  %d : %p ex=0x%08X%08X %p\n",
  14.250 -                    j, t, (u32)(t->expires>>32), (u32)t->expires, t->data);
  14.251 -        }
  14.252 -        spin_unlock_irqrestore(&ac_timers[i].lock, flags);
  14.253 -        printk("\n");
  14.254 -    }
  14.255 -}
  14.256 -
  14.257 -
  14.258 -void __init ac_timer_init(void)
  14.259 -{
  14.260 -    static struct ac_timer *dummy_heap;
  14.261 -    int i;
  14.262 -
  14.263 -    open_softirq(AC_TIMER_SOFTIRQ, ac_timer_softirq_action);
  14.264 -
  14.265 -    /*
  14.266 -     * All CPUs initially share an empty dummy heap. Only those CPUs that
  14.267 -     * are brought online will be dynamically allocated their own heap.
  14.268 -     */
  14.269 -    SET_HEAP_SIZE(&dummy_heap, 0);
  14.270 -    SET_HEAP_LIMIT(&dummy_heap, 0);
  14.271 -
  14.272 -    for ( i = 0; i < NR_CPUS; i++ )
  14.273 -    {
  14.274 -        spin_lock_init(&ac_timers[i].lock);
  14.275 -        ac_timers[i].heap = &dummy_heap;
  14.276 -    }
  14.277 -
  14.278 -    register_keyhandler('a', dump_timerq, "dump ac_timer queues");
  14.279 -}
  14.280 -
  14.281 -/*
  14.282 - * Local variables:
  14.283 - * mode: C
  14.284 - * c-set-style: "BSD"
  14.285 - * c-basic-offset: 4
  14.286 - * tab-width: 4
  14.287 - * indent-tabs-mode: nil
  14.288 - * End:
  14.289 - */
    15.1 --- a/xen/common/sched_bvt.c	Thu Jan 12 23:25:02 2006 +0100
    15.2 +++ b/xen/common/sched_bvt.c	Thu Jan 12 23:39:14 2006 +0100
    15.3 @@ -20,7 +20,7 @@
    15.4  #include <xen/delay.h>
    15.5  #include <xen/event.h>
    15.6  #include <xen/time.h>
    15.7 -#include <xen/ac_timer.h>
    15.8 +#include <xen/timer.h>
    15.9  #include <xen/perfc.h>
   15.10  #include <xen/sched-if.h>
   15.11  #include <xen/softirq.h>
   15.12 @@ -45,9 +45,9 @@ struct bvt_dom_info
   15.13                                               limits*/
   15.14      s32                 warp_value;       /* virtual time warp */
   15.15      s_time_t            warpl;            /* warp limit */
   15.16 -    struct ac_timer     warp_timer;       /* deals with warpl */
   15.17 +    struct timer     warp_timer;       /* deals with warpl */
   15.18      s_time_t            warpu;            /* unwarp time requirement */
   15.19 -    struct ac_timer     unwarp_timer;     /* deals with warpu */
   15.20 +    struct timer     unwarp_timer;     /* deals with warpu */
   15.21  
   15.22      struct bvt_vcpu_info vcpu_inf[MAX_VIRT_CPUS];
   15.23  };
   15.24 @@ -111,7 +111,7 @@ static void warp_timer_fn(void *data)
   15.25          cpu_raise_softirq(cpu, SCHEDULE_SOFTIRQ);   
   15.26      }
   15.27      
   15.28 -    set_ac_timer(&inf->unwarp_timer, NOW() + inf->warpu);
   15.29 +    set_timer(&inf->unwarp_timer, NOW() + inf->warpu);
   15.30  
   15.31      spin_unlock_irq(&schedule_data[cpu].schedule_lock);
   15.32  }
   15.33 @@ -214,8 +214,8 @@ static void bvt_add_task(struct vcpu *v)
   15.34          inf->warpl       = MILLISECS(2000);
   15.35          inf->warpu       = MILLISECS(1000);
   15.36          /* Initialise the warp timers. */
   15.37 -        init_ac_timer(&inf->warp_timer, warp_timer_fn, inf, v->processor);
   15.38 -        init_ac_timer(&inf->unwarp_timer, unwarp_timer_fn, inf, v->processor);
   15.39 +        init_timer(&inf->warp_timer, warp_timer_fn, inf, v->processor);
   15.40 +        init_timer(&inf->unwarp_timer, unwarp_timer_fn, inf, v->processor);
   15.41      }
   15.42  
   15.43      einf->vcpu = v;
   15.44 @@ -271,7 +271,7 @@ static void bvt_wake(struct vcpu *v)
   15.45      if ( is_idle_vcpu(curr) || (einf->evt <= curr_evt) )
   15.46          cpu_raise_softirq(cpu, SCHEDULE_SOFTIRQ);
   15.47      else if ( schedule_data[cpu].s_timer.expires > r_time )
   15.48 -        set_ac_timer(&schedule_data[cpu].s_timer, r_time);
   15.49 +        set_timer(&schedule_data[cpu].s_timer, r_time);
   15.50  }
   15.51  
   15.52  
   15.53 @@ -355,10 +355,10 @@ static int bvt_adjdom(
   15.54          inf->warpu = MILLISECS(warpu);
   15.55          
   15.56          /* If the unwarp timer set up it needs to be removed */
   15.57 -        rem_ac_timer(&inf->unwarp_timer);
   15.58 +        stop_timer(&inf->unwarp_timer);
   15.59          /* If we stop warping the warp timer needs to be removed */
   15.60          if ( !warpback )
   15.61 -            rem_ac_timer(&inf->warp_timer);
   15.62 +            stop_timer(&inf->warp_timer);
   15.63      }
   15.64      else if ( cmd->direction == SCHED_INFO_GET )
   15.65      {
   15.66 @@ -405,7 +405,7 @@ static struct task_slice bvt_do_schedule
   15.67          prev_einf->evt = calc_evt(prev, prev_einf->avt);
   15.68         
   15.69          if(prev_inf->warpback && prev_inf->warpl > 0)
   15.70 -            rem_ac_timer(&prev_inf->warp_timer);
   15.71 +            stop_timer(&prev_inf->warp_timer);
   15.72          
   15.73          __del_from_runqueue(prev);
   15.74          
   15.75 @@ -455,7 +455,7 @@ static struct task_slice bvt_do_schedule
   15.76      }
   15.77      
   15.78      if ( next_einf->inf->warp && next_einf->inf->warpl > 0 )
   15.79 -        set_ac_timer(&next_einf->inf->warp_timer, now + next_einf->inf->warpl);
   15.80 +        set_timer(&next_einf->inf->warp_timer, now + next_einf->inf->warpl);
   15.81     
   15.82      /* Extract the domain pointers from the dom infos */
   15.83      next        = next_einf->vcpu;
    16.1 --- a/xen/common/sched_sedf.c	Thu Jan 12 23:25:02 2006 +0100
    16.2 +++ b/xen/common/sched_sedf.c	Thu Jan 12 23:39:14 2006 +0100
    16.3 @@ -9,7 +9,7 @@
    16.4  #include <xen/sched.h>
    16.5  #include <xen/sched-if.h>
    16.6  #include <public/sched_ctl.h>
    16.7 -#include <xen/ac_timer.h>
    16.8 +#include <xen/timer.h>
    16.9  #include <xen/softirq.h>
   16.10  #include <xen/time.h>
   16.11  
    17.1 --- a/xen/common/schedule.c	Thu Jan 12 23:25:02 2006 +0100
    17.2 +++ b/xen/common/schedule.c	Thu Jan 12 23:39:14 2006 +0100
    17.3 @@ -21,7 +21,7 @@
    17.4  #include <xen/delay.h>
    17.5  #include <xen/event.h>
    17.6  #include <xen/time.h>
    17.7 -#include <xen/ac_timer.h>
    17.8 +#include <xen/timer.h>
    17.9  #include <xen/perfc.h>
   17.10  #include <xen/sched-if.h>
   17.11  #include <xen/softirq.h>
   17.12 @@ -71,7 +71,7 @@ static struct scheduler ops;
   17.13            : (typeof(ops.fn(__VA_ARGS__)))0 )
   17.14  
   17.15  /* Per-CPU periodic timer sends an event to the currently-executing domain. */
   17.16 -static struct ac_timer t_timer[NR_CPUS]; 
   17.17 +static struct timer t_timer[NR_CPUS]; 
   17.18  
   17.19  void free_domain(struct domain *d)
   17.20  {
   17.21 @@ -141,7 +141,7 @@ struct domain *alloc_domain(void)
   17.22  void sched_add_domain(struct vcpu *v) 
   17.23  {
   17.24      /* Initialise the per-domain timer. */
   17.25 -    init_ac_timer(&v->timer, dom_timer_fn, v, v->processor);
   17.26 +    init_timer(&v->timer, dom_timer_fn, v, v->processor);
   17.27  
   17.28      if ( is_idle_vcpu(v) )
   17.29      {
   17.30 @@ -156,7 +156,7 @@ void sched_add_domain(struct vcpu *v)
   17.31  
   17.32  void sched_rem_domain(struct vcpu *v) 
   17.33  {
   17.34 -    rem_ac_timer(&v->timer);
   17.35 +    stop_timer(&v->timer);
   17.36      SCHED_OP(rem_task, v);
   17.37      TRACE_2D(TRC_SCHED_DOM_REM, v->domain->domain_id, v->vcpu_id);
   17.38  }
   17.39 @@ -278,9 +278,9 @@ long do_set_timer_op(s_time_t timeout)
   17.40      struct vcpu *v = current;
   17.41  
   17.42      if ( timeout == 0 )
   17.43 -        rem_ac_timer(&v->timer);
   17.44 +        stop_timer(&v->timer);
   17.45      else
   17.46 -        set_ac_timer(&v->timer, timeout);
   17.47 +        set_timer(&v->timer, timeout);
   17.48  
   17.49      return 0;
   17.50  }
   17.51 @@ -365,7 +365,7 @@ static void __enter_scheduler(void)
   17.52  
   17.53      spin_lock_irq(&schedule_data[cpu].schedule_lock);
   17.54  
   17.55 -    rem_ac_timer(&schedule_data[cpu].s_timer);
   17.56 +    stop_timer(&schedule_data[cpu].s_timer);
   17.57      
   17.58      prev->cpu_time += now - prev->lastschd;
   17.59  
   17.60 @@ -379,7 +379,7 @@ static void __enter_scheduler(void)
   17.61      
   17.62      next->lastschd = now;
   17.63  
   17.64 -    set_ac_timer(&schedule_data[cpu].s_timer, now + r_time);
   17.65 +    set_timer(&schedule_data[cpu].s_timer, now + r_time);
   17.66  
   17.67      if ( unlikely(prev == next) )
   17.68      {
   17.69 @@ -475,7 +475,7 @@ static void t_timer_fn(void *unused)
   17.70  
   17.71      page_scrub_schedule_work();
   17.72  
   17.73 -    set_ac_timer(&t_timer[cpu], NOW() + MILLISECS(10));
   17.74 +    set_timer(&t_timer[cpu], NOW() + MILLISECS(10));
   17.75  }
   17.76  
   17.77  /* Domain timer function, sends a virtual timer interrupt to domain */
   17.78 @@ -497,8 +497,8 @@ void __init scheduler_init(void)
   17.79      for ( i = 0; i < NR_CPUS; i++ )
   17.80      {
   17.81          spin_lock_init(&schedule_data[i].schedule_lock);
   17.82 -        init_ac_timer(&schedule_data[i].s_timer, s_timer_fn, NULL, i);
   17.83 -        init_ac_timer(&t_timer[i], t_timer_fn, NULL, i);
   17.84 +        init_timer(&schedule_data[i].s_timer, s_timer_fn, NULL, i);
   17.85 +        init_timer(&t_timer[i], t_timer_fn, NULL, i);
   17.86      }
   17.87  
   17.88      for ( i = 0; schedulers[i] != NULL; i++ )
    18.1 --- a/xen/common/xmalloc.c	Thu Jan 12 23:25:02 2006 +0100
    18.2 +++ b/xen/common/xmalloc.c	Thu Jan 12 23:39:14 2006 +0100
    18.3 @@ -30,7 +30,7 @@
    18.4  #include <xen/config.h>
    18.5  #include <xen/mm.h>
    18.6  #include <xen/spinlock.h>
    18.7 -#include <xen/ac_timer.h>
    18.8 +#include <xen/timer.h>
    18.9  #include <xen/cache.h>
   18.10  #include <xen/prefetch.h>
   18.11  
    19.1 --- a/xen/drivers/char/ns16550.c	Thu Jan 12 23:25:02 2006 +0100
    19.2 +++ b/xen/drivers/char/ns16550.c	Thu Jan 12 23:39:14 2006 +0100
    19.3 @@ -33,7 +33,7 @@ static struct ns16550 {
    19.4      /* UART with IRQ line: interrupt-driven I/O. */
    19.5      struct irqaction irqaction;
    19.6      /* UART with no IRQ line: periodically-polled I/O. */
    19.7 -    struct ac_timer timer;
    19.8 +    struct timer timer;
    19.9      unsigned int timeout_ms;
   19.10  } ns16550_com[2] = { { 0 } };
   19.11  
   19.12 @@ -138,7 +138,7 @@ static void ns16550_poll(void *data)
   19.13      if ( ns_read_reg(uart, LSR) & LSR_THRE )
   19.14          serial_tx_interrupt(port, regs);
   19.15  
   19.16 -    set_ac_timer(&uart->timer, NOW() + MILLISECS(uart->timeout_ms));
   19.17 +    set_timer(&uart->timer, NOW() + MILLISECS(uart->timeout_ms));
   19.18  }
   19.19  
   19.20  static int ns16550_tx_empty(struct serial_port *port)
   19.21 @@ -214,8 +214,8 @@ static void ns16550_init_postirq(struct 
   19.22          bits = uart->data_bits + uart->stop_bits + !!uart->parity;
   19.23          uart->timeout_ms = max_t(
   19.24              unsigned int, 1, (bits * port->tx_fifo_size * 1000) / uart->baud);
   19.25 -        init_ac_timer(&uart->timer, ns16550_poll, port, 0);
   19.26 -        set_ac_timer(&uart->timer, NOW() + MILLISECS(uart->timeout_ms));
   19.27 +        init_timer(&uart->timer, ns16550_poll, port, 0);
   19.28 +        set_timer(&uart->timer, NOW() + MILLISECS(uart->timeout_ms));
   19.29      }
   19.30      else
   19.31      {
    20.1 --- a/xen/include/asm-ia64/config.h	Thu Jan 12 23:25:02 2006 +0100
    20.2 +++ b/xen/include/asm-ia64/config.h	Thu Jan 12 23:39:14 2006 +0100
    20.3 @@ -156,7 +156,7 @@ struct page;
    20.4  #define platform_outl	__ia64_outl
    20.5  
    20.6  // FIXME: This just overrides a use in a typedef (not allowed in ia64,
    20.7 -//  or maybe just in older gcc's?) used in ac_timer.c but should be OK
    20.8 +//  or maybe just in older gcc's?) used in timer.c but should be OK
    20.9  //  (and indeed is probably required!) elsewhere
   20.10  #undef __cacheline_aligned
   20.11  #undef ____cacheline_aligned
    21.1 --- a/xen/include/asm-ia64/vtm.h	Thu Jan 12 23:25:02 2006 +0100
    21.2 +++ b/xen/include/asm-ia64/vtm.h	Thu Jan 12 23:39:14 2006 +0100
    21.3 @@ -23,7 +23,7 @@
    21.4  #ifndef _VTM_H_
    21.5  #define _VTM_H_
    21.6  
    21.7 -#include <xen/ac_timer.h>
    21.8 +#include <xen/timer.h>
    21.9  #include <xen/types.h>
   21.10  
   21.11  #define MAX_JUMP_STEP       (5000)   /* 500ms, max jump step */
   21.12 @@ -46,7 +46,7 @@ typedef struct vtime {
   21.13      	uint64_t    cfg_max_jump;   // max jump within one time suspendsion
   21.14      	uint64_t    cfg_min_grun;   // min guest running time since last jump
   21.15  //    	uint64_t    latest_read_itc;    // latest guest read ITC
   21.16 -    	struct ac_timer	vtm_timer;
   21.17 +    	struct timer	vtm_timer;
   21.18  //	int        triggered;
   21.19      	
   21.20  
    22.1 --- a/xen/include/asm-x86/vmx_vlapic.h	Thu Jan 12 23:25:02 2006 +0100
    22.2 +++ b/xen/include/asm-x86/vmx_vlapic.h	Thu Jan 12 23:39:14 2006 +0100
    22.3 @@ -187,7 +187,7 @@ struct vlapic
    22.4      uint32_t           timer_current;
    22.5      uint32_t           timer_divconf;
    22.6      uint32_t           timer_divide_counter;
    22.7 -    struct ac_timer    vlapic_timer;
    22.8 +    struct timer    vlapic_timer;
    22.9      int                intr_pending_count[MAX_VECTOR];
   22.10      s_time_t           timer_current_update;
   22.11      uint32_t           icr_high;
   22.12 @@ -216,7 +216,7 @@ static inline int vlapic_set_irq(struct 
   22.13  
   22.14  static inline int  vlapic_timer_active(struct vlapic *vlapic)
   22.15  {
   22.16 -    return  active_ac_timer(&(vlapic->vlapic_timer));
   22.17 +    return  active_timer(&(vlapic->vlapic_timer));
   22.18  }
   22.19  
   22.20  int vlapic_find_highest_irr(struct vlapic *vlapic);
    23.1 --- a/xen/include/asm-x86/vmx_vmcs.h	Thu Jan 12 23:25:02 2006 +0100
    23.2 +++ b/xen/include/asm-x86/vmx_vmcs.h	Thu Jan 12 23:39:14 2006 +0100
    23.3 @@ -100,7 +100,7 @@ struct arch_vmx_struct {
    23.4      void                    *io_bitmap_a, *io_bitmap_b;
    23.5      struct vlapic           *vlapic;
    23.6      u64                     tsc_offset;
    23.7 -    struct ac_timer         hlt_timer;  /* hlt ins emulation wakeup timer */
    23.8 +    struct timer         hlt_timer;  /* hlt ins emulation wakeup timer */
    23.9  };
   23.10  
   23.11  #define vmx_schedule_tail(next)         \
    24.1 --- a/xen/include/asm-x86/vmx_vpit.h	Thu Jan 12 23:25:02 2006 +0100
    24.2 +++ b/xen/include/asm-x86/vmx_vpit.h	Thu Jan 12 23:39:14 2006 +0100
    24.3 @@ -6,7 +6,7 @@
    24.4  #include <xen/lib.h>
    24.5  #include <xen/time.h>
    24.6  #include <xen/errno.h>
    24.7 -#include <xen/ac_timer.h>
    24.8 +#include <xen/timer.h>
    24.9  #include <asm/vmx_vmcs.h>
   24.10  #include <asm/vmx_vpic.h>
   24.11  
   24.12 @@ -23,7 +23,7 @@ struct vmx_virpit {
   24.13      u64 inject_point; /* the time inject virt intr */
   24.14      u64 shift;  /* save the value of offset - drift */
   24.15      s_time_t scheduled;                 /* scheduled timer interrupt */
   24.16 -    struct ac_timer pit_timer;  /* periodic timer for mode 2*/
   24.17 +    struct timer pit_timer;  /* periodic timer for mode 2*/
   24.18      unsigned int channel;  /* the pit channel, counter 0~2 */
   24.19      unsigned int pending_intr_nr; /* the couner for pending timer interrupts */
   24.20      u32 period;		/* pit frequency in ns */
    25.1 --- a/xen/include/xen/ac_timer.h	Thu Jan 12 23:25:02 2006 +0100
    25.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    25.3 @@ -1,81 +0,0 @@
    25.4 -/******************************************************************************
    25.5 - * ac_timer.h
    25.6 - * 
    25.7 - * Copyright (c) 2002-2003 Rolf Neugebauer
    25.8 - * Copyright (c) 2002-2005 K A Fraser
    25.9 - */
   25.10 -
   25.11 -#ifndef _AC_TIMER_H_
   25.12 -#define _AC_TIMER_H_
   25.13 -
   25.14 -#include <xen/spinlock.h>
   25.15 -#include <xen/time.h>
   25.16 -#include <xen/string.h>
   25.17 -
   25.18 -struct ac_timer {
   25.19 -    /* System time expiry value (nanoseconds since boot). */
   25.20 -    s_time_t      expires;
   25.21 -    /* CPU on which this timer will be installed and executed. */
   25.22 -    unsigned int  cpu;
   25.23 -    /* On expiry, '(*function)(data)' will be executed in softirq context. */
   25.24 -    void        (*function)(void *);
   25.25 -    void         *data;
   25.26 -    /* Timer-heap offset. */
   25.27 -    unsigned int  heap_offset;
   25.28 -};
   25.29 -
   25.30 -/*
   25.31 - * All functions below can be called for any CPU from any CPU in any context.
   25.32 - */
   25.33 -
   25.34 -/* Returns TRUE if the given timer is on a timer list. */
   25.35 -static __inline__ int active_ac_timer(struct ac_timer *timer)
   25.36 -{
   25.37 -    return (timer->heap_offset != 0);
   25.38 -}
   25.39 -
   25.40 -/*
   25.41 - * It initialises the static fields of the ac_timer structure.
   25.42 - * It can be called multiple times to reinitialise a single (inactive) timer.
   25.43 - */
   25.44 -static __inline__ void init_ac_timer(
   25.45 -    struct ac_timer *timer,
   25.46 -    void           (*function)(void *),
   25.47 -    void            *data,
   25.48 -    unsigned int     cpu)
   25.49 -{
   25.50 -    memset(timer, 0, sizeof(*timer));
   25.51 -    timer->function = function;
   25.52 -    timer->data     = data;
   25.53 -    timer->cpu      = cpu;
   25.54 -}
   25.55 -
   25.56 -/*
   25.57 - * Set the expiry time and activate a timer (which must previously have been
   25.58 - * initialised by init_ac_timer).
   25.59 - */
   25.60 -extern void set_ac_timer(struct ac_timer *timer, s_time_t expires);
   25.61 -
   25.62 -/*
   25.63 - * Deactivate a timer (which must previously have been initialised by
   25.64 - * init_ac_timer). This function has no effect if the timer is not currently
   25.65 - * active.
   25.66 - */
   25.67 -extern void rem_ac_timer(struct ac_timer *timer);
   25.68 -
   25.69 -/*
   25.70 - * Initialisation. Must be called before any other ac_timer function.
   25.71 - */
   25.72 -extern void ac_timer_init(void);
   25.73 -
   25.74 -#endif /* _AC_TIMER_H_ */
   25.75 -
   25.76 -/*
   25.77 - * Local variables:
   25.78 - * mode: C
   25.79 - * c-set-style: "BSD"
   25.80 - * c-basic-offset: 4
   25.81 - * tab-width: 4
   25.82 - * indent-tabs-mode: nil
   25.83 - * End:
   25.84 - */
    26.1 --- a/xen/include/xen/perfc_defn.h	Thu Jan 12 23:25:02 2006 +0100
    26.2 +++ b/xen/include/xen/perfc_defn.h	Thu Jan 12 23:39:14 2006 +0100
    26.3 @@ -32,7 +32,7 @@ PERFCOUNTER_CPU(ipis,                   
    26.4  PERFCOUNTER_CPU(irq_time,               "cycles spent in irq handler")
    26.5  
    26.6  PERFCOUNTER_CPU(apic_timer,             "apic timer interrupts")
    26.7 -PERFCOUNTER_CPU(ac_timer_max,           "ac_timer max error (ns)")
    26.8 +PERFCOUNTER_CPU(timer_max,           "timer max error (ns)")
    26.9  PERFCOUNTER_CPU(sched_irq,              "sched: timer")
   26.10  PERFCOUNTER_CPU(sched_run,              "sched: runs through scheduler")
   26.11  PERFCOUNTER_CPU(sched_ctx,              "sched: context switches")
    27.1 --- a/xen/include/xen/sched-if.h	Thu Jan 12 23:25:02 2006 +0100
    27.2 +++ b/xen/include/xen/sched-if.h	Thu Jan 12 23:39:14 2006 +0100
    27.3 @@ -16,7 +16,7 @@ struct schedule_data {
    27.4      struct vcpu        *curr;           /* current task                    */
    27.5      struct vcpu        *idle;           /* idle task for this cpu          */
    27.6      void               *sched_priv;
    27.7 -    struct ac_timer     s_timer;        /* scheduling timer                */
    27.8 +    struct timer     s_timer;        /* scheduling timer                */
    27.9      unsigned long       tick;           /* current periodic 'tick'         */
   27.10  #ifdef BUCKETS
   27.11      u32                 hist[BUCKETS];  /* for scheduler latency histogram */
    28.1 --- a/xen/include/xen/sched.h	Thu Jan 12 23:25:02 2006 +0100
    28.2 +++ b/xen/include/xen/sched.h	Thu Jan 12 23:39:14 2006 +0100
    28.3 @@ -9,7 +9,7 @@
    28.4  #include <public/xen.h>
    28.5  #include <public/dom0_ops.h>
    28.6  #include <xen/time.h>
    28.7 -#include <xen/ac_timer.h>
    28.8 +#include <xen/timer.h>
    28.9  #include <xen/grant_table.h>
   28.10  #include <xen/rangeset.h>
   28.11  #include <asm/domain.h>
   28.12 @@ -63,7 +63,7 @@ struct vcpu
   28.13  
   28.14      struct vcpu     *next_in_list;
   28.15  
   28.16 -    struct ac_timer  timer;         /* one-shot timer for timeout values */
   28.17 +    struct timer  timer;         /* one-shot timer for timeout values */
   28.18      unsigned long    sleep_tick;    /* tick at which this vcpu started sleep */
   28.19  
   28.20      s_time_t         lastschd;      /* time this domain was last scheduled */
    29.1 --- a/xen/include/xen/softirq.h	Thu Jan 12 23:25:02 2006 +0100
    29.2 +++ b/xen/include/xen/softirq.h	Thu Jan 12 23:39:14 2006 +0100
    29.3 @@ -2,7 +2,7 @@
    29.4  #define __XEN_SOFTIRQ_H__
    29.5  
    29.6  /* Common softirqs come first in the following list. */
    29.7 -#define AC_TIMER_SOFTIRQ                  0
    29.8 +#define TIMER_SOFTIRQ                     0
    29.9  #define SCHEDULE_SOFTIRQ                  1
   29.10  #define NEW_TLBFLUSH_CLOCK_PERIOD_SOFTIRQ 2
   29.11  #define KEYPRESS_SOFTIRQ                  3