system.cc (12272:bcc67ee98e6d) | system.cc (12443:0479f5e6f8bd) |
---|---|
1/* 2 * Copyright (c) 2011-2014,2017 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 --- 227 unchanged lines hidden (view full) --- 236 if (remoteGDB.size()) 237 return remoteGDB[0]->breakpoint(); 238 return false; 239} 240 241ContextID 242System::registerThreadContext(ThreadContext *tc, ContextID assigned) 243{ | 1/* 2 * Copyright (c) 2011-2014,2017 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 --- 227 unchanged lines hidden (view full) --- 236 if (remoteGDB.size()) 237 return remoteGDB[0]->breakpoint(); 238 return false; 239} 240 241ContextID 242System::registerThreadContext(ThreadContext *tc, ContextID assigned) 243{ |
244 int id; 245 if (assigned == InvalidContextID) { 246 for (id = 0; id < threadContexts.size(); id++) { 247 if (!threadContexts[id]) 248 break; 249 } 250 251 if (threadContexts.size() <= id) 252 threadContexts.resize(id + 1); 253 } else { 254 if (threadContexts.size() <= assigned) 255 threadContexts.resize(assigned + 1); 256 id = assigned; | 244 int id = assigned; 245 if (id == InvalidContextID) { 246 // Find an unused context ID for this thread. 247 id = 0; 248 while (id < threadContexts.size() && threadContexts[id]) 249 id++; |
257 } 258 | 250 } 251 |
259 if (threadContexts[id]) 260 fatal("Cannot have two CPUs with the same id (%d)\n", id); | 252 if (threadContexts.size() <= id) 253 threadContexts.resize(id + 1); |
261 | 254 |
255 fatal_if(threadContexts[id], 256 "Cannot have two CPUs with the same id (%d)\n", id); 257 |
|
262 threadContexts[id] = tc; 263 _numContexts++; 264 265#if THE_ISA != NULL_ISA 266 int port = getRemoteGDBPort(); 267 if (port) { 268 RemoteGDB *rgdb = new RemoteGDB(this, tc); 269 GDBListener *gdbl = new GDBListener(rgdb, port + id); --- 270 unchanged lines hidden --- | 258 threadContexts[id] = tc; 259 _numContexts++; 260 261#if THE_ISA != NULL_ISA 262 int port = getRemoteGDBPort(); 263 if (port) { 264 RemoteGDB *rgdb = new RemoteGDB(this, tc); 265 GDBListener *gdbl = new GDBListener(rgdb, port + id); --- 270 unchanged lines hidden --- |