Skip to content

Commit 2abb586

Browse files
committed
Fix conditional compilation
1 parent f7c332f commit 2abb586

File tree

1 file changed

+10
-19
lines changed

1 file changed

+10
-19
lines changed

arch/riscv/src/lib.rs

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,9 @@ extern "C" {
8282
#[allow(unused_imports)]
8383
use kernel::{csr_op, csr_ptr, is_cheri, ldptr, ldx, ptrreg, stptr, stx};
8484

85-
#[cfg(any(
86-
doc,
87-
all(
88-
any(target_arch = "riscv32", target_arch = "riscv64"),
89-
target_os = "none"
90-
)
85+
#[cfg(all(
86+
any(target_arch = "riscv32", target_arch = "riscv64"),
87+
target_os = "none"
9188
))]
9289
core::arch::global_asm!(crate::easm!("
9390
.section .riscv.start, \"ax\"
@@ -298,12 +295,9 @@ extern "C" {
298295
pub fn _start_trap();
299296
}
300297

301-
#[cfg(any(
302-
doc,
303-
all(
304-
any(target_arch = "riscv32", target_arch = "riscv64"),
305-
target_os = "none"
306-
)
298+
#[cfg(all(
299+
any(target_arch = "riscv32", target_arch = "riscv64"),
300+
target_os = "none"
307301
))]
308302
core::arch::global_asm!(crate::easm!(
309303
"
@@ -416,12 +410,9 @@ core::arch::global_asm!(crate::easm!(
416410
/// https://elixir.bootlin.com/linux/v5.12.10/source/arch/riscv/include/asm/jump_label.h#L21
417411
/// as suggested by the RISC-V developers:
418412
/// https://groups.google.com/a/groups.riscv.org/g/isa-dev/c/XKkYacERM04/m/CdpOcqtRAgAJ
419-
#[cfg(any(
420-
doc,
421-
all(
422-
any(target_arch = "riscv32", target_arch = "riscv64"),
423-
target_os = "none"
424-
)
413+
#[cfg(all(
414+
any(target_arch = "riscv32", target_arch = "riscv64"),
415+
target_os = "none"
425416
))]
426417
pub unsafe fn semihost_command(command: usize, arg0: usize, arg1: usize) -> usize {
427418
use core::arch::asm;
@@ -445,7 +436,7 @@ pub unsafe fn semihost_command(command: usize, arg0: usize, arg1: usize) -> usiz
445436
}
446437

447438
// Mock implementation for tests on Travis-CI.
448-
#[cfg(not(any(target_os = "none")))]
439+
#[cfg(not(target_os = "none"))]
449440
pub unsafe fn semihost_command(_command: usize, _arg0: usize, _arg1: usize) -> usize {
450441
unimplemented!()
451442
}

0 commit comments

Comments
 (0)