Skip to content

Feat Request: Port RROS kernel onto SpinLock of Linux 6.6.23 #63

@shannmu

Description

@shannmu

What we have done

Now we have two kinds of SpinLock from R4L
See

#[cfg(not(CONFIG_RROS))]
pub type SpinLock<T> = super::Lock<T, SpinLockBackend>;

and
#[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 Guard from SpinLock::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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

In Progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions