File tree Expand file tree Collapse file tree 3 files changed +18
-18
lines changed Expand file tree Collapse file tree 3 files changed +18
-18
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,14 @@ This project adheres to [Semantic Versioning](http://semver.org/).
55
66## [ Unreleased]
77
8+ ### Changed
9+
10+ - Use ` cfg(any(target_arch = "riscv32", target_arch = "riscv64")) ` instead of ` cfg(riscv) ` .
11+
12+ ### Removed
13+
14+ - Removed custom build script, as ` cfg(riscv) ` is no longer necessary.
15+
816## [ v0.2.0] - 2025-06-10
917
1018### Changed
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 180180#![ deny( missing_docs) ]
181181#![ no_std]
182182
183- #[ cfg( all( riscv, not( feature = "no-semihosting" ) ) ) ]
184- use core:: arch:: asm;
185-
186183#[ macro_use]
187184mod macros;
188185
@@ -213,15 +210,18 @@ pub unsafe fn syscall<T>(nr: usize, arg: &T) -> usize {
213210#[ inline( always) ]
214211pub unsafe fn syscall1 ( _nr : usize , _arg : usize ) -> usize {
215212 match ( ) {
216- #[ cfg( all( riscv, not( feature = "no-semihosting" ) ) ) ]
213+ #[ cfg( all(
214+ any( target_arch = "riscv32" , target_arch = "riscv64" ) ,
215+ not( feature = "no-semihosting" )
216+ ) ) ]
217217 ( ) => {
218218 let mut nr = _nr;
219219 let arg = _arg;
220220 // The instructions below must always be uncompressed, otherwise
221221 // it will be treated as a regular break, hence the norvc option.
222222 //
223223 // See https://github.com/riscv/riscv-semihosting-spec for more details.
224- asm ! ( "
224+ core :: arch :: asm!( "
225225 .balign 16
226226 .option push
227227 .option norvc
@@ -236,9 +236,12 @@ pub unsafe fn syscall1(_nr: usize, _arg: usize) -> usize {
236236 ) ;
237237 nr
238238 }
239- #[ cfg( all( riscv, feature = "no-semihosting" ) ) ]
239+ #[ cfg( all(
240+ any( target_arch = "riscv32" , target_arch = "riscv64" ) ,
241+ feature = "no-semihosting"
242+ ) ) ]
240243 ( ) => 0 ,
241- #[ cfg( not( riscv ) ) ]
244+ #[ cfg( not( any ( target_arch = "riscv32" , target_arch = "riscv64" ) ) ) ]
242245 ( ) => unimplemented ! ( ) ,
243246 }
244247}
You can’t perform that action at this time.
0 commit comments