Skip to content

Commit

Permalink
[debug] Clear interrupt enable and pending in disable_timer
Browse files Browse the repository at this point in the history
  • Loading branch information
lz-bro committed Nov 6, 2024
1 parent fa2f65c commit d7ae32e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion debug/gdbserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -1110,9 +1110,9 @@ def test(self):
self.disable_timer()
return

self.disable_timer()
assertGreater(interrupt_count, 1000)
assertGreater(local, 1000)
self.disable_timer()

def postMortem(self):
GdbSingleHartTest.postMortem(self)
Expand Down
3 changes: 3 additions & 0 deletions debug/testlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -1508,6 +1508,9 @@ def disable_timer(self, interrupt=False):
if interrupt:
self.gdb.interrupt()
self.gdb.p("$mie=$mie & ~0x80")
self.gdb.p("$mstatus=$mstatus & ~0x8")
self.gdb.p(f"*((long long*) 0x{self.target.clint_addr + 0x4000:x})\
=0x" + "f" * (self.hart.xlen // 4))

def exit(self, expected_result=10):
self.gdb.command("delete")
Expand Down

0 comments on commit d7ae32e

Please sign in to comment.