Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/audio audio(4): Use membar_acquire, not membar_enter.



details:   https://anonhg.NetBSD.org/src/rev/890ede4e6157
branches:  trunk
changeset: 365148:890ede4e6157
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sat Apr 09 23:35:58 2022 +0000

description:
audio(4): Use membar_acquire, not membar_enter.

Cheaper and adequate to make an atomic_swap into a load-acquire.

diffstat:

 sys/dev/audio/audio.c |  10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diffs (45 lines):

diff -r 8723dfea1c9f -r 890ede4e6157 sys/dev/audio/audio.c
--- a/sys/dev/audio/audio.c     Sat Apr 09 23:34:50 2022 +0000
+++ b/sys/dev/audio/audio.c     Sat Apr 09 23:35:58 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: audio.c,v 1.122 2022/03/31 19:30:15 pgoyette Exp $     */
+/*     $NetBSD: audio.c,v 1.123 2022/04/09 23:35:58 riastradh Exp $    */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -181,7 +181,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.122 2022/03/31 19:30:15 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.123 2022/04/09 23:35:58 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "audio.h"
@@ -316,7 +316,7 @@
        /* Nothing to do if already in use ? */
        if (atomic_swap_32(&mlog_inuse, 1) == 1)
                return;
-       membar_enter();
+       membar_acquire();
 
        int rpage = mlog_wpage;
        mlog_wpage ^= 1;
@@ -353,7 +353,7 @@
                mlog_drop++;
                return;
        }
-       membar_enter();
+       membar_acquire();
 
        va_start(ap, fmt);
        len = vsnprintf(
@@ -1684,7 +1684,7 @@
 
        if (atomic_swap_uint(&track->lock, 1) != 0)
                return false;
-       membar_enter();
+       membar_acquire();
        return true;
 }
 



Home | Main Index | Thread Index | Old Index