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/).
5
5
6
6
## [ Unreleased]
7
7
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
+
8
16
## [ v0.2.0] - 2025-06-10
9
17
10
18
### Changed
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 180
180
#![ deny( missing_docs) ]
181
181
#![ no_std]
182
182
183
- #[ cfg( all( riscv, not( feature = "no-semihosting" ) ) ) ]
184
- use core:: arch:: asm;
185
-
186
183
#[ macro_use]
187
184
mod macros;
188
185
@@ -213,15 +210,18 @@ pub unsafe fn syscall<T>(nr: usize, arg: &T) -> usize {
213
210
#[ inline( always) ]
214
211
pub unsafe fn syscall1 ( _nr : usize , _arg : usize ) -> usize {
215
212
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
+ ) ) ]
217
217
( ) => {
218
218
let mut nr = _nr;
219
219
let arg = _arg;
220
220
// The instructions below must always be uncompressed, otherwise
221
221
// it will be treated as a regular break, hence the norvc option.
222
222
//
223
223
// See https://github.com/riscv/riscv-semihosting-spec for more details.
224
- asm ! ( "
224
+ core :: arch :: asm!( "
225
225
.balign 16
226
226
.option push
227
227
.option norvc
@@ -236,9 +236,12 @@ pub unsafe fn syscall1(_nr: usize, _arg: usize) -> usize {
236
236
) ;
237
237
nr
238
238
}
239
- #[ cfg( all( riscv, feature = "no-semihosting" ) ) ]
239
+ #[ cfg( all(
240
+ any( target_arch = "riscv32" , target_arch = "riscv64" ) ,
241
+ feature = "no-semihosting"
242
+ ) ) ]
240
243
( ) => 0 ,
241
- #[ cfg( not( riscv ) ) ]
244
+ #[ cfg( not( any ( target_arch = "riscv32" , target_arch = "riscv64" ) ) ) ]
242
245
( ) => unimplemented ! ( ) ,
243
246
}
244
247
}
You can’t perform that action at this time.
0 commit comments