cachepc-linux

Fork of AMDESE/linux with modifications for CachePC side-channel attack
git clone https://git.sinitax.com/sinitax/cachepc-linux
Log | Files | Refs | README | LICENSE | sfeed.txt

seq_lock.h (612B)


      1/* SPDX-License-Identifier: GPL-2.0 */
      2#ifndef __SND_SEQ_LOCK_H
      3#define __SND_SEQ_LOCK_H
      4
      5#include <linux/sched.h>
      6
      7typedef atomic_t snd_use_lock_t;
      8
      9/* initialize lock */
     10#define snd_use_lock_init(lockp) atomic_set(lockp, 0)
     11
     12/* increment lock */
     13#define snd_use_lock_use(lockp) atomic_inc(lockp)
     14
     15/* release lock */
     16#define snd_use_lock_free(lockp) atomic_dec(lockp)
     17
     18/* wait until all locks are released */
     19void snd_use_lock_sync_helper(snd_use_lock_t *lock, const char *file, int line);
     20#define snd_use_lock_sync(lockp) snd_use_lock_sync_helper(lockp, __BASE_FILE__, __LINE__)
     21
     22#endif /* __SND_SEQ_LOCK_H */