void v3_print_cond(const char * fmt, ...);
+#ifdef CONFIG_MULTITHREAD_OS
void v3_interrupt_cpu(struct v3_vm_info * vm, int logical_cpu, int vector);
+#endif
v3_cpu_arch_t v3_get_cpu_type(int cpu_id);
return -1;
}
+#ifdef CONFIG_MULTITHREAD_OS
v3_interrupt_cpu(vm, 0, 0);
+#endif
return 0;
}
// host maitains logical proc->phsysical proc
PrintDebug(" non-local core, forcing it to exit\n");
+#ifdef CONFIG_MULTITHREAD_OS
v3_interrupt_cpu(dst_core->vm_info, dst_core->cpu_id, 0);
+#else
+ V3_ASSERT(0);
+#endif
}
break;
activate_apic_irq(apic, irq);
if (V3_Get_CPU() != dst) {
+#ifdef CONFIG_MULTITHREAD_OS
v3_interrupt_cpu(vm, dst, 0);
+#else
+ V3_ASSERT(0);
+#endif
}
return 0;
// For the moment very ugly. Eventually we will shift the cpu_mask to an arbitrary sized type...
+#ifdef CONFIG_MULTITHREAD_OS
#define MAX_CORES 32
+#else
+#define MAX_CORES 1
+#endif
int v3_start_vm(struct v3_vm_info * vm, unsigned int cpu_mask) {
uint32_t i;
+#ifdef CONFIG_MULTITHREAD_OS
int vcore_id = 0;
+#endif
uint8_t * core_mask = (uint8_t *)&cpu_mask; // This is to make future expansion easier
uint32_t avail_cores = 0;
}
+#ifdef CONFIG_MULTITHREAD_OS
// spawn off new threads, for other cores
for (i = 0, vcore_id = 1; (i < MAX_CORES) && (vcore_id < vm->num_cores); i++) {
int major = i / 8;
vcore_id++;
}
+#endif
sprintf(vm->cores[0].exec_name, "%s", vm->name);