diff options
Diffstat (limited to 'sys/dev/vmware/vmci/vmci_kernel_if.c')
| -rw-r--r-- | sys/dev/vmware/vmci/vmci_kernel_if.c | 48 |
1 files changed, 47 insertions, 1 deletions
diff --git a/sys/dev/vmware/vmci/vmci_kernel_if.c b/sys/dev/vmware/vmci/vmci_kernel_if.c index e845650873b5..de54a8d1ca4f 100644 --- a/sys/dev/vmware/vmci/vmci_kernel_if.c +++ b/sys/dev/vmware/vmci/vmci_kernel_if.c @@ -70,7 +70,8 @@ void vmci_cleanup_lock(vmci_lock *lock) { - mtx_destroy(lock); + if mtx_initialized(lock) + mtx_destroy(lock); } /* @@ -168,6 +169,29 @@ vmci_release_lock_bh(vmci_lock *lock) /* *------------------------------------------------------------------------------ * + * vmci_initialized_lock + * + * Returns whether a lock has been initialized. + * + * Results: + * Return 1 if initialized or 0 if unininitialized. + * + * Side effects: + * None + * + *------------------------------------------------------------------------------ + */ + +int +vmci_initialized_lock(vmci_lock *lock) +{ + + return mtx_initialized(lock); +} + +/* + *------------------------------------------------------------------------------ + * * vmci_alloc_kernel_mem * * Allocate physically contiguous memory for the VMCI driver. @@ -449,6 +473,28 @@ vmci_mutex_release(vmci_mutex *mutex) /* *------------------------------------------------------------------------------ * + * vmci_mutex_initialized + * + * Returns whether a mutex has been initialized. + * + * Results: + * Return 1 if initialized or 0 if unininitialized. + * + * Side effects: + * None + * + *------------------------------------------------------------------------------ + */ + +int +vmci_mutex_initialized(vmci_mutex *mutex) +{ + + return mtx_initialized(mutex); +} +/* + *------------------------------------------------------------------------------ + * * vmci_alloc_queue -- * * Allocates kernel queue pages of specified size with IOMMU mappings, plus |
