-
Notifications
You must be signed in to change notification settings - Fork 53
Open
Description
What we have done
Now we have two kinds of SpinLock from R4L
See
RROS/rust/kernel/sync/lock/spinlock.rs
Lines 100 to 101 in a39ff9d
| #[cfg(not(CONFIG_RROS))] | |
| pub type SpinLock<T> = super::Lock<T, SpinLockBackend>; |
and
RROS/rust/kernel/sync/lock/spinlock.rs
Lines 179 to 188 in a39ff9d
| #[cfg(CONFIG_RROS)] | |
| pub struct SpinLock<T: ?Sized> { | |
| spin_lock: Opaque<bindings::spinlock>, | |
| /// Spinlocks are architecture-defined. So we conservatively require them to be pinned in case | |
| /// some architecture uses self-references now or in the future. | |
| _pin: PhantomPinned, | |
| data: UnsafeCell<T>, | |
| } |
What we should do next
There are some difference between them, including:
- How to init a SpinLock
- How to use a
GuardfromSpinLock::lock()
Note: The two are not only different in API, but also in design. These differences need to be paid attention to during the porting process.
We should use the stable SpinLock and remove the unstable SpinLock
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
In Progress