diff --git a/01_wait_forever/src/_arch/aarch64/cpu.rs b/01_wait_forever/src/_arch/aarch64/cpu.rs index a444de6d..1d3e871a 100644 --- a/01_wait_forever/src/_arch/aarch64/cpu.rs +++ b/01_wait_forever/src/_arch/aarch64/cpu.rs @@ -16,11 +16,11 @@ global_asm!(include_str!("cpu.S")); pub fn wait_forever() -> ! { unsafe { loop { - llvm_asm!("wfe" - : // outputs - : // inputs - : // clobbers - : "volatile") // options + #[rustfmt::skip] + asm!( + "wfe", + options(nomem, nostack, preserves_flags) + ); } } } diff --git a/01_wait_forever/src/main.rs b/01_wait_forever/src/main.rs index e642e31f..28b68b59 100644 --- a/01_wait_forever/src/main.rs +++ b/01_wait_forever/src/main.rs @@ -92,8 +92,8 @@ //! - `crate::memory::*` //! - `crate::bsp::memory::*` +#![feature(asm)] #![feature(global_asm)] -#![feature(llvm_asm)] #![no_main] #![no_std] diff --git a/02_runtime_init/src/_arch/aarch64/cpu.rs b/02_runtime_init/src/_arch/aarch64/cpu.rs index a444de6d..1d3e871a 100644 --- a/02_runtime_init/src/_arch/aarch64/cpu.rs +++ b/02_runtime_init/src/_arch/aarch64/cpu.rs @@ -16,11 +16,11 @@ global_asm!(include_str!("cpu.S")); pub fn wait_forever() -> ! { unsafe { loop { - llvm_asm!("wfe" - : // outputs - : // inputs - : // clobbers - : "volatile") // options + #[rustfmt::skip] + asm!( + "wfe", + options(nomem, nostack, preserves_flags) + ); } } } diff --git a/02_runtime_init/src/main.rs b/02_runtime_init/src/main.rs index dc9d7b24..336824a1 100644 --- a/02_runtime_init/src/main.rs +++ b/02_runtime_init/src/main.rs @@ -92,8 +92,8 @@ //! - `crate::memory::*` //! - `crate::bsp::memory::*` +#![feature(asm)] #![feature(global_asm)] -#![feature(llvm_asm)] #![no_main] #![no_std] diff --git a/03_hacky_hello_world/README.md b/03_hacky_hello_world/README.md index 86d69c59..bd08943e 100644 --- a/03_hacky_hello_world/README.md +++ b/03_hacky_hello_world/README.md @@ -139,13 +139,12 @@ diff -uNr 02_runtime_init/src/console.rs 03_hacky_hello_world/src/console.rs diff -uNr 02_runtime_init/src/main.rs 03_hacky_hello_world/src/main.rs --- 02_runtime_init/src/main.rs +++ 03_hacky_hello_world/src/main.rs -@@ -92,8 +92,10 @@ - //! - `crate::memory::*` +@@ -93,7 +93,9 @@ //! - `crate::bsp::memory::*` + #![feature(asm)] +#![feature(format_args_nl)] #![feature(global_asm)] - #![feature(llvm_asm)] +#![feature(panic_info_message)] #![no_main] #![no_std] diff --git a/03_hacky_hello_world/src/_arch/aarch64/cpu.rs b/03_hacky_hello_world/src/_arch/aarch64/cpu.rs index a444de6d..1d3e871a 100644 --- a/03_hacky_hello_world/src/_arch/aarch64/cpu.rs +++ b/03_hacky_hello_world/src/_arch/aarch64/cpu.rs @@ -16,11 +16,11 @@ global_asm!(include_str!("cpu.S")); pub fn wait_forever() -> ! { unsafe { loop { - llvm_asm!("wfe" - : // outputs - : // inputs - : // clobbers - : "volatile") // options + #[rustfmt::skip] + asm!( + "wfe", + options(nomem, nostack, preserves_flags) + ); } } } diff --git a/03_hacky_hello_world/src/main.rs b/03_hacky_hello_world/src/main.rs index 945e3604..8b6f4b25 100644 --- a/03_hacky_hello_world/src/main.rs +++ b/03_hacky_hello_world/src/main.rs @@ -92,9 +92,9 @@ //! - `crate::memory::*` //! - `crate::bsp::memory::*` +#![feature(asm)] #![feature(format_args_nl)] #![feature(global_asm)] -#![feature(llvm_asm)] #![feature(panic_info_message)] #![no_main] #![no_std] diff --git a/04_zero_overhead_abstraction/README.md b/04_zero_overhead_abstraction/README.md index d912bc8b..781f0a2f 100644 --- a/04_zero_overhead_abstraction/README.md +++ b/04_zero_overhead_abstraction/README.md @@ -100,11 +100,11 @@ diff -uNr 03_hacky_hello_world/src/_arch/aarch64/cpu.rs 04_zero_overhead_abstrac pub fn wait_forever() -> ! { - unsafe { - loop { -- llvm_asm!("wfe" -- : // outputs -- : // inputs -- : // clobbers -- : "volatile") // options +- #[rustfmt::skip] +- asm!( +- "wfe", +- options(nomem, nostack, preserves_flags) +- ); - } + loop { + asm::wfe() @@ -194,12 +194,13 @@ diff -uNr 03_hacky_hello_world/src/cpu.rs 04_zero_overhead_abstraction/src/cpu.r diff -uNr 03_hacky_hello_world/src/main.rs 04_zero_overhead_abstraction/src/main.rs --- 03_hacky_hello_world/src/main.rs +++ 04_zero_overhead_abstraction/src/main.rs -@@ -93,8 +93,7 @@ +@@ -92,9 +92,8 @@ + //! - `crate::memory::*` //! - `crate::bsp::memory::*` +-#![feature(asm)] #![feature(format_args_nl)] -#![feature(global_asm)] --#![feature(llvm_asm)] +#![feature(naked_functions)] #![feature(panic_info_message)] #![no_main] diff --git a/14_exceptions_part2_peripheral_IRQs/README.md b/14_exceptions_part2_peripheral_IRQs/README.md index 37bffaf3..82c6ad43 100644 --- a/14_exceptions_part2_peripheral_IRQs/README.md +++ b/14_exceptions_part2_peripheral_IRQs/README.md @@ -826,11 +826,11 @@ diff -uNr 13_integrated_testing/src/_arch/aarch64/exception/asynchronous.rs 14_e +/// - Changes the HW state of the executing core. +#[inline(always)] +pub unsafe fn local_irq_unmask() { -+ llvm_asm!("msr DAIFClr, $0" -+ : // outputs -+ : "i"(daif_bits::IRQ) // inputs -+ : // clobbers -+ : "volatile" // options ++ #[rustfmt::skip] ++ asm!( ++ "msr DAIFClr, {arg}", ++ arg = const daif_bits::IRQ, ++ options(nomem, nostack, preserves_flags) + ); +} + @@ -841,11 +841,11 @@ diff -uNr 13_integrated_testing/src/_arch/aarch64/exception/asynchronous.rs 14_e +/// - Changes the HW state of the executing core. +#[inline(always)] +pub unsafe fn local_irq_mask() { -+ llvm_asm!("msr DAIFSet, $0" -+ : // outputs -+ : "i"(daif_bits::IRQ) // inputs -+ : // clobbers -+ : "volatile" // options ++ #[rustfmt::skip] ++ asm!( ++ "msr DAIFSet, {arg}", ++ arg = const daif_bits::IRQ, ++ options(nomem, nostack, preserves_flags) + ); +} + @@ -2568,10 +2568,11 @@ diff -uNr 13_integrated_testing/src/lib.rs 14_exceptions_part2_peripheral_IRQs/s //! [timer interface]: ../libkernel/time/interface/trait.TimeManager.html //! //! # Code organization and architecture -@@ -107,11 +112,15 @@ +@@ -107,8 +112,12 @@ //! - `crate::bsp::memory::*` #![allow(incomplete_features)] ++#![feature(asm)] +#![feature(const_fn)] #![feature(const_generics)] -#![feature(custom_inner_attributes)] @@ -2581,10 +2582,6 @@ diff -uNr 13_integrated_testing/src/lib.rs 14_exceptions_part2_peripheral_IRQs/s #![feature(format_args_nl)] #![feature(global_asm)] #![feature(linkage)] -+#![feature(llvm_asm)] - #![feature(naked_functions)] - #![feature(panic_info_message)] - #![feature(slice_ptr_range)] @@ -137,6 +146,7 @@ pub mod exception; pub mod memory; diff --git a/14_exceptions_part2_peripheral_IRQs/src/_arch/aarch64/exception/asynchronous.rs b/14_exceptions_part2_peripheral_IRQs/src/_arch/aarch64/exception/asynchronous.rs index b5b307af..f09a92e6 100644 --- a/14_exceptions_part2_peripheral_IRQs/src/_arch/aarch64/exception/asynchronous.rs +++ b/14_exceptions_part2_peripheral_IRQs/src/_arch/aarch64/exception/asynchronous.rs @@ -77,11 +77,11 @@ pub fn is_local_irq_masked() -> bool { /// - Changes the HW state of the executing core. #[inline(always)] pub unsafe fn local_irq_unmask() { - llvm_asm!("msr DAIFClr, $0" - : // outputs - : "i"(daif_bits::IRQ) // inputs - : // clobbers - : "volatile" // options + #[rustfmt::skip] + asm!( + "msr DAIFClr, {arg}", + arg = const daif_bits::IRQ, + options(nomem, nostack, preserves_flags) ); } @@ -92,11 +92,11 @@ pub unsafe fn local_irq_unmask() { /// - Changes the HW state of the executing core. #[inline(always)] pub unsafe fn local_irq_mask() { - llvm_asm!("msr DAIFSet, $0" - : // outputs - : "i"(daif_bits::IRQ) // inputs - : // clobbers - : "volatile" // options + #[rustfmt::skip] + asm!( + "msr DAIFSet, {arg}", + arg = const daif_bits::IRQ, + options(nomem, nostack, preserves_flags) ); } diff --git a/14_exceptions_part2_peripheral_IRQs/src/lib.rs b/14_exceptions_part2_peripheral_IRQs/src/lib.rs index 5a2785f6..c6a431c3 100644 --- a/14_exceptions_part2_peripheral_IRQs/src/lib.rs +++ b/14_exceptions_part2_peripheral_IRQs/src/lib.rs @@ -112,6 +112,7 @@ //! - `crate::bsp::memory::*` #![allow(incomplete_features)] +#![feature(asm)] #![feature(const_fn)] #![feature(const_generics)] #![feature(const_if_match)] @@ -120,7 +121,6 @@ #![feature(format_args_nl)] #![feature(global_asm)] #![feature(linkage)] -#![feature(llvm_asm)] #![feature(naked_functions)] #![feature(panic_info_message)] #![feature(slice_ptr_range)] diff --git a/X1_JTAG_boot/jtag_boot_rpi3.img b/X1_JTAG_boot/jtag_boot_rpi3.img index f39f1e48..dc756ac7 100755 Binary files a/X1_JTAG_boot/jtag_boot_rpi3.img and b/X1_JTAG_boot/jtag_boot_rpi3.img differ diff --git a/X1_JTAG_boot/jtag_boot_rpi4.img b/X1_JTAG_boot/jtag_boot_rpi4.img index d5e8d1a7..4388f0d2 100755 Binary files a/X1_JTAG_boot/jtag_boot_rpi4.img and b/X1_JTAG_boot/jtag_boot_rpi4.img differ