base.cc (5715:e8c1d4e669a7) base.cc (5718:323cfbfec1a4)
1/*
2 * Copyright (c) 2002-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

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

280}
281
282void
283BaseCPU::registerThreadContexts()
284{
285 for (int i = 0; i < threadContexts.size(); ++i) {
286 ThreadContext *tc = threadContexts[i];
287
1/*
2 * Copyright (c) 2002-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

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

280}
281
282void
283BaseCPU::registerThreadContexts()
284{
285 for (int i = 0; i < threadContexts.size(); ++i) {
286 ThreadContext *tc = threadContexts[i];
287
288 tc->setContextId(system->registerThreadContext(tc));
288 /** This is so that contextId and cpuId match where there is a
289 * 1cpu:1context relationship. Otherwise, the order of registration
290 * could affect the assignment and cpu 1 could have context id 3, for
291 * example. We may even want to do something like this for SMT so that
292 * cpu 0 has the lowest thread contexts and cpu N has the highest, but
293 * I'll just do this for now
294 */
295 if (number_of_threads == 1)
296 tc->setContextId(system->registerThreadContext(tc, _cpuId));
297 else
298 tc->setContextId(system->registerThreadContext(tc));
289#if !FULL_SYSTEM
290 tc->getProcessPtr()->assignThreadContext(tc->contextId());
291#endif
292 }
293}
294
295
296int

--- 145 unchanged lines hidden ---
299#if !FULL_SYSTEM
300 tc->getProcessPtr()->assignThreadContext(tc->contextId());
301#endif
302 }
303}
304
305
306int

--- 145 unchanged lines hidden ---