Sync computers

This commit is contained in:
2026-03-09 17:53:06 +01:00
parent 9baa77a678
commit c2e5e2f715
6 changed files with 179 additions and 37 deletions

12
src/volatile.rs Normal file
View File

@@ -0,0 +1,12 @@
#[repr(transparent)]
#[derive(Debug, Clone, Copy)]
pub struct Volatile<T>(T);
impl<T> Volatile<T> {
pub unsafe fn read(self: *const Self) -> T {
unsafe { core::ptr::read_volatile(self as *const T) }
}
pub unsafe fn write(self: *mut Self, value: T) {
unsafe { core::ptr::write_volatile(self as *mut T, value) }
}
}