NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
crates.io · #3314 most downloaded on crates.io
Low level access to RISC-V processors
Last release 4 months ago
28 May 2026
Ships fairly regularly
a new release about every 4 months
Some releases are documented
notes for 14 of 27 stable releases
4 versions withdrawn
withdrawn after publishing
9 years old
31 releases · first in 2017
Add mstatus and sstatus CSRs helpers for UBE, VS, UXL and SXL, and the corresponding tests
mtopei CSRmstatus and sstatus CSRs helpers for UBE, VS, UXL and SXL, and the corresponding testspmpaddr16 ~ pmpaddr63 CSRssiselect CSRvsiselect CSRstopi CSRpaste crate with pastey to fix RUSTSEC-2024-0436This crate substitutes riscv-pac , which is now deprecated
A new batch of RISC-V releases is now available at crates.io! Here we enumerate the most important changes, but please read the CHANGELOG.md files for further details.
riscv-types v0.1.0This crate substitutes riscv-pac, which is now deprecated
riscv v0.16.0 rt and rt-v-trap features to opt-in riscv-rt-related code in riscv::pac_enum macro (@romancardenas)riscv-rt v0.17.0no-mhartid and no-xtvec features to support more targets (@Shatur)v-trap core interrupt so RISCV_RT_BASE_ISA must be defined (@kurtjd)One column per quarter.
vstopi CSRdcsratch0 and dscratch1 CSRsread-write_csr_as_usize macro for registersdpc CSR support for RISC-Vmiselect CSRrt and rt-v-trap features to opt-in riscv-rt-related code in riscv::pac_enum macro.mvien + mvienh CSRriscv-typesriscv-types instead of riscv-pacpac_enum macro from riscv-macros./macros/ to ../riscv-macros/MIT or Apache-2.0riscv::pac_enum macro only includes trap-related code if rt or rt-v-trap features are enabled.A new batch of RISC-V releases is now available at crates.io ! Here we enumerate the most important changes, but please read the CHANGELOG.md files fo
A new batch of RISC-V releases is now available at crates.io! Here we enumerate the most important changes, but please read the CHANGELOG.md files for further details.
riscv v0.15.0riscv-pac abstractions for interrupts.mcause bit mask.riscv-peripheral v0.4.0riscv-rt v0.16.0This release features numerous exciting changes. The most important are:
esp-riscv-rt to run on top of riscv-rt.cortex-m-rt and esp-riscv-rt.global_asm macro invocations to avoid potential undefined behavior in future Rust releases.riscv-rtThank you to all the people who contributed to these releases!
try_new and new associated functions for Mtvec and Stvec.mie and sie registers
using the riscv_pac::CoreInterruptNumber trait.riscv::interrupt::{is_interrupt_enabled, disable_interrupt, enable_interrupt} functions.mip and sip registers
using the riscv_pac::CoreInterruptNumber trait.riscv::interrupt::is_interrupt_pending function.riscv::register::xip::clear_pending atomic function for mip and sip registers.
This function is marked as unsafe, as its availability depends both on the target chip
and the target interrupt source.mseccfg CSRmseccfgh CSRcfg(any(target_arch = "riscv32", target_arch = "riscv64")) instead of cfg(riscv).riscv::pac_enum(unsafe CoreInterrupt) now locates the vector table at the .trap.vector
section instead of .trap.cfg(riscv) is no longer necessary.Mip and Sip CSR proxies are now read-only. This change is motivated
to avoid clearing unwanted interrupts triggered between CSR reads and CSR writes.If you need it, you must activate the pre_init feature. Also, note that the riscv_rt::pre_init has been deprecated, as it is unsound to execute Rust c…
A new batch of RISC-V releases are now available at crates.io! Here we enumerate the most important changes, but please read the CHANGELOG.md files for further details
riscv v0.14.0@rmsyn added new CSRs. Also, MSRV is now 1.67
riscv-peripheral v0.3.0This crate experienced a full rework, so the code corresponding to RISC-V peripherals is more natural for PACS generated with svd2rust
riscv-rt v0.15.0We added the device and memory features to allow PACs to simplify the linking process, similar to cortex-m-rt. If you enable these features, the link.x file will include the device.x and/or memory.x files. In this way, just including link.x in your binary is enough.
The __pre_init symbol has disappeared from riscv-rt by default. If you need it, you must activate the pre_init feature. Also, note that the riscv_rt::pre_init has been deprecated, as it is unsound to execute Rust code before RAM initialization. Instead, use assembly.
We removed weak symbols, as currently stable Rust does not support weak linkage and LTOs. Now, we use _default_* symbols. Once weak linkage is available in stable Rust, we plan to go back to weak symbols. Thanks, @rslawson !
write_composite_csr for writing 64-bit CSRs on 32-bit targets.mcycle, minstretsenvcfg CSRscontext CSRmconfigptr CSRlog to ilog name changemtval2 CSRriscv::interrupt::machine::nestedCSR writes are now all unsafe . Users can open an RFC to nominate certain CSRs to be safe
riscv 0.12.0unsafe. Users can open an RFC to nominate certain CSRs to be safe (#209)RISCV_MTVEC_ALIGN environment variable to set the vector table byte alignment ((thanks, @ia0 !)riscv-rt 0.13.0cortex-m-rtriscv-target-parser 0.1.0New utility crate to assist in build scripts of the RISC-V ecosystem. It is useful for determining which extensions are available, the base ISA of the target, etc.
riscv-peripheral 0.2.1 and riscv-semihosting 0.1.3Update dependencies
unsafe by default (#209)RISCV_MTVEC_ALIGN to control the alignment constraint of the vector tablecfg fieldcortex-mmarchid registertry_* functions in mcountinhibitmcause registermedeleg registermideleg registermcounteren registermie registermimpid registermisa registermip registermstatus registermstatush registermtvec registermtvendorid registersatp registerpmpcfgx field typesscause field typessie registerscounteren field typessip registersstatus field typesstvec field typespmpcfg CSRs from RISC-V privileged specUpdate critical-section to 1.2.0
Support for target-dependent external interrupt and exception numbers
riscv 0.12.0riscv-macros for helping during the definition of custom interrupt and exception sourcesriscv-pac 0.2.0usize numbersExceptionNumber trait for custom exception numbersriscv-peripheral 0.2.0riscv-rt 0.13.0_dispatch_exception function_dispatch_interrupt functionno-exceptions and no-interrupts features. This way, you can adapt riscv-rt to target-specific sources.pre_init_trap to detect early errors during the boot process.v-trap feature!core_interrupt, external_interrupt, and exception macros for defining interrupt and exception handlersu-boot feature to execute U-boot binaries.riscv-macros crate for riscv-pac enums.riscv-pac traits for Interrupt and Exception enums.riscv-pac trait implementations of Interrupt and Exception enums.Mcause::from(usize) for use in unit testsMstatus::from(usize) for use in unit testsMstatus.bits()Eq and PartialEq for pmpcfgx::{Range, Permission}Mstatus::update_* helpers to manipulate Mstatus values without touching
the CSRriscv::register::macros module macros for external useriscv::register::mcountinhibit module for mcountinhibit CSRMcounteren in-memory update functionsMstatus vector extension supportpanicriscv-pac as a dependencysip::set_ssoft and sip::clear_ssoft using wrong addressmstatus unit tests.Made asm::wfi, fence, fence_i and sfence safe (ie, removed unsafe from their definitions)
asm::wfi, fence, fence_i and sfence safe (ie, removed unsafe from their definitions)cfg variable selection more robust for custom targetsAdd asm::ecall(), a wrapper for implementing an ecall instruction
asm::ecall(), a wrapper for implementing an ecall instructionnested function for nested ISRs in interrupt::machine and interrupt::supervisors-mode feature for reexporting interrupt::machine or interrupt::supervisor to interruptinterrupt::supervisorread_csr_as_rv32, set_rv32, and clear_rv32 macrosmstatus::uxl and mstatus::sxlmstatus::ube, mstatus::sbe, and mstatus::mbe endianness bit fieldsmstatush registers (RISCV-32 only)asm::fence(), a wrapper for implementing a fence instructionasm::fence_i(), a wrapper for implementing a fence.i instructionTryFrom implementation for mcause::{Interrupt, Exception} and scause::{Interrupt, Exception}embedded-hal dependency to v1.0.0 (bumps MSRV to 1.60)misa::MXL renamed to misa::XLENbit_field dependencycheckout@v3 and dtolnay/rust-toolchain.mcause::{Interrupt, Exception} and scause::{Interrupt, Exception} now implement From trait for usizeasm::nop and asm::delay functions to safe.scause::Exception missing LoadMisalignedscause::Exception missing SupervisorEnvCallmcause::Interrupt and scause::Interruptmstatusmedelegrelease v0.10.1 with critical section bug
release v0.10.1 with critical section bug
120: release v0.10.0 r=almindor a=almindor
critical-section-single-hart feature which provides an implementation for the critical_section crate for single-hart systems, based on disabling all interrupts.Fix asm::delay() to ensure count register is always reloaded
asm::delay() to ensure count register is always reloadedset_msoft, clear_msoft, set_mtimer and clear_mtimer removed as part of fixing issue #62112: Propose to release a version riscv v0.8.1 r=almindor a=luojia65
112: Propose to release a version riscv v0.8.1 r=almindor a=luojia65
The riscv crate includes an important fix (#107) where the RustSBI community would leverage the use of. However, the latest release v0.8.0 did not include this fix. In this pull request we want to propose to release a new version of riscv crate to include at least this fix, so that RustSBI community would write correct implemenations based on this crate.
Notes to CHANGELOG.md: the release date 2022-10-06 can always be changed.
r? @Disasm
Co-authored-by: luojia65 me@luojia.cc
102: Prepare v0.8.0 release r=almindor a=Disasm
102: Prepare v0.8.0 release r=almindor a=Disasm
Co-authored-by: Vadim Kaushan admin@disasm.info
#[cfg(riscv32)] to pmpcfg1 and pmpcfg3 modulesRange, Permission for PMP configurationset_pmp() and clear_pmp() functions to pmpcfg(x) modulesPmpcsr and is returned from pmpcfgx::read()singleton! macromcycle registerasm::delay() function for assembly-based busy-loopsasm::nop(), a wrapper for implementing a nop instruction#[inline] attribute to register reads, type conversations and interrupt::freeasm! instead of llvm_asm!pmpcfgx::read() macro to read_csr_as!() from read_csr_as_usize!()sfence.vma operand orderinline-asm feature which is now always enabledAdd cycle[h], instret[h] and mcounteren
medeleg registercycle[h], instret[h] and mcounterenmxrmprvscause::setbare-metal to v1.0.0 removing Nr traitdocs.rs are now RISC-V targets other than default onesMtvec::trap_mode(), Stvec::trap_mode() and Utvec::trap_mode() functions now return Option (breaking change)
Mtvec::trap_mode(), Stvec::trap_mode() and Utvec::trap_mode() functions now return Option<TrapMode> (breaking change)llvm_asm! instead of asm!vexriscv crateAdded vexriscv-specific registers
Added riscv32i-unknown-none-elf target support
riscv32i-unknown-none-elf target supportmip and satp registersmideleg registerbare-metal versionNothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →