base.cc (9433:34971d2e0019) base.cc (9446:644f2a2c9bfc)
1/*
2 * Copyright (c) 2011-2012 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

--- 347 unchanged lines hidden (view full) ---

356
357void
358BaseCPU::switchOut()
359{
360 assert(!_switchedOut);
361 _switchedOut = true;
362 if (profileEvent && profileEvent->scheduled())
363 deschedule(profileEvent);
1/*
2 * Copyright (c) 2011-2012 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

--- 347 unchanged lines hidden (view full) ---

356
357void
358BaseCPU::switchOut()
359{
360 assert(!_switchedOut);
361 _switchedOut = true;
362 if (profileEvent && profileEvent->scheduled())
363 deschedule(profileEvent);
364
365 // Flush all TLBs in the CPU to avoid having stale translations if
366 // it gets switched in later.
367 flushTLBs();
364}
365
366void
367BaseCPU::takeOverFrom(BaseCPU *oldCPU)
368{
369 assert(threadContexts.size() == oldCPU->threadContexts.size());
370 assert(_cpuId == oldCPU->cpuId());
371 assert(_switchedOut);

--- 105 unchanged lines hidden (view full) ---

477
478 assert(!getDataPort().isConnected());
479 assert(oldCPU->getDataPort().isConnected());
480 BaseSlavePort &data_peer_port = oldCPU->getDataPort().getSlavePort();
481 oldCPU->getDataPort().unbind();
482 getDataPort().bind(data_peer_port);
483}
484
368}
369
370void
371BaseCPU::takeOverFrom(BaseCPU *oldCPU)
372{
373 assert(threadContexts.size() == oldCPU->threadContexts.size());
374 assert(_cpuId == oldCPU->cpuId());
375 assert(_switchedOut);

--- 105 unchanged lines hidden (view full) ---

481
482 assert(!getDataPort().isConnected());
483 assert(oldCPU->getDataPort().isConnected());
484 BaseSlavePort &data_peer_port = oldCPU->getDataPort().getSlavePort();
485 oldCPU->getDataPort().unbind();
486 getDataPort().bind(data_peer_port);
487}
488
489void
490BaseCPU::flushTLBs()
491{
492 for (ThreadID i = 0; i < threadContexts.size(); ++i) {
493 ThreadContext &tc(*threadContexts[i]);
494 CheckerCPU *checker(tc.getCheckerCpuPtr());
485
495
496 tc.getITBPtr()->flushAll();
497 tc.getDTBPtr()->flushAll();
498 if (checker) {
499 checker->getITBPtr()->flushAll();
500 checker->getDTBPtr()->flushAll();
501 }
502 }
503}
504
505
486BaseCPU::ProfileEvent::ProfileEvent(BaseCPU *_cpu, Tick _interval)
487 : cpu(_cpu), interval(_interval)
488{ }
489
490void
491BaseCPU::ProfileEvent::process()
492{
493 ThreadID size = cpu->threadContexts.size();

--- 77 unchanged lines hidden ---
506BaseCPU::ProfileEvent::ProfileEvent(BaseCPU *_cpu, Tick _interval)
507 : cpu(_cpu), interval(_interval)
508{ }
509
510void
511BaseCPU::ProfileEvent::process()
512{
513 ThreadID size = cpu->threadContexts.size();

--- 77 unchanged lines hidden ---