* Fix endianness
* Remove ITS affinity and numa
This commit is contained in:
+2
-15
@@ -76,12 +76,8 @@ impl<'a> Iterator for SratIter<'a> {
|
||||
assert!(entry_len as usize == size_of::<GiccAffinity>() + 2);
|
||||
*(entry.add(2) as *const GiccAffinity)
|
||||
}),
|
||||
4 => SratEntry::GicItsAffinity(unsafe {
|
||||
assert!(entry_len as usize == size_of::<GicItsAffinity>() + 2);
|
||||
*(entry.add(2) as *const GicItsAffinity)
|
||||
}),
|
||||
// ignore Generic Initiator Affinity
|
||||
5 => {
|
||||
// ignore ITS Affinity and Generic Initiator Affinity
|
||||
4 | 5 => {
|
||||
self.i += entry_len as u32;
|
||||
continue;
|
||||
}
|
||||
@@ -100,7 +96,6 @@ pub enum SratEntry {
|
||||
MemoryAffinity(MemoryAffinity),
|
||||
ProcessorLocalAffinity(ProcessorLocalAffinity),
|
||||
GiccAffinity(GiccAffinity),
|
||||
GicItsAffinity(GicItsAffinity),
|
||||
Unknown(u8), // unimplemented: Generic Initiator Affinity; our current focus is only on memory and cpus
|
||||
}
|
||||
|
||||
@@ -147,11 +142,3 @@ struct GiccAffinity {
|
||||
flags: u32,
|
||||
clock_domain: u32,
|
||||
}
|
||||
|
||||
#[repr(C, packed)]
|
||||
#[derive(Clone, Copy, Debug)]
|
||||
struct GicItsAffinity {
|
||||
proximity_domain: u32,
|
||||
_reserved: u16,
|
||||
its_domain: u32,
|
||||
}
|
||||
|
||||
@@ -13,9 +13,9 @@ fn to_usize(low: u32, high: u32) -> usize {
|
||||
#[cfg(target_pointer_width = "64")]
|
||||
{
|
||||
let mut low_and_high = [0u8; 8];
|
||||
low_and_high[0..=3].copy_from_slice(low.to_ne_bytes().as_slice());
|
||||
low_and_high[4..=7].copy_from_slice(high.to_ne_bytes().as_slice());
|
||||
usize::from_ne_bytes(low_and_high)
|
||||
low_and_high[0..=3].copy_from_slice(low.to_le_bytes().as_slice());
|
||||
low_and_high[4..=7].copy_from_slice(high.to_le_bytes().as_slice());
|
||||
usize::from_le_bytes(low_and_high)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ fn to_single_int(high: &[u8; 3], low: u8) -> u32 {
|
||||
let mut high_and_low = [0u8; 4];
|
||||
high_and_low[0] = low;
|
||||
(high_and_low[1], high_and_low[2], high_and_low[3]) = (high[0], high[1], high[2]);
|
||||
u32::from_ne_bytes(high_and_low)
|
||||
u32::from_le_bytes(high_and_low)
|
||||
}
|
||||
|
||||
pub fn init_srat(srat: &Srat) {
|
||||
|
||||
@@ -50,8 +50,6 @@ pub struct PercpuBlock {
|
||||
pub misc_arch_info: crate::arch::device::ArchPercpuMisc,
|
||||
|
||||
pub stats: CpuStats,
|
||||
|
||||
pub numa_node: Option<Weak<NumaNode>>,
|
||||
}
|
||||
|
||||
static ALL_PERCPU_BLOCKS: [AtomicPtr<PercpuBlock>; MAX_CPU_COUNT as usize] =
|
||||
@@ -204,8 +202,6 @@ impl PercpuBlock {
|
||||
misc_arch_info: ArchPercpuMisc::default(),
|
||||
|
||||
stats: CpuStats::default(),
|
||||
|
||||
numa_node: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user