Skip to content

Commit 6337981

Browse files
committed
triggers: fix textra.sbytemask
Ignore corresponding bytes to the scontext and textra.svalue. Cast 0xff to reg_t for the 34-bit textra64.svalue.
1 parent 60c08b1 commit 6337981

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

riscv/triggers.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ bool trigger_t::textra_match(processor_t * const proc) const noexcept
8484
assert(CSR_TEXTRA32_SBYTEMASK_LENGTH < CSR_TEXTRA64_SBYTEMASK_LENGTH);
8585
for (int i = 0; i < CSR_TEXTRA64_SBYTEMASK_LENGTH; i++)
8686
if (sbytemask & (1 << i))
87-
mask &= 0xff << (i * 8);
87+
mask &= ~(reg_t(0xff) << (i * 8));
8888
if ((state->scontext->read() & mask) != (svalue & mask))
8989
return false;
9090
} else if (sselect == SSELECT_ASID) {

0 commit comments

Comments
 (0)