From 204e7c8e175624e8c117158349824f4fc4ca7be2 Mon Sep 17 00:00:00 2001 From: liangzhen Date: Thu, 14 Sep 2023 10:25:28 +0800 Subject: [PATCH] Disable timer interrupt to fix some bugs Signed-off-by: liangzhen --- debug/gdbserver.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/debug/gdbserver.py b/debug/gdbserver.py index 5a2ba2abe..3a53283af 100755 --- a/debug/gdbserver.py +++ b/debug/gdbserver.py @@ -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) @@ -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") @@ -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")