From a5c4eb3de9deb3a71a6a5230a25ff5962e584980 Mon Sep 17 00:00:00 2001 From: Mitch Hayenga Date: Wed, 30 Sep 2015 11:14:19 -0500 Subject: isa,cpu: Add support for FS SMT Interrupts Adds per-thread interrupt controllers and thread/context logic so that interrupts properly get routed in SMT systems. --- src/cpu/base.hh | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'src/cpu/base.hh') diff --git a/src/cpu/base.hh b/src/cpu/base.hh index 0286ac45b..2a57c01ba 100644 --- a/src/cpu/base.hh +++ b/src/cpu/base.hh @@ -207,41 +207,45 @@ class BaseCPU : public MemObject TheISA::MicrocodeRom microcodeRom; protected: - TheISA::Interrupts *interrupts; + std::vector interrupts; public: TheISA::Interrupts * - getInterruptController() + getInterruptController(ThreadID tid) { - return interrupts; + if (interrupts.empty()) + return NULL; + + assert(interrupts.size() > tid); + return interrupts[tid]; } virtual void wakeup() = 0; void - postInterrupt(int int_num, int index) + postInterrupt(ThreadID tid, int int_num, int index) { - interrupts->post(int_num, index); + interrupts[tid]->post(int_num, index); if (FullSystem) wakeup(); } void - clearInterrupt(int int_num, int index) + clearInterrupt(ThreadID tid, int int_num, int index) { - interrupts->clear(int_num, index); + interrupts[tid]->clear(int_num, index); } void - clearInterrupts() + clearInterrupts(ThreadID tid) { - interrupts->clearAll(); + interrupts[tid]->clearAll(); } bool checkInterrupts(ThreadContext *tc) const { - return FullSystem && interrupts->checkInterrupts(tc); + return FullSystem && interrupts[tc->threadId()]->checkInterrupts(tc); } class ProfileEvent : public Event -- cgit v1.2.3