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.)
This commit is contained in:
Nicholas Bishop 2021-12-16 12:22:09 -05:00 committed by Nicholas Bishop
parent ceb55f2600
commit c0311ff917
3 changed files with 5 additions and 4 deletions

View file

@ -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 = "." }

View file

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

View file

@ -1,6 +1,5 @@
#![no_std]
#![no_main]
#![feature(asm)]
#![feature(abi_efiapi)]
#[macro_use]