diff options
Diffstat (limited to 'rust/kernel/sync/atomic')
| -rw-r--r-- | rust/kernel/sync/atomic/internal.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/rust/kernel/sync/atomic/internal.rs b/rust/kernel/sync/atomic/internal.rs index e301db4eaf91..b762dbdf6d18 100644 --- a/rust/kernel/sync/atomic/internal.rs +++ b/rust/kernel/sync/atomic/internal.rs @@ -340,5 +340,10 @@ declare_and_impl_atomic_methods!( // SAFETY: `a.as_ptr()` is valid and properly aligned. unsafe { bindings::#call(v, a.as_ptr().cast()) } } + + fn fetch_sub[acquire, release, relaxed](a: &AtomicRepr<Self>, v: Self::Delta) -> Self { + // SAFETY: `a.as_ptr()` guarantees the returned pointer is valid and properly aligned. + unsafe { bindings::#call(v, a.as_ptr().cast()) } + } } ); |
