base.cc (11148:1bc3d93c7eaa) | base.cc (11150:a8a64cca231b) |
---|---|
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 --- 223 unchanged lines hidden (view full) --- 232 Event *event = new wrap(this, true); 233 schedule(event, p->function_trace_start); 234 } 235 } 236 237 // The interrupts should always be present unless this CPU is 238 // switched in later or in case it is a checker CPU 239 if (!params()->switched_out && !is_checker) { | 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 --- 223 unchanged lines hidden (view full) --- 232 Event *event = new wrap(this, true); 233 schedule(event, p->function_trace_start); 234 } 235 } 236 237 // The interrupts should always be present unless this CPU is 238 // switched in later or in case it is a checker CPU 239 if (!params()->switched_out && !is_checker) { |
240 if (interrupts) { 241 interrupts->setCPU(this); | 240 if (!interrupts.empty()) { 241 for (ThreadID tid = 0; tid < numThreads; tid++) { 242 interrupts[tid]->setCPU(this); 243 } |
242 } else { 243 fatal("CPU %s has no interrupt controller.\n" 244 "Ensure createInterruptController() is called.\n", name()); 245 } 246 } 247 248 if (FullSystem) { 249 if (params()->profile) --- 328 unchanged lines hidden (view full) --- 578 old_checker_dtb_port->getSlavePort(); 579 old_checker_dtb_port->unbind(); 580 new_checker_dtb_port->bind(slavePort); 581 } 582 } 583 } 584 585 interrupts = oldCPU->interrupts; | 244 } else { 245 fatal("CPU %s has no interrupt controller.\n" 246 "Ensure createInterruptController() is called.\n", name()); 247 } 248 } 249 250 if (FullSystem) { 251 if (params()->profile) --- 328 unchanged lines hidden (view full) --- 580 old_checker_dtb_port->getSlavePort(); 581 old_checker_dtb_port->unbind(); 582 new_checker_dtb_port->bind(slavePort); 583 } 584 } 585 } 586 587 interrupts = oldCPU->interrupts; |
586 interrupts->setCPU(this); 587 oldCPU->interrupts = NULL; | 588 for (ThreadID tid = 0; tid < numThreads; tid++) { 589 interrupts[tid]->setCPU(this); 590 } 591 oldCPU->interrupts.clear(); |
588 589 if (FullSystem) { 590 for (ThreadID i = 0; i < size; ++i) 591 threadContexts[i]->profileClear(); 592 593 if (profileEvent) 594 schedule(profileEvent, curTick()); 595 } --- 55 unchanged lines hidden (view full) --- 651 652 if (!_switchedOut) { 653 /* Unlike _pid, _taskId is not serialized, as they are dynamically 654 * assigned unique ids that are only meaningful for the duration of 655 * a specific run. We will need to serialize the entire taskMap in 656 * system. */ 657 SERIALIZE_SCALAR(_pid); 658 | 592 593 if (FullSystem) { 594 for (ThreadID i = 0; i < size; ++i) 595 threadContexts[i]->profileClear(); 596 597 if (profileEvent) 598 schedule(profileEvent, curTick()); 599 } --- 55 unchanged lines hidden (view full) --- 655 656 if (!_switchedOut) { 657 /* Unlike _pid, _taskId is not serialized, as they are dynamically 658 * assigned unique ids that are only meaningful for the duration of 659 * a specific run. We will need to serialize the entire taskMap in 660 * system. */ 661 SERIALIZE_SCALAR(_pid); 662 |
659 interrupts->serialize(cp); 660 | |
661 // Serialize the threads, this is done by the CPU implementation. 662 for (ThreadID i = 0; i < numThreads; ++i) { 663 ScopedCheckpointSection sec(cp, csprintf("xc.%i", i)); | 663 // Serialize the threads, this is done by the CPU implementation. 664 for (ThreadID i = 0; i < numThreads; ++i) { 665 ScopedCheckpointSection sec(cp, csprintf("xc.%i", i)); |
666 interrupts[i]->serialize(cp); |
|
664 serializeThread(cp, i); 665 } 666 } 667} 668 669void 670BaseCPU::unserialize(CheckpointIn &cp) 671{ 672 UNSERIALIZE_SCALAR(instCnt); 673 674 if (!_switchedOut) { 675 UNSERIALIZE_SCALAR(_pid); | 667 serializeThread(cp, i); 668 } 669 } 670} 671 672void 673BaseCPU::unserialize(CheckpointIn &cp) 674{ 675 UNSERIALIZE_SCALAR(instCnt); 676 677 if (!_switchedOut) { 678 UNSERIALIZE_SCALAR(_pid); |
676 interrupts->unserialize(cp); | |
677 678 // Unserialize the threads, this is done by the CPU implementation. 679 for (ThreadID i = 0; i < numThreads; ++i) { 680 ScopedCheckpointSection sec(cp, csprintf("xc.%i", i)); | 679 680 // Unserialize the threads, this is done by the CPU implementation. 681 for (ThreadID i = 0; i < numThreads; ++i) { 682 ScopedCheckpointSection sec(cp, csprintf("xc.%i", i)); |
683 interrupts[i]->unserialize(cp); |
|
681 unserializeThread(cp, i); 682 } 683 } 684} 685 686void 687BaseCPU::scheduleInstStop(ThreadID tid, Counter insts, const char *cause) 688{ --- 61 unchanged lines hidden --- | 684 unserializeThread(cp, i); 685 } 686 } 687} 688 689void 690BaseCPU::scheduleInstStop(ThreadID tid, Counter insts, const char *cause) 691{ --- 61 unchanged lines hidden --- |