mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-08 21:06:48 +00:00
Adjust for Rust unstable feature's stability change
This commit is contained in:
parent
5c524348de
commit
ab1d931cb7
@ -69,20 +69,23 @@ impl PciDeviceLocation {
|
||||
|
||||
/// Returns an iterator that enumerates all possible PCI device locations.
|
||||
pub fn all() -> impl Iterator<Item = PciDeviceLocation> {
|
||||
iter::from_coroutine(|| {
|
||||
for bus in Self::MIN_BUS..=Self::MAX_BUS {
|
||||
for device in Self::MIN_DEVICE..=Self::MAX_DEVICE {
|
||||
for function in Self::MIN_FUNCTION..=Self::MAX_FUNCTION {
|
||||
let loc = PciDeviceLocation {
|
||||
bus,
|
||||
device,
|
||||
function,
|
||||
};
|
||||
yield loc;
|
||||
iter::from_coroutine(
|
||||
#[coroutine]
|
||||
|| {
|
||||
for bus in Self::MIN_BUS..=Self::MAX_BUS {
|
||||
for device in Self::MIN_DEVICE..=Self::MAX_DEVICE {
|
||||
for function in Self::MIN_FUNCTION..=Self::MAX_FUNCTION {
|
||||
let loc = PciDeviceLocation {
|
||||
bus,
|
||||
device,
|
||||
function,
|
||||
};
|
||||
yield loc;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
/// The page table of all devices is the same. So we can use any device ID.
|
||||
|
@ -15,7 +15,6 @@
|
||||
#![feature(panic_info_message)]
|
||||
#![feature(ptr_sub_ptr)]
|
||||
#![feature(strict_provenance)]
|
||||
#![feature(pointer_is_aligned)]
|
||||
// The `generic_const_exprs` feature is incomplete however required for the page table
|
||||
// const generic implementation. We are using this feature in a conservative manner.
|
||||
#![allow(incomplete_features)]
|
||||
|
@ -30,7 +30,7 @@ use unwinding::{
|
||||
#[export_name = "__aster_panic_handler"]
|
||||
pub fn panic_handler(info: &core::panic::PanicInfo) -> ! {
|
||||
let throw_info = ktest::PanicInfo {
|
||||
message: info.message().unwrap().to_string(),
|
||||
message: info.message().to_string(),
|
||||
file: info.location().unwrap().file().to_string(),
|
||||
line: info.location().unwrap().line() as usize,
|
||||
col: info.location().unwrap().column() as usize,
|
||||
|
@ -8,7 +8,6 @@
|
||||
//! currently not needed by Asterinas.
|
||||
//!
|
||||
|
||||
#![feature(offset_of)]
|
||||
#![cfg_attr(not(test), no_std)]
|
||||
|
||||
/// Magic stored in the boot protocol header.
|
||||
|
@ -5,5 +5,5 @@ rustflags = [
|
||||
"-Ctarget-feature=+crt-static",
|
||||
"-Zplt=yes",
|
||||
"-Zrelax-elf-relocations=yes",
|
||||
"-Zrelro-level=full",
|
||||
"-Crelro-level=full",
|
||||
]
|
||||
|
@ -7,7 +7,6 @@
|
||||
#![feature(btree_cursors)]
|
||||
#![feature(btree_extract_if)]
|
||||
#![feature(const_option)]
|
||||
#![feature(exclusive_range_pattern)]
|
||||
#![feature(extend_one)]
|
||||
#![feature(fn_traits)]
|
||||
#![feature(format_args_nl)]
|
||||
@ -21,6 +20,7 @@
|
||||
#![feature(specialization)]
|
||||
#![feature(step_trait)]
|
||||
#![feature(trait_alias)]
|
||||
#![feature(trait_upcasting)]
|
||||
#![register_tool(component_access_control)]
|
||||
|
||||
use aster_frame::{
|
||||
|
@ -30,6 +30,7 @@
|
||||
#![deny(unsafe_code)]
|
||||
#![feature(fn_traits)]
|
||||
#![feature(step_trait)]
|
||||
#![feature(trait_upcasting)]
|
||||
#![allow(dead_code)]
|
||||
|
||||
extern crate alloc;
|
||||
|
@ -153,7 +153,7 @@ fn install_setup_with_arch(
|
||||
let target_dir = std::fs::canonicalize(target_dir).unwrap();
|
||||
|
||||
let mut cmd = Command::new("cargo");
|
||||
cmd.env("RUSTFLAGS", "-Ccode-model=kernel -Crelocation-model=pie -Ctarget-feature=+crt-static -Zplt=yes -Zrelax-elf-relocations=yes -Zrelro-level=full");
|
||||
cmd.env("RUSTFLAGS", "-Ccode-model=kernel -Crelocation-model=pie -Ctarget-feature=+crt-static -Zplt=yes -Zrelax-elf-relocations=yes -Crelro-level=full");
|
||||
cmd.arg("install").arg("linux-bzimage-setup");
|
||||
cmd.arg("--force");
|
||||
cmd.arg("--root").arg(install_dir.as_ref());
|
||||
|
@ -205,7 +205,7 @@ fn build_kernel_elf(
|
||||
&env_rustflags,
|
||||
&rustc_linker_script_arg,
|
||||
"-C relocation-model=static",
|
||||
"-Z relro-level=off",
|
||||
"-C relro-level=off",
|
||||
// We do not really allow unwinding except for kernel testing. However, we need to specify
|
||||
// this to show backtraces when panicking.
|
||||
"-C panic=unwind",
|
||||
|
Loading…
x
Reference in New Issue
Block a user