Skip to content

fix(riscv): use ~0ULL when programming stimecmp to "infinity"#365

Merged
danielRep merged 1 commit into
mainfrom
fix/riscv-stimecmp-init-truncation
May 22, 2026
Merged

fix(riscv): use ~0ULL when programming stimecmp to "infinity"#365
danielRep merged 1 commit into
mainfrom
fix/riscv-stimecmp-init-truncation

Conversation

@josecm
Copy link
Copy Markdown
Member

@josecm josecm commented May 21, 2026

~0U is a 32-bit unsigned literal; when widened to the 64-bit parameter of csrs_stimecmp_write() it is zero-extended, leaving stimecmp with the upper half cleared instead of all ones. Affects both RV32 and RV64.

~0U is a 32-bit unsigned literal; when widened to the 64-bit parameter
of csrs_stimecmp_write() it is zero-extended, leaving stimecmp with the
upper half cleared instead of all ones. Affects both RV32 and RV64.

Signed-off-by: Jose Martins <josemartins90@gmail.com>
@danielRep danielRep self-assigned this May 22, 2026
Copy link
Copy Markdown
Contributor

@malejo97 malejo97 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is correct.

@danielRep danielRep merged commit 5415601 into main May 22, 2026
45 checks passed
@danielRep danielRep deleted the fix/riscv-stimecmp-init-truncation branch May 22, 2026 09:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants