Add back code to clean up triggers in entry.S
[riscv-tests.git] / debug / programs / entry.S
index 302d409c55bb3d297c5fc8a1dc5019d27b83f82d..ff8ae3092a517ad20ce2860b7b56ac2d1cd05b5a 100755 (executable)
@@ -64,6 +64,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