@@ -1830,8 +1830,7 @@ def test(self):
18301830 # Other hart should have become unavailable.
18311831 if self .target .support_unavailable_control :
18321832 self .server .wait_until_running (self .target .harts )
1833- self .server .command (
1834- f"riscv dmi_write 0x1f 0x{ (1 << self .hart .id )& 0x3 :x} " )
1833+ self .server .set_available ([self .hart ])
18351834 self .gdb .expect (r"\S+ became unavailable." )
18361835 self .gdb .interrupt ()
18371836
@@ -1901,8 +1900,8 @@ def test(self):
19011900 self .gdb .c (wait = False )
19021901 if self .target .support_unavailable_control :
19031902 self .server .wait_until_running ([self .hart ])
1904- self .server .command (
1905- f"riscv dmi_write 0x1f 0x { ( ~ ( 1 << self .hart . id )) & 0x3 :x } " )
1903+ self .server .set_available (
1904+ [ h for h in self . target . harts if h != self .hart ] )
19061905 self .gdb .expect (r"\S+ became unavailable." )
19071906 self .gdb .interrupt ()
19081907 # gdb might automatically switch to the available hart.
@@ -1933,14 +1932,14 @@ def test(self):
19331932 self .gdb .p ("$pc=loop_forever" )
19341933 self .gdb .c (wait = False )
19351934 self .server .wait_until_running ([self .hart ])
1936- self .server .command (
1937- f"riscv dmi_write 0x1f 0x { ( ~ ( 1 << self .hart . id )) & 0x3 :x } " )
1935+ self .server .set_available (
1936+ [ h for h in self .target . harts if h != self . hart ] )
19381937 self .gdb .expect (r"\S+ became unavailable." )
19391938
19401939 # Now send a DMI command through OpenOCD to make the hart available
19411940 # again.
19421941
1943- self .server .command ( "riscv dmi_write 0x1f 0x3" )
1942+ self .server .set_available ( self . target . harts )
19441943 self .gdb .expect (r"\S+ became available" )
19451944 self .gdb .interrupt ()
19461945 self .gdb .p ("$pc" )
0 commit comments