1 # See LICENSE for license details.
3 #*****************************************************************************
5 #-----------------------------------------------------------------------------
7 # Test breakpoints, if they are implemented.
10 #include "riscv_test.h"
11 #include "test_macros.h"
16 # Set up breakpoint to trap on M-mode fetches.
19 li t0, (BPCONTROL_MATCHCOND & (BPCONTROL_MATCHCOND>>1)) | BPCONTROL_M | BPCONTROL_X
21 # Skip if breakpoint type is unsupported.
27 # Trap handler should skip this instruction.
30 # Make sure reads don't trap.
35 # Set up breakpoint to trap on M-mode reads.
37 li t0, (BPCONTROL_MATCHCOND & (BPCONTROL_MATCHCOND>>1)) | BPCONTROL_M | BPCONTROL_R
39 # Skip if breakpoint type is unsupported.
45 # Trap handler should skip this instruction.
49 # Make sure writes don't trap.
54 # Set up breakpoint to trap on M-mode stores.
56 li t0, (BPCONTROL_MATCHCOND & (BPCONTROL_MATCHCOND>>1)) | BPCONTROL_M | BPCONTROL_W
58 # Skip if breakpoint type is unsupported.
62 # Trap handler should skip this instruction.
66 # Make sure store didn't succeed.
75 # Only even-numbered tests should trap.
79 li a0, CAUSE_BREAKPOINT