ia64/xen-unstable

changeset 4699:495fc70ea1ec

bitkeeper revision 1.1389.1.8 (42715668DjHMmednZbpL0cOFNSNyoA)

Merge firebug.cl.cam.ac.uk:/auto/groups/xeno-xenod/BK/xen-unstable.bk
into firebug.cl.cam.ac.uk:/local/scratch/kaf24/xen-unstable.bk
author kaf24@firebug.cl.cam.ac.uk
date Thu Apr 28 21:32:24 2005 +0000 (2005-04-28)
parents 123bd8c4b408 a879e5923337
children 4a9c0eedfac7
files xen/arch/x86/domain.c
line diff
     1.1 --- a/xen/arch/x86/domain.c	Thu Apr 28 21:04:10 2005 +0000
     1.2 +++ b/xen/arch/x86/domain.c	Thu Apr 28 21:32:24 2005 +0000
     1.3 @@ -50,6 +50,16 @@ struct percpu_ctxt {
     1.4  } __cacheline_aligned;
     1.5  static struct percpu_ctxt percpu_ctxt[NR_CPUS];
     1.6  
     1.7 +static void continue_idle_task(struct exec_domain *ed)
     1.8 +{
     1.9 +    reset_stack_and_jump(idle_loop);
    1.10 +}
    1.11 +
    1.12 +static void continue_nonidle_task(struct exec_domain *ed)
    1.13 +{
    1.14 +    reset_stack_and_jump(ret_from_intr);
    1.15 +}
    1.16 +
    1.17  static void default_idle(void)
    1.18  {
    1.19      local_irq_disable();
    1.20 @@ -74,24 +84,32 @@ static __attribute_used__ void idle_loop
    1.21      }
    1.22  }
    1.23  
    1.24 +static void __startup_cpu_idle_loop(struct exec_domain *ed)
    1.25 +{
    1.26 +    /* Signal to boot CPU that we are done. */
    1.27 +    init_idle();
    1.28 +
    1.29 +    /* Start normal idle loop. */
    1.30 +    ed->arch.schedule_tail = continue_idle_task;
    1.31 +    reset_stack_and_jump(idle_loop);
    1.32 +}
    1.33 +
    1.34  void startup_cpu_idle_loop(void)
    1.35  {
    1.36 +    struct exec_domain *ed = current;
    1.37 +
    1.38      /* Just some sanity to ensure that the scheduler is set up okay. */
    1.39 -    ASSERT(current->domain->id == IDLE_DOMAIN_ID);
    1.40 -    percpu_ctxt[smp_processor_id()].curr_ed = current;
    1.41 -    set_bit(smp_processor_id(), &current->domain->cpuset);
    1.42 -    domain_unpause_by_systemcontroller(current->domain);
    1.43 +    ASSERT(ed->domain->id == IDLE_DOMAIN_ID);
    1.44 +    percpu_ctxt[smp_processor_id()].curr_ed = ed;
    1.45 +    set_bit(smp_processor_id(), &ed->domain->cpuset);
    1.46 +    domain_unpause_by_systemcontroller(ed->domain);
    1.47 +
    1.48 +    ed->arch.schedule_tail = __startup_cpu_idle_loop;
    1.49      raise_softirq(SCHEDULE_SOFTIRQ);
    1.50      do_softirq();
    1.51  
    1.52 -    /*
    1.53 -     * Declares CPU setup done to the boot processor.
    1.54 -     * Therefore memory barrier to ensure state is visible.
    1.55 -     */
    1.56 -    smp_mb();
    1.57 -    init_idle();
    1.58 -
    1.59 -    idle_loop();
    1.60 +    /* End up in __startup_cpu_idle_loop, not here. */
    1.61 +    BUG();
    1.62  }
    1.63  
    1.64  static long no_idt[2];
    1.65 @@ -219,16 +237,6 @@ void free_perdomain_pt(struct domain *d)
    1.66  #endif
    1.67  }
    1.68  
    1.69 -static void continue_idle_task(struct exec_domain *ed)
    1.70 -{
    1.71 -    reset_stack_and_jump(idle_loop);
    1.72 -}
    1.73 -
    1.74 -static void continue_nonidle_task(struct exec_domain *ed)
    1.75 -{
    1.76 -    reset_stack_and_jump(ret_from_intr);
    1.77 -}
    1.78 -
    1.79  void arch_do_createdomain(struct exec_domain *ed)
    1.80  {
    1.81      struct domain *d = ed->domain;
    1.82 @@ -237,11 +245,7 @@ void arch_do_createdomain(struct exec_do
    1.83  
    1.84      ed->arch.flags = TF_kernel_mode;
    1.85  
    1.86 -    if ( d->id == IDLE_DOMAIN_ID )
    1.87 -    {
    1.88 -        ed->arch.schedule_tail = continue_idle_task;
    1.89 -    }
    1.90 -    else
    1.91 +    if ( d->id != IDLE_DOMAIN_ID )
    1.92      {
    1.93          ed->arch.schedule_tail = continue_nonidle_task;
    1.94  
    1.95 @@ -657,7 +661,7 @@ static void clear_segments(void)
    1.96  
    1.97  long do_switch_to_user(void)
    1.98  {
    1.99 -    struct cpu_user_regs       *regs = get_cpu_user_regs();
   1.100 +    struct cpu_user_regs  *regs = get_cpu_user_regs();
   1.101      struct switch_to_user  stu;
   1.102      struct exec_domain    *ed = current;
   1.103