diff --git a/Dockerfile b/Dockerfile index 444c2135c3..8f98948b5d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,7 +5,7 @@ ENV RUSTUP_HOME=/usr/local/rustup \ CARGO_HOME=/usr/local/cargo \ PATH=/usr/local/cargo/bin:$PATH \ # Manually sync this with rust-toolchain.toml! - RUST_VERSION=nightly-2022-10-19 \ + RUST_VERSION=nightly-2022-12-12 \ RUST_COMPONENTS="llvm-tools-preview rust-src" \ RUST_TARGETS="x86_64-unknown-none" diff --git a/hermit-builtins/Cargo.lock b/hermit-builtins/Cargo.lock index d3206ff981..73bb25b65f 100644 --- a/hermit-builtins/Cargo.lock +++ b/hermit-builtins/Cargo.lock @@ -2,15 +2,6 @@ # It is not intended for manual editing. version = 3 -[[package]] -name = "compiler_builtins" -version = "0.1.75" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6e3183e88f659a862835db8f4b67dbeed3d93e44dd4927eef78edb1c149d784" - [[package]] name = "hermit-builtins" version = "0.1.0" -dependencies = [ - "compiler_builtins", -] diff --git a/hermit-builtins/Cargo.toml b/hermit-builtins/Cargo.toml index fae1d30cf1..00ca106718 100644 --- a/hermit-builtins/Cargo.toml +++ b/hermit-builtins/Cargo.toml @@ -5,6 +5,3 @@ edition = "2021" [lib] crate-type = ["staticlib"] - -[dependencies] -mem-builtins = { package = "compiler_builtins", version = "0.1", features = ["mem"] } diff --git a/hermit-builtins/src/lib.rs b/hermit-builtins/src/lib.rs index 9146370452..378f3c68f1 100644 --- a/hermit-builtins/src/lib.rs +++ b/hermit-builtins/src/lib.rs @@ -1,7 +1,5 @@ #![no_std] -use mem_builtins as _; - #[panic_handler] fn panic(_info: &core::panic::PanicInfo) -> ! { loop {} diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 245b2a0421..334cf1f48b 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,6 +1,6 @@ [toolchain] # Manually sync this with Dockerfile! -channel = "nightly-2022-10-19" +channel = "nightly-2022-12-12" components = [ "llvm-tools-preview", "rust-src", diff --git a/src/arch/x86_64/kernel/acpi.rs b/src/arch/x86_64/kernel/acpi.rs index ae10eb0755..9dca319567 100644 --- a/src/arch/x86_64/kernel/acpi.rs +++ b/src/arch/x86_64/kernel/acpi.rs @@ -423,8 +423,7 @@ fn parse_fadt(fadt: AcpiTable<'_>) { ); assert!( verify_checksum(dsdt.header_start_address(), dsdt.header.length as usize).is_ok(), - "DSDT at {:#X} has invalid checksum", - dsdt_address + "DSDT at {dsdt_address:#X} has invalid checksum" ); // Try to find the "_S5_" object for SLP_TYPA in the DSDT AML bytecode. @@ -503,8 +502,7 @@ pub fn init() { // Check and save the entire APIC table for the get_apic_table() call. assert!( verify_checksum(table.header_start_address(), table.header.length as usize).is_ok(), - "MADT at {:#X} has invalid checksum", - table_physical_address + "MADT at {table_physical_address:#X} has invalid checksum" ); unsafe { MADT = Some(table); @@ -514,15 +512,13 @@ pub fn init() { // Check and parse this table for the poweroff() call. assert!( verify_checksum(table.header_start_address(), table.header.length as usize).is_ok(), - "FADT at {:#X} has invalid checksum", - table_physical_address + "FADT at {table_physical_address:#X} has invalid checksum" ); parse_fadt(table); } else if table.header.signature() == "SSDT" { assert!( verify_checksum(table.header_start_address(), table.header.length as usize).is_ok(), - "SSDT at {:#X} has invalid checksum", - table_physical_address + "SSDT at {table_physical_address:#X} has invalid checksum" ); parse_ssdt(table); } diff --git a/src/arch/x86_64/kernel/pci.rs b/src/arch/x86_64/kernel/pci.rs index 9c3b1fd4fa..39bf2b72c7 100644 --- a/src/arch/x86_64/kernel/pci.rs +++ b/src/arch/x86_64/kernel/pci.rs @@ -373,7 +373,7 @@ impl fmt::Display for PciBar { PciBar::IO(io_bar) => ("IOBar", io_bar.addr as usize, io_bar.size), PciBar::Memory(mem_bar) => ("MemoryBar", mem_bar.addr, mem_bar.size), }; - write!(f, "{}: {:#x} (size {:#x})", typ, addr, size)?; + write!(f, "{typ}: {addr:#x} (size {size:#x})")?; Ok(()) } @@ -422,7 +422,7 @@ impl fmt::Display for PciAdapter { } for pci_bar in &self.base_addresses { - write!(f, ", {}", pci_bar)?; + write!(f, ", {pci_bar}")?; } Ok(()) diff --git a/src/arch/x86_64/mm/physicalmem.rs b/src/arch/x86_64/mm/physicalmem.rs index 1f6518af63..d433e956a5 100644 --- a/src/arch/x86_64/mm/physicalmem.rs +++ b/src/arch/x86_64/mm/physicalmem.rs @@ -131,9 +131,7 @@ pub fn allocate_aligned(size: usize, alignment: usize) -> Result Result= PhysAddr(mm::kernel_end_address().as_u64()), - "Physical address {:#X} is not >= KERNEL_END_ADDRESS", - physical_address + "Physical address {physical_address:#X} is not >= KERNEL_END_ADDRESS" ); assert!(size > 0); assert_eq!( diff --git a/src/arch/x86_64/mm/virtualmem.rs b/src/arch/x86_64/mm/virtualmem.rs index e45a2a617d..56db39b164 100644 --- a/src/arch/x86_64/mm/virtualmem.rs +++ b/src/arch/x86_64/mm/virtualmem.rs @@ -44,9 +44,7 @@ pub fn allocate_aligned(size: usize, alignment: usize) -> Result Result= VirtAddr(mm::kernel_end_address().as_u64()), - "Virtual address {:#X} is not >= KERNEL_END_ADDRESS", - virtual_address + "Virtual address {virtual_address:#X} is not >= KERNEL_END_ADDRESS" ); assert!( virtual_address < kernel_heap_end(), - "Virtual address {:#X} is not < kernel_heap_end()", - virtual_address + "Virtual address {virtual_address:#X} is not < kernel_heap_end()" ); assert_eq!( virtual_address % BasePageSize::SIZE, diff --git a/src/drivers/mod.rs b/src/drivers/mod.rs index 099cb8d742..e02734823f 100644 --- a/src/drivers/mod.rs +++ b/src/drivers/mod.rs @@ -41,11 +41,11 @@ pub mod error { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match *self { DriverError::InitVirtioDevFail(ref err) => { - write!(f, "Virtio driver failed: {:?}", err) + write!(f, "Virtio driver failed: {err:?}") } #[cfg(feature = "pci")] DriverError::InitRTL8139DevFail(ref err) => { - write!(f, "RTL8139 driver failed: {:?}", err) + write!(f, "RTL8139 driver failed: {err:?}") } } } diff --git a/src/drivers/virtio/mod.rs b/src/drivers/virtio/mod.rs index 3e33254dfe..89386eb4d2 100644 --- a/src/drivers/virtio/mod.rs +++ b/src/drivers/virtio/mod.rs @@ -29,20 +29,20 @@ pub mod error { VirtioError::Unknown => write!(f, "Driver failed to initialize virtio device due to unknown reasosn!"), #[cfg(feature = "pci")] VirtioError::FromPci(pci_error) => match pci_error { - PciError::General(id) => write!(f, "Driver failed to initialize device with id: {:#x}. Due to unknown reasosn!", id), - PciError::NoBar(id ) => write!(f, "Driver failed to initialize device with id: {:#x}. Reason: No BAR's found.", id), - PciError::NoCapPtr(id) => write!(f, "Driver failed to initialize device with id: {:#x}. Reason: No Capabilities pointer found.", id), - PciError::BadCapPtr(id) => write!(f, "Driver failed to initialize device with id: {:#x}. Reason: Malformed Capabilities pointer.", id), - PciError::NoVirtioCaps(id) => write!(f, "Driver failed to initialize device with id: {:#x}. Reason: No Virtio capabilities were found.", id), + PciError::General(id) => write!(f, "Driver failed to initialize device with id: {id:#x}. Due to unknown reasosn!"), + PciError::NoBar(id ) => write!(f, "Driver failed to initialize device with id: {id:#x}. Reason: No BAR's found."), + PciError::NoCapPtr(id) => write!(f, "Driver failed to initialize device with id: {id:#x}. Reason: No Capabilities pointer found."), + PciError::BadCapPtr(id) => write!(f, "Driver failed to initialize device with id: {id:#x}. Reason: Malformed Capabilities pointer."), + PciError::NoVirtioCaps(id) => write!(f, "Driver failed to initialize device with id: {id:#x}. Reason: No Virtio capabilities were found."), }, - VirtioError::DevNotSupported(id) => write!(f, "Device with id {:#x} not supported.", id), + VirtioError::DevNotSupported(id) => write!(f, "Device with id {id:#x} not supported."), VirtioError::NetDriver(net_error) => match net_error { VirtioNetError::General => write!(f, "Virtio network driver failed due to unknown reasons!"), - VirtioNetError::NoDevCfg(id) => write!(f, "Network driver failed, for device {:x}, due to a missing or malformed device config!", id), - VirtioNetError::NoComCfg(id) => write!(f, "Network driver failed, for device {:x}, due to a missing or malformed common config!", id), - VirtioNetError::NoIsrCfg(id) => write!(f, "Network driver failed, for device {:x}, due to a missing or malformed ISR status config!", id), - VirtioNetError::NoNotifCfg(id) => write!(f, "Network driver failed, for device {:x}, due to a missing or malformed notification config!", id), - VirtioNetError::FailFeatureNeg(id) => write!(f, "Network driver failed, for device {:x}, device did not acknowledge negotiated feature set!", id), + VirtioNetError::NoDevCfg(id) => write!(f, "Network driver failed, for device {id:x}, due to a missing or malformed device config!"), + VirtioNetError::NoComCfg(id) => write!(f, "Network driver failed, for device {id:x}, due to a missing or malformed common config!"), + VirtioNetError::NoIsrCfg(id) => write!(f, "Network driver failed, for device {id:x}, due to a missing or malformed ISR status config!"), + VirtioNetError::NoNotifCfg(id) => write!(f, "Network driver failed, for device {id:x}, due to a missing or malformed notification config!"), + VirtioNetError::FailFeatureNeg(id) => write!(f, "Network driver failed, for device {id:x}, device did not acknowledge negotiated feature set!"), VirtioNetError::FeatReqNotMet(feats) => write!(f, "Network driver tried to set feature bit without setting dependency feature. Feat set: {:x}", u64::from(*feats)), VirtioNetError::IncompFeatsSet(drv_feats, dev_feats) => write!(f, "Feature set: {:x} , is incompatible with the device features: {:x}", u64::from(*drv_feats), u64::from(*dev_feats)), VirtioNetError::ProcessOngoing => write!(f, "Driver performed an unsuitable operation upon an ongoging transfer."), diff --git a/xtask/src/arch.rs b/xtask/src/arch.rs index 55ba65c5a0..01e07ed547 100644 --- a/xtask/src/arch.rs +++ b/xtask/src/arch.rs @@ -32,8 +32,16 @@ impl Arch { pub fn builtins_cargo_args(&self) -> &'static [&'static str] { match self { - Arch::X86_64 => &["--target=x86_64-unknown-hermit", "-Zbuild-std=core"], - Arch::AArch64 => &["--target=aarch64-unknown-hermit", "-Zbuild-std=core"], + Arch::X86_64 => &[ + "--target=x86_64-unknown-hermit", + "-Zbuild-std=core", + "-Zbuild-std-features=compiler-builtins-mem", + ], + Arch::AArch64 => &[ + "--target=aarch64-unknown-hermit", + "-Zbuild-std=core", + "-Zbuild-std-features=compiler-builtins-mem", + ], } } diff --git a/xtask/src/archive.rs b/xtask/src/archive.rs index a55dce542a..38aa57c84a 100644 --- a/xtask/src/archive.rs +++ b/xtask/src/archive.rs @@ -50,7 +50,7 @@ impl Archive { .collect::(); let rename_path = archive.with_extension("redefine-syms"); - sh.write_file(&rename_path, &symbol_renames)?; + sh.write_file(&rename_path, symbol_renames)?; let objcopy = binutil("objcopy")?; cmd!(sh, "{objcopy} --prefix-symbols={prefix}_ {archive}").run()?;