check that no interrupts are pending before entering the wfi wait

This commit is contained in:
Stanislaw Kaushanski 2022-04-26 13:58:20 +02:00
parent a92b84bef4
commit 5f6d462973
1 changed files with 2 additions and 2 deletions

View File

@ -175,9 +175,9 @@ public:
void wait_until(uint64_t flags) override {
SCCDEBUG(owner->name()) << "Sleeping until interrupt";
do {
while(this->reg.pending_trap == 0 && (this->csr[arch::mip] & this->csr[arch::mie]) == 0) {
sc_core::wait(wfi_evt);
} while (this->reg.pending_trap == 0);
}
PLAT::wait_until(flags);
}