Move Io/Pio/Mmio from redox_syscall to common

* Fix Mmio repr from transparent to packed.
* Rename Mmio::from to Mmio::new.
* Remove dead imports around affected code.
* Minor formatting.
This commit is contained in:
Kamil Koczurek
2024-09-27 23:31:03 +02:00
parent ea5ccbc84d
commit d2c82add9d
50 changed files with 421 additions and 59 deletions
+1 -1
View File
@@ -6,7 +6,7 @@ use std::sync::{Arc, Mutex};
use std::{fmt, mem};
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
use syscall::io::{Io, Pio};
use common::io::{Io, Pio};
use parking_lot::{RwLock, RwLockReadGuard, RwLockWriteGuard};
use thiserror::Error;
+1 -1
View File
@@ -1,6 +1,6 @@
use std::ops::{Deref, DerefMut};
use syscall::io::Mmio;
use common::io::Mmio;
// TODO: Only wrap with Mmio where there are hardware-registers. (Some of these structs seem to be
// ring buffer entries, which are not to be treated the same way).
+1 -1
View File
@@ -10,7 +10,7 @@ use std::convert::TryFrom;
use std::ops::Deref;
use std::{fmt, mem};
use syscall::io::Io as _;
use common::io::Io as _;
use num_derive::FromPrimitive;
use num_traits::FromPrimitive;
+2 -1
View File
@@ -3,7 +3,8 @@ use rustc_hash::FxHashMap;
use std::fmt::LowerHex;
use std::mem::size_of;
use std::sync::{Arc, Mutex};
use syscall::{Io, Pio, PAGE_SIZE};
use syscall::PAGE_SIZE;
use common::io::{Io, Pio};
const PAGE_MASK: usize = !(PAGE_SIZE - 1);
const OFFSET_MASK: usize = PAGE_SIZE - 1;