update openharmony 1.0.1

This commit is contained in:
mamingshuai
2021-03-11 18:45:38 +08:00
parent 749e1fc82f
commit 18be8c8b60
392 changed files with 42515 additions and 7610 deletions
Executable → Regular
+5 -34
View File
@@ -1,32 +1,9 @@
/*
* Copyright (c) 2013-2019, Huawei Technologies Co., Ltd. All rights reserved.
* Copyright (c) 2020, Huawei Device Co., Ltd. All rights reserved.
* Copyright (c) 2020-2021 Huawei Device Co., Ltd.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
* to endorse or promote products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* HDF is dual licensed: you can use it either under the terms of
* the GPL, or the BSD license, at your option.
* See the LICENSE file in the root of this repository for complete details.
*/
/**
@@ -53,13 +30,7 @@
#ifndef HDF_BASE_TYPE_H
#define HDF_BASE_TYPE_H
#if defined(__KERNEL__)
#include <linux/types.h>
#else
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#endif
#include "hdf_types.h"
#ifdef __cplusplus
extern "C" {
Executable → Regular
+4 -27
View File
@@ -1,32 +1,9 @@
/*
* Copyright (c) 2013-2019, Huawei Technologies Co., Ltd. All rights reserved.
* Copyright (c) 2020, Huawei Device Co., Ltd. All rights reserved.
* Copyright (c) 2020-2021 Huawei Device Co., Ltd.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
* to endorse or promote products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* HDF is dual licensed: you can use it either under the terms of
* the GPL, or the BSD license, at your option.
* See the LICENSE file in the root of this repository for complete details.
*/
/**
* @addtogroup DriverUtils
Executable → Regular
+10 -237
View File
@@ -1,32 +1,9 @@
/*
* Copyright (c) 2013-2019, Huawei Technologies Co., Ltd. All rights reserved.
* Copyright (c) 2020, Huawei Device Co., Ltd. All rights reserved.
* Copyright (c) 2020-2021 Huawei Device Co., Ltd.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
* to endorse or promote products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* HDF is dual licensed: you can use it either under the terms of
* the GPL, or the BSD license, at your option.
* See the LICENSE file in the root of this repository for complete details.
*/
/**
@@ -68,23 +45,12 @@
#define LOG_TAG LOG_TAG_MARK(HDF_LOG_TAG)
#endif /* LOG_TAG */
#if defined(_LINUX_USER_)
#include "cutils/log.h"
#elif defined(__KERNEL__)
#include <linux/printk.h>
#elif defined(__LITEOS__) && defined(__USER__)
#include <stdio.h>
#elif defined(__LITEOS__)
#include "los_printf.h"
#else
#include <stdio.h>
#endif /* __KERNEL__ */
#include "hdf_log_adapter.h"
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#if defined(_LINUX_USER_)
/**
* @brief Prints logs at the verbose level.
*
@@ -93,7 +59,7 @@ extern "C" {
* @since 1.0
* @version 1.0
*/
#define HDF_LOGV(...) ALOGV(__VA_ARGS__)
#define HDF_LOGV(fmt, args...) HDF_LOGV_WRAPPER(fmt, ##args)
/**
* @brief Prints logs at the debug level.
*
@@ -102,7 +68,7 @@ extern "C" {
* @since 1.0
* @version 1.0
*/
#define HDF_LOGD(...) ALOGD(__VA_ARGS__)
#define HDF_LOGD(fmt, args...) HDF_LOGD_WRAPPER(fmt, ##args)
/**
* @brief Prints logs at the information level.
*
@@ -111,8 +77,7 @@ extern "C" {
* @since 1.0
* @version 1.0
*/
#define HDF_LOGI(...) ALOGI(__VA_ARGS__)
#define HDF_LOGI(fmt, args...) HDF_LOGI_WRAPPER(fmt, ##args)
/**
* @brief Prints logs at the warning level.
*
@@ -121,8 +86,7 @@ extern "C" {
* @since 1.0
* @version 1.0
*/
#define HDF_LOGW(...) ALOGW(__VA_ARGS__)
#define HDF_LOGW(fmt, args...) HDF_LOGW_WRAPPER(fmt, ##args)
/**
* @brief Prints logs at the error level.
*
@@ -131,198 +95,7 @@ extern "C" {
* @since 1.0
* @version 1.0
*/
#define HDF_LOGE(...) ALOGE(__VA_ARGS__)
#elif defined(__KERNEL__)
#define _HDF_FMT_TAG(TAG, LEVEL) "[" #LEVEL "/" #TAG "] "
#define HDF_FMT_TAG(TAG, LEVEL) _HDF_FMT_TAG(TAG, LEVEL)
/**
* @brief Prints logs at the verbose level.
*
* To use this function, you must define <b>HDF_LOG_TAG</b>, for example, #define HDF_LOG_TAG evt.
*
* @since 1.0
* @version 1.0
*/
#define HDF_LOGV(fmt, args...) printk(KERN_DEBUG HDF_FMT_TAG(HDF_LOG_TAG, V) fmt, ## args)
/**
* @brief Prints logs at the debug level.
*
* To use this function, you must define <b>HDF_LOG_TAG</b>, for example, #define HDF_LOG_TAG evt.
*
* @since 1.0
* @version 1.0
*/
#define HDF_LOGD(fmt, args...) printk(KERN_DEBUG HDF_FMT_TAG(HDF_LOG_TAG, D) fmt, ## args)
/**
* @brief Prints logs at the information level.
*
* To use this function, you must define <b>HDF_LOG_TAG</b>, for example, #define HDF_LOG_TAG evt.
*
* @since 1.0
* @version 1.0
*/
#define HDF_LOGI(fmt, args...) printk(KERN_INFO HDF_FMT_TAG(HDF_LOG_TAG, I) fmt, ## args)
/**
* @brief Prints logs at the warning level.
*
* To use this function, you must define <b>HDF_LOG_TAG</b>, for example, #define HDF_LOG_TAG evt.
*
* @since 1.0
* @version 1.0
*/
#define HDF_LOGW(fmt, args...) printk(KERN_WARNING HDF_FMT_TAG(HDF_LOG_TAG, W) fmt, ## args)
/**
* @brief Prints logs at the error level.
*
* To use this function, you must define <b>HDF_LOG_TAG</b>, for example, #define HDF_LOG_TAG evt.
*
* @since 1.0
* @version 1.0
*/
#define HDF_LOGE(fmt, args...) printk(KERN_ERR HDF_FMT_TAG(HDF_LOG_TAG, E) fmt, ## args)
#elif defined(__LITEOS__) && defined(__USER__)
/**
* @brief Prints logs at the verbose level.
*
* To use this function, you must define <b>HDF_LOG_TAG</b>, for example, #define HDF_LOG_TAG evt.
*
* @since 1.0
* @version 1.0
*/
#define HDF_LOGV(fmt, arg...) printf("[HDF:V/" LOG_TAG "]" fmt "\r\n", ##arg)
/**
* @brief Prints logs at the debug level.
*
* To use this function, you must define <b>HDF_LOG_TAG</b>, for example, #define HDF_LOG_TAG evt.
*
* @since 1.0
* @version 1.0
*/
#define HDF_LOGD(fmt, arg...) printf("[HDF:D/" LOG_TAG "]" fmt "\r\n", ##arg)
/**
* @brief Prints logs at the information level.
*
* To use this function, you must define <b>HDF_LOG_TAG</b>, for example, #define HDF_LOG_TAG evt.
*
* @since 1.0
* @version 1.0
*/
#define HDF_LOGI(fmt, arg...) printf("[HDF:I/" LOG_TAG "]" fmt "\r\n", ##arg)
/**
* @brief Prints logs at the warning level.
*
* To use this function, you must define <b>HDF_LOG_TAG</b>, for example, #define HDF_LOG_TAG evt.
*
* @since 1.0
* @version 1.0
*/
#define HDF_LOGW(fmt, arg...) printf("[HDF:W/" LOG_TAG "]" fmt "\r\n", ##arg)
/**
* @brief Prints logs at the error level.
*
* To use this function, you must define <b>HDF_LOG_TAG</b>, for example, #define HDF_LOG_TAG evt.
*
* @since 1.0
* @version 1.0
*/
#define HDF_LOGE(fmt, arg...) printf("[HDF:E/" LOG_TAG "]" fmt "\r\n", ##arg)
#elif defined(__LITEOS__)
/**
* @brief Prints logs at the verbose level.
*
* To use this function, you must define <b>HDF_LOG_TAG</b>, for example, #define HDF_LOG_TAG evt.
*
* @since 1.0
* @version 1.0
*/
#define HDF_LOGV(fmt, arg...) PRINT_DEBUG("[HDF:V/" LOG_TAG "]" fmt "\r\n", ##arg)
/**
* @brief Prints logs at the debug level.
*
* To use this function, you must define <b>HDF_LOG_TAG</b>, for example, #define HDF_LOG_TAG evt.
*
* @since 1.0
* @version 1.0
*/
#define HDF_LOGD(fmt, arg...) PRINT_DEBUG("[HDF:D/" LOG_TAG "]" fmt "\r\n", ##arg)
/**
* @brief Prints logs at the information level.
*
* To use this function, you must define <b>HDF_LOG_TAG</b>, for example, #define HDF_LOG_TAG evt.
*
* @since 1.0
* @version 1.0
*/
#define HDF_LOGI(fmt, arg...) PRINT_INFO("[HDF:I/" LOG_TAG "]" fmt "\r\n", ##arg)
/**
* @brief Prints logs at the warning level.
*
* To use this function, you must define <b>HDF_LOG_TAG</b>, for example, #define HDF_LOG_TAG evt.
*
* @since 1.0
* @version 1.0
*/
#define HDF_LOGW(fmt, arg...) PRINT_WARN("[HDF:W/" LOG_TAG "]" fmt "\r\n", ##arg)
/**
* @brief Prints logs at the error level.
*
* To use this function, you must define <b>HDF_LOG_TAG</b>, for example, #define HDF_LOG_TAG evt.
*
* @since 1.0
* @version 1.0
*/
#define HDF_LOGE(fmt, arg...) PRINT_ERR("[HDF:E/" LOG_TAG "]" fmt "\r\n", ##arg)
#else
/**
* @brief Prints logs at the verbose level.
*
* To use this function, you must define <b>HDF_LOG_TAG</b>, for example, #define HDF_LOG_TAG evt.
*
* @since 1.0
* @version 1.0
*/
#define HDF_LOGV(fmt, arg...) printf("[HDF:V/" LOG_TAG "]" fmt "\r\n", ##arg)
/**
* @brief Prints logs at the debug level.
*
* To use this function, you must define <b>HDF_LOG_TAG</b>, for example, #define HDF_LOG_TAG evt.
*
* @since 1.0
* @version 1.0
*/
#define HDF_LOGD(fmt, arg...) printf("[HDF:D/" LOG_TAG "]" fmt "\r\n", ##arg)
/**
* @brief Prints logs at the information level.
*
* To use this function, you must define <b>HDF_LOG_TAG</b>, for example, #define HDF_LOG_TAG evt.
*
* @since 1.0
* @version 1.0
*/
#define HDF_LOGI(fmt, arg...) printf("[HDF:I/" LOG_TAG "]" fmt "\r\n", ##arg)
/**
* @brief Prints logs at the warning level.
*
* To use this function, you must define <b>HDF_LOG_TAG</b>, for example, #define HDF_LOG_TAG evt.
*
* @since 1.0
* @version 1.0
*/
#define HDF_LOGW(fmt, arg...) printf("[HDF:W/" LOG_TAG "]" fmt "\r\n", ##arg)
/**
* @brief Prints logs at the error level.
*
* To use this function, you must define <b>HDF_LOG_TAG</b>, for example, #define HDF_LOG_TAG evt.
*
* @since 1.0
* @version 1.0
*/
#define HDF_LOGE(fmt, arg...) printf("[HDF:E/" LOG_TAG "]" fmt "\r\n", ##arg)
#endif /* __KERNEL__ */
#define HDF_LOGE(fmt, args...) HDF_LOGE_WRAPPER(fmt, ##args)
#ifdef __cplusplus
}
Executable → Regular
+4 -27
View File
@@ -1,32 +1,9 @@
/*
* Copyright (c) 2013-2019, Huawei Technologies Co., Ltd. All rights reserved.
* Copyright (c) 2020, Huawei Device Co., Ltd. All rights reserved.
* Copyright (c) 2020-2021 Huawei Device Co., Ltd.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
* to endorse or promote products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* HDF is dual licensed: you can use it either under the terms of
* the GPL, or the BSD license, at your option.
* See the LICENSE file in the root of this repository for complete details.
*/
/**