Skip to content
Merged
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
26 changes: 1 addition & 25 deletions tool/microkit/src/sdf/pci.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@
// SPDX-License-Identifier: BSD-2-Clause
//

use std::cmp::Ordering;
use std::fmt;
use std::ops::Deref;

use sel4_capdl_initializer_types::object;

use super::util::ParseableAttribute;

#[derive(Debug, Clone, Copy, PartialEq, Eq)]
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
pub struct PciDevice(pub object::PCIDevice);

impl Deref for PciDevice {
Expand All @@ -23,29 +22,6 @@ impl Deref for PciDevice {
}
}

// This should be removed once https://github.com/seL4/rust-sel4/pull/374 is merged
impl Ord for PciDevice {
fn cmp(&self, other: &Self) -> Ordering {
let object::PCIDevice {
bus,
device,
function,
} = &self.0;
let object::PCIDevice {
bus: other_bus,
device: other_device,
function: other_function,
} = &other.0;
(bus, device, function).cmp(&(other_bus, other_device, other_function))
}
}

impl PartialOrd for PciDevice {
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
Some(self.cmp(other))
}
}

impl From<PciDevice> for object::PCIDevice {
fn from(device: PciDevice) -> Self {
device.0
Expand Down
Loading