diff options
| author | riastradh <riastradh@NetBSD.org> | 2022-04-09 23:43:30 +0000 |
|---|---|---|
| committer | riastradh <riastradh@NetBSD.org> | 2022-04-09 23:43:30 +0000 |
| commit | 8b2342bfe2d0a4d1ef8a0b84e6ceec876e32fcf0 (patch) | |
| tree | 06116e54c49a48f0449fd32a094719511f2aa57b /sys/external/bsd/common/linux | |
| parent | 526b97c4a04ce1f136cea3b14be05ca65274bdf6 (diff) | |
linux: Convert various API shims to use membar_release/acquire.
Diffstat (limited to 'sys/external/bsd/common/linux')
| -rw-r--r-- | sys/external/bsd/common/linux/linux_tasklet.c | 32 | ||||
| -rw-r--r-- | sys/external/bsd/common/linux/linux_work.c | 8 |
2 files changed, 20 insertions, 20 deletions
diff --git a/sys/external/bsd/common/linux/linux_tasklet.c b/sys/external/bsd/common/linux/linux_tasklet.c index 5288a01c154..310ce3469d5 100644 --- a/sys/external/bsd/common/linux/linux_tasklet.c +++ b/sys/external/bsd/common/linux/linux_tasklet.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux_tasklet.c,v 1.10 2021/12/27 14:57:30 riastradh Exp $ */ +/* $NetBSD: linux_tasklet.c,v 1.11 2022/04/09 23:43:31 riastradh Exp $ */ /*- * Copyright (c) 2018, 2020, 2021 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: linux_tasklet.c,v 1.10 2021/12/27 14:57:30 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_tasklet.c,v 1.11 2022/04/09 23:43:31 riastradh Exp $"); #include <sys/param.h> #include <sys/types.h> @@ -245,7 +245,7 @@ tasklet_softintr(void *cookie) /* * Check whether it's currently disabled. * - * Pairs with membar_exit in __tasklet_enable. + * Pairs with membar_release in __tasklet_enable. */ if (atomic_load_acquire(&tasklet->tl_disablecount)) { /* @@ -394,9 +394,9 @@ tasklet_disable_nosync(struct tasklet_struct *tasklet) KASSERT(disablecount < UINT_MAX); KASSERT(disablecount != 0); - /* Pairs with membar_exit in __tasklet_enable. */ + /* Pairs with membar_release in __tasklet_enable. */ #ifndef __HAVE_ATOMIC_AS_MEMBAR - membar_enter(); + membar_acquire(); #endif } @@ -514,9 +514,9 @@ tasklet_trylock(struct tasklet_struct *tasklet) } while (atomic_cas_uint(&tasklet->tl_state, state, state | TASKLET_RUNNING) != state); - /* Pairs with membar_exit in tasklet_unlock. */ + /* Pairs with membar_release in tasklet_unlock. */ #ifndef __HAVE_ATOMIC_AS_MEMBAR - membar_enter(); + membar_acquire(); #endif return true; @@ -536,11 +536,11 @@ tasklet_unlock(struct tasklet_struct *tasklet) KASSERT(atomic_load_relaxed(&tasklet->tl_state) & TASKLET_RUNNING); /* - * Pairs with membar_enter in tasklet_trylock and with + * Pairs with membar_acquire in tasklet_trylock and with * atomic_load_acquire in tasklet_unlock_wait. */ #ifndef __HAVE_ATOMIC_AS_MEMBAR - membar_exit(); + membar_release(); #endif atomic_and_uint(&tasklet->tl_state, ~TASKLET_RUNNING); } @@ -556,7 +556,7 @@ void tasklet_unlock_wait(const struct tasklet_struct *tasklet) { - /* Pairs with membar_exit in tasklet_unlock. */ + /* Pairs with membar_release in tasklet_unlock. */ while (atomic_load_acquire(&tasklet->tl_state) & TASKLET_RUNNING) SPINLOCK_BACKOFF_HOOK; } @@ -589,9 +589,9 @@ __tasklet_disable_sync_once(struct tasklet_struct *tasklet) KASSERT(disablecount < UINT_MAX); KASSERT(disablecount != 0); - /* Pairs with membar_exit in __tasklet_enable_sync_once. */ + /* Pairs with membar_release in __tasklet_enable_sync_once. */ #ifndef __HAVE_ATOMIC_AS_MEMBAR - membar_enter(); + membar_acquire(); #endif /* @@ -613,9 +613,9 @@ __tasklet_enable_sync_once(struct tasklet_struct *tasklet) { unsigned int disablecount; - /* Pairs with membar_enter in __tasklet_disable_sync_once. */ + /* Pairs with membar_acquire in __tasklet_disable_sync_once. */ #ifndef __HAVE_ATOMIC_AS_MEMBAR - membar_exit(); + membar_release(); #endif /* Decrement the disable count. */ @@ -681,10 +681,10 @@ __tasklet_enable(struct tasklet_struct *tasklet) * decrementing the disable count. * * Pairs with atomic_load_acquire in tasklet_softintr and with - * membar_enter in tasklet_disable. + * membar_acquire in tasklet_disable. */ #ifndef __HAVE_ATOMIC_AS_MEMBAR - membar_exit(); + membar_release(); #endif /* Decrement the disable count. */ diff --git a/sys/external/bsd/common/linux/linux_work.c b/sys/external/bsd/common/linux/linux_work.c index 978dd4c1e78..0a9ab98c15f 100644 --- a/sys/external/bsd/common/linux/linux_work.c +++ b/sys/external/bsd/common/linux/linux_work.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux_work.c,v 1.60 2021/12/31 14:30:20 riastradh Exp $ */ +/* $NetBSD: linux_work.c,v 1.61 2022/04/09 23:43:31 riastradh Exp $ */ /*- * Copyright (c) 2018 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: linux_work.c,v 1.60 2021/12/31 14:30:20 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_work.c,v 1.61 2022/04/09 23:43:31 riastradh Exp $"); #include <sys/types.h> #include <sys/atomic.h> @@ -639,7 +639,7 @@ acquire_work(struct work_struct *work, struct workqueue_struct *wq) owner0); KASSERT(work_queue(work) == wq); - membar_enter(); + membar_acquire(); SDT_PROBE2(sdt, linux, work, acquire, work, wq); return true; } @@ -660,7 +660,7 @@ release_work(struct work_struct *work, struct workqueue_struct *wq) KASSERT(mutex_owned(&wq->wq_lock)); SDT_PROBE2(sdt, linux, work, release, work, wq); - membar_exit(); + membar_release(); /* * Non-interlocked r/m/w is safe here because nobody else can |
