mmu = new mmu_t(mem, memsz);
- for(size_t i = 0; i < num_cores(); i++)
+ if (_nprocs == 0)
+ _nprocs = 1;
+ for (size_t i = 0; i < _nprocs; i++)
procs[i] = new processor_t(this, new mmu_t(mem, memsz), i);
}
sim_t::~sim_t()
{
- for(size_t i = 0; i < num_cores(); i++)
+ for (size_t i = 0; i < procs.size(); i++)
{
mmu_t* pmmu = &procs[i]->mmu;
delete procs[i];
void sim_t::send_ipi(reg_t who)
{
- if(who < num_cores())
+ if (who < procs.size())
procs[who]->deliver_ipi();
}