mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-22 17:25:35 +03:00
Use SPDX license GPL-V2.0 format and change Nvidia copyright year to include 2023. Bug 4078035 Change-Id: Icc0060431eb8d9c470a44f4cee50913cc1d8048a Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2890656 Reviewed-by: svcacv <svcacv@nvidia.com> Reviewed-by: Arun Swain <arswain@nvidia.com> GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
63 lines
1.2 KiB
C
63 lines
1.2 KiB
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
/*
|
|
* Copyright (c) 2019-2023, NVIDIA CORPORATION. All rights reserved.
|
|
*/
|
|
|
|
#ifndef DCE_LOCK_H
|
|
#define DCE_LOCK_H
|
|
|
|
struct dce_mutex {
|
|
struct mutex mutex;
|
|
};
|
|
|
|
/**
|
|
* dce_mutex_init - Initialize dce_mutex in Linux style
|
|
*
|
|
* mutex : pointer to the mutext to be initialized.
|
|
*
|
|
* Return : 0 if successful
|
|
*/
|
|
static inline int dce_mutex_init(struct dce_mutex *mutex)
|
|
{
|
|
mutex_init(&mutex->mutex);
|
|
return 0;
|
|
};
|
|
|
|
/**
|
|
* dce_mutex_lock - Acquire the dce_mutex in Linux style
|
|
*
|
|
* mutex : pointer to the mutext to be acquired.
|
|
*
|
|
* Return : void
|
|
*/
|
|
static inline void dce_mutex_lock(struct dce_mutex *mutex)
|
|
{
|
|
mutex_lock(&mutex->mutex);
|
|
};
|
|
|
|
/**
|
|
* dce_mutex_unlock - Release the dce_mutex in Linux style
|
|
*
|
|
* mutex : pointer to the mutext to be released.
|
|
*
|
|
* Return : void
|
|
*/
|
|
static inline void dce_mutex_unlock(struct dce_mutex *mutex)
|
|
{
|
|
mutex_unlock(&mutex->mutex);
|
|
};
|
|
|
|
/**
|
|
* dce_mutex_destroy - Destroy the dce_mutex in Linux style
|
|
*
|
|
* mutex : pointer to the mutext to be destroyed.
|
|
*
|
|
* Return : 0 if successful
|
|
*/
|
|
static inline void dce_mutex_destroy(struct dce_mutex *mutex)
|
|
{
|
|
mutex_destroy(&mutex->mutex);
|
|
};
|
|
|
|
#endif
|