Switch to llvm_asm! to avoid future breakage

pull/54/head
Andre Richter 4 years ago
parent e26ed0ffde
commit 82f97c000b
No known key found for this signature in database
GPG Key ID: 2116C1AB102F615E

@ -16,7 +16,11 @@ global_asm!(include_str!("cpu.S"));
pub fn wait_forever() -> ! {
unsafe {
loop {
asm!("wfe" :::: "volatile")
llvm_asm!("wfe"
: // outputs
: // inputs
: // clobbers
: "volatile") // options
}
}
}

@ -92,8 +92,8 @@
//! - `crate::memory::*`
//! - `crate::bsp::memory::*`
#![feature(asm)]
#![feature(global_asm)]
#![feature(llvm_asm)]
#![no_main]
#![no_std]

@ -16,7 +16,11 @@ global_asm!(include_str!("cpu.S"));
pub fn wait_forever() -> ! {
unsafe {
loop {
asm!("wfe" :::: "volatile")
llvm_asm!("wfe"
: // outputs
: // inputs
: // clobbers
: "volatile") // options
}
}
}

@ -92,8 +92,8 @@
//! - `crate::memory::*`
//! - `crate::bsp::memory::*`
#![feature(asm)]
#![feature(global_asm)]
#![feature(llvm_asm)]
#![no_main]
#![no_std]

@ -139,12 +139,13 @@ 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
@@ -93,7 +93,9 @@
@@ -92,8 +92,10 @@
//! - `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]

@ -16,7 +16,11 @@ global_asm!(include_str!("cpu.S"));
pub fn wait_forever() -> ! {
unsafe {
loop {
asm!("wfe" :::: "volatile")
llvm_asm!("wfe"
: // outputs
: // inputs
: // clobbers
: "volatile") // options
}
}
}

@ -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]

@ -94,13 +94,17 @@ diff -uNr 03_hacky_hello_world/src/_arch/aarch64/cpu.rs 04_zero_overhead_abstrac
//--------------------------------------------------------------------------------------------------
// Public Code
@@ -14,9 +40,7 @@
@@ -14,13 +40,7 @@
/// Pause execution on the core.
#[inline(always)]
pub fn wait_forever() -> ! {
- unsafe {
- loop {
- asm!("wfe" :::: "volatile")
- llvm_asm!("wfe"
- : // outputs
- : // inputs
- : // clobbers
- : "volatile") // options
- }
+ loop {
+ asm::wfe()
@ -190,13 +194,12 @@ 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
@@ -92,9 +92,8 @@
//! - `crate::memory::*`
@@ -93,8 +93,7 @@
//! - `crate::bsp::memory::*`
-#![feature(asm)]
#![feature(format_args_nl)]
-#![feature(global_asm)]
-#![feature(llvm_asm)]
+#![feature(naked_functions)]
#![feature(panic_info_message)]
#![no_main]

@ -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() {
+ asm!("msr DAIFClr, $0"
+ : // outputs
+ : "i"(daif_bits::IRQ) // inputs
+ : // clobbers
+ : "volatile" // options
+ llvm_asm!("msr DAIFClr, $0"
+ : // outputs
+ : "i"(daif_bits::IRQ) // inputs
+ : // clobbers
+ : "volatile" // options
+ );
+}
+
@ -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() {
+ asm!("msr DAIFSet, $0"
+ : // outputs
+ : "i"(daif_bits::IRQ) // inputs
+ : // clobbers
+ : "volatile" // options
+ llvm_asm!("msr DAIFSet, $0"
+ : // outputs
+ : "i"(daif_bits::IRQ) // inputs
+ : // clobbers
+ : "volatile" // options
+ );
+}
+
@ -2568,11 +2568,10 @@ 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,8 +112,12 @@
@@ -107,11 +112,15 @@
//! - `crate::bsp::memory::*`
#![allow(incomplete_features)]
+#![feature(asm)]
+#![feature(const_fn)]
#![feature(const_generics)]
-#![feature(custom_inner_attributes)]
@ -2582,6 +2581,10 @@ 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;

@ -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() {
asm!("msr DAIFClr, $0"
: // outputs
: "i"(daif_bits::IRQ) // inputs
: // clobbers
: "volatile" // options
llvm_asm!("msr DAIFClr, $0"
: // outputs
: "i"(daif_bits::IRQ) // inputs
: // clobbers
: "volatile" // options
);
}
@ -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() {
asm!("msr DAIFSet, $0"
: // outputs
: "i"(daif_bits::IRQ) // inputs
: // clobbers
: "volatile" // options
llvm_asm!("msr DAIFSet, $0"
: // outputs
: "i"(daif_bits::IRQ) // inputs
: // clobbers
: "volatile" // options
);
}

@ -112,7 +112,6 @@
//! - `crate::bsp::memory::*`
#![allow(incomplete_features)]
#![feature(asm)]
#![feature(const_fn)]
#![feature(const_generics)]
#![feature(const_if_match)]
@ -121,6 +120,7 @@
#![feature(format_args_nl)]
#![feature(global_asm)]
#![feature(linkage)]
#![feature(llvm_asm)]
#![feature(naked_functions)]
#![feature(panic_info_message)]
#![feature(slice_ptr_range)]

Loading…
Cancel
Save