The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/dev/qat/qat_api/qat_utils/src/QatUtilsSpinLock.c

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 /* SPDX-License-Identifier: BSD-3-Clause */
    2 /* Copyright(c) 2007-2022 Intel Corporation */
    3 /* $FreeBSD$ */
    4 #include "qat_utils.h"
    5 #include <sys/sx.h>
    6 
    7 CpaStatus
    8 qatUtilsLockInit(struct mtx *pLock)
    9 {
   10         if (!pLock)
   11                 return CPA_STATUS_FAIL;
   12         memset(pLock, 0, sizeof(*pLock));
   13         mtx_init(pLock, "qat spin", NULL, MTX_DEF | MTX_DUPOK);
   14 
   15         return CPA_STATUS_SUCCESS;
   16 }
   17 
   18 CpaStatus
   19 qatUtilsLock(struct mtx *pLock)
   20 {
   21         if (!pLock)
   22                 return CPA_STATUS_FAIL;
   23         mtx_lock(pLock);
   24 
   25         return CPA_STATUS_SUCCESS;
   26 }
   27 
   28 CpaStatus
   29 qatUtilsUnlock(struct mtx *pLock)
   30 {
   31         if (!pLock)
   32                 return CPA_STATUS_FAIL;
   33         mtx_unlock(pLock);
   34 
   35         return CPA_STATUS_SUCCESS;
   36 }
   37 
   38 CpaStatus
   39 qatUtilsLockDestroy(struct mtx *pLock)
   40 {
   41         if (!pLock)
   42                 return CPA_STATUS_FAIL;
   43         mtx_destroy(pLock);
   44         return CPA_STATUS_SUCCESS;
   45 }

Cache object: 451d23de6d72618c7e4673dcfa9fc814


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.