Beispiel #1
0
static void x86_cpu_core_init(int core)
{
	int thread;
	X86_CORE.thread = xcalloc(x86_cpu_num_threads, sizeof(struct x86_thread_t));
	X86_THREAD_FOR_EACH
		x86_cpu_thread_init(core, thread);

	X86_CORE.prefetch_history = prefetch_history_create();
}
Beispiel #2
0
void X86CoreCreate(X86Core *self, X86Cpu *cpu)
{
	int i;

	/* Initialize */
	self->cpu = cpu;

	/* Create threads */
	self->threads = xcalloc(x86_cpu_num_threads, sizeof(X86Thread *));
	for (i = 0; i < x86_cpu_num_threads; i++)
		self->threads[i] = new(X86Thread, self);

	/* Prefetcher */
	self->prefetch_history = prefetch_history_create();

	/* Structures */
	X86CoreInitROB(self);
	X86CoreInitEventQueue(self);
	X86CoreInitFunctionalUnits(self);
}