base.cc (11050:65fc1db5d795) base.cc (11146:0fd6976303bc)
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

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

431 return getInstPort();
432 else
433 return MemObject::getMasterPort(if_name, idx);
434}
435
436void
437BaseCPU::registerThreadContexts()
438{
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

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

431 return getInstPort();
432 else
433 return MemObject::getMasterPort(if_name, idx);
434}
435
436void
437BaseCPU::registerThreadContexts()
438{
439 assert(system->multiThread || numThreads == 1);
440
439 ThreadID size = threadContexts.size();
440 for (ThreadID tid = 0; tid < size; ++tid) {
441 ThreadContext *tc = threadContexts[tid];
442
441 ThreadID size = threadContexts.size();
442 for (ThreadID tid = 0; tid < size; ++tid) {
443 ThreadContext *tc = threadContexts[tid];
444
443 /** This is so that contextId and cpuId match where there is a
444 * 1cpu:1context relationship. Otherwise, the order of registration
445 * could affect the assignment and cpu 1 could have context id 3, for
446 * example. We may even want to do something like this for SMT so that
447 * cpu 0 has the lowest thread contexts and cpu N has the highest, but
448 * I'll just do this for now
449 */
450 if (numThreads == 1)
451 tc->setContextId(system->registerThreadContext(tc, _cpuId));
452 else
445 if (system->multiThread) {
453 tc->setContextId(system->registerThreadContext(tc));
446 tc->setContextId(system->registerThreadContext(tc));
447 } else {
448 tc->setContextId(system->registerThreadContext(tc, _cpuId));
449 }
454
455 if (!FullSystem)
456 tc->getProcessPtr()->assignThreadContext(tc->contextId());
457 }
458}
459
460
461int

--- 283 unchanged lines hidden ---
450
451 if (!FullSystem)
452 tc->getProcessPtr()->assignThreadContext(tc->contextId());
453 }
454}
455
456
457int

--- 283 unchanged lines hidden ---