xen/arch/x86/setup.c

  1.  static void __init init_idle_domain(void)
  2.  {
  3.   struct domain *idle_domain;
  4.  
  5.   /* Domain creation requires that scheduler structures are initialised. */
  6.   scheduler_init();
  7.  
  8.   idle_domain = domain_create(IDLE_DOMAIN_ID, 0, 0);
  9.   if ( (idle_domain == NULL) || (alloc_vcpu(idle_domain, 0, 0) == NULL) )
  10.   BUG();
  11.  
  12.   set_current(idle_domain->vcpu[0]);
  13.   idle_vcpu[0] = this_cpu(curr_vcpu) = current;
  14.  
  15.   setup_idle_pagetable();
  16.  }