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/common/utils/sal_user_process.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 /**
    5  *****************************************************************************
    6  * @file sal_user_process.c
    7  *
    8  * @ingroup SalUserProcess
    9  *
   10  * @description
   11  *    This file contains implementation of functions to set/get user process
   12  *    name
   13  *
   14  *****************************************************************************/
   15 
   16 #include "qat_utils.h"
   17 #include "lac_common.h"
   18 static char lacProcessName[LAC_USER_PROCESS_NAME_MAX_LEN + 1] =
   19     LAC_KERNEL_PROCESS_NAME;
   20 
   21 /**< Process name used to obtain values from correct section of config file. */
   22 
   23 /*
   24  * @ingroup LacCommon
   25  * @description
   26  *      This function sets the process name
   27  *
   28  * @context
   29  *      This functions is called from module_init or from user space process
   30  *      initialisation function
   31  *
   32  * @assumptions
   33  *      None
   34  * @sideEffects
   35  *      None
   36  * @reentrant
   37  *      No
   38  * @threadSafe
   39  *      No
   40  *
   41  * param[in]  processName    Process name to be set
   42 */
   43 CpaStatus
   44 icpSetProcessName(const char *processName)
   45 {
   46         LAC_CHECK_NULL_PARAM(processName);
   47 
   48         if (strnlen(processName, LAC_USER_PROCESS_NAME_MAX_LEN) ==
   49             LAC_USER_PROCESS_NAME_MAX_LEN) {
   50                 QAT_UTILS_LOG(
   51                     "Process name too long, maximum process name is %d>\n",
   52                     LAC_USER_PROCESS_NAME_MAX_LEN);
   53                 return CPA_STATUS_FAIL;
   54         }
   55 
   56         strncpy(lacProcessName, processName, LAC_USER_PROCESS_NAME_MAX_LEN);
   57         lacProcessName[LAC_USER_PROCESS_NAME_MAX_LEN] = '\0';
   58 
   59         return CPA_STATUS_SUCCESS;
   60 }
   61 
   62 /*
   63  * @ingroup LacCommon
   64  * @description
   65  *      This function gets the process name
   66  *
   67  * @context
   68  *      This functions is called from LAC context
   69  *
   70  * @assumptions
   71  *      None
   72  * @sideEffects
   73  *      None
   74  * @reentrant
   75  *      No
   76  * @threadSafe
   77  *      Yes
   78  *
   79 */
   80 char *
   81 icpGetProcessName(void)
   82 {
   83         return lacProcessName;
   84 }

Cache object: 3b5ee266458e43e72b3224f86072905f


[ 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.