Deleted Added
sdiff udiff text old ( 3495:884bf1f0c0c9 ) new ( 3520:4f4a2054fd85 )
full compact
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;

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

163 int *counter = new int;
164 *counter = number_of_threads;
165 for (int i = 0; i < number_of_threads; ++i)
166 new CountedExitEvent(comLoadEventQueue[i],
167 "all threads reached the max load count",
168 p->max_loads_all_threads, *counter);
169 }
170
171#if FULL_SYSTEM
172 memset(interrupts, 0, sizeof(interrupts));
173 intstatus = 0;
174#endif
175
176 functionTracingEnabled = false;
177 if (p->functionTrace) {
178 functionTraceStream = simout.find(csprintf("ftrace.%s", name()));
179 currentFunctionStart = currentFunctionEnd = 0;
180 functionEntryTick = p->functionTraceStart;
181
182 if (p->functionTraceStart == 0) {
183 functionTracingEnabled = true;

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

254 }
255 } else if (size == 1)
256 threadContexts[0]->regStats(name());
257
258#if FULL_SYSTEM
259#endif
260}
261
262Tick
263BaseCPU::nextCycle()
264{
265 Tick next_tick = curTick + clock - 1;
266 next_tick -= (next_tick % clock);
267 return next_tick;
268}
269
270Tick
271BaseCPU::nextCycle(Tick begin_tick)
272{
273 Tick next_tick = begin_tick;
274
275 while (next_tick < curTick)
276 next_tick += clock;
277
278 next_tick -= (next_tick % clock);
279 assert(next_tick >= curTick);
280 return next_tick;
281}
282
283void
284BaseCPU::registerThreadContexts()
285{
286 for (int i = 0; i < threadContexts.size(); ++i) {
287 ThreadContext *tc = threadContexts[i];
288
289#if FULL_SYSTEM
290 int id = params->cpu_id;

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

329 assert(newTC->getProcessPtr() == oldTC->getProcessPtr());
330 newTC->getProcessPtr()->replaceThreadContext(newTC, newTC->readCpuId());
331#endif
332
333// TheISA::compareXCs(oldXC, newXC);
334 }
335
336#if FULL_SYSTEM
337 for (int i = 0; i < TheISA::NumInterruptLevels; ++i)
338 interrupts[i] = oldCPU->interrupts[i];
339 intstatus = oldCPU->intstatus;
340 checkInterrupts = oldCPU->checkInterrupts;
341
342 for (int i = 0; i < threadContexts.size(); ++i)
343 threadContexts[i]->profileClear();
344
345 // The Sampler must take care of this!
346// if (profileEvent)
347// profileEvent->schedule(curTick);

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

363 }
364
365 schedule(curTick + interval);
366}
367
368void
369BaseCPU::post_interrupt(int int_num, int index)
370{
371 DPRINTF(Interrupt, "Interrupt %d:%d posted\n", int_num, index);
372
373 if (int_num < 0 || int_num >= TheISA::NumInterruptLevels)
374 panic("int_num out of bounds\n");
375
376 if (index < 0 || index >= sizeof(uint64_t) * 8)
377 panic("int_num out of bounds\n");
378
379 checkInterrupts = true;
380 interrupts[int_num] |= 1 << index;
381 intstatus |= (ULL(1) << int_num);
382}
383
384void
385BaseCPU::clear_interrupt(int int_num, int index)
386{
387 DPRINTF(Interrupt, "Interrupt %d:%d cleared\n", int_num, index);
388
389 if (int_num < 0 || int_num >= TheISA::NumInterruptLevels)
390 panic("int_num out of bounds\n");
391
392 if (index < 0 || index >= sizeof(uint64_t) * 8)
393 panic("int_num out of bounds\n");
394
395 interrupts[int_num] &= ~(1 << index);
396 if (interrupts[int_num] == 0)
397 intstatus &= ~(ULL(1) << int_num);
398}
399
400void
401BaseCPU::clear_interrupts()
402{
403 DPRINTF(Interrupt, "Interrupts all cleared\n");
404
405 memset(interrupts, 0, sizeof(interrupts));
406 intstatus = 0;
407}
408
409
410void
411BaseCPU::serialize(std::ostream &os)
412{
413 SERIALIZE_ARRAY(interrupts, TheISA::NumInterruptLevels);
414 SERIALIZE_SCALAR(intstatus);
415}
416
417void
418BaseCPU::unserialize(Checkpoint *cp, const std::string &section)
419{
420 UNSERIALIZE_ARRAY(interrupts, TheISA::NumInterruptLevels);
421 UNSERIALIZE_SCALAR(intstatus);
422}
423
424#endif // FULL_SYSTEM
425
426void
427BaseCPU::traceFunctionsInternal(Addr pc)
428{
429 if (!debugSymbolTable)

--- 25 unchanged lines hidden ---