Skip to content

Commit

Permalink
trivial: update rust, deps, fix lints
Browse files Browse the repository at this point in the history
Update Rust and dependencies and fix uncovered lints.

Signed-off-by: Dan Cross <cross@oxidecomputer.com>
  • Loading branch information
dancrossnyc committed Sep 5, 2024
1 parent ad496b5 commit c655766
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 25 deletions.
26 changes: 13 additions & 13 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 rust-toolchain
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[toolchain]
channel = "nightly-2024-03-19"
channel = "nightly-2024-09-04"
components = [ "rustfmt", "rust-src", "llvm-tools", "clippy", "miri" ]
2 changes: 1 addition & 1 deletion src/loader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<u64, Thunk>(elf.entry) })
}

/// Parses the ELF executable contained in the given byte slice.
Expand Down
9 changes: 4 additions & 5 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion src/mmu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<T>()) {
return Err(Error::BadPointer);
}
Expand Down
6 changes: 3 additions & 3 deletions src/uart.rs
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ impl Device {
}

fn reset<'a>(self) -> &'a mut ConfigMmio {
let regs = core::ptr::from_exposed_addr_mut::<ConfigMmio>(self.addr());
let regs = ptr::with_exposed_provenance_mut::<ConfigMmio>(self.addr());
let uart = unsafe { &mut *regs };
unsafe {
ptr::write_volatile(
Expand Down Expand Up @@ -472,7 +472,7 @@ impl Uart {
}

fn write_mmio_mut(&mut self) -> &mut MmioWrite {
let regs = core::ptr::from_exposed_addr_mut::<MmioWrite>(self.0.addr());
let regs = ptr::with_exposed_provenance_mut::<MmioWrite>(self.0.addr());
unsafe { &mut *regs }
}

Expand All @@ -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::<MmioRead>(self.0.addr());
let regs = ptr::with_exposed_provenance_mut::<MmioRead>(self.0.addr());
unsafe { &mut *regs }
}

Expand Down
2 changes: 1 addition & 1 deletion x86_64-oxide-none-elf.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit c655766

Please sign in to comment.