diff --git a/rust-toolchain.toml b/rust-toolchain.toml index ebae252ef5..1eeb12bbe0 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,5 +1,5 @@ [toolchain] -channel = "nightly-2023-12-01" +channel = "nightly-2023-12-15" components = [ "llvm-tools", "rust-src", diff --git a/src/drivers/virtio/transport/mmio.rs b/src/drivers/virtio/transport/mmio.rs index cb3465d98f..77152f4292 100644 --- a/src/drivers/virtio/transport/mmio.rs +++ b/src/drivers/virtio/transport/mmio.rs @@ -4,7 +4,6 @@ #![allow(dead_code)] use core::convert::TryInto; -use core::intrinsics::unaligned_volatile_store; use core::ptr::{read_volatile, write_volatile}; use core::result::Result; use core::sync::atomic::{fence, Ordering}; @@ -297,22 +296,16 @@ impl NotifCtrl { fence(Ordering::Acquire); if self.f_notif_data { - let ptr = self.notif_addr; + let ptr = self.notif_addr as *mut [u8; 4]; unsafe { - unaligned_volatile_store( - ptr, - u32::from_ne_bytes(notif_data[0..4].try_into().unwrap()), - ); + ptr.write_volatile(notif_data[0..4].try_into().unwrap()); } } else { - let ptr = self.notif_addr as *mut u16; + let ptr = self.notif_addr as *mut [u8; 2]; unsafe { - unaligned_volatile_store( - ptr, - u16::from_ne_bytes(notif_data[0..2].try_into().unwrap()), - ); + ptr.write_volatile(notif_data[0..2].try_into().unwrap()); } } diff --git a/src/drivers/virtio/transport/pci.rs b/src/drivers/virtio/transport/pci.rs index d581ef6a8b..03b4ad9a20 100644 --- a/src/drivers/virtio/transport/pci.rs +++ b/src/drivers/virtio/transport/pci.rs @@ -4,7 +4,6 @@ #![allow(dead_code)] use alloc::vec::Vec; -use core::intrinsics::unaligned_volatile_store; use core::result::Result; use core::sync::atomic::{fence, Ordering}; use core::{mem, ptr}; @@ -720,22 +719,16 @@ impl NotifCtrl { fence(Ordering::Acquire); if self.f_notif_data { - let ptr = self.notif_addr as *mut u32; + let ptr = self.notif_addr as *mut [u8; 4]; unsafe { - unaligned_volatile_store( - ptr, - u32::from_ne_bytes(notif_data[0..4].try_into().unwrap()), - ); + ptr.write_volatile(notif_data[0..4].try_into().unwrap()); } } else { - let ptr = self.notif_addr as *mut u16; + let ptr = self.notif_addr as *mut [u8; 2]; unsafe { - unaligned_volatile_store( - ptr, - u16::from_ne_bytes(notif_data[0..2].try_into().unwrap()), - ); + ptr.write_volatile(notif_data[0..2].try_into().unwrap()); } } diff --git a/src/lib.rs b/src/lib.rs index dae21bb324..2bda8c3e6b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -15,7 +15,7 @@ #![cfg_attr(target_arch = "riscv64", feature(offset_of))] #![feature(allocator_api)] #![feature(asm_const)] -#![feature(core_intrinsics)] +#![feature(exposed_provenance)] #![feature(linked_list_cursors)] #![feature(maybe_uninit_slice)] #![feature(naked_functions)]