You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

52 lines
1.4 KiB

/*
* Copyright (c) Hisilicon Technologies Co., Ltd. 2021-2022. All rights reserved.
* Description: OS Abstract Layer.
* Author: Hisilicon
* Create: 2021-12-16
*/
#ifndef __OSAL_DEF_H__
#define __OSAL_DEF_H__
#ifdef __KERNEL__
#include <linux/module.h>
#endif
#ifdef __cplusplus
#if __cplusplus
extern "C" {
#endif
#endif
#ifdef __KERNEL__
#define OSAL_THIS_MODULE THIS_MODULE
#define osal_module_export(_symbol) EXPORT_SYMBOL(_symbol)
#define osal_module_param(name, type, perm) module_param(name, type, perm)
#define OSAL_MODULE_PARM_DESC(_parm, desc) MODULE_PARM_DESC(_perm, desc)
#define osal_module_init(x) module_init(x)
#define osal_module_exit(x) module_exit(x)
#define OSAL_MODULE_AUTHOR(_author) MODULE_AUTHOR(_author)
#define OSAL_MODULE_DESCRIPTION(_description) MODULE_DESCRIPTION(_description)
#define OSAL_MODULE_LICENSE(_license) MODULE_LICENSE(_license)
#define OSAL_MODULE_VERSION(_version) MODULE_VERSION(_version)
#else
#define OSAL_THIS_MODULE
#define osal_module_export(_symbol)
#define osal_module_param(name, type, perm)
#define OSAL_MODULE_PARM_DESC(_parm, desc)
#define osal_module_init(x)
#define osal_module_exit(x)
#define OSAL_MODULE_AUTHOR(_author)
#define OSAL_MODULE_DESCRIPTION(_description)
#define OSAL_MODULE_LICENSE(_license)
#define OSAL_MODULE_VERSION(_version)
#endif
#ifdef __cplusplus
#if __cplusplus
}
#endif
#endif
#endif // __OSAL_DEF_H__