Skip to content

Commit

Permalink
Disable timer interrupt to fix some bugs
Browse files Browse the repository at this point in the history
Signed-off-by: liangzhen <[email protected]>
  • Loading branch information
lz-bro committed Sep 26, 2023
1 parent d4eaa5b commit 204e7c8
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions debug/gdbserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -1039,8 +1039,21 @@ def test(self):
local = self.gdb.p("local")
if interrupt_count > 1000 and \
local > 1000:
# Disable timer interrupt
for hart in self.target.harts:
self.gdb.select_hart(hart)
self.gdb.p("$mie")
self.gdb.p("$mie=$mie & ~0x80")
self.gdb.p("$mie")
return

# Disable timer interrupt
for hart in self.target.harts:
self.gdb.select_hart(hart)
self.gdb.p("$mie")
self.gdb.p("$mie=$mie & ~0x80")
self.gdb.p("$mie")

assertGreater(interrupt_count, 1000)
assertGreater(local, 1000)

Expand Down Expand Up @@ -1191,6 +1204,14 @@ def test(self):
time.sleep(1)
self.gdb.p("buf", fmt="")

# Disable timer interrupt
for hart in self.target.harts:
self.gdb.select_hart(hart)
self.gdb.interrupt()
self.gdb.p("$mie")
self.gdb.p("$mie=$mie & ~0x80")
self.gdb.p("$mie")

class MulticoreRtosSwitchActiveHartTest(GdbTest):
compile_args = ("programs/multicore.c", "-DMULTICORE")

Expand Down Expand Up @@ -1220,6 +1241,13 @@ def test(self):
assertIn("set_trap_handler", output)
assertNotIn("received signal SIGTRAP", output)

# Disable timer interrupt
for hart in self.target.harts:
self.gdb.select_hart(hart)
self.gdb.p("$mie")
self.gdb.p("$mie=$mie & ~0x80")
self.gdb.p("$mie")

class SmpSimultaneousRunHalt(GdbTest):
compile_args = ("programs/run_halt_timing.S", "-DMULTICORE")

Expand Down

0 comments on commit 204e7c8

Please sign in to comment.