diff --git a/Cargo.lock b/Cargo.lock index b9e6613..333dda7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -51,9 +51,9 @@ dependencies = [ [[package]] name = "goblin" -version = "0.8.0" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb07a4ffed2093b118a525b1d8f5204ae274faed5604537caf7135d0f18d9887" +checksum = "1b363a30c165f666402fe6a3024d3bec7ebc898f96a4a23bd1c99f8dbf3f4f47" dependencies = [ "log", "plain", @@ -62,15 +62,15 @@ dependencies = [ [[package]] name = "log" -version = "0.4.21" +version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" +checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" [[package]] name = "miniz_oxide" -version = "0.7.2" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" +checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" dependencies = [ "adler", ] @@ -97,18 +97,18 @@ checksum = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6" [[package]] name = "proc-macro2" -version = "1.0.79" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e835ff2298f5721608eb1a980ecaee1aef2c132bf95ecc026a11b7bf3c01c02e" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.35" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" dependencies = [ "proc-macro2", ] @@ -139,7 +139,7 @@ checksum = "7f81c2fde025af7e69b1d1420531c8a8811ca898919db177141a85313b1cb932" dependencies = [ "proc-macro2", "quote", - "syn 2.0.53", + "syn 2.0.77", ] [[package]] @@ -167,9 +167,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.53" +version = "2.0.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7383cd0e49fff4b6b90ca5670bfd3e9d6a733b3f90c686605aa7eec8c4996032" +checksum = "9f35bcdf61fd8e7be6caf75f429fdca8beb3ed76584befb503b1569faee373ed" dependencies = [ "proc-macro2", "quote", diff --git a/rust-toolchain b/rust-toolchain index 2939fe8..bc30fed 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1,3 +1,3 @@ [toolchain] -channel = "nightly-2024-03-19" +channel = "nightly-2024-09-04" components = [ "rustfmt", "rust-src", "llvm-tools", "clippy", "miri" ] diff --git a/src/loader.rs b/src/loader.rs index 0b93ad0..505bfa7 100644 --- a/src/loader.rs +++ b/src/loader.rs @@ -35,7 +35,7 @@ pub(crate) fn load( } load_segment(page_table, section, &bytes[file_range])?; } - Ok(unsafe { core::mem::transmute::<_, Thunk>(elf.entry) }) + Ok(unsafe { core::mem::transmute::(elf.entry) }) } /// Parses the ELF executable contained in the given byte slice. diff --git a/src/main.rs b/src/main.rs index eff222a..9299fbb 100644 --- a/src/main.rs +++ b/src/main.rs @@ -2,11 +2,10 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at https://mozilla.org/MPL/2.0/. -#![feature(allocator_api, new_uninit)] -#![feature(asm_const)] +#![feature(allocator_api)] #![feature(exposed_provenance)] #![feature(naked_functions)] -#![feature(pointer_is_aligned)] +#![feature(pointer_is_aligned_to)] #![feature(strict_provenance)] #![feature(sync_unsafe_cell)] #![cfg_attr(not(any(test, clippy)), no_std)] @@ -51,9 +50,9 @@ fn expand_ramdisk() -> &'static [u8] { use miniz_oxide::inflate::core::DecompressorOxide; use miniz_oxide::inflate::TINFLStatus; - #[cfg(all(target_vendor = "oxide", target_os = "none"))] + #[cfg(target_os = "none")] let cpio = include_bytes!(env!("PHBL_PHASE1_COMPRESSED_CPIO_ARCHIVE_PATH")); - #[cfg(not(all(target_vendor = "oxide", target_os = "none")))] + #[cfg(not(target_os = "none"))] let cpio = [0u8; 1]; let dst = phbl::ramdisk_region_init_mut(); diff --git a/src/mmu.rs b/src/mmu.rs index 2300638..62e6caa 100644 --- a/src/mmu.rs +++ b/src/mmu.rs @@ -920,7 +920,7 @@ impl PageTable { if !self.is_mapped(va) { return Err(Error::BadPointer); } - let ptr = core::ptr::from_exposed_addr_mut::<()>(va); + let ptr = core::ptr::with_exposed_provenance_mut::<()>(va); if !ptr.is_aligned_to(core::mem::align_of::()) { return Err(Error::BadPointer); } diff --git a/src/uart.rs b/src/uart.rs index 615e073..859273a 100644 --- a/src/uart.rs +++ b/src/uart.rs @@ -443,7 +443,7 @@ impl Device { } fn reset<'a>(self) -> &'a mut ConfigMmio { - let regs = core::ptr::from_exposed_addr_mut::(self.addr()); + let regs = ptr::with_exposed_provenance_mut::(self.addr()); let uart = unsafe { &mut *regs }; unsafe { ptr::write_volatile( @@ -472,7 +472,7 @@ impl Uart { } fn write_mmio_mut(&mut self) -> &mut MmioWrite { - let regs = core::ptr::from_exposed_addr_mut::(self.0.addr()); + let regs = ptr::with_exposed_provenance_mut::(self.0.addr()); unsafe { &mut *regs } } @@ -481,7 +481,7 @@ impl Uart { // it is mutually exclusive with a write MMIO structure, // as the two share the same register space. fn read_mmio_mut(&mut self) -> &mut MmioRead { - let regs = core::ptr::from_exposed_addr_mut::(self.0.addr()); + let regs = ptr::with_exposed_provenance_mut::(self.0.addr()); unsafe { &mut *regs } } diff --git a/x86_64-oxide-none-elf.json b/x86_64-oxide-none-elf.json index dec29f3..cd766c4 100644 --- a/x86_64-oxide-none-elf.json +++ b/x86_64-oxide-none-elf.json @@ -13,7 +13,7 @@ "code-model": "small", "frame-pointer": "always", "disable-redzone": true, - "features": "-3dnow,-3dnowa,-avx,-avx2,-avx512bf16,-f16c,-fxsr,-mmx,-sse,-sse2,-sse3,-sse4.1,-sse4.2,-sse4a,-ssse3,-x87,-soft-float", + "features": "-avx,-avx2,-avx512bf16,-f16c,-fxsr,-mmx,-sse,-sse2,-sse3,-sse4.1,-sse4.2,-sse4a,-ssse3,-x87,-soft-float", "linker-flavor": "ld", "linker": "gld", "no-default-libraries": "true",