Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 11 additions & 33 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@ fdt = "0.1.5"
dirs = "5.0.1"
rand = "0.8.5"
ssh2 = { version = "0.9.4", features = ["vendored-openssl"] }
tempfile = "3.6.0"
tempfile = "3.7.0"
6 changes: 4 additions & 2 deletions src/efi/mod.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
// SPDX-License-Identifier: Apache-2.0
// Copyright © 2019 Intel Corporation

#[cfg(all(not(test), not(feature = "integration_tests")))]
use core::alloc as heap_alloc;

use core::{
alloc as heap_alloc,
ffi::c_void,
mem::{size_of, transmute},
ptr::null_mut,
Expand Down Expand Up @@ -65,7 +67,7 @@ pub static ALLOCATOR: AtomicRefCell<Allocator> = AtomicRefCell::new(Allocator::n
#[global_allocator]
pub static HEAP_ALLOCATOR: LockedHeap = LockedHeap::empty();

#[cfg(not(test))]
#[cfg(all(not(test), not(feature = "integration_tests")))]
#[alloc_error_handler]
fn heap_alloc_error_handler(layout: heap_alloc::Layout) -> ! {
panic!("heap allocation error: {:?}", layout);
Expand Down
21 changes: 17 additions & 4 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,27 @@
// Copyright © 2019 Intel Corporation

#![feature(asm_const)]
#![feature(alloc_error_handler)]
#![feature(slice_take)]
#![feature(stdsimd)]
#![feature(stmt_expr_attributes)]
#![cfg_attr(not(test), no_std)]
#![cfg_attr(not(test), no_main)]
#![cfg_attr(
all(not(test), not(feature = "integration_tests")),
feature(alloc_error_handler)
)]
#![cfg_attr(test, allow(unused_imports, dead_code))]
#![cfg_attr(not(feature = "log-serial"), allow(unused_variables, unused_imports))]

#[cfg(all(not(test), not(feature = "integration_tests")))]
use core::panic::PanicInfo;

#[cfg(target_arch = "x86_64")]
#[cfg(all(
not(test),
not(feature = "integration_tests"),
target_arch = "x86_64",
feature = "log-panic"
))]
use x86_64::instructions::hlt;

#[cfg(target_arch = "aarch64")]
Expand Down Expand Up @@ -60,7 +69,7 @@ mod uart_mmio;
mod uart_pl011;
mod virtio;

#[cfg(all(not(test), feature = "log-panic"))]
#[cfg(all(not(test), not(feature = "integration_tests"), feature = "log-panic"))]
#[panic_handler]
fn panic(info: &PanicInfo) -> ! {
log!("PANIC: {}", info);
Expand All @@ -70,7 +79,11 @@ fn panic(info: &PanicInfo) -> ! {
}
}

#[cfg(all(not(test), not(feature = "log-panic")))]
#[cfg(all(
not(test),
not(feature = "integration_tests"),
not(feature = "log-panic")
))]
#[panic_handler]
fn panic(_: &PanicInfo) -> ! {
loop {}
Expand Down