This allows them to be referenced by other files, such as a test environment
that lives in a separate compilation unit.
2:
TEST_PASSFAIL
+ .align 2
+ .global mtvec_handler
mtvec_handler:
# Only even-numbered tests should trap.
andi t0, TESTNUM, 1
TEST_PASSFAIL
.align 8
+ .global mtvec_handler
mtvec_handler:
j synchronous_exception
j msip
TEST_PASSFAIL
.align 3
+ .global mtvec_handler
mtvec_handler:
csrr t0, mcause
bne t0, s1, fail
TEST_PASSFAIL
.align 2
+ .global stvec_handler
stvec_handler:
# Trapping on tests 10-12 is good news.
# Note that since the test didn't complete, TESTNUM is smaller by 1.
TEST_PASSFAIL
.align 2
+ .global mtvec_handler
mtvec_handler:
csrr t0, mcause
add t0, t0, -CAUSE_STORE_PAGE_FAULT
TEST_PASSFAIL
.align 2
+ .global stvec_handler
stvec_handler:
# tests 2, 4, 5, and 6 should trap
li a0, 2
TEST_PASSFAIL
.align 2
+ .global stvec_handler
stvec_handler:
li t1, CAUSE_BREAKPOINT
csrr t0, scause
TEST_PASSFAIL
.align 2
+ .global stvec_handler
stvec_handler:
li t1, CAUSE_USER_ECALL
csrr t0, scause