Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: update toolchain nightly-2024-05-15 #1208

Merged
merged 2 commits into from
May 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[toolchain]
channel = "nightly-2024-04-15"
channel = "nightly-2024-05-15"
components = [
"llvm-tools",
"rust-src",
Expand Down
2 changes: 1 addition & 1 deletion src/arch/aarch64/kernel/pci.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ impl ConfigRegionAccess for PciConfigRegion {
#[inline]
unsafe fn read(&self, pci_addr: PciAddress, offset: u16) -> u32 {
let ptr = core::ptr::with_exposed_provenance(self.addr_from_offset(pci_addr, offset));
unsafe { crate::drivers::pci::from_pci_endian(core::ptr::read_volatile(ptr)) }
unsafe { u32::from_le(core::ptr::read_volatile(ptr)) }
}

#[inline]
Expand Down
2 changes: 1 addition & 1 deletion src/arch/x86_64/kernel/pci.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ impl ConfigRegionAccess for PciConfigRegion {
| u32::from(register);
unsafe {
outl(PCI_CONFIG_ADDRESS_PORT, address);
crate::drivers::pci::from_pci_endian(inl(PCI_CONFIG_DATA_PORT))
u32::from_le(inl(PCI_CONFIG_DATA_PORT))
}
}

Expand Down
15 changes: 0 additions & 15 deletions src/drivers/pci.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,6 @@ use crate::drivers::virtio::transport::pci as pci_virtio;
))]
use crate::drivers::virtio::transport::pci::VirtioDriver;

/// Converts a given little endian coded u32 to native endian coded.
//
// INFO: As the endianness received from the device is little endian coded
// the given value must be swapped again on big endian machines. Which is done
// via the u32::to_le() method as the u32::to_be() would be a no-op in big endian
// machines. Resulting in no conversion.
#[inline]
pub(crate) fn from_pci_endian(val: u32) -> u32 {
if cfg!(target = "big_endian") {
val.to_le()
} else {
val
}
}

/// The module contains constants specific to PCI.
#[allow(dead_code)]
pub(crate) mod constants {
Expand Down