Skip to content

Commit ecf4fde

Browse files
committed
Disable timer interrupt to fix some bugs
Signed-off-by: liangzhen <[email protected]>
1 parent d4eaa5b commit ecf4fde

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

debug/gdbserver.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1039,8 +1039,10 @@ def test(self):
10391039
local = self.gdb.p("local")
10401040
if interrupt_count > 1000 and \
10411041
local > 1000:
1042+
self.disable_timer()
10421043
return
10431044

1045+
self.disable_timer()
10441046
assertGreater(interrupt_count, 1000)
10451047
assertGreater(local, 1000)
10461048

@@ -1191,6 +1193,8 @@ def test(self):
11911193
time.sleep(1)
11921194
self.gdb.p("buf", fmt="")
11931195

1196+
self.disable_timer(interrupt=True)
1197+
11941198
class MulticoreRtosSwitchActiveHartTest(GdbTest):
11951199
compile_args = ("programs/multicore.c", "-DMULTICORE")
11961200

@@ -1220,6 +1224,8 @@ def test(self):
12201224
assertIn("set_trap_handler", output)
12211225
assertNotIn("received signal SIGTRAP", output)
12221226

1227+
self.disable_timer()
1228+
12231229
class SmpSimultaneousRunHalt(GdbTest):
12241230
compile_args = ("programs/run_halt_timing.S", "-DMULTICORE")
12251231

debug/testlib.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1411,6 +1411,13 @@ def disable_pmp(self):
14111411
# PMP registers are optional
14121412
pass
14131413

1414+
def disable_timer(self, interrupt=False):
1415+
for hart in self.target.harts:
1416+
self.gdb.select_hart(hart)
1417+
if interrupt:
1418+
self.gdb.interrupt()
1419+
self.gdb.p("$mie=$mie & ~0x80")
1420+
14141421
def exit(self, expected_result=10):
14151422
self.gdb.command("delete")
14161423
self.gdb.b("_exit")

0 commit comments

Comments
 (0)