Clear triggers during entry.
authorTim Newsome <tim@sifive.com>
Thu, 29 Sep 2016 18:38:54 +0000 (11:38 -0700)
committerTim Newsome <tim@sifive.com>
Thu, 29 Sep 2016 18:38:54 +0000 (11:38 -0700)
If the last test leaves some triggers set they should be cleaned up.

debug/programs/entry.S

index 80904cdb38191967deb1958e18955c4365fc1c91..6dc694f69ea54780ef2a1eb51cb2888c86819924 100755 (executable)
@@ -40,6 +40,15 @@ handle_reset:
   # initialize stack pointer
   la sp, stack_top
 
+  # Clear all hardware triggers
+  li    t0, ~0
+1:
+  addi  t0, t0, 1
+  csrw  CSR_TSELECT, t0
+  csrw  CSR_TDATA1, zero
+  csrr  t1, CSR_TSELECT
+  beq   t0, t1, 1b
+
   # perform the rest of initialization in C
   j _init