Skip to content

Commit f00a398

Browse files
committed
remove asm feature
The `asm!()` macro was stabilized in rust-lang/rust#91728. This removes the feature and imports it through `core::arch` instead.
1 parent 2ab8d33 commit f00a398

File tree

28 files changed

+42
-17
lines changed

28 files changed

+42
-17
lines changed

arch/cortex-m/src/lib.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22
33
#![crate_name = "cortexm"]
44
#![crate_type = "rlib"]
5-
#![feature(asm, asm_sym)]
5+
#![feature(asm_sym)]
66
#![feature(naked_functions)]
77
#![no_std]
88

9+
use core::arch::asm;
910
use core::fmt::Write;
1011

1112
pub mod mpu;

arch/cortex-m/src/scb.rs

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
//!
33
//! <http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0553a/CIHFDJCA.html>
44
5+
use core::arch::asm;
6+
57
use kernel::utilities::registers::interfaces::{ReadWriteable, Readable, Writeable};
68
use kernel::utilities::registers::{register_bitfields, register_structs, ReadOnly, ReadWrite};
79
use kernel::utilities::StaticRef;

arch/cortex-m/src/support.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
use core::arch::asm;
12
use core::ops::FnOnce;
23

34
#[cfg(all(target_arch = "arm", target_os = "none"))]

arch/cortex-m0/src/lib.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
#![crate_name = "cortexm0"]
44
#![crate_type = "rlib"]
5-
#![feature(asm, asm_sym, naked_functions)]
5+
#![feature(asm_sym, naked_functions)]
66
#![no_std]
77

88
// Re-export the base generic cortex-m functions here as they are
@@ -13,6 +13,8 @@ pub use cortexm::nvic;
1313
pub use cortexm::print_cortexm_state as print_cortexm0_state;
1414
pub use cortexm::syscall;
1515

16+
use core::arch::asm;
17+
1618
extern "C" {
1719
// _estack is not really a function, but it makes the types work
1820
// You should never actually invoke it!!

arch/cortex-m0p/src/lib.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
33
#![crate_name = "cortexm0p"]
44
#![crate_type = "rlib"]
5-
#![feature(asm)]
65
#![feature(naked_functions)]
76
#![no_std]
87

@@ -26,6 +25,8 @@ pub use cortexm0::generic_isr;
2625
pub use cortexm0::hard_fault_handler;
2726
pub use cortexm0::systick_handler;
2827

28+
use core::arch::asm;
29+
2930
// Mock implementation for tests on Travis-CI.
3031
#[cfg(not(any(target_arch = "arm", target_os = "none")))]
3132
pub unsafe extern "C" fn switch_to_user(

arch/rv32i/src/lib.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
33
#![crate_name = "rv32i"]
44
#![crate_type = "rlib"]
5-
#![feature(asm, asm_sym, const_fn_trait_bound, naked_functions)]
5+
#![feature(asm_sym, const_fn_trait_bound, naked_functions)]
66
#![no_std]
77

8+
use core::arch::asm;
89
use core::fmt::Write;
910

1011
use kernel::utilities::registers::interfaces::{Readable, Writeable};

arch/rv32i/src/support.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
//! Core low-level operations.
22
33
use crate::csr::{mstatus::mstatus, CSR};
4+
use core::arch::asm;
45
use core::ops::FnOnce;
56

67
#[cfg(all(target_arch = "riscv32", target_os = "none"))]

arch/rv32i/src/syscall.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
//! Kernel-userland system call interface for RISC-V architecture.
22
3+
use core::arch::asm;
34
use core::convert::TryInto;
45
use core::fmt::Write;
56
use core::mem::size_of;

boards/nano_rp2040_connect/src/main.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
// https://github.com/rust-lang/rust/issues/62184.
88
#![cfg_attr(not(doc), no_main)]
99
#![deny(missing_docs)]
10-
#![feature(asm, naked_functions)]
10+
#![feature(naked_functions)]
11+
12+
use core::arch::asm;
1113

1214
use capsules::virtual_alarm::VirtualMuxAlarm;
1315
use components::gpio::GpioComponent;

boards/pico_explorer_base/src/main.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
// https://github.com/rust-lang/rust/issues/62184.
88
#![cfg_attr(not(doc), no_main)]
99
#![deny(missing_docs)]
10-
#![feature(asm, naked_functions)]
10+
#![feature(naked_functions)]
11+
12+
use core::arch::asm;
1113

1214
use kernel::dynamic_deferred_call::{DynamicDeferredCall, DynamicDeferredCallClientState};
1315

boards/raspberry_pi_pico/src/main.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
// https://github.com/rust-lang/rust/issues/62184.
88
#![cfg_attr(not(doc), no_main)]
99
#![deny(missing_docs)]
10-
#![feature(asm, naked_functions)]
10+
#![feature(naked_functions)]
11+
12+
use core::arch::asm;
1113

1214
use capsules::i2c_master::I2CMasterDriver;
1315
use capsules::virtual_alarm::VirtualMuxAlarm;

chips/apollo3/src/lib.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
#![crate_name = "apollo3"]
44
#![crate_type = "rlib"]
5-
#![feature(asm, const_fn_trait_bound)]
5+
#![feature(const_fn_trait_bound)]
66
#![no_std]
77

88
// Peripherals
@@ -18,6 +18,8 @@ pub mod pwrctrl;
1818
pub mod stimer;
1919
pub mod uart;
2020

21+
use core::arch::asm;
22+
2123
use cortexm4::{
2224
generic_isr, hard_fault_handler, initialize_ram_jump_to_main, scb, svc_handler,
2325
systick_handler, unhandled_interrupt,

chips/arty_e21_chip/src/chip.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
use core::arch::asm;
12
use core::fmt::Write;
23
use kernel;
34
use kernel::debug;

chips/arty_e21_chip/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
//! Drivers and chip support for the E21 soft core.
22
3-
#![feature(asm)]
43
#![no_std]
54
#![crate_name = "arty_e21_chip"]
65
#![crate_type = "rlib"]

chips/earlgrey/src/chip.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
//! High-level setup and interrupt mapping for the chip.
22
3+
use core::arch::asm;
34
use core::fmt::Write;
45
use kernel;
56
use kernel::dynamic_deferred_call::DynamicDeferredCall;

chips/earlgrey/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! Drivers and chip support for EarlGrey.
22
3-
#![feature(asm, const_fn_trait_bound, naked_functions)]
3+
#![feature(const_fn_trait_bound, naked_functions)]
44
#![no_std]
55
#![crate_name = "earlgrey"]
66
#![crate_type = "rlib"]

chips/esp32-c3/src/chip.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
//! High-level setup and interrupt mapping for the chip.
22
3+
use core::arch::asm;
34
use core::fmt::Write;
45

56
use kernel;

chips/esp32-c3/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! Drivers and chip support for ESP32-C3.
22
3-
#![feature(const_fn_trait_bound, naked_functions, asm)]
3+
#![feature(const_fn_trait_bound, naked_functions)]
44
#![no_std]
55
#![crate_name = "esp32_c3"]
66
#![crate_type = "rlib"]

chips/litex_vexriscv/src/interrupt_controller.rs

+3
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ mod vexriscv_irq_raw {
107107
#[cfg(all(target_arch = "riscv32", target_os = "none"))]
108108
pub unsafe fn irq_getmask() -> usize {
109109
let mask: usize;
110+
use core::arch::asm;
110111
asm!("csrr {mask}, {csr}", mask = out(reg) mask, csr = const CSR_IRQ_MASK);
111112
mask
112113
}
@@ -116,6 +117,7 @@ mod vexriscv_irq_raw {
116117

117118
#[cfg(all(target_arch = "riscv32", target_os = "none"))]
118119
pub unsafe fn irq_setmask(mask: usize) {
120+
use core::arch::asm;
119121
asm!("csrw {csr}, {mask}", csr = const CSR_IRQ_MASK, mask = in(reg) mask);
120122
}
121123

@@ -127,6 +129,7 @@ mod vexriscv_irq_raw {
127129
#[cfg(all(target_arch = "riscv32", target_os = "none"))]
128130
pub unsafe fn irq_pending() -> usize {
129131
let pending: usize;
132+
use core::arch::asm;
130133
asm!("csrr {pending}, {csr}", pending = out(reg) pending, csr = const CSR_IRQ_PENDING);
131134
pending
132135
}

chips/litex_vexriscv/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! LiteX SoCs based around a VexRiscv CPU
22
3-
#![feature(asm, asm_const, const_fn_trait_bound)]
3+
#![feature(asm_const, const_fn_trait_bound)]
44
#![no_std]
55
#![crate_name = "litex_vexriscv"]
66
#![crate_type = "rlib"]

chips/msp432/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#![crate_name = "msp432"]
22
#![crate_type = "rlib"]
3-
#![feature(asm, const_fn_trait_bound)]
3+
#![feature(const_fn_trait_bound)]
44
#![no_std]
55

66
use cortexm4::{

chips/rp2040/src/clocks.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
use core::arch::asm;
12
use core::cell::Cell;
23
use kernel::utilities::registers::interfaces::{ReadWriteable, Readable, Writeable};
34
use kernel::utilities::registers::{register_bitfields, register_structs, ReadOnly, ReadWrite};

chips/rp2040/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![feature(const_fn_trait_bound, asm)]
1+
#![feature(const_fn_trait_bound)]
22
#![no_std]
33

44
pub mod adc;

chips/stm32f4xx/src/fsmc.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
use crate::rcc;
2+
use core::arch::asm;
23
use core::cell::Cell;
34
use kernel::deferred_call::DeferredCall;
45
use kernel::hil::bus8080::{Bus8080, BusWidth, Client};

chips/stm32f4xx/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
#![crate_name = "stm32f4xx"]
66
#![crate_type = "rlib"]
77
#![feature(const_fn_trait_bound)]
8-
#![feature(asm)]
98
#![no_std]
109

1110
pub mod chip;

chips/swervolf-eh1/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! Drivers and chip support for SweRVolf.
22
3-
#![feature(asm, const_fn_trait_bound, naked_functions)]
3+
#![feature(const_fn_trait_bound, naked_functions)]
44
#![no_std]
55
#![crate_name = "swervolf_eh1"]
66
#![crate_type = "rlib"]

libraries/riscv-csr/src/csr.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
//! `ReadWriteRiscvCsr` type for RISC-V CSRs.
22
3+
use core::arch::asm;
34
use core::marker::PhantomData;
45

56
use tock_registers::fields::Field;

libraries/riscv-csr/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//!
33
//! Uses the Tock Register Interface to control RISC-V CSRs.
44
5-
#![feature(asm, asm_const)]
5+
#![feature(asm_const)]
66
#![feature(const_fn_trait_bound)]
77
#![no_std]
88

0 commit comments

Comments
 (0)