mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-23 01:50:07 +03:00
gpu: nvgpu: unit: SWUTS for interface.lock
Add SWUTS documentation for the interface.lock unit. JIRA NVGPU-3943 Change-Id: I705755482ee98217dc5015a42fea6f13ba852a61 Signed-off-by: Nicolas Benech <nbenech@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/2207311 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
Alex Waterman
parent
b7066e0bf1
commit
bac3b84a7b
@@ -32,9 +32,7 @@
|
||||
#include <pthread.h>
|
||||
#include <semaphore.h>
|
||||
|
||||
#define TYPE_MUTEX 0
|
||||
#define TYPE_SPINLOCK 1
|
||||
#define TYPE_RAW_SPINLOCK 2
|
||||
#include "lock.h"
|
||||
|
||||
/* Parameter structure to pass to worker threads */
|
||||
struct worker_parameters {
|
||||
@@ -47,11 +45,7 @@ struct worker_parameters {
|
||||
sem_t worker_sem;
|
||||
bool test_shared_flag;
|
||||
|
||||
/*
|
||||
* Simple test to check mutex init routine
|
||||
*/
|
||||
static int test_mutex_init(struct unit_module *m, struct gk20a *g,
|
||||
void *args)
|
||||
int test_mutex_init(struct unit_module *m, struct gk20a *g, void *args)
|
||||
{
|
||||
struct nvgpu_mutex mutex;
|
||||
|
||||
@@ -61,11 +55,7 @@ static int test_mutex_init(struct unit_module *m, struct gk20a *g,
|
||||
return UNIT_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
* Test to verify the behavior of mutex tryacquire function.
|
||||
*/
|
||||
static int test_mutex_tryacquire(struct unit_module *m, struct gk20a *g,
|
||||
void *args)
|
||||
int test_mutex_tryacquire(struct unit_module *m, struct gk20a *g, void *args)
|
||||
{
|
||||
struct nvgpu_mutex mutex;
|
||||
int status;
|
||||
@@ -154,7 +144,7 @@ static void *lock_worker(void *args)
|
||||
* release functions.
|
||||
* The "args" argument is an int indicating the lock type.
|
||||
*/
|
||||
static int test_lock_acquire_release(struct unit_module *m, struct gk20a *g,
|
||||
int test_lock_acquire_release(struct unit_module *m, struct gk20a *g,
|
||||
void *args)
|
||||
{
|
||||
struct nvgpu_mutex mutex;
|
||||
|
||||
Reference in New Issue
Block a user