cpu->schedule(this, curTick + interval);
}
-void
-BaseCPU::postInterrupt(int int_num, int index)
-{
- interrupts->post(int_num, index);
-}
-
-void
-BaseCPU::clearInterrupt(int int_num, int index)
-{
- interrupts->clear(int_num, index);
-}
-
-void
-BaseCPU::clearInterrupts()
-{
- interrupts->clearAll();
-}
-
void
BaseCPU::serialize(std::ostream &os)
{
return interrupts;
}
- virtual void postInterrupt(int int_num, int index);
- virtual void clearInterrupt(int int_num, int index);
- virtual void clearInterrupts();
+ virtual void wakeup() = 0;
+
+ void
+ postInterrupt(int int_num, int index)
+ {
+ interrupts->post(int_num, index);
+ wakeup();
+ }
+
+ void
+ clearInterrupt(int int_num, int index)
+ {
+ interrupts->clear(int_num, index);
+ }
+
+ void
+ clearInterrupts()
+ {
+ interrupts->clearAll();
+ }
bool
checkInterrupts(ThreadContext *tc) const
}
#if FULL_SYSTEM
-template <class Impl>
-void
-FullO3CPU<Impl>::postInterrupt(int int_num, int index)
-{
- BaseCPU::postInterrupt(int_num, index);
-
- if (this->thread[0]->status() == ThreadContext::Suspended) {
- DPRINTF(IPI,"Suspended Processor awoke\n");
- this->threadContexts[0]->activate();
- }
-}
-
template <class Impl>
Fault
FullO3CPU<Impl>::hwrei(unsigned tid)
schedule(tickEvent, nextCycle());
}
+#if FULL_SYSTEM
+template <class Impl>
+void
+FullO3CPU<Impl>::wakeup()
+{
+ if (this->thread[0]->status() != ThreadContext::Suspended)
+ return;
+
+ this->wakeCPU();
+
+ DPRINTF(Quiesce, "Suspended Processor woken\n");
+ this->threadContexts[0]->activate();
+}
+#endif
+
template <class Impl>
int
FullO3CPU<Impl>::getFreeTid()
void trap(Fault fault, unsigned tid);
#if FULL_SYSTEM
- /** Posts an interrupt. */
- void postInterrupt(int int_num, int index);
-
/** HW return from error interrupt. */
Fault hwrei(unsigned tid);
/** Wakes the CPU, rescheduling the CPU if it's not already active. */
void wakeCPU();
+#if FULL_SYSTEM
+ virtual void wakeup();
+#endif
+
/** Gets a free thread id. Use if thread ids change across system. */
int getFreeTid();
Status _status;
public:
- void postInterrupt(int int_num, int index);
+ void wakeup();
void zero_fill_64(Addr addr) {
static int warned = 0;
#if FULL_SYSTEM
template <class Impl>
void
-OzoneCPU<Impl>::postInterrupt(int int_num, int index)
+OzoneCPU<Impl>::wakeup()
{
- BaseCPU::postInterrupt(int_num, index);
-
if (_status == Idle) {
DPRINTF(IPI,"Suspended Processor awoke\n");
// thread.activate();
#if FULL_SYSTEM
void
-BaseSimpleCPU::postInterrupt(int int_num, int index)
+BaseSimpleCPU::wakeup()
{
- BaseCPU::postInterrupt(int_num, index);
+ if (thread->status() != ThreadContext::Suspended)
+ return;
- if (thread->status() == ThreadContext::Suspended) {
- DPRINTF(Quiesce,"Suspended Processor awoke\n");
- thread->activate();
- }
+ DPRINTF(Quiesce,"Suspended Processor awoke\n");
+ thread->activate();
}
#endif // FULL_SYSTEM
}
public:
- void postInterrupt(int int_num, int index);
+ void wakeup();
void zero_fill_64(Addr addr) {
static int warned = 0;