This shouldn't affect triggers set by the debugger, because running code
can't change those. When it does affect them, it breaks Hwbp1 which sets
the breakpoint before running the program.
# 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