mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-15 08:30:02 +00:00
add functions necessary to create a compatibility shim
We don't have Arc in machine mode (no-std), but we want to be able to run our USB driver in machine mode for fast debugging of certain problems. Add some thunks that allow us to do some slightly unholy things which facilitate such debug access.
This commit is contained in:
parent
519ae31485
commit
ed42ee0be7
1 changed files with 4 additions and 0 deletions
|
|
@ -619,6 +619,7 @@ impl Field {
|
|||
}
|
||||
pub const fn offset(&self) -> usize { self.offset }
|
||||
pub const fn mask(&self) -> usize { self.mask }
|
||||
pub const fn register(&self) -> Register { self.register }
|
||||
}
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct CSR<T> {
|
||||
|
|
@ -733,6 +734,9 @@ where
|
|||
base: Arc::new(AtomicPtr::new(base))
|
||||
}
|
||||
}
|
||||
pub unsafe fn base(&self) -> *mut T {
|
||||
self.base.load(core::sync::atomic::Ordering::SeqCst) as *mut T
|
||||
}
|
||||
pub fn clone(&self) -> Self {
|
||||
AtomicCsr {
|
||||
base: self.base.clone()
|
||||
|
|
|
|||
Loading…
Reference in a new issue