#else
struct vcpu *v;
- v = idle_vcpu[cpu] = alloc_vcpu(idle_vcpu[0]->domain, cpu, cpu);
+ v = alloc_idle_vcpu(cpu);
BUG_ON(v == NULL);
//printf ("do_boot_cpu: cpu=%d, domain=%p, vcpu=%p\n", cpu, idle, v);
char saved_command_line[COMMAND_LINE_SIZE];
char dom0_command_line[COMMAND_LINE_SIZE];
-struct vcpu *idle_vcpu[NR_CPUS];
-
cpumask_t cpu_present_map;
extern unsigned long domain0_ready;
struct tss_struct init_tss[NR_CPUS];
-struct vcpu *idle_vcpu[NR_CPUS];
-
extern unsigned long cpu0_stack[];
struct cpuinfo_x86 boot_cpu_data = { 0, 0, 0, 0, -1, 1, 0, 0, -1 };
int timeout;
unsigned long start_eip;
unsigned short nmi_high = 0, nmi_low = 0;
- struct domain *d;
struct vcpu *v;
- int vcpu_id;
++cpucount;
booting_cpu = cpu;
- if ((vcpu_id = cpu % MAX_VIRT_CPUS) == 0) {
- d = domain_create(IDLE_DOMAIN_ID, cpu);
- BUG_ON(d == NULL);
- v = d->vcpu[0];
- } else {
- d = idle_vcpu[cpu - vcpu_id]->domain;
- BUG_ON(d == NULL);
- v = alloc_vcpu(d, vcpu_id, cpu);
- }
-
- idle_vcpu[cpu] = v;
+ v = alloc_idle_vcpu(cpu);
BUG_ON(v == NULL);
v->arch.monitor_table = pagetable_from_paddr(__pa(idle_pg_table));
struct domain *dom0;
+struct vcpu *idle_vcpu[NR_CPUS];
+
struct domain *alloc_domain(domid_t domid)
{
struct domain *d;
return v;
}
+struct vcpu *alloc_idle_vcpu(unsigned int cpu_id)
+{
+ struct domain *d;
+ struct vcpu *v;
+ unsigned int vcpu_id;
+
+ if ((vcpu_id = cpu_id % MAX_VIRT_CPUS) == 0)
+ {
+ d = domain_create(IDLE_DOMAIN_ID, cpu_id);
+ BUG_ON(d == NULL);
+ v = d->vcpu[0];
+ }
+ else
+ {
+ d = idle_vcpu[cpu_id - vcpu_id]->domain;
+ BUG_ON(d == NULL);
+ v = alloc_vcpu(d, vcpu_id, cpu_id);
+ }
+
+ idle_vcpu[cpu_id] = v;
+
+ return v;
+}
struct domain *domain_create(domid_t domid, unsigned int cpu)
{
struct domain *d, unsigned int vcpu_id, unsigned int cpu_id);
int boot_vcpu(
struct domain *d, int vcpuid, struct vcpu_guest_context *ctxt);
+struct vcpu *alloc_idle_vcpu(unsigned int cpu_id);
struct domain *alloc_domain(domid_t domid);
void free_domain(struct domain *d);