From c0311ff917b7dee932cd5918df0ef557bcf8145a Mon Sep 17 00:00:00 2001 From: Nicholas Bishop Date: Thu, 16 Dec 2021 12:22:09 -0500 Subject: [PATCH] Fix compilation errors on nightly related to asm Add `use core::arch::asm` in a couple places, and add a temporary override of the qemu-exit dep to point at a branch with the asm fix. Partially fixes https://github.com/rust-osdev/uefi-rs/issues/329 (but keep it open until qemu-exit can be switched back to a normal release.) --- Cargo.toml | 2 ++ uefi-services/src/lib.rs | 6 +++--- uefi-test-runner/src/main.rs | 1 - 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index d46c3296..7bc0e5d4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -46,6 +46,8 @@ members = [ ] [patch.crates-io] +# TODO: workaround for https://github.com/rust-osdev/uefi-rs/issues/329 +qemu-exit = { git = "https://github.com/toku-sa-n/qemu-exit.git", rev = "7279783c309423168398394682faa93ff81cdd31" } uefi-macros = { path = "uefi-macros" } uefi = { path = "." } diff --git a/uefi-services/src/lib.rs b/uefi-services/src/lib.rs index e21305c3..d988b3c1 100644 --- a/uefi-services/src/lib.rs +++ b/uefi-services/src/lib.rs @@ -18,7 +18,6 @@ #![no_std] #![feature(alloc_error_handler)] -#![feature(asm)] #![feature(lang_items)] #![feature(panic_info_message)] #![feature(abi_efiapi)] @@ -28,6 +27,7 @@ extern crate log; // Core types. extern crate uefi; +use core::arch::asm; use core::ffi::c_void; use core::ptr::NonNull; @@ -187,14 +187,14 @@ fn panic_handler(info: &core::panic::PanicInfo) -> ! { loop { unsafe { // Try to at least keep CPU from running at 100% - core::arch::asm!("hlt", options(nomem, nostack)); + asm!("hlt", options(nomem, nostack)); } } } else if #[cfg(target_arch = "aarch64")] { loop { unsafe { // Try to at least keep CPU from running at 100% - core::arch::asm!("hlt 420", options(nomem, nostack)); + asm!("hlt 420", options(nomem, nostack)); } } } else { diff --git a/uefi-test-runner/src/main.rs b/uefi-test-runner/src/main.rs index 45b21e19..bc9bcb75 100644 --- a/uefi-test-runner/src/main.rs +++ b/uefi-test-runner/src/main.rs @@ -1,6 +1,5 @@ #![no_std] #![no_main] -#![feature(asm)] #![feature(abi_efiapi)] #[macro_use]