diff --git a/README.md b/README.md deleted file mode 100644 index d5e25782..00000000 --- a/README.md +++ /dev/null @@ -1,2 +0,0 @@ -# Iot_Cs_best - diff --git a/doc/test.txt b/doc/test.txt deleted file mode 100644 index e69de29b..00000000 diff --git a/doc/woshishabi.txt b/doc/woshishabi.txt deleted file mode 100644 index 56a6051c..00000000 --- a/doc/woshishabi.txt +++ /dev/null @@ -1 +0,0 @@ -1 \ No newline at end of file diff --git a/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/.gitee/ISSUE_TEMPLATE.zh-CN.md b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/.gitee/ISSUE_TEMPLATE.zh-CN.md new file mode 100644 index 00000000..651e02ce --- /dev/null +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/.gitee/ISSUE_TEMPLATE.zh-CN.md @@ -0,0 +1,11 @@ +### 该问题是怎么引起的? + + + +### 重现步骤 + + + +### 报错信息 + + diff --git a/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/.gitee/PULL_REQUEST_TEMPLATE.zh-CN.md b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/.gitee/PULL_REQUEST_TEMPLATE.zh-CN.md new file mode 100644 index 00000000..2e36464c --- /dev/null +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/.gitee/PULL_REQUEST_TEMPLATE.zh-CN.md @@ -0,0 +1,21 @@ +### 相关的Issue + + +### 原因(目的、解决的问题等) + + +### 描述(做了什么,变更了什么) + + +### 测试用例(新增、改动、可能影响的功能) + + +### 是否需要同步至release(如:3.0LTS ... )分支? + +必须选择一项(在MarkDown模式下用[x]替换[ ]即可勾选对应选项): +- [ ] 是,需要同步的分支: +- [ ] 否 + +理由: + + diff --git a/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/.gitignore b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/.gitignore new file mode 100644 index 00000000..c796d20f --- /dev/null +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/.gitignore @@ -0,0 +1,24 @@ +# General ignored file types +*.o +*.a +*.so +*.swp + +# IDE settings +.vscode +.idea +.settings +.cproject +.project + +# VIM files +cscope* +tags + +# Menuconfig temp files +/config.h +/.config +/.config.old + +# Build temp files +/out diff --git a/src/kernel_liteos_a/BUILD.gn b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/BUILD.gn similarity index 86% rename from src/kernel_liteos_a/BUILD.gn rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/BUILD.gn index 4ba2c2ff..ed823066 100644 --- a/src/kernel_liteos_a/BUILD.gn +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/BUILD.gn @@ -34,9 +34,7 @@ LITEOS_MENUCONFIG_H = rebase_path("$root_out_dir/config.h") declare_args() { tee_enable = false liteos_name = "OHOS_Image" - liteos_container_enable = false liteos_skip_make = false - liteos_is_mini = false } tee = "" @@ -130,9 +128,7 @@ config("stdinc_config") { "-isystem", std_include, ] - if (!defined(LOSCFG_LIBC_NEWLIB)) { - cflags += [ "-nostdinc" ] - } + cflags += [ "-nostdinc" ] asmflags = cflags } @@ -202,10 +198,6 @@ config("warn_config") { ] if (defined(LOSCFG_COMPILER_CLANG_LLVM)) { cflags += [ "-Wno-address-of-packed-member" ] - cflags += [ - "-Wno-unused-but-set-variable", - "-Wno-strict-prototypes", - ] } asmflags = cflags } @@ -244,28 +236,6 @@ config("misc_config") { asmflags = cflags } -config("container_config") { - if (liteos_container_enable) { - cflags = [ - "-DLOSCFG_KERNEL_CONTAINER", - "-DLOSCFG_PID_CONTAINER", - "-DLOSCFG_UTS_CONTAINER", - "-DLOSCFG_MNT_CONTAINER", - "-DLOSCFG_CHROOT", - "-DLOSCFG_IPC_CONTAINER", - "-DLOSCFG_TIME_CONTAINER", - "-DLOSCFG_USER_CONTAINER", - "-DLOSCFG_NET_CONTAINER", - "-DLOSCFG_PROC_PROCESS_DIR", - "-DLOSCFG_KERNEL_PLIMITS", - "-DLOSCFG_KERNEL_MEM_PLIMIT", - "-DLOSCFG_KERNEL_IPC_PLIMIT", - "-DLOSCFG_KERNEL_DEV_PLIMIT", - "-DLOSCFG_KERNEL_SCHED_PLIMIT", - ] - } -} - config("los_config") { configs = [ ":arch_config", @@ -276,7 +246,6 @@ config("los_config") { ":ssp_config", ":warn_config", ":misc_config", - ":container_config", ] } @@ -299,7 +268,7 @@ config("public") { configs += [ "$HDFTOPDIR:public", - "$DRIVERS_LITEOS_DIR:public", + "//drivers/liteos:public", ] if (HAVE_DEVICE_SDK) { @@ -320,12 +289,11 @@ group("modules") { "security", "shell", "syscall", - "testsuites/kernel:kernel_test", ] deps += [ - "$DRIVERS_LITEOS_DIR", - "$HDFTOPDIR", + "//drivers/liteos", + HDFTOPDIR, ] if (HAVE_DEVICE_SDK) { @@ -346,17 +314,13 @@ group("kernel") { } group("liteos_a") { - deps = [ ":kernel" ] - if (!liteos_is_mini) { - deps += [ - ":apps", - ":tests", - "$THIRDPARTY_MUSL_DIR/scripts/build_lite:strip", - ] - if (liteos_skip_make == false) { - deps += [ ":make" ] - } - } + deps = [ + ":apps", + ":kernel", + ":make", + ":tests", + "//prebuilts/lite/sysroot/build:strip", + ] } executable("liteos") { @@ -372,17 +336,6 @@ executable("liteos") { "-Wl,--no-eh-frame-hdr", ] - if (defined(LOSCFG_LIBC_NEWLIB)) { - ldflags += [ - "-Wl,--wrap=_free_r", - "-Wl,--wrap,_malloc_usable_size_r", - "-Wl,--wrap,_malloc_r", - "-Wl,--wrap,_memalign_r", - "-Wl,--wrap,_realloc_r", - "-Wl,--wrap,_fseeko_r", - ] - ldflags -= [ "-nostdlib" ] - } libgcc = exec_script("//build/lite/run_shell_cmd.py", [ "$cc -print-libgcc-file-name" ], "trim string") @@ -394,7 +347,7 @@ executable("liteos") { } else { ldflags += [ "-Wl,-T" + rebase_path("tools/build/liteos.ld", root_build_dir) ] - ldflags += [ "-nostartfiles" ] + ldflags += [ "-Wl,-nostartfiles" ] inputs = [ "tools/build/liteos.ld" ] } diff --git a/src/kernel_liteos_a/Kconfig b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/Kconfig similarity index 98% rename from src/kernel_liteos_a/Kconfig rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/Kconfig index 562e352a..8041b61d 100644 --- a/src/kernel_liteos_a/Kconfig +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/Kconfig @@ -235,12 +235,7 @@ config SCHED_DEBUG depends on DEBUG_VERSION help If you wish to build LiteOS with support for sched debug. -config SCHED_EDF_DEBUG - bool "Enable sched EDF debug Feature" - default n - depends on SCHED_DEBUG - help - If you wish to build LiteOS with support for sched debug. + config USER_INIT_DEBUG bool "Enable user init Debug" default n @@ -270,7 +265,7 @@ config MEM_LEAKCHECK default n depends on DEBUG_VERSION && MEM_DEBUG help - Answer Y to enable record the LR of Function call stack of Mem operation, it can check the mem leak through the information of mem node. + Answer Y to enable record the LR of Function call stack of Mem operation, it can check the mem leak through the informations of mem node. config BASE_MEM_NODE_INTEGRITY_CHECK bool "Enable integrity check or not" default n diff --git a/src/kernel_liteos_a/LICENSE b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/LICENSE similarity index 100% rename from src/kernel_liteos_a/LICENSE rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/LICENSE diff --git a/src/kernel_liteos_a/Makefile b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/Makefile similarity index 98% rename from src/kernel_liteos_a/Makefile rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/Makefile index a28c48e0..8122156f 100644 --- a/src/kernel_liteos_a/Makefile +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/Makefile @@ -82,6 +82,9 @@ endif ifeq ($(LOSCFG_STORAGE_SPINAND), y) FSTYPE = yaffs2 endif +ifeq ($(LOSCFG_PLATFORM_QEMU_ARM_VIRT_CA7), y) +FSTYPE = jffs2 +endif ROOTFS_DIR = $(OUT)/rootfs ROOTFS_ZIP = $(OUT)/rootfs.zip @@ -118,7 +121,7 @@ sysroot: $(HIDE)echo "sysroot:" $(abspath $(SYSROOT_PATH)) ifeq ($(origin SYSROOT_PATH),file) $(HIDE)mkdir -p $(SYSROOT_PATH)/build && cd $(SYSROOT_PATH)/build && \ - ln -snf $(LITEOSTOPDIR)/../../third_party/musl/scripts/build_lite/Makefile && \ + ln -snf $(LITEOSTOPDIR)/../../prebuilts/lite/sysroot/build/Makefile && \ $(MAKE) TARGETS=liteos_a_user \ ARCH=$(ARCH) \ TARGET=$(LOSCFG_LLVM_TARGET) \ diff --git a/src/kernel_liteos_a/OAT.xml b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/OAT.xml similarity index 95% rename from src/kernel_liteos_a/OAT.xml rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/OAT.xml index 9a549d62..3ffb98a8 100644 --- a/src/kernel_liteos_a/OAT.xml +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/OAT.xml @@ -15,7 +15,7 @@ --> @@ -24,7 +24,6 @@ - @@ -39,7 +38,7 @@ - + diff --git a/src/kernel_liteos_a/README.md b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/README.md similarity index 76% rename from src/kernel_liteos_a/README.md rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/README.md index a019cb3b..63f37f9f 100644 --- a/src/kernel_liteos_a/README.md +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/README.md @@ -4,10 +4,10 @@ - [Directory Structure](#section161941989596) - [Constraints](#section119744591305) - [Usage](#section741617511812) -- [Preparations](#section1579912573329) -- [Source Code Acquisition](#section11443189655) -- [Compilation and Building](#section2081013992812) -- [Contribution](#section1371123476304) + - [Preparations](#section1579912573329) + - [Source Code Acquisition](#section11443189655) + - [Compilation and Building](#section2081013992812) + - [Repositories Involved](#section1371113476307) ## Introduction @@ -67,33 +67,24 @@ The OpenHarmony LiteOS Cortex-A is a new-generation kernel developed based on th ## Usage -OpenHarmony LiteOS Cortex-A supports the [Hi3516D V300](https://gitee.com/openharmony/docs/blob/master/en/device-dev/quick-start/quickstart-appendix-hi3516.md). You can develop and run your applications based on this development board. +OpenHarmony LiteOS Cortex-A supports the [Hi3516D V300](https://gitee.com/openharmony/docs/blob/master/en/device-dev/quick-start/quickstart-lite-introduction-hi3516.md). You can develop and run your applications based on this development board. ### Preparations -You need to set up the compilation environment on Ubuntu. +You need to set up the compilation environment on Linux. -- [Setting Up Ubuntu Development Environment](https://gitee.com/openharmony/docs/blob/master/en/device-dev/quick-start/Readme-EN.md) +- [Setting Up Ubuntu Development Environment](https://gitee.com/openharmony/docs/blob/master/en/device-dev/quick-start/quickstart-lite-env-setup.md) +- For Hi3516D V300, see [Setting Up the Hi3516 Development Environment](https://gitee.com/openharmony/docs/blob/master/en/device-dev/quick-start/quickstart-lite-steps-hi3516-setting.md). ### Source Code Acquisition -Download and decompress a set of source code on a Ubuntu server to acquire the [source code](https://gitee.com/openharmony/docs/blob/master/en/device-dev/get-code/sourcecode-acquire.md). +Download and decompress a set of source code on a Linux server to acquire the [source code](https://gitee.com/openharmony/docs/blob/master/en/device-dev/get-code/sourcecode-acquire.md). ### Compilation and Building -For details about how to develop the first application, see: [Developing the First Example Program Running on Hi3516](https://gitee.com/openharmony/docs/blob/master/en/device-dev/quick-start/quickstart-pkg-3516-helloworld.md) - -For compilation, please refer to the [compilation instructions](https://gitee.com/openharmony/docs/blob/master/en/device-dev/quick-start/quickstart-pkg-3516-build.md). - -## Contribution - -[How to involve](https://gitee.com/openharmony/docs/blob/HEAD/en/contribute/contribution-guide.md) - -[Commit message spec](https://gitee.com/openharmony/kernel_liteos_a/wikis/Commit%20message%20%E8%A7%84%E8%8C%83) - -[C&C++ Secure Coding Guide](https://gitee.com/openharmony/docs/blob/master/en/contribute/OpenHarmony-c-cpp-secure-coding-guide.md) +For details about how to develop the first application, see: -[LiteOS-A Kernel Coding Style Guide](https://gitee.com/openharmony/kernel_liteos_a/wikis/LiteOS-A%20%E5%86%85%E6%A0%B8%E7%BC%96%E7%A0%81%E8%A7%84%E8%8C%83%E6%8C%87%E5%8D%97) +- [Developing the First Example Program Running on Hi3516](https://gitee.com/openharmony/docs/blob/master/en/device-dev/quick-start/quickstart-lite-steps-hi3516-running.md) ## Repositories Involved diff --git a/src/kernel_liteos_a/README_zh-HK.md b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/README_zh-HK.md similarity index 69% rename from src/kernel_liteos_a/README_zh-HK.md rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/README_zh-HK.md index 3ec89180..46bc25c2 100644 --- a/src/kernel_liteos_a/README_zh-HK.md +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/README_zh-HK.md @@ -4,10 +4,10 @@ - [目錄](#section161941989596) - [約束](#section119744591305) - [使用說明](#section741617511812) -- [準備](#section1579912573329) -- [獲取源碼](#section11443189655) -- [編譯構建](#section2081013992812) -- [貢獻](#section1371123476304) + - [準備](#section1579912573329) + - [獲取源碼](#section11443189655) + - [編譯構建](#section2081013992812) + - [相關倉](#section1371113476307) ## 簡介 @@ -67,33 +67,24 @@ OpenHarmony LiteOS-A內核是基於Huawei LiteOS內核演進發展的新一代 ## 使用說明 -OpenHarmony LiteOS-A內核支持[Hi3516DV300](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-appendix-hi3516.md)單板,開發者可基於此單板開發運行自己的應用程序。 +OpenHarmony LiteOS-A內核支持Hi3516DV300([介紹](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-lite-introduction-hi3516.md))單板,開發者可基於此單板開發運行自己的應用程序。 ### 準備 -開發者需要在Ubuntu上搭建編譯環境: +開發者需要在Linux上搭建編譯環境: -- [編譯環境凖備](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/Readme-CN.md); +- [編譯環境凖備](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-lite-env-setup.md); +- Hi3516DV300單板:參考[環境搭建](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-lite-steps-hi3516-setting.md)。 ### 獲取源碼 -在Ubuntu服務器上下載並解壓一套源代碼,源碼獲取方式參考[源碼獲取](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/get-code/sourcecode-acquire.md)。 +在Linux服務器上下載並解壓一套源代碼,源碼獲取方式參考[源碼獲取](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/get-code/sourcecode-acquire.md)。 ### 編譯構建 -開發者開發第一個應用程序可參考:[helloworld for Hi3516DV300](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-pkg-3516-helloworld.md)。 - -編譯可以參考:[編譯指導](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-pkg-3516-build.md) - -## 貢獻 - -[如何貢獻](https://gitee.com/openharmony/docs/blob/HEAD/zh-cn/contribute/%E5%8F%82%E4%B8%8E%E8%B4%A1%E7%8C%AE.md) - -[Commit message規範](https://gitee.com/openharmony/kernel_liteos_a/wikis/Commit%20message%20%E8%A7%84%E8%8C%83) - -[OpenHarmony C&C++ 安全編程指南](https://gitee.com/openharmony/docs/blob/master/zh-cn/contribute/OpenHarmony-c-cpp-secure-coding-guide.md) +開發者開發第一個應用程序可參考: -[LiteOS-A 內核編碼規範指南](https://gitee.com/openharmony/kernel_liteos_a/wikis/LiteOS-A%20%E5%86%85%E6%A0%B8%E7%BC%96%E7%A0%81%E8%A7%84%E8%8C%83%E6%8C%87%E5%8D%97) +- [helloworld for Hi3516DV300](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-lite-steps-hi3516-running.md)。 ## 相關倉 diff --git a/src/kernel_liteos_a/README_zh.md b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/README_zh.md similarity index 72% rename from src/kernel_liteos_a/README_zh.md rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/README_zh.md index 27d7da11..c62c0449 100644 --- a/src/kernel_liteos_a/README_zh.md +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/README_zh.md @@ -4,10 +4,10 @@ - [目录](#section161941989596) - [约束](#section119744591305) - [使用说明](#section741617511812) -- [准备](#section1579912573329) -- [获取源码](#section11443189655) -- [编译构建](#section2081013992812) -- [贡献](#section1371123476304) + - [准备](#section1579912573329) + - [获取源码](#section11443189655) + - [编译构建](#section2081013992812) + - [相关仓](#section1371113476307) ## 简介 @@ -33,7 +33,6 @@ OpenHarmony LiteOS-A内核是基于Huawei LiteOS内核演进发展的新一代 │ ├── quickstart # 系统快速启动接口目录 │ ├── random # 随机数设备驱动 │ └── video # framebuffer驱动框架 -├── figures # 内核架构图 ├── fs # 文件系统模块,主要来源于NuttX开源项目 │ ├── fat # fat文件系统 │ ├── jffs2 # jffs2文件系统 @@ -55,9 +54,7 @@ OpenHarmony LiteOS-A内核是基于Huawei LiteOS内核演进发展的新一代 │ ├── include # 对外暴露头文件存放目录 │ └── uart # 串口相关逻辑代码 ├── security # 安全特性相关的代码,包括进程权限管理和虚拟id映射管理 -├── shell # 接收用户输入的命令,内核去执行 ├── syscall # 系统调用 -├── testsuilts # 测试套件 └── tools # 构建工具及相关配置和代码 ``` @@ -69,35 +66,24 @@ OpenHarmony LiteOS-A内核是基于Huawei LiteOS内核演进发展的新一代 ## 使用说明 -OpenHarmony LiteOS-A内核支持[Hi3516DV300](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-appendix-hi3516.md)单板。开发者可基于此单板开发运行自己的应用程序。 +OpenHarmony LiteOS-A内核支持[Hi3516DV300](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-lite-introduction-hi3516.md)单板。开发者可基于此单板开发运行自己的应用程序。 ### 准备 -开发者需要在Ubuntu上搭建编译环境: +开发者需要在Linux上搭建编译环境: -- [编译环境准备](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/Readme-CN.md); +- [编译环境准备](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-lite-env-setup.md); +- Hi3516DV300单板:参考[环境搭建](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-lite-steps-hi3516-setting.md)。 ### 获取源码 -在Ubuntu服务器源码获取方式参考: [源码获取](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/get-code/sourcecode-acquire.md)。 +在Linux服务器上下载并解压一套源代码,源码获取方式参考[源码获取](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/get-code/sourcecode-acquire.md)。 ### 编译构建 -如果这是您的首次应用程序开发,可参考:[helloworld for Hi3516DV300](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-pkg-3516-helloworld.md)。 - -编译可以参考:[编译指导](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-pkg-3516-build.md) - -测试参考:[单元测试](testsuites/unittest/tools/README.md) - -## 贡献 - -[如何贡献](https://gitee.com/openharmony/docs/blob/HEAD/zh-cn/contribute/%E5%8F%82%E4%B8%8E%E8%B4%A1%E7%8C%AE.md) - -[Commit message规范](https://gitee.com/openharmony/kernel_liteos_a/wikis/Commit%20message%20%E8%A7%84%E8%8C%83) - -[OpenHarmony C&C++ 安全编程指南](https://gitee.com/openharmony/docs/blob/master/zh-cn/contribute/OpenHarmony-c-cpp-secure-coding-guide.md) +开发者开发第一个应用程序可参考: -[LiteOS-A 内核编码规范指南](https://gitee.com/openharmony/kernel_liteos_a/wikis/LiteOS-A%20%E5%86%85%E6%A0%B8%E7%BC%96%E7%A0%81%E8%A7%84%E8%8C%83%E6%8C%87%E5%8D%97) +- [helloworld for Hi3516DV300](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-lite-steps-hi3516-running.md)。 ## 相关仓 diff --git a/src/kernel_liteos_a/apps/BUILD.gn b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/BUILD.gn similarity index 100% rename from src/kernel_liteos_a/apps/BUILD.gn rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/BUILD.gn diff --git a/src/kernel_liteos_a/apps/Makefile b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/Makefile similarity index 100% rename from src/kernel_liteos_a/apps/Makefile rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/Makefile diff --git a/src/kernel_liteos_a/apps/app.mk b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/app.mk similarity index 100% rename from src/kernel_liteos_a/apps/app.mk rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/app.mk diff --git a/src/kernel_liteos_a/apps/config.mk b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/config.mk similarity index 97% rename from src/kernel_liteos_a/apps/config.mk rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/config.mk index 5bff8f4b..51e9e219 100644 --- a/src/kernel_liteos_a/apps/config.mk +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/config.mk @@ -58,10 +58,6 @@ APP_SUBDIRS += mksh APP_SUBDIRS += toybox endif -ifeq ($(LOSCFG_KERNEL_LMS), y) -APP_SUBDIRS += lms -endif - ifeq ($(LOSCFG_USER_INIT_DEBUG), y) APP_SUBDIRS += init endif diff --git a/src/kernel_liteos_a/apps/init/BUILD.gn b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/init/BUILD.gn similarity index 100% rename from src/kernel_liteos_a/apps/init/BUILD.gn rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/init/BUILD.gn diff --git a/src/kernel_liteos_a/apps/init/Makefile b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/init/Makefile similarity index 100% rename from src/kernel_liteos_a/apps/init/Makefile rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/init/Makefile diff --git a/src/kernel_liteos_a/apps/init/src/init.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/init/src/init.c similarity index 100% rename from src/kernel_liteos_a/apps/init/src/init.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/init/src/init.c diff --git a/src/kernel_liteos_a/apps/lms/BUILD.gn b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/lms/BUILD.gn similarity index 97% rename from src/kernel_liteos_a/apps/lms/BUILD.gn rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/lms/BUILD.gn index dd58d2d3..f90f6363 100644 --- a/src/kernel_liteos_a/apps/lms/BUILD.gn +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/lms/BUILD.gn @@ -73,5 +73,5 @@ executable("sample_usr_lms") { "-Wl,--wrap=strcpy", "-Wl,--wrap=strcat", ] - deps = [ "$LITEOSTOPDIR/kernel/extended/lms/usr:usrlmslib" ] + deps = [ "//kernel/liteos_a/kernel/extended/lms/usr:usrlmslib" ] } diff --git a/src/kernel_liteos_a/apps/lms/src/sample_usr_lms.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/lms/src/sample_usr_lms.c similarity index 98% rename from src/kernel_liteos_a/apps/lms/src/sample_usr_lms.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/lms/src/sample_usr_lms.c index 7eb085e6..de5425f0 100644 --- a/src/kernel_liteos_a/apps/lms/src/sample_usr_lms.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/lms/src/sample_usr_lms.c @@ -180,8 +180,7 @@ static void LmsStrcpyTest(void) return; } char *testStr = "bbbbbbbbbbbbbbbbb"; - printf("[LmsStrcpyTest] strcpy overflow error should be triggered, src string buf size:%d\n", - (int)strlen(testStr) + 1); + printf("[LmsStrcpyTest] strcpy overflow error should be triggered, src string buf size:%d\n", strlen(testStr) + 1); strcpy(buf, testStr); free(buf); printf("\n-------- LmsStrcpyTest End --------\n"); @@ -231,7 +230,7 @@ int main(int argc, char * const *argv) printf("\n############### Lms Test start ###############\n"); char *tmp = (char *)malloc(5000); /* 5000: test mem size */ if (tmp == NULL) { - return -1; + return; } LmsMallocTest(); LmsReallocTest(); @@ -246,5 +245,4 @@ int main(int argc, char * const *argv) LmsFreeTest(); free(tmp); printf("\n############### Lms Test End ###############\n"); - return 0; } diff --git a/src/kernel_liteos_a/apps/mksh/BUILD.gn b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/mksh/BUILD.gn similarity index 97% rename from src/kernel_liteos_a/apps/mksh/BUILD.gn rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/mksh/BUILD.gn index 2e9c46d6..379d78f0 100644 --- a/src/kernel_liteos_a/apps/mksh/BUILD.gn +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/mksh/BUILD.gn @@ -29,7 +29,7 @@ import("//build/lite/config/component/lite_component.gni") import("//kernel/liteos_a/liteos.gni") -import("$THIRDPARTY_MKSH_DIR/mksh.gni") +import("//third_party/mksh/mksh.gni") group("mksh") { deps = [ ":build_mksh" ] @@ -42,7 +42,7 @@ copy("copy_mksh_src") { build_ext_component("build_mksh") { deps = [ ":copy_mksh_src" ] - deps += [ "$THIRDPARTY_MUSL_DIR:sysroot_lite" ] + deps += [ "//prebuilts/lite/sysroot" ] exec_path = rebase_path("$target_out_dir/mksh_build") cflags = [ diff --git a/src/kernel_liteos_a/apps/mksh/Makefile b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/mksh/Makefile similarity index 100% rename from src/kernel_liteos_a/apps/mksh/Makefile rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/mksh/Makefile diff --git a/src/kernel_liteos_a/apps/perf/BUILD.gn b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/perf/BUILD.gn similarity index 100% rename from src/kernel_liteos_a/apps/perf/BUILD.gn rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/perf/BUILD.gn diff --git a/src/kernel_liteos_a/apps/perf/Makefile b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/perf/Makefile similarity index 100% rename from src/kernel_liteos_a/apps/perf/Makefile rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/perf/Makefile diff --git a/src/kernel_liteos_a/apps/perf/include/option.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/perf/include/option.h similarity index 100% rename from src/kernel_liteos_a/apps/perf/include/option.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/perf/include/option.h diff --git a/src/kernel_liteos_a/apps/perf/include/perf.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/perf/include/perf.h similarity index 100% rename from src/kernel_liteos_a/apps/perf/include/perf.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/perf/include/perf.h diff --git a/src/kernel_liteos_a/apps/perf/include/perf_list.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/perf/include/perf_list.h similarity index 100% rename from src/kernel_liteos_a/apps/perf/include/perf_list.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/perf/include/perf_list.h diff --git a/src/kernel_liteos_a/apps/perf/include/perf_record.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/perf/include/perf_record.h similarity index 100% rename from src/kernel_liteos_a/apps/perf/include/perf_record.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/perf/include/perf_record.h diff --git a/src/kernel_liteos_a/apps/perf/include/perf_stat.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/perf/include/perf_stat.h similarity index 100% rename from src/kernel_liteos_a/apps/perf/include/perf_stat.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/perf/include/perf_stat.h diff --git a/src/kernel_liteos_a/apps/perf/src/main.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/perf/src/main.c similarity index 99% rename from src/kernel_liteos_a/apps/perf/src/main.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/perf/src/main.c index 1482d490..8fb841fa 100644 --- a/src/kernel_liteos_a/apps/perf/src/main.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/perf/src/main.c @@ -62,7 +62,7 @@ int main(int argc, char **argv) PerfStop(fd); } else if ((argc == THREE_ARGS) && strcmp(argv[1], "read") == 0) { size_t size = strtoul(argv[THREE_ARGS - 1], NULL, 0); - if (size == 0) { + if (size <= 0) { goto EXIT: } diff --git a/src/kernel_liteos_a/apps/perf/src/option.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/perf/src/option.c similarity index 100% rename from src/kernel_liteos_a/apps/perf/src/option.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/perf/src/option.c diff --git a/src/kernel_liteos_a/apps/perf/src/perf.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/perf/src/perf.c similarity index 100% rename from src/kernel_liteos_a/apps/perf/src/perf.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/perf/src/perf.c diff --git a/src/kernel_liteos_a/apps/perf/src/perf_list.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/perf/src/perf_list.c similarity index 100% rename from src/kernel_liteos_a/apps/perf/src/perf_list.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/perf/src/perf_list.c diff --git a/src/kernel_liteos_a/apps/perf/src/perf_record.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/perf/src/perf_record.c similarity index 100% rename from src/kernel_liteos_a/apps/perf/src/perf_record.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/perf/src/perf_record.c diff --git a/src/kernel_liteos_a/apps/perf/src/perf_stat.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/perf/src/perf_stat.c similarity index 100% rename from src/kernel_liteos_a/apps/perf/src/perf_stat.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/perf/src/perf_stat.c diff --git a/src/kernel_liteos_a/apps/shell/BUILD.gn b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/shell/BUILD.gn similarity index 100% rename from src/kernel_liteos_a/apps/shell/BUILD.gn rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/shell/BUILD.gn diff --git a/src/kernel_liteos_a/apps/shell/Makefile b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/shell/Makefile similarity index 100% rename from src/kernel_liteos_a/apps/shell/Makefile rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/shell/Makefile diff --git a/src/kernel_liteos_a/apps/shell/builtin/cd.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/shell/builtin/cd.c similarity index 100% rename from src/kernel_liteos_a/apps/shell/builtin/cd.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/shell/builtin/cd.c diff --git a/src/kernel_liteos_a/apps/shell/include/shcmd.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/shell/include/shcmd.h similarity index 100% rename from src/kernel_liteos_a/apps/shell/include/shcmd.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/shell/include/shcmd.h diff --git a/src/kernel_liteos_a/apps/shell/include/shcmdparse.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/shell/include/shcmdparse.h similarity index 100% rename from src/kernel_liteos_a/apps/shell/include/shcmdparse.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/shell/include/shcmdparse.h diff --git a/src/kernel_liteos_a/apps/shell/include/shell.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/shell/include/shell.h similarity index 100% rename from src/kernel_liteos_a/apps/shell/include/shell.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/shell/include/shell.h diff --git a/src/kernel_liteos_a/apps/shell/include/shell_list.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/shell/include/shell_list.h similarity index 100% rename from src/kernel_liteos_a/apps/shell/include/shell_list.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/shell/include/shell_list.h diff --git a/src/kernel_liteos_a/apps/shell/include/shell_pri.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/shell/include/shell_pri.h similarity index 96% rename from src/kernel_liteos_a/apps/shell/include/shell_pri.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/shell/include/shell_pri.h index 11dd582d..e1a47f1d 100644 --- a/src/kernel_liteos_a/apps/shell/include/shell_pri.h +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/shell/include/shell_pri.h @@ -32,15 +32,13 @@ #ifndef _SHELL_PRI_H #define _SHELL_PRI_H -#include "shell.h" - #ifdef __cplusplus #if __cplusplus extern "C" { #endif /* __cplusplus */ #endif /* __cplusplus */ -extern void ShellEntry(ShellCB *shellCB); +extern void *ShellEntry(void *argv); extern void *ShellTask(void *argv); #ifdef __cplusplus diff --git a/src/kernel_liteos_a/apps/shell/include/sherr.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/shell/include/sherr.h similarity index 100% rename from src/kernel_liteos_a/apps/shell/include/sherr.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/shell/include/sherr.h diff --git a/src/kernel_liteos_a/apps/shell/include/shmsg.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/shell/include/shmsg.h similarity index 98% rename from src/kernel_liteos_a/apps/shell/include/shmsg.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/shell/include/shmsg.h index a2cb6874..71d7da96 100644 --- a/src/kernel_liteos_a/apps/shell/include/shmsg.h +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/shell/include/shmsg.h @@ -32,7 +32,6 @@ #ifndef _SHMSG_H #define _SHMSG_H -#include "shell_list.h" #include "shell.h" #ifdef __cplusplus @@ -62,7 +61,8 @@ extern "C" { typedef void (* OutputFunc)(const char *fmt, ...); extern int ShellTaskInit(ShellCB *shellCB); -extern void ChildExec(const char *cmdName, char *const paramArray[], bool foreground); +extern int ShellEntryInit(ShellCB *shellCB); +extern void ChildExec(const char *cmdName, char *const paramArray[]); extern void ShellCmdLineParse(char c, OutputFunc outputFunc, ShellCB *shellCB); extern int ShellNotify(ShellCB *shellCB); diff --git a/src/kernel_liteos_a/apps/shell/include/show.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/shell/include/show.h similarity index 100% rename from src/kernel_liteos_a/apps/shell/include/show.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/shell/include/show.h diff --git a/src/kernel_liteos_a/apps/shell/src/main.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/shell/src/main.c similarity index 86% rename from src/kernel_liteos_a/apps/shell/src/main.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/shell/src/main.c index 37e0ebbd..3cdfc803 100644 --- a/src/kernel_liteos_a/apps/shell/src/main.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/shell/src/main.c @@ -31,25 +31,22 @@ #define _GNU_SOURCE -#include -#include -#include -#include #include "show.h" #include "shmsg.h" #include "shcmd.h" -#include "shell_pri.h" #include "semaphore.h" #include "securec.h" +#include "unistd.h" +#include ShellCB *g_shellCB = NULL; -ShellCB *OsGetShellCb(void) +ShellCB *OsGetShellCb() { return g_shellCB; } -static void ShellDeinit(ShellCB *shellCB) +void ShellDeinit(ShellCB *shellCB) { (void)pthread_mutex_destroy(&shellCB->historyMutex); (void)pthread_mutex_destroy(&shellCB->keyMutex); @@ -65,23 +62,32 @@ static int OsShellCreateTask(ShellCB *shellCB) ret = sched_getparam(getpid(), ¶m); if (ret != SH_OK) { - return ret; + goto OUT; } param.sched_priority = SHELL_PROCESS_PRIORITY_INIT; ret = sched_setparam(getpid(), ¶m); if (ret != SH_OK) { - return ret; + goto OUT; } ret = ShellTaskInit(shellCB); if (ret != SH_OK) { - return ret; + goto OUT; } - shellCB->shellEntryHandle = pthread_self(); - return 0; + ret = ShellEntryInit(shellCB); + if (ret != SH_OK) { + goto OUT; + } + + (void)pthread_join(shellCB->shellTaskHandle, NULL); + (void)pthread_join(shellCB->shellEntryHandle, NULL); + +OUT: + ShellDeinit(shellCB); + return ret; } static int DoShellExec(char **argv) @@ -92,7 +98,7 @@ static int DoShellExec(char **argv) char *cmdLine = NULL; if (strncmp(argv[0], SHELL_EXEC_COMMAND, SHELL_EXEC_COMMAND_BYTES) == 0) { - ChildExec(argv[1], argv + 1, FALSE); + ChildExec(argv[1], argv + 1); } for (i = 0; argv[i]; i++) { len += strlen(argv[i]); @@ -119,22 +125,11 @@ static int DoShellExec(char **argv) return ret; } -static void ShellSigChildHook(int sig) -{ - (void)sig; - - while (waitpid(-1, NULL, WNOHANG) > 0) { - continue; - } -} - int main(int argc, char **argv) { int ret = SH_NOK; ShellCB *shellCB = NULL; - (void)signal(SIGCHLD, ShellSigChildHook); - if (argc > 1) { ret = DoShellExec(argv + 1); return ret; @@ -144,7 +139,7 @@ int main(int argc, char **argv) shellCB = (ShellCB *)malloc(sizeof(ShellCB)); if (shellCB == NULL) { - return SH_NOK; + goto ERR_OUT1; } ret = memset_s(shellCB, sizeof(ShellCB), 0, sizeof(ShellCB)); if (ret != SH_OK) { @@ -170,14 +165,7 @@ int main(int argc, char **argv) sem_init(&shellCB->shellSem, 0, 0); g_shellCB = shellCB; - ret = OsShellCreateTask(shellCB); - if (ret != SH_OK) { - ShellDeinit(shellCB); - g_shellCB = NULL; - return ret; - } - - ShellEntry(shellCB); + return OsShellCreateTask(shellCB); ERR_OUT3: (void)pthread_mutex_destroy(&shellCB->historyMutex); diff --git a/src/kernel_liteos_a/apps/shell/src/shcmd.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/shell/src/shcmd.c similarity index 100% rename from src/kernel_liteos_a/apps/shell/src/shcmd.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/shell/src/shcmd.c diff --git a/src/kernel_liteos_a/apps/shell/src/shcmdparse.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/shell/src/shcmdparse.c similarity index 100% rename from src/kernel_liteos_a/apps/shell/src/shcmdparse.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/shell/src/shcmdparse.c diff --git a/src/kernel_liteos_a/apps/shell/src/shmsg.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/shell/src/shmsg.c similarity index 93% rename from src/kernel_liteos_a/apps/shell/src/shmsg.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/shell/src/shmsg.c index d51ef9aa..0fb2b69d 100644 --- a/src/kernel_liteos_a/apps/shell/src/shmsg.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/shell/src/shmsg.c @@ -351,7 +351,7 @@ char *GetCmdName(const char *cmdline, unsigned int len) return cmdName; } -void ChildExec(const char *cmdName, char *const paramArray[], bool foreground) +void ChildExec(const char *cmdName, char *const paramArray[]) { int ret; pid_t gid; @@ -367,12 +367,10 @@ void ChildExec(const char *cmdName, char *const paramArray[], bool foreground) exit(1); } - if (!foreground) { - ret = tcsetpgrp(STDIN_FILENO, gid); - if (ret != 0) { - printf("tcsetpgrp failed, errno %d\n", errno); - exit(1); - } + ret = tcsetpgrp(STDIN_FILENO, gid); + if (ret != 0) { + printf("tcsetpgrp failed, errno %d\n", errno); + exit(1); } ret = execve(cmdName, paramArray, NULL); @@ -406,30 +404,20 @@ int CheckExit(const char *cmdName, const CmdParsed *cmdParsed) exit(ret); } -static void DoCmdExec(const char *cmdName, const char *cmdline, unsigned int len, CmdParsed *cmdParsed) +static void DoCmdExec(const char *cmdName, const char *cmdline, unsigned int len, const CmdParsed *cmdParsed) { - bool foreground = FALSE; int ret; pid_t forkPid; if (strncmp(cmdline, CMD_EXEC_COMMAND, CMD_EXEC_COMMAND_BYTES) == 0) { - if ((cmdParsed->paramCnt > 1) && (strcmp(cmdParsed->paramArray[cmdParsed->paramCnt - 1], "&") == 0)) { - free(cmdParsed->paramArray[cmdParsed->paramCnt - 1]); - cmdParsed->paramArray[cmdParsed->paramCnt - 1] = NULL; - cmdParsed->paramCnt--; - foreground = TRUE; - } - forkPid = fork(); if (forkPid < 0) { - printf("Failed to fork from shell\n"); + printf("Faild to fork from shell\n"); return; } else if (forkPid == 0) { - ChildExec(cmdParsed->paramArray[0], cmdParsed->paramArray, foreground); + ChildExec(cmdParsed->paramArray[0], cmdParsed->paramArray); } else { - if (!foreground) { - (void)waitpid(forkPid, 0, 0); - } + waitpid(forkPid, 0, 0); ret = tcsetpgrp(STDIN_FILENO, getpid()); if (ret != 0) { printf("tcsetpgrp failed, errno %d\n", errno); @@ -579,10 +567,20 @@ static void ExecCmdline(const char *cmdline) free(output); } +void RecycleZombieChild(void) +{ + while (waitpid(-1, NULL, WNOHANG) > 0) { + continue; + } +} + static void ShellCmdProcess(ShellCB *shellCB) { + char *buf = NULL; while (1) { - char *buf = GetCmdline(shellCB); + /* recycle zombine child process */ + RecycleZombieChild(); + buf = GetCmdline(shellCB); if (buf == NULL) { break; } @@ -656,19 +654,25 @@ static int ShellKernelReg(unsigned int shellHandle) return ioctl(STDIN_FILENO, CONSOLE_CONTROL_REG_USERTASK, shellHandle); } -void ShellEntry(ShellCB *shellCB) +void *ShellEntry(void *argv) { char ch; int ret; int n; pid_t tid = syscall(__NR_gettid); + ShellCB *shellCB = (ShellCB *)argv; if (shellCB == NULL) { - return; + return NULL; } (void)memset_s(shellCB->shellBuf, SHOW_MAX_LEN, 0, SHOW_MAX_LEN); + ret = prctl(PR_SET_NAME, "ShellEntry"); + if (ret != SH_OK) { + return NULL; + } + ret = ShellKernelReg((int)tid); if (ret != 0) { printf("another shell is already running!\n"); @@ -681,5 +685,32 @@ void ShellEntry(ShellCB *shellCB) ShellCmdLineParse(ch, (OutputFunc)printf, shellCB); } } - return; + return NULL; } + +int ShellEntryInit(ShellCB *shellCB) +{ + int ret; + size_t stackSize = SHELL_ENTRY_STACKSIZE; + void *arg = NULL; + pthread_attr_t attr; + + if (shellCB == NULL) { + return SH_NOK; + } + + ret = pthread_attr_init(&attr); + if (ret != SH_OK) { + return SH_NOK; + } + + pthread_attr_setstacksize(&attr, stackSize); + arg = (void *)shellCB; + ret = pthread_create(&shellCB->shellEntryHandle, &attr, &ShellEntry, arg); + if (ret != SH_OK) { + return SH_NOK; + } + + return ret; +} + diff --git a/src/kernel_liteos_a/apps/tftp/BUILD.gn b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/tftp/BUILD.gn similarity index 100% rename from src/kernel_liteos_a/apps/tftp/BUILD.gn rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/tftp/BUILD.gn diff --git a/src/kernel_liteos_a/apps/tftp/Makefile b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/tftp/Makefile similarity index 100% rename from src/kernel_liteos_a/apps/tftp/Makefile rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/tftp/Makefile diff --git a/src/kernel_liteos_a/apps/tftp/include/tftpc.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/tftp/include/tftpc.h similarity index 100% rename from src/kernel_liteos_a/apps/tftp/include/tftpc.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/tftp/include/tftpc.h diff --git a/src/kernel_liteos_a/apps/tftp/include/types_adapt.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/tftp/include/types_adapt.h similarity index 100% rename from src/kernel_liteos_a/apps/tftp/include/types_adapt.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/tftp/include/types_adapt.h diff --git a/src/kernel_liteos_a/apps/tftp/src/main.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/tftp/src/main.c similarity index 100% rename from src/kernel_liteos_a/apps/tftp/src/main.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/tftp/src/main.c diff --git a/src/kernel_liteos_a/apps/tftp/src/tftpc.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/tftp/src/tftpc.c similarity index 99% rename from src/kernel_liteos_a/apps/tftp/src/tftpc.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/tftp/src/tftpc.c index 6185c2af..a1ab6f34 100644 --- a/src/kernel_liteos_a/apps/tftp/src/tftpc.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/tftp/src/tftpc.c @@ -500,7 +500,7 @@ static void lwip_tftp_send_error(s32_t iSockNum, u32_t ulError, const char *szEr } } -/* INTERFACE to get a file using filename +/* INTEFACE to get a file using filename ulHostAddr - IP address of Host szSrcFileName - Source file szDestDirPath - Destination file path @@ -1419,7 +1419,7 @@ err_handler: } #ifdef TFTP_TO_RAWMEM -/* INTERFACE to get a file using filename +/* INTEFACE to get a file using filename ulHostAddr - IP address of Host szSrcFileName - Source file szDestMemAddr - The target memory address in the client @@ -1437,8 +1437,10 @@ u32_t lwip_tftp_get_file_by_filename_to_rawmem(u32_t ulHostAddr, { s32_t iSockNum = TFTP_NULL_INT32; u32_t ulSrcStrLen; + u32_t lDestStrLen; u32_t ulSize; u32_t ulRecvSize = TFTP_NULL_UINT32; + s32_t iErrCode; u32_t ulErrCode; u16_t usReadReq; u16_t usTempServPort; diff --git a/src/kernel_liteos_a/apps/toybox/BUILD.gn b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/toybox/BUILD.gn similarity index 97% rename from src/kernel_liteos_a/apps/toybox/BUILD.gn rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/toybox/BUILD.gn index e347c372..a6d74a10 100644 --- a/src/kernel_liteos_a/apps/toybox/BUILD.gn +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/toybox/BUILD.gn @@ -29,7 +29,7 @@ import("//build/lite/config/component/lite_component.gni") import("//kernel/liteos_a/liteos.gni") -import("$THIRDPARTY_TOYBOX_DIR/toybox.gni") +import("//third_party/toybox/toybox.gni") group("toybox") { deps = [ ":build_toybox" ] @@ -51,7 +51,7 @@ build_ext_component("build_toybox") { ":copy_toybox_config", ":copy_toybox_src", ] - deps += [ "$THIRDPARTY_MUSL_DIR:sysroot_lite" ] + deps += [ "//prebuilts/lite/sysroot" ] exec_path = rebase_path("$target_out_dir/toybox_build") cflags = [ diff --git a/src/kernel_liteos_a/apps/toybox/Makefile b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/toybox/Makefile similarity index 100% rename from src/kernel_liteos_a/apps/toybox/Makefile rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/toybox/Makefile diff --git a/src/kernel_liteos_a/apps/toybox/liteos_a_custom.config b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/toybox/liteos_a_custom.config similarity index 100% rename from src/kernel_liteos_a/apps/toybox/liteos_a_custom.config rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/toybox/liteos_a_custom.config diff --git a/src/kernel_liteos_a/apps/trace/BUILD.gn b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/trace/BUILD.gn similarity index 100% rename from src/kernel_liteos_a/apps/trace/BUILD.gn rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/trace/BUILD.gn diff --git a/src/kernel_liteos_a/apps/trace/Makefile b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/trace/Makefile similarity index 100% rename from src/kernel_liteos_a/apps/trace/Makefile rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/trace/Makefile diff --git a/src/kernel_liteos_a/apps/trace/src/trace.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/trace/src/trace.c similarity index 99% rename from src/kernel_liteos_a/apps/trace/src/trace.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/trace/src/trace.c index ecc4f229..ddcb5553 100644 --- a/src/kernel_liteos_a/apps/trace/src/trace.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/apps/trace/src/trace.c @@ -70,7 +70,7 @@ static void TraceRead(int fd, size_t size) { ssize_t i; ssize_t len; - if (size == 0) { + if (size <= 0) { return; } diff --git a/src/kernel_liteos_a/arch/BUILD.gn b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/BUILD.gn similarity index 100% rename from src/kernel_liteos_a/arch/BUILD.gn rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/BUILD.gn diff --git a/src/kernel_liteos_a/arch/Kconfig b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/Kconfig similarity index 100% rename from src/kernel_liteos_a/arch/Kconfig rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/Kconfig diff --git a/src/kernel_liteos_a/arch/arm/BUILD.gn b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/BUILD.gn similarity index 100% rename from src/kernel_liteos_a/arch/arm/BUILD.gn rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/BUILD.gn diff --git a/src/kernel_liteos_a/arch/arm/Kconfig b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/Kconfig similarity index 100% rename from src/kernel_liteos_a/arch/arm/Kconfig rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/Kconfig diff --git a/src/kernel_liteos_a/arch/arm/arm.mk b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/arm.mk similarity index 100% rename from src/kernel_liteos_a/arch/arm/arm.mk rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/arm.mk diff --git a/src/kernel_liteos_a/arch/arm/arm/BUILD.gn b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/arm/BUILD.gn similarity index 100% rename from src/kernel_liteos_a/arch/arm/arm/BUILD.gn rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/arm/BUILD.gn diff --git a/src/kernel_liteos_a/arch/arm/arm/Makefile b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/arm/Makefile similarity index 100% rename from src/kernel_liteos_a/arch/arm/arm/Makefile rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/arm/Makefile diff --git a/src/kernel_liteos_a/arch/arm/arm/include/arch_config.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/arm/include/arch_config.h similarity index 100% rename from src/kernel_liteos_a/arch/arm/arm/include/arch_config.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/arm/include/arch_config.h diff --git a/src/kernel_liteos_a/arch/arm/arm/include/arm.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/arm/include/arm.h similarity index 100% rename from src/kernel_liteos_a/arch/arm/arm/include/arm.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/arm/include/arm.h diff --git a/src/kernel_liteos_a/arch/arm/arm/include/arm_user_clear.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/arm/include/arm_user_clear.h similarity index 100% rename from src/kernel_liteos_a/arch/arm/arm/include/arm_user_clear.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/arm/include/arm_user_clear.h diff --git a/src/kernel_liteos_a/arch/arm/arm/include/arm_user_copy.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/arm/include/arm_user_copy.h similarity index 100% rename from src/kernel_liteos_a/arch/arm/arm/include/arm_user_copy.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/arm/include/arm_user_copy.h diff --git a/src/kernel_liteos_a/arch/arm/arm/include/arm_user_get.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/arm/include/arm_user_get.h similarity index 100% rename from src/kernel_liteos_a/arch/arm/arm/include/arm_user_get.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/arm/include/arm_user_get.h diff --git a/src/kernel_liteos_a/arch/arm/arm/include/arm_user_put.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/arm/include/arm_user_put.h similarity index 100% rename from src/kernel_liteos_a/arch/arm/arm/include/arm_user_put.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/arm/include/arm_user_put.h diff --git a/src/kernel_liteos_a/arch/arm/arm/include/hal_timer.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/arm/include/hal_timer.h similarity index 100% rename from src/kernel_liteos_a/arch/arm/arm/include/hal_timer.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/arm/include/hal_timer.h diff --git a/src/kernel_liteos_a/arch/arm/arm/include/los_arch_mmu.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/arm/include/los_arch_mmu.h similarity index 100% rename from src/kernel_liteos_a/arch/arm/arm/include/los_arch_mmu.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/arm/include/los_arch_mmu.h diff --git a/src/kernel_liteos_a/arch/arm/arm/include/los_asid.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/arm/include/los_asid.h similarity index 100% rename from src/kernel_liteos_a/arch/arm/arm/include/los_asid.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/arm/include/los_asid.h diff --git a/src/kernel_liteos_a/arch/arm/arm/include/los_atomic.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/arm/include/los_atomic.h similarity index 100% rename from src/kernel_liteos_a/arch/arm/arm/include/los_atomic.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/arm/include/los_atomic.h diff --git a/src/kernel_liteos_a/arch/arm/arm/include/los_hw_cpu.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/arm/include/los_hw_cpu.h similarity index 100% rename from src/kernel_liteos_a/arch/arm/arm/include/los_hw_cpu.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/arm/include/los_hw_cpu.h diff --git a/src/kernel_liteos_a/arch/arm/arm/include/los_mmu_descriptor_v6.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/arm/include/los_mmu_descriptor_v6.h similarity index 100% rename from src/kernel_liteos_a/arch/arm/arm/include/los_mmu_descriptor_v6.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/arm/include/los_mmu_descriptor_v6.h diff --git a/src/kernel_liteos_a/arch/arm/arm/include/los_pte_ops.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/arm/include/los_pte_ops.h similarity index 100% rename from src/kernel_liteos_a/arch/arm/arm/include/los_pte_ops.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/arm/include/los_pte_ops.h diff --git a/src/kernel_liteos_a/arch/arm/arm/include/los_tlb_v6.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/arm/include/los_tlb_v6.h similarity index 100% rename from src/kernel_liteos_a/arch/arm/arm/include/los_tlb_v6.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/arm/include/los_tlb_v6.h diff --git a/src/kernel_liteos_a/arch/arm/arm/include/smp.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/arm/include/smp.h similarity index 100% rename from src/kernel_liteos_a/arch/arm/arm/include/smp.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/arm/include/smp.h diff --git a/src/kernel_liteos_a/arch/arm/arm/src/arm_generic_timer.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/arm/src/arm_generic_timer.c similarity index 100% rename from src/kernel_liteos_a/arch/arm/arm/src/arm_generic_timer.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/arm/src/arm_generic_timer.c diff --git a/src/kernel_liteos_a/arch/arm/arm/src/armv7a/cache.S b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/arm/src/armv7a/cache.S similarity index 100% rename from src/kernel_liteos_a/arch/arm/arm/src/armv7a/cache.S rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/arm/src/armv7a/cache.S diff --git a/src/kernel_liteos_a/arch/arm/arm/src/clear_user.S b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/arm/src/clear_user.S similarity index 100% rename from src/kernel_liteos_a/arch/arm/arm/src/clear_user.S rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/arm/src/clear_user.S diff --git a/src/kernel_liteos_a/arch/arm/arm/src/hw_user_get.S b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/arm/src/hw_user_get.S similarity index 100% rename from src/kernel_liteos_a/arch/arm/arm/src/hw_user_get.S rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/arm/src/hw_user_get.S diff --git a/src/kernel_liteos_a/arch/arm/arm/src/hw_user_put.S b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/arm/src/hw_user_put.S similarity index 100% rename from src/kernel_liteos_a/arch/arm/arm/src/hw_user_put.S rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/arm/src/hw_user_put.S diff --git a/src/kernel_liteos_a/arch/arm/arm/src/include/armv7_pmu_pri.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/arm/src/include/armv7_pmu_pri.h similarity index 100% rename from src/kernel_liteos_a/arch/arm/arm/src/include/armv7_pmu_pri.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/arm/src/include/armv7_pmu_pri.h diff --git a/src/kernel_liteos_a/arch/arm/arm/src/include/asm.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/arm/src/include/asm.h similarity index 100% rename from src/kernel_liteos_a/arch/arm/arm/src/include/asm.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/arm/src/include/asm.h diff --git a/src/kernel_liteos_a/arch/arm/arm/src/include/los_exc_pri.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/arm/src/include/los_exc_pri.h similarity index 100% rename from src/kernel_liteos_a/arch/arm/arm/src/include/los_exc_pri.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/arm/src/include/los_exc_pri.h diff --git a/src/kernel_liteos_a/arch/arm/arm/src/include/los_hw_pri.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/arm/src/include/los_hw_pri.h similarity index 95% rename from src/kernel_liteos_a/arch/arm/arm/src/include/los_hw_pri.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/arm/src/include/los_hw_pri.h index 08e9e6bb..d764cc9b 100644 --- a/src/kernel_liteos_a/arch/arm/arm/src/include/los_hw_pri.h +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/arm/src/include/los_hw_pri.h @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2023 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -102,7 +102,7 @@ typedef struct { * Return : pointer to the task context */ extern VOID *OsTaskStackInit(UINT32 taskID, UINT32 stackSize, VOID *topStack, BOOL initFlag); -extern VOID OsUserCloneParentStack(VOID *childStack, UINTPTR sp, UINTPTR parentTopOfStask, UINT32 parentStackSize); +extern VOID OsUserCloneParentStack(VOID *childStack, UINTPTR parentTopOfStask, UINT32 parentStackSize); extern VOID OsUserTaskStackInit(TaskContext *context, UINTPTR taskEntry, UINTPTR stack); extern VOID OsInitSignalContext(const VOID *sp, VOID *signalContext, UINTPTR sigHandler, UINT32 signo, UINT32 param); extern void arm_clean_cache_range(UINTPTR start, UINTPTR end); diff --git a/src/kernel_liteos_a/arch/arm/arm/src/include/los_hwi_pri.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/arm/src/include/los_hwi_pri.h similarity index 95% rename from src/kernel_liteos_a/arch/arm/arm/src/include/los_hwi_pri.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/arm/src/include/los_hwi_pri.h index e0b62adb..174b0189 100644 --- a/src/kernel_liteos_a/arch/arm/arm/src/include/los_hwi_pri.h +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/arm/src/include/los_hwi_pri.h @@ -55,8 +55,8 @@ extern "C" { #define HWI_IS_REGISTED(num) ((&g_hwiForm[num])->pstNext != NULL) #endif extern VOID OsHwiInit(VOID); -extern VOID OsIncHwiFormCnt(UINT16 cpuid, UINT32 index); -extern UINT32 OsGetHwiFormCnt(UINT16 cpuid, UINT32 index); +extern VOID OsIncHwiFormCnt(UINT32 index); +extern UINT32 OsGetHwiFormCnt(UINT32 index); extern CHAR *OsGetHwiFormName(UINT32 index); extern VOID OsInterrupt(UINT32 intNum); extern VOID OsSyscallHandleInit(VOID); diff --git a/src/kernel_liteos_a/arch/arm/arm/src/jmp.S b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/arm/src/jmp.S similarity index 100% rename from src/kernel_liteos_a/arch/arm/arm/src/jmp.S rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/arm/src/jmp.S diff --git a/src/kernel_liteos_a/arch/arm/arm/src/los_arch_mmu.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/arm/src/los_arch_mmu.c similarity index 100% rename from src/kernel_liteos_a/arch/arm/arm/src/los_arch_mmu.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/arm/src/los_arch_mmu.c diff --git a/src/kernel_liteos_a/arch/arm/arm/src/los_asid.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/arm/src/los_asid.c similarity index 100% rename from src/kernel_liteos_a/arch/arm/arm/src/los_asid.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/arm/src/los_asid.c diff --git a/src/kernel_liteos_a/arch/arm/arm/src/los_dispatch.S b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/arm/src/los_dispatch.S similarity index 100% rename from src/kernel_liteos_a/arch/arm/arm/src/los_dispatch.S rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/arm/src/los_dispatch.S diff --git a/src/kernel_liteos_a/arch/arm/arm/src/los_exc.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/arm/src/los_exc.c similarity index 94% rename from src/kernel_liteos_a/arch/arm/arm/src/los_exc.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/arm/src/los_exc.c index f51ac52a..672e9396 100644 --- a/src/kernel_liteos_a/arch/arm/arm/src/los_exc.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/arm/src/los_exc.c @@ -74,7 +74,7 @@ STATIC UINTPTR g_minAddr; STATIC UINTPTR g_maxAddr; -STATIC UINT32 g_currHandleExcCpuid = INVALID_CPUID; +STATIC UINT32 g_currHandleExcCpuID = INVALID_CPUID; VOID OsExcHook(UINT32 excType, ExcContext *excBufAddr, UINT32 far, UINT32 fsr); UINT32 g_curNestCount[LOSCFG_KERNEL_CORE_NUM] = { 0 }; BOOL g_excFromUserMode[LOSCFG_KERNEL_CORE_NUM]; @@ -88,7 +88,6 @@ STATIC UINT32 g_nextExcWaitCpu = INVALID_CPUID; #define OS_MAX_BACKTRACE 15U #define DUMPSIZE 128U #define DUMPREGS 12U -#define COM_REGS 4U #define INSTR_SET_MASK 0x01000020U #define THUMB_INSTR_LEN 2U #define ARM_INSTR_LEN 4U @@ -113,11 +112,11 @@ STATIC const StackInfo g_excStack[] = { UINT32 OsGetSystemStatus(VOID) { UINT32 flag; - UINT32 cpuid = g_currHandleExcCpuid; + UINT32 cpuID = g_currHandleExcCpuID; - if (cpuid == INVALID_CPUID) { + if (cpuID == INVALID_CPUID) { flag = OS_SYSTEM_NORMAL; - } else if (cpuid == ArchCurrCpuid()) { + } else if (cpuID == ArchCurrCpuid()) { flag = OS_SYSTEM_EXC_CURR_CPU; } else { flag = OS_SYSTEM_EXC_OTHER_CPU; @@ -517,22 +516,13 @@ VOID OsDumpContextMem(const ExcContext *excBufAddr) return; } - for (excReg = &(excBufAddr->R0); count < COM_REGS; excReg++, count++) { + for (excReg = &(excBufAddr->R0); count <= DUMPREGS; excReg++, count++) { if (IS_VALID_ADDR(*excReg)) { PrintExcInfo("\ndump mem around R%u:%p", count, (*excReg)); OsDumpMemByte(DUMPSIZE, ((*excReg) - (DUMPSIZE >> 1))); } } - for (excReg = &(excBufAddr->R4); count < DUMPREGS; excReg++, count++) { - if (IS_VALID_ADDR(*excReg)) { - PrintExcInfo("\ndump mem around R%u:%p", count, (*excReg)); - OsDumpMemByte(DUMPSIZE, ((*excReg) - (DUMPSIZE >> 1))); - } - } - if (IS_VALID_ADDR(excBufAddr->R12)) { - PrintExcInfo("\ndump mem around R12:%p", excBufAddr->R12); - OsDumpMemByte(DUMPSIZE, (excBufAddr->R12 - (DUMPSIZE >> 1))); - } + if (IS_VALID_ADDR(excBufAddr->SP)) { PrintExcInfo("\ndump mem around SP:%p", excBufAddr->SP); OsDumpMemByte(DUMPSIZE, (excBufAddr->SP - (DUMPSIZE >> 1))); @@ -541,11 +531,11 @@ VOID OsDumpContextMem(const ExcContext *excBufAddr) STATIC VOID OsExcRestore(VOID) { - UINT32 currCpuid = ArchCurrCpuid(); + UINT32 currCpuID = ArchCurrCpuid(); - g_excFromUserMode[currCpuid] = FALSE; - g_intCount[currCpuid] = 0; - g_curNestCount[currCpuid] = 0; + g_excFromUserMode[currCpuID] = FALSE; + g_intCount[currCpuID] = 0; + g_curNestCount[currCpuID] = 0; #ifdef LOSCFG_KERNEL_SMP OsCpuStatusSet(CPU_RUNNING); #endif @@ -566,15 +556,15 @@ STATIC VOID OsUserExcHandle(ExcContext *excBufAddr) #ifdef LOSCFG_KERNEL_SMP LOS_SpinLock(&g_excSerializerSpin); if (g_nextExcWaitCpu != INVALID_CPUID) { - g_currHandleExcCpuid = g_nextExcWaitCpu; + g_currHandleExcCpuID = g_nextExcWaitCpu; g_nextExcWaitCpu = INVALID_CPUID; } else { - g_currHandleExcCpuid = INVALID_CPUID; + g_currHandleExcCpuID = INVALID_CPUID; } g_currHandleExcPID = OS_INVALID_VALUE; LOS_SpinUnlock(&g_excSerializerSpin); #else - g_currHandleExcCpuid = INVALID_CPUID; + g_currHandleExcCpuID = INVALID_CPUID; #endif #ifdef LOSCFG_KERNEL_SMP @@ -655,7 +645,6 @@ STATIC INLINE BOOL FindSuitableStack(UINTPTR regFP, UINTPTR *start, UINTPTR *end const StackInfo *stack = NULL; vaddr_t kvaddr; -#ifdef LOSCFG_KERNEL_VM if (g_excFromUserMode[ArchCurrCpuid()] == TRUE) { taskCB = OsCurrTaskGet(); stackStart = taskCB->userMapBase; @@ -666,7 +655,6 @@ STATIC INLINE BOOL FindSuitableStack(UINTPTR regFP, UINTPTR *start, UINTPTR *end } return found; } -#endif /* Search in the task stacks */ for (index = 0; index < g_taskMaxNum; index++) { @@ -991,14 +979,14 @@ VOID OsDataAbortExcHandleEntry(ExcContext *excBufAddr) #define EXC_WAIT_INTER 50U #define EXC_WAIT_TIME 2000U -STATIC VOID WaitAllCpuStop(UINT32 cpuid) +STATIC VOID WaitAllCpuStop(UINT32 cpuID) { UINT32 i; UINT32 time = 0; while (time < EXC_WAIT_TIME) { for (i = 0; i < LOSCFG_KERNEL_CORE_NUM; i++) { - if ((i != cpuid) && !OsCpuStatusIsHalt(i)) { + if ((i != cpuID) && !OsCpuStatusIsHalt(i)) { LOS_Mdelay(EXC_WAIT_INTER); time += EXC_WAIT_INTER; break; @@ -1012,19 +1000,19 @@ STATIC VOID WaitAllCpuStop(UINT32 cpuid) return; } -STATIC VOID OsWaitOtherCoresHandleExcEnd(UINT32 currCpuid) +STATIC VOID OsWaitOtherCoresHandleExcEnd(UINT32 currCpuID) { while (1) { LOS_SpinLock(&g_excSerializerSpin); - if ((g_currHandleExcCpuid == INVALID_CPUID) || (g_currHandleExcCpuid == currCpuid)) { - g_currHandleExcCpuid = currCpuid; + if ((g_currHandleExcCpuID == INVALID_CPUID) || (g_currHandleExcCpuID == currCpuID)) { + g_currHandleExcCpuID = currCpuID; g_currHandleExcPID = OsCurrProcessGet()->processID; LOS_SpinUnlock(&g_excSerializerSpin); break; } if (g_nextExcWaitCpu == INVALID_CPUID) { - g_nextExcWaitCpu = currCpuid; + g_nextExcWaitCpu = currCpuID; } LOS_SpinUnlock(&g_excSerializerSpin); LOS_Mdelay(EXC_WAIT_INTER); @@ -1033,7 +1021,7 @@ STATIC VOID OsWaitOtherCoresHandleExcEnd(UINT32 currCpuid) STATIC VOID OsCheckAllCpuStatus(VOID) { - UINT32 currCpuid = ArchCurrCpuid(); + UINT32 currCpuID = ArchCurrCpuid(); UINT32 ret, target; OsCpuStatusSet(CPU_EXC); @@ -1041,17 +1029,17 @@ STATIC VOID OsCheckAllCpuStatus(VOID) LOS_SpinLock(&g_excSerializerSpin); /* Only the current CPU anomaly */ - if (g_currHandleExcCpuid == INVALID_CPUID) { - g_currHandleExcCpuid = currCpuid; + if (g_currHandleExcCpuID == INVALID_CPUID) { + g_currHandleExcCpuID = currCpuID; g_currHandleExcPID = OsCurrProcessGet()->processID; LOS_SpinUnlock(&g_excSerializerSpin); #ifndef LOSCFG_SAVE_EXCINFO - if (g_excFromUserMode[currCpuid] == FALSE) { - target = (UINT32)(OS_MP_CPU_ALL & ~CPUID_TO_AFFI_MASK(currCpuid)); + if (g_excFromUserMode[currCpuID] == FALSE) { + target = (UINT32)(OS_MP_CPU_ALL & ~CPUID_TO_AFFI_MASK(currCpuID)); HalIrqSendIpi(target, LOS_MP_IPI_HALT); } #endif - } else if (g_excFromUserMode[currCpuid] == TRUE) { + } else if (g_excFromUserMode[currCpuID] == TRUE) { /* Both cores raise exceptions, and the current core is a user-mode exception. * Both cores are abnormal and come from the same process */ @@ -1063,12 +1051,12 @@ STATIC VOID OsCheckAllCpuStatus(VOID) } LOS_SpinUnlock(&g_excSerializerSpin); - OsWaitOtherCoresHandleExcEnd(currCpuid); + OsWaitOtherCoresHandleExcEnd(currCpuID); } else { - if ((g_currHandleExcCpuid < LOSCFG_KERNEL_CORE_NUM) && (g_excFromUserMode[g_currHandleExcCpuid] == TRUE)) { - g_currHandleExcCpuid = currCpuid; + if ((g_currHandleExcCpuID < LOSCFG_KERNEL_CORE_NUM) && (g_excFromUserMode[g_currHandleExcCpuID] == TRUE)) { + g_currHandleExcCpuID = currCpuID; LOS_SpinUnlock(&g_excSerializerSpin); - target = (UINT32)(OS_MP_CPU_ALL & ~CPUID_TO_AFFI_MASK(currCpuid)); + target = (UINT32)(OS_MP_CPU_ALL & ~CPUID_TO_AFFI_MASK(currCpuID)); HalIrqSendIpi(target, LOS_MP_IPI_HALT); } else { LOS_SpinUnlock(&g_excSerializerSpin); @@ -1078,7 +1066,7 @@ STATIC VOID OsCheckAllCpuStatus(VOID) #ifndef LOSCFG_SAVE_EXCINFO /* use halt ipi to stop other active cores */ if (g_excFromUserMode[ArchCurrCpuid()] == FALSE) { - WaitAllCpuStop(currCpuid); + WaitAllCpuStop(currCpuID); } #endif } @@ -1089,7 +1077,7 @@ STATIC VOID OsCheckCpuStatus(VOID) #ifdef LOSCFG_KERNEL_SMP OsCheckAllCpuStatus(); #else - g_currHandleExcCpuid = ArchCurrCpuid(); + g_currHandleExcCpuID = ArchCurrCpuid(); #endif } diff --git a/src/kernel_liteos_a/arch/arm/arm/src/los_hw.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/arm/src/los_hw.c similarity index 94% rename from src/kernel_liteos_a/arch/arm/arm/src/los_hw.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/arm/src/los_hw.c index ba04a89f..617c7c57 100644 --- a/src/kernel_liteos_a/arch/arm/arm/src/los_hw.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/arm/src/los_hw.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2023 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -103,7 +103,7 @@ LITE_OS_SEC_TEXT_INIT VOID *OsTaskStackInit(UINT32 taskID, UINT32 stackSize, VOI return (VOID *)taskContext; } -VOID OsUserCloneParentStack(VOID *childStack, UINTPTR sp, UINTPTR parentTopOfStack, UINT32 parentStackSize) +LITE_OS_SEC_TEXT VOID OsUserCloneParentStack(VOID *childStack, UINTPTR parentTopOfStack, UINT32 parentStackSize) { LosTaskCB *task = OsCurrTaskGet(); sig_cb *sigcb = &task->sig; @@ -117,10 +117,6 @@ VOID OsUserCloneParentStack(VOID *childStack, UINTPTR sp, UINTPTR parentTopOfSta (VOID)memcpy_s(childStack, sizeof(TaskContext), cloneStack, sizeof(TaskContext)); ((TaskContext *)childStack)->R0 = 0; - if (sp != 0) { - ((TaskContext *)childStack)->USP = TRUNCATE(sp, LOSCFG_STACK_POINT_ALIGN_SIZE); - ((TaskContext *)childStack)->ULR = 0; - } } LITE_OS_SEC_TEXT_INIT VOID OsUserTaskStackInit(TaskContext *context, UINTPTR taskEntry, UINTPTR stack) diff --git a/src/kernel_liteos_a/arch/arm/arm/src/los_hw_exc.S b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/arm/src/los_hw_exc.S similarity index 100% rename from src/kernel_liteos_a/arch/arm/arm/src/los_hw_exc.S rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/arm/src/los_hw_exc.S diff --git a/src/kernel_liteos_a/arch/arm/arm/src/los_hw_runstop.S b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/arm/src/los_hw_runstop.S similarity index 100% rename from src/kernel_liteos_a/arch/arm/arm/src/los_hw_runstop.S rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/arm/src/los_hw_runstop.S diff --git a/src/kernel_liteos_a/arch/arm/arm/src/los_hw_tick.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/arm/src/los_hw_tick.c similarity index 100% rename from src/kernel_liteos_a/arch/arm/arm/src/los_hw_tick.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/arm/src/los_hw_tick.c diff --git a/src/kernel_liteos_a/arch/arm/arm/src/los_hwi.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/arm/src/los_hwi.c similarity index 96% rename from src/kernel_liteos_a/arch/arm/arm/src/los_hwi.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/arm/src/los_hwi.c index dd41e50d..0fd86da5 100644 --- a/src/kernel_liteos_a/arch/arm/arm/src/los_hwi.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/arm/src/los_hwi.c @@ -46,11 +46,16 @@ LITE_OS_SEC_BSS SPIN_LOCK_INIT(g_hwiSpin); size_t g_intCount[LOSCFG_KERNEL_CORE_NUM] = {0}; HwiHandleForm g_hwiForm[OS_HWI_MAX_NUM]; STATIC CHAR *g_hwiFormName[OS_HWI_MAX_NUM] = {0}; -STATIC UINT32 g_hwiFormCnt[LOSCFG_KERNEL_CORE_NUM][OS_HWI_MAX_NUM] = {0}; +STATIC UINT32 g_hwiFormCnt[OS_HWI_MAX_NUM] = {0}; -UINT32 OsGetHwiFormCnt(UINT16 cpuid, UINT32 index) +VOID OsIncHwiFormCnt(UINT32 index) { - return g_hwiFormCnt[cpuid][index]; + g_hwiFormCnt[index]++; +} + +UINT32 OsGetHwiFormCnt(UINT32 index) +{ + return g_hwiFormCnt[index]; } CHAR *OsGetHwiFormName(UINT32 index) @@ -69,17 +74,16 @@ VOID OsInterrupt(UINT32 intNum) { HwiHandleForm *hwiForm = NULL; UINT32 *intCnt = NULL; - UINT16 cpuid = ArchCurrCpuid(); /* Must keep the operation at the beginning of the interface */ - intCnt = &g_intCount[cpuid]; + intCnt = &g_intCount[ArchCurrCpuid()]; *intCnt = *intCnt + 1; + OsSchedIrqStartTime(); + #ifdef LOSCFG_CPUP_INCLUDE_IRQ - OsCpupIrqStart(cpuid); + OsCpupIrqStart(); #endif - - OsSchedIrqStartTime(); OsHookCall(LOS_HOOK_TYPE_ISR_ENTER, intNum); hwiForm = (&g_hwiForm[intNum]); #ifndef LOSCFG_NO_SHARED_IRQ @@ -101,14 +105,14 @@ VOID OsInterrupt(UINT32 intNum) #ifndef LOSCFG_NO_SHARED_IRQ } #endif - ++g_hwiFormCnt[cpuid][intNum]; + ++g_hwiFormCnt[intNum]; OsHookCall(LOS_HOOK_TYPE_ISR_EXIT, intNum); - OsSchedIrqUsedTimeUpdate(); - #ifdef LOSCFG_CPUP_INCLUDE_IRQ - OsCpupIrqEnd(cpuid, intNum); + OsCpupIrqEnd(intNum); #endif + OsSchedIrqUpdateUsedTime(); + /* Must keep the operation at the end of the interface */ *intCnt = *intCnt - 1; } diff --git a/src/kernel_liteos_a/arch/arm/arm/src/pmu/armv7_pmu.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/arm/src/pmu/armv7_pmu.c similarity index 100% rename from src/kernel_liteos_a/arch/arm/arm/src/pmu/armv7_pmu.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/arm/src/pmu/armv7_pmu.c diff --git a/src/kernel_liteos_a/arch/arm/arm/src/smp.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/arm/src/smp.c similarity index 100% rename from src/kernel_liteos_a/arch/arm/arm/src/smp.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/arm/src/smp.c diff --git a/src/kernel_liteos_a/arch/arm/arm/src/startup/reset_vector_mp.S b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/arm/src/startup/reset_vector_mp.S similarity index 96% rename from src/kernel_liteos_a/arch/arm/arm/src/startup/reset_vector_mp.S rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/arm/src/startup/reset_vector_mp.S index 11c74afc..7f7e2962 100644 --- a/src/kernel_liteos_a/arch/arm/arm/src/startup/reset_vector_mp.S +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/arm/src/startup/reset_vector_mp.S @@ -121,9 +121,8 @@ reset_vector: mcr p15, 0, r0, c13, c0, 4 /* do some early cpu setup: i/d cache disable, mmu disabled */ mrc p15, 0, r0, c1, c0, 0 - bic r0, #(1 << 12) /* i cache */ - bic r0, #(1 << 2) /* d cache */ - bic r0, #(1 << 0) /* mmu */ + bic r0, #(1<<12) + bic r0, #(1<<2 | 1<<0) mcr p15, 0, r0, c1, c0, 0 /* enable fpu+neon */ @@ -276,18 +275,18 @@ mmu_setup: mov r12, #0x7 /* 0b0111 */ mcr p15, 0, r12, c3, c0, 0 /* Set DACR with 0b0111, client and manager domian */ isb - mrc p15, 0, r12, c1, c0, 1 /* ACTLR, Auxiliary Control Register */ + mrc p15, 0, r12, c1, c0, 1 /* ACTLR, Auxlliary Control Register */ orr r12, r12, #(1 << 6) /* SMP, Enables coherent requests to the processor. */ orr r12, r12, #(1 << 2) /* Enable D-side prefetch */ orr r12, r12, #(1 << 11) /* Global BP Enable bit */ - mcr p15, 0, r12, c1, c0, 1 /* ACTLR, Auxiliary Control Register */ + mcr p15, 0, r12, c1, c0, 1 /* ACTLR, Auxlliary Control Register */ dsb mrc p15, 0, r12, c1, c0, 0 - bic r12, #(1 << 29 | 1 << 28) /* Disable TRE/AFE */ - orr r12, #(1 << 0) /* mmu enable */ + bic r12, #(1 << 29 | 1 << 28) + orr r12, #(1 << 0) bic r12, #(1 << 1) - orr r12, #(1 << 2) /* D cache enable */ - orr r12, #(1 << 12) /* I cache enable */ + orr r12, #(1 << 2) + orr r12, #(1 << 12) mcr p15, 0, r12, c1, c0, 0 /* Set SCTLR with r12: Turn on the MMU, I/D cache Disable TRE/AFE */ isb ldr pc, =1f /* Convert to VA */ diff --git a/src/kernel_liteos_a/arch/arm/arm/src/startup/reset_vector_up.S b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/arm/src/startup/reset_vector_up.S similarity index 96% rename from src/kernel_liteos_a/arch/arm/arm/src/startup/reset_vector_up.S rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/arm/src/startup/reset_vector_up.S index a54f468a..75994ac1 100644 --- a/src/kernel_liteos_a/arch/arm/arm/src/startup/reset_vector_up.S +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/arm/src/startup/reset_vector_up.S @@ -101,9 +101,8 @@ __exception_handlers: reset_vector: /* do some early cpu setup: i/d cache disable, mmu disabled */ mrc p15, 0, r0, c1, c0, 0 - bic r0, #(1 << 12) /* i cache */ - bic r0, #(1 << 2) /* d cache */ - bic r0, #(1 << 0) /* mmu */ + bic r0, #(1<<12) + bic r0, #(1<<2 | 1<<0) mcr p15, 0, r0, c1, c0, 0 /* enable fpu+neon */ @@ -270,11 +269,11 @@ mmu_setup: isb mrc p15, 0, r12, c1, c0, 0 - bic r12, #(1 << 29 | 1 << 28) /* Disable TRE/AFE */ - orr r12, #(1 << 0) /* mmu enable */ + bic r12, #(1 << 29 | 1 << 28) + orr r12, #(1 << 0) bic r12, #(1 << 1) - orr r12, #(1 << 2) /* D cache enable */ - orr r12, #(1 << 12) /* I cache enable */ + orr r12, #(1 << 2) + orr r12, #(1 << 12) mcr p15, 0, r12, c1, c0, 0 /* Set SCTLR with r12: Turn on the MMU, I/D cache Disable TRE/AFE */ isb diff --git a/src/kernel_liteos_a/arch/arm/arm/src/strncpy_from_user.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/arm/src/strncpy_from_user.c similarity index 97% rename from src/kernel_liteos_a/arch/arm/arm/src/strncpy_from_user.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/arm/src/strncpy_from_user.c index 1d6c6634..5d3e9cd5 100644 --- a/src/kernel_liteos_a/arch/arm/arm/src/strncpy_from_user.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/arm/src/strncpy_from_user.c @@ -46,7 +46,7 @@ INT32 LOS_StrncpyFromUser(CHAR *dst, const CHAR *src, INT32 count) } maxCount = (LOS_IsUserAddressRange((VADDR_T)(UINTPTR)src, (size_t)count)) ? \ - count : (INT32)(USER_ASPACE_TOP_MAX - (UINTPTR)src); + count : (USER_ASPACE_TOP_MAX - (UINTPTR)src); for (i = 0; i < maxCount; ++i) { if (LOS_GetUser(&character, src + offset) != LOS_OK) { diff --git a/src/kernel_liteos_a/arch/arm/arm/src/strnlen_user.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/arm/src/strnlen_user.c similarity index 100% rename from src/kernel_liteos_a/arch/arm/arm/src/strnlen_user.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/arm/src/strnlen_user.c diff --git a/src/kernel_liteos_a/arch/arm/arm/src/user_copy.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/arm/src/user_copy.c similarity index 100% rename from src/kernel_liteos_a/arch/arm/arm/src/user_copy.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/arm/src/user_copy.c diff --git a/src/kernel_liteos_a/arch/arm/gic/BUILD.gn b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/gic/BUILD.gn similarity index 100% rename from src/kernel_liteos_a/arch/arm/gic/BUILD.gn rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/gic/BUILD.gn diff --git a/src/kernel_liteos_a/arch/arm/gic/Makefile b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/gic/Makefile similarity index 100% rename from src/kernel_liteos_a/arch/arm/gic/Makefile rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/gic/Makefile diff --git a/src/kernel_liteos_a/arch/arm/gic/gic_v2.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/gic/gic_v2.c similarity index 100% rename from src/kernel_liteos_a/arch/arm/gic/gic_v2.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/gic/gic_v2.c diff --git a/src/kernel_liteos_a/arch/arm/gic/gic_v3.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/gic/gic_v3.c similarity index 100% rename from src/kernel_liteos_a/arch/arm/gic/gic_v3.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/gic/gic_v3.c diff --git a/src/kernel_liteos_a/arch/arm/include/gic_common.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/include/gic_common.h similarity index 100% rename from src/kernel_liteos_a/arch/arm/include/gic_common.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/include/gic_common.h diff --git a/src/kernel_liteos_a/arch/arm/include/gic_v3.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/include/gic_v3.h similarity index 100% rename from src/kernel_liteos_a/arch/arm/include/gic_v3.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/include/gic_v3.h diff --git a/src/kernel_liteos_a/arch/arm/include/hal_hwi.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/include/hal_hwi.h similarity index 100% rename from src/kernel_liteos_a/arch/arm/include/hal_hwi.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/include/hal_hwi.h diff --git a/src/kernel_liteos_a/arch/arm/include/in_cksum.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/include/in_cksum.h similarity index 100% rename from src/kernel_liteos_a/arch/arm/include/in_cksum.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/include/in_cksum.h diff --git a/src/kernel_liteos_a/arch/arm/include/los_exc.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/include/los_exc.h similarity index 100% rename from src/kernel_liteos_a/arch/arm/include/los_exc.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/include/los_exc.h diff --git a/src/kernel_liteos_a/arch/arm/include/los_hw.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/include/los_hw.h similarity index 100% rename from src/kernel_liteos_a/arch/arm/include/los_hw.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/include/los_hw.h diff --git a/src/kernel_liteos_a/arch/arm/include/los_hw_arch.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/include/los_hw_arch.h similarity index 100% rename from src/kernel_liteos_a/arch/arm/include/los_hw_arch.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/include/los_hw_arch.h diff --git a/src/kernel_liteos_a/arch/arm/include/los_hw_tick_pri.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/include/los_hw_tick_pri.h similarity index 100% rename from src/kernel_liteos_a/arch/arm/include/los_hw_tick_pri.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/include/los_hw_tick_pri.h diff --git a/src/kernel_liteos_a/arch/arm/include/los_hwi.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/include/los_hwi.h similarity index 100% rename from src/kernel_liteos_a/arch/arm/include/los_hwi.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/include/los_hwi.h diff --git a/src/kernel_liteos_a/arch/arm/include/los_strncpy_from_user.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/include/los_strncpy_from_user.h similarity index 100% rename from src/kernel_liteos_a/arch/arm/include/los_strncpy_from_user.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/include/los_strncpy_from_user.h diff --git a/src/kernel_liteos_a/arch/arm/include/los_strnlen_user.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/include/los_strnlen_user.h similarity index 100% rename from src/kernel_liteos_a/arch/arm/include/los_strnlen_user.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/include/los_strnlen_user.h diff --git a/src/kernel_liteos_a/arch/arm/include/los_sys_stack_pri.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/include/los_sys_stack_pri.h similarity index 100% rename from src/kernel_liteos_a/arch/arm/include/los_sys_stack_pri.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/include/los_sys_stack_pri.h diff --git a/src/kernel_liteos_a/arch/arm/include/los_user_get.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/include/los_user_get.h similarity index 100% rename from src/kernel_liteos_a/arch/arm/include/los_user_get.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/include/los_user_get.h diff --git a/src/kernel_liteos_a/arch/arm/include/los_user_put.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/include/los_user_put.h similarity index 100% rename from src/kernel_liteos_a/arch/arm/include/los_user_put.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/include/los_user_put.h diff --git a/src/kernel_liteos_a/arch/arm/include/perf.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/include/perf.h similarity index 100% rename from src/kernel_liteos_a/arch/arm/include/perf.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/include/perf.h diff --git a/src/kernel_liteos_a/arch/arm/include/user_copy.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/include/user_copy.h similarity index 100% rename from src/kernel_liteos_a/arch/arm/include/user_copy.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/arm/include/user_copy.h diff --git a/src/kernel_liteos_a/arch/cpu.mk b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/cpu.mk similarity index 100% rename from src/kernel_liteos_a/arch/cpu.mk rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/arch/cpu.mk diff --git a/src/kernel_liteos_a/bsd/BUILD.gn b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/bsd/BUILD.gn similarity index 100% rename from src/kernel_liteos_a/bsd/BUILD.gn rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/bsd/BUILD.gn diff --git a/src/kernel_liteos_a/bsd/Kconfig b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/bsd/Kconfig similarity index 100% rename from src/kernel_liteos_a/bsd/Kconfig rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/bsd/Kconfig diff --git a/src/kernel_liteos_a/bsd/Makefile b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/bsd/Makefile similarity index 100% rename from src/kernel_liteos_a/bsd/Makefile rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/bsd/Makefile diff --git a/src/kernel_liteos_a/bsd/compat/linuxkpi/BUILD.gn b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/bsd/compat/linuxkpi/BUILD.gn similarity index 100% rename from src/kernel_liteos_a/bsd/compat/linuxkpi/BUILD.gn rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/bsd/compat/linuxkpi/BUILD.gn diff --git a/src/kernel_liteos_a/bsd/compat/linuxkpi/Makefile b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/bsd/compat/linuxkpi/Makefile similarity index 100% rename from src/kernel_liteos_a/bsd/compat/linuxkpi/Makefile rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/bsd/compat/linuxkpi/Makefile diff --git a/src/kernel_liteos_a/bsd/dev/usb/BUILD.gn b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/bsd/dev/usb/BUILD.gn similarity index 100% rename from src/kernel_liteos_a/bsd/dev/usb/BUILD.gn rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/bsd/dev/usb/BUILD.gn diff --git a/src/kernel_liteos_a/bsd/dev/usb/Kconfig b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/bsd/dev/usb/Kconfig similarity index 100% rename from src/kernel_liteos_a/bsd/dev/usb/Kconfig rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/bsd/dev/usb/Kconfig diff --git a/src/kernel_liteos_a/bsd/dev/usb/Makefile b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/bsd/dev/usb/Makefile similarity index 87% rename from src/kernel_liteos_a/bsd/dev/usb/Makefile rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/bsd/dev/usb/Makefile index 2d465482..f01ea12d 100644 --- a/src/kernel_liteos_a/bsd/dev/usb/Makefile +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/bsd/dev/usb/Makefile @@ -28,7 +28,7 @@ # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. include $(LITEOSTOPDIR)/config.mk -include $(LITEOSTOPDIR)/../../drivers/hdf_core/adapter/khdf/liteos/lite.mk +include $(LITEOSTOPDIR)/../../drivers/adapter/khdf/liteos/lite.mk MODULE_NAME := usb_base @@ -122,13 +122,13 @@ LOCAL_SRCS += $(STORAGE_SRC)/umass.c endif ifeq ($(LOSCFG_DRIVERS_USB_HID_CLASS)_$(LOSCFG_DRIVERS_HDF_INPUT), y_y) -LOCAL_FLAGS += -I$(LITEOSTOPDIR)/../../drivers/hdf_core/framework/model/input/driver \ - -I$(LITEOSTOPDIR)/../../drivers/hdf_core/framework/include/core \ - -I$(LITEOSTOPDIR)/../../drivers/hdf_core/framework/core/common/include/host \ - -I$(LITEOSTOPDIR)/../../drivers/hdf_core/framework/utils \ - -I$(LITEOSTOPDIR)/../../drivers/hdf_core/framework/osal \ - -I$(LITEOSTOPDIR)/../../drivers/hdf_core/framework/ability/sbuf/include \ - -I$(LITEOSTOPDIR)/../../drivers/hdf_core/framework/include/osal \ +LOCAL_FLAGS += -I$(LITEOSTOPDIR)/../../drivers/framework/model/input/driver \ + -I$(LITEOSTOPDIR)/../../drivers/framework/include/core \ + -I$(LITEOSTOPDIR)/../../drivers/framework/core/common/include/host \ + -I$(LITEOSTOPDIR)/../../drivers/framework/utils \ + -I$(LITEOSTOPDIR)/../../drivers/framework/osal \ + -I$(LITEOSTOPDIR)/../../drivers/framework/ability/sbuf/include \ + -I$(LITEOSTOPDIR)/../../drivers/framework/include/osal \ -I$(LITEOSTOPDIR)/../../third_party/FreeBSD/sys/dev/evdev LOCAL_SRCS += $(INPUT_SRC)/uhid.c \ diff --git a/src/kernel_liteos_a/build.sh b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/build.sh similarity index 100% rename from src/kernel_liteos_a/build.sh rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/build.sh diff --git a/src/kernel_liteos_a/bundle.json b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/bundle.json similarity index 94% rename from src/kernel_liteos_a/bundle.json rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/bundle.json index cccbce32..1a70a918 100644 --- a/src/kernel_liteos_a/bundle.json +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/bundle.json @@ -28,10 +28,10 @@ "name": "liteos_a", "subsystem": "kernel", "syscap": [ - "SystemCapability.Kernel.Liteos-A" + "SystemCapability.Kernel.liteos-a" ], "features": [], - "adapted_system_type": [ + "adated_system_type": [ "small" ], "rom": "1.5MB", diff --git a/src/kernel_liteos_a/compat/BUILD.gn b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/compat/BUILD.gn similarity index 100% rename from src/kernel_liteos_a/compat/BUILD.gn rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/compat/BUILD.gn diff --git a/src/kernel_liteos_a/compat/posix/BUILD.gn b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/compat/posix/BUILD.gn similarity index 100% rename from src/kernel_liteos_a/compat/posix/BUILD.gn rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/compat/posix/BUILD.gn diff --git a/src/kernel_liteos_a/compat/posix/Kconfig b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/compat/posix/Kconfig similarity index 100% rename from src/kernel_liteos_a/compat/posix/Kconfig rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/compat/posix/Kconfig diff --git a/src/kernel_liteos_a/compat/posix/Makefile b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/compat/posix/Makefile similarity index 100% rename from src/kernel_liteos_a/compat/posix/Makefile rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/compat/posix/Makefile diff --git a/src/kernel_liteos_a/compat/posix/include/mqueue.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/compat/posix/include/mqueue.h similarity index 98% rename from src/kernel_liteos_a/compat/posix/include/mqueue.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/compat/posix/include/mqueue.h index 551dd06a..c15554a2 100644 --- a/src/kernel_liteos_a/compat/posix/include/mqueue.h +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/compat/posix/include/mqueue.h @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2023 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -74,10 +74,6 @@ extern "C" { /* not support prio */ #define MQ_PRIO_MAX 1 -#ifndef MAX_MQ_FD -#define MAX_MQ_FD CONFIG_NQUEUE_DESCRIPTORS -#endif - typedef union send_receive_t { unsigned oth : 3; unsigned grp : 6; @@ -428,7 +424,6 @@ extern ssize_t mq_timedreceive(mqd_t personal, char *msg, size_t msgLen, extern void MqueueRefer(int sysFd); extern int OsMqNotify(mqd_t personal, const struct sigevent *sigev); -extern VOID OsMqueueCBDestroy(struct mqarray *queueTable); #ifdef __cplusplus #if __cplusplus diff --git a/src/kernel_liteos_a/compat/posix/include/time_posix.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/compat/posix/include/time_posix.h similarity index 100% rename from src/kernel_liteos_a/compat/posix/include/time_posix.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/compat/posix/include/time_posix.h diff --git a/src/kernel_liteos_a/compat/posix/src/errno.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/compat/posix/src/errno.c similarity index 100% rename from src/kernel_liteos_a/compat/posix/src/errno.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/compat/posix/src/errno.c diff --git a/src/kernel_liteos_a/compat/posix/src/malloc.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/compat/posix/src/malloc.c similarity index 100% rename from src/kernel_liteos_a/compat/posix/src/malloc.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/compat/posix/src/malloc.c diff --git a/src/kernel_liteos_a/compat/posix/src/map_error.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/compat/posix/src/map_error.c similarity index 100% rename from src/kernel_liteos_a/compat/posix/src/map_error.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/compat/posix/src/map_error.c diff --git a/src/kernel_liteos_a/compat/posix/src/map_error.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/compat/posix/src/map_error.h similarity index 100% rename from src/kernel_liteos_a/compat/posix/src/map_error.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/compat/posix/src/map_error.h diff --git a/src/kernel_liteos_a/compat/posix/src/misc.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/compat/posix/src/misc.c similarity index 94% rename from src/kernel_liteos_a/compat/posix/src/misc.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/compat/posix/src/misc.c index 9f619070..d3ae7e4d 100644 --- a/src/kernel_liteos_a/compat/posix/src/misc.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/compat/posix/src/misc.c @@ -53,27 +53,21 @@ int uname(struct utsname *name) { - if (name == NULL) { - return -EFAULT; - } + INT32 ret; + const char *cpuInfo = NULL; -#ifdef LOSCFG_UTS_CONTAINER - struct utsname *currentUtsName = OsGetCurrUtsName(); - if (currentUtsName == NULL) { + if (name == NULL) { return -EFAULT; } - (VOID)memcpy_s(name, sizeof(struct utsname), currentUtsName, sizeof(struct utsname)); -#else - (VOID)strcpy_s(name->sysname, sizeof(name->sysname), KERNEL_NAME); - (VOID)strcpy_s(name->nodename, sizeof(name->nodename), KERNEL_NODE_NAME); - INT32 ret = sprintf_s(name->version, sizeof(name->version), "%s %u.%u.%u.%u %s %s", - KERNEL_NAME, KERNEL_MAJOR, KERNEL_MINOR, KERNEL_PATCH, KERNEL_ITRE, __DATE__, __TIME__); + (VOID)strcpy_s(name->nodename, sizeof(name->nodename), "hisilicon"); + ret = sprintf_s(name->version, sizeof(name->version), "%s %u.%u.%u.%u %s %s", + KERNEL_NAME, KERNEL_MAJOR, KERNEL_MINOR, KERNEL_PATCH, KERNEL_ITRE, __DATE__, __TIME__); if (ret < 0) { return -EIO; } - const char *cpuInfo = LOS_CpuInfo(); + cpuInfo = LOS_CpuInfo(); (VOID)strcpy_s(name->machine, sizeof(name->machine), cpuInfo); ret = sprintf_s(name->release, sizeof(name->release), "%u.%u.%u.%u", KERNEL_MAJOR, KERNEL_MINOR, KERNEL_PATCH, KERNEL_ITRE); @@ -82,7 +76,6 @@ int uname(struct utsname *name) } name->domainname[0] = '\0'; -#endif return 0; } diff --git a/src/kernel_liteos_a/compat/posix/src/mqueue.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/compat/posix/src/mqueue.c similarity index 89% rename from src/kernel_liteos_a/compat/posix/src/mqueue.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/compat/posix/src/mqueue.c index 0b885d86..8e67b035 100644 --- a/src/kernel_liteos_a/compat/posix/src/mqueue.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/compat/posix/src/mqueue.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2023 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -44,19 +44,16 @@ #define FNONBLOCK O_NONBLOCK -#ifndef LOSCFG_IPC_CONTAINER +#ifndef MAX_MQ_FD +#define MAX_MQ_FD CONFIG_NQUEUE_DESCRIPTORS +#endif + /* GLOBALS */ STATIC fd_set g_queueFdSet; STATIC struct mqarray g_queueTable[LOSCFG_BASE_IPC_QUEUE_LIMIT]; STATIC pthread_mutex_t g_mqueueMutex = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP; STATIC struct mqpersonal *g_mqPrivBuf[MAX_MQ_FD]; -#define IPC_QUEUE_FD_SET g_queueFdSet -#define IPC_QUEUE_TABLE g_queueTable -#define IPC_QUEUE_MUTEX g_mqueueMutex -#define IPC_QUEUE_MQ_PRIV_BUF g_mqPrivBuf -#endif - /* LOCAL FUNCTIONS */ STATIC INLINE INT32 MqNameCheck(const CHAR *mqName) { @@ -99,12 +96,12 @@ STATIC INLINE struct mqarray *GetMqueueCBByName(const CHAR *name) UINT32 mylen = strlen(name); for (index = 0; index < LOSCFG_BASE_IPC_QUEUE_LIMIT; index++) { - if ((IPC_QUEUE_TABLE[index].mq_name == NULL) || (strlen(IPC_QUEUE_TABLE[index].mq_name) != mylen)) { + if ((g_queueTable[index].mq_name == NULL) || (strlen(g_queueTable[index].mq_name) != mylen)) { continue; } - if (strncmp(name, (const CHAR *)(IPC_QUEUE_TABLE[index].mq_name), mylen) == 0) { - return &(IPC_QUEUE_TABLE[index]); + if (strncmp(name, (const CHAR *)(g_queueTable[index].mq_name), mylen) == 0) { + return &(g_queueTable[index]); } } return NULL; @@ -113,9 +110,7 @@ STATIC INLINE struct mqarray *GetMqueueCBByName(const CHAR *name) STATIC INT32 DoMqueueDelete(struct mqarray *mqueueCB) { UINT32 ret; -#ifdef LOSCFG_KERNEL_IPC_PLIMIT - OsIPCLimitMqFree(); -#endif + if (mqueueCB->mq_name != NULL) { LOS_MemFree(OS_SYS_MEM_ADDR, mqueueCB->mq_name); mqueueCB->mq_name = NULL; @@ -165,36 +160,18 @@ STATIC int SaveMqueueName(const CHAR *mqName, struct mqarray *mqueueCB) return LOS_OK; } -STATIC VOID MqueueCBInit(struct mqarray *mqueueCB, const struct mq_attr *attr, INT32 openFlag, UINT32 mode) -{ - mqueueCB->unlinkflag = FALSE; - mqueueCB->unlink_ref = 0; - mqueueCB->mq_personal->mq_status = MQ_USE_MAGIC; - mqueueCB->mq_personal->mq_next = NULL; - mqueueCB->mq_personal->mq_posixdes = mqueueCB; - mqueueCB->mq_personal->mq_flags = (INT32)((UINT32)openFlag | ((UINT32)attr->mq_flags & (UINT32)FNONBLOCK)); - mqueueCB->mq_personal->mq_mode = mode; - mqueueCB->mq_personal->mq_refcount = 0; - mqueueCB->mq_notify.pid = 0; -} - STATIC struct mqpersonal *DoMqueueCreate(const struct mq_attr *attr, const CHAR *mqName, INT32 openFlag, UINT32 mode) { struct mqarray *mqueueCB = NULL; UINT32 mqueueID; -#ifdef LOSCFG_KERNEL_IPC_PLIMIT - if (OsIPCLimitMqAlloc() != LOS_OK) { - return (struct mqpersonal *)-1; - } -#endif UINT32 err = LOS_QueueCreate(NULL, attr->mq_maxmsg, &mqueueID, 0, attr->mq_msgsize); if (map_errno(err) != ENOERR) { goto ERROUT; } - if (IPC_QUEUE_TABLE[GET_QUEUE_INDEX(mqueueID)].mqcb == NULL) { - mqueueCB = &(IPC_QUEUE_TABLE[GET_QUEUE_INDEX(mqueueID)]); + if (g_queueTable[GET_QUEUE_INDEX(mqueueID)].mqcb == NULL) { + mqueueCB = &(g_queueTable[GET_QUEUE_INDEX(mqueueID)]); mqueueCB->mq_id = mqueueID; } @@ -221,7 +198,15 @@ STATIC struct mqpersonal *DoMqueueCreate(const struct mq_attr *attr, const CHAR goto ERROUT; } - MqueueCBInit(mqueueCB, attr, openFlag, mode); + mqueueCB->unlinkflag = FALSE; + mqueueCB->unlink_ref = 0; + mqueueCB->mq_personal->mq_status = MQ_USE_MAGIC; + mqueueCB->mq_personal->mq_next = NULL; + mqueueCB->mq_personal->mq_posixdes = mqueueCB; + mqueueCB->mq_personal->mq_flags = (INT32)((UINT32)openFlag | ((UINT32)attr->mq_flags & (UINT32)FNONBLOCK)); + mqueueCB->mq_personal->mq_mode = mode; + mqueueCB->mq_personal->mq_refcount = 0; + mqueueCB->mq_notify.pid = 0; return mqueueCB->mq_personal; ERROUT: @@ -230,9 +215,6 @@ ERROUT: LOS_MemFree(OS_SYS_MEM_ADDR, mqueueCB->mq_name); mqueueCB->mq_name = NULL; } -#ifdef LOSCFG_KERNEL_IPC_PLIMIT - OsIPCLimitMqFree(); -#endif return (struct mqpersonal *)-1; } @@ -315,7 +297,7 @@ STATIC struct mqpersonal *MqGetPrivDataBuff(mqd_t personal) errno = EBADF; return NULL; } - return IPC_QUEUE_MQ_PRIV_BUF[id]; + return g_mqPrivBuf[id]; } /** @@ -329,13 +311,13 @@ STATIC struct mqpersonal *MqGetPrivDataBuff(mqd_t personal) STATIC INT32 MqAllocSysFd(int maxfdp, struct mqpersonal *privateMqPersonal) { INT32 i; - fd_set *fdset = &IPC_QUEUE_FD_SET; + fd_set *fdset = &g_queueFdSet; for (i = 0; i < maxfdp; i++) { /* sysFd: used bit setting, and get the index of swtmrID buffer */ if (fdset && !(FD_ISSET(i + MQUEUE_FD_OFFSET, fdset))) { FD_SET(i + MQUEUE_FD_OFFSET, fdset); - if (!IPC_QUEUE_MQ_PRIV_BUF[i]) { - IPC_QUEUE_MQ_PRIV_BUF[i] = privateMqPersonal; + if (!g_mqPrivBuf[i]) { + g_mqPrivBuf[i] = privateMqPersonal; return i + MQUEUE_FD_OFFSET; } } @@ -346,10 +328,10 @@ STATIC INT32 MqAllocSysFd(int maxfdp, struct mqpersonal *privateMqPersonal) STATIC VOID MqFreeSysFd(mqd_t personal) { INT32 sysFd = (INT32)personal; - fd_set *fdset = &IPC_QUEUE_FD_SET; + fd_set *fdset = &g_queueFdSet; if (fdset && FD_ISSET(sysFd, fdset)) { FD_CLR(sysFd, fdset); - IPC_QUEUE_MQ_PRIV_BUF[sysFd - MQUEUE_FD_OFFSET] = NULL; + g_mqPrivBuf[sysFd - MQUEUE_FD_OFFSET] = NULL; } } @@ -359,7 +341,7 @@ void MqueueRefer(int sysFd) struct mqarray *mqueueCB = NULL; struct mqpersonal *privateMqPersonal = NULL; - (VOID)pthread_mutex_lock(&IPC_QUEUE_MUTEX); + (VOID)pthread_mutex_lock(&g_mqueueMutex); /* Get the personal sysFd and reset personal fd -1 */ privateMqPersonal = MqGetPrivDataBuff((mqd_t)sysFd); if (privateMqPersonal == NULL) { @@ -372,7 +354,7 @@ void MqueueRefer(int sysFd) privateMqPersonal->mq_refcount++; OUT_UNLOCK: - (VOID)pthread_mutex_unlock(&IPC_QUEUE_MUTEX); + (VOID)pthread_mutex_unlock(&g_mqueueMutex); return; } @@ -516,7 +498,7 @@ mqd_t mq_open(const char *mqName, int openFlag, ...) return (mqd_t)-1; } - (VOID)pthread_mutex_lock(&IPC_QUEUE_MUTEX); + (VOID)pthread_mutex_lock(&g_mqueueMutex); mqueueCB = GetMqueueCBByName(mqName); if ((UINT32)openFlag & (UINT32)O_CREAT) { if (mqueueCB != NULL) { @@ -561,7 +543,7 @@ mqd_t mq_open(const char *mqName, int openFlag, ...) mqFd = (mqd_t)sysFd; } OUT: - (VOID)pthread_mutex_unlock(&IPC_QUEUE_MUTEX); + (VOID)pthread_mutex_unlock(&g_mqueueMutex); return mqFd; } @@ -570,7 +552,7 @@ int mq_close(mqd_t personal) INT32 ret = -1; struct mqpersonal *privateMqPersonal = NULL; - (VOID)pthread_mutex_lock(&IPC_QUEUE_MUTEX); + (VOID)pthread_mutex_lock(&g_mqueueMutex); /* Get the personal sysFd and reset personal fd -1 */ privateMqPersonal = MqGetPrivDataBuff(personal); @@ -595,7 +577,7 @@ int mq_close(mqd_t personal) MqFreeSysFd(personal); OUT_UNLOCK: - (VOID)pthread_mutex_unlock(&IPC_QUEUE_MUTEX); + (VOID)pthread_mutex_unlock(&g_mqueueMutex); return ret; } @@ -614,10 +596,10 @@ int OsMqGetAttr(mqd_t personal, struct mq_attr *mqAttr) return -1; } - (VOID)pthread_mutex_lock(&IPC_QUEUE_MUTEX); + (VOID)pthread_mutex_lock(&g_mqueueMutex); if (privateMqPersonal->mq_status != MQ_USE_MAGIC) { errno = EBADF; - (VOID)pthread_mutex_unlock(&IPC_QUEUE_MUTEX); + (VOID)pthread_mutex_unlock(&g_mqueueMutex); return -1; } @@ -626,7 +608,7 @@ int OsMqGetAttr(mqd_t personal, struct mq_attr *mqAttr) mqAttr->mq_msgsize = mqueueCB->mqcb->queueSize - sizeof(UINT32); mqAttr->mq_curmsgs = mqueueCB->mqcb->readWriteableCnt[OS_QUEUE_READ]; mqAttr->mq_flags = privateMqPersonal->mq_flags; - (VOID)pthread_mutex_unlock(&IPC_QUEUE_MUTEX); + (VOID)pthread_mutex_unlock(&g_mqueueMutex); return 0; } @@ -644,10 +626,10 @@ int OsMqSetAttr(mqd_t personal, const struct mq_attr *mqSetAttr, struct mq_attr return -1; } - (VOID)pthread_mutex_lock(&IPC_QUEUE_MUTEX); + (VOID)pthread_mutex_lock(&g_mqueueMutex); if (privateMqPersonal->mq_status != MQ_USE_MAGIC) { errno = EBADF; - (VOID)pthread_mutex_unlock(&IPC_QUEUE_MUTEX); + (VOID)pthread_mutex_unlock(&g_mqueueMutex); return -1; } @@ -659,7 +641,7 @@ int OsMqSetAttr(mqd_t personal, const struct mq_attr *mqSetAttr, struct mq_attr if (((UINT32)mqSetAttr->mq_flags & (UINT32)FNONBLOCK) == (UINT32)FNONBLOCK) { privateMqPersonal->mq_flags = (INT32)((UINT32)privateMqPersonal->mq_flags | (UINT32)FNONBLOCK); } - (VOID)pthread_mutex_unlock(&IPC_QUEUE_MUTEX); + (VOID)pthread_mutex_unlock(&g_mqueueMutex); return 0; } @@ -680,7 +662,7 @@ int mq_unlink(const char *mqName) return -1; } - (VOID)pthread_mutex_lock(&IPC_QUEUE_MUTEX); + (VOID)pthread_mutex_lock(&g_mqueueMutex); mqueueCB = GetMqueueCBByName(mqName); if (mqueueCB == NULL) { errno = ENOENT; @@ -693,11 +675,11 @@ int mq_unlink(const char *mqName) ret = DoMqueueDelete(mqueueCB); } - (VOID)pthread_mutex_unlock(&IPC_QUEUE_MUTEX); + (VOID)pthread_mutex_unlock(&g_mqueueMutex); return ret; ERROUT_UNLOCK: - (VOID)pthread_mutex_unlock(&IPC_QUEUE_MUTEX); + (VOID)pthread_mutex_unlock(&g_mqueueMutex); return -1; } @@ -785,7 +767,7 @@ int mq_timedsend(mqd_t personal, const char *msg, size_t msgLen, unsigned int ms OS_MQ_GOTO_ERROUT_IF(!MqParamCheck(personal, msg, msgLen), errno); OS_MQ_GOTO_ERROUT_IF(msgPrio > (MQ_PRIO_MAX - 1), EINVAL); - (VOID)pthread_mutex_lock(&IPC_QUEUE_MUTEX); + (VOID)pthread_mutex_lock(&g_mqueueMutex); privateMqPersonal = MqGetPrivDataBuff(personal); OS_MQ_GOTO_ERROUT_UNLOCK_IF(privateMqPersonal == NULL || privateMqPersonal->mq_status != MQ_USE_MAGIC, EBADF); @@ -799,7 +781,7 @@ int mq_timedsend(mqd_t personal, const char *msg, size_t msgLen, unsigned int ms OS_MQ_GOTO_ERROUT_UNLOCK_IF(ConvertTimeout(privateMqPersonal->mq_flags, absTimeout, &absTicks) == -1, errno); mqueueID = mqueueCB->mq_id; - (VOID)pthread_mutex_unlock(&IPC_QUEUE_MUTEX); + (VOID)pthread_mutex_unlock(&g_mqueueMutex); if (LOS_ListEmpty(&mqueueCB->mqcb->readWriteList[OS_QUEUE_READ])) { MqSendNotify(mqueueCB); @@ -811,7 +793,7 @@ int mq_timedsend(mqd_t personal, const char *msg, size_t msgLen, unsigned int ms } return 0; ERROUT_UNLOCK: - (VOID)pthread_mutex_unlock(&IPC_QUEUE_MUTEX); + (VOID)pthread_mutex_unlock(&g_mqueueMutex); ERROUT: return -1; } @@ -833,7 +815,7 @@ ssize_t mq_timedreceive(mqd_t personal, char *msg, size_t msgLen, unsigned int * *msgPrio = 0; } - (VOID)pthread_mutex_lock(&IPC_QUEUE_MUTEX); + (VOID)pthread_mutex_lock(&g_mqueueMutex); privateMqPersonal = MqGetPrivDataBuff(personal); if (privateMqPersonal == NULL || privateMqPersonal->mq_status != MQ_USE_MAGIC) { errno = EBADF; @@ -857,7 +839,7 @@ ssize_t mq_timedreceive(mqd_t personal, char *msg, size_t msgLen, unsigned int * receiveLen = msgLen; mqueueID = mqueueCB->mq_id; - (VOID)pthread_mutex_unlock(&IPC_QUEUE_MUTEX); + (VOID)pthread_mutex_unlock(&g_mqueueMutex); err = LOS_QueueReadCopy(mqueueID, (VOID *)msg, &receiveLen, (UINT32)absTicks); if (map_errno(err) == ENOERR) { @@ -867,7 +849,7 @@ ssize_t mq_timedreceive(mqd_t personal, char *msg, size_t msgLen, unsigned int * } ERROUT_UNLOCK: - (VOID)pthread_mutex_unlock(&IPC_QUEUE_MUTEX); + (VOID)pthread_mutex_unlock(&g_mqueueMutex); ERROUT: return -1; } @@ -916,7 +898,7 @@ int OsMqNotify(mqd_t personal, const struct sigevent *sigev) goto ERROUT; } - (VOID)pthread_mutex_lock(&IPC_QUEUE_MUTEX); + (VOID)pthread_mutex_lock(&g_mqueueMutex); privateMqPersonal = MqGetPrivDataBuff(personal); if (privateMqPersonal == NULL) { goto OUT_UNLOCK; @@ -954,26 +936,11 @@ int OsMqNotify(mqd_t personal, const struct sigevent *sigev) mqnotify->pid = LOS_GetCurrProcessID(); } - (VOID)pthread_mutex_unlock(&IPC_QUEUE_MUTEX); + (VOID)pthread_mutex_unlock(&g_mqueueMutex); return 0; OUT_UNLOCK: - (VOID)pthread_mutex_unlock(&IPC_QUEUE_MUTEX); + (VOID)pthread_mutex_unlock(&g_mqueueMutex); ERROUT: return -1; } - -VOID OsMqueueCBDestroy(struct mqarray *queueTable) -{ - if (queueTable == NULL) { - return; - } - - for (UINT32 index = 0; index < LOSCFG_BASE_IPC_QUEUE_LIMIT; index++) { - struct mqarray *mqueueCB = &(queueTable[index]); - if (mqueueCB->mq_name == NULL) { - continue; - } - (VOID)DoMqueueClose(mqueueCB->mq_personal); - } -} #endif diff --git a/src/kernel_liteos_a/compat/posix/src/posix_memalign.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/compat/posix/src/posix_memalign.c similarity index 100% rename from src/kernel_liteos_a/compat/posix/src/posix_memalign.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/compat/posix/src/posix_memalign.c diff --git a/src/kernel_liteos_a/compat/posix/src/pprivate.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/compat/posix/src/pprivate.h similarity index 100% rename from src/kernel_liteos_a/compat/posix/src/pprivate.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/compat/posix/src/pprivate.h diff --git a/src/kernel_liteos_a/compat/posix/src/pthread.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/compat/posix/src/pthread.c similarity index 98% rename from src/kernel_liteos_a/compat/posix/src/pthread.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/compat/posix/src/pthread.c index 9b939d73..1fd5c4ff 100644 --- a/src/kernel_liteos_a/compat/posix/src/pthread.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/compat/posix/src/pthread.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2022 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -158,7 +158,7 @@ STATIC VOID SetPthreadAttr(const _pthread_data *self, const pthread_attr_t *attr } if (outAttr->inheritsched == PTHREAD_INHERIT_SCHED) { if (self->task == NULL) { - outAttr->schedparam.sched_priority = LOS_TaskPriGet(OsCurrTaskGet()->taskID); + outAttr->schedparam.sched_priority = ((LosTaskCB *)(OsCurrTaskGet()))->priority; } else { outAttr->schedpolicy = self->attr.schedpolicy; outAttr->schedparam = self->attr.schedparam; @@ -240,9 +240,9 @@ int pthread_create(pthread_t *thread, const pthread_attr_t *attr, taskInitParam.usTaskPrio = (UINT16)userAttr.schedparam.sched_priority; taskInitParam.uwStackSize = userAttr.stacksize; if (OsProcessIsUserMode(OsCurrProcessGet())) { - taskInitParam.processID = (UINTPTR)OsGetKernelInitProcess(); + taskInitParam.processID = OsGetKernelInitProcessID(); } else { - taskInitParam.processID = (UINTPTR)OsCurrProcessGet(); + taskInitParam.processID = OsCurrProcessGet()->processID; } if (userAttr.detachstate == PTHREAD_CREATE_DETACHED) { taskInitParam.uwResved = LOS_TASK_STATUS_DETACHED; diff --git a/src/kernel_liteos_a/compat/posix/src/pthread_attr.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/compat/posix/src/pthread_attr.c similarity index 100% rename from src/kernel_liteos_a/compat/posix/src/pthread_attr.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/compat/posix/src/pthread_attr.c diff --git a/src/kernel_liteos_a/compat/posix/src/pthread_cond.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/compat/posix/src/pthread_cond.c similarity index 100% rename from src/kernel_liteos_a/compat/posix/src/pthread_cond.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/compat/posix/src/pthread_cond.c diff --git a/src/kernel_liteos_a/compat/posix/src/pthread_mutex.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/compat/posix/src/pthread_mutex.c similarity index 100% rename from src/kernel_liteos_a/compat/posix/src/pthread_mutex.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/compat/posix/src/pthread_mutex.c diff --git a/src/kernel_liteos_a/compat/posix/src/sched.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/compat/posix/src/sched.c similarity index 100% rename from src/kernel_liteos_a/compat/posix/src/sched.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/compat/posix/src/sched.c diff --git a/src/kernel_liteos_a/compat/posix/src/semaphore.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/compat/posix/src/semaphore.c similarity index 100% rename from src/kernel_liteos_a/compat/posix/src/semaphore.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/compat/posix/src/semaphore.c diff --git a/src/kernel_liteos_a/compat/posix/src/socket.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/compat/posix/src/socket.c similarity index 100% rename from src/kernel_liteos_a/compat/posix/src/socket.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/compat/posix/src/socket.c diff --git a/src/kernel_liteos_a/compat/posix/src/stdio.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/compat/posix/src/stdio.c similarity index 100% rename from src/kernel_liteos_a/compat/posix/src/stdio.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/compat/posix/src/stdio.c diff --git a/src/kernel_liteos_a/compat/posix/src/stdlib.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/compat/posix/src/stdlib.c similarity index 100% rename from src/kernel_liteos_a/compat/posix/src/stdlib.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/compat/posix/src/stdlib.c diff --git a/src/kernel_liteos_a/compat/posix/src/time.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/compat/posix/src/time.c similarity index 93% rename from src/kernel_liteos_a/compat/posix/src/time.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/compat/posix/src/time.c index c7e6521f..8803b586 100644 --- a/src/kernel_liteos_a/compat/posix/src/time.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/compat/posix/src/time.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2023 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -71,7 +71,7 @@ #ifdef LOSCFG_AARCH64 /* - * This two structures originally didn't exit, + * This two structures originally did't exit, * they added by liteos to support 64bit interfaces on 32bit platform, * in 64bit platform, timeval64 define to timeval which is platform adaptive. */ @@ -117,7 +117,7 @@ STATIC INLINE BOOL ValidTimerID(UINT16 swtmrID) } /* check owner of this timer */ - if (OS_SWT_FROM_SID(swtmrID)->uwOwnerPid != (UINTPTR)OsCurrProcessGet()) { + if (OS_SWT_FROM_SID(swtmrID)->uwOwnerPid != LOS_GetCurrProcessID()) { return FALSE; } @@ -387,16 +387,9 @@ int gettimeofday64(struct timeval64 *tv, struct timezone *tz) } #endif -#ifdef LOSCFG_LIBC_NEWLIB -int gettimeofday(struct timeval *tv, void *_tz) -#else int gettimeofday(struct timeval *tv, struct timezone *tz) -#endif { struct timeval64 stTimeVal64 = {0}; -#ifdef LOSCFG_LIBC_NEWLIB - struct timezone *tz = (struct timezone *)_tz; -#endif if (tv == NULL) { TIME_RETURN(EINVAL); @@ -478,13 +471,14 @@ static int PthreadGetCputime(clockid_t clockID, struct timespec *ats) uint64_t runtime; UINT32 intSave; UINT32 tid = GetTidFromClockID(clockID); + if (OS_TID_CHECK_INVALID(tid)) { return -EINVAL; } LosTaskCB *task = OsGetTaskCB(tid); - if (OsCurrTaskGet()->processCB != task->processCB) { + if (OsCurrTaskGet()->processID != task->processID) { return -EINVAL; } @@ -599,22 +593,13 @@ int clock_gettime(clockid_t clockID, struct timespec *tp) switch (clockID) { case CLOCK_MONOTONIC_RAW: -#ifdef LOSCFG_TIME_CONTAINER - tmp = OsTimeSpecAdd(hwTime, CLOCK_MONOTONIC_TIME_BASE); - tp->tv_sec = tmp.tv_sec; - tp->tv_nsec = tmp.tv_nsec; -#else tp->tv_sec = hwTime.tv_sec; tp->tv_nsec = hwTime.tv_nsec; -#endif break; case CLOCK_MONOTONIC: LOS_SpinLockSave(&g_timeSpin, &intSave); tmp = OsTimeSpecAdd(hwTime, g_accDeltaFromAdj); LOS_SpinUnlockRestore(&g_timeSpin, intSave); -#ifdef LOSCFG_TIME_CONTAINER - tmp = OsTimeSpecAdd(tmp, CLOCK_MONOTONIC_TIME_BASE); -#endif tp->tv_sec = tmp.tv_sec; tp->tv_nsec = tmp.tv_nsec; break; @@ -648,7 +633,7 @@ int clock_gettime(clockid_t clockID, struct timespec *tp) return 0; -ERROUT: + ERROUT: TIME_RETURN(EINVAL); } @@ -733,7 +718,6 @@ typedef struct { static VOID SwtmrProc(UINTPTR tmrArg) { -#ifdef LOSCFG_KERNEL_VM INT32 sig, ret; UINT32 intSave; pid_t pid; @@ -757,7 +741,7 @@ static VOID SwtmrProc(UINTPTR tmrArg) /* Make sure that the para is valid */ OS_GOTO_EXIT_IF(OS_TID_CHECK_INVALID(arg->tid), EINVAL); stcb = OsGetTaskCB(arg->tid); - ret = OsUserProcessOperatePermissionsCheck(stcb, stcb->processCB); + ret = OsUserProcessOperatePermissionsCheck(stcb, stcb->processID); OS_GOTO_EXIT_IF(ret != LOS_OK, -ret); /* Dispatch the signal to thread, bypassing normal task group thread @@ -777,47 +761,9 @@ static VOID SwtmrProc(UINTPTR tmrArg) return; EXIT: PRINT_ERR("Dispatch signals failed!, ret: %d\r\n", ret); -#endif return; } -int timer_create(clockid_t clockID, struct sigevent *restrict evp, timer_t *restrict timerID) -{ - UINT32 ret; - UINT16 swtmrID; -#ifdef LOSCFG_SECURITY_VID - UINT16 vid; -#endif - - if (!timerID || (clockID != CLOCK_REALTIME) || !evp) { - errno = EINVAL; - return -1; - } - - if ((evp->sigev_notify != SIGEV_THREAD) || evp->sigev_notify_attributes) { - errno = ENOTSUP; - return -1; - } - - ret = LOS_SwtmrCreate(1, LOS_SWTMR_MODE_ONCE, (SWTMR_PROC_FUNC)evp->sigev_notify_function, - &swtmrID, (UINTPTR)evp->sigev_value.sival_ptr); - if (ret != LOS_OK) { - errno = (ret == LOS_ERRNO_SWTMR_MAXSIZE) ? EAGAIN : EINVAL; - return -1; - } - -#ifdef LOSCFG_SECURITY_VID - vid = AddNodeByRid(swtmrID); - if (vid == MAX_INVALID_TIMER_VID) { - (VOID)LOS_SwtmrDelete(swtmrID); - return -1; - } - swtmrID = vid; -#endif - *timerID = (timer_t)(UINTPTR)swtmrID; - return 0; -} - int OsTimerCreate(clockid_t clockID, struct ksigevent *evp, timer_t *timerID) { UINT32 ret; @@ -877,7 +823,6 @@ int timer_delete(timer_t timerID) { UINT16 swtmrID = (UINT16)(UINTPTR)timerID; VOID *arg = NULL; - UINTPTR swtmrProc; #ifdef LOSCFG_SECURITY_VID swtmrID = GetRidByVid(swtmrID); @@ -887,11 +832,10 @@ int timer_delete(timer_t timerID) } arg = (VOID *)OS_SWT_FROM_SID(swtmrID)->uwArg; - swtmrProc = (UINTPTR)OS_SWT_FROM_SID(swtmrID)->pfnHandler; if (LOS_SwtmrDelete(swtmrID)) { goto ERROUT; } - if ((swtmrProc == (UINTPTR)SwtmrProc) && (arg != NULL)) { + if (arg != NULL) { free(arg); } @@ -1035,11 +979,7 @@ STATIC INT32 DoNanoSleep(UINT64 nanoseconds) return -1; } -#ifdef LOSCFG_LIBC_NEWLIB -int usleep(unsigned long useconds) -#else int usleep(unsigned useconds) -#endif { return DoNanoSleep((UINT64)useconds * OS_SYS_NS_PER_US); } @@ -1096,7 +1036,8 @@ clock_t times(struct tms *buf) int setitimer(int which, const struct itimerval *value, struct itimerval *ovalue) { UINT32 intSave; - LosProcessCB *processCB = OsCurrProcessGet(); + LosTaskCB *taskCB = OS_TCB_FROM_TID(LOS_CurTaskIDGet()); + LosProcessCB *processCB = OS_PCB_FROM_PID(taskCB->processID); timer_t timerID = 0; struct itimerspec spec; struct itimerspec ospec; @@ -1149,7 +1090,8 @@ int setitimer(int which, const struct itimerval *value, struct itimerval *ovalue int getitimer(int which, struct itimerval *value) { - LosProcessCB *processCB = OsCurrProcessGet(); + LosTaskCB *taskCB = OS_TCB_FROM_TID(LOS_CurTaskIDGet()); + LosProcessCB *processCB = OS_PCB_FROM_PID(taskCB->processID); struct itimerspec spec = {}; int ret = LOS_OK; diff --git a/src/kernel_liteos_a/config.mk b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/config.mk similarity index 100% rename from src/kernel_liteos_a/config.mk rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/config.mk diff --git a/src/kernel_liteos_a/drivers/BUILD.gn b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/BUILD.gn similarity index 100% rename from src/kernel_liteos_a/drivers/BUILD.gn rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/BUILD.gn diff --git a/src/kernel_liteos_a/drivers/Kconfig b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/Kconfig similarity index 83% rename from src/kernel_liteos_a/drivers/Kconfig rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/Kconfig index da5e9e9b..c603f8a9 100644 --- a/src/kernel_liteos_a/drivers/Kconfig +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/Kconfig @@ -5,7 +5,7 @@ config DRIVERS Answer Y to enable LiteOS support driver. source "bsd/dev/usb/Kconfig" -source "../../drivers/hdf_core/adapter/khdf/liteos/Kconfig" +source "../../drivers/adapter/khdf/liteos/Kconfig" # Device driver Kconfig import source "$(DEVICE_PATH)/drivers/Kconfig" @@ -17,4 +17,5 @@ source "drivers/char/video/Kconfig" source "drivers/char/trace/Kconfig" source "drivers/char/perf/Kconfig" +source "../../drivers/liteos/tzdriver/Kconfig" source "../../drivers/liteos/hievent/Kconfig" diff --git a/src/kernel_liteos_a/drivers/block/BUILD.gn b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/block/BUILD.gn similarity index 100% rename from src/kernel_liteos_a/drivers/block/BUILD.gn rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/block/BUILD.gn diff --git a/src/kernel_liteos_a/drivers/block/disk/BUILD.gn b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/block/disk/BUILD.gn similarity index 100% rename from src/kernel_liteos_a/drivers/block/disk/BUILD.gn rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/block/disk/BUILD.gn diff --git a/src/kernel_liteos_a/drivers/block/disk/Makefile b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/block/disk/Makefile similarity index 100% rename from src/kernel_liteos_a/drivers/block/disk/Makefile rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/block/disk/Makefile diff --git a/src/kernel_liteos_a/drivers/block/disk/include/disk.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/block/disk/include/disk.h similarity index 99% rename from src/kernel_liteos_a/drivers/block/disk/include/disk.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/block/disk/include/disk.h index 46c55ee1..8f79cea3 100644 --- a/src/kernel_liteos_a/drivers/block/disk/include/disk.h +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/block/disk/include/disk.h @@ -163,7 +163,7 @@ extern "C" { #define DISK_ATA_GET_MODEL 21 /* Get model name */ #define DISK_ATA_GET_SN 22 /* Get serial number */ -#ifndef LOSCFG_FS_FAT_CACHE +#ifdef LOSCFG_FS_FAT_CACHE #define DISK_DIRECT_BUFFER_SIZE 4 /* los_disk direct io buffer when bcache is off */ #endif diff --git a/src/kernel_liteos_a/drivers/block/disk/include/disk_pri.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/block/disk/include/disk_pri.h similarity index 96% rename from src/kernel_liteos_a/drivers/block/disk/include/disk_pri.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/block/disk/include/disk_pri.h index 573f1b5c..eecc8667 100644 --- a/src/kernel_liteos_a/drivers/block/disk/include/disk_pri.h +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/block/disk/include/disk_pri.h @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2022 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -42,7 +42,7 @@ #ifdef __cplusplus #if __cplusplus -extern "C" { +extern "C"{ #endif #endif /* __cplusplus */ diff --git a/src/kernel_liteos_a/drivers/block/disk/include/driver.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/block/disk/include/driver.h similarity index 100% rename from src/kernel_liteos_a/drivers/block/disk/include/driver.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/block/disk/include/driver.h diff --git a/src/kernel_liteos_a/drivers/block/disk/src/disk.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/block/disk/src/disk.c similarity index 99% rename from src/kernel_liteos_a/drivers/block/disk/src/disk.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/block/disk/src/disk.c index 60ecf2c2..6db419cb 100644 --- a/src/kernel_liteos_a/drivers/block/disk/src/disk.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/block/disk/src/disk.c @@ -1465,7 +1465,7 @@ INT32 los_disk_init(const CHAR *diskName, const struct block_operations *bops, ret = VnodeLookup(diskName, &blkDriver, 0); if (ret < 0) { VnodeDrop(); - PRINT_ERR("disk_init : %s, failed to find the vnode, ERRNO=%d\n", diskName, ret); + ret = ENOENT; goto DISK_FIND_ERROR; } struct block_operations *bops2 = (struct block_operations *)((struct drv_data *)blkDriver->data)->ops; diff --git a/src/kernel_liteos_a/drivers/block/disk/src/disk_shellcmd.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/block/disk/src/disk_shellcmd.c similarity index 100% rename from src/kernel_liteos_a/drivers/block/disk/src/disk_shellcmd.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/block/disk/src/disk_shellcmd.c diff --git a/src/kernel_liteos_a/drivers/char/BUILD.gn b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/char/BUILD.gn similarity index 100% rename from src/kernel_liteos_a/drivers/char/BUILD.gn rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/char/BUILD.gn diff --git a/src/kernel_liteos_a/drivers/char/bch/BUILD.gn b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/char/bch/BUILD.gn similarity index 97% rename from src/kernel_liteos_a/drivers/char/bch/BUILD.gn rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/char/bch/BUILD.gn index 16f29213..634b1e7c 100644 --- a/src/kernel_liteos_a/drivers/char/bch/BUILD.gn +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/char/bch/BUILD.gn @@ -28,7 +28,7 @@ # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. import("//kernel/liteos_a/liteos.gni") -import("$THIRDPARTY_NUTTX_DIR/NuttX.gni") +import("//third_party/NuttX/NuttX.gni") module_switch = defined(LOSCFG_FS_VFS_BLOCK_DEVICE) module_name = get_path_info(rebase_path("."), "name") diff --git a/src/kernel_liteos_a/drivers/char/bch/Makefile b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/char/bch/Makefile similarity index 100% rename from src/kernel_liteos_a/drivers/char/bch/Makefile rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/char/bch/Makefile diff --git a/src/kernel_liteos_a/drivers/char/bch/include/blockproxy.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/char/bch/include/blockproxy.h similarity index 100% rename from src/kernel_liteos_a/drivers/char/bch/include/blockproxy.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/char/bch/include/blockproxy.h diff --git a/src/kernel_liteos_a/drivers/char/mem/BUILD.gn b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/char/mem/BUILD.gn similarity index 100% rename from src/kernel_liteos_a/drivers/char/mem/BUILD.gn rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/char/mem/BUILD.gn diff --git a/src/kernel_liteos_a/drivers/char/mem/Kconfig b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/char/mem/Kconfig similarity index 100% rename from src/kernel_liteos_a/drivers/char/mem/Kconfig rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/char/mem/Kconfig diff --git a/src/kernel_liteos_a/drivers/char/mem/Makefile b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/char/mem/Makefile similarity index 100% rename from src/kernel_liteos_a/drivers/char/mem/Makefile rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/char/mem/Makefile diff --git a/src/kernel_liteos_a/drivers/char/mem/include/los_dev_mem.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/char/mem/include/los_dev_mem.h similarity index 100% rename from src/kernel_liteos_a/drivers/char/mem/include/los_dev_mem.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/char/mem/include/los_dev_mem.h diff --git a/src/kernel_liteos_a/drivers/char/mem/src/mem.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/char/mem/src/mem.c similarity index 97% rename from src/kernel_liteos_a/drivers/char/mem/src/mem.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/char/mem/src/mem.c index 8a4e96e9..4030a29c 100644 --- a/src/kernel_liteos_a/drivers/char/mem/src/mem.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/char/mem/src/mem.c @@ -97,5 +97,5 @@ static const struct file_operations_vfs g_memDevOps = { int DevMemRegister(void) { - return register_driver("/dev/mem", &g_memDevOps, 0644, 0); /* 0644: file mode */ + return register_driver("/dev/mem", &g_memDevOps, 0666, 0); /* 0666: file mode */ } diff --git a/src/kernel_liteos_a/drivers/char/perf/BUILD.gn b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/char/perf/BUILD.gn similarity index 100% rename from src/kernel_liteos_a/drivers/char/perf/BUILD.gn rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/char/perf/BUILD.gn diff --git a/src/kernel_liteos_a/drivers/char/perf/Kconfig b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/char/perf/Kconfig similarity index 100% rename from src/kernel_liteos_a/drivers/char/perf/Kconfig rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/char/perf/Kconfig diff --git a/src/kernel_liteos_a/drivers/char/perf/Makefile b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/char/perf/Makefile similarity index 100% rename from src/kernel_liteos_a/drivers/char/perf/Makefile rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/char/perf/Makefile diff --git a/src/kernel_liteos_a/drivers/char/perf/include/los_dev_perf.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/char/perf/include/los_dev_perf.h similarity index 100% rename from src/kernel_liteos_a/drivers/char/perf/include/los_dev_perf.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/char/perf/include/los_dev_perf.h diff --git a/src/kernel_liteos_a/drivers/char/perf/src/perf.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/char/perf/src/perf.c similarity index 100% rename from src/kernel_liteos_a/drivers/char/perf/src/perf.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/char/perf/src/perf.c diff --git a/src/kernel_liteos_a/drivers/char/quickstart/BUILD.gn b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/char/quickstart/BUILD.gn similarity index 100% rename from src/kernel_liteos_a/drivers/char/quickstart/BUILD.gn rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/char/quickstart/BUILD.gn diff --git a/src/kernel_liteos_a/drivers/char/quickstart/Kconfig b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/char/quickstart/Kconfig similarity index 100% rename from src/kernel_liteos_a/drivers/char/quickstart/Kconfig rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/char/quickstart/Kconfig diff --git a/src/kernel_liteos_a/drivers/char/quickstart/Makefile b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/char/quickstart/Makefile similarity index 100% rename from src/kernel_liteos_a/drivers/char/quickstart/Makefile rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/char/quickstart/Makefile diff --git a/src/kernel_liteos_a/drivers/char/quickstart/include/los_dev_quickstart.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/char/quickstart/include/los_dev_quickstart.h similarity index 100% rename from src/kernel_liteos_a/drivers/char/quickstart/include/los_dev_quickstart.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/char/quickstart/include/los_dev_quickstart.h diff --git a/src/kernel_liteos_a/drivers/char/quickstart/src/quickstart.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/char/quickstart/src/quickstart.c similarity index 98% rename from src/kernel_liteos_a/drivers/char/quickstart/src/quickstart.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/char/quickstart/src/quickstart.c index 3270e57c..5f55bc14 100644 --- a/src/kernel_liteos_a/drivers/char/quickstart/src/quickstart.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/char/quickstart/src/quickstart.c @@ -112,7 +112,7 @@ static ssize_t QuickstartIoctl(struct file *filep, int cmd, unsigned long arg) return QuickstartNotify(arg); } - if (LOS_GetCurrProcessID() != OS_USER_ROOT_PROCESS_ID) { + if (OsGetUserInitProcessID() != LOS_GetCurrProcessID()) { PRINT_ERR("Permission denios!\n"); return -EACCES; } diff --git a/src/kernel_liteos_a/drivers/char/random/BUILD.gn b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/char/random/BUILD.gn similarity index 100% rename from src/kernel_liteos_a/drivers/char/random/BUILD.gn rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/char/random/BUILD.gn diff --git a/src/kernel_liteos_a/drivers/char/random/Kconfig b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/char/random/Kconfig similarity index 100% rename from src/kernel_liteos_a/drivers/char/random/Kconfig rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/char/random/Kconfig diff --git a/src/kernel_liteos_a/drivers/char/random/Makefile b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/char/random/Makefile similarity index 100% rename from src/kernel_liteos_a/drivers/char/random/Makefile rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/char/random/Makefile diff --git a/src/kernel_liteos_a/drivers/char/random/include/los_random.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/char/random/include/los_random.h similarity index 100% rename from src/kernel_liteos_a/drivers/char/random/include/los_random.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/char/random/include/los_random.h diff --git a/src/kernel_liteos_a/drivers/char/random/src/random.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/char/random/src/random.c similarity index 100% rename from src/kernel_liteos_a/drivers/char/random/src/random.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/char/random/src/random.c diff --git a/src/kernel_liteos_a/drivers/char/random/src/random_hw.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/char/random/src/random_hw.c similarity index 100% rename from src/kernel_liteos_a/drivers/char/random/src/random_hw.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/char/random/src/random_hw.c diff --git a/src/kernel_liteos_a/drivers/char/trace/BUILD.gn b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/char/trace/BUILD.gn similarity index 100% rename from src/kernel_liteos_a/drivers/char/trace/BUILD.gn rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/char/trace/BUILD.gn diff --git a/src/kernel_liteos_a/drivers/char/trace/Kconfig b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/char/trace/Kconfig similarity index 100% rename from src/kernel_liteos_a/drivers/char/trace/Kconfig rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/char/trace/Kconfig diff --git a/src/kernel_liteos_a/drivers/char/trace/Makefile b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/char/trace/Makefile similarity index 100% rename from src/kernel_liteos_a/drivers/char/trace/Makefile rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/char/trace/Makefile diff --git a/src/kernel_liteos_a/drivers/char/trace/include/los_dev_trace.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/char/trace/include/los_dev_trace.h similarity index 100% rename from src/kernel_liteos_a/drivers/char/trace/include/los_dev_trace.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/char/trace/include/los_dev_trace.h diff --git a/src/kernel_liteos_a/drivers/char/trace/src/trace.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/char/trace/src/trace.c similarity index 100% rename from src/kernel_liteos_a/drivers/char/trace/src/trace.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/char/trace/src/trace.c diff --git a/src/kernel_liteos_a/drivers/char/video/BUILD.gn b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/char/video/BUILD.gn similarity index 97% rename from src/kernel_liteos_a/drivers/char/video/BUILD.gn rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/char/video/BUILD.gn index b6395569..a7fcc3f9 100644 --- a/src/kernel_liteos_a/drivers/char/video/BUILD.gn +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/char/video/BUILD.gn @@ -28,7 +28,7 @@ # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. import("//kernel/liteos_a/liteos.gni") -import("$THIRDPARTY_NUTTX_DIR/NuttX.gni") +import("//third_party/NuttX/NuttX.gni") module_switch = defined(LOSCFG_DRIVERS_VIDEO) module_name = get_path_info(rebase_path("."), "name") diff --git a/src/kernel_liteos_a/drivers/char/video/Kconfig b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/char/video/Kconfig similarity index 100% rename from src/kernel_liteos_a/drivers/char/video/Kconfig rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/char/video/Kconfig diff --git a/src/kernel_liteos_a/drivers/char/video/Makefile b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/char/video/Makefile similarity index 100% rename from src/kernel_liteos_a/drivers/char/video/Makefile rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/char/video/Makefile diff --git a/src/kernel_liteos_a/drivers/mtd/BUILD.gn b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/mtd/BUILD.gn similarity index 100% rename from src/kernel_liteos_a/drivers/mtd/BUILD.gn rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/mtd/BUILD.gn diff --git a/src/kernel_liteos_a/drivers/mtd/multi_partition/BUILD.gn b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/mtd/multi_partition/BUILD.gn similarity index 94% rename from src/kernel_liteos_a/drivers/mtd/multi_partition/BUILD.gn rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/mtd/multi_partition/BUILD.gn index f54c2424..5278330a 100644 --- a/src/kernel_liteos_a/drivers/mtd/multi_partition/BUILD.gn +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/mtd/multi_partition/BUILD.gn @@ -39,6 +39,10 @@ kernel_module(module_name) { include_dirs = [ "$LITEOSTOPDIR/fs/jffs2/include" ] + if (defined(LOSCFG_PLATFORM_QEMU_ARM_VIRT_CA7)) { + include_dirs += [ "//device/qemu/drivers/cfiflash" ] + } + public_configs = [ ":public" ] } diff --git a/src/kernel_liteos_a/drivers/mtd/multi_partition/Makefile b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/mtd/multi_partition/Makefile similarity index 93% rename from src/kernel_liteos_a/drivers/mtd/multi_partition/Makefile rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/mtd/multi_partition/Makefile index 46b5d78d..76f8973f 100644 --- a/src/kernel_liteos_a/drivers/mtd/multi_partition/Makefile +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/mtd/multi_partition/Makefile @@ -36,6 +36,10 @@ LOCAL_SRCS := $(wildcard src/*.c) LOCAL_INCLUDE := \ -I $(LITEOSTOPDIR)/fs/jffs2/include +ifeq ($(LOSCFG_PLATFORM_QEMU_ARM_VIRT_CA7), y) +LOCAL_INCLUDE += -I $(LITEOSTOPDIR)/../../device/qemu/drivers/cfiflash +endif + LOCAL_FLAGS := $(LOCAL_INCLUDE) include $(MODULE) diff --git a/src/kernel_liteos_a/drivers/mtd/multi_partition/include/mtd_dev.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/mtd/multi_partition/include/mtd_dev.h similarity index 100% rename from src/kernel_liteos_a/drivers/mtd/multi_partition/include/mtd_dev.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/mtd/multi_partition/include/mtd_dev.h diff --git a/src/kernel_liteos_a/drivers/mtd/multi_partition/include/mtd_list.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/mtd/multi_partition/include/mtd_list.h similarity index 100% rename from src/kernel_liteos_a/drivers/mtd/multi_partition/include/mtd_list.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/mtd/multi_partition/include/mtd_list.h diff --git a/src/kernel_liteos_a/drivers/mtd/multi_partition/include/mtd_partition.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/mtd/multi_partition/include/mtd_partition.h similarity index 100% rename from src/kernel_liteos_a/drivers/mtd/multi_partition/include/mtd_partition.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/mtd/multi_partition/include/mtd_partition.h diff --git a/src/kernel_liteos_a/drivers/mtd/multi_partition/src/mtd_partition.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/mtd/multi_partition/src/mtd_partition.c similarity index 97% rename from src/kernel_liteos_a/drivers/mtd/multi_partition/src/mtd_partition.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/mtd/multi_partition/src/mtd_partition.c index 034bc551..e5414618 100644 --- a/src/kernel_liteos_a/drivers/mtd/multi_partition/src/mtd_partition.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/mtd/multi_partition/src/mtd_partition.c @@ -39,6 +39,11 @@ #include "fs/driver.h" #include "mtd/mtd_legacy_lite.h" +#ifdef LOSCFG_PLATFORM_QEMU_ARM_VIRT_CA7 +#include "cfiflash.h" +#endif + + #define DRIVER_NAME_ADD_SIZE 3 pthread_mutex_t g_mtdPartitionLock = PTHREAD_MUTEX_INITIALIZER; @@ -129,10 +134,17 @@ static VOID MtdNorParamAssign(partition_param *spinorParam, const struct MtdDev * you can change the SPIBLK_NAME or SPICHR_NAME to NULL. */ spinorParam->flash_mtd = (struct MtdDev *)spinorMtd; +#ifndef LOSCFG_PLATFORM_QEMU_ARM_VIRT_CA7 spinorParam->flash_ops = GetDevSpinorOps(); spinorParam->char_ops = GetMtdCharFops(); spinorParam->blockname = SPIBLK_NAME; spinorParam->charname = SPICHR_NAME; +#else + spinorParam->flash_ops = GetCfiBlkOps(); + spinorParam->char_ops = NULL; + spinorParam->blockname = CFI_DRIVER; + spinorParam->charname = NULL; +#endif spinorParam->partition_head = g_spinorPartitionHead; spinorParam->block_size = spinorMtd->eraseSize; } @@ -146,7 +158,11 @@ static VOID MtdDeinitSpinorParam(VOID) static partition_param *MtdInitSpinorParam(partition_param *spinorParam) { +#ifndef LOSCFG_PLATFORM_QEMU_ARM_VIRT_CA7 struct MtdDev *spinorMtd = GetMtd("spinor"); +#else + struct MtdDev *spinorMtd = GetCfiMtdDev(); +#endif if (spinorMtd == NULL) { return NULL; } diff --git a/src/kernel_liteos_a/drivers/mtd/multi_partition/src/mtd_shellcmd.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/mtd/multi_partition/src/mtd_shellcmd.c similarity index 100% rename from src/kernel_liteos_a/drivers/mtd/multi_partition/src/mtd_shellcmd.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/drivers/mtd/multi_partition/src/mtd_shellcmd.c diff --git a/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/figures/OpenHarmony-LiteOS-A内核架构图.png b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/figures/OpenHarmony-LiteOS-A内核架构图.png new file mode 100644 index 00000000..b2ff552d Binary files /dev/null and b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/figures/OpenHarmony-LiteOS-A内核架构图.png differ diff --git a/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/figures/architecture-of-the-openharmony-liteos-cortex-a-kernel.png b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/figures/architecture-of-the-openharmony-liteos-cortex-a-kernel.png new file mode 100644 index 00000000..27b8a0e0 Binary files /dev/null and b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/figures/architecture-of-the-openharmony-liteos-cortex-a-kernel.png differ diff --git a/src/kernel_liteos_a/fs/BUILD.gn b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/BUILD.gn similarity index 100% rename from src/kernel_liteos_a/fs/BUILD.gn rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/BUILD.gn diff --git a/src/kernel_liteos_a/fs/Kconfig b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/Kconfig similarity index 100% rename from src/kernel_liteos_a/fs/Kconfig rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/Kconfig diff --git a/src/kernel_liteos_a/fs/fat/BUILD.gn b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/fat/BUILD.gn similarity index 97% rename from src/kernel_liteos_a/fs/fat/BUILD.gn rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/fat/BUILD.gn index d87d32e1..921f9ea6 100644 --- a/src/kernel_liteos_a/fs/fat/BUILD.gn +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/fat/BUILD.gn @@ -28,7 +28,7 @@ # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. import("//kernel/liteos_a/liteos.gni") -import("$THIRDPARTY_FATFS_DIR/FatFs.gni") +import("//third_party/FatFs/FatFs.gni") module_switch = defined(LOSCFG_FS_FAT) module_name = get_path_info(rebase_path("."), "name") diff --git a/src/kernel_liteos_a/fs/fat/Kconfig b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/fat/Kconfig similarity index 100% rename from src/kernel_liteos_a/fs/fat/Kconfig rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/fat/Kconfig diff --git a/src/kernel_liteos_a/fs/fat/Makefile b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/fat/Makefile similarity index 100% rename from src/kernel_liteos_a/fs/fat/Makefile rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/fat/Makefile diff --git a/src/kernel_liteos_a/fs/fat/os_adapt/fat_shellcmd.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/fat/os_adapt/fat_shellcmd.c similarity index 100% rename from src/kernel_liteos_a/fs/fat/os_adapt/fat_shellcmd.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/fat/os_adapt/fat_shellcmd.c diff --git a/src/kernel_liteos_a/fs/fat/os_adapt/fatfs.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/fat/os_adapt/fatfs.c similarity index 99% rename from src/kernel_liteos_a/fs/fat/os_adapt/fatfs.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/fat/os_adapt/fatfs.c index e95706a6..109ef3f0 100644 --- a/src/kernel_liteos_a/fs/fat/os_adapt/fatfs.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/fat/os_adapt/fatfs.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2022 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -343,8 +343,7 @@ static FRESULT init_cluster(DIR_FILE *pdfp, DIR *dp_new, FATFS *fs, int type, co return FR_OK; } -static int fatfs_create_obj(struct Vnode *parent, const char *name, int mode, struct Vnode **vpp, - BYTE type, const char *target) +static int fatfs_create_obj(struct Vnode *parent, const char *name, int mode, struct Vnode **vpp, BYTE type, const char *target) { struct Vnode *vp = NULL; FATFS *fs = (FATFS *)parent->originMount->data; @@ -1409,7 +1408,7 @@ DWORD fattime_format(time_t time) ftime |= ((DWORD)((st.tm_year > YEAR_OFFSET) ? (st.tm_year - YEAR_OFFSET) : 0)) << FTIME_YEAR_OFFSET; ftime <<= FTIME_DATE_OFFSET; - ftime |= (DWORD)st.tm_sec / SEC_MULTIPLIER; + ftime = (DWORD)st.tm_sec / SEC_MULTIPLIER; ftime |= ((DWORD)st.tm_min) << FTIME_MIN_OFFSET; ftime |= ((DWORD)st.tm_hour) << FTIME_HR_OFFSET; @@ -2167,7 +2166,7 @@ int fatfs_symlink(struct Vnode *parentVnode, struct Vnode **newVnode, const char ssize_t fatfs_readlink(struct Vnode *vnode, char *buffer, size_t bufLen) { int ret; - FRESULT res; + FRESULT res = FR_OK; DWORD clust; QWORD sect; DIR_FILE *dfp = (DIR_FILE *)(vnode->data); diff --git a/src/kernel_liteos_a/fs/fat/os_adapt/fatfs.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/fat/os_adapt/fatfs.h similarity index 99% rename from src/kernel_liteos_a/fs/fat/os_adapt/fatfs.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/fat/os_adapt/fatfs.h index 01a5ecd0..76d0f2f4 100644 --- a/src/kernel_liteos_a/fs/fat/os_adapt/fatfs.h +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/fat/os_adapt/fatfs.h @@ -64,7 +64,7 @@ extern "C" { #define MBR_PRIMARY_PART_NUM 4 #define JUMP_CODE "\xEB\xFE\x90" -/* Partition type */ +/* Partiton type */ #define FAT12 0x01 /* FAT12 as primary partition in first physical 32MB */ #define FAT16 0x04 /* FAT16 with less than 65536 sectors(32MB) */ #define EXTENDED_PARTITION_CHS 0x05 diff --git a/src/kernel_liteos_a/fs/fat/os_adapt/format.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/fat/os_adapt/format.c similarity index 100% rename from src/kernel_liteos_a/fs/fat/os_adapt/format.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/fat/os_adapt/format.c diff --git a/src/kernel_liteos_a/fs/fat/virpart/BUILD.gn b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/fat/virpart/BUILD.gn similarity index 100% rename from src/kernel_liteos_a/fs/fat/virpart/BUILD.gn rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/fat/virpart/BUILD.gn diff --git a/src/kernel_liteos_a/fs/fat/virpart/Makefile b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/fat/virpart/Makefile similarity index 100% rename from src/kernel_liteos_a/fs/fat/virpart/Makefile rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/fat/virpart/Makefile diff --git a/src/kernel_liteos_a/fs/fat/virpart/include/virpart.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/fat/virpart/include/virpart.h similarity index 100% rename from src/kernel_liteos_a/fs/fat/virpart/include/virpart.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/fat/virpart/include/virpart.h diff --git a/src/kernel_liteos_a/fs/fat/virpart/include/virpartff.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/fat/virpart/include/virpartff.h similarity index 100% rename from src/kernel_liteos_a/fs/fat/virpart/include/virpartff.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/fat/virpart/include/virpartff.h diff --git a/src/kernel_liteos_a/fs/fat/virpart/src/virpart.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/fat/virpart/src/virpart.c similarity index 99% rename from src/kernel_liteos_a/fs/fat/virpart/src/virpart.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/fat/virpart/src/virpart.c index a6e67ee7..efc70c28 100644 --- a/src/kernel_liteos_a/fs/fat/virpart/src/virpart.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/fat/virpart/src/virpart.c @@ -179,7 +179,7 @@ static INT FatfsDisablePart(void *handle) * Scan the FAT inside the boundary of CHILD FATFS limit, and update the free cluster and last cluster * for all CHILD FATFS. * Acceptable Return Value: - * - FR_OK : Successfully scanned the FAT and update field. + * - FR_OK : Successfully scaned the FAT and update field. * Others Return Value: * - FR_INVAILD_FATFS : The FATFS object has error or the info in it has been occuried * - FR_DENIED : The virtual partition feature has been shut down by switcher diff --git a/src/kernel_liteos_a/fs/fat/virpart/src/virpartff.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/fat/virpart/src/virpartff.c similarity index 99% rename from src/kernel_liteos_a/fs/fat/virpart/src/virpartff.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/fat/virpart/src/virpartff.c index 590aca64..cbf723b3 100644 --- a/src/kernel_liteos_a/fs/fat/virpart/src/virpartff.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/fat/virpart/src/virpartff.c @@ -373,7 +373,7 @@ static FRESULT FatfsCheckScanFatParam(FATFS *fs) * Scan the FAT inside the boundary of CHILD FATFS limit, and update the free cluster and last cluster * * Acceptable Return Value: -* - FR_OK : Successfully scanned the FAT and update field. +* - FR_OK : Successfully scaned the FAT and update field. * * Others Return Value: * - FR_INVAILD_FATFS : The FATFS object has error or the info in it has been occuried diff --git a/src/kernel_liteos_a/fs/include/fs/fd_table.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/include/fs/fd_table.h similarity index 98% rename from src/kernel_liteos_a/fs/include/fs/fd_table.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/include/fs/fd_table.h index 4d2fdce4..750c6b1a 100644 --- a/src/kernel_liteos_a/fs/include/fs/fd_table.h +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/include/fs/fd_table.h @@ -59,9 +59,6 @@ struct files_struct { spinlock_t workdir_lock; char workdir[PATH_MAX]; #endif -#ifdef LOSCFG_CHROOT - struct Vnode *rootVnode; -#endif }; typedef struct ProcessCB LosProcessCB; diff --git a/src/kernel_liteos_a/fs/include/fs/fs_operation.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/include/fs/fs_operation.h similarity index 98% rename from src/kernel_liteos_a/fs/include/fs/fs_operation.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/include/fs/fs_operation.h index e2bdd766..ddc05158 100644 --- a/src/kernel_liteos_a/fs/include/fs/fs_operation.h +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/include/fs/fs_operation.h @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2022 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -244,9 +244,8 @@ extern int chattr(const char *pathname, struct IATTR *attr); * * @retval #0 On success. * @retval #-1 On failure with errno set. - * @retval CONTINE_NUTTX_FCNTL doesn't support some cmds in VfsFcntl, needs to continue going through - * Nuttx vfs operation. - * + * @retval CONTINE_NUTTX_FCNTL doesn't support some cmds in VfsFcntl, needs to continue going through Nuttx vfs operation. + * * @par Dependency: *
  • fs.h
* @see None diff --git a/src/kernel_liteos_a/fs/include/fs/mount.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/include/fs/mount.h similarity index 92% rename from src/kernel_liteos_a/fs/include/fs/mount.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/include/fs/mount.h index d457df1a..28c92e6a 100644 --- a/src/kernel_liteos_a/fs/include/fs/mount.h +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/include/fs/mount.h @@ -39,7 +39,6 @@ #define MS_NOSYNC 2 struct MountOps; -struct fsmap_t; struct Mount { LIST_ENTRY mountList; /* mount list */ @@ -50,7 +49,7 @@ struct Mount { LIST_HEAD vnodeList; /* list of vnodes */ int vnodeSize; /* size of vnode list */ LIST_HEAD activeVnodeList; /* list of active vnodes */ - int activeVnodeSize; /* size of active vnodes list */ + int activeVnodeSize; /* szie of active vnodes list */ void *data; /* private data */ uint32_t hashseed; /* Random seed for vfshash */ unsigned long mountFlags; /* Flags for mount */ @@ -70,11 +69,8 @@ typedef int (*foreach_mountpoint_t)(const char *devpoint, struct statfs *statbuf, void *arg); -struct Mount *MountAlloc(struct Vnode *vnode, struct MountOps *mop); -LIST_HEAD *GetMountList(void); -#ifdef LOSCFG_MNT_CONTAINER -LIST_HEAD *GetMountCache(void); -#endif +struct Mount* MountAlloc(struct Vnode* vnode, struct MountOps* mop); +LIST_HEAD* GetMountList(void); int foreach_mountpoint(foreach_mountpoint_t handler, void *arg); int ForceUmountDev(struct Vnode *dev); #endif diff --git a/src/kernel_liteos_a/fs/include/fs/vnode.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/include/fs/vnode.h similarity index 100% rename from src/kernel_liteos_a/fs/include/fs/vnode.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/include/fs/vnode.h diff --git a/src/kernel_liteos_a/fs/include/vfs_config.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/include/vfs_config.h similarity index 100% rename from src/kernel_liteos_a/fs/include/vfs_config.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/include/vfs_config.h diff --git a/src/kernel_liteos_a/fs/jffs2/BUILD.gn b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/jffs2/BUILD.gn similarity index 98% rename from src/kernel_liteos_a/fs/jffs2/BUILD.gn rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/jffs2/BUILD.gn index c184f753..dea3bd7c 100644 --- a/src/kernel_liteos_a/fs/jffs2/BUILD.gn +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/jffs2/BUILD.gn @@ -31,7 +31,7 @@ import("//kernel/liteos_a/liteos.gni") module_switch = defined(LOSCFG_FS_JFFS) module_name = get_path_info(rebase_path("."), "name") -linux_path = rebase_path("$KERNEL_LINUX_DIR") +linux_path = rebase_path("//kernel/linux/linux-5.10") out_path = rebase_path(target_out_dir) kernel_module(module_name) { diff --git a/src/kernel_liteos_a/fs/jffs2/Kconfig b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/jffs2/Kconfig similarity index 100% rename from src/kernel_liteos_a/fs/jffs2/Kconfig rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/jffs2/Kconfig diff --git a/src/kernel_liteos_a/fs/jffs2/Makefile b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/jffs2/Makefile similarity index 100% rename from src/kernel_liteos_a/fs/jffs2/Makefile rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/jffs2/Makefile diff --git a/src/kernel_liteos_a/fs/jffs2/include/jffs2_hash.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/jffs2/include/jffs2_hash.h similarity index 100% rename from src/kernel_liteos_a/fs/jffs2/include/jffs2_hash.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/jffs2/include/jffs2_hash.h diff --git a/src/kernel_liteos_a/fs/jffs2/include/vfs_jffs2.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/jffs2/include/vfs_jffs2.h similarity index 100% rename from src/kernel_liteos_a/fs/jffs2/include/vfs_jffs2.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/jffs2/include/vfs_jffs2.h diff --git a/src/kernel_liteos_a/fs/jffs2/jffs2.patch b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/jffs2/jffs2.patch similarity index 96% rename from src/kernel_liteos_a/fs/jffs2/jffs2.patch rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/jffs2/jffs2.patch index 073aa696..907d3f32 100644 --- a/src/kernel_liteos_a/fs/jffs2/jffs2.patch +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/jffs2/jffs2.patch @@ -2311,7 +2311,7 @@ diff -Nupr old/fs/jffs2/erase.c new/fs/jffs2/erase.c diff -Nupr old/fs/jffs2/file.c new/fs/jffs2/file.c --- old/fs/jffs2/file.c 2022-05-09 17:22:53.000000000 +0800 +++ new/fs/jffs2/file.c 2022-05-10 09:43:14.250000000 +0800 -@@ -9,335 +9,30 @@ +@@ -9,325 +9,34 @@ * For licensing information, see the file 'LICENCE' in this directory. * */ @@ -2336,35 +2336,32 @@ diff -Nupr old/fs/jffs2/file.c new/fs/jffs2/file.c - loff_t pos, unsigned len, unsigned flags, - struct page **pagep, void **fsdata); -static int jffs2_readpage (struct file *filp, struct page *pg); -+static unsigned char gc_buffer[PAGE_SIZE]; //avoids malloc when user may be under memory pressure - +- -int jffs2_fsync(struct file *filp, loff_t start, loff_t end, int datasync) -+unsigned char *jffs2_gc_fetch_page(struct jffs2_sb_info *c, -+ struct jffs2_inode_info *f, -+ unsigned long offset, -+ unsigned long *priv) - { +-{ - struct inode *inode = filp->f_mapping->host; - struct jffs2_sb_info *c = JFFS2_SB_INFO(inode->i_sb); -+ /* FIXME: This works only with one file system mounted at a time */ - int ret; +- int ret; - - ret = file_write_and_wait_range(filp, start, end); -+ ret = jffs2_read_inode_range(c, f, gc_buffer, -+ offset & ~(PAGE_SIZE-1), PAGE_SIZE); - if (ret) +- if (ret) - return ret; -- + - inode_lock(inode); - /* Trigger GC to flush any pending writes for this inode */ - jffs2_flush_wbuf_gc(c, inode->i_ino); - inode_unlock(inode); -- ++static unsigned char gc_buffer[PAGE_SIZE]; //avoids malloc when user may be under memory pressure + - return 0; -} -- + -const struct file_operations jffs2_file_operations = --{ ++unsigned char *jffs2_gc_fetch_page(struct jffs2_sb_info *c, ++ struct jffs2_inode_info *f, ++ unsigned long offset, ++ unsigned long *priv) + { - .llseek = generic_file_llseek, - .open = generic_file_open, - .read_iter = generic_file_read_iter, @@ -2398,8 +2395,9 @@ diff -Nupr old/fs/jffs2/file.c new/fs/jffs2/file.c - struct jffs2_inode_info *f = JFFS2_INODE_INFO(inode); - struct jffs2_sb_info *c = JFFS2_SB_INFO(inode->i_sb); - unsigned char *pg_buf; -- int ret; -- ++ /* FIXME: This works only with one file system mounted at a time */ + int ret; + - jffs2_dbg(2, "%s(): ino #%lu, page at offset 0x%lx\n", - __func__, inode->i_ino, pg->index << PAGE_SHIFT); - @@ -2438,15 +2436,18 @@ diff -Nupr old/fs/jffs2/file.c new/fs/jffs2/file.c -{ - struct jffs2_inode_info *f = JFFS2_INODE_INFO(pg->mapping->host); - int ret; -- ++ ret = jffs2_read_inode_range(c, f, gc_buffer, ++ offset & ~(PAGE_SIZE-1), PAGE_SIZE); ++ if (ret) ++ return ERR_PTR(ret); + - mutex_lock(&f->sem); - ret = jffs2_do_readpage_unlock(pg->mapping->host, pg); - mutex_unlock(&f->sem); - return ret; -+ return ERR_PTR(ret); + return gc_buffer; } - +- -static int jffs2_write_begin(struct file *filp, struct address_space *mapping, - loff_t pos, unsigned len, unsigned flags, - struct page **pagep, void **fsdata) @@ -2457,15 +2458,20 @@ diff -Nupr old/fs/jffs2/file.c new/fs/jffs2/file.c - struct page *pg; - struct inode *inode = mapping->host; - struct jffs2_inode_info *f = JFFS2_INODE_INFO(inode); -- struct jffs2_sb_info *c = JFFS2_SB_INFO(inode->i_sb); - pgoff_t index = pos >> PAGE_SHIFT; - uint32_t pageofs = index << PAGE_SHIFT; - int ret = 0; - +- pg = grab_cache_page_write_begin(mapping, index, flags); +- if (!pg) +- return -ENOMEM; +- *pagep = pg; +- - jffs2_dbg(1, "%s()\n", __func__); - - if (pageofs > inode->i_size) { - /* Make new hole frag from old EOF to new page */ +- struct jffs2_sb_info *c = JFFS2_SB_INFO(inode->i_sb); - struct jffs2_raw_inode ri; - struct jffs2_full_dnode *fn; - uint32_t alloc_len; @@ -2476,7 +2482,7 @@ diff -Nupr old/fs/jffs2/file.c new/fs/jffs2/file.c - ret = jffs2_reserve_space(c, sizeof(ri), &alloc_len, - ALLOC_NORMAL, JFFS2_SUMMARY_INODE_SIZE); - if (ret) -- goto out_err; +- goto out_page; - - mutex_lock(&f->sem); - memset(&ri, 0, sizeof(ri)); @@ -2506,7 +2512,7 @@ diff -Nupr old/fs/jffs2/file.c new/fs/jffs2/file.c - ret = PTR_ERR(fn); - jffs2_complete_reservation(c); - mutex_unlock(&f->sem); -- goto out_err; +- goto out_page; - } - ret = jffs2_add_full_dnode_to_inode(c, f, fn); - if (f->metadata) { @@ -2521,7 +2527,7 @@ diff -Nupr old/fs/jffs2/file.c new/fs/jffs2/file.c - jffs2_free_full_dnode(fn); - jffs2_complete_reservation(c); - mutex_unlock(&f->sem); -- goto out_err; +- goto out_page; - } - jffs2_complete_reservation(c); - inode->i_size = pageofs; @@ -2529,19 +2535,6 @@ diff -Nupr old/fs/jffs2/file.c new/fs/jffs2/file.c - } - - /* -- * While getting a page and reading data in, lock c->alloc_sem until -- * the page is Uptodate. Otherwise GC task may attempt to read the same -- * page in read_cache_page(), which causes a deadlock. -- */ -- mutex_lock(&c->alloc_sem); -- pg = grab_cache_page_write_begin(mapping, index, flags); -- if (!pg) { -- ret = -ENOMEM; -- goto release_sem; -- } -- *pagep = pg; -- -- /* - * Read in the page if it wasn't already present. Cannot optimize away - * the whole page write case until jffs2_write_end can handle the - * case of a short-copy. @@ -2550,20 +2543,19 @@ diff -Nupr old/fs/jffs2/file.c new/fs/jffs2/file.c - mutex_lock(&f->sem); - ret = jffs2_do_readpage_nolock(inode, pg); - mutex_unlock(&f->sem); -- if (ret) { -- unlock_page(pg); -- put_page(pg); -- goto release_sem; -- } +- if (ret) +- goto out_page; - } - jffs2_dbg(1, "end write_begin(). pg->flags %lx\n", pg->flags); -- --release_sem: -- mutex_unlock(&c->alloc_sem); --out_err: - return ret; --} - +-out_page: +- unlock_page(pg); +- put_page(pg); +- return ret; ++ /* Do nothing */ + } + -static int jffs2_write_end(struct file *filp, struct address_space *mapping, - loff_t pos, unsigned len, unsigned copied, - struct page *pg, void *fsdata) @@ -2661,8 +2653,7 @@ diff -Nupr old/fs/jffs2/file.c new/fs/jffs2/file.c - unlock_page(pg); - put_page(pg); - return writtenlen > 0 ? writtenlen : ret; -+ /* Do nothing */ - } +-} diff -Nupr old/fs/jffs2/fs.c new/fs/jffs2/fs.c --- old/fs/jffs2/fs.c 2022-05-09 17:22:53.000000000 +0800 +++ new/fs/jffs2/fs.c 2022-05-10 16:13:37.830000000 +0800 @@ -2778,11 +2769,7 @@ diff -Nupr old/fs/jffs2/fs.c new/fs/jffs2/fs.c ri->version = cpu_to_je32(++f->highest_version); + ri->uid = cpu_to_je16(inode->i_uid); + ri->gid = cpu_to_je16(inode->i_gid); - -- ri->uid = cpu_to_je16((ivalid & ATTR_UID)? -- from_kuid(&init_user_ns, iattr->ia_uid):i_uid_read(inode)); -- ri->gid = cpu_to_je16((ivalid & ATTR_GID)? -- from_kgid(&init_user_ns, iattr->ia_gid):i_gid_read(inode)); ++ + if (ivalid & CHG_UID) { + if (((c_uid != inode->i_uid) || (attr->attr_chg_uid != inode->i_uid)) && (!IsCapPermit(CAP_CHOWN))) { + jffs2_complete_reservation(c); @@ -2804,7 +2791,16 @@ diff -Nupr old/fs/jffs2/fs.c new/fs/jffs2/fs.c + ri->gid = cpu_to_je16(attr->attr_chg_gid); + } + } -+ + +- ri->uid = cpu_to_je16((ivalid & ATTR_UID)? +- from_kuid(&init_user_ns, iattr->ia_uid):i_uid_read(inode)); +- ri->gid = cpu_to_je16((ivalid & ATTR_GID)? +- from_kgid(&init_user_ns, iattr->ia_gid):i_gid_read(inode)); +- +- if (ivalid & ATTR_MODE) +- ri->mode = cpu_to_jemode(iattr->ia_mode); +- else +- ri->mode = cpu_to_jemode(inode->i_mode); + if (ivalid & CHG_MODE) { + if (!IsCapPermit(CAP_FOWNER) && (c_uid != inode->i_uid)) { + jffs2_complete_reservation(c); @@ -2818,10 +2814,6 @@ diff -Nupr old/fs/jffs2/fs.c new/fs/jffs2/fs.c + } + } -- if (ivalid & ATTR_MODE) -- ri->mode = cpu_to_jemode(iattr->ia_mode); -- else -- ri->mode = cpu_to_jemode(inode->i_mode); + if (ivalid & CHG_ATIME) { + if ((c_uid != inode->i_uid) || (attr->attr_chg_uid != inode->i_uid)) { + return -EPERM; @@ -2831,7 +2823,7 @@ diff -Nupr old/fs/jffs2/fs.c new/fs/jffs2/fs.c + } else { + ri->atime = cpu_to_je32(inode->i_atime); + } - ++ + if (ivalid & CHG_MTIME) { + if ((c_uid != inode->i_uid) || (attr->attr_chg_uid != inode->i_uid)) { + return -EPERM; @@ -2883,7 +2875,7 @@ diff -Nupr old/fs/jffs2/fs.c new/fs/jffs2/fs.c if (IS_ERR(new_metadata)) { jffs2_complete_reservation(c); jffs2_free_raw_inode(ri); -@@ -147,23 +140,20 @@ int jffs2_do_setattr (struct inode *inode, struct iattr *iattr) +@@ -147,23 +140,20 @@ int jffs2_do_setattr (struct inode *inod return PTR_ERR(new_metadata); } /* It worked. Update the inode */ @@ -2916,7 +2908,7 @@ diff -Nupr old/fs/jffs2/fs.c new/fs/jffs2/fs.c f->metadata = NULL; } else { f->metadata = new_metadata; -@@ -182,315 +172,201 @@ int jffs2_do_setattr (struct inode *inode, struct iattr *iattr) +@@ -182,315 +172,201 @@ int jffs2_do_setattr (struct inode *inod We are protected from a simultaneous write() extending i_size back past iattr->ia_size, because do_truncate() holds the generic inode semaphore. */ @@ -2935,43 +2927,31 @@ diff -Nupr old/fs/jffs2/fs.c new/fs/jffs2/fs.c { - struct inode *inode = d_inode(dentry); - int rc; -+ /* We can forget about this inode for now - drop all -+ * the nodelists associated with it, etc. -+ */ -+ struct jffs2_sb_info *c = JFFS2_SB_INFO(inode->i_sb); -+ struct jffs2_inode_info *f = JFFS2_INODE_INFO(inode); -+ -+ jffs2_do_clear_inode(c, f); -+} - +- - rc = setattr_prepare(dentry, iattr); - if (rc) - return rc; -+static struct jffs2_inode *ilookup(struct super_block *sb, uint32_t ino) -+{ -+ struct jffs2_inode *node = NULL; - +- - rc = jffs2_do_setattr(inode, iattr); - if (!rc && (iattr->ia_valid & ATTR_MODE)) - rc = posix_acl_chmod(inode, inode->i_mode); -+ if (sb->s_root == NULL) { -+ return NULL; -+ } ++ /* We can forget about this inode for now - drop all ++ * the nodelists associated with it, etc. ++ */ ++ struct jffs2_sb_info *c = JFFS2_SB_INFO(inode->i_sb); ++ struct jffs2_inode_info *f = JFFS2_INODE_INFO(inode); - return rc; -+ // Check for this inode in the cache -+ Jffs2NodeLock(); -+ (void)Jffs2HashGet(&sb->s_node_hash_lock, &sb->s_node_hash[0], sb, ino, &node); -+ Jffs2NodeUnlock(); -+ return node; ++ jffs2_do_clear_inode(c, f); } -int jffs2_statfs(struct dentry *dentry, struct kstatfs *buf) -+struct jffs2_inode *new_inode(struct super_block *sb) ++static struct jffs2_inode *ilookup(struct super_block *sb, uint32_t ino) { - struct jffs2_sb_info *c = JFFS2_SB_INFO(dentry->d_sb); - unsigned long avail; -- ++ struct jffs2_inode *node = NULL; + - buf->f_type = JFFS2_SUPER_MAGIC; - buf->f_bsize = 1 << PAGE_SHIFT; - buf->f_blocks = c->flash_size >> PAGE_SHIFT; @@ -2990,35 +2970,47 @@ diff -Nupr old/fs/jffs2/fs.c new/fs/jffs2/fs.c - spin_unlock(&c->erase_completion_lock); - - buf->f_bavail = buf->f_bfree = avail >> PAGE_SHIFT; -+ struct jffs2_inode *inode = NULL; ++ if (sb->s_root == NULL) { ++ return NULL; ++ } - return 0; --} -+ inode = zalloc(sizeof (struct jffs2_inode)); -+ if (inode == NULL) -+ return 0; - -+ D2(PRINTK("malloc new_inode %x ####################################\n", -+ inode)); ++ // Check for this inode in the cache ++ Jffs2NodeLock(); ++ (void)Jffs2HashGet(&sb->s_node_hash_lock, &sb->s_node_hash[0], sb, ino, &node); ++ Jffs2NodeUnlock(); ++ return node; + } +- -void jffs2_evict_inode (struct inode *inode) --{ ++struct jffs2_inode *new_inode(struct super_block *sb) + { - /* We can forget about this inode for now - drop all - * the nodelists associated with it, etc. - */ - struct jffs2_sb_info *c = JFFS2_SB_INFO(inode->i_sb); - struct jffs2_inode_info *f = JFFS2_INODE_INFO(inode); -+ inode->i_sb = sb; -+ inode->i_ino = 1; -+ inode->i_nlink = 1; // Let JFFS2 manage the link count -+ inode->i_size = 0; -+ LOS_ListInit((&(inode->i_hashlist))); ++ struct jffs2_inode *inode = NULL; - jffs2_dbg(1, "%s(): ino #%lu mode %o\n", - __func__, inode->i_ino, inode->i_mode); - truncate_inode_pages_final(&inode->i_data); - clear_inode(inode); - jffs2_do_clear_inode(c, f); ++ inode = zalloc(sizeof (struct jffs2_inode)); ++ if (inode == NULL) ++ return 0; ++ ++ D2(PRINTK("malloc new_inode %x ####################################\n", ++ inode)); ++ ++ inode->i_sb = sb; ++ inode->i_ino = 1; ++ inode->i_nlink = 1; // Let JFFS2 manage the link count ++ inode->i_size = 0; ++ LOS_ListInit((&(inode->i_hashlist))); ++ + return inode; } @@ -3083,16 +3075,16 @@ diff -Nupr old/fs/jffs2/fs.c new/fs/jffs2/fs.c - inode->i_ctime = ITIME(je32_to_cpu(latest_node.ctime)); - - set_nlink(inode, f->inocache->pino_nlink); -- -- inode->i_blocks = (inode->i_size + 511) >> 9; + inode->i_atime = je32_to_cpu(latest_node.atime); + inode->i_mtime = je32_to_cpu(latest_node.mtime); + inode->i_ctime = je32_to_cpu(latest_node.ctime); + inode->i_nlink = f->inocache->pino_nlink; -- switch (inode->i_mode & S_IFMT) { +- inode->i_blocks = (inode->i_size + 511) >> 9; + (void)mutex_unlock(&f->sem); +- switch (inode->i_mode & S_IFMT) { +- - case S_IFLNK: - inode->i_op = &jffs2_symlink_inode_operations; - inode->i_link = f->target; @@ -3162,21 +3154,20 @@ diff -Nupr old/fs/jffs2/fs.c new/fs/jffs2/fs.c jffs2_dbg(1, "jffs2_read_inode() returning\n"); - unlock_new_inode(inode); - return inode; -+ Jffs2NodeUnlock(); - +- -error_io: - ret = -EIO; -error: - mutex_unlock(&f->sem); - iget_failed(inode); - return ERR_PTR(ret); -+ return inode; - } +-} ++ Jffs2NodeUnlock(); -void jffs2_dirty_inode(struct inode *inode, int flags) -{ - struct iattr iattr; - +- - if (!(inode->i_state & I_DIRTY_DATASYNC)) { - jffs2_dbg(2, "%s(): not calling setattr() for ino #%lu\n", - __func__, inode->i_ino); @@ -3195,19 +3186,16 @@ diff -Nupr old/fs/jffs2/fs.c new/fs/jffs2/fs.c - iattr.ia_ctime = inode->i_ctime; - - jffs2_do_setattr(inode, &iattr); --} -+// ------------------------------------------------------------------------- -+// Decrement the reference count on an inode. If this makes the ref count -+// zero, then this inode can be freed. ++ return inode; + } -int jffs2_do_remount_fs(struct super_block *sb, struct fs_context *fc) -+int jffs2_iput(struct jffs2_inode *i) - { +-{ - struct jffs2_sb_info *c = JFFS2_SB_INFO(sb); - - if (c->flags & JFFS2_SB_FLAG_RO && !sb_rdonly(sb)) - return -EROFS; -- + - /* We stop if it was running, then restart if it needs to. - This also catches the case where it was stopped and this - is just a remount to restart it. @@ -3218,9 +3206,12 @@ diff -Nupr old/fs/jffs2/fs.c new/fs/jffs2/fs.c - jffs2_flush_wbuf_pad(c); - mutex_unlock(&c->alloc_sem); - } -- -- if (!(fc->sb_flags & SB_RDONLY)) -- jffs2_start_garbage_collect_thread(c); ++// ------------------------------------------------------------------------- ++// Decrement the reference count on an inode. If this makes the ref count ++// zero, then this inode can be freed. ++ ++int jffs2_iput(struct jffs2_inode *i) ++{ + // Called in jffs2_find + // (and jffs2_open and jffs2_ops_mkdir?) + // super.c jffs2_fill_super, @@ -3242,6 +3233,9 @@ diff -Nupr old/fs/jffs2/fs.c new/fs/jffs2/fs.c + free(i); + Jffs2NodeUnlock(); +- if (!(fc->sb_flags & SB_RDONLY)) +- jffs2_start_garbage_collect_thread(c); +- - fc->sb_flags |= SB_NOATIME; return 0; } @@ -3348,7 +3342,7 @@ diff -Nupr old/fs/jffs2/fs.c new/fs/jffs2/fs.c { /* * Pick a inocache hash size based on the size of the medium. -@@ -510,118 +386,17 @@ static int calculate_inocache_hashsize(uint32_t flash_size) +@@ -510,117 +386,17 @@ static int calculate_inocache_hashsize(u return hashsize; } @@ -3444,9 +3438,8 @@ diff -Nupr old/fs/jffs2/fs.c new/fs/jffs2/fs.c - jffs2_free_ino_caches(c); - jffs2_free_raw_node_refs(c); - kvfree(c->blocks); -- jffs2_clear_xattr_subsystem(c); -- jffs2_sum_exit(c); - out_inohash: +- jffs2_clear_xattr_subsystem(c); - kfree(c->inocache_list); - out_wbuf: - jffs2_flash_cleanup(c); @@ -3455,7 +3448,8 @@ diff -Nupr old/fs/jffs2/fs.c new/fs/jffs2/fs.c -} - void jffs2_gc_release_inode(struct jffs2_sb_info *c, - struct jffs2_inode_info *f) +- struct jffs2_inode_info *f) ++ struct jffs2_inode_info *f) { - iput(OFNI_EDONI_2SFFJ(f)); + struct jffs2_inode *node = OFNI_EDONI_2SFFJ(f); @@ -3470,7 +3464,7 @@ diff -Nupr old/fs/jffs2/fs.c new/fs/jffs2/fs.c struct jffs2_inode_cache *ic; if (unlinked) { -@@ -669,72 +444,9 @@ struct jffs2_inode_info *jffs2_gc_fetch_inode(struct jffs2_sb_info *c, +@@ -668,72 +444,9 @@ struct jffs2_inode_info *jffs2_gc_fetch_ Just iget() it, and if read_inode() is necessary that's OK. */ inode = jffs2_iget(OFNI_BS_2SFFJ(c), inum); @@ -5505,7 +5499,7 @@ diff -Nupr old/fs/jffs2/readinode.c new/fs/jffs2/readinode.c break; default: -+ JFFS2_ERROR("Unknown f->inocache->state %d!\n", f->inocache->state); ++ JFFS2_ERROR("Unknow f->inocache->state %d!\n", f->inocache->state); BUG(); } } @@ -5562,7 +5556,7 @@ diff -Nupr old/fs/jffs2/scan.c new/fs/jffs2/scan.c #define DEFAULT_EMPTY_SCAN_SIZE 256 -@@ -74,7 +73,7 @@ static int file_dirty(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb) +@@ -74,7 +73,7 @@ static int file_dirty(struct jffs2_sb_in return ret; if ((ret = jffs2_scan_dirty_space(c, jeb, jeb->free_size))) return ret; @@ -5571,254 +5565,15 @@ diff -Nupr old/fs/jffs2/scan.c new/fs/jffs2/scan.c think it's recoverable now. */ jeb->dirty_size += jeb->wasted_size; c->dirty_size += jeb->wasted_size; -@@ -95,40 +94,26 @@ int jffs2_scan_medium(struct jffs2_sb_info *c) +@@ -95,40 +94,26 @@ int jffs2_scan_medium(struct jffs2_sb_in unsigned char *flashbuf = NULL; uint32_t buf_size = 0; struct jffs2_summary *s = NULL; /* summary info collected by the scan process */ -#ifndef __ECOS - size_t pointlen, try_size; -- -- ret = mtd_point(c->mtd, 0, c->mtd->size, &pointlen, -- (void **)&flashbuf, NULL); -- if (!ret && pointlen < c->mtd->size) { -- /* Don't muck about if it won't let us point to the whole flash */ -- jffs2_dbg(1, "MTD point returned len too short: 0x%zx\n", -- pointlen); -- mtd_unpoint(c->mtd, 0, pointlen); -- flashbuf = NULL; -- } -- if (ret && ret != -EOPNOTSUPP) -- jffs2_dbg(1, "MTD point failed %d\n", ret); --#endif + struct super_block *sb = NULL; + struct MtdNorDev *device = NULL; -+ - if (!flashbuf) { - /* For NAND it's quicker to read a whole eraseblock at a time, - apparently */ - if (jffs2_cleanmarker_oob(c)) -- try_size = c->sector_size; -+ buf_size = c->sector_size; - else -- try_size = PAGE_SIZE; -+ buf_size = PAGE_SIZE; - - jffs2_dbg(1, "Trying to allocate readbuf of %zu " -- "bytes\n", try_size); -+ "bytes\n", buf_size); - -- flashbuf = mtd_kmalloc_up_to(c->mtd, &try_size); -+ flashbuf = kmalloc(buf_size, GFP_KERNEL); - if (!flashbuf) - return -ENOMEM; - - jffs2_dbg(1, "Allocated readbuf of %zu bytes\n", -- try_size); -- -- buf_size = (uint32_t)try_size; -+ buf_size); - } - - if (jffs2_sum_active()) { -@@ -140,7 +125,9 @@ int jffs2_scan_medium(struct jffs2_sb_info *c) - } - } - -- for (i=0; inr_blocks; i++) { -+ sb = OFNI_BS_2SFFJ(c); -+ device = (struct MtdNorDev*)(sb->s_dev); -+ for (i=device->blockStart; inr_blocks + device->blockStart; i++) { - struct jffs2_eraseblock *jeb = &c->blocks[i]; - - cond_resched(); -@@ -269,14 +256,10 @@ int jffs2_scan_medium(struct jffs2_sb_info *c) - ret = -EIO; - goto out; - } -- spin_lock(&c->erase_completion_lock); -- jffs2_garbage_collect_trigger(c); -- spin_unlock(&c->erase_completion_lock); - } - ret = 0; - out: -- jffs2_sum_reset_collected(s); -- kfree(s); -+ kfree(flashbuf); - out_buf: - if (buf_size) - kfree(flashbuf); -@@ -413,7 +396,7 @@ static int jffs2_scan_xref_node(struct jffs2_sb_info *c, struct jffs2_eraseblock - if (!ref) - return -ENOMEM; - -- /* BEFORE jffs2_build_xattr_subsystem() called, -+ /* BEFORE jffs2_build_xattr_subsystem() called, - * and AFTER xattr_ref is marked as a dead xref, - * ref->xid is used to store 32bit xid, xd is not used - * ref->ino is used to store 32bit inode-number, ic is not used -@@ -486,10 +469,10 @@ static int jffs2_scan_eraseblock (struct jffs2_sb_info *c, struct jffs2_eraseblo - struct jffs2_sum_marker *sm; - void *sumptr = NULL; - uint32_t sumlen; -- -+ - if (!buf_size) { - /* XIP case. Just look, point at the summary if it's there */ -- sm = (void *)buf + c->sector_size - sizeof(*sm); -+ sm = (struct jffs2_sum_marker *)((uint8_t *)buf + c->sector_size - sizeof(*sm)); - if (je32_to_cpu(sm->magic) == JFFS2_SUM_MAGIC) { - sumptr = buf + je32_to_cpu(sm->offset); - sumlen = c->sector_size - je32_to_cpu(sm->offset); -@@ -502,13 +485,13 @@ static int jffs2_scan_eraseblock (struct jffs2_sb_info *c, struct jffs2_eraseblo - buf_len = sizeof(*sm); - - /* Read as much as we want into the _end_ of the preallocated buffer */ -- err = jffs2_fill_scan_buf(c, buf + buf_size - buf_len, -+ err = jffs2_fill_scan_buf(c, buf + buf_size - buf_len, - jeb->offset + c->sector_size - buf_len, -- buf_len); -+ buf_len); - if (err) - return err; - -- sm = (void *)buf + buf_size - sizeof(*sm); -+ sm = (struct jffs2_sum_marker *)((uint8_t *)buf + buf_size - sizeof(*sm)); - if (je32_to_cpu(sm->magic) == JFFS2_SUM_MAGIC) { - sumlen = c->sector_size - je32_to_cpu(sm->offset); - sumptr = buf + buf_size - sumlen; -@@ -523,18 +506,15 @@ static int jffs2_scan_eraseblock (struct jffs2_sb_info *c, struct jffs2_eraseblo - sumptr = kmalloc(sumlen, GFP_KERNEL); - if (!sumptr) - return -ENOMEM; -- memcpy(sumptr + sumlen - buf_len, buf + buf_size - buf_len, buf_len); -+ memcpy((uint8_t *)sumptr + sumlen - buf_len, buf + buf_size - buf_len, buf_len); - } - if (buf_len < sumlen) { - /* Need to read more so that the entire summary node is present */ -- err = jffs2_fill_scan_buf(c, sumptr, -+ err = jffs2_fill_scan_buf(c, sumptr, - jeb->offset + c->sector_size - sumlen, -- sumlen - buf_len); -- if (err) { -- if (sumlen > buf_size) -- kfree(sumptr); -+ sumlen - buf_len); -+ if (err) - return err; -- } - } - } - -@@ -545,7 +525,7 @@ static int jffs2_scan_eraseblock (struct jffs2_sb_info *c, struct jffs2_eraseblo - if (buf_size && sumlen > buf_size) - kfree(sumptr); -- /* If it returns with a real error, bail. -+ /* If it returns with a real error, bail. - If it returns positive, that's a block classification - (i.e. BLK_STATE_xxx) so return that too. - If it returns zero, fall through to full scan. */ -@@ -607,7 +587,7 @@ static int jffs2_scan_eraseblock (struct jffs2_sb_info *c, struct jffs2_eraseblo - /* Now ofs is a complete physical flash offset as it always was... */ - ofs += jeb->offset; - -- noise = 10; -+ noise = 1; - - dbg_summary("no summary found in jeb 0x%08x. Apply original scan.\n",jeb->offset); - -@@ -700,7 +680,7 @@ static int jffs2_scan_eraseblock (struct jffs2_sb_info *c, struct jffs2_eraseblo - scan_end = buf_len; - goto more_empty; - } -- -+ - /* See how much more there is to read in this eraseblock... */ - buf_len = min_t(uint32_t, buf_size, jeb->offset + c->sector_size - ofs); - if (!buf_len) { -@@ -950,7 +930,7 @@ static int jffs2_scan_eraseblock (struct jffs2_sb_info *c, struct jffs2_eraseblo - jffs2_dbg(1, "Block at 0x%08x: free 0x%08x, dirty 0x%08x, unchecked 0x%08x, used 0x%08x, wasted 0x%08x\n", - jeb->offset, jeb->free_size, jeb->dirty_size, - jeb->unchecked_size, jeb->used_size, jeb->wasted_size); -- -+ - /* mark_node_obsolete can add to wasted !! */ - if (jeb->wasted_size) { - jeb->dirty_size += jeb->wasted_size; -@@ -978,7 +958,6 @@ struct jffs2_inode_cache *jffs2_scan_make_ino_cache(struct jffs2_sb_info *c, uin - pr_notice("%s(): allocation of inode cache failed\n", __func__); - return NULL; - } -- memset(ic, 0, sizeof(*ic)); - - ic->ino = ino; - ic->nodes = (void *)ic; -@@ -1069,7 +1048,7 @@ static int jffs2_scan_dirent_node(struct jffs2_sb_info *c, struct jffs2_eraseblo - pseudo_random += je32_to_cpu(rd->version); - - /* Should never happen. Did. (OLPC trac #4184)*/ -- checkedlen = strnlen(rd->name, rd->nsize); -+ checkedlen = strnlen((const char *)rd->name, rd->nsize); - if (checkedlen < rd->nsize) { - pr_err("Dirent at %08x has zeroes in name. Truncating to %d chars\n", - ofs, checkedlen); -@@ -1081,7 +1060,7 @@ static int jffs2_scan_dirent_node(struct jffs2_sb_info *c, struct jffs2_eraseblo - memcpy(&fd->name, rd->name, checkedlen); - fd->name[checkedlen] = 0; - -- crc = crc32(0, fd->name, checkedlen); -+ crc = crc32(0, fd->name, rd->nsize); - if (crc != je32_to_cpu(rd->name_crc)) { - pr_notice("%s(): Name CRC failed on node at 0x%08x: Read 0x%08x, calculated 0x%08x\n", - __func__, ofs, je32_to_cpu(rd->name_crc), crc); -@@ -1106,7 +1085,7 @@ static int jffs2_scan_dirent_node(struct jffs2_sb_info *c, struct jffs2_eraseblo - fd->next = NULL; - fd->version = je32_to_cpu(rd->version); - fd->ino = je32_to_cpu(rd->ino); -- fd->nhash = full_name_hash(NULL, fd->name, checkedlen); -+ fd->nhash = full_name_hash(fd->name, checkedlen); - fd->type = rd->type; - jffs2_add_fd_to_list(c, fd, &ic->scan_dents); - -diff -@@ -9,18 +9,17 @@ - * - */ - --#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt -- - #include - #include - #include --#include - #include --#include - #include - #include "nodelist.h" - #include "summary.h" - #include "debug.h" -+#include "mtd_dev.h" -+#include "los_typedef.h" -+#include "los_crc32.h" - - #define DEFAULT_EMPTY_SCAN_SIZE 256 - -@@ -74,7 +73,7 @@ static int file_dirty(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb) - return ret; - if ((ret = jffs2_scan_dirty_space(c, jeb, jeb->free_size))) - return ret; -- /* Turned wasted size into dirty, since we apparently -+ /* Turned wasted size into dirty, since we apparently - think it's recoverable now. */ - jeb->dirty_size += jeb->wasted_size; - c->dirty_size += jeb->wasted_size; -@@ -95,40 +94,26 @@ int jffs2_scan_medium(struct jffs2_sb_info *c) - unsigned char *flashbuf = NULL; - uint32_t buf_size = 0; - struct jffs2_summary *s = NULL; /* summary info collected by the scan process */ --#ifndef __ECOS -- size_t pointlen, try_size; -- - ret = mtd_point(c->mtd, 0, c->mtd->size, &pointlen, - (void **)&flashbuf, NULL); - if (!ret && pointlen < c->mtd->size) { @@ -5831,9 +5586,6 @@ diff - if (ret && ret != -EOPNOTSUPP) - jffs2_dbg(1, "MTD point failed %d\n", ret); -#endif -+ struct super_block *sb = NULL; -+ struct MtdNorDev *device = NULL; -+ if (!flashbuf) { /* For NAND it's quicker to read a whole eraseblock at a time, apparently */ @@ -5861,7 +5613,7 @@ diff } if (jffs2_sum_active()) { -@@ -140,7 +125,9 @@ int jffs2_scan_medium(struct jffs2_sb_info *c) +@@ -140,7 +125,9 @@ int jffs2_scan_medium(struct jffs2_sb_in } } @@ -5872,7 +5624,7 @@ diff struct jffs2_eraseblock *jeb = &c->blocks[i]; cond_resched(); -@@ -269,14 +256,10 @@ int jffs2_scan_medium(struct jffs2_sb_info *c) +@@ -269,19 +256,12 @@ int jffs2_scan_medium(struct jffs2_sb_in ret = -EIO; goto out; } @@ -5882,13 +5634,20 @@ diff } ret = 0; out: -- jffs2_sum_reset_collected(s); +- if (buf_size) +- kfree(flashbuf); +-#ifndef __ECOS +- else +- mtd_unpoint(c->mtd, 0, c->mtd->size); +-#endif - kfree(s); ++ + kfree(flashbuf); - out_buf: - if (buf_size) - kfree(flashbuf); -@@ -413,7 +396,7 @@ static int jffs2_scan_xref_node(struct jffs2_sb_info *c, struct jffs2_eraseblock ++ + return ret; + } + +@@ -411,7 +391,7 @@ static int jffs2_scan_xref_node(struct j if (!ref) return -ENOMEM; @@ -5897,7 +5656,7 @@ diff * and AFTER xattr_ref is marked as a dead xref, * ref->xid is used to store 32bit xid, xd is not used * ref->ino is used to store 32bit inode-number, ic is not used -@@ -486,10 +469,10 @@ static int jffs2_scan_eraseblock (struct jffs2_sb_info *c, struct jffs2_eraseblo +@@ -484,10 +464,10 @@ static int jffs2_scan_eraseblock (struct struct jffs2_sum_marker *sm; void *sumptr = NULL; uint32_t sumlen; @@ -5910,7 +5669,7 @@ diff if (je32_to_cpu(sm->magic) == JFFS2_SUM_MAGIC) { sumptr = buf + je32_to_cpu(sm->offset); sumlen = c->sector_size - je32_to_cpu(sm->offset); -@@ -502,13 +485,13 @@ static int jffs2_scan_eraseblock (struct jffs2_sb_info *c, struct jffs2_eraseblo +@@ -500,13 +480,13 @@ static int jffs2_scan_eraseblock (struct buf_len = sizeof(*sm); /* Read as much as we want into the _end_ of the preallocated buffer */ @@ -5927,7 +5686,7 @@ diff if (je32_to_cpu(sm->magic) == JFFS2_SUM_MAGIC) { sumlen = c->sector_size - je32_to_cpu(sm->offset); sumptr = buf + buf_size - sumlen; -@@ -523,18 +506,15 @@ static int jffs2_scan_eraseblock (struct jffs2_sb_info *c, struct jffs2_eraseblo +@@ -521,18 +501,15 @@ static int jffs2_scan_eraseblock (struct sumptr = kmalloc(sumlen, GFP_KERNEL); if (!sumptr) return -ENOMEM; @@ -5950,7 +5709,7 @@ diff } } -@@ -545,7 +525,7 @@ static int jffs2_scan_eraseblock (struct jffs2_sb_info *c, struct jffs2_eraseblo +@@ -543,7 +520,7 @@ static int jffs2_scan_eraseblock (struct if (buf_size && sumlen > buf_size) kfree(sumptr); @@ -5959,7 +5718,7 @@ diff If it returns positive, that's a block classification (i.e. BLK_STATE_xxx) so return that too. If it returns zero, fall through to full scan. */ -@@ -607,7 +587,7 @@ static int jffs2_scan_eraseblock (struct jffs2_sb_info *c, struct jffs2_eraseblo +@@ -605,7 +582,7 @@ full_scan: /* Now ofs is a complete physical flash offset as it always was... */ ofs += jeb->offset; @@ -5968,7 +5727,7 @@ diff dbg_summary("no summary found in jeb 0x%08x. Apply original scan.\n",jeb->offset); -@@ -700,7 +680,7 @@ static int jffs2_scan_eraseblock (struct jffs2_sb_info *c, struct jffs2_eraseblo +@@ -698,7 +675,7 @@ scan_more: scan_end = buf_len; goto more_empty; } @@ -5977,7 +5736,7 @@ diff /* See how much more there is to read in this eraseblock... */ buf_len = min_t(uint32_t, buf_size, jeb->offset + c->sector_size - ofs); if (!buf_len) { -@@ -950,7 +930,7 @@ static int jffs2_scan_eraseblock (struct jffs2_sb_info *c, struct jffs2_eraseblo +@@ -948,7 +925,7 @@ scan_more: jffs2_dbg(1, "Block at 0x%08x: free 0x%08x, dirty 0x%08x, unchecked 0x%08x, used 0x%08x, wasted 0x%08x\n", jeb->offset, jeb->free_size, jeb->dirty_size, jeb->unchecked_size, jeb->used_size, jeb->wasted_size); @@ -5986,7 +5745,7 @@ diff /* mark_node_obsolete can add to wasted !! */ if (jeb->wasted_size) { jeb->dirty_size += jeb->wasted_size; -@@ -978,7 +958,6 @@ struct jffs2_inode_cache *jffs2_scan_make_ino_cache(struct jffs2_sb_info *c, uin +@@ -976,7 +953,6 @@ struct jffs2_inode_cache *jffs2_scan_mak pr_notice("%s(): allocation of inode cache failed\n", __func__); return NULL; } @@ -5994,7 +5753,7 @@ diff ic->ino = ino; ic->nodes = (void *)ic; -@@ -1069,7 +1048,7 @@ static int jffs2_scan_dirent_node(struct jffs2_sb_info *c, struct jffs2_eraseblo +@@ -1067,7 +1043,7 @@ static int jffs2_scan_dirent_node(struct pseudo_random += je32_to_cpu(rd->version); /* Should never happen. Did. (OLPC trac #4184)*/ @@ -6003,7 +5762,7 @@ diff if (checkedlen < rd->nsize) { pr_err("Dirent at %08x has zeroes in name. Truncating to %d chars\n", ofs, checkedlen); -@@ -1081,7 +1060,7 @@ static int jffs2_scan_dirent_node(struct jffs2_sb_info *c, struct jffs2_eraseblo +@@ -1079,7 +1055,7 @@ static int jffs2_scan_dirent_node(struct memcpy(&fd->name, rd->name, checkedlen); fd->name[checkedlen] = 0; @@ -6012,7 +5771,7 @@ diff if (crc != je32_to_cpu(rd->name_crc)) { pr_notice("%s(): Name CRC failed on node at 0x%08x: Read 0x%08x, calculated 0x%08x\n", __func__, ofs, je32_to_cpu(rd->name_crc), crc); -@@ -1106,7 +1085,7 @@ static int jffs2_scan_dirent_node(struct jffs2_sb_info *c, struct jffs2_eraseblo +@@ -1104,7 +1080,7 @@ static int jffs2_scan_dirent_node(struct fd->next = NULL; fd->version = je32_to_cpu(rd->version); fd->ino = je32_to_cpu(rd->ino); diff --git a/src/kernel_liteos_a/fs/jffs2/src/jffs2_hash.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/jffs2/src/jffs2_hash.c similarity index 100% rename from src/kernel_liteos_a/fs/jffs2/src/jffs2_hash.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/jffs2/src/jffs2_hash.c diff --git a/src/kernel_liteos_a/fs/jffs2/src/vfs_jffs2.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/jffs2/src/vfs_jffs2.c similarity index 99% rename from src/kernel_liteos_a/fs/jffs2/src/vfs_jffs2.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/jffs2/src/vfs_jffs2.c index a67ed280..b6d616ba 100644 --- a/src/kernel_liteos_a/fs/jffs2/src/vfs_jffs2.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/jffs2/src/vfs_jffs2.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2021-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -490,14 +490,14 @@ off_t VfsJffs2Seek(struct file *filep, off_t offset, int whence) filePos = filep->f_pos; switch (whence) { - case SEEK_CUR: - filePos += offset; - break; - case SEEK_SET: filePos = offset; break; + case SEEK_CUR: + filePos += offset; + break; + case SEEK_END: filePos = node->i_size + offset; break; @@ -682,6 +682,7 @@ int VfsJffs2Rmdir(struct Vnode *parentVnode, struct Vnode *targetVnode, const ch LOS_MuxLock(&g_jffs2FsLock, (uint32_t)JFFS2_WAITING_FOREVER); ret = jffs2_rmdir(parentInode, targetInode, (const unsigned char *)path); + if (ret == 0) { (void)jffs2_iput(targetInode); } @@ -780,6 +781,7 @@ ssize_t VfsJffs2Readlink(struct Vnode *vnode, char *buffer, size_t bufLen) cnt = (bufLen - 1) < targetLen ? (bufLen - 1) : targetLen; if (LOS_CopyFromKernel(buffer, bufLen, (const char *)f->target, cnt) != 0) { + cnt = 0; LOS_MuxUnlock(&g_jffs2FsLock); return -EFAULT; } @@ -807,6 +809,7 @@ int VfsJffs2Unlink(struct Vnode *parentVnode, struct Vnode *targetVnode, const c LOS_MuxLock(&g_jffs2FsLock, (uint32_t)JFFS2_WAITING_FOREVER); ret = jffs2_unlink(parentInode, targetInode, (const unsigned char *)path); + if (ret == 0) { (void)jffs2_iput(targetInode); } diff --git a/src/kernel_liteos_a/fs/nfs/BUILD.gn b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/nfs/BUILD.gn similarity index 97% rename from src/kernel_liteos_a/fs/nfs/BUILD.gn rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/nfs/BUILD.gn index c48f95eb..4a5c8cf4 100644 --- a/src/kernel_liteos_a/fs/nfs/BUILD.gn +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/nfs/BUILD.gn @@ -28,7 +28,7 @@ # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. import("//kernel/liteos_a/liteos.gni") -import("$THIRDPARTY_NUTTX_DIR/NuttX.gni") +import("//third_party/NuttX/NuttX.gni") module_switch = defined(LOSCFG_FS_NFS) module_name = get_path_info(rebase_path("."), "name") diff --git a/src/kernel_liteos_a/fs/nfs/Kconfig b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/nfs/Kconfig similarity index 100% rename from src/kernel_liteos_a/fs/nfs/Kconfig rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/nfs/Kconfig diff --git a/src/kernel_liteos_a/fs/nfs/Makefile b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/nfs/Makefile similarity index 100% rename from src/kernel_liteos_a/fs/nfs/Makefile rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/nfs/Makefile diff --git a/src/kernel_liteos_a/fs/patchfs/BUILD.gn b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/patchfs/BUILD.gn similarity index 100% rename from src/kernel_liteos_a/fs/patchfs/BUILD.gn rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/patchfs/BUILD.gn diff --git a/src/kernel_liteos_a/fs/patchfs/Kconfig b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/patchfs/Kconfig similarity index 100% rename from src/kernel_liteos_a/fs/patchfs/Kconfig rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/patchfs/Kconfig diff --git a/src/kernel_liteos_a/fs/patchfs/Makefile b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/patchfs/Makefile similarity index 100% rename from src/kernel_liteos_a/fs/patchfs/Makefile rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/patchfs/Makefile diff --git a/src/kernel_liteos_a/fs/patchfs/los_partition_utils.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/patchfs/los_partition_utils.c similarity index 100% rename from src/kernel_liteos_a/fs/patchfs/los_partition_utils.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/patchfs/los_partition_utils.c diff --git a/src/kernel_liteos_a/fs/patchfs/los_partition_utils.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/patchfs/los_partition_utils.h similarity index 100% rename from src/kernel_liteos_a/fs/patchfs/los_partition_utils.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/patchfs/los_partition_utils.h diff --git a/src/kernel_liteos_a/fs/patchfs/los_patchfs.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/patchfs/los_patchfs.c similarity index 100% rename from src/kernel_liteos_a/fs/patchfs/los_patchfs.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/patchfs/los_patchfs.c diff --git a/src/kernel_liteos_a/fs/patchfs/los_patchfs.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/patchfs/los_patchfs.h similarity index 100% rename from src/kernel_liteos_a/fs/patchfs/los_patchfs.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/patchfs/los_patchfs.h diff --git a/src/kernel_liteos_a/fs/proc/BUILD.gn b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/proc/BUILD.gn similarity index 95% rename from src/kernel_liteos_a/fs/proc/BUILD.gn rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/proc/BUILD.gn index eb2538ed..d20b5d2e 100644 --- a/src/kernel_liteos_a/fs/proc/BUILD.gn +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/proc/BUILD.gn @@ -34,16 +34,12 @@ module_name = get_path_info(rebase_path("."), "name") kernel_module(module_name) { sources = [ "os_adapt/fd_proc.c", - "os_adapt/file_sys.c", "os_adapt/fs_cache_proc.c", - "os_adapt/mem_info.c", "os_adapt/mounts_proc.c", - "os_adapt/plimits_proc.c", "os_adapt/power_proc.c", "os_adapt/proc_init.c", "os_adapt/proc_vfs.c", "os_adapt/process_proc.c", - "os_adapt/sys_user.c", "os_adapt/uptime_proc.c", "os_adapt/vmm_proc.c", "src/proc_file.c", diff --git a/src/kernel_liteos_a/fs/proc/Kconfig b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/proc/Kconfig similarity index 57% rename from src/kernel_liteos_a/fs/proc/Kconfig rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/proc/Kconfig index c91ebe6e..1d8e320b 100644 --- a/src/kernel_liteos_a/fs/proc/Kconfig +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/proc/Kconfig @@ -4,8 +4,3 @@ config FS_PROC depends on FS_VFS help Answer Y to enable LiteOS support proc filesystem. - -config PROC_PROCESS_DIR - bool "Enable Process mount directory" - default n - depends on FS_PROC diff --git a/src/kernel_liteos_a/fs/proc/Makefile b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/proc/Makefile similarity index 100% rename from src/kernel_liteos_a/fs/proc/Makefile rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/proc/Makefile diff --git a/src/kernel_liteos_a/fs/proc/include/internal.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/proc/include/internal.h similarity index 73% rename from src/kernel_liteos_a/fs/proc/include/internal.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/proc/include/internal.h index 22949386..0cf4b35a 100644 --- a/src/kernel_liteos_a/fs/proc/include/internal.h +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/proc/include/internal.h @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2023 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -45,26 +45,6 @@ extern "C" { extern spinlock_t procfsLock; extern bool procfsInit; -#ifdef LOSCFG_PROC_PROCESS_DIR -int ProcCreateProcessDir(UINT32 pid, uintptr_t process); - -void ProcFreeProcessDir(struct ProcDirEntry *processDir); - -void ProcSysMemInfoInit(void); - -void ProcFileSysInit(void); -#endif - -#ifdef LOSCFG_KERNEL_PLIMITS -void ProcLimitsInit(void); -#endif - -void ProcEntryClearVnode(struct ProcDirEntry *entry); - -void ProcDetachNode(struct ProcDirEntry *pn); - -void RemoveProcEntryTravalsal(struct ProcDirEntry *pn); - void ProcPmInit(void); void ProcVmmInit(void); @@ -77,20 +57,15 @@ struct ProcDirEntry *ProcFindEntry(const char *path); void ProcFreeEntry(struct ProcDirEntry *pde); -int ProcStat(const char *file, struct ProcStat *buf); - -void ProcMountsInit(void); +extern int ProcStat(const char *file, struct ProcStat *buf); -void ProcUptimeInit(void); +extern void ProcMountsInit(void); -void ProcFsCacheInit(void); +extern void ProcUptimeInit(void); -void ProcFdInit(void); +extern void ProcFsCacheInit(void); -#ifdef LOSCFG_KERNEL_CONTAINER -void *ProcfsContainerGet(int fd, unsigned int *containerType); -void ProcSysUserInit(void); -#endif +extern void ProcFdInit(void); #ifdef __cplusplus #if __cplusplus diff --git a/src/kernel_liteos_a/fs/proc/include/proc_file.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/proc/include/proc_file.h similarity index 100% rename from src/kernel_liteos_a/fs/proc/include/proc_file.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/proc/include/proc_file.h diff --git a/src/kernel_liteos_a/fs/proc/include/proc_fs.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/proc/include/proc_fs.h similarity index 81% rename from src/kernel_liteos_a/fs/proc/include/proc_fs.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/proc/include/proc_fs.h index f172d439..10acebca 100644 --- a/src/kernel_liteos_a/fs/proc/include/proc_fs.h +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/proc/include/proc_fs.h @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2023 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -82,7 +82,6 @@ typedef unsigned short fmode_t; #define FMODE_READ ((fmode_t)0x1) struct ProcFile; -struct ProcDirEntry; struct ProcFileOperations { char *name; @@ -90,18 +89,8 @@ struct ProcFileOperations { int (*open)(struct Vnode *vnode, struct ProcFile *pf); int (*release)(struct Vnode *vnode, struct ProcFile *pf); int (*read)(struct SeqBuf *m, void *v); - ssize_t (*readLink)(struct ProcDirEntry *pde, char *buf, size_t bufLen); }; -#ifdef LOSCFG_KERNEL_PLIMITS -struct ProcDirOperations { - int (*rmdir)(struct ProcDirEntry *parent, struct ProcDirEntry *pde, const char *name); - int (*mkdir)(struct ProcDirEntry *parent, const char *dirName, mode_t mode, struct ProcDirEntry **pde); -}; -#endif - -#define PROC_DATA_STATIC 0 -#define PROC_DATA_FREE 1 struct ProcDirEntry { uint uid; uint gid; @@ -110,10 +99,6 @@ struct ProcDirEntry { const struct ProcFileOperations *procFileOps; struct ProcFile *pf; struct ProcDirEntry *next, *parent, *subdir; -#ifdef LOSCFG_KERNEL_PLIMITS - const struct ProcDirOperations *procDirOps; -#endif - int dataType; void *data; atomic_t count; /* open file count */ spinlock_t pdeUnloadLock; @@ -124,11 +109,6 @@ struct ProcDirEntry { enum VnodeType type; }; -struct ProcDataParm { - void *data; - int dataType; -}; - struct ProcFile { fmode_t fMode; spinlock_t fLock; @@ -157,7 +137,7 @@ struct ProcData { #define S_IALLUGO (S_ISUID | S_ISGID | S_ISVTX | S_IRWXU | S_IRWXG | S_IRWXO) /** - * Interface for modules using proc below internal proc module; + * Interface for modules using proc below internal proc moudule; */ /** * @ingroup procfs @@ -264,35 +244,6 @@ extern struct ProcDirEntry *ProcMkdir(const char *name, struct ProcDirEntry *par extern struct ProcDirEntry *ProcCreate(const char *name, mode_t mode, struct ProcDirEntry *parent, const struct ProcFileOperations *procFops); -/** - * @ingroup procfs - * @brief create a proc node - * - * @par Description: - * This API is used to create the node by 'name' and parent vnode, - * And assignment operation function - * - * @attention - *
    - *
  • This interface should be called after system initialization.
  • - *
  • The parameter name should be a valid string.
  • - *
- * - * @param name [IN] Type #const char * The name of the node to be created. - * @param mode [IN] Type #mode_t the mode of create's node. - * @param parent [IN] Type #struct ProcDirEntry * the parent node of the node to be created. - * @param procFops [IN] Type #const struct ProcFileOperations * operation function of the node. - * @param data [IN] Type #void * data of the node. - * - * @retval #NULL Create failed. - * @retval #ProcDirEntry* Create successfully. - * @par Dependency: - *
  • proc_fs.h: the header file that contains the API declaration.
- * @see - * - */ -extern struct ProcDirEntry *ProcCreateData(const char *name, mode_t mode, struct ProcDirEntry *parent, - const struct ProcFileOperations *procFileOps, struct ProcDataParm *param); /** * @ingroup procfs * @brief init proc fs @@ -315,7 +266,6 @@ extern struct ProcDirEntry *ProcCreateData(const char *name, mode_t mode, struct */ extern void ProcFsInit(void); -extern struct ProcDirEntry *VnodeToEntry(struct Vnode *node); #ifdef __cplusplus #if __cplusplus } diff --git a/src/kernel_liteos_a/fs/proc/os_adapt/fd_proc.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/proc/os_adapt/fd_proc.c similarity index 99% rename from src/kernel_liteos_a/fs/proc/os_adapt/fd_proc.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/proc/os_adapt/fd_proc.c index 1c658b39..337b493b 100644 --- a/src/kernel_liteos_a/fs/proc/os_adapt/fd_proc.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/proc/os_adapt/fd_proc.c @@ -135,7 +135,7 @@ void ProcFdInit(void) { struct ProcDirEntry *pde = CreateProcEntry("fd", 0, NULL); if (pde == NULL) { - PRINT_ERR("create /proc/fd error.\n"); + PRINT_ERR("creat /proc/fd error.\n"); return; } diff --git a/src/kernel_liteos_a/fs/proc/os_adapt/fs_cache_proc.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/proc/os_adapt/fs_cache_proc.c similarity index 96% rename from src/kernel_liteos_a/fs/proc/os_adapt/fs_cache_proc.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/proc/os_adapt/fs_cache_proc.c index 19bcdb02..a33ec1a9 100644 --- a/src/kernel_liteos_a/fs/proc/os_adapt/fs_cache_proc.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/proc/os_adapt/fs_cache_proc.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2021-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -154,8 +154,7 @@ static int FsCacheInfoFill(struct SeqBuf *buf, void *arg) VnodeHold(); LosBufPrintf(buf, "\n=================================================================\n"); - LosBufPrintf(buf, - "VnodeAddr ParentAddr DataAddr VnodeOps Hash Ref Type Gid Uid Mode\n"); + LosBufPrintf(buf, "VnodeAddr ParentAddr DataAddr VnodeOps Hash Ref Type Gid Uid Mode\n"); vnodeVirtual = VnodeListProcess(buf, GetVnodeVirtualList()); vnodeFree = VnodeListProcess(buf, GetVnodeFreeList()); vnodeActive = VnodeListProcess(buf, GetVnodeActiveList()); @@ -207,7 +206,7 @@ static const struct ProcFileOperations FS_CACHE_PROC_FOPS = { void ProcFsCacheInit(void) { - struct ProcDirEntry *pde = CreateProcEntry("fs_cache", 0400, NULL); + struct ProcDirEntry *pde = CreateProcEntry("fs_cache", 0, NULL); if (pde == NULL) { PRINT_ERR("create fs_cache error!\n"); return; diff --git a/src/kernel_liteos_a/fs/proc/os_adapt/mounts_proc.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/proc/os_adapt/mounts_proc.c similarity index 98% rename from src/kernel_liteos_a/fs/proc/os_adapt/mounts_proc.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/proc/os_adapt/mounts_proc.c index bc36dc9f..c5f39ab2 100644 --- a/src/kernel_liteos_a/fs/proc/os_adapt/mounts_proc.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/proc/os_adapt/mounts_proc.c @@ -91,7 +91,7 @@ void ProcMountsInit(void) { struct ProcDirEntry *pde = CreateProcEntry("mounts", 0, NULL); if (pde == NULL) { - PRINT_ERR("create mounts error!\n"); + PRINT_ERR("creat mounts error!\n"); return; } diff --git a/src/kernel_liteos_a/fs/proc/os_adapt/power_proc.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/proc/os_adapt/power_proc.c similarity index 100% rename from src/kernel_liteos_a/fs/proc/os_adapt/power_proc.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/proc/os_adapt/power_proc.c diff --git a/src/kernel_liteos_a/fs/proc/os_adapt/proc_init.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/proc/os_adapt/proc_init.c similarity index 90% rename from src/kernel_liteos_a/fs/proc/os_adapt/proc_init.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/proc/os_adapt/proc_init.c index 85913e1d..e8dc2df1 100644 --- a/src/kernel_liteos_a/fs/proc/os_adapt/proc_init.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/proc/os_adapt/proc_init.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2023 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -68,16 +68,6 @@ void ProcFsInit(void) #ifdef LOSCFG_KERNEL_PM ProcPmInit(); #endif -#ifdef LOSCFG_PROC_PROCESS_DIR - ProcSysMemInfoInit(); - ProcFileSysInit(); -#endif -#ifdef LOSCFG_KERNEL_PLIMITS - ProcLimitsInit(); -#endif -#ifdef LOSCFG_KERNEL_CONTAINER - ProcSysUserInit(); -#endif } LOS_MODULE_INIT(ProcFsInit, LOS_INIT_LEVEL_KMOD_EXTENDED); diff --git a/src/kernel_liteos_a/fs/proc/os_adapt/proc_vfs.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/proc/os_adapt/proc_vfs.c similarity index 73% rename from src/kernel_liteos_a/fs/proc/os_adapt/proc_vfs.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/proc/os_adapt/proc_vfs.c index b479bd63..3876967c 100644 --- a/src/kernel_liteos_a/fs/proc/os_adapt/proc_vfs.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/proc/os_adapt/proc_vfs.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2023 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2021-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -45,7 +45,7 @@ static struct VnodeOps g_procfsVops; static struct file_operations_vfs g_procfsFops; -struct ProcDirEntry *VnodeToEntry(struct Vnode *node) +static struct ProcDirEntry *VnodeToEntry(struct Vnode *node) { return (struct ProcDirEntry *)(node->data); } @@ -125,16 +125,10 @@ int VfsProcfsRead(struct file *filep, char *buffer, size_t buflen) return -EINVAL; } - VnodeHold(); entry = VnodeToEntry(filep->f_vnode); - if (entry == NULL) { - VnodeDrop(); - return -EPERM; - } - size = (ssize_t)ReadProcFile(entry, (void *)buffer, buflen); filep->f_pos = entry->pf->fPos; - VnodeDrop(); + return size; } @@ -146,16 +140,10 @@ int VfsProcfsWrite(struct file *filep, const char *buffer, size_t buflen) return -EINVAL; } - VnodeHold(); entry = VnodeToEntry(filep->f_vnode); - if (entry == NULL) { - VnodeDrop(); - return -EPERM; - } - size = (ssize_t)WriteProcFile(entry, (void *)buffer, buflen); filep->f_pos = entry->pf->fPos; - VnodeDrop(); + return size; } @@ -168,7 +156,6 @@ int VfsProcfsLookup(struct Vnode *parent, const char *name, int len, struct Vnod if (entry == NULL) { return -ENODATA; } - entry = entry->subdir; while (1) { if (entry == NULL) { @@ -227,70 +214,21 @@ int VfsProcfsUnmount(void *handle, struct Vnode **blkdriver) int VfsProcfsStat(struct Vnode *node, struct stat *buf) { - VnodeHold(); struct ProcDirEntry *entry = VnodeToEntry(node); - if (entry == NULL) { - VnodeDrop(); - return -EPERM; - } + (void)memset_s(buf, sizeof(struct stat), 0, sizeof(struct stat)); buf->st_mode = entry->mode; - VnodeDrop(); - return LOS_OK; -} -#ifdef LOSCFG_KERNEL_PLIMITS -int VfsProcfsMkdir(struct Vnode *parent, const char *dirName, mode_t mode, struct Vnode **vnode) -{ - struct ProcDirEntry *parentEntry = VnodeToEntry(parent); - struct ProcDirEntry *pde = NULL; - if ((parentEntry->procDirOps == NULL) || (parentEntry->procDirOps->mkdir == NULL)) { - return -ENOSYS; - } - - int ret = parentEntry->procDirOps->mkdir(parentEntry, dirName, mode, &pde); - if ((ret < 0) || (pde == NULL)) { - return ret; - } - - *vnode = EntryToVnode(pde); - (*vnode)->vop = parent->vop; - (*vnode)->parent = parent; - (*vnode)->originMount = parent->originMount; - if ((*vnode)->type == VNODE_TYPE_DIR) { - (*vnode)->mode = S_IFDIR | PROCFS_DEFAULT_MODE; - } else { - (*vnode)->mode = S_IFREG | PROCFS_DEFAULT_MODE; - } - return ret; -} - -int VfsProcfsRmdir(struct Vnode *parent, struct Vnode *vnode, const char *dirName) -{ - if (parent == NULL) { - return -EINVAL; - } - - struct ProcDirEntry *parentEntry = VnodeToEntry(parent); - if ((parentEntry->procDirOps == NULL) || (parentEntry->procDirOps->rmdir == NULL)) { - return -ENOSYS; - } - - struct ProcDirEntry *dirEntry = VnodeToEntry(vnode); - int ret = parentEntry->procDirOps->rmdir(parentEntry, dirEntry, dirName); - if (ret < 0) { - return ret; - } - vnode->data = NULL; - return 0; + return LOS_OK; } -#endif int VfsProcfsReaddir(struct Vnode *node, struct fs_dirent_s *dir) { int result; char *buffer = NULL; - unsigned int minSize, dstNameSize; + int buflen = NAME_MAX; + unsigned int min_size; + unsigned int dst_name_size; struct ProcDirEntry *pde = NULL; int i = 0; @@ -300,35 +238,28 @@ int VfsProcfsReaddir(struct Vnode *node, struct fs_dirent_s *dir) if (node->type != VNODE_TYPE_DIR) { return -ENOTDIR; } - VnodeHold(); pde = VnodeToEntry(node); - if (pde == NULL) { - VnodeDrop(); - return -EPERM; - } while (i < dir->read_cnt) { buffer = (char *)zalloc(sizeof(char) * NAME_MAX); if (buffer == NULL) { - VnodeDrop(); PRINT_ERR("malloc failed\n"); return -ENOMEM; } - result = ReadProcFile(pde, (void *)buffer, NAME_MAX); + result = ReadProcFile(pde, (void *)buffer, buflen); if (result != ENOERR) { free(buffer); break; } - dstNameSize = sizeof(dir->fd_dir[i].d_name); - minSize = (dstNameSize < NAME_MAX) ? dstNameSize : NAME_MAX; - result = strncpy_s(dir->fd_dir[i].d_name, dstNameSize, buffer, minSize); + dst_name_size = sizeof(dir->fd_dir[i].d_name); + min_size = (dst_name_size < NAME_MAX) ? dst_name_size : NAME_MAX; + result = strncpy_s(dir->fd_dir[i].d_name, dst_name_size, buffer, min_size); if (result != EOK) { - VnodeDrop(); free(buffer); return -ENAMETOOLONG; } - dir->fd_dir[i].d_name[dstNameSize - 1] = '\0'; + dir->fd_dir[i].d_name[dst_name_size - 1] = '\0'; dir->fd_position++; dir->fd_dir[i].d_off = dir->fd_position; dir->fd_dir[i].d_reclen = (uint16_t)sizeof(struct dirent); @@ -336,26 +267,19 @@ int VfsProcfsReaddir(struct Vnode *node, struct fs_dirent_s *dir) i++; free(buffer); } - VnodeDrop(); + return i; } int VfsProcfsOpendir(struct Vnode *node, struct fs_dirent_s *dir) { - VnodeHold(); struct ProcDirEntry *pde = VnodeToEntry(node); if (pde == NULL) { - VnodeDrop(); return -EINVAL; } - pde->pdirCurrent = pde->subdir; - if (pde->pf == NULL) { - VnodeDrop(); - return -EINVAL; - } pde->pf->fPos = 0; - VnodeDrop(); + return LOS_OK; } @@ -364,14 +288,8 @@ int VfsProcfsOpen(struct file *filep) if (filep == NULL) { return -EINVAL; } - VnodeHold(); struct Vnode *node = filep->f_vnode; struct ProcDirEntry *pde = VnodeToEntry(node); - if (pde == NULL) { - VnodeDrop(); - return -EPERM; - } - if (ProcOpen(pde->pf) != OK) { return -ENOMEM; } @@ -383,7 +301,6 @@ int VfsProcfsOpen(struct file *filep) pde->pf->fPos = 0; } filep->f_priv = (void *)pde; - VnodeDrop(); return LOS_OK; } @@ -393,22 +310,15 @@ int VfsProcfsClose(struct file *filep) if (filep == NULL) { return -EINVAL; } - - VnodeHold(); struct Vnode *node = filep->f_vnode; struct ProcDirEntry *pde = VnodeToEntry(node); - if ((pde == NULL) || (pde->pf == NULL)) { - VnodeDrop(); - return -EPERM; - } - pde->pf->fPos = 0; if ((pde->procFileOps != NULL) && (pde->procFileOps->release != NULL)) { result = pde->procFileOps->release((struct Vnode *)pde, pde->pf); } LosBufRelease(pde->pf->sbuf); pde->pf->sbuf = NULL; - VnodeDrop(); + return result; } @@ -425,24 +335,6 @@ int VfsProcfsClosedir(struct Vnode *vp, struct fs_dirent_s *dir) return LOS_OK; } -ssize_t VfsProcfsReadlink(struct Vnode *vnode, char *buffer, size_t bufLen) -{ - int result = -EINVAL; - if (vnode == NULL) { - return result; - } - - struct ProcDirEntry *pde = VnodeToEntry(vnode); - if (pde == NULL) { - return -EPERM; - } - - if ((pde->procFileOps != NULL) && (pde->procFileOps->readLink != NULL)) { - result = pde->procFileOps->readLink(pde, buffer, bufLen); - } - return result; -} - const struct MountOps procfs_operations = { .Mount = VfsProcfsMount, .Unmount = NULL, @@ -455,12 +347,7 @@ static struct VnodeOps g_procfsVops = { .Readdir = VfsProcfsReaddir, .Opendir = VfsProcfsOpendir, .Closedir = VfsProcfsClosedir, - .Truncate = VfsProcfsTruncate, - .Readlink = VfsProcfsReadlink, -#ifdef LOSCFG_KERNEL_PLIMITS - .Mkdir = VfsProcfsMkdir, - .Rmdir = VfsProcfsRmdir, -#endif + .Truncate = VfsProcfsTruncate }; static struct file_operations_vfs g_procfsFops = { diff --git a/src/kernel_liteos_a/testsuites/unittest/fuzz/clone_fuzzer.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/proc/os_adapt/process_proc.c similarity index 68% rename from src/kernel_liteos_a/testsuites/unittest/fuzz/clone_fuzzer.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/proc/os_adapt/process_proc.c index 2ac95f6b..65fe78bb 100644 --- a/src/kernel_liteos_a/testsuites/unittest/fuzz/clone_fuzzer.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/proc/os_adapt/process_proc.c @@ -1,5 +1,6 @@ /* - * Copyright (c) 2022-2023 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -28,31 +29,30 @@ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include -#include -#include -#include -#include -#include -#include -#include -#include "fuzzertest.h" +#include +#include +#include "proc_fs.h" +#include "los_process_pri.h" -static int childFunc(void *) +static int ProcessProcFill(struct SeqBuf *m, void *v) { + (void)v; + (void)OsShellCmdTskInfoGet(OS_ALL_TASK_MASK, m, OS_PROCESS_INFO_ALL); return 0; } -void TestClone(void) +static const struct ProcFileOperations PROCESS_PROC_FOPS = { + .read = ProcessProcFill, +}; + +void ProcProcessInit(void) { - printf("start----TestClone\n"); - DT_Enable_Support_Loop(1); - - DT_FUZZ_START(0, FREQUENCY, const_cast("TestClone"), 0) { - s32 number = *(s32 *)DT_SetGetS32(&g_Element[0], INITVALUE_S32); - pid_t pid = clone(childFunc, NULL, number, NULL); - waitpid(pid, NULL, 0); + struct ProcDirEntry *pde = CreateProcEntry("process", 0, NULL); + if (pde == NULL) { + PRINT_ERR("create /proc/process error!\n"); + return; } - DT_FUZZ_END() - printf("end----TestClone\n"); + + pde->procFileOps = &PROCESS_PROC_FOPS; } + diff --git a/src/kernel_liteos_a/fs/proc/os_adapt/uptime_proc.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/proc/os_adapt/uptime_proc.c similarity index 98% rename from src/kernel_liteos_a/fs/proc/os_adapt/uptime_proc.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/proc/os_adapt/uptime_proc.c index 552a4451..d30e62c1 100644 --- a/src/kernel_liteos_a/fs/proc/os_adapt/uptime_proc.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/proc/os_adapt/uptime_proc.c @@ -78,7 +78,7 @@ void ProcUptimeInit(void) { struct ProcDirEntry *pde = CreateProcEntry("uptime", 0, NULL); if (pde == NULL) { - PRINT_ERR("create /proc/uptime error!\n"); + PRINT_ERR("creat /proc/uptime error!\n"); return; } diff --git a/src/kernel_liteos_a/fs/proc/os_adapt/vmm_proc.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/proc/os_adapt/vmm_proc.c similarity index 100% rename from src/kernel_liteos_a/fs/proc/os_adapt/vmm_proc.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/proc/os_adapt/vmm_proc.c diff --git a/src/kernel_liteos_a/fs/proc/src/proc_file.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/proc/src/proc_file.c similarity index 92% rename from src/kernel_liteos_a/fs/proc/src/proc_file.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/proc/src/proc_file.c index 92415022..27264da1 100644 --- a/src/kernel_liteos_a/fs/proc/src/proc_file.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/proc/src/proc_file.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2023 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -62,9 +62,8 @@ static struct ProcDirEntry g_procRootDirEntry = { int ProcMatch(unsigned int len, const char *name, struct ProcDirEntry *pn) { - if (len != pn->nameLen) { + if (len != pn->nameLen) return 0; - } return !strncmp(name, pn->name, len); } @@ -296,7 +295,7 @@ static int ProcAddNode(struct ProcDirEntry *parent, struct ProcDirEntry *pn) return 0; } -void ProcDetachNode(struct ProcDirEntry *pn) +static void ProcDetachNode(struct ProcDirEntry *pn) { struct ProcDirEntry *parent = pn->parent; struct ProcDirEntry **iter = NULL; @@ -352,11 +351,6 @@ static struct ProcDirEntry *ProcCreateFile(struct ProcDirEntry *parent, const ch pn->procFileOps = procFileOps; pn->type = VNODE_TYPE_REG; -#ifdef LOSCFG_PROC_PROCESS_DIR - if (S_ISLNK(mode)) { - pn->type = VNODE_TYPE_VIR_LNK; - } -#endif ret = ProcAddNode(parent, pn); if (ret != 0) { free(pn->pf); @@ -379,50 +373,25 @@ struct ProcDirEntry *CreateProcEntry(const char *name, mode_t mode, struct ProcD return pde; } -void ProcEntryClearVnode(struct ProcDirEntry *entry) -{ - struct Vnode *item = NULL; - struct Vnode *nextItem = NULL; - - VnodeHold(); - LOS_DL_LIST_FOR_EACH_ENTRY_SAFE(item, nextItem, GetVnodeActiveList(), struct Vnode, actFreeEntry) { - if ((struct ProcDirEntry *)item->data != entry) { - continue; - } - - if (VnodeFree(item) != LOS_OK) { - PRINT_ERR("ProcEntryClearVnode free failed, entry: %s\n", entry->name); - } - } - VnodeDrop(); - return; -} - static void FreeProcEntry(struct ProcDirEntry *entry) { if (entry == NULL) { return; } - if (entry->pf != NULL) { free(entry->pf); entry->pf = NULL; } - if ((entry->dataType == PROC_DATA_FREE) && (entry->data != NULL)) { - free(entry->data); - } - entry->data = NULL; free(entry); } void ProcFreeEntry(struct ProcDirEntry *pn) { - if (atomic_dec_and_test(&pn->count)) { + if (atomic_dec_and_test(&pn->count)) FreeProcEntry(pn); - } } -void RemoveProcEntryTravalsal(struct ProcDirEntry *pn) +static void RemoveProcEntryTravalsal(struct ProcDirEntry *pn) { if (pn == NULL) { return; @@ -430,8 +399,6 @@ void RemoveProcEntryTravalsal(struct ProcDirEntry *pn) RemoveProcEntryTravalsal(pn->next); RemoveProcEntryTravalsal(pn->subdir); - ProcEntryClearVnode(pn); - ProcFreeEntry(pn); } @@ -461,9 +428,6 @@ void RemoveProcEntry(const char *name, struct ProcDirEntry *parent) spin_unlock(&procfsLock); RemoveProcEntryTravalsal(pn->subdir); - - ProcEntryClearVnode(pn); - ProcFreeEntry(pn); } @@ -478,17 +442,14 @@ struct ProcDirEntry *ProcMkdir(const char *name, struct ProcDirEntry *parent) } struct ProcDirEntry *ProcCreateData(const char *name, mode_t mode, struct ProcDirEntry *parent, - const struct ProcFileOperations *procFileOps, struct ProcDataParm *param) + const struct ProcFileOperations *procFileOps, void *data) { struct ProcDirEntry *pde = CreateProcEntry(name, mode, parent); if (pde != NULL) { if (procFileOps != NULL) { pde->procFileOps = procFileOps; } - if (param != NULL) { - pde->data = param->data; - pde->dataType = param->dataType; - } + pde->data = data; } return pde; } @@ -566,7 +527,7 @@ static int ProcRead(struct ProcDirEntry *pde, char *buf, size_t len) if (sb->buf == NULL) { // only read once to build the storage buffer - if (pde->procFileOps->read(sb, pde->data) != 0) { + if (pde->procFileOps->read(sb, NULL) != 0) { return PROC_ERROR; } } @@ -591,17 +552,21 @@ static int ProcRead(struct ProcDirEntry *pde, char *buf, size_t len) struct ProcDirEntry *OpenProcFile(const char *fileName, int flags, ...) { + unsigned int intSave; struct ProcDirEntry *pn = ProcFindEntry(fileName); if (pn == NULL) { return NULL; } + SCHEDULER_LOCK(intSave); if (S_ISREG(pn->mode) && (pn->count != 1)) { + SCHEDULER_UNLOCK(intSave); return NULL; } pn->flags = (unsigned int)(pn->flags) | (unsigned int)flags; atomic_set(&pn->count, PROC_INUSE); + SCHEDULER_UNLOCK(intSave); if (ProcOpen(pn->pf) != OK) { return NULL; } @@ -650,6 +615,7 @@ int WriteProcFile(struct ProcDirEntry *pde, const void *buf, size_t len) result = pde->procFileOps->write(pde->pf, (const char *)buf, len, &(pde->pf->fPos)); } spin_unlock(&procfsLock); + return result; } diff --git a/src/kernel_liteos_a/fs/proc/src/proc_shellcmd.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/proc/src/proc_shellcmd.c similarity index 95% rename from src/kernel_liteos_a/fs/proc/src/proc_shellcmd.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/proc/src/proc_shellcmd.c index 6e2d8fbf..188ffc58 100644 --- a/src/kernel_liteos_a/fs/proc/src/proc_shellcmd.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/proc/src/proc_shellcmd.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2022 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -62,8 +62,8 @@ int OsShellCmdWriteProc(int argc, char **argv) if (argc == WRITEPROC_ARGC) { value = argv[0]; - path = argv[2]; // 2: index of path - len = strlen(value) + 1; /* + 1:add the \0 */ + path = argv[2]; + len = strlen(value) + 1; /* +1:add the \0 */ if (strncmp(argv[1], ">>", strlen(">>")) == 0) { if ((realpath(path, realPath) == NULL) || (strncmp(realPath, rootProcDir, strlen(rootProcDir)) != 0)) { PRINT_ERR("No such file or directory\n"); diff --git a/src/kernel_liteos_a/fs/ramfs/BUILD.gn b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/ramfs/BUILD.gn similarity index 97% rename from src/kernel_liteos_a/fs/ramfs/BUILD.gn rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/ramfs/BUILD.gn index 1f95d11c..716f4c3a 100644 --- a/src/kernel_liteos_a/fs/ramfs/BUILD.gn +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/ramfs/BUILD.gn @@ -28,7 +28,7 @@ # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. import("//kernel/liteos_a/liteos.gni") -import("$THIRDPARTY_NUTTX_DIR/NuttX.gni") +import("//third_party/NuttX/NuttX.gni") module_switch = defined(LOSCFG_FS_RAMFS) module_name = get_path_info(rebase_path("."), "name") diff --git a/src/kernel_liteos_a/fs/ramfs/Kconfig b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/ramfs/Kconfig similarity index 100% rename from src/kernel_liteos_a/fs/ramfs/Kconfig rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/ramfs/Kconfig diff --git a/src/kernel_liteos_a/fs/ramfs/Makefile b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/ramfs/Makefile similarity index 100% rename from src/kernel_liteos_a/fs/ramfs/Makefile rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/ramfs/Makefile diff --git a/src/kernel_liteos_a/fs/romfs/BUILD.gn b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/romfs/BUILD.gn similarity index 97% rename from src/kernel_liteos_a/fs/romfs/BUILD.gn rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/romfs/BUILD.gn index e01fc43b..4e371f7d 100644 --- a/src/kernel_liteos_a/fs/romfs/BUILD.gn +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/romfs/BUILD.gn @@ -28,7 +28,7 @@ # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. import("//kernel/liteos_a/liteos.gni") -import("$THIRDPARTY_NUTTX_DIR/NuttX.gni") +import("//third_party/NuttX/NuttX.gni") module_switch = defined(LOSCFG_FS_ROMFS) module_name = get_path_info(rebase_path("."), "name") diff --git a/src/kernel_liteos_a/fs/romfs/Kconfig b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/romfs/Kconfig similarity index 100% rename from src/kernel_liteos_a/fs/romfs/Kconfig rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/romfs/Kconfig diff --git a/src/kernel_liteos_a/fs/romfs/Makefile b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/romfs/Makefile similarity index 100% rename from src/kernel_liteos_a/fs/romfs/Makefile rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/romfs/Makefile diff --git a/src/kernel_liteos_a/fs/rootfs/BUILD.gn b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/rootfs/BUILD.gn similarity index 100% rename from src/kernel_liteos_a/fs/rootfs/BUILD.gn rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/rootfs/BUILD.gn diff --git a/src/kernel_liteos_a/fs/rootfs/Kconfig b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/rootfs/Kconfig similarity index 94% rename from src/kernel_liteos_a/fs/rootfs/Kconfig rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/rootfs/Kconfig index d1c39d24..2866817a 100644 --- a/src/kernel_liteos_a/fs/rootfs/Kconfig +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/rootfs/Kconfig @@ -29,9 +29,10 @@ endchoice config BOOTENV_ADDR int "Address of boot command line (KB)" depends on PLATFORM_ROOTFS && (STORAGE_SPINOR || STORAGE_SPINAND || STORAGE_EMMC) + range 0 1024 default 512 help - Boot command line addr. + Boot command line addr, range from 0 to 1MB. config BOOTENV_RAM bool "Read bootenv from RAM" diff --git a/src/kernel_liteos_a/fs/rootfs/Makefile b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/rootfs/Makefile similarity index 93% rename from src/kernel_liteos_a/fs/rootfs/Makefile rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/rootfs/Makefile index 7afed881..a4fd241d 100644 --- a/src/kernel_liteos_a/fs/rootfs/Makefile +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/rootfs/Makefile @@ -33,6 +33,10 @@ MODULE_NAME := rootfs LOCAL_SRCS := $(wildcard los_rootfs.c los_bootargs.c) +ifeq ($(LOSCFG_PLATFORM_QEMU_ARM_VIRT_CA7), y) +LOCAL_INCLUDE += -I $(LITEOSTOPDIR)/../../device/qemu/drivers/cfiflash +endif + LOCAL_FLAGS := $(LOCAL_INCLUDE) include $(MODULE) diff --git a/src/kernel_liteos_a/fs/rootfs/los_bootargs.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/rootfs/los_bootargs.c similarity index 92% rename from src/kernel_liteos_a/fs/rootfs/los_bootargs.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/rootfs/los_bootargs.c index fb40d796..3764ae49 100644 --- a/src/kernel_liteos_a/fs/rootfs/los_bootargs.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/rootfs/los_bootargs.c @@ -32,10 +32,14 @@ #include "los_base.h" #include "string.h" -#if defined(LOSCFG_STORAGE_SPINOR) || defined(LOSCFG_STORAGE_SPINAND) +#if defined(LOSCFG_STORAGE_SPINOR) || defined(LOSCFG_STORAGE_SPINAND) || defined(LOSCFG_PLATFORM_QEMU_ARM_VIRT_CA7) #include "mtd_list.h" #endif +#ifdef LOSCFG_PLATFORM_QEMU_ARM_VIRT_CA7 +#include "cfiflash.h" +#endif + #ifdef LOSCFG_STORAGE_EMMC #include "disk.h" #endif @@ -94,6 +98,19 @@ INT32 LOS_GetCmdLine(VOID) } #endif +#ifdef LOSCFG_PLATFORM_QEMU_ARM_VIRT_CA7 + struct MtdDev *mtd = GetCfiMtdDev(); + if (mtd == NULL) { + PRINT_ERR("Get CFI mtd failed!\n"); + goto ERROUT; + } + g_alignSize = mtd->eraseSize; + ret = mtd->read(mtd, CFIFLASH_BOOTARGS_ADDR, COMMAND_LINE_SIZE, g_cmdLine); + if (ret == COMMAND_LINE_SIZE) { + return LOS_OK; + } +#endif + PRINT_ERR("Read cmdline error!\n"); ERROUT: free(g_cmdLine); diff --git a/src/kernel_liteos_a/fs/rootfs/los_bootargs.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/rootfs/los_bootargs.h similarity index 100% rename from src/kernel_liteos_a/fs/rootfs/los_bootargs.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/rootfs/los_bootargs.h diff --git a/src/kernel_liteos_a/fs/rootfs/los_rootfs.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/rootfs/los_rootfs.c similarity index 96% rename from src/kernel_liteos_a/fs/rootfs/los_rootfs.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/rootfs/los_rootfs.c index 346618b4..7adb7dd4 100644 --- a/src/kernel_liteos_a/fs/rootfs/los_rootfs.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/rootfs/los_rootfs.c @@ -37,11 +37,15 @@ #include "sys/stat.h" #include "sys/types.h" -#if defined(LOSCFG_STORAGE_SPINOR) || defined(LOSCFG_STORAGE_SPINAND) +#if defined(LOSCFG_STORAGE_SPINOR) || defined(LOSCFG_STORAGE_SPINAND) || defined(LOSCFG_PLATFORM_QEMU_ARM_VIRT_CA7) #include "mtd_list.h" #include "mtd_partition.h" #endif +#ifdef LOSCFG_PLATFORM_QEMU_ARM_VIRT_CA7 +#include "cfiflash.h" +#endif + #ifdef LOSCFG_STORAGE_EMMC #include "disk.h" #include "ff.h" @@ -124,7 +128,14 @@ STATIC INT32 AddEmmcParts(INT32 rootAddr, INT32 rootSize, INT32 userAddr, INT32 STATIC INT32 AddPartitions(CHAR *dev, UINT64 rootAddr, UINT64 rootSize, UINT64 userAddr, UINT64 userSize) { -#if defined(LOSCFG_STORAGE_SPINOR) || defined(LOSCFG_STORAGE_SPINAND) +#ifdef LOSCFG_PLATFORM_QEMU_ARM_VIRT_CA7 + if ((strcmp(dev, "cfi-flash") == 0) && (rootAddr != CFIFLASH_ROOT_ADDR)) { + PRINT_ERR("Error rootAddr, must be %#0x!\n", CFIFLASH_ROOT_ADDR); + return LOS_NOK; + } +#endif + +#if defined(LOSCFG_STORAGE_SPINOR) || defined(LOSCFG_STORAGE_SPINAND) || defined(LOSCFG_PLATFORM_QEMU_ARM_VIRT_CA7) INT32 ret; INT32 blk0 = 0; INT32 blk2 = 2; diff --git a/src/kernel_liteos_a/fs/rootfs/los_rootfs.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/rootfs/los_rootfs.h similarity index 91% rename from src/kernel_liteos_a/fs/rootfs/los_rootfs.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/rootfs/los_rootfs.h index ec12869c..43b81f6c 100644 --- a/src/kernel_liteos_a/fs/rootfs/los_rootfs.h +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/rootfs/los_rootfs.h @@ -59,6 +59,12 @@ #define ROOTFS_ADDR 0x600000 #define ROOTFS_SIZE 0x800000 #define USERFS_SIZE 0x80000 +#elif defined (LOSCFG_PLATFORM_QEMU_ARM_VIRT_CA7) +#define ROOT_DEV_NAME "/dev/cfiflash0" +#define USER_DEV_NAME "/dev/cfiflash2" +#define ROOTFS_ADDR CFIFLASH_ROOT_ADDR +#define ROOTFS_SIZE 0x1B00000 +#define USERFS_SIZE (CFIFLASH_CAPACITY - ROOTFS_ADDR - ROOTFS_SIZE) #elif defined (LOSCFG_STORAGE_EMMC) #define ROOT_DEV_NAME "/dev/mmcblk0p0" #ifdef LOSCFG_PLATFORM_PATCHFS diff --git a/src/kernel_liteos_a/fs/vfs/BUILD.gn b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/vfs/BUILD.gn similarity index 91% rename from src/kernel_liteos_a/fs/vfs/BUILD.gn rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/vfs/BUILD.gn index 96c181d1..b04eddfb 100644 --- a/src/kernel_liteos_a/fs/vfs/BUILD.gn +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/vfs/BUILD.gn @@ -28,14 +28,17 @@ # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. import("//kernel/liteos_a/liteos.gni") -import("$THIRDPARTY_NUTTX_DIR/NuttX.gni") +import("//third_party/NuttX/NuttX.gni") module_switch = defined(LOSCFG_FS_VFS) module_name = get_path_info(rebase_path("."), "name") kernel_module(module_name) { sources = [ - "epoll/fs_epoll.c", - "mount.c", + "$LITEOSTOPDIR/fs/vfs/epoll/fs_epoll.c", + "$LITEOSTOPDIR/fs/vfs/mount.c", + "$LITEOSTOPDIR/fs/vfs/path_cache.c", + "$LITEOSTOPDIR/fs/vfs/vnode.c", + "$LITEOSTOPDIR/fs/vfs/vnode_hash.c", "operation/fullpath.c", "operation/vfs_chattr.c", "operation/vfs_check.c", @@ -52,10 +55,7 @@ kernel_module(module_name) { "operation/vfs_readv.c", "operation/vfs_utime.c", "operation/vfs_writev.c", - "path_cache.c", "vfs_cmd/vfs_shellcmd.c", - "vnode.c", - "vnode_hash.c", ] sources += NUTTX_FS_DIRENT_SRC_FILES sources += NUTTX_FS_DRIVER_SRC_FILES diff --git a/src/kernel_liteos_a/fs/vfs/Kconfig b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/vfs/Kconfig similarity index 100% rename from src/kernel_liteos_a/fs/vfs/Kconfig rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/vfs/Kconfig diff --git a/src/kernel_liteos_a/fs/vfs/Makefile b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/vfs/Makefile similarity index 100% rename from src/kernel_liteos_a/fs/vfs/Makefile rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/vfs/Makefile diff --git a/src/kernel_liteos_a/fs/vfs/bcache/BUILD.gn b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/vfs/bcache/BUILD.gn similarity index 100% rename from src/kernel_liteos_a/fs/vfs/bcache/BUILD.gn rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/vfs/bcache/BUILD.gn diff --git a/src/kernel_liteos_a/fs/vfs/bcache/Makefile b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/vfs/bcache/Makefile similarity index 100% rename from src/kernel_liteos_a/fs/vfs/bcache/Makefile rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/vfs/bcache/Makefile diff --git a/src/kernel_liteos_a/fs/vfs/bcache/src/bcache.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/vfs/bcache/src/bcache.c similarity index 99% rename from src/kernel_liteos_a/fs/vfs/bcache/src/bcache.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/vfs/bcache/src/bcache.c index 4c1e0732..c9e2d795 100644 --- a/src/kernel_liteos_a/fs/vfs/bcache/src/bcache.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/vfs/bcache/src/bcache.c @@ -581,8 +581,8 @@ static OsBcacheBlock *AllocNewBlock(OsBcache *bc, BOOL read, UINT64 num) DelBlock(bc, prefer); } - if (prefer->used) { /* do not combine with next check */ - MergeSyncBlocks(bc, prefer); /* prefer->used may be changed here */ + if (prefer->used) { + MergeSyncBlocks(bc, prefer); } if (prefer->used) { diff --git a/src/kernel_liteos_a/fs/vfs/epoll/fs_epoll.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/vfs/epoll/fs_epoll.c similarity index 96% rename from src/kernel_liteos_a/fs/vfs/epoll/fs_epoll.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/vfs/epoll/fs_epoll.c index 9252e80c..8591d612 100644 --- a/src/kernel_liteos_a/fs/vfs/epoll/fs_epoll.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/vfs/epoll/fs_epoll.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2021-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -164,23 +164,23 @@ static VOID DoEpollClose(struct epoll_head *epHead) } /** - * epoll_create unsupported api - * - * epoll_create is implemented by calling epoll_create1, it's parameter 'size' is useless. - * - * epoll_create1, + * epoll_create, * The simple version of epoll does not use red-black trees, * so when fd is normal value (greater than 0), * actually allocated epoll can manage num of EPOLL_DEFAULT_SIZE * - * @param flags: not actually used + * @param size: not actually used * @return epoll fd */ -int epoll_create1(int flags) +int epoll_create(int size) { - (void)flags; int fd = -1; + if (size <= 0) { + set_errno(EINVAL); + return fd; + } + struct epoll_head *epHead = (struct epoll_head *)malloc(sizeof(struct epoll_head)); if (epHead == NULL) { set_errno(ENOMEM); @@ -304,7 +304,7 @@ int epoll_wait(int epfd, FAR struct epoll_event *evs, int maxevents, int timeout int pollSize; epHead = EpollGetDataBuff(epfd); - if (epHead == NULL) { + if (epHead== NULL) { set_errno(EBADF); return -1; } diff --git a/src/kernel_liteos_a/fs/vfs/include/bcache/bcache.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/vfs/include/bcache/bcache.h similarity index 98% rename from src/kernel_liteos_a/fs/vfs/include/bcache/bcache.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/vfs/include/bcache/bcache.h index 591baaac..d4479bd5 100644 --- a/src/kernel_liteos_a/fs/vfs/include/bcache/bcache.h +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/vfs/include/bcache/bcache.h @@ -138,7 +138,7 @@ typedef struct tagOsBcache { *
  • The block number is automatically adjusted if position is greater than block size.
  • * * - * @retval #0 read succeeded + * @retval #0 read succeded * @retval #INT32 read failed * * @par Dependency: @@ -168,7 +168,7 @@ INT32 BlockCacheRead(OsBcache *bc, *
  • The block number is automatically adjusted if position is greater than block size.
  • * * - * @retval #0 write succeeded + * @retval #0 write succeded * @retval #INT32 write failed * * @par Dependency: @@ -193,7 +193,7 @@ INT32 BlockCacheWrite(OsBcache *bc, *
  • None.
  • * * - * @retval #0 sync succeeded + * @retval #0 sync succeded * @retval #INT32 sync failed * * @par Dependency: @@ -219,7 +219,7 @@ INT32 BlockCacheSync(OsBcache *bc); *
  • None.
  • * * - * @retval #OsBcache * init succeeded + * @retval #OsBcache * init succeded * @retval #NULL init failed * * @par Dependency: diff --git a/src/kernel_liteos_a/fs/vfs/include/epoll.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/vfs/include/epoll.h similarity index 98% rename from src/kernel_liteos_a/fs/vfs/include/epoll.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/vfs/include/epoll.h index e0aed193..c6f6ff3a 100644 --- a/src/kernel_liteos_a/fs/vfs/include/epoll.h +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/vfs/include/epoll.h @@ -72,7 +72,7 @@ struct epoll_event { epoll_data_t data; }; -int epoll_create1(int flags); +int epoll_create(int size); int epoll_close(int epfd); int epoll_ctl(int epfd, int op, int fd, struct epoll_event *ev); int epoll_wait(int epfd, FAR struct epoll_event *evs, int maxevents, int timeout); diff --git a/src/kernel_liteos_a/fs/vfs/include/fs_poll_pri.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/vfs/include/fs_poll_pri.h similarity index 100% rename from src/kernel_liteos_a/fs/vfs/include/fs_poll_pri.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/vfs/include/fs_poll_pri.h diff --git a/src/kernel_liteos_a/fs/vfs/include/path_cache.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/vfs/include/path_cache.h similarity index 100% rename from src/kernel_liteos_a/fs/vfs/include/path_cache.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/vfs/include/path_cache.h diff --git a/src/kernel_liteos_a/fs/vfs/include/vnode.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/vfs/include/vnode.h similarity index 95% rename from src/kernel_liteos_a/fs/vfs/include/vnode.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/vfs/include/vnode.h index 95afde6c..f04e1a11 100644 --- a/src/kernel_liteos_a/fs/vfs/include/vnode.h +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/vfs/include/vnode.h @@ -101,9 +101,6 @@ enum VnodeType { VNODE_TYPE_BCHR, /* block char mix device */ VNODE_TYPE_FIFO, /* pipe */ VNODE_TYPE_LNK, /* link */ -#ifdef LOSCFG_PROC_PROCESS_DIR - VNODE_TYPE_VIR_LNK, /* virtual link */ -#endif }; struct fs_dirent_s; @@ -130,9 +127,6 @@ struct Vnode { struct Mount *newMount; /* fs info about who mount on this vnode */ char *filePath; /* file path of the vnode */ struct page_mapping mapping; /* page mapping of the vnode */ -#ifdef LOSCFG_MNT_CONTAINER - int mntCount; /* ref count of mounts */ -#endif }; struct VnodeOps { @@ -166,7 +160,7 @@ typedef int VfsHashCmp(struct Vnode *vnode, void *arg); int VnodesInit(void); int VnodeDevInit(void); -int VnodeAlloc(struct VnodeOps *vop, struct Vnode **newVnode); +int VnodeAlloc(struct VnodeOps *vop, struct Vnode **vnode); int VnodeFree(struct Vnode *vnode); int VnodeLookup(const char *path, struct Vnode **vnode, uint32_t flags); int VnodeLookupFullpath(const char *fullpath, struct Vnode **vnode, uint32_t flags); @@ -191,8 +185,5 @@ LIST_HEAD* GetVnodeFreeList(void); LIST_HEAD* GetVnodeActiveList(void); LIST_HEAD* GetVnodeVirtualList(void); int VnodeClearCache(void); -struct Vnode *GetCurrRootVnode(void); -#ifdef LOSCFG_PROC_PROCESS_DIR -struct Vnode *VnodeFind(int fd); -#endif + #endif /* !_VNODE_H_ */ diff --git a/src/kernel_liteos_a/fs/vfs/mount.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/vfs/mount.c similarity index 77% rename from src/kernel_liteos_a/fs/vfs/mount.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/vfs/mount.c index b95a7673..d8dbbe50 100644 --- a/src/kernel_liteos_a/fs/vfs/mount.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/vfs/mount.c @@ -37,16 +37,11 @@ #include "stdlib.h" #endif -#ifdef LOSCFG_MNT_CONTAINER -#include "los_mnt_container_pri.h" -static LIST_HEAD *g_mountCache = NULL; -#else static LIST_HEAD *g_mountList = NULL; -#endif -struct Mount *MountAlloc(struct Vnode *vnodeBeCovered, struct MountOps *fsop) +struct Mount* MountAlloc(struct Vnode* vnodeBeCovered, struct MountOps* fsop) { - struct Mount *mnt = (struct Mount *)zalloc(sizeof(struct Mount)); + struct Mount* mnt = (struct Mount*)zalloc(sizeof(struct Mount)); if (mnt == NULL) { PRINT_ERR("MountAlloc failed no memory!\n"); return NULL; @@ -67,26 +62,7 @@ struct Mount *MountAlloc(struct Vnode *vnodeBeCovered, struct MountOps *fsop) return mnt; } -#ifdef LOSCFG_MNT_CONTAINER -LIST_HEAD *GetMountList(void) -{ - return GetContainerMntList(); -} - -LIST_HEAD *GetMountCache(void) -{ - if (g_mountCache == NULL) { - g_mountCache = zalloc(sizeof(LIST_HEAD)); - if (g_mountCache == NULL) { - PRINT_ERR("init cache mount list failed, no memory."); - return NULL; - } - LOS_ListInit(g_mountCache); - } - return g_mountCache; -} -#else -LIST_HEAD* GetMountList(void) +LIST_HEAD* GetMountList() { if (g_mountList == NULL) { g_mountList = zalloc(sizeof(LIST_HEAD)); @@ -98,4 +74,3 @@ LIST_HEAD* GetMountList(void) } return g_mountList; } -#endif diff --git a/src/kernel_liteos_a/fs/vfs/operation/fullpath.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/vfs/operation/fullpath.c similarity index 97% rename from src/kernel_liteos_a/fs/vfs/operation/fullpath.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/vfs/operation/fullpath.c index f42caead..f71ce8e0 100644 --- a/src/kernel_liteos_a/fs/vfs/operation/fullpath.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/vfs/operation/fullpath.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2022 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -225,6 +225,7 @@ static char *vfs_normalize_fullpath(const char *directory, const char *filename, /* it's a absolute path, use it directly */ fullpath = strdup(filename); /* copy string */ + if (fullpath == NULL) { *pathname = NULL; set_errno(ENOMEM); @@ -257,10 +258,11 @@ int vfs_normalize_path(const char *directory, const char *filename, char **pathn } #ifdef VFS_USING_WORKDIR - if (directory == NULL) { + if (directory == NULL) + { spin_lock_irqsave(&curr->files->workdir_lock, lock_flags); directory = curr->files->workdir; - } + } #else if ((directory == NULL) && (filename[0] != '/')) { PRINT_ERR("NO_WORKING_DIR\n"); @@ -273,18 +275,20 @@ int vfs_normalize_path(const char *directory, const char *filename, char **pathn if ((filename[0] != '/') && (strlen(directory) + namelen + 2 > TEMP_PATH_MAX)) { #ifdef VFS_USING_WORKDIR - if (dir_flags == TRUE) { + if (dir_flags == TRUE) + { spin_unlock_irqrestore(&curr->files->workdir_lock, lock_flags); - } + } #endif return -ENAMETOOLONG; } fullpath = vfs_normalize_fullpath(directory, filename, pathname, namelen); #ifdef VFS_USING_WORKDIR - if (dir_flags == TRUE) { + if (dir_flags == TRUE) + { spin_unlock_irqrestore(&curr->files->workdir_lock, lock_flags); - } + } #endif if (fullpath == NULL) { return -get_errno(); @@ -304,7 +308,7 @@ int vfs_normalize_path(const char *directory, const char *filename, char **pathn int vfs_normalize_pathat(int dirfd, const char *filename, char **pathname) { - /* Get path by dirfd */ + /* Get path by dirfd*/ char *relativeoldpath = NULL; char *fullpath = NULL; int ret = 0; diff --git a/src/kernel_liteos_a/fs/vfs/operation/vfs_chattr.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/vfs/operation/vfs_chattr.c similarity index 100% rename from src/kernel_liteos_a/fs/vfs/operation/vfs_chattr.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/vfs/operation/vfs_chattr.c diff --git a/src/kernel_liteos_a/fs/vfs/operation/vfs_check.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/vfs/operation/vfs_check.c similarity index 100% rename from src/kernel_liteos_a/fs/vfs/operation/vfs_check.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/vfs/operation/vfs_check.c diff --git a/src/kernel_liteos_a/fs/vfs/operation/vfs_cloexec.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/vfs/operation/vfs_cloexec.c similarity index 100% rename from src/kernel_liteos_a/fs/vfs/operation/vfs_cloexec.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/vfs/operation/vfs_cloexec.c diff --git a/src/kernel_liteos_a/fs/vfs/operation/vfs_fallocate.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/vfs/operation/vfs_fallocate.c similarity index 100% rename from src/kernel_liteos_a/fs/vfs/operation/vfs_fallocate.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/vfs/operation/vfs_fallocate.c diff --git a/src/kernel_liteos_a/fs/vfs/operation/vfs_fallocate64.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/vfs/operation/vfs_fallocate64.c similarity index 98% rename from src/kernel_liteos_a/fs/vfs/operation/vfs_fallocate64.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/vfs/operation/vfs_fallocate64.c index 9686173c..b3797ee1 100644 --- a/src/kernel_liteos_a/fs/vfs/operation/vfs_fallocate64.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/vfs/operation/vfs_fallocate64.c @@ -133,7 +133,7 @@ int fallocate64(int fd, int mode, off64_t offset, off64_t len) return VFS_ERROR; } - if ((unsigned int)filep->f_oflags & O_DIRECTORY) { + if (filep->f_oflags & O_DIRECTORY) { set_errno(EBADF); return VFS_ERROR; } diff --git a/src/kernel_liteos_a/fs/vfs/operation/vfs_fcntl.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/vfs/operation/vfs_fcntl.c similarity index 100% rename from src/kernel_liteos_a/fs/vfs/operation/vfs_fcntl.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/vfs/operation/vfs_fcntl.c diff --git a/src/kernel_liteos_a/fs/vfs/operation/vfs_force_umount.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/vfs/operation/vfs_force_umount.c similarity index 98% rename from src/kernel_liteos_a/fs/vfs/operation/vfs_force_umount.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/vfs/operation/vfs_force_umount.c index 3d7f4ed7..5231829a 100644 --- a/src/kernel_liteos_a/fs/vfs/operation/vfs_force_umount.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/vfs/operation/vfs_force_umount.c @@ -353,7 +353,7 @@ static struct file_operations_vfs g_errorFileOps = { .unlink = ErrorFopUnlink, }; -static struct Mount* GetDevMountPoint(const struct Vnode *dev) +static struct Mount* GetDevMountPoint(struct Vnode *dev) { struct Mount *mnt = NULL; LIST_HEAD *mntList = GetMountList(); @@ -394,7 +394,7 @@ static void FilePreClose(struct file *filep, const struct file_operations_vfs *o } } -static void FileDisableAndClean(const struct Mount *mnt) +static void FileDisableAndClean(struct Mount *mnt) { struct filelist *flist = &tg_filelist; struct file *filep = NULL; @@ -435,7 +435,7 @@ static void VnodeTryFree(struct Vnode *vnode) vnode->fop = &g_errorFileOps; } -static void VnodeTryFreeAll(const struct Mount *mount) +static void VnodeTryFreeAll(struct Mount *mount) { struct Vnode *vnode = NULL; struct Vnode *nextVnode = NULL; diff --git a/src/kernel_liteos_a/fs/vfs/operation/vfs_init.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/vfs/operation/vfs_init.c similarity index 100% rename from src/kernel_liteos_a/fs/vfs/operation/vfs_init.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/vfs/operation/vfs_init.c diff --git a/src/kernel_liteos_a/fs/vfs/operation/vfs_other.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/vfs/operation/vfs_other.c similarity index 81% rename from src/kernel_liteos_a/fs/vfs/operation/vfs_other.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/vfs/operation/vfs_other.c index 7495f5be..c667170e 100644 --- a/src/kernel_liteos_a/fs/vfs/operation/vfs_other.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/vfs/operation/vfs_other.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2023 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -132,19 +132,19 @@ int VfsPermissionCheck(uint fuid, uint fgid, uint fileMode, int accMode) #ifdef VFS_USING_WORKDIR static int SetWorkDir(const char *dir, size_t len) { - errno_t ret; - uint lock_flags; - LosProcessCB *curr = OsCurrProcessGet(); - - spin_lock_irqsave(&curr->files->workdir_lock, lock_flags); - ret = strncpy_s(curr->files->workdir, PATH_MAX, dir, len); - curr->files->workdir[PATH_MAX - 1] = '\0'; - spin_unlock_irqrestore(&curr->files->workdir_lock, lock_flags); - if (ret != EOK) { - return -1; - } - - return 0; + errno_t ret; + uint lock_flags; + LosProcessCB *curr = OsCurrProcessGet(); + + spin_lock_irqsave(&curr->files->workdir_lock, lock_flags); + ret = strncpy_s(curr->files->workdir, PATH_MAX, dir, len); + curr->files->workdir[PATH_MAX - 1] = '\0'; + spin_unlock_irqrestore(&curr->files->workdir_lock, lock_flags); + if (ret != EOK) { + return -1; + } + + return 0; } #endif @@ -155,6 +155,7 @@ int chdir(const char *path) char *fullpath_bak = NULL; struct stat statBuff; + if (!path) { set_errno(EFAULT); return -1; @@ -482,7 +483,7 @@ exit_with_nomem: return (char *)NULL; } -static void PrintFileInfo64(const struct stat64 *stat64Info, const char *name, const char *linkName) +static void PrintFileInfo64(const struct stat64 *stat64Info, const char *name) { mode_t mode; char str[UGO_NUMS][UGO_NUMS + 1] = {0}; @@ -504,18 +505,11 @@ static void PrintFileInfo64(const struct stat64 *stat64Info, const char *name, c dirFlag = '-'; } - if (S_ISLNK(stat64Info->st_mode)) { - PRINTK("%c%s%s%s %-8lld u:%-5d g:%-5d %-10s -> %s\n", dirFlag, - str[0], str[1], str[UGO_NUMS - 1], stat64Info->st_size, - stat64Info->st_uid, stat64Info->st_gid, name, linkName); - } else { - PRINTK("%c%s%s%s %-8lld u:%-5d g:%-5d %-10s\n", dirFlag, - str[0], str[1], str[UGO_NUMS - 1], stat64Info->st_size, - stat64Info->st_uid, stat64Info->st_gid, name); - } + PRINTK("%c%s%s%s %-8lld u:%-5d g:%-5d %-10s\n", dirFlag, + str[0], str[1], str[UGO_NUMS - 1], stat64Info->st_size, stat64Info->st_uid, stat64Info->st_gid, name); } -static void PrintFileInfo(const struct stat *statInfo, const char *name, const char *linkName) +static void PrintFileInfo(const struct stat *statInfo, const char *name) { mode_t mode; char str[UGO_NUMS][UGO_NUMS + 1] = {0}; @@ -537,33 +531,19 @@ static void PrintFileInfo(const struct stat *statInfo, const char *name, const c dirFlag = '-'; } - if (S_ISLNK(statInfo->st_mode)) { - PRINTK("%c%s%s%s %-8lld u:%-5d g:%-5d %-10s -> %s\n", dirFlag, - str[0], str[1], str[UGO_NUMS - 1], statInfo->st_size, - statInfo->st_uid, statInfo->st_gid, name, linkName); - } else { - PRINTK("%c%s%s%s %-8lld u:%-5d g:%-5d %-10s\n", dirFlag, - str[0], str[1], str[UGO_NUMS - 1], statInfo->st_size, - statInfo->st_uid, statInfo->st_gid, name); - } + PRINTK("%c%s%s%s %-8lld u:%-5d g:%-5d %-10s\n", dirFlag, + str[0], str[1], str[UGO_NUMS - 1], statInfo->st_size, statInfo->st_uid, statInfo->st_gid, name); } int LsFile(const char *path) { struct stat64 stat64Info; struct stat statInfo; - char linkName[NAME_MAX] = { 0 }; if (stat64(path, &stat64Info) == 0) { - if (S_ISLNK(stat64Info.st_mode)) { - readlink(path, linkName, NAME_MAX); - } - PrintFileInfo64(&stat64Info, path, (const char *)linkName); + PrintFileInfo64(&stat64Info, path); } else if (stat(path, &statInfo) == 0) { - if (S_ISLNK(statInfo.st_mode)) { - readlink(path, linkName, NAME_MAX); - } - PrintFileInfo(&statInfo, path, (const char *)linkName); + PrintFileInfo(&statInfo, path); } else { return -1; } @@ -575,7 +555,6 @@ int LsDir(const char *path) { struct stat statInfo = { 0 }; struct stat64 stat64Info = { 0 }; - char linkName[NAME_MAX] = { 0 }; DIR *d = NULL; char *fullpath = NULL; char *fullpath_bak = NULL; @@ -591,34 +570,28 @@ int LsDir(const char *path) pdirent = readdir(d); if (pdirent == NULL) { break; - } - if (!strcmp(pdirent->d_name, ".") || !strcmp(pdirent->d_name, "..")) { - continue; - } - (void)memset_s(&statInfo, sizeof(struct stat), 0, sizeof(struct stat)); - (void)memset_s(&stat64Info, sizeof(struct stat), 0, sizeof(struct stat)); - (void)memset_s(&linkName, sizeof(linkName), 0, sizeof(linkName)); - fullpath = ls_get_fullpath(path, pdirent); - if (fullpath == NULL) { - (void)closedir(d); - return -1; - } - - fullpath_bak = fullpath; - if (stat64(fullpath, &stat64Info) == 0) { - if (S_ISLNK(stat64Info.st_mode)) { - readlink(fullpath, linkName, NAME_MAX); + } else { + if (!strcmp(pdirent->d_name, ".") || !strcmp(pdirent->d_name, "..")) { + continue; } - PrintFileInfo64(&stat64Info, pdirent->d_name, linkName); - } else if (stat(fullpath, &statInfo) == 0) { - if (S_ISLNK(statInfo.st_mode)) { - readlink(fullpath, linkName, NAME_MAX); + (void)memset_s(&statInfo, sizeof(struct stat), 0, sizeof(struct stat)); + (void)memset_s(&stat64Info, sizeof(struct stat), 0, sizeof(struct stat)); + fullpath = ls_get_fullpath(path, pdirent); + if (fullpath == NULL) { + (void)closedir(d); + return -1; } - PrintFileInfo(&statInfo, pdirent->d_name, linkName); - } else { - PRINTK("BAD file: %s\n", pdirent->d_name); + + fullpath_bak = fullpath; + if (stat64(fullpath, &stat64Info) == 0) { + PrintFileInfo64(&stat64Info, pdirent->d_name); + } else if (stat(fullpath, &statInfo) == 0) { + PrintFileInfo(&statInfo, pdirent->d_name); + } else { + PRINTK("BAD file: %s\n", pdirent->d_name); + } + free(fullpath_bak); } - free(fullpath_bak); } while (1); (void)closedir(d); @@ -758,45 +731,3 @@ mode_t SysUmask(mode_t mask) return oldUmask; } -#ifdef LOSCFG_CHROOT -int chroot(const char *path) -{ - int ret; - struct Vnode *vnode = NULL; - - if (!path) { - set_errno(EFAULT); - return VFS_ERROR; - } - - if (!strlen(path)) { - set_errno(ENOENT); - return VFS_ERROR; - } - - if (strlen(path) > PATH_MAX) { - set_errno(ENAMETOOLONG); - return VFS_ERROR; - } - VnodeHold(); - ret = VnodeLookup(path, &vnode, 0); - if (ret != LOS_OK) { - VnodeDrop(); - return ret; - } - - LosProcessCB *curr = OsCurrProcessGet(); - if ((curr->files == NULL) || (curr->files->rootVnode == NULL)) { - VnodeDrop(); - return VFS_ERROR; - } - if (curr->files->rootVnode->useCount > 0) { - curr->files->rootVnode->useCount--; - } - vnode->useCount++; - curr->files->rootVnode = vnode; - - VnodeDrop(); - return LOS_OK; -} -#endif diff --git a/src/kernel_liteos_a/fs/vfs/operation/vfs_preadv.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/vfs/operation/vfs_preadv.c similarity index 100% rename from src/kernel_liteos_a/fs/vfs/operation/vfs_preadv.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/vfs/operation/vfs_preadv.c diff --git a/src/kernel_liteos_a/fs/vfs/operation/vfs_procfd.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/vfs/operation/vfs_procfd.c similarity index 100% rename from src/kernel_liteos_a/fs/vfs/operation/vfs_procfd.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/vfs/operation/vfs_procfd.c diff --git a/src/kernel_liteos_a/fs/vfs/operation/vfs_pwritev.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/vfs/operation/vfs_pwritev.c similarity index 100% rename from src/kernel_liteos_a/fs/vfs/operation/vfs_pwritev.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/vfs/operation/vfs_pwritev.c diff --git a/src/kernel_liteos_a/fs/vfs/operation/vfs_readv.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/vfs/operation/vfs_readv.c similarity index 100% rename from src/kernel_liteos_a/fs/vfs/operation/vfs_readv.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/vfs/operation/vfs_readv.c diff --git a/src/kernel_liteos_a/fs/vfs/operation/vfs_utime.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/vfs/operation/vfs_utime.c similarity index 98% rename from src/kernel_liteos_a/fs/vfs/operation/vfs_utime.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/vfs/operation/vfs_utime.c index cbe607f7..31cf98e2 100644 --- a/src/kernel_liteos_a/fs/vfs/operation/vfs_utime.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/vfs/operation/vfs_utime.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2022 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -57,6 +57,7 @@ int utime(const char *path, const struct utimbuf *ptimes) /* Sanity checks */ + if (path == NULL) { ret = -EINVAL; goto errout; diff --git a/src/kernel_liteos_a/fs/vfs/operation/vfs_writev.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/vfs/operation/vfs_writev.c similarity index 99% rename from src/kernel_liteos_a/fs/vfs/operation/vfs_writev.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/vfs/operation/vfs_writev.c index 7638a650..cbea0771 100644 --- a/src/kernel_liteos_a/fs/vfs/operation/vfs_writev.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/vfs/operation/vfs_writev.c @@ -66,6 +66,7 @@ static int iov_trans_to_buf(char *buf, ssize_t totallen, const struct iovec *iov } else { writepart = bytestowrite - ret; curbuf += writepart; + totallen -= writepart; break; } } diff --git a/src/kernel_liteos_a/fs/vfs/path_cache.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/vfs/path_cache.c similarity index 100% rename from src/kernel_liteos_a/fs/vfs/path_cache.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/vfs/path_cache.c diff --git a/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/vfs/vfs_cmd/vfs_shellcmd.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/vfs/vfs_cmd/vfs_shellcmd.c new file mode 100644 index 00000000..67c175d1 --- /dev/null +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/vfs/vfs_cmd/vfs_shellcmd.c @@ -0,0 +1,1590 @@ +/* + * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. + * + * 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. + */ + +#include "los_config.h" +#include "sys/mount.h" + +#ifdef LOSCFG_SHELL + +#include "los_typedef.h" +#include "shell.h" +#include "sys/stat.h" +#include "stdlib.h" +#include "unistd.h" +#include "fcntl.h" +#include "sys/statfs.h" +#include "stdio.h" +#include "pthread.h" + +#include "shcmd.h" +#include "securec.h" +#include "show.h" +#include "los_syscall.h" + +#include "los_process_pri.h" +#include +#include "fs/fs_operation.h" + +typedef enum +{ + RM_RECURSIVER, + RM_FILE, + RM_DIR, + CP_FILE, + CP_COUNT +} wildcard_type; + +#define ERROR_OUT_IF(condition, message_function, handler) \ + do \ + { \ + if (condition) \ + { \ + message_function; \ + handler; \ + } \ + } \ + while (0) + +static inline void set_err(int errcode, const char *err_message) +{ + set_errno(errcode); + perror(err_message); +} + +int osShellCmdDoChdir(const char *path) +{ + char *fullpath = NULL; + char *fullpath_bak = NULL; + int ret; + char *shell_working_directory = OsShellGetWorkingDirectory(); + if (shell_working_directory == NULL) + { + return -1; + } + + if (path == NULL) + { + LOS_TaskLock(); + PRINTK("%s\n", shell_working_directory); + LOS_TaskUnlock(); + + return 0; + } + + ERROR_OUT_IF(strlen(path) > PATH_MAX, set_err(ENOTDIR, "cd error"), return -1); + + ret = vfs_normalize_path(shell_working_directory, path, &fullpath); + ERROR_OUT_IF(ret < 0, set_err(-ret, "cd error"), return -1); + + fullpath_bak = fullpath; + ret = chdir(fullpath); + if (ret < 0) + { + free(fullpath_bak); + perror("cd"); + return -1; + } + + /* copy full path to working directory */ + + LOS_TaskLock(); + ret = strncpy_s(shell_working_directory, PATH_MAX, fullpath, strlen(fullpath)); + if (ret != EOK) + { + free(fullpath_bak); + LOS_TaskUnlock(); + return -1; + } + LOS_TaskUnlock(); + /* release normalize directory path name */ + + free(fullpath_bak); + + return 0; +} + +int osShellCmdLs(int argc, const char **argv) +{ + char *fullpath = NULL; + const char *filename = NULL; + int ret; + char *shell_working_directory = OsShellGetWorkingDirectory(); + if (shell_working_directory == NULL) + { + return -1; + } + + ERROR_OUT_IF(argc > 1, PRINTK("ls or ls [DIRECTORY]\n"), return -1); + + if (argc == 0) + { + ls(shell_working_directory); + return 0; + } + + filename = argv[0]; + ret = vfs_normalize_path(shell_working_directory, filename, &fullpath); + ERROR_OUT_IF(ret < 0, set_err(-ret, "ls error"), return -1); + + ls(fullpath); + free(fullpath); + + return 0; +} + +int osShellCmdCd(int argc, const char **argv) +{ + if (argc == 0) + { + (void)osShellCmdDoChdir("/"); + return 0; + } + + (void)osShellCmdDoChdir(argv[0]); + + return 0; +} + +#define CAT_BUF_SIZE 512 +#define CAT_TASK_PRIORITY 10 +#define CAT_TASK_STACK_SIZE 0x3000 +pthread_mutex_t g_mutex_cat = PTHREAD_MUTEX_INITIALIZER; + +int osShellCmdDoCatShow(UINTPTR arg) +{ + int ret = 0; + char buf[CAT_BUF_SIZE]; + size_t size, written, toWrite; + ssize_t cnt; + char *fullpath = (char *)arg; + FILE *ini = NULL; + + (void)pthread_mutex_lock(&g_mutex_cat); + ini = fopen(fullpath, "r"); + if (ini == NULL) + { + ret = -1; + perror("cat error"); + goto out; + } + + do + { + (void)memset_s(buf, sizeof(buf), 0, CAT_BUF_SIZE); + size = fread(buf, 1, CAT_BUF_SIZE, ini); + if ((int)size < 0) + { + ret = -1; + perror("cat error"); + goto out_with_fclose; + } + + for (toWrite = size, written = 0; toWrite > 0;) + { + cnt = write(1, buf + written, toWrite); + if (cnt == 0) + { + /* avoid task-starvation */ + (void)LOS_TaskDelay(1); + continue; + } + else if (cnt < 0) + { + perror("cat write error"); + break; + } + + written += cnt; + toWrite -= cnt; + } + } + while (size > 0); + +out_with_fclose: + (void)fclose(ini); +out: + free(fullpath); + (void)pthread_mutex_unlock(&g_mutex_cat); + return ret; +} + +int osShellCmdCat(int argc, const char **argv) +{ + char *fullpath = NULL; + int ret; + unsigned int ca_task; + struct Vnode *vnode = NULL; + TSK_INIT_PARAM_S init_param; + char *shell_working_directory = OsShellGetWorkingDirectory(); + if (shell_working_directory == NULL) + { + return -1; + } + + ERROR_OUT_IF(argc != 1, PRINTK("cat [FILE]\n"), return -1); + + ret = vfs_normalize_path(shell_working_directory, argv[0], &fullpath); + ERROR_OUT_IF(ret < 0, set_err(-ret, "cat error"), return -1); + + VnodeHold(); + ret = VnodeLookup(fullpath, &vnode, O_RDONLY); + if (ret != LOS_OK) + { + set_errno(-ret); + perror("cat error"); + VnodeDrop(); + free(fullpath); + return -1; + } + if (vnode->type != VNODE_TYPE_REG) + { + set_errno(EINVAL); + perror("cat error"); + VnodeDrop(); + free(fullpath); + return -1; + } + VnodeDrop(); + (void)memset_s(&init_param, sizeof(init_param), 0, sizeof(TSK_INIT_PARAM_S)); + init_param.pfnTaskEntry = (TSK_ENTRY_FUNC)osShellCmdDoCatShow; + init_param.usTaskPrio = CAT_TASK_PRIORITY; + init_param.auwArgs[0] = (UINTPTR)fullpath; + init_param.uwStackSize = CAT_TASK_STACK_SIZE; + init_param.pcName = "shellcmd_cat"; + init_param.uwResved = LOS_TASK_STATUS_DETACHED | OS_TASK_FLAG_SPECIFIES_PROCESS; + init_param.processID = 2; /* 2: kProcess */ + + ret = (int)LOS_TaskCreate(&ca_task, &init_param); + + if (ret != LOS_OK) + { + free(fullpath); + } + + return ret; +} + +static int nfs_mount_ref(const char *server_ip_and_path, const char *mount_path, + unsigned int uid, unsigned int gid) __attribute__((weakref("nfs_mount"))); + +static unsigned long get_mountflags(const char *options) +{ + unsigned long mountfalgs = 0; + char *p; + while ((options != NULL) && (p = strsep((char**)&options, ",")) != NULL) { + if (strncmp(p, "ro", strlen("ro")) == 0) { + mountfalgs |= MS_RDONLY; + } else if (strncmp(p, "rw", strlen("rw")) == 0) { + mountfalgs &= ~MS_RDONLY; + } else if (strncmp(p, "nosuid", strlen("nosuid")) == 0) { + mountfalgs |= MS_NOSUID; + } else if (strncmp(p, "suid", strlen("suid")) == 0) { + mountfalgs &= ~MS_NOSUID; + } else { + continue; + } + } + + return mountfalgs; +} +static inline void print_mount_usage(void) +{ + PRINTK("mount [DEVICE] [PATH] [NAME]\n"); +} + +int osShellCmdMount(int argc, const char **argv) +{ + int ret; + char *fullpath = NULL; + const char *filename = NULL; + unsigned int gid, uid; + char *data = NULL; + char *filessystemtype = NULL; + unsigned long mountfalgs; + char *shell_working_directory = OsShellGetWorkingDirectory(); + if (shell_working_directory == NULL) + { + return -1; + } + + ERROR_OUT_IF(argc < 3, print_mount_usage(), return OS_FAIL); + + if (strncmp(argv[0], "-t", 2) == 0 || strncmp(argv[0], "-o", 2) == 0) + { + if (argc < 4) + { + PRINTK("mount -t/-o [DEVICE] [PATH] [NAME]\n"); + return -1; + } + + filename = argv[2]; + ret = vfs_normalize_path(shell_working_directory, filename, &fullpath); + ERROR_OUT_IF(ret < 0, set_err(-ret, "mount error"), return -1); + + if (strncmp(argv[3], "nfs", 3) == 0) + { + if (argc <= 6) + { + uid = ((argc >= 5) && (argv[4] != NULL)) ? (unsigned int)strtoul(argv[4], (char **)NULL, 0) : 0; + gid = ((argc == 6) && (argv[5] != NULL)) ? (unsigned int)strtoul(argv[5], (char **)NULL, 0) : 0; + + if (nfs_mount_ref != NULL) + { + ret = nfs_mount_ref(argv[1], fullpath, uid, gid); + if (ret != LOS_OK) + { + PRINTK("mount -t [DEVICE] [PATH] [NAME]\n"); + } + } + else + { + PRINTK("can't find nfs_mount\n"); + } + free(fullpath); + return 0; + } + } + + filessystemtype = (argc >= 4) ? (char *)argv[3] : NULL; /* 3: fs type */ + mountfalgs = (argc >= 5) ? get_mountflags((const char *)argv[4]) : 0; /* 4: usr option */ + data = (argc >= 6) ? (char *)argv[5] : NULL; /* 5: usr option data */ + + if (strcmp(argv[1], "0") == 0) + { + ret = mount((const char *)NULL, fullpath, filessystemtype, mountfalgs, data); + } + else + { + ret = mount(argv[1], fullpath, filessystemtype, mountfalgs, data); /* 3: fs type */ + } + if (ret != LOS_OK) + { + perror("mount error"); + } + else + { + PRINTK("mount ok\n"); + } + } + else + { + filename = argv[1]; + ret = vfs_normalize_path(shell_working_directory, filename, &fullpath); + ERROR_OUT_IF(ret < 0, set_err(-ret, "mount error"), return -1); + + if (strncmp(argv[2], "nfs", 3) == 0) + { + if (argc <= 5) + { + uid = ((argc >= 4) && (argv[3] != NULL)) ? (unsigned int)strtoul(argv[3], (char **)NULL, 0) : 0; + gid = ((argc == 5) && (argv[4] != NULL)) ? (unsigned int)strtoul(argv[4], (char **)NULL, 0) : 0; + + if (nfs_mount_ref != NULL) + { + ret = nfs_mount_ref(argv[0], fullpath, uid, gid); + if (ret != LOS_OK) + { + PRINTK("mount [DEVICE] [PATH] [NAME]\n"); + } + } + else + { + PRINTK("can't find nfs_mount\n"); + } + free(fullpath); + return 0; + } + + print_mount_usage(); + free(fullpath); + return 0; + } + + mountfalgs = (argc >= 4) ? get_mountflags((const char *)argv[3]) : 0; /* 3: usr option */ + data = (argc >= 5) ? (char *)argv[4] : NULL; /* 4: usr option data */ + + if (strcmp(argv[0], "0") == 0) + { + ret = mount((const char *)NULL, fullpath, argv[2], mountfalgs, data); + } + else + { + ret = mount(argv[0], fullpath, argv[2], mountfalgs, data); /* 2: fs type */ + } + if (ret != LOS_OK) + { + perror("mount error"); + } + else + { + PRINTK("mount ok\n"); + } + } + + free(fullpath); + return 0; +} + +int osShellCmdUmount(int argc, const char **argv) +{ + int ret; + const char *filename = NULL; + char *fullpath = NULL; + char *target_path = NULL; + int cmp_num; + char *work_path = NULL; + char *shell_working_directory = OsShellGetWorkingDirectory(); + if (shell_working_directory == NULL) + { + return -1; + } + work_path = shell_working_directory; + + ERROR_OUT_IF(argc == 0, PRINTK("umount [PATH]\n"), return 0); + + filename = argv[0]; + ret = vfs_normalize_path(shell_working_directory, filename, &fullpath); + ERROR_OUT_IF(ret < 0, set_err(-ret, "umount error"), return -1); + + target_path = fullpath; + cmp_num = strlen(fullpath); + ret = strncmp(work_path, target_path, cmp_num); + if (ret == 0) + { + work_path += cmp_num; + if (*work_path == '/' || *work_path == '\0') + { + set_errno(EBUSY); + perror("umount error"); + free(fullpath); + return -1; + } + } + + ret = umount(fullpath); + free(fullpath); + if (ret != LOS_OK) + { + perror("umount error"); + return 0; + } + + PRINTK("umount ok\n"); + return 0; +} + +int osShellCmdMkdir(int argc, const char **argv) +{ + int ret; + char *fullpath = NULL; + const char *filename = NULL; + char *shell_working_directory = OsShellGetWorkingDirectory(); + if (shell_working_directory == NULL) + { + return -1; + } + + ERROR_OUT_IF(argc != 1, PRINTK("mkdir [DIRECTORY]\n"), return 0); + + filename = argv[0]; + ret = vfs_normalize_path(shell_working_directory, filename, &fullpath); + ERROR_OUT_IF(ret < 0, set_err(-ret, "mkdir error"), return -1); + + ret = mkdir(fullpath, S_IRWXU | S_IRWXG | S_IRWXO); + if (ret == -1) + { + perror("mkdir error"); + } + free(fullpath); + return 0; +} + +int osShellCmdPwd(int argc, const char **argv) +{ + char buf[SHOW_MAX_LEN] = {0}; + DIR *dir = NULL; + char *shell_working_directory = OsShellGetWorkingDirectory(); + if (shell_working_directory == NULL) + { + return -1; + } + + ERROR_OUT_IF(argc > 0, PRINTK("\nUsage: pwd\n"), return -1); + + dir = opendir(shell_working_directory); + if (dir == NULL) + { + perror("pwd error"); + return -1; + } + + LOS_TaskLock(); + if (strncpy_s(buf, SHOW_MAX_LEN, shell_working_directory, SHOW_MAX_LEN - 1) != EOK) + { + LOS_TaskUnlock(); + PRINTK("pwd error: strncpy_s error!\n"); + (void)closedir(dir); + return -1; + } + LOS_TaskUnlock(); + + PRINTK("%s\n", buf); + (void)closedir(dir); + return 0; +} + +static inline void print_statfs_usage(void) +{ + PRINTK("Usage :\n"); + PRINTK(" statfs \n"); + PRINTK(" path : Mounted file system path that requires query information\n"); + PRINTK("Example:\n"); + PRINTK(" statfs /ramfs\n"); +} + +int osShellCmdStatfs(int argc, const char **argv) +{ + struct statfs sfs; + int result; + unsigned long long total_size, free_size; + char *fullpath = NULL; + const char *filename = NULL; + char *shell_working_directory = OsShellGetWorkingDirectory(); + if (shell_working_directory == NULL) + { + return -1; + } + + ERROR_OUT_IF(argc != 1, PRINTK("statfs failed! Invalid argument!\n"), return -1); + + (void)memset_s(&sfs, sizeof(sfs), 0, sizeof(sfs)); + + filename = argv[0]; + result = vfs_normalize_path(shell_working_directory, filename, &fullpath); + ERROR_OUT_IF(result < 0, set_err(-result, "statfs error"), return -1); + + result = statfs(fullpath, &sfs); + free(fullpath); + + if (result != 0 || sfs.f_type == 0) + { + PRINTK("statfs failed! Invalid argument!\n"); + print_statfs_usage(); + return -1; + } + + total_size = (unsigned long long)sfs.f_bsize * sfs.f_blocks; + free_size = (unsigned long long)sfs.f_bsize * sfs.f_bfree; + + PRINTK("statfs got:\n f_type = %d\n cluster_size = %d\n", sfs.f_type, sfs.f_bsize); + PRINTK(" total_clusters = %llu\n free_clusters = %llu\n", sfs.f_blocks, sfs.f_bfree); + PRINTK(" avail_clusters = %llu\n f_namelen = %d\n", sfs.f_bavail, sfs.f_namelen); + PRINTK("\n%s\n total size: %4llu Bytes\n free size: %4llu Bytes\n", argv[0], total_size, free_size); + + return 0; +} + +int osShellCmdTouch(int argc, const char **argv) +{ + int ret; + int fd = -1; + char *fullpath = NULL; + const char *filename = NULL; + char *shell_working_directory = OsShellGetWorkingDirectory(); + if (shell_working_directory == NULL) + { + return -1; + } + + ERROR_OUT_IF(argc != 1, PRINTK("touch [FILE]\n"), return -1); + + filename = argv[0]; + ret = vfs_normalize_path(shell_working_directory, filename, &fullpath); + ERROR_OUT_IF(ret < 0, set_err(-ret, "touch error"), return -1); + + fd = open(fullpath, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH); + free(fullpath); + if (fd == -1) + { + perror("touch error"); + return -1; + } + + (void)close(fd); + return 0; +} + +#define CP_BUF_SIZE 4096 +pthread_mutex_t g_mutex_cp = PTHREAD_MUTEX_INITIALIZER; + +static int os_shell_cmd_do_cp(const char *src_filepath, const char *dst_filename) +{ + int ret; + char *src_fullpath = NULL; + char *dst_fullpath = NULL; + const char *src_filename = NULL; + char *dst_filepath = NULL; + char *buf = NULL; + const char *filename = NULL; + ssize_t r_size, w_size; + int src_fd = -1; + int dst_fd = -1; + struct stat stat_buf; + mode_t src_mode; + char *shell_working_directory = OsShellGetWorkingDirectory(); + if (shell_working_directory == NULL) + { + return -1; + } + + buf = (char *)malloc(CP_BUF_SIZE); + if (buf == NULL) + { + PRINTK("cp error: Out of memory!\n"); + return -1; + } + + /* Get source fullpath. */ + + ret = vfs_normalize_path(shell_working_directory, src_filepath, &src_fullpath); + if (ret < 0) + { + set_errno(-ret); + PRINTK("cp error: %s\n", strerror(errno)); + free(buf); + return -1; + } + + /* Is source path exist? */ + + ret = stat(src_fullpath, &stat_buf); + if (ret == -1) + { + PRINTK("cp %s error: %s\n", src_fullpath, strerror(errno)); + goto errout_with_srcpath; + } + src_mode = stat_buf.st_mode; + /* Is source path a directory? */ + + if (S_ISDIR(stat_buf.st_mode)) + { + PRINTK("cp %s error: Source file can't be a directory.\n", src_fullpath); + goto errout_with_srcpath; + } + + /* Get dest fullpath. */ + + dst_fullpath = strdup(dst_filename); + if (dst_fullpath == NULL) + { + PRINTK("cp error: Out of memory.\n"); + goto errout_with_srcpath; + } + + /* Is dest path exist? */ + + ret = stat(dst_fullpath, &stat_buf); + if (ret == 0) + { + /* Is dest path a directory? */ + + if (S_ISDIR(stat_buf.st_mode)) + { + /* Get source file name without '/'. */ + + src_filename = src_filepath; + while (1) + { + filename = strchr(src_filename, '/'); + if (filename == NULL) + { + break; + } + src_filename = filename + 1; + } + + /* Add the source file after dest path. */ + + ret = vfs_normalize_path(dst_fullpath, src_filename, &dst_filepath); + if (ret < 0) + { + set_errno(-ret); + PRINTK("cp error. %s.\n", strerror(errno)); + goto errout_with_path; + } + free(dst_fullpath); + dst_fullpath = dst_filepath; + } + } + + /* Is dest file same as source file? */ + + if (strcmp(src_fullpath, dst_fullpath) == 0) + { + PRINTK("cp error: '%s' and '%s' are the same file\n", src_fullpath, dst_fullpath); + goto errout_with_path; + } + + /* Copy begins. */ + + (void)pthread_mutex_lock(&g_mutex_cp); + src_fd = open(src_fullpath, O_RDONLY); + if (src_fd < 0) + { + PRINTK("cp error: can't open %s. %s.\n", src_fullpath, strerror(errno)); + goto errout_with_mutex; + } + + dst_fd = open(dst_fullpath, O_CREAT | O_WRONLY | O_TRUNC, src_mode); + if (dst_fd < 0) + { + PRINTK("cp error: can't create %s. %s.\n", dst_fullpath, strerror(errno)); + goto errout_with_srcfd; + } + + do + { + (void)memset_s(buf, CP_BUF_SIZE, 0, CP_BUF_SIZE); + r_size = read(src_fd, buf, CP_BUF_SIZE); + if (r_size < 0) + { + PRINTK("cp %s %s failed. %s.\n", src_fullpath, dst_fullpath, strerror(errno)); + goto errout_with_fd; + } + w_size = write(dst_fd, buf, r_size); + if (w_size != r_size) + { + PRINTK("cp %s %s failed. %s.\n", src_fullpath, dst_fullpath, strerror(errno)); + goto errout_with_fd; + } + } + while (r_size == CP_BUF_SIZE); + + /* Release resource. */ + + free(buf); + free(src_fullpath); + free(dst_fullpath); + (void)close(src_fd); + (void)close(dst_fd); + (void)pthread_mutex_unlock(&g_mutex_cp); + return LOS_OK; + +errout_with_fd: + (void)close(dst_fd); +errout_with_srcfd: + (void)close(src_fd); +errout_with_mutex: + (void)pthread_mutex_unlock(&g_mutex_cp); +errout_with_path: + free(dst_fullpath); +errout_with_srcpath: + free(src_fullpath); + free(buf); + return -1; +} + +/* The separator and EOF for a directory fullpath: '/'and '\0' */ + +#define SEPARATOR_EOF_LEN 2 + +static int os_shell_cmd_do_rmdir(const char *pathname) +{ + struct dirent *dirent = NULL; + struct stat stat_info; + DIR *d = NULL; + char *fullpath = NULL; + int ret; + + (void)memset_s(&stat_info, sizeof(stat_info), 0, sizeof(struct stat)); + if (stat(pathname, &stat_info) != 0) + { + return -1; + } + + if (S_ISREG(stat_info.st_mode) || S_ISLNK(stat_info.st_mode)) + { + return remove(pathname); + } + d = opendir(pathname); + if (d == NULL) + { + return -1; + } + while (1) + { + dirent = readdir(d); + if (dirent == NULL) + { + break; + } + if (strcmp(dirent->d_name, "..") && strcmp(dirent->d_name, ".")) + { + size_t fullpath_buf_size = strlen(pathname) + strlen(dirent->d_name) + SEPARATOR_EOF_LEN; + if (fullpath_buf_size <= 0) + { + PRINTK("buffer size is invalid!\n"); + (void)closedir(d); + return -1; + } + fullpath = (char *)malloc(fullpath_buf_size); + if (fullpath == NULL) + { + PRINTK("malloc failure!\n"); + (void)closedir(d); + return -1; + } + ret = snprintf_s(fullpath, fullpath_buf_size, fullpath_buf_size - 1, "%s/%s", pathname, dirent->d_name); + if (ret < 0) + { + PRINTK("name is too long!\n"); + free(fullpath); + (void)closedir(d); + return -1; + } + (void)os_shell_cmd_do_rmdir(fullpath); + free(fullpath); + } + } + (void)closedir(d); + return rmdir(pathname); +} + +/* Wildcard matching operations */ + +static int os_wildcard_match(const char *src, const char *filename) +{ + int ret; + + if (*src != '\0') + { + if (*filename == '*') + { + while ((*filename == '*') || (*filename == '?')) + { + filename++; + } + + if (*filename == '\0') + { + return 0; + } + + while (*src != '\0' && !(*src == *filename)) + { + src++; + } + + if (*src == '\0') + { + return -1; + } + + ret = os_wildcard_match(src, filename); + + while ((ret != 0) && (*(++src) != '\0')) + { + if (*src == *filename) + { + ret = os_wildcard_match(src, filename); + } + } + return ret; + } + else + { + if ((*src == *filename) || (*filename == '?')) + { + return os_wildcard_match(++src, ++filename); + } + return -1; + } + } + + while (*filename != '\0') + { + if (*filename != '*') + { + return -1; + } + filename++; + } + return 0; +} + +/* To determine whether a wildcard character exists in a path */ + +static int os_is_containers_wildcard(const char *filename) +{ + while (*filename != '\0') + { + if ((*filename == '*') || (*filename == '?')) + { + return 1; + } + filename++; + } + return 0; +} + +/* Delete a matching file or directory */ + +static int os_wildcard_delete_file_or_dir(const char *fullpath, wildcard_type mark) +{ + int ret; + + switch (mark) + { + case RM_RECURSIVER: + ret = os_shell_cmd_do_rmdir(fullpath); + break; + case RM_FILE: + ret = unlink(fullpath); + break; + case RM_DIR: + ret = rmdir(fullpath); + break; + default: + return VFS_ERROR; + } + if (ret == -1) + { + PRINTK("%s ", fullpath); + perror("rm/rmdir error!"); + return ret; + } + + PRINTK("%s match successful!delete!\n", fullpath); + return 0; +} + +/* Split the path with wildcard characters */ + +static char* os_wildcard_split_path(char *fullpath, char **handle, char **wait) +{ + int n = 0; + int a = 0; + int b = 0; + int len = strlen(fullpath); + + for (n = 0; n < len; n++) + { + if (fullpath[n] == '/') + { + if (b != 0) + { + fullpath[n] = '\0'; + *wait = fullpath + n + 1; + break; + } + a = n; + } + else if (fullpath[n] == '*' || fullpath[n] == '?') + { + b = n; + fullpath[a] = '\0'; + if (a == 0) + { + *handle = fullpath + a + 1; + continue; + } + *handle = fullpath + a + 1; + } + } + return fullpath; +} + +/* Handling entry of the path with wildcard characters */ + +static int os_wildcard_extract_directory(char *fullpath, void *dst, wildcard_type mark) +{ + char separator[] = "/"; + char src[PATH_MAX] = {0}; + struct dirent *dirent = NULL; + char *f = NULL; + char *s = NULL; + char *t = NULL; + int ret = 0; + DIR *d = NULL; + struct stat stat_buf; + int deleteFlag = 0; + + f = os_wildcard_split_path(fullpath, &s, &t); + + if (s == NULL) + { + if (mark == CP_FILE) + { + ret = os_shell_cmd_do_cp(fullpath, dst); + } + else if (mark == CP_COUNT) + { + ret = stat(fullpath, &stat_buf); + if (ret == 0 && (S_ISREG(stat_buf.st_mode) || S_ISLNK(stat_buf.st_mode))) + { + (*(int *)dst)++; + } + } + else + { + ret = os_wildcard_delete_file_or_dir(fullpath, mark); + } + return ret; + } + + d = (*f == '\0') ? opendir("/") : opendir(f); + + if (d == NULL) + { + perror("opendir error"); + return VFS_ERROR; + } + + while (1) + { + dirent = readdir(d); + if (dirent == NULL) + { + break; + } + + ret = strcpy_s(src, PATH_MAX, f); + if (ret != EOK) + { + goto closedir_out; + } + + ret = os_wildcard_match(dirent->d_name, s); + if (ret == 0) + { + ret = strcat_s(src, sizeof(src), separator); + if (ret != EOK) + { + goto closedir_out; + } + ret = strcat_s(src, sizeof(src), dirent->d_name); + if (ret != EOK) + { + goto closedir_out; + } + if (t == NULL) + { + if (mark == CP_FILE) + { + ret = os_shell_cmd_do_cp(src, dst); + } + else if (mark == CP_COUNT) + { + ret = stat(src, &stat_buf); + if (ret == 0 && (S_ISREG(stat_buf.st_mode) || S_ISLNK(stat_buf.st_mode))) + { + (*(int *)dst)++; + if ((*(int *)dst) > 1) + { + break; + } + } + } + else + { + ret = os_wildcard_delete_file_or_dir(src, mark); + if (ret == 0) + { + deleteFlag = 1; + } + } + } + else + { + ret = strcat_s(src, sizeof(src), separator); + if (ret != EOK) + { + goto closedir_out; + } + ret = strcat_s(src, sizeof(src), t); + if (ret != EOK) + { + goto closedir_out; + } + ret = os_wildcard_extract_directory(src, dst, mark); + if (mark == CP_COUNT && (*(int *)dst) > 1) + { + break; + } + } + } + } + (void)closedir(d); + if (deleteFlag == 1) + { + ret = 0; + } + return ret; +closedir_out: + (void)closedir(d); + return VFS_ERROR; +} + +int osShellCmdCp(int argc, const char **argv) +{ + int ret; + const char *src = NULL; + const char *dst = NULL; + char *src_fullpath = NULL; + char *dst_fullpath = NULL; + struct stat stat_buf; + int count = 0; + char *shell_working_directory = OsShellGetWorkingDirectory(); + if (shell_working_directory == NULL) + { + return -1; + } + + ERROR_OUT_IF(argc < 2, PRINTK("cp [SOURCEFILE] [DESTFILE]\n"), return -1); + + src = argv[0]; + dst = argv[1]; + + /* Get source fullpath. */ + + ret = vfs_normalize_path(shell_working_directory, src, &src_fullpath); + if (ret < 0) + { + set_errno(-ret); + PRINTK("cp error:%s\n", strerror(errno)); + return -1; + } + + if (src[strlen(src) - 1] == '/') + { + PRINTK("cp %s error: Source file can't be a directory.\n", src); + goto errout_with_srcpath; + } + + /* Get dest fullpath. */ + + ret = vfs_normalize_path(shell_working_directory, dst, &dst_fullpath); + if (ret < 0) + { + set_errno(-ret); + PRINTK("cp error: can't open %s. %s\n", dst, strerror(errno)); + goto errout_with_srcpath; + } + + /* Is dest path exist? */ + + ret = stat(dst_fullpath, &stat_buf); + if (ret < 0) + { + /* Is dest path a directory? */ + + if (dst[strlen(dst) - 1] == '/') + { + PRINTK("cp error: %s, %s.\n", dst_fullpath, strerror(errno)); + goto errout_with_path; + } + } + else + { + if ((S_ISREG(stat_buf.st_mode) || S_ISLNK(stat_buf.st_mode)) && dst[strlen(dst) - 1] == '/') + { + PRINTK("cp error: %s is not a directory.\n", dst_fullpath); + goto errout_with_path; + } + } + + if (os_is_containers_wildcard(src_fullpath)) + { + if (ret < 0 || S_ISREG(stat_buf.st_mode) || S_ISLNK(stat_buf.st_mode)) + { + char *src_copy = strdup(src_fullpath); + if (src_copy == NULL) + { + PRINTK("cp error : Out of memory.\n"); + goto errout_with_path; + } + (void)os_wildcard_extract_directory(src_copy, &count, CP_COUNT); + free(src_copy); + if (count > 1) + { + PRINTK("cp error : %s is not a directory.\n", dst_fullpath); + goto errout_with_path; + } + } + ret = os_wildcard_extract_directory(src_fullpath, dst_fullpath, CP_FILE); + } + else + { + ret = os_shell_cmd_do_cp(src_fullpath, dst_fullpath); + } + free(dst_fullpath); + free(src_fullpath); + return ret; + +errout_with_path: + free(dst_fullpath); +errout_with_srcpath: + free(src_fullpath); + return VFS_ERROR; +} + +static inline void print_rm_usage(void) +{ + PRINTK("rm [FILE] or rm [-r/-R] [FILE]\n"); +} + +int osShellCmdRm(int argc, const char **argv) +{ + int ret = 0; + char *fullpath = NULL; + const char *filename = NULL; + char *shell_working_directory = OsShellGetWorkingDirectory(); + if (shell_working_directory == NULL) + { + return -1; + } + + ERROR_OUT_IF(argc != 1 && argc != 2, print_rm_usage(), return -1); + + if (argc == 2) + { + ERROR_OUT_IF(strcmp(argv[0], "-r") != 0 && strcmp(argv[0], "-R") != 0, print_rm_usage(), return -1); + + filename = argv[1]; + ret = vfs_normalize_path(shell_working_directory, filename, &fullpath); + ERROR_OUT_IF(ret < 0, set_err(-ret, "rm error"), return -1); + + if (os_is_containers_wildcard(fullpath)) + { + ret = os_wildcard_extract_directory(fullpath, NULL, RM_RECURSIVER); + } + else + { + ret = os_shell_cmd_do_rmdir(fullpath); + } + } + else + { + filename = argv[0]; + ret = vfs_normalize_path(shell_working_directory, filename, &fullpath); + ERROR_OUT_IF(ret < 0, set_err(-ret, "rm error"), return -1); + + if (os_is_containers_wildcard(fullpath)) + { + ret = os_wildcard_extract_directory(fullpath, NULL, RM_FILE); + } + else + { + ret = unlink(fullpath); + } + } + if (ret == -1) + { + perror("rm error"); + } + free(fullpath); + return 0; +} + +int osShellCmdRmdir(int argc, const char **argv) +{ + int ret; + char *fullpath = NULL; + const char *filename = NULL; + char *shell_working_directory = OsShellGetWorkingDirectory(); + if (shell_working_directory == NULL) + { + return -1; + } + + ERROR_OUT_IF(argc == 0, PRINTK("rmdir [DIRECTORY]\n"), return -1); + + filename = argv[0]; + ret = vfs_normalize_path(shell_working_directory, filename, &fullpath); + ERROR_OUT_IF(ret < 0, set_err(-ret, "rmdir error"), return -1); + + if (os_is_containers_wildcard(fullpath)) + { + ret = os_wildcard_extract_directory(fullpath, NULL, RM_DIR); + } + else + { + ret = rmdir(fullpath); + } + if (ret == -1) + { + PRINTK("rmdir %s failed. Error: %s.\n", fullpath, strerror(errno)); + } + free(fullpath); + + return 0; +} + +int osShellCmdSync(int argc, const char **argv) +{ + ERROR_OUT_IF(argc > 0, PRINTK("\nUsage: sync\n"), return -1); + + sync(); + return 0; +} + +int osShellCmdLsfd(int argc, const char **argv) +{ + ERROR_OUT_IF(argc > 0, PRINTK("\nUsage: lsfd\n"), return -1); + + lsfd(); + + return 0; +} + +int checkNum(const char *arg) +{ + int i = 0; + if (arg == NULL) + { + return -1; + } + if (arg[0] == '-') + { + /* exclude the '-' */ + + i = 1; + } + for (; arg[i] != 0; i++) + { + if (!isdigit(arg[i])) + { + return -1; + } + } + return 0; +} + +#ifdef LOSCFG_KERNEL_SYSCALL +int osShellCmdSu(int argc, const char **argv) +{ + int su_uid; + int su_gid; + + if (argc == 0) + { + /* for su root */ + + su_uid = 0; + su_gid = 0; + } + else + { + ERROR_OUT_IF((argc != 2), PRINTK("su [uid_num] [gid_num]\n"), return -1); + ERROR_OUT_IF((checkNum(argv[0]) != 0) || (checkNum(argv[1]) != 0), /* check argv is digit */ + PRINTK("check uid_num and gid_num is digit\n"), return -1); + + su_uid = atoi(argv[0]); + su_gid = atoi(argv[1]); + + ERROR_OUT_IF((su_uid < 0) || (su_uid > 60000) || (su_gid < 0) || + (su_gid > 60000), PRINTK("uid_num or gid_num out of range!they should be [0~60000]\n"), return -1); + } + + SysSetUserID(su_uid); + SysSetGroupID(su_gid); + return 0; +} +#endif + +int osShellCmdChmod(int argc, const char **argv) +{ + int i = 0; + int mode = 0; + int ret; + char *fullpath = NULL; + const char *filename = NULL; + struct IATTR attr = {0}; + char *shell_working_directory = NULL; + const char *p = NULL; +#define MODE_BIT 3 /* 3 bits express 1 mode */ + + ERROR_OUT_IF((argc != 2), PRINTK("Usage: chmod [FILE]\n"), return -1); + + p = argv[0]; + while (p[i]) + { + if ((p[i] <= '7') && (p[i] >= '0')) + { + mode = ((uint)mode << MODE_BIT) | (uint)(p[i] - '0'); + } + else + { + PRINTK("check the input \n"); + return -1; + } + i++; + } + filename = argv[1]; + + shell_working_directory = OsShellGetWorkingDirectory(); + if (shell_working_directory == NULL) + { + return -1; + } + ret = vfs_normalize_path(shell_working_directory, filename, &fullpath); + ERROR_OUT_IF(ret < 0, set_err(-ret, "chmod error\n"), return -1); + + attr.attr_chg_mode = mode; + attr.attr_chg_valid = CHG_MODE; /* change mode */ + ret = chattr(fullpath, &attr); + if (ret < 0) + { + free(fullpath); + PRINTK("chmod error! %s\n", strerror(errno)); + return ret; + } + + free(fullpath); + return 0; +} + +int osShellCmdChown(int argc, const char **argv) +{ + int ret; + char *fullpath = NULL; + const char *filename = NULL; + struct IATTR attr; + uid_t owner = -1; + gid_t group = -1; + attr.attr_chg_valid = 0; + + ERROR_OUT_IF(((argc != 2) && (argc != 3)), PRINTK("Usage: chown [OWNER] [GROUP] FILE\n"), return -1); + if (argc == 2) + { + ERROR_OUT_IF((checkNum(argv[0]) != 0), PRINTK("check OWNER is digit\n"), return -1); + owner = atoi(argv[0]); + filename = argv[1]; + } + if (argc == 3) + { + ERROR_OUT_IF((checkNum(argv[0]) != 0), PRINTK("check OWNER is digit\n"), return -1); + ERROR_OUT_IF((checkNum(argv[1]) != 0), PRINTK("check GROUP is digit\n"), return -1); + owner = atoi(argv[0]); + group = atoi(argv[1]); + filename = argv[2]; + } + + if (group != -1) + { + attr.attr_chg_gid = group; + attr.attr_chg_valid |= CHG_GID; + } + if (owner != -1) + { + attr.attr_chg_uid = owner; + attr.attr_chg_valid |= CHG_UID; + } + + char *shell_working_directory = OsShellGetWorkingDirectory(); + if (shell_working_directory == NULL) + { + return -1; + } + ret = vfs_normalize_path(shell_working_directory, filename, &fullpath); + ERROR_OUT_IF(ret < 0, set_err(-ret, "chown error\n"), return -1); + + ret = chattr(fullpath, &attr); + if (ret < 0) + { + free(fullpath); + PRINTK("chown error! %s\n", strerror(errno)); + return ret; + } + + free(fullpath); + return 0; +} + +int osShellCmdChgrp(int argc, const char **argv) +{ + int ret; + char *fullpath = NULL; + const char *filename = NULL; + struct IATTR attr; + gid_t group; + attr.attr_chg_valid = 0; + ERROR_OUT_IF((argc != 2), PRINTK("Usage: chgrp GROUP FILE\n"), return -1); + ERROR_OUT_IF((checkNum(argv[0]) != 0), PRINTK("check GROUP is digit\n"), return -1); + group = atoi(argv[0]); + filename = argv[1]; + + if (group != -1) { + attr.attr_chg_gid = group; + attr.attr_chg_valid |= CHG_GID; + } + + char *shell_working_directory = OsShellGetWorkingDirectory(); + if (shell_working_directory == NULL) { + return -1; + } + ret = vfs_normalize_path(shell_working_directory, filename, &fullpath); + ERROR_OUT_IF(ret < 0, set_err(-ret, "chmod error"), return -1); + + ret = chattr(fullpath, &attr); + if (ret < 0) { + free(fullpath); + PRINTK("chgrp error! %s\n", strerror(errno)); + return ret; + } + + free(fullpath); + return 0; +} + +#ifdef LOSCFG_SHELL_CMD_DEBUG +SHELLCMD_ENTRY(lsfd_shellcmd, CMD_TYPE_EX, "lsfd", XARGS, (CmdCallBackFunc)osShellCmdLsfd); +SHELLCMD_ENTRY(statfs_shellcmd, CMD_TYPE_EX, "statfs", XARGS, (CmdCallBackFunc)osShellCmdStatfs); +SHELLCMD_ENTRY(touch_shellcmd, CMD_TYPE_EX, "touch", XARGS, (CmdCallBackFunc)osShellCmdTouch); +#ifdef LOSCFG_KERNEL_SYSCALL +SHELLCMD_ENTRY(su_shellcmd, CMD_TYPE_EX, "su", XARGS, (CmdCallBackFunc)osShellCmdSu); +#endif +#endif +SHELLCMD_ENTRY(sync_shellcmd, CMD_TYPE_EX, "sync", XARGS, (CmdCallBackFunc)osShellCmdSync); +SHELLCMD_ENTRY(ls_shellcmd, CMD_TYPE_EX, "ls", XARGS, (CmdCallBackFunc)osShellCmdLs); +SHELLCMD_ENTRY(pwd_shellcmd, CMD_TYPE_EX, "pwd", XARGS, (CmdCallBackFunc)osShellCmdPwd); +SHELLCMD_ENTRY(cd_shellcmd, CMD_TYPE_EX, "cd", XARGS, (CmdCallBackFunc)osShellCmdCd); +SHELLCMD_ENTRY(cat_shellcmd, CMD_TYPE_EX, "cat", XARGS, (CmdCallBackFunc)osShellCmdCat); +SHELLCMD_ENTRY(rm_shellcmd, CMD_TYPE_EX, "rm", XARGS, (CmdCallBackFunc)osShellCmdRm); +SHELLCMD_ENTRY(rmdir_shellcmd, CMD_TYPE_EX, "rmdir", XARGS, (CmdCallBackFunc)osShellCmdRmdir); +SHELLCMD_ENTRY(mkdir_shellcmd, CMD_TYPE_EX, "mkdir", XARGS, (CmdCallBackFunc)osShellCmdMkdir); +SHELLCMD_ENTRY(chmod_shellcmd, CMD_TYPE_EX, "chmod", XARGS, (CmdCallBackFunc)osShellCmdChmod); +SHELLCMD_ENTRY(chown_shellcmd, CMD_TYPE_EX, "chown", XARGS, (CmdCallBackFunc)osShellCmdChown); +SHELLCMD_ENTRY(chgrp_shellcmd, CMD_TYPE_EX, "chgrp", XARGS, (CmdCallBackFunc)osShellCmdChgrp); +SHELLCMD_ENTRY(mount_shellcmd, CMD_TYPE_EX, "mount", XARGS, (CmdCallBackFunc)osShellCmdMount); +SHELLCMD_ENTRY(umount_shellcmd, CMD_TYPE_EX, "umount", XARGS, (CmdCallBackFunc)osShellCmdUmount); +SHELLCMD_ENTRY(cp_shellcmd, CMD_TYPE_EX, "cp", XARGS, (CmdCallBackFunc)osShellCmdCp); +#endif diff --git a/src/kernel_liteos_a/fs/vfs/vnode.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/vfs/vnode.c similarity index 90% rename from src/kernel_liteos_a/fs/vfs/vnode.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/vfs/vnode.c index 9c6f58d3..ad7f0e3f 100644 --- a/src/kernel_liteos_a/fs/vfs/vnode.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/vfs/vnode.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2021-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -29,11 +29,9 @@ */ #include "los_mux.h" +#include "vnode.h" #include "fs/dirent_fs.h" #include "path_cache.h" -#include "vnode.h" -#include "los_process.h" -#include "los_process_pri.h" LIST_HEAD g_vnodeFreeList; /* free vnodes list */ LIST_HEAD g_vnodeVirtualList; /* dev vnodes list */ @@ -69,13 +67,6 @@ int VnodesInit(void) g_rootVnode->type = VNODE_TYPE_DIR; g_rootVnode->filePath = "/"; -#ifdef LOSCFG_CHROOT - LosProcessCB *processCB = OsGetKernelInitProcess(); - if (processCB->files != NULL) { - g_rootVnode->useCount++; - processCB->files->rootVnode = g_rootVnode; - } -#endif return LOS_OK; } @@ -138,7 +129,7 @@ int VnodeAlloc(struct VnodeOps *vop, struct Vnode **newVnode) VnodeHold(); vnode = GetFromFreeList(); if ((vnode == NULL) && g_totalVnodeSize < LOSCFG_MAX_VNODE_SIZE) { - vnode = (struct Vnode *)zalloc(sizeof(struct Vnode)); + vnode = (struct Vnode*)zalloc(sizeof(struct Vnode)); g_totalVnodeSize++; } @@ -248,7 +239,7 @@ BOOL VnodeInUseIter(const struct Mount *mount) return FALSE; } -int VnodeHold(void) +int VnodeHold() { int ret = LOS_MuxLock(&g_vnodeMux, LOS_WAIT_FOREVER); if (ret != LOS_OK) { @@ -257,7 +248,7 @@ int VnodeHold(void) return ret; } -int VnodeDrop(void) +int VnodeDrop() { int ret = LOS_MuxUnlock(&g_vnodeMux); if (ret != LOS_OK) { @@ -290,7 +281,7 @@ static int PreProcess(const char *originPath, struct Vnode **startVnode, char ** ret = vfs_normalize_path(NULL, originPath, &absolutePath); if (ret == LOS_OK) { - *startVnode = GetCurrRootVnode(); + *startVnode = g_rootVnode; *path = absolutePath; } @@ -302,21 +293,7 @@ static struct Vnode *ConvertVnodeIfMounted(struct Vnode *vnode) if ((vnode == NULL) || !(vnode->flag & VNODE_FLAG_MOUNT_ORIGIN)) { return vnode; } -#ifdef LOSCFG_MNT_CONTAINER - LIST_HEAD *mntList = GetMountList(); - struct Mount *mnt = NULL; - LOS_DL_LIST_FOR_EACH_ENTRY(mnt, mntList, struct Mount, mountList) { - if ((mnt != NULL) && (mnt->vnodeBeCovered == vnode)) { - return mnt->vnodeCovered; - } - } - if (strcmp(vnode->filePath, "/dev") == 0) { - return vnode->newMount->vnodeCovered; - } - return vnode; -#else return vnode->newMount->vnodeCovered; -#endif } static void RefreshLRU(struct Vnode *vnode) @@ -417,7 +394,7 @@ int VnodeLookupAt(const char *path, struct Vnode **result, uint32_t flags, struc } if (normalizedPath[1] == '\0' && normalizedPath[0] == '/') { - *result = GetCurrRootVnode(); + *result = g_rootVnode; free(normalizedPath); return LOS_OK; } @@ -477,7 +454,7 @@ int VnodeLookup(const char *path, struct Vnode **vnode, uint32_t flags) int VnodeLookupFullpath(const char *fullpath, struct Vnode **vnode, uint32_t flags) { - return VnodeLookupAt(fullpath, vnode, flags, GetCurrRootVnode()); + return VnodeLookupAt(fullpath, vnode, flags, g_rootVnode); } static void ChangeRootInternal(struct Vnode *rootOld, char *dirname) @@ -519,17 +496,6 @@ void ChangeRoot(struct Vnode *rootNew) { struct Vnode *rootOld = g_rootVnode; g_rootVnode = rootNew; -#ifdef LOSCFG_CHROOT - LosProcessCB *curr = OsCurrProcessGet(); - if ((curr->files != NULL) && - (curr->files->rootVnode != NULL) && - (curr->files->rootVnode->useCount > 0)) { - curr->files->rootVnode->useCount--; - } - rootNew->useCount++; - curr->files->rootVnode = rootNew; -#endif - ChangeRootInternal(rootOld, "proc"); ChangeRootInternal(rootOld, "dev"); } @@ -617,7 +583,7 @@ int VnodeCreate(struct Vnode *parent, const char *name, int mode, struct Vnode * return 0; } -int VnodeDevInit(void) +int VnodeDevInit() { struct Vnode *devNode = NULL; struct Mount *devMount = NULL; @@ -650,7 +616,7 @@ int VnodeGetattr(struct Vnode *vnode, struct stat *buf) return LOS_OK; } -struct Vnode *VnodeGetRoot(void) +struct Vnode *VnodeGetRoot() { return g_rootVnode; } @@ -716,27 +682,6 @@ void VnodeMemoryDump(void) PRINTK("Vnode memory size = %d(B)\n", vnodeCount * sizeof(struct Vnode)); } -#ifdef LOSCFG_PROC_PROCESS_DIR -struct Vnode *VnodeFind(int fd) -{ - INT32 sysFd; - - if (fd < 0) { - PRINT_ERR("Error. fd is invalid as %d\n", fd); - return NULL; - } - - /* Process fd convert to system global fd */ - sysFd = GetAssociatedSystemFd(fd); - if (sysFd < 0) { - PRINT_ERR("Error. sysFd is invalid as %d\n", sysFd); - return NULL; - } - - return files_get_openfile((int)sysFd); -} -#endif - LIST_HEAD* GetVnodeFreeList() { return &g_vnodeFreeList; @@ -752,7 +697,7 @@ LIST_HEAD* GetVnodeActiveList() return &g_vnodeActiveList; } -int VnodeClearCache(void) +int VnodeClearCache() { struct Vnode *item = NULL; struct Vnode *nextItem = NULL; @@ -774,13 +719,3 @@ int VnodeClearCache(void) return count; } - -struct Vnode *GetCurrRootVnode(void) -{ -#ifdef LOSCFG_CHROOT - LosProcessCB *curr = OsCurrProcessGet(); - return curr->files->rootVnode; -#else - return g_rootVnode; -#endif -} diff --git a/src/kernel_liteos_a/fs/vfs/vnode_hash.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/vfs/vnode_hash.c similarity index 100% rename from src/kernel_liteos_a/fs/vfs/vnode_hash.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/vfs/vnode_hash.c diff --git a/src/kernel_liteos_a/fs/zpfs/BUILD.gn b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/zpfs/BUILD.gn similarity index 100% rename from src/kernel_liteos_a/fs/zpfs/BUILD.gn rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/zpfs/BUILD.gn diff --git a/src/kernel_liteos_a/fs/zpfs/Kconfig b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/zpfs/Kconfig similarity index 100% rename from src/kernel_liteos_a/fs/zpfs/Kconfig rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/zpfs/Kconfig diff --git a/src/kernel_liteos_a/fs/zpfs/Makefile b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/zpfs/Makefile similarity index 100% rename from src/kernel_liteos_a/fs/zpfs/Makefile rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/fs/zpfs/Makefile diff --git a/src/kernel_liteos_a/kernel/BUILD.gn b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/BUILD.gn similarity index 100% rename from src/kernel_liteos_a/kernel/BUILD.gn rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/BUILD.gn diff --git a/src/kernel_liteos_a/kernel/Kconfig b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/Kconfig similarity index 93% rename from src/kernel_liteos_a/kernel/Kconfig rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/Kconfig index 03fea0d9..d1c1195b 100644 --- a/src/kernel_liteos_a/kernel/Kconfig +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/Kconfig @@ -67,14 +67,7 @@ config PAGE_TABLE_FINE_LOCK help This option will enable fine lock for page table. - ######################### config options of extended ##################### source "kernel/extended/Kconfig" -config ENABLE_KERNEL_TEST - bool "Enable kernel test" - default n - help - This option will enable kernel test. - endmenu diff --git a/src/kernel_liteos_a/kernel/base/BUILD.gn b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/BUILD.gn similarity index 90% rename from src/kernel_liteos_a/kernel/base/BUILD.gn rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/BUILD.gn index f3d9b457..3bdcc06b 100644 --- a/src/kernel_liteos_a/kernel/base/BUILD.gn +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/BUILD.gn @@ -1,5 +1,5 @@ # Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. -# Copyright (c) 2020-2023 Huawei Device Co., Ltd. All rights reserved. +# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: @@ -33,7 +33,6 @@ module_name = get_path_info(rebase_path("."), "name") kernel_module(module_name) { sources = [ "core/los_bitmap.c", - "core/los_info.c", "core/los_process.c", "core/los_smp.c", "core/los_swtmr.c", @@ -66,13 +65,10 @@ kernel_module(module_name) { "mp/los_mp.c", "mp/los_percpu.c", "mp/los_spinlock.c", + "mp/los_stat.c", "om/los_err.c", - "sched/los_deadline.c", - "sched/los_idle.c", - "sched/los_priority.c", - "sched/los_sched.c", - "sched/los_sortlink.c", - "sched/los_statistics.c", + "sched/sched_sq/los_sched.c", + "sched/sched_sq/los_sortlink.c", "vm/los_vm_boot.c", "vm/los_vm_dump.c", "vm/los_vm_fault.c", @@ -92,13 +88,8 @@ kernel_module(module_name) { } public_configs = [ ":public" ] - configs += [ ":private" ] } config("public") { include_dirs = [ "include" ] } - -config("private") { - cflags = [ "-Wno-frame-address" ] -} diff --git a/src/kernel_liteos_a/kernel/base/Makefile b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/Makefile similarity index 88% rename from src/kernel_liteos_a/kernel/base/Makefile rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/Makefile index 73fa7ceb..b805e2b9 100644 --- a/src/kernel_liteos_a/kernel/base/Makefile +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/Makefile @@ -1,5 +1,5 @@ # Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. -# Copyright (c) 2020-2023 Huawei Device Co., Ltd. All rights reserved. +# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: @@ -28,7 +28,7 @@ # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. include $(LITEOSTOPDIR)/config.mk -include $(LITEOSTOPDIR)/../../drivers/hdf_core/adapter/khdf/liteos/lite.mk +include $(LITEOSTOPDIR)/../../drivers/adapter/khdf/liteos/lite.mk MODULE_NAME := $(notdir $(shell pwd)) @@ -37,10 +37,9 @@ LOCAL_SRCS := $(wildcard ipc/*.c) $(wildcard core/*.c) $(wildcard mem/membox/*. $(wildcard misc/*.c)\ $(wildcard mem/tlsf/*.c) \ $(wildcard mp/*.c) \ - $(wildcard sched/*.c) \ - $(wildcard vm/*.c) \ + $(wildcard sched/sched_sq/*.c) \ + $(wildcard vm/*.c) - -LOCAL_FLAGS := $(LITEOS_CFLAGS_INTERWORK) -Wno-frame-address +LOCAL_FLAGS := $(LITEOS_CFLAGS_INTERWORK) include $(MODULE) diff --git a/src/kernel_liteos_a/kernel/base/core/los_bitmap.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/core/los_bitmap.c similarity index 100% rename from src/kernel_liteos_a/kernel/base/core/los_bitmap.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/core/los_bitmap.c diff --git a/src/kernel_liteos_a/kernel/base/core/los_process.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/core/los_process.c similarity index 68% rename from src/kernel_liteos_a/kernel/base/core/los_process.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/core/los_process.c index 724ecf66..025ee129 100644 --- a/src/kernel_liteos_a/kernel/base/core/los_process.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/core/los_process.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2023 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -40,7 +40,6 @@ #ifdef LOSCFG_FS_VFS #include "fs/fd_table.h" #include "fs/fs_operation.h" -#include "internal.h" #endif #include "time.h" #include "user_copy.h" @@ -59,20 +58,18 @@ #include "los_vm_phys.h" #include "los_vm_syscall.h" + LITE_OS_SEC_BSS LosProcessCB *g_processCBArray = NULL; LITE_OS_SEC_DATA_INIT STATIC LOS_DL_LIST g_freeProcess; LITE_OS_SEC_DATA_INIT STATIC LOS_DL_LIST g_processRecycleList; +LITE_OS_SEC_BSS UINT32 g_userInitProcess = OS_INVALID_VALUE; +LITE_OS_SEC_BSS UINT32 g_kernelInitProcess = OS_INVALID_VALUE; +LITE_OS_SEC_BSS UINT32 g_kernelIdleProcess = OS_INVALID_VALUE; LITE_OS_SEC_BSS UINT32 g_processMaxNum; -#ifndef LOSCFG_PID_CONTAINER LITE_OS_SEC_BSS ProcessGroup *g_processGroup = NULL; -#define OS_ROOT_PGRP(processCB) (g_processGroup) -#endif STATIC INLINE VOID OsInsertPCBToFreeList(LosProcessCB *processCB) { -#ifdef LOSCFG_PID_CONTAINER - OsPidContainerDestroy(processCB->container, processCB); -#endif UINT32 pid = processCB->processID; (VOID)memset_s(processCB, sizeof(LosProcessCB), 0, sizeof(LosProcessCB)); processCB->processID = pid; @@ -83,132 +80,114 @@ STATIC INLINE VOID OsInsertPCBToFreeList(LosProcessCB *processCB) VOID OsDeleteTaskFromProcess(LosTaskCB *taskCB) { - LosProcessCB *processCB = OS_PCB_FROM_TCB(taskCB); + LosProcessCB *processCB = OS_PCB_FROM_PID(taskCB->processID); LOS_ListDelete(&taskCB->threadList); processCB->threadNumber--; OsTaskInsertToRecycleList(taskCB); } -UINT32 OsProcessAddNewTask(UINTPTR processID, LosTaskCB *taskCB, SchedParam *param, UINT32 *numCount) +UINT32 OsProcessAddNewTask(UINT32 pid, LosTaskCB *taskCB) { UINT32 intSave; - LosProcessCB *processCB = (LosProcessCB *)processID; + UINT16 numCount; + LosProcessCB *processCB = OS_PCB_FROM_PID(pid); SCHEDULER_LOCK(intSave); -#ifdef LOSCFG_PID_CONTAINER - if (OsAllocVtid(taskCB, processCB) == OS_INVALID_VALUE) { - SCHEDULER_UNLOCK(intSave); - PRINT_ERR("OsAllocVtid failed!\n"); - return LOS_NOK; - } -#endif - - taskCB->processCB = (UINTPTR)processCB; + taskCB->processID = pid; LOS_ListTailInsert(&(processCB->threadSiblingList), &(taskCB->threadList)); + if (OsProcessIsUserMode(processCB)) { taskCB->taskStatus |= OS_TASK_FLAG_USER_MODE; if (processCB->threadNumber > 0) { - LosTaskCB *task = processCB->threadGroup; - task->ops->schedParamGet(task, param); + taskCB->basePrio = OS_TCB_FROM_TID(processCB->threadGroupID)->basePrio; } else { - OsSchedProcessDefaultSchedParamGet(param->policy, param); + taskCB->basePrio = OS_USER_PROCESS_PRIORITY_HIGHEST; } } else { - LosTaskCB *runTask = OsCurrTaskGet(); - runTask->ops->schedParamGet(runTask, param); + taskCB->basePrio = OsCurrTaskGet()->basePrio; } #ifdef LOSCFG_KERNEL_VM taskCB->archMmu = (UINTPTR)&processCB->vmSpace->archMmu; #endif if (!processCB->threadNumber) { - processCB->threadGroup = taskCB; + processCB->threadGroupID = taskCB->taskID; } processCB->threadNumber++; - *numCount = processCB->threadCount; + numCount = processCB->threadCount; processCB->threadCount++; SCHEDULER_UNLOCK(intSave); - return LOS_OK; + return numCount; } -ProcessGroup *OsCreateProcessGroup(LosProcessCB *processCB) +STATIC ProcessGroup *OsCreateProcessGroup(UINT32 pid) { - ProcessGroup *pgroup = LOS_MemAlloc(m_aucSysMem1, sizeof(ProcessGroup)); - if (pgroup == NULL) { + LosProcessCB *processCB = NULL; + ProcessGroup *group = LOS_MemAlloc(m_aucSysMem1, sizeof(ProcessGroup)); + if (group == NULL) { return NULL; } - pgroup->pgroupLeader = (UINTPTR)processCB; - LOS_ListInit(&pgroup->processList); - LOS_ListInit(&pgroup->exitProcessList); + group->groupID = pid; + LOS_ListInit(&group->processList); + LOS_ListInit(&group->exitProcessList); - LOS_ListTailInsert(&pgroup->processList, &processCB->subordinateGroupList); - processCB->pgroup = pgroup; + processCB = OS_PCB_FROM_PID(pid); + LOS_ListTailInsert(&group->processList, &processCB->subordinateGroupList); + processCB->group = group; processCB->processStatus |= OS_PROCESS_FLAG_GROUP_LEADER; - - ProcessGroup *rootPGroup = OS_ROOT_PGRP(processCB); - if (rootPGroup == NULL) { - OS_ROOT_PGRP(processCB) = pgroup; - LOS_ListInit(&pgroup->groupList); - } else { - LOS_ListTailInsert(&rootPGroup->groupList, &pgroup->groupList); + if (g_processGroup != NULL) { + LOS_ListTailInsert(&g_processGroup->groupList, &group->groupList); } - return pgroup; + + return group; } -STATIC VOID ExitProcessGroup(LosProcessCB *processCB, ProcessGroup **pgroup) +STATIC VOID OsExitProcessGroup(LosProcessCB *processCB, ProcessGroup **group) { - LosProcessCB *pgroupCB = OS_GET_PGROUP_LEADER(processCB->pgroup); + LosProcessCB *groupProcessCB = OS_PCB_FROM_PID(processCB->group->groupID); + LOS_ListDelete(&processCB->subordinateGroupList); - if (LOS_ListEmpty(&processCB->pgroup->processList) && LOS_ListEmpty(&processCB->pgroup->exitProcessList)) { -#ifdef LOSCFG_PID_CONTAINER - if (processCB->pgroup != OS_ROOT_PGRP(processCB)) { -#endif - LOS_ListDelete(&processCB->pgroup->groupList); - *pgroup = processCB->pgroup; -#ifdef LOSCFG_PID_CONTAINER - } -#endif - pgroupCB->processStatus &= ~OS_PROCESS_FLAG_GROUP_LEADER; - if (OsProcessIsUnused(pgroupCB) && !(pgroupCB->processStatus & OS_PROCESS_FLAG_EXIT)) { - LOS_ListDelete(&pgroupCB->pendList); - OsInsertPCBToFreeList(pgroupCB); + if (LOS_ListEmpty(&processCB->group->processList) && LOS_ListEmpty(&processCB->group->exitProcessList)) { + LOS_ListDelete(&processCB->group->groupList); + groupProcessCB->processStatus &= ~OS_PROCESS_FLAG_GROUP_LEADER; + *group = processCB->group; + if (OsProcessIsUnused(groupProcessCB) && !(groupProcessCB->processStatus & OS_PROCESS_FLAG_EXIT)) { + LOS_ListDelete(&groupProcessCB->pendList); + OsInsertPCBToFreeList(groupProcessCB); } } - processCB->pgroup = NULL; + processCB->group = NULL; } STATIC ProcessGroup *OsFindProcessGroup(UINT32 gid) { - ProcessGroup *pgroup = NULL; - ProcessGroup *rootPGroup = OS_ROOT_PGRP(OsCurrProcessGet()); - LosProcessCB *processCB = OS_GET_PGROUP_LEADER(rootPGroup); - if (processCB->processID == gid) { - return rootPGroup; + ProcessGroup *group = NULL; + if (g_processGroup->groupID == gid) { + return g_processGroup; } - LOS_DL_LIST_FOR_EACH_ENTRY(pgroup, &rootPGroup->groupList, ProcessGroup, groupList) { - processCB = OS_GET_PGROUP_LEADER(pgroup); - if (processCB->processID == gid) { - return pgroup; + LOS_DL_LIST_FOR_EACH_ENTRY(group, &g_processGroup->groupList, ProcessGroup, groupList) { + if (group->groupID == gid) { + return group; } } - PRINT_INFO("%s failed! pgroup id = %u\n", __FUNCTION__, gid); + PRINT_INFO("%s failed! group id = %u\n", __FUNCTION__, gid); return NULL; } -STATIC INT32 OsSendSignalToSpecifyProcessGroup(ProcessGroup *pgroup, siginfo_t *info, INT32 permission) +STATIC INT32 OsSendSignalToSpecifyProcessGroup(ProcessGroup *group, siginfo_t *info, INT32 permission) { INT32 ret, success, err; LosProcessCB *childCB = NULL; success = 0; ret = -LOS_ESRCH; - LOS_DL_LIST_FOR_EACH_ENTRY(childCB, &(pgroup->processList), LosProcessCB, subordinateGroupList) { + LOS_DL_LIST_FOR_EACH_ENTRY(childCB, &(group->processList), LosProcessCB, subordinateGroupList) { if (childCB->processID == 0) { continue; } @@ -224,17 +203,16 @@ STATIC INT32 OsSendSignalToSpecifyProcessGroup(ProcessGroup *pgroup, siginfo_t * LITE_OS_SEC_TEXT INT32 OsSendSignalToAllProcess(siginfo_t *info, INT32 permission) { INT32 ret, success, err; - ProcessGroup *pgroup = NULL; - ProcessGroup *rootPGroup = OS_ROOT_PGRP(OsCurrProcessGet()); + ProcessGroup *group = NULL; success = 0; - err = OsSendSignalToSpecifyProcessGroup(rootPGroup, info, permission); + err = OsSendSignalToSpecifyProcessGroup(g_processGroup, info, permission); success |= !err; ret = err; /* all processes group */ - LOS_DL_LIST_FOR_EACH_ENTRY(pgroup, &rootPGroup->groupList, ProcessGroup, groupList) { + LOS_DL_LIST_FOR_EACH_ENTRY(group, &g_processGroup->groupList, ProcessGroup, groupList) { /* all processes in the process group. */ - err = OsSendSignalToSpecifyProcessGroup(pgroup, info, permission); + err = OsSendSignalToSpecifyProcessGroup(group, info, permission); success |= !err; ret = err; } @@ -243,61 +221,69 @@ LITE_OS_SEC_TEXT INT32 OsSendSignalToAllProcess(siginfo_t *info, INT32 permissio LITE_OS_SEC_TEXT INT32 OsSendSignalToProcessGroup(INT32 pid, siginfo_t *info, INT32 permission) { - ProcessGroup *pgroup = NULL; + ProcessGroup *group = NULL; /* Send SIG to all processes in process group PGRP. If PGRP is zero, send SIG to all processes in the current process's process group. */ - pgroup = OsFindProcessGroup(pid ? -pid : LOS_GetCurrProcessGroupID()); - if (pgroup == NULL) { + group = OsFindProcessGroup(pid ? -pid : LOS_GetCurrProcessGroupID()); + if (group == NULL) { return -LOS_ESRCH; } /* all processes in the process group. */ - return OsSendSignalToSpecifyProcessGroup(pgroup, info, permission); + return OsSendSignalToSpecifyProcessGroup(group, info, permission); } -STATIC LosProcessCB *OsFindGroupExitProcess(ProcessGroup *pgroup, INT32 pid) +STATIC LosProcessCB *OsFindGroupExitProcess(ProcessGroup *group, INT32 pid) { LosProcessCB *childCB = NULL; - LOS_DL_LIST_FOR_EACH_ENTRY(childCB, &(pgroup->exitProcessList), LosProcessCB, subordinateGroupList) { + LOS_DL_LIST_FOR_EACH_ENTRY(childCB, &(group->exitProcessList), LosProcessCB, subordinateGroupList) { if ((childCB->processID == pid) || (pid == OS_INVALID_VALUE)) { return childCB; } } + PRINT_INFO("%s find exit process : %d failed in group : %u\n", __FUNCTION__, pid, group->groupID); return NULL; } -STATIC UINT32 OsFindChildProcess(const LosProcessCB *processCB, const LosProcessCB *wait) +STATIC UINT32 OsFindChildProcess(const LosProcessCB *processCB, INT32 childPid) { LosProcessCB *childCB = NULL; + if (childPid < 0) { + goto ERR; + } + LOS_DL_LIST_FOR_EACH_ENTRY(childCB, &(processCB->childrenList), LosProcessCB, siblingList) { - if (childCB == wait) { + if (childCB->processID == childPid) { return LOS_OK; } } +ERR: + PRINT_INFO("%s is find the child : %d failed in parent : %u\n", __FUNCTION__, childPid, processCB->processID); return LOS_NOK; } -STATIC LosProcessCB *OsFindExitChildProcess(const LosProcessCB *processCB, const LosProcessCB *wait) +STATIC LosProcessCB *OsFindExitChildProcess(const LosProcessCB *processCB, INT32 childPid) { LosProcessCB *exitChild = NULL; LOS_DL_LIST_FOR_EACH_ENTRY(exitChild, &(processCB->exitChildList), LosProcessCB, siblingList) { - if ((wait == NULL) || (exitChild == wait)) { + if ((childPid == OS_INVALID_VALUE) || (exitChild->processID == childPid)) { return exitChild; } } + PRINT_INFO("%s is find the exit child : %d failed in parent : %u\n", __FUNCTION__, childPid, processCB->processID); return NULL; } -VOID OsWaitWakeTask(LosTaskCB *taskCB, UINTPTR wakePID) +VOID OsWaitWakeTask(LosTaskCB *taskCB, UINT32 wakePID) { taskCB->waitID = wakePID; - taskCB->ops->wake(taskCB); + OsSchedTaskWake(taskCB); #ifdef LOSCFG_KERNEL_SMP LOS_MpSchedule(OS_MP_CPU_ALL); #endif @@ -307,20 +293,20 @@ STATIC BOOL OsWaitWakeSpecifiedProcess(LOS_DL_LIST *head, const LosProcessCB *pr { LOS_DL_LIST *list = head; LosTaskCB *taskCB = NULL; - UINTPTR processID = 0; + UINT32 pid = 0; BOOL find = FALSE; while (list->pstNext != head) { taskCB = OS_TCB_FROM_PENDLIST(LOS_DL_LIST_FIRST(list)); - if ((taskCB->waitFlag == OS_PROCESS_WAIT_PRO) && (taskCB->waitID == (UINTPTR)processCB)) { - if (processID == 0) { - processID = taskCB->waitID; + if ((taskCB->waitFlag == OS_PROCESS_WAIT_PRO) && (taskCB->waitID == processCB->processID)) { + if (pid == 0) { + pid = processCB->processID; find = TRUE; } else { - processID = OS_INVALID_VALUE; + pid = OS_INVALID_VALUE; } - OsWaitWakeTask(taskCB, processID); + OsWaitWakeTask(taskCB, pid); continue; } @@ -375,14 +361,14 @@ STATIC VOID OsWaitCheckAndWakeParentProcess(LosProcessCB *parentCB, const LosPro while (list->pstNext != head) { taskCB = OS_TCB_FROM_PENDLIST(LOS_DL_LIST_FIRST(list)); if (taskCB->waitFlag == OS_PROCESS_WAIT_GID) { - if (taskCB->waitID != (UINTPTR)OS_GET_PGROUP_LEADER(processCB->pgroup)) { + if (taskCB->waitID != processCB->group->groupID) { list = list->pstNext; continue; } } if (findSpecified == FALSE) { - OsWaitWakeTask(taskCB, (UINTPTR)processCB); + OsWaitWakeTask(taskCB, processCB->processID); findSpecified = TRUE; } else { OsWaitWakeTask(taskCB, OS_INVALID_VALUE); @@ -404,6 +390,13 @@ LITE_OS_SEC_TEXT VOID OsProcessResourcesToFree(LosProcessCB *processCB) } #endif +#ifdef LOSCFG_FS_VFS + if (OsProcessIsUserMode(processCB)) { + delete_files(processCB->files); + } + processCB->files = NULL; +#endif + #ifdef LOSCFG_SECURITY_CAPABILITY if (processCB->user != NULL) { (VOID)LOS_MemFree(m_aucSysMem1, processCB->user); @@ -411,10 +404,8 @@ LITE_OS_SEC_TEXT VOID OsProcessResourcesToFree(LosProcessCB *processCB) } #endif -#ifdef LOSCFG_BASE_CORE_SWTMR_ENABLE - OsSwtmrRecycle((UINTPTR)processCB); + OsSwtmrRecycle(processCB->processID); processCB->timerID = (timer_t)(UINTPTR)MAX_INVALID_TIMER_VID; -#endif #ifdef LOSCFG_SECURITY_VID if (processCB->timerIdMap.bitMap != NULL) { @@ -436,41 +427,18 @@ LITE_OS_SEC_TEXT VOID OsProcessResourcesToFree(LosProcessCB *processCB) (VOID)LOS_MemFree(m_aucSysMem1, processCpup); #endif -#ifdef LOSCFG_PROC_PROCESS_DIR - ProcFreeProcessDir(processCB->procDir); - processCB->procDir = NULL; -#endif - -#ifdef LOSCFG_KERNEL_CONTAINER - OsOsContainersDestroyEarly(processCB); -#endif - -#ifdef LOSCFG_FS_VFS - if (OsProcessIsUserMode(processCB)) { - delete_files(processCB->files); - } - processCB->files = NULL; -#endif - -#ifdef LOSCFG_KERNEL_CONTAINER - OsContainersDestroy(processCB); -#endif - -#ifdef LOSCFG_KERNEL_PLIMITS - OsPLimitsDeleteProcess(processCB); -#endif if (processCB->resourceLimit != NULL) { (VOID)LOS_MemFree((VOID *)m_aucSysMem0, processCB->resourceLimit); processCB->resourceLimit = NULL; } } -STATIC VOID OsRecycleZombiesProcess(LosProcessCB *childCB, ProcessGroup **pgroup) +LITE_OS_SEC_TEXT STATIC VOID OsRecycleZombiesProcess(LosProcessCB *childCB, ProcessGroup **group) { - ExitProcessGroup(childCB, pgroup); + OsExitProcessGroup(childCB, group); LOS_ListDelete(&childCB->siblingList); - if (OsProcessIsDead(childCB)) { - OsDeleteTaskFromProcess(childCB->threadGroup); + if (childCB->processStatus & OS_PROCESS_STATUS_ZOMBIES) { + OsDeleteTaskFromProcess(OS_TCB_FROM_TID(childCB->threadGroupID)); childCB->processStatus &= ~OS_PROCESS_STATUS_ZOMBIES; childCB->processStatus |= OS_PROCESS_FLAG_UNUSED; } @@ -478,7 +446,7 @@ STATIC VOID OsRecycleZombiesProcess(LosProcessCB *childCB, ProcessGroup **pgroup LOS_ListDelete(&childCB->pendList); if (childCB->processStatus & OS_PROCESS_FLAG_EXIT) { LOS_ListHeadInsert(&g_processRecycleList, &childCB->pendList); - } else if (OsProcessIsPGroupLeader(childCB)) { + } else if (childCB->processStatus & OS_PROCESS_FLAG_GROUP_LEADER) { LOS_ListTailInsert(&g_processRecycleList, &childCB->pendList); } else { OsInsertPCBToFreeList(childCB); @@ -487,35 +455,31 @@ STATIC VOID OsRecycleZombiesProcess(LosProcessCB *childCB, ProcessGroup **pgroup STATIC VOID OsDealAliveChildProcess(LosProcessCB *processCB) { + UINT32 parentID; LosProcessCB *childCB = NULL; LosProcessCB *parentCB = NULL; LOS_DL_LIST *nextList = NULL; LOS_DL_LIST *childHead = NULL; -#ifdef LOSCFG_PID_CONTAINER - if (processCB->processID == OS_USER_ROOT_PROCESS_ID) { - return; - } -#endif - if (!LOS_ListEmpty(&processCB->childrenList)) { childHead = processCB->childrenList.pstNext; LOS_ListDelete(&(processCB->childrenList)); if (OsProcessIsUserMode(processCB)) { - parentCB = OS_PCB_FROM_PID(OS_USER_ROOT_PROCESS_ID); + parentID = g_userInitProcess; } else { - parentCB = OsGetKernelInitProcess(); + parentID = g_kernelInitProcess; } for (nextList = childHead; ;) { childCB = OS_PCB_FROM_SIBLIST(nextList); - childCB->parentProcess = parentCB; + childCB->parentProcessID = parentID; nextList = nextList->pstNext; if (nextList == childHead) { break; } } + parentCB = OS_PCB_FROM_PID(parentID); LOS_ListTailInsertList(&parentCB->childrenList, childHead); } @@ -525,37 +489,40 @@ STATIC VOID OsDealAliveChildProcess(LosProcessCB *processCB) STATIC VOID OsChildProcessResourcesFree(const LosProcessCB *processCB) { LosProcessCB *childCB = NULL; - ProcessGroup *pgroup = NULL; + ProcessGroup *group = NULL; while (!LOS_ListEmpty(&((LosProcessCB *)processCB)->exitChildList)) { childCB = LOS_DL_LIST_ENTRY(processCB->exitChildList.pstNext, LosProcessCB, siblingList); - OsRecycleZombiesProcess(childCB, &pgroup); - (VOID)LOS_MemFree(m_aucSysMem1, pgroup); + OsRecycleZombiesProcess(childCB, &group); + (VOID)LOS_MemFree(m_aucSysMem1, group); } } VOID OsProcessNaturalExit(LosProcessCB *processCB, UINT32 status) { + LosProcessCB *parentCB = NULL; + OsChildProcessResourcesFree(processCB); /* is a child process */ - if (processCB->parentProcess != NULL) { - LosProcessCB *parentCB = processCB->parentProcess; + if (processCB->parentProcessID != OS_INVALID_VALUE) { + parentCB = OS_PCB_FROM_PID(processCB->parentProcessID); LOS_ListDelete(&processCB->siblingList); if (!OsProcessExitCodeSignalIsSet(processCB)) { OsProcessExitCodeSet(processCB, status); } LOS_ListTailInsert(&parentCB->exitChildList, &processCB->siblingList); LOS_ListDelete(&processCB->subordinateGroupList); - LOS_ListTailInsert(&processCB->pgroup->exitProcessList, &processCB->subordinateGroupList); + LOS_ListTailInsert(&processCB->group->exitProcessList, &processCB->subordinateGroupList); OsWaitCheckAndWakeParentProcess(parentCB, processCB); OsDealAliveChildProcess(processCB); processCB->processStatus |= OS_PROCESS_STATUS_ZOMBIES; + #ifdef LOSCFG_KERNEL_VM - (VOID)OsSendSigToProcess(parentCB, SIGCHLD, OS_KERNEL_KILL_PERMISSION); + (VOID)OsKill(processCB->parentProcessID, SIGCHLD, OS_KERNEL_KILL_PERMISSION); #endif LOS_ListHeadInsert(&g_processRecycleList, &processCB->pendList); return; @@ -565,25 +532,13 @@ VOID OsProcessNaturalExit(LosProcessCB *processCB, UINT32 status) return; } -STATIC VOID SystemProcessEarlyInit(LosProcessCB *processCB) -{ - LOS_ListDelete(&processCB->pendList); -#ifdef LOSCFG_KERNEL_CONTAINER - OsContainerInitSystemProcess(processCB); -#endif - if (processCB == OsGetKernelInitProcess()) { - OsSetMainTaskProcess((UINTPTR)processCB); - } -} - -UINT32 OsProcessInit(VOID) +STATIC UINT32 OsProcessInit(VOID) { UINT32 index; UINT32 size; - UINT32 ret; g_processMaxNum = LOSCFG_BASE_CORE_PROCESS_LIMIT; - size = (g_processMaxNum + 1) * sizeof(LosProcessCB); + size = g_processMaxNum * sizeof(LosProcessCB); g_processCBArray = (LosProcessCB *)LOS_MemAlloc(m_aucSysMem1, size); if (g_processCBArray == NULL) { @@ -600,25 +555,15 @@ UINT32 OsProcessInit(VOID) LOS_ListTailInsert(&g_freeProcess, &g_processCBArray[index].pendList); } - /* Default process to prevent thread PCB from being empty */ - g_processCBArray[index].processID = index; - g_processCBArray[index].processStatus = OS_PROCESS_FLAG_UNUSED; + g_kernelIdleProcess = 0; /* 0: The idle process ID of the kernel-mode process is fixed at 0 */ + LOS_ListDelete(&OS_PCB_FROM_PID(g_kernelIdleProcess)->pendList); - ret = OsTaskInit((UINTPTR)&g_processCBArray[g_processMaxNum]); - if (ret != LOS_OK) { - (VOID)LOS_MemFree(m_aucSysMem1, g_processCBArray); - return LOS_OK; - } + g_userInitProcess = 1; /* 1: The root process ID of the user-mode process is fixed at 1 */ + LOS_ListDelete(&OS_PCB_FROM_PID(g_userInitProcess)->pendList); + + g_kernelInitProcess = 2; /* 2: The root process ID of the kernel-mode process is fixed at 2 */ + LOS_ListDelete(&OS_PCB_FROM_PID(g_kernelInitProcess)->pendList); -#ifdef LOSCFG_KERNEL_CONTAINER - OsInitRootContainer(); -#endif -#ifdef LOSCFG_KERNEL_PLIMITS - OsProcLimiterSetInit(); -#endif - SystemProcessEarlyInit(OsGetIdleProcess()); - SystemProcessEarlyInit(OsGetUserInitProcess()); - SystemProcessEarlyInit(OsGetKernelInitProcess()); return LOS_OK; } @@ -650,7 +595,8 @@ LITE_OS_SEC_TEXT VOID OsProcessCBRecycleToFree(VOID) * !OS_PROCESS_FLAG_UNUSED: Parent process does not reclaim child process resources. */ LOS_ListDelete(&processCB->pendList); - if (OsProcessIsPGroupLeader(processCB) || OsProcessIsDead(processCB)) { + if ((processCB->processStatus & OS_PROCESS_FLAG_GROUP_LEADER) || + (processCB->processStatus & OS_PROCESS_STATUS_ZOMBIES)) { LOS_ListTailInsert(&g_processRecycleList, &processCB->pendList); } else { /* Clear the bottom 4 bits of process status */ @@ -669,28 +615,22 @@ LITE_OS_SEC_TEXT VOID OsProcessCBRecycleToFree(VOID) STATIC VOID OsDeInitPCB(LosProcessCB *processCB) { UINT32 intSave; - ProcessGroup *pgroup = NULL; + ProcessGroup *group = NULL; if (processCB == NULL) { return; } -#ifdef LOSCFG_KERNEL_CONTAINER - if (OS_PID_CHECK_INVALID(processCB->processID)) { - return; - } -#endif - OsProcessResourcesToFree(processCB); SCHEDULER_LOCK(intSave); - if (processCB->parentProcess != NULL) { + if (processCB->parentProcessID != OS_INVALID_VALUE) { LOS_ListDelete(&processCB->siblingList); - processCB->parentProcess = NULL; + processCB->parentProcessID = OS_INVALID_VALUE; } - if (processCB->pgroup != NULL) { - ExitProcessGroup(processCB, &pgroup); + if (processCB->group != NULL) { + OsExitProcessGroup(processCB, &group); } processCB->processStatus &= ~OS_PROCESS_STATUS_INIT; @@ -698,7 +638,7 @@ STATIC VOID OsDeInitPCB(LosProcessCB *processCB) LOS_ListHeadInsert(&g_processRecycleList, &processCB->pendList); SCHEDULER_UNLOCK(intSave); - (VOID)LOS_MemFree(m_aucSysMem1, pgroup); + (VOID)LOS_MemFree(m_aucSysMem1, group); OsWriteResourceEvent(OS_RESOURCE_EVENT_FREE); return; } @@ -739,8 +679,8 @@ STATIC UINT32 OsInitPCB(LosProcessCB *processCB, UINT32 mode, const CHAR *name) { processCB->processMode = mode; processCB->processStatus = OS_PROCESS_STATUS_INIT; - processCB->parentProcess = NULL; - processCB->threadGroup = NULL; + processCB->parentProcessID = OS_INVALID_VALUE; + processCB->threadGroupID = OS_INVALID_VALUE; processCB->umask = OS_PROCESS_DEFAULT_UMASK; processCB->timerID = (timer_t)(UINTPTR)MAX_INVALID_TIMER_VID; @@ -831,11 +771,7 @@ LITE_OS_SEC_TEXT INT32 LOS_GetUserID(VOID) INT32 uid; SCHEDULER_LOCK(intSave); -#ifdef LOSCFG_USER_CONTAINER - uid = OsFromKuidMunged(OsCurrentUserContainer(), CurrentCredentials()->uid); -#else uid = (INT32)OsCurrUserGet()->userID; -#endif SCHEDULER_UNLOCK(intSave); return uid; #else @@ -850,11 +786,7 @@ LITE_OS_SEC_TEXT INT32 LOS_GetGroupID(VOID) INT32 gid; SCHEDULER_LOCK(intSave); -#ifdef LOSCFG_USER_CONTAINER - gid = OsFromKgidMunged(OsCurrentUserContainer(), CurrentCredentials()->gid); -#else gid = (INT32)OsCurrUserGet()->gid; -#endif SCHEDULER_UNLOCK(intSave); return gid; @@ -863,8 +795,9 @@ LITE_OS_SEC_TEXT INT32 LOS_GetGroupID(VOID) #endif } -STATIC UINT32 OsSystemProcessInit(LosProcessCB *processCB, UINT32 flags, const CHAR *name) +STATIC UINT32 OsProcessCreateInit(LosProcessCB *processCB, UINT32 flags, const CHAR *name) { + ProcessGroup *group = NULL; UINT32 ret = OsInitPCB(processCB, flags, name); if (ret != LOS_OK) { goto EXIT; @@ -878,8 +811,8 @@ STATIC UINT32 OsSystemProcessInit(LosProcessCB *processCB, UINT32 flags, const C } #endif - ProcessGroup *pgroup = OsCreateProcessGroup(processCB); - if (pgroup == NULL) { + group = OsCreateProcessGroup(processCB->processID); + if (group == NULL) { ret = LOS_ENOMEM; goto EXIT; } @@ -892,13 +825,6 @@ STATIC UINT32 OsSystemProcessInit(LosProcessCB *processCB, UINT32 flags, const C } #endif -#ifdef LOSCFG_KERNEL_PLIMITS - ret = OsPLimitsAddProcess(NULL, processCB); - if (ret != LOS_OK) { - ret = LOS_ENOMEM; - goto EXIT; - } -#endif return LOS_OK; EXIT: @@ -908,22 +834,30 @@ EXIT: LITE_OS_SEC_TEXT_INIT UINT32 OsSystemProcessCreate(VOID) { - LosProcessCB *kerInitProcess = OsGetKernelInitProcess(); - UINT32 ret = OsSystemProcessInit(kerInitProcess, OS_KERNEL_MODE, "KProcess"); + UINT32 ret = OsProcessInit(); + if (ret != LOS_OK) { + return ret; + } + + LosProcessCB *kerInitProcess = OS_PCB_FROM_PID(g_kernelInitProcess); + ret = OsProcessCreateInit(kerInitProcess, OS_KERNEL_MODE, "KProcess"); if (ret != LOS_OK) { return ret; } + kerInitProcess->processStatus &= ~OS_PROCESS_STATUS_INIT; + g_processGroup = kerInitProcess->group; + LOS_ListInit(&g_processGroup->groupList); - LosProcessCB *idleProcess = OsGetIdleProcess(); + LosProcessCB *idleProcess = OS_PCB_FROM_PID(g_kernelIdleProcess); ret = OsInitPCB(idleProcess, OS_KERNEL_MODE, "KIdle"); if (ret != LOS_OK) { return ret; } - idleProcess->parentProcess = kerInitProcess; + idleProcess->parentProcessID = kerInitProcess->processID; LOS_ListTailInsert(&kerInitProcess->childrenList, &idleProcess->siblingList); - idleProcess->pgroup = kerInitProcess->pgroup; - LOS_ListTailInsert(&kerInitProcess->pgroup->processList, &idleProcess->subordinateGroupList); + idleProcess->group = kerInitProcess->group; + LOS_ListTailInsert(&kerInitProcess->group->processList, &idleProcess->subordinateGroupList); #ifdef LOSCFG_SECURITY_CAPABILITY idleProcess->user = kerInitProcess->user; #endif @@ -932,58 +866,38 @@ LITE_OS_SEC_TEXT_INIT UINT32 OsSystemProcessCreate(VOID) #endif idleProcess->processStatus &= ~OS_PROCESS_STATUS_INIT; - ret = OsIdleTaskCreate((UINTPTR)idleProcess); + ret = OsIdleTaskCreate(); if (ret != LOS_OK) { return ret; } + idleProcess->threadGroupID = OsGetIdleTaskId(); + return LOS_OK; } -INT32 OsSchedulerParamCheck(UINT16 policy, BOOL isThread, const LosSchedParam *param) +STATIC INLINE INT32 OsProcessSchedlerParamCheck(INT32 which, INT32 pid, UINT16 prio, UINT16 policy) { - if (param == NULL) { + if (OS_PID_CHECK_INVALID(pid)) { return LOS_EINVAL; } - if ((policy == LOS_SCHED_RR) || (isThread && (policy == LOS_SCHED_FIFO))) { - if ((param->priority < OS_PROCESS_PRIORITY_HIGHEST) || - (param->priority > OS_PROCESS_PRIORITY_LOWEST)) { - return LOS_EINVAL; - } - return LOS_OK; - } - - if (policy == LOS_SCHED_DEADLINE) { - if ((param->runTimeUs < OS_SCHED_EDF_MIN_RUNTIME) || (param->runTimeUs >= param->deadlineUs)) { - return LOS_EINVAL; - } - if ((param->deadlineUs < OS_SCHED_EDF_MIN_DEADLINE) || (param->deadlineUs > OS_SCHED_EDF_MAX_DEADLINE)) { - return LOS_EINVAL; - } - if (param->periodUs < param->deadlineUs) { - return LOS_EINVAL; - } - return LOS_OK; + if (which != LOS_PRIO_PROCESS) { + return LOS_EINVAL; } - return LOS_EINVAL; -} - -STATIC INLINE INT32 ProcessSchedulerParamCheck(INT32 which, INT32 pid, UINT16 policy, const LosSchedParam *param) -{ - if (OS_PID_CHECK_INVALID(pid)) { + if (prio > OS_PROCESS_PRIORITY_LOWEST) { return LOS_EINVAL; } - if (which != LOS_PRIO_PROCESS) { + if (policy != LOS_SCHED_RR) { return LOS_EINVAL; } - return OsSchedulerParamCheck(policy, FALSE, param); + return LOS_OK; } #ifdef LOSCFG_SECURITY_CAPABILITY -STATIC BOOL OsProcessCapPermitCheck(const LosProcessCB *processCB, const SchedParam *param, UINT16 policy, UINT16 prio) +STATIC BOOL OsProcessCapPermitCheck(const LosProcessCB *processCB, UINT16 prio) { LosProcessCB *runProcess = OsCurrProcessGet(); @@ -993,7 +907,7 @@ STATIC BOOL OsProcessCapPermitCheck(const LosProcessCB *processCB, const SchedPa } /* user mode process can reduce the priority of itself */ - if ((runProcess->processID == processCB->processID) && (policy == LOS_SCHED_RR) && (prio > param->basePrio)) { + if ((runProcess->processID == processCB->processID) && (prio > OsCurrTaskGet()->basePrio)) { return TRUE; } @@ -1005,59 +919,33 @@ STATIC BOOL OsProcessCapPermitCheck(const LosProcessCB *processCB, const SchedPa } #endif -LITE_OS_SEC_TEXT INT32 OsSetProcessScheduler(INT32 which, INT32 pid, UINT16 policy, const LosSchedParam *schedParam) +LITE_OS_SEC_TEXT INT32 OsSetProcessScheduler(INT32 which, INT32 pid, UINT16 prio, UINT16 policy) { - SchedParam param = { 0 }; + LosProcessCB *processCB = NULL; BOOL needSched = FALSE; UINT32 intSave; + INT32 ret; - INT32 ret = ProcessSchedulerParamCheck(which, pid, policy, schedParam); + ret = OsProcessSchedlerParamCheck(which, pid, prio, policy); if (ret != LOS_OK) { return -ret; } - LosProcessCB *processCB = OS_PCB_FROM_PID(pid); SCHEDULER_LOCK(intSave); + processCB = OS_PCB_FROM_PID(pid); if (OsProcessIsInactive(processCB)) { - SCHEDULER_UNLOCK(intSave); - return -LOS_ESRCH; + ret = LOS_ESRCH; + goto EXIT; } - LosTaskCB *taskCB = processCB->threadGroup; - taskCB->ops->schedParamGet(taskCB, ¶m); - #ifdef LOSCFG_SECURITY_CAPABILITY - if (!OsProcessCapPermitCheck(processCB, ¶m, policy, schedParam->priority)) { - SCHEDULER_UNLOCK(intSave); - return -LOS_EPERM; + if (!OsProcessCapPermitCheck(processCB, prio)) { + ret = LOS_EPERM; + goto EXIT; } #endif - if (param.policy != policy) { - if (policy == LOS_SCHED_DEADLINE) { /* HPF -> EDF */ - if (processCB->threadNumber > 1) { - SCHEDULER_UNLOCK(intSave); - return -LOS_EPERM; - } - OsSchedParamInit(taskCB, policy, NULL, schedParam); - needSched = TRUE; - goto TO_SCHED; - } else if (param.policy == LOS_SCHED_DEADLINE) { /* EDF -> HPF */ - SCHEDULER_UNLOCK(intSave); - return -LOS_EPERM; - } - } - - if (policy == LOS_SCHED_DEADLINE) { - param.runTimeUs = schedParam->runTimeUs; - param.deadlineUs = schedParam->deadlineUs; - param.periodUs = schedParam->periodUs; - } else { - param.basePrio = schedParam->priority; - } - needSched = taskCB->ops->schedParamModify(taskCB, ¶m); - -TO_SCHED: + needSched = OsSchedModifyProcessSchedParam(pid, policy, prio); SCHEDULER_UNLOCK(intSave); LOS_MpSchedule(OS_MP_CPU_ALL); @@ -1065,26 +953,25 @@ TO_SCHED: LOS_Schedule(); } return LOS_OK; + +EXIT: + SCHEDULER_UNLOCK(intSave); + return -ret; } -LITE_OS_SEC_TEXT INT32 LOS_SetProcessScheduler(INT32 pid, UINT16 policy, const LosSchedParam *schedParam) +LITE_OS_SEC_TEXT INT32 LOS_SetProcessScheduler(INT32 pid, UINT16 policy, UINT16 prio) { - return OsSetProcessScheduler(LOS_PRIO_PROCESS, pid, policy, schedParam); + return OsSetProcessScheduler(LOS_PRIO_PROCESS, pid, prio, policy); } -LITE_OS_SEC_TEXT INT32 LOS_GetProcessScheduler(INT32 pid, INT32 *policy, LosSchedParam *schedParam) +LITE_OS_SEC_TEXT INT32 LOS_GetProcessScheduler(INT32 pid) { UINT32 intSave; - SchedParam param = { 0 }; if (OS_PID_CHECK_INVALID(pid)) { return -LOS_EINVAL; } - if ((policy == NULL) && (schedParam == NULL)) { - return -LOS_EINVAL; - } - SCHEDULER_LOCK(intSave); LosProcessCB *processCB = OS_PCB_FROM_PID(pid); if (OsProcessIsUnused(processCB)) { @@ -1092,54 +979,20 @@ LITE_OS_SEC_TEXT INT32 LOS_GetProcessScheduler(INT32 pid, INT32 *policy, LosSche return -LOS_ESRCH; } - LosTaskCB *taskCB = processCB->threadGroup; - taskCB->ops->schedParamGet(taskCB, ¶m); SCHEDULER_UNLOCK(intSave); - if (policy != NULL) { - if (param.policy == LOS_SCHED_FIFO) { - *policy = LOS_SCHED_RR; - } else { - *policy = param.policy; - } - } - - if (schedParam != NULL) { - if (param.policy == LOS_SCHED_DEADLINE) { - schedParam->runTimeUs = param.runTimeUs; - schedParam->deadlineUs = param.deadlineUs; - schedParam->periodUs = param.periodUs; - } else { - schedParam->priority = param.basePrio; - } - } - return LOS_OK; + return LOS_SCHED_RR; } -LITE_OS_SEC_TEXT INT32 LOS_SetProcessPriority(INT32 pid, INT32 prio) +LITE_OS_SEC_TEXT INT32 LOS_SetProcessPriority(INT32 pid, UINT16 prio) { - INT32 ret; - INT32 policy; - LosSchedParam param = { - .priority = prio, - }; - - ret = LOS_GetProcessScheduler(pid, &policy, NULL); - if (ret != LOS_OK) { - return ret; - } - - if (policy == LOS_SCHED_DEADLINE) { - return -LOS_EINVAL; - } - - return OsSetProcessScheduler(LOS_PRIO_PROCESS, pid, (UINT16)policy, ¶m); + return OsSetProcessScheduler(LOS_PRIO_PROCESS, pid, prio, LOS_GetProcessScheduler(pid)); } LITE_OS_SEC_TEXT INT32 OsGetProcessPriority(INT32 which, INT32 pid) { + INT32 prio; UINT32 intSave; - SchedParam param = { 0 }; (VOID)which; if (OS_PID_CHECK_INVALID(pid)) { @@ -1153,20 +1006,15 @@ LITE_OS_SEC_TEXT INT32 OsGetProcessPriority(INT32 which, INT32 pid) LosProcessCB *processCB = OS_PCB_FROM_PID(pid); SCHEDULER_LOCK(intSave); if (OsProcessIsUnused(processCB)) { - SCHEDULER_UNLOCK(intSave); - return -LOS_ESRCH; + prio = -LOS_ESRCH; + goto OUT; } - LosTaskCB *taskCB = processCB->threadGroup; - taskCB->ops->schedParamGet(taskCB, ¶m); - - if (param.policy == LOS_SCHED_DEADLINE) { - SCHEDULER_UNLOCK(intSave); - return -LOS_EINVAL; - } + prio = (INT32)OS_TCB_FROM_TID(processCB->threadGroupID)->basePrio; +OUT: SCHEDULER_UNLOCK(intSave); - return param.basePrio; + return prio; } LITE_OS_SEC_TEXT INT32 LOS_GetProcessPriority(INT32 pid) @@ -1202,68 +1050,42 @@ STATIC VOID OsWaitInsertWaitListInOrder(LosTaskCB *runTask, LosProcessCB *proces /* if runTask->waitFlag == OS_PROCESS_WAIT_PRO, * this node is inserted directly into the header of the waitList */ - (VOID)runTask->ops->wait(runTask, list->pstNext, LOS_WAIT_FOREVER); - return; -} -STATIC UINT32 WaitFindSpecifiedProcess(UINT32 pid, LosTaskCB *runTask, - const LosProcessCB *processCB, LosProcessCB **childCB) -{ - if (OS_PID_CHECK_INVALID((UINT32)pid)) { - return LOS_ECHILD; - } - - LosProcessCB *waitProcess = OS_PCB_FROM_PID(pid); - if (OsProcessIsUnused(waitProcess)) { - return LOS_ECHILD; - } - -#ifdef LOSCFG_PID_CONTAINER - if (OsPidContainerProcessParentIsRealParent(waitProcess, processCB)) { - *childCB = (LosProcessCB *)processCB; - return LOS_OK; - } -#endif - /* Wait for the child process whose process number is pid. */ - *childCB = OsFindExitChildProcess(processCB, waitProcess); - if (*childCB != NULL) { - return LOS_OK; - } - - if (OsFindChildProcess(processCB, waitProcess) != LOS_OK) { - return LOS_ECHILD; - } - - runTask->waitFlag = OS_PROCESS_WAIT_PRO; - runTask->waitID = (UINTPTR)waitProcess; - return LOS_OK; + (VOID)OsSchedTaskWait(list->pstNext, LOS_WAIT_FOREVER, TRUE); + return; } STATIC UINT32 OsWaitSetFlag(const LosProcessCB *processCB, INT32 pid, LosProcessCB **child) { - UINT32 ret; LosProcessCB *childCB = NULL; + ProcessGroup *group = NULL; LosTaskCB *runTask = OsCurrTaskGet(); + UINT32 ret; if (pid > 0) { - ret = WaitFindSpecifiedProcess((UINT32)pid, runTask, processCB, &childCB); - if (ret != LOS_OK) { - return ret; - } + /* Wait for the child process whose process number is pid. */ + childCB = OsFindExitChildProcess(processCB, pid); if (childCB != NULL) { goto WAIT_BACK; } + + ret = OsFindChildProcess(processCB, pid); + if (ret != LOS_OK) { + return LOS_ECHILD; + } + runTask->waitFlag = OS_PROCESS_WAIT_PRO; + runTask->waitID = pid; } else if (pid == 0) { /* Wait for any child process in the same process group */ - childCB = OsFindGroupExitProcess(processCB->pgroup, OS_INVALID_VALUE); + childCB = OsFindGroupExitProcess(processCB->group, OS_INVALID_VALUE); if (childCB != NULL) { goto WAIT_BACK; } - runTask->waitID = (UINTPTR)OS_GET_PGROUP_LEADER(processCB->pgroup); + runTask->waitID = processCB->group->groupID; runTask->waitFlag = OS_PROCESS_WAIT_GID; } else if (pid == -1) { /* Wait for any child process */ - childCB = OsFindExitChildProcess(processCB, NULL); + childCB = OsFindExitChildProcess(processCB, OS_INVALID_VALUE); if (childCB != NULL) { goto WAIT_BACK; } @@ -1271,17 +1093,17 @@ STATIC UINT32 OsWaitSetFlag(const LosProcessCB *processCB, INT32 pid, LosProcess runTask->waitFlag = OS_PROCESS_WAIT_ANY; } else { /* pid < -1 */ /* Wait for any child process whose group number is the pid absolute value. */ - ProcessGroup *pgroup = OsFindProcessGroup(-pid); - if (pgroup == NULL) { + group = OsFindProcessGroup(-pid); + if (group == NULL) { return LOS_ECHILD; } - childCB = OsFindGroupExitProcess(pgroup, OS_INVALID_VALUE); + childCB = OsFindGroupExitProcess(group, OS_INVALID_VALUE); if (childCB != NULL) { goto WAIT_BACK; } - runTask->waitID = (UINTPTR)OS_GET_PGROUP_LEADER(pgroup); + runTask->waitID = -pid; runTask->waitFlag = OS_PROCESS_WAIT_GID; } @@ -1292,8 +1114,8 @@ WAIT_BACK: STATIC UINT32 OsWaitRecycleChildProcess(const LosProcessCB *childCB, UINT32 intSave, INT32 *status, siginfo_t *info) { - ProcessGroup *pgroup = NULL; - UINT32 pid = OsGetPid(childCB); + ProcessGroup *group = NULL; + UINT32 pid = childCB->processID; UINT16 mode = childCB->processMode; INT32 exitCode = childCB->exitCode; UINT32 uid = 0; @@ -1304,7 +1126,7 @@ STATIC UINT32 OsWaitRecycleChildProcess(const LosProcessCB *childCB, UINT32 intS } #endif - OsRecycleZombiesProcess((LosProcessCB *)childCB, &pgroup); + OsRecycleZombiesProcess((LosProcessCB *)childCB, &group); SCHEDULER_UNLOCK(intSave); if (status != NULL) { @@ -1341,7 +1163,7 @@ STATIC UINT32 OsWaitRecycleChildProcess(const LosProcessCB *childCB, UINT32 intS (VOID)memcpy_s((VOID *)(info), sizeof(siginfo_t), (const VOID *)(&(tempinfo)), sizeof(siginfo_t)); } } - (VOID)LOS_MemFree(m_aucSysMem1, pgroup); + (VOID)LOS_MemFree(m_aucSysMem1, group); return pid; } @@ -1380,10 +1202,13 @@ STATIC INT32 OsWait(INT32 pid, USER INT32 *status, USER siginfo_t *info, UINT32 UINT32 ret; UINT32 intSave; LosProcessCB *childCB = NULL; + LosProcessCB *processCB = NULL; + LosTaskCB *runTask = NULL; - LosProcessCB *processCB = OsCurrProcessGet(); - LosTaskCB *runTask = OsCurrTaskGet(); SCHEDULER_LOCK(intSave); + processCB = OsCurrProcessGet(); + runTask = OsCurrTaskGet(); + ret = OsWaitChildProcessCheck(processCB, pid, &childCB); if (ret != LOS_OK) { pid = -ret; @@ -1391,15 +1216,6 @@ STATIC INT32 OsWait(INT32 pid, USER INT32 *status, USER siginfo_t *info, UINT32 } if (childCB != NULL) { -#ifdef LOSCFG_PID_CONTAINER - if (childCB == processCB) { - SCHEDULER_UNLOCK(intSave); - if (status != NULL) { - (VOID)LOS_ArchCopyToUser((VOID *)status, (const VOID *)(&ret), sizeof(INT32)); - } - return pid; - } -#endif return (INT32)OsWaitRecycleChildProcess(childCB, intSave, status, info); } @@ -1417,8 +1233,8 @@ STATIC INT32 OsWait(INT32 pid, USER INT32 *status, USER siginfo_t *info, UINT32 goto ERROR; } - childCB = (LosProcessCB *)runTask->waitID; - if (!OsProcessIsDead(childCB)) { + childCB = OS_PCB_FROM_PID(runTask->waitID); + if (!(childCB->processStatus & OS_PROCESS_STATUS_ZOMBIES)) { pid = -LOS_ESRCH; goto ERROR; } @@ -1481,45 +1297,20 @@ LITE_OS_SEC_TEXT INT32 LOS_Waitid(INT32 pid, USER siginfo_t *info, UINT32 option return OsWait(pid, NULL, info, options, NULL); } -UINT32 OsGetProcessGroupCB(UINT32 pid, UINTPTR *ppgroupLeader) -{ - UINT32 intSave; - - if (OS_PID_CHECK_INVALID(pid) || (ppgroupLeader == NULL)) { - return LOS_EINVAL; - } - - SCHEDULER_LOCK(intSave); - LosProcessCB *processCB = OS_PCB_FROM_PID(pid); - if (OsProcessIsUnused(processCB)) { - SCHEDULER_UNLOCK(intSave); - return LOS_ESRCH; - } - - *ppgroupLeader = (UINTPTR)OS_GET_PGROUP_LEADER(processCB->pgroup); - SCHEDULER_UNLOCK(intSave); - return LOS_OK; -} - -STATIC UINT32 OsSetProcessGroupCheck(const LosProcessCB *processCB, LosProcessCB *pgroupCB) +STATIC UINT32 OsSetProcessGroupCheck(const LosProcessCB *processCB, UINT32 gid) { LosProcessCB *runProcessCB = OsCurrProcessGet(); + LosProcessCB *groupProcessCB = OS_PCB_FROM_PID(gid); if (OsProcessIsInactive(processCB)) { return LOS_ESRCH; } -#ifdef LOSCFG_PID_CONTAINER - if ((processCB->processID == OS_USER_ROOT_PROCESS_ID) || OS_PROCESS_CONTAINER_CHECK(processCB, runProcessCB)) { - return LOS_EPERM; - } -#endif - - if (!OsProcessIsUserMode(processCB) || !OsProcessIsUserMode(pgroupCB)) { + if (!OsProcessIsUserMode(processCB) || !OsProcessIsUserMode(groupProcessCB)) { return LOS_EPERM; } - if (runProcessCB == processCB->parentProcess) { + if (runProcessCB->processID == processCB->parentProcessID) { if (processCB->processStatus & OS_PROCESS_FLAG_ALREADY_EXEC) { return LOS_EACCES; } @@ -1528,12 +1319,12 @@ STATIC UINT32 OsSetProcessGroupCheck(const LosProcessCB *processCB, LosProcessCB } /* Add the process to another existing process group */ - if (processCB != pgroupCB) { - if (!OsProcessIsPGroupLeader(pgroupCB)) { + if (processCB->processID != gid) { + if (!(groupProcessCB->processStatus & OS_PROCESS_FLAG_GROUP_LEADER)) { return LOS_EPERM; } - if ((pgroupCB->parentProcess != processCB->parentProcess) && (pgroupCB != processCB->parentProcess)) { + if ((groupProcessCB->parentProcessID != processCB->parentProcessID) && (gid != processCB->parentProcessID)) { return LOS_EPERM; } } @@ -1541,39 +1332,39 @@ STATIC UINT32 OsSetProcessGroupCheck(const LosProcessCB *processCB, LosProcessCB return LOS_OK; } -STATIC UINT32 OsSetProcessGroupIDUnsafe(UINT32 pid, UINT32 gid, ProcessGroup **pgroup) +STATIC UINT32 OsSetProcessGroupIDUnsafe(UINT32 pid, UINT32 gid, ProcessGroup **group) { + ProcessGroup *oldGroup = NULL; + ProcessGroup *newGroup = NULL; LosProcessCB *processCB = OS_PCB_FROM_PID(pid); - ProcessGroup *rootPGroup = OS_ROOT_PGRP(OsCurrProcessGet()); - LosProcessCB *pgroupCB = OS_PCB_FROM_PID(gid); - UINT32 ret = OsSetProcessGroupCheck(processCB, pgroupCB); + UINT32 ret = OsSetProcessGroupCheck(processCB, gid); if (ret != LOS_OK) { return ret; } - if (OS_GET_PGROUP_LEADER(processCB->pgroup) == pgroupCB) { + if (processCB->group->groupID == gid) { return LOS_OK; } - ProcessGroup *oldPGroup = processCB->pgroup; - ExitProcessGroup(processCB, pgroup); + oldGroup = processCB->group; + OsExitProcessGroup(processCB, group); - ProcessGroup *newPGroup = OsFindProcessGroup(gid); - if (newPGroup != NULL) { - LOS_ListTailInsert(&newPGroup->processList, &processCB->subordinateGroupList); - processCB->pgroup = newPGroup; + newGroup = OsFindProcessGroup(gid); + if (newGroup != NULL) { + LOS_ListTailInsert(&newGroup->processList, &processCB->subordinateGroupList); + processCB->group = newGroup; return LOS_OK; } - newPGroup = OsCreateProcessGroup(pgroupCB); - if (newPGroup == NULL) { - LOS_ListTailInsert(&oldPGroup->processList, &processCB->subordinateGroupList); - processCB->pgroup = oldPGroup; - if (*pgroup != NULL) { - LOS_ListTailInsert(&rootPGroup->groupList, &oldPGroup->groupList); - processCB = OS_GET_PGROUP_LEADER(oldPGroup); + newGroup = OsCreateProcessGroup(gid); + if (newGroup == NULL) { + LOS_ListTailInsert(&oldGroup->processList, &processCB->subordinateGroupList); + processCB->group = oldGroup; + if (*group != NULL) { + LOS_ListTailInsert(&g_processGroup->groupList, &oldGroup->groupList); + processCB = OS_PCB_FROM_PID(oldGroup->groupID); processCB->processStatus |= OS_PROCESS_FLAG_GROUP_LEADER; - *pgroup = NULL; + *group = NULL; } return LOS_EPERM; } @@ -1582,7 +1373,7 @@ STATIC UINT32 OsSetProcessGroupIDUnsafe(UINT32 pid, UINT32 gid, ProcessGroup **p LITE_OS_SEC_TEXT INT32 OsSetProcessGroupID(UINT32 pid, UINT32 gid) { - ProcessGroup *pgroup = NULL; + ProcessGroup *group = NULL; UINT32 ret; UINT32 intSave; @@ -1591,9 +1382,9 @@ LITE_OS_SEC_TEXT INT32 OsSetProcessGroupID(UINT32 pid, UINT32 gid) } SCHEDULER_LOCK(intSave); - ret = OsSetProcessGroupIDUnsafe(pid, gid, &pgroup); + ret = OsSetProcessGroupIDUnsafe(pid, gid, &group); SCHEDULER_UNLOCK(intSave); - (VOID)LOS_MemFree(m_aucSysMem1, pgroup); + (VOID)LOS_MemFree(m_aucSysMem1, group); return -ret; } @@ -1606,20 +1397,20 @@ LITE_OS_SEC_TEXT INT32 LOS_GetProcessGroupID(UINT32 pid) { INT32 gid; UINT32 intSave; + LosProcessCB *processCB = NULL; if (OS_PID_CHECK_INVALID(pid)) { return -LOS_EINVAL; } SCHEDULER_LOCK(intSave); - LosProcessCB *processCB = OS_PCB_FROM_PID(pid); + processCB = OS_PCB_FROM_PID(pid); if (OsProcessIsUnused(processCB)) { gid = -LOS_ESRCH; goto EXIT; } - processCB = OS_GET_PGROUP_LEADER(processCB->pgroup); - gid = (INT32)processCB->processID; + gid = (INT32)processCB->group->groupID; EXIT: SCHEDULER_UNLOCK(intSave); @@ -1732,10 +1523,8 @@ LITE_OS_SEC_TEXT UINT32 OsExecRecycleAndInit(LosProcessCB *processCB, const CHAR delete_files_snapshot((struct files_struct *)oldFiles); #endif -#ifdef LOSCFG_BASE_CORE_SWTMR_ENABLE - OsSwtmrRecycle((UINTPTR)processCB); + OsSwtmrRecycle(processCB->processID); processCB->timerID = (timer_t)(UINTPTR)MAX_INVALID_TIMER_VID; -#endif #ifdef LOSCFG_SECURITY_VID VidMapDestroy(processCB); @@ -1787,7 +1576,7 @@ STATIC UINT32 OsUserInitProcessStart(LosProcessCB *processCB, TSK_INIT_PARAM_S * UINT32 intSave; INT32 ret; - UINT32 taskID = OsCreateUserTask((UINTPTR)processCB, param); + UINT32 taskID = OsCreateUserTask(processCB->processID, param); if (taskID == OS_INVALID_VALUE) { return LOS_NOK; } @@ -1887,8 +1676,8 @@ LITE_OS_SEC_TEXT_INIT UINT32 OsUserInitProcess(VOID) TSK_INIT_PARAM_S param = { 0 }; VOID *stack = NULL; - LosProcessCB *processCB = OsGetUserInitProcess(); - ret = OsSystemProcessInit(processCB, OS_USER_MODE, "Init"); + LosProcessCB *processCB = OS_PCB_FROM_PID(g_userInitProcess); + ret = OsProcessCreateInit(processCB, OS_USER_MODE, "Init"); if (ret != LOS_OK) { return ret; } @@ -1936,49 +1725,47 @@ STATIC UINT32 OsCopyUser(LosProcessCB *childCB, LosProcessCB *parentCB) return LOS_OK; } -STATIC VOID GetCopyTaskParam(LosProcessCB *childProcessCB, UINTPTR entry, UINT32 size, - TSK_INIT_PARAM_S *taskParam, SchedParam *param) +STATIC VOID OsInitCopyTaskParam(LosProcessCB *childProcessCB, const CHAR *name, UINTPTR entry, UINT32 size, + TSK_INIT_PARAM_S *childPara) { + LosTaskCB *mainThread = NULL; UINT32 intSave; - LosTaskCB *runTask = OsCurrTaskGet(); SCHEDULER_LOCK(intSave); + mainThread = OsCurrTaskGet(); + if (OsProcessIsUserMode(childProcessCB)) { - taskParam->pfnTaskEntry = runTask->taskEntry; - taskParam->uwStackSize = runTask->stackSize; - taskParam->userParam.userArea = runTask->userArea; - taskParam->userParam.userMapBase = runTask->userMapBase; - taskParam->userParam.userMapSize = runTask->userMapSize; + childPara->pfnTaskEntry = mainThread->taskEntry; + childPara->uwStackSize = mainThread->stackSize; + childPara->userParam.userArea = mainThread->userArea; + childPara->userParam.userMapBase = mainThread->userMapBase; + childPara->userParam.userMapSize = mainThread->userMapSize; } else { - taskParam->pfnTaskEntry = (TSK_ENTRY_FUNC)entry; - taskParam->uwStackSize = size; + childPara->pfnTaskEntry = (TSK_ENTRY_FUNC)entry; + childPara->uwStackSize = size; } - if (runTask->taskStatus & OS_TASK_FLAG_PTHREAD_JOIN) { - taskParam->uwResved = LOS_TASK_ATTR_JOINABLE; + childPara->pcName = (CHAR *)name; + childPara->policy = mainThread->policy; + childPara->usTaskPrio = mainThread->priority; + childPara->processID = childProcessCB->processID; + if (mainThread->taskStatus & OS_TASK_FLAG_PTHREAD_JOIN) { + childPara->uwResved = LOS_TASK_ATTR_JOINABLE; } - runTask->ops->schedParamGet(runTask, param); SCHEDULER_UNLOCK(intSave); - - taskParam->policy = param->policy; - taskParam->runTimeUs = param->runTimeUs; - taskParam->deadlineUs = param->deadlineUs; - taskParam->periodUs = param->periodUs; - taskParam->usTaskPrio = param->priority; - taskParam->processID = (UINTPTR)childProcessCB; } STATIC UINT32 OsCopyTask(UINT32 flags, LosProcessCB *childProcessCB, const CHAR *name, UINTPTR entry, UINT32 size) { LosTaskCB *runTask = OsCurrTaskGet(); - TSK_INIT_PARAM_S taskParam = { 0 }; - UINT32 ret, taskID, intSave; - SchedParam param = { 0 }; + TSK_INIT_PARAM_S childPara = { 0 }; + UINT32 ret; + UINT32 intSave; + UINT32 taskID; - taskParam.pcName = (CHAR *)name; - GetCopyTaskParam(childProcessCB, entry, size, &taskParam, ¶m); + OsInitCopyTaskParam(childProcessCB, name, entry, size, &childPara); - ret = LOS_TaskCreateOnly(&taskID, &taskParam); + ret = LOS_TaskCreateOnly(&taskID, &childPara); if (ret != LOS_OK) { if (ret == LOS_ERRNO_TSK_TCB_UNAVAILABLE) { return LOS_EAGAIN; @@ -1986,9 +1773,9 @@ STATIC UINT32 OsCopyTask(UINT32 flags, LosProcessCB *childProcessCB, const CHAR return LOS_ENOMEM; } - LosTaskCB *childTaskCB = childProcessCB->threadGroup; + LosTaskCB *childTaskCB = OS_TCB_FROM_TID(taskID); childTaskCB->taskStatus = runTask->taskStatus; - childTaskCB->ops->schedParamModify(childTaskCB, ¶m); + childTaskCB->basePrio = runTask->basePrio; if (childTaskCB->taskStatus & OS_TASK_STATUS_RUNNING) { childTaskCB->taskStatus &= ~OS_TASK_STATUS_RUNNING; } else { @@ -2000,7 +1787,7 @@ STATIC UINT32 OsCopyTask(UINT32 flags, LosProcessCB *childProcessCB, const CHAR if (OsProcessIsUserMode(childProcessCB)) { SCHEDULER_LOCK(intSave); - OsUserCloneParentStack(childTaskCB->stackPointer, entry, runTask->topOfStack, runTask->stackSize); + OsUserCloneParentStack(childTaskCB->stackPointer, runTask->topOfStack, runTask->stackSize); SCHEDULER_UNLOCK(intSave); } return LOS_OK; @@ -2008,26 +1795,25 @@ STATIC UINT32 OsCopyTask(UINT32 flags, LosProcessCB *childProcessCB, const CHAR STATIC UINT32 OsCopyParent(UINT32 flags, LosProcessCB *childProcessCB, LosProcessCB *runProcessCB) { + UINT32 ret; UINT32 intSave; LosProcessCB *parentProcessCB = NULL; SCHEDULER_LOCK(intSave); - if (childProcessCB->parentProcess == NULL) { - if (flags & CLONE_PARENT) { - parentProcessCB = runProcessCB->parentProcess; - } else { - parentProcessCB = runProcessCB; - } - childProcessCB->parentProcess = parentProcessCB; - LOS_ListTailInsert(&parentProcessCB->childrenList, &childProcessCB->siblingList); - } - if (childProcessCB->pgroup == NULL) { - childProcessCB->pgroup = parentProcessCB->pgroup; - LOS_ListTailInsert(&parentProcessCB->pgroup->processList, &childProcessCB->subordinateGroupList); + if (flags & CLONE_PARENT) { + parentProcessCB = OS_PCB_FROM_PID(runProcessCB->parentProcessID); + } else { + parentProcessCB = runProcessCB; } + childProcessCB->parentProcessID = parentProcessCB->processID; + LOS_ListTailInsert(&parentProcessCB->childrenList, &childProcessCB->siblingList); + childProcessCB->group = parentProcessCB->group; + LOS_ListTailInsert(&parentProcessCB->group->processList, &childProcessCB->subordinateGroupList); + ret = OsCopyUser(childProcessCB, parentProcessCB); + SCHEDULER_UNLOCK(intSave); - return LOS_OK; + return ret; } STATIC UINT32 OsCopyMM(UINT32 flags, LosProcessCB *childProcessCB, LosProcessCB *runProcessCB) @@ -2047,7 +1833,7 @@ STATIC UINT32 OsCopyMM(UINT32 flags, LosProcessCB *childProcessCB, LosProcessCB return LOS_OK; } - status = LOS_VmSpaceClone(flags, runProcessCB->vmSpace, childProcessCB->vmSpace); + status = LOS_VmSpaceClone(runProcessCB->vmSpace, childProcessCB->vmSpace); if (status != LOS_OK) { return LOS_ENOMEM; } @@ -2060,27 +1846,11 @@ STATIC UINT32 OsCopyFile(UINT32 flags, LosProcessCB *childProcessCB, LosProcessC if (flags & CLONE_FILES) { childProcessCB->files = runProcessCB->files; } else { -#ifdef LOSCFG_IPC_CONTAINER - if (flags & CLONE_NEWIPC) { - OsCurrTaskGet()->cloneIpc = TRUE; - } -#endif childProcessCB->files = dup_fd(runProcessCB->files); -#ifdef LOSCFG_IPC_CONTAINER - OsCurrTaskGet()->cloneIpc = FALSE; -#endif } if (childProcessCB->files == NULL) { return LOS_ENOMEM; } - -#ifdef LOSCFG_PROC_PROCESS_DIR - INT32 ret = ProcCreateProcessDir(OsGetRootPid(childProcessCB), (UINTPTR)childProcessCB); - if (ret < 0) { - PRINT_ERR("ProcCreateProcessDir failed, pid = %u\n", childProcessCB->processID); - return LOS_EBADF; - } -#endif #endif childProcessCB->consoleID = runProcessCB->consoleID; @@ -2093,6 +1863,11 @@ STATIC UINT32 OsForkInitPCB(UINT32 flags, LosProcessCB *child, const CHAR *name, UINT32 ret; LosProcessCB *run = OsCurrProcessGet(); + ret = OsInitPCB(child, run->processMode, name); + if (ret != LOS_OK) { + return ret; + } + ret = OsCopyParent(flags, child, run); if (ret != LOS_OK) { return ret; @@ -2105,11 +1880,11 @@ STATIC UINT32 OsChildSetProcessGroupAndSched(LosProcessCB *child, LosProcessCB * { UINT32 intSave; UINT32 ret; - ProcessGroup *pgroup = NULL; + ProcessGroup *group = NULL; SCHEDULER_LOCK(intSave); - if ((UINTPTR)OS_GET_PGROUP_LEADER(run->pgroup) == OS_USER_PRIVILEGE_PROCESS_GROUP) { - ret = OsSetProcessGroupIDUnsafe(child->processID, child->processID, &pgroup); + if (run->group->groupID == OS_USER_PRIVILEGE_PROCESS_GROUP) { + ret = OsSetProcessGroupIDUnsafe(child->processID, child->processID, &group); if (ret != LOS_OK) { SCHEDULER_UNLOCK(intSave); return LOS_ENOMEM; @@ -2117,11 +1892,10 @@ STATIC UINT32 OsChildSetProcessGroupAndSched(LosProcessCB *child, LosProcessCB * } child->processStatus &= ~OS_PROCESS_STATUS_INIT; - LosTaskCB *taskCB = child->threadGroup; - taskCB->ops->enqueue(OsSchedRunqueue(), taskCB); + OsSchedTaskEnQueue(OS_TCB_FROM_TID(child->threadGroupID)); SCHEDULER_UNLOCK(intSave); - (VOID)LOS_MemFree(m_aucSysMem1, pgroup); + (VOID)LOS_MemFree(m_aucSysMem1, group); return LOS_OK; } @@ -2129,11 +1903,6 @@ STATIC UINT32 OsCopyProcessResources(UINT32 flags, LosProcessCB *child, LosProce { UINT32 ret; - ret = OsCopyUser(child, run); - if (ret != LOS_OK) { - return ret; - } - ret = OsCopyMM(flags, child, run); if (ret != LOS_OK) { return ret; @@ -2156,6 +1925,7 @@ STATIC UINT32 OsCopyProcessResources(UINT32 flags, LosProcessCB *child, LosProce #ifdef LOSCFG_SECURITY_CAPABILITY OsCopyCapability(run, child); #endif + return LOS_OK; } @@ -2170,25 +1940,6 @@ STATIC INT32 OsCopyProcess(UINT32 flags, const CHAR *name, UINTPTR sp, UINT32 si } processID = child->processID; - ret = OsInitPCB(child, run->processMode, name); - if (ret != LOS_OK) { - goto ERROR_INIT; - } - -#ifdef LOSCFG_KERNEL_CONTAINER - ret = OsCopyContainers(flags, child, run, &processID); - if (ret != LOS_OK) { - goto ERROR_INIT; - } - -#ifdef LOSCFG_KERNEL_PLIMITS - ret = OsPLimitsAddProcess(run->plimits, child); - if (ret != LOS_OK) { - goto ERROR_INIT; - } -#endif -#endif - ret = OsForkInitPCB(flags, child, name, sp, size); if (ret != LOS_OK) { goto ERROR_INIT; @@ -2212,7 +1963,7 @@ STATIC INT32 OsCopyProcess(UINT32 flags, const CHAR *name, UINTPTR sp, UINT32 si return processID; ERROR_TASK: - (VOID)LOS_TaskDelete(child->threadGroup->taskID); + (VOID)LOS_TaskDelete(child->threadGroupID); ERROR_INIT: OsDeInitPCB(child); return -ret; @@ -2220,48 +1971,10 @@ ERROR_INIT: LITE_OS_SEC_TEXT INT32 OsClone(UINT32 flags, UINTPTR sp, UINT32 size) { - UINT32 cloneFlag = CLONE_PARENT | CLONE_THREAD | SIGCHLD; -#ifdef LOSCFG_KERNEL_CONTAINER -#ifdef LOSCFG_PID_CONTAINER - cloneFlag |= CLONE_NEWPID; - LosProcessCB *curr = OsCurrProcessGet(); - if (((flags & CLONE_NEWPID) != 0) && ((flags & (CLONE_PARENT | CLONE_THREAD)) != 0)) { - return -LOS_EINVAL; - } - - if (OS_PROCESS_PID_FOR_CONTAINER_CHECK(curr) && ((flags & CLONE_NEWPID) != 0)) { - return -LOS_EINVAL; - } - - if (OS_PROCESS_PID_FOR_CONTAINER_CHECK(curr) && ((flags & (CLONE_PARENT | CLONE_THREAD)) != 0)) { - return -LOS_EINVAL; - } -#endif -#ifdef LOSCFG_UTS_CONTAINER - cloneFlag |= CLONE_NEWUTS; -#endif -#ifdef LOSCFG_MNT_CONTAINER - cloneFlag |= CLONE_NEWNS; -#endif -#ifdef LOSCFG_IPC_CONTAINER - cloneFlag |= CLONE_NEWIPC; - if (((flags & CLONE_NEWIPC) != 0) && ((flags & CLONE_FILES) != 0)) { - return -LOS_EINVAL; - } -#endif -#ifdef LOSCFG_TIME_CONTAINER - cloneFlag |= CLONE_NEWTIME; -#endif -#ifdef LOSCFG_USER_CONTAINER - cloneFlag |= CLONE_NEWUSER; -#endif -#ifdef LOSCFG_NET_CONTAINER - cloneFlag |= CLONE_NEWNET; -#endif -#endif + UINT32 cloneFlag = CLONE_PARENT | CLONE_THREAD | CLONE_VFORK | CLONE_VM; if (flags & (~cloneFlag)) { - return -LOS_EOPNOTSUPP; + PRINT_WARN("Clone dont support some flags!\n"); } return OsCopyProcess(cloneFlag & flags, NULL, sp, size); @@ -2335,12 +2048,14 @@ LITE_OS_SEC_TEXT INT32 LOS_GetUsedPIDList(UINT32 *pidList, INT32 pidMaxNum) #ifdef LOSCFG_FS_VFS LITE_OS_SEC_TEXT struct fd_table_s *LOS_GetFdTable(UINT32 pid) { + LosProcessCB *pcb = NULL; + struct files_struct *files = NULL; + if (OS_PID_CHECK_INVALID(pid)) { return NULL; } - - LosProcessCB *pcb = OS_PCB_FROM_PID(pid); - struct files_struct *files = pcb->files; + pcb = OS_PCB_FROM_PID(pid); + files = pcb->files; if (files == NULL) { return NULL; } @@ -2358,7 +2073,7 @@ LITE_OS_SEC_TEXT UINT32 LOS_GetCurrProcessID(VOID) STATIC VOID ThreadGroupActiveTaskKilled(LosTaskCB *taskCB) { INT32 ret; - LosProcessCB *processCB = OS_PCB_FROM_TCB(taskCB); + taskCB->taskStatus |= OS_TASK_FLAG_EXIT_KILL; #ifdef LOSCFG_KERNEL_SMP /** The other core that the thread is running on and is currently running in a non-system call */ @@ -2371,7 +2086,7 @@ STATIC VOID ThreadGroupActiveTaskKilled(LosTaskCB *taskCB) ret = OsTaskKillUnsafe(taskCB->taskID, SIGKILL); if (ret != LOS_OK) { PRINT_ERR("pid %u exit, Exit task group %u kill %u failed! ERROR: %d\n", - processCB->processID, OsCurrTaskGet()->taskID, taskCB->taskID, ret); + taskCB->processID, OsCurrTaskGet()->taskID, taskCB->taskID, ret); } } @@ -2383,7 +2098,7 @@ STATIC VOID ThreadGroupActiveTaskKilled(LosTaskCB *taskCB) ret = OsTaskJoinPendUnsafe(taskCB); if (ret != LOS_OK) { PRINT_ERR("pid %u exit, Exit task group %u to wait others task %u(0x%x) exit failed! ERROR: %d\n", - processCB->processID, OsCurrTaskGet()->taskID, taskCB->taskID, taskCB->taskStatus, ret); + taskCB->processID, OsCurrTaskGet()->taskID, taskCB->taskID, taskCB->taskStatus, ret); } } #endif @@ -2402,7 +2117,7 @@ LITE_OS_SEC_TEXT VOID OsProcessThreadGroupDestroy(VOID) } processCB->processStatus |= OS_PROCESS_FLAG_EXIT; - processCB->threadGroup = currTask; + processCB->threadGroupID = currTask->taskID; LOS_DL_LIST *list = &processCB->threadSiblingList; LOS_DL_LIST *head = list; @@ -2432,19 +2147,19 @@ LITE_OS_SEC_TEXT UINT32 LOS_GetSystemProcessMaximum(VOID) return g_processMaxNum; } -LITE_OS_SEC_TEXT LosProcessCB *OsGetUserInitProcess(VOID) +LITE_OS_SEC_TEXT UINT32 OsGetUserInitProcessID(VOID) { - return &g_processCBArray[OS_USER_ROOT_PROCESS_ID]; + return g_userInitProcess; } -LITE_OS_SEC_TEXT LosProcessCB *OsGetKernelInitProcess(VOID) +LITE_OS_SEC_TEXT UINT32 OsGetKernelInitProcessID(VOID) { - return &g_processCBArray[OS_KERNEL_ROOT_PROCESS_ID]; + return g_kernelInitProcess; } -LITE_OS_SEC_TEXT LosProcessCB *OsGetIdleProcess(VOID) +LITE_OS_SEC_TEXT UINT32 OsGetIdleProcessID(VOID) { - return &g_processCBArray[OS_KERNEL_IDLE_PROCESS_ID]; + return g_kernelIdleProcess; } LITE_OS_SEC_TEXT VOID OsSetSigHandler(UINTPTR addr) @@ -2457,7 +2172,3 @@ LITE_OS_SEC_TEXT UINTPTR OsGetSigHandler(VOID) return OsCurrProcessGet()->sigHandler; } -LosProcessCB *OsGetDefaultProcessCB(VOID) -{ - return &g_processCBArray[g_processMaxNum]; -} diff --git a/src/kernel_liteos_a/kernel/base/core/los_smp.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/core/los_smp.c similarity index 94% rename from src/kernel_liteos_a/kernel/base/core/los_smp.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/core/los_smp.c index bbeb9c22..01b919a6 100644 --- a/src/kernel_liteos_a/kernel/base/core/los_smp.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/core/los_smp.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2023 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -45,13 +45,11 @@ STATIC VOID OsSmpSecondaryInit(VOID *arg) { UNUSED(arg); - OsCurrTaskSet(OsGetMainTask()); - #ifdef LOSCFG_BASE_CORE_SWTMR_ENABLE OsSwtmrInit(); #endif - OsIdleTaskCreate((UINTPTR)OsGetIdleProcess()); + OsIdleTaskCreate(); OsInitCall(LOS_INIT_LEVEL_KMOD_TASK); OsSchedStart(); diff --git a/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/core/los_swtmr.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/core/los_swtmr.c new file mode 100644 index 00000000..5378633e --- /dev/null +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/core/los_swtmr.c @@ -0,0 +1,529 @@ +/* + * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. + * + * 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. + */ + +#include "los_swtmr_pri.h" +#include "los_init.h" +#include "los_process_pri.h" +#include "los_queue_pri.h" +#include "los_sched_pri.h" +#include "los_sortlink_pri.h" +#include "los_task_pri.h" +#include "los_hook.h" + +#ifdef LOSCFG_BASE_CORE_SWTMR_ENABLE +#if (LOSCFG_BASE_CORE_SWTMR_LIMIT <= 0) +#error "swtmr maxnum cannot be zero" +#endif /* LOSCFG_BASE_CORE_SWTMR_LIMIT <= 0 */ + +LITE_OS_SEC_BSS SWTMR_CTRL_S *g_swtmrCBArray = NULL; /* First address in Timer memory space */ +LITE_OS_SEC_BSS UINT8 *g_swtmrHandlerPool = NULL; /* Pool of Swtmr Handler */ +LITE_OS_SEC_BSS LOS_DL_LIST g_swtmrFreeList; /* Free list of Software Timer */ + +/* spinlock for swtmr module, only available on SMP mode */ +LITE_OS_SEC_BSS SPIN_LOCK_INIT(g_swtmrSpin); +#define SWTMR_LOCK(state) LOS_SpinLockSave(&g_swtmrSpin, &(state)) +#define SWTMR_UNLOCK(state) LOS_SpinUnlockRestore(&g_swtmrSpin, (state)) + +STATIC VOID SwtmrTask(VOID) +{ + SwtmrHandlerItemPtr swtmrHandlePtr = NULL; + SwtmrHandlerItem swtmrHandle; + UINT32 ret, swtmrHandlerQueue; + + swtmrHandlerQueue = OsSchedSwtmrHandlerQueueGet(); + for (;;) { + ret = LOS_QueueRead(swtmrHandlerQueue, &swtmrHandlePtr, sizeof(CHAR *), LOS_WAIT_FOREVER); + if ((ret == LOS_OK) && (swtmrHandlePtr != NULL)) { + swtmrHandle.handler = swtmrHandlePtr->handler; + swtmrHandle.arg = swtmrHandlePtr->arg; + (VOID)LOS_MemboxFree(g_swtmrHandlerPool, swtmrHandlePtr); + if (swtmrHandle.handler != NULL) { + swtmrHandle.handler(swtmrHandle.arg); + } + } + } +} + +STATIC UINT32 SwtmrTaskCreate(UINT16 cpuid, UINT32 *swtmrTaskID) +{ + UINT32 ret; + TSK_INIT_PARAM_S swtmrTask; + + (VOID)memset_s(&swtmrTask, sizeof(TSK_INIT_PARAM_S), 0, sizeof(TSK_INIT_PARAM_S)); + swtmrTask.pfnTaskEntry = (TSK_ENTRY_FUNC)SwtmrTask; + swtmrTask.uwStackSize = LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE; + swtmrTask.pcName = "Swt_Task"; + swtmrTask.usTaskPrio = 0; + swtmrTask.uwResved = LOS_TASK_STATUS_DETACHED; +#ifdef LOSCFG_KERNEL_SMP + swtmrTask.usCpuAffiMask = CPUID_TO_AFFI_MASK(cpuid); +#endif + ret = LOS_TaskCreate(swtmrTaskID, &swtmrTask); + if (ret == LOS_OK) { + OS_TCB_FROM_TID(*swtmrTaskID)->taskStatus |= OS_TASK_FLAG_SYSTEM_TASK; + } + + return ret; +} + +BOOL OsIsSwtmrTask(const LosTaskCB *taskCB) +{ + if (taskCB->taskEntry == (TSK_ENTRY_FUNC)SwtmrTask) { + return TRUE; + } + return FALSE; +} + +LITE_OS_SEC_TEXT_INIT VOID OsSwtmrRecycle(UINT32 processID) +{ + for (UINT16 index = 0; index < LOSCFG_BASE_CORE_SWTMR_LIMIT; index++) { + if (g_swtmrCBArray[index].uwOwnerPid == processID) { + LOS_SwtmrDelete(index); + } + } +} + +LITE_OS_SEC_TEXT_INIT UINT32 OsSwtmrInit(VOID) +{ + UINT32 size; + UINT16 index; + UINT32 ret; + SWTMR_CTRL_S *swtmr = NULL; + UINT32 swtmrHandlePoolSize; + UINT32 cpuid = ArchCurrCpuid(); + UINT32 swtmrTaskID, swtmrHandlerQueue; + + if (cpuid == 0) { + size = sizeof(SWTMR_CTRL_S) * LOSCFG_BASE_CORE_SWTMR_LIMIT; + swtmr = (SWTMR_CTRL_S *)LOS_MemAlloc(m_aucSysMem0, size); /* system resident resource */ + if (swtmr == NULL) { + ret = LOS_ERRNO_SWTMR_NO_MEMORY; + goto ERROR; + } + + (VOID)memset_s(swtmr, size, 0, size); + g_swtmrCBArray = swtmr; + LOS_ListInit(&g_swtmrFreeList); + for (index = 0; index < LOSCFG_BASE_CORE_SWTMR_LIMIT; index++, swtmr++) { + swtmr->usTimerID = index; + LOS_ListTailInsert(&g_swtmrFreeList, &swtmr->stSortList.sortLinkNode); + } + + swtmrHandlePoolSize = LOS_MEMBOX_SIZE(sizeof(SwtmrHandlerItem), OS_SWTMR_HANDLE_QUEUE_SIZE); + + g_swtmrHandlerPool = (UINT8 *)LOS_MemAlloc(m_aucSysMem1, swtmrHandlePoolSize); /* system resident resource */ + if (g_swtmrHandlerPool == NULL) { + ret = LOS_ERRNO_SWTMR_NO_MEMORY; + goto ERROR; + } + + ret = LOS_MemboxInit(g_swtmrHandlerPool, swtmrHandlePoolSize, sizeof(SwtmrHandlerItem)); + if (ret != LOS_OK) { + ret = LOS_ERRNO_SWTMR_HANDLER_POOL_NO_MEM; + goto ERROR; + } + } + + ret = LOS_QueueCreate(NULL, OS_SWTMR_HANDLE_QUEUE_SIZE, &swtmrHandlerQueue, 0, sizeof(CHAR *)); + if (ret != LOS_OK) { + ret = LOS_ERRNO_SWTMR_QUEUE_CREATE_FAILED; + goto ERROR; + } + + ret = SwtmrTaskCreate(cpuid, &swtmrTaskID); + if (ret != LOS_OK) { + ret = LOS_ERRNO_SWTMR_TASK_CREATE_FAILED; + goto ERROR; + } + + OsSchedRunQueSwtmrInit(swtmrTaskID, swtmrHandlerQueue); + return LOS_OK; + +ERROR: + (VOID)LOS_MemFree(m_aucSysMem0, g_swtmrCBArray); + g_swtmrCBArray = NULL; + (VOID)LOS_MemFree(m_aucSysMem1, g_swtmrHandlerPool); + g_swtmrHandlerPool = NULL; + PRINT_ERR("OsSwtmrInit error! ret = %u\n", ret); + return ret; +} + +/* + * Description: Start Software Timer + * Input : swtmr --- Need to start software timer + */ +LITE_OS_SEC_TEXT VOID OsSwtmrStart(SWTMR_CTRL_S *swtmr) +{ + UINT32 ticks; + + if ((swtmr->uwOverrun == 0) && ((swtmr->ucMode == LOS_SWTMR_MODE_ONCE) || + (swtmr->ucMode == LOS_SWTMR_MODE_OPP) || + (swtmr->ucMode == LOS_SWTMR_MODE_NO_SELFDELETE))) { + ticks = swtmr->uwExpiry; + } else { + ticks = swtmr->uwInterval; + } + swtmr->ucState = OS_SWTMR_STATUS_TICKING; + + OsSchedAddSwtmr2TimeList(&swtmr->stSortList, swtmr->startTime, ticks); + OsSchedUpdateExpireTime(); + return; +} + +/* + * Description: Delete Software Timer + * Input : swtmr --- Need to delete software timer, When using, Ensure that it can't be NULL. + */ +STATIC INLINE VOID OsSwtmrDelete(SWTMR_CTRL_S *swtmr) +{ + /* insert to free list */ + LOS_ListTailInsert(&g_swtmrFreeList, &swtmr->stSortList.sortLinkNode); + swtmr->ucState = OS_SWTMR_STATUS_UNUSED; + swtmr->uwOwnerPid = 0; +} + +VOID OsSwtmrWake(SchedRunQue *rq, UINT64 startTime, SortLinkList *sortList) +{ + SWTMR_CTRL_S *swtmr = LOS_DL_LIST_ENTRY(sortList, SWTMR_CTRL_S, stSortList); + + OsHookCall(LOS_HOOK_TYPE_SWTMR_EXPIRED, swtmr); + LOS_SpinLock(&g_swtmrSpin); + SwtmrHandlerItemPtr swtmrHandler = (SwtmrHandlerItemPtr)LOS_MemboxAlloc(g_swtmrHandlerPool); + if (swtmrHandler != NULL) { + swtmrHandler->handler = swtmr->pfnHandler; + swtmrHandler->arg = swtmr->uwArg; + + if (LOS_QueueWrite(rq->swtmrHandlerQueue, swtmrHandler, sizeof(CHAR *), LOS_NO_WAIT)) { + (VOID)LOS_MemboxFree(g_swtmrHandlerPool, swtmrHandler); + } + } + + if (swtmr->ucMode == LOS_SWTMR_MODE_ONCE) { + OsSwtmrDelete(swtmr); + + if (swtmr->usTimerID < (OS_SWTMR_MAX_TIMERID - LOSCFG_BASE_CORE_SWTMR_LIMIT)) { + swtmr->usTimerID += LOSCFG_BASE_CORE_SWTMR_LIMIT; + } else { + swtmr->usTimerID %= LOSCFG_BASE_CORE_SWTMR_LIMIT; + } + } else if (swtmr->ucMode == LOS_SWTMR_MODE_NO_SELFDELETE) { + swtmr->ucState = OS_SWTMR_STATUS_CREATED; + } else { + swtmr->uwOverrun++; + swtmr->startTime = startTime; + OsSwtmrStart(swtmr); + } + + LOS_SpinUnlock(&g_swtmrSpin); +} + +VOID OsSwtmrRestart(UINT64 startTime, SortLinkList *sortList) +{ + UINT32 intSave; + + SWTMR_CTRL_S *swtmr = LOS_DL_LIST_ENTRY(sortList, SWTMR_CTRL_S, stSortList); + SWTMR_LOCK(intSave); + swtmr->startTime = startTime; + OsSwtmrStart(swtmr); + SWTMR_UNLOCK(intSave); +} + +BOOL OsSwtmrWorkQueueFind(SCHED_TL_FIND_FUNC checkFunc, UINTPTR arg) +{ + UINT32 intSave; + + SWTMR_LOCK(intSave); + BOOL find = OsSchedSwtmrTimeListFind(checkFunc, arg); + SWTMR_UNLOCK(intSave); + return find; +} + +/* + * Description: Get next timeout + * Return : Count of the Timer list + */ +LITE_OS_SEC_TEXT UINT32 OsSwtmrGetNextTimeout(VOID) +{ + UINT64 currTime = OsGetCurrSchedTimeCycle(); + UINT64 time = (OsSortLinkGetNextExpireTime(currTime, &OsSchedRunQue()->swtmrSortLink) / OS_CYCLE_PER_TICK); + if (time > OS_INVALID_VALUE) { + time = OS_INVALID_VALUE; + } + return (UINT32)time; +} + +/* + * Description: Stop of Software Timer interface + * Input : swtmr --- the software timer control handler + */ +LITE_OS_SEC_TEXT STATIC VOID OsSwtmrStop(SWTMR_CTRL_S *swtmr) +{ + OsSchedDeSwtmrFromTimeList(&swtmr->stSortList); + + swtmr->ucState = OS_SWTMR_STATUS_CREATED; + swtmr->uwOverrun = 0; + + OsSchedUpdateExpireTime(); +} + +/* + * Description: Get next software timer expiretime + * Input : swtmr --- the software timer control handler + */ +LITE_OS_SEC_TEXT STATIC UINT32 OsSwtmrTimeGet(const SWTMR_CTRL_S *swtmr) +{ + UINT64 currTime = OsGetCurrSchedTimeCycle(); + UINT64 time = (OsSortLinkGetTargetExpireTime(currTime, &swtmr->stSortList) / OS_CYCLE_PER_TICK); + if (time > OS_INVALID_VALUE) { + time = OS_INVALID_VALUE; + } + return (UINT32)time; +} + +LITE_OS_SEC_TEXT_INIT UINT32 LOS_SwtmrCreate(UINT32 interval, + UINT8 mode, + SWTMR_PROC_FUNC handler, + UINT16 *swtmrID, + UINTPTR arg) +{ + SWTMR_CTRL_S *swtmr = NULL; + UINT32 intSave; + SortLinkList *sortList = NULL; + + if (interval == 0) { + return LOS_ERRNO_SWTMR_INTERVAL_NOT_SUITED; + } + + if ((mode != LOS_SWTMR_MODE_ONCE) && (mode != LOS_SWTMR_MODE_PERIOD) && + (mode != LOS_SWTMR_MODE_NO_SELFDELETE)) { + return LOS_ERRNO_SWTMR_MODE_INVALID; + } + + if (handler == NULL) { + return LOS_ERRNO_SWTMR_PTR_NULL; + } + + if (swtmrID == NULL) { + return LOS_ERRNO_SWTMR_RET_PTR_NULL; + } + + SWTMR_LOCK(intSave); + if (LOS_ListEmpty(&g_swtmrFreeList)) { + SWTMR_UNLOCK(intSave); + return LOS_ERRNO_SWTMR_MAXSIZE; + } + + sortList = LOS_DL_LIST_ENTRY(g_swtmrFreeList.pstNext, SortLinkList, sortLinkNode); + swtmr = LOS_DL_LIST_ENTRY(sortList, SWTMR_CTRL_S, stSortList); + LOS_ListDelete(LOS_DL_LIST_FIRST(&g_swtmrFreeList)); + SWTMR_UNLOCK(intSave); + + swtmr->uwOwnerPid = OsCurrProcessGet()->processID; + swtmr->pfnHandler = handler; + swtmr->ucMode = mode; + swtmr->uwOverrun = 0; + swtmr->uwInterval = interval; + swtmr->uwExpiry = interval; + swtmr->uwArg = arg; + swtmr->ucState = OS_SWTMR_STATUS_CREATED; + SET_SORTLIST_VALUE(&swtmr->stSortList, OS_SORT_LINK_INVALID_TIME); + *swtmrID = swtmr->usTimerID; + OsHookCall(LOS_HOOK_TYPE_SWTMR_CREATE, swtmr); + return LOS_OK; +} + +LITE_OS_SEC_TEXT UINT32 LOS_SwtmrStart(UINT16 swtmrID) +{ + SWTMR_CTRL_S *swtmr = NULL; + UINT32 intSave; + UINT32 ret = LOS_OK; + UINT16 swtmrCBID; + + if (swtmrID >= OS_SWTMR_MAX_TIMERID) { + return LOS_ERRNO_SWTMR_ID_INVALID; + } + + swtmrCBID = swtmrID % LOSCFG_BASE_CORE_SWTMR_LIMIT; + swtmr = g_swtmrCBArray + swtmrCBID; + + SWTMR_LOCK(intSave); + if (swtmr->usTimerID != swtmrID) { + SWTMR_UNLOCK(intSave); + return LOS_ERRNO_SWTMR_ID_INVALID; + } + + switch (swtmr->ucState) { + case OS_SWTMR_STATUS_UNUSED: + ret = LOS_ERRNO_SWTMR_NOT_CREATED; + break; + /* + * If the status of swtmr is timing, it should stop the swtmr first, + * then start the swtmr again. + */ + case OS_SWTMR_STATUS_TICKING: + OsSwtmrStop(swtmr); + /* fall-through */ + case OS_SWTMR_STATUS_CREATED: + swtmr->startTime = OsGetCurrSchedTimeCycle(); + OsSwtmrStart(swtmr); + break; + default: + ret = LOS_ERRNO_SWTMR_STATUS_INVALID; + break; + } + + SWTMR_UNLOCK(intSave); + OsHookCall(LOS_HOOK_TYPE_SWTMR_START, swtmr); + return ret; +} + +LITE_OS_SEC_TEXT UINT32 LOS_SwtmrStop(UINT16 swtmrID) +{ + SWTMR_CTRL_S *swtmr = NULL; + UINT32 intSave; + UINT32 ret = LOS_OK; + UINT16 swtmrCBID; + + if (swtmrID >= OS_SWTMR_MAX_TIMERID) { + return LOS_ERRNO_SWTMR_ID_INVALID; + } + + swtmrCBID = swtmrID % LOSCFG_BASE_CORE_SWTMR_LIMIT; + swtmr = g_swtmrCBArray + swtmrCBID; + SWTMR_LOCK(intSave); + + if (swtmr->usTimerID != swtmrID) { + SWTMR_UNLOCK(intSave); + return LOS_ERRNO_SWTMR_ID_INVALID; + } + + switch (swtmr->ucState) { + case OS_SWTMR_STATUS_UNUSED: + ret = LOS_ERRNO_SWTMR_NOT_CREATED; + break; + case OS_SWTMR_STATUS_CREATED: + ret = LOS_ERRNO_SWTMR_NOT_STARTED; + break; + case OS_SWTMR_STATUS_TICKING: + OsSwtmrStop(swtmr); + break; + default: + ret = LOS_ERRNO_SWTMR_STATUS_INVALID; + break; + } + + SWTMR_UNLOCK(intSave); + OsHookCall(LOS_HOOK_TYPE_SWTMR_STOP, swtmr); + return ret; +} + +LITE_OS_SEC_TEXT UINT32 LOS_SwtmrTimeGet(UINT16 swtmrID, UINT32 *tick) +{ + SWTMR_CTRL_S *swtmr = NULL; + UINT32 intSave; + UINT32 ret = LOS_OK; + UINT16 swtmrCBID; + + if (swtmrID >= OS_SWTMR_MAX_TIMERID) { + return LOS_ERRNO_SWTMR_ID_INVALID; + } + + if (tick == NULL) { + return LOS_ERRNO_SWTMR_TICK_PTR_NULL; + } + + swtmrCBID = swtmrID % LOSCFG_BASE_CORE_SWTMR_LIMIT; + swtmr = g_swtmrCBArray + swtmrCBID; + SWTMR_LOCK(intSave); + + if (swtmr->usTimerID != swtmrID) { + SWTMR_UNLOCK(intSave); + return LOS_ERRNO_SWTMR_ID_INVALID; + } + switch (swtmr->ucState) { + case OS_SWTMR_STATUS_UNUSED: + ret = LOS_ERRNO_SWTMR_NOT_CREATED; + break; + case OS_SWTMR_STATUS_CREATED: + ret = LOS_ERRNO_SWTMR_NOT_STARTED; + break; + case OS_SWTMR_STATUS_TICKING: + *tick = OsSwtmrTimeGet(swtmr); + break; + default: + ret = LOS_ERRNO_SWTMR_STATUS_INVALID; + break; + } + SWTMR_UNLOCK(intSave); + return ret; +} + +LITE_OS_SEC_TEXT UINT32 LOS_SwtmrDelete(UINT16 swtmrID) +{ + SWTMR_CTRL_S *swtmr = NULL; + UINT32 intSave; + UINT32 ret = LOS_OK; + UINT16 swtmrCBID; + + if (swtmrID >= OS_SWTMR_MAX_TIMERID) { + return LOS_ERRNO_SWTMR_ID_INVALID; + } + + swtmrCBID = swtmrID % LOSCFG_BASE_CORE_SWTMR_LIMIT; + swtmr = g_swtmrCBArray + swtmrCBID; + SWTMR_LOCK(intSave); + + if (swtmr->usTimerID != swtmrID) { + SWTMR_UNLOCK(intSave); + return LOS_ERRNO_SWTMR_ID_INVALID; + } + + switch (swtmr->ucState) { + case OS_SWTMR_STATUS_UNUSED: + ret = LOS_ERRNO_SWTMR_NOT_CREATED; + break; + case OS_SWTMR_STATUS_TICKING: + OsSwtmrStop(swtmr); + /* fall-through */ + case OS_SWTMR_STATUS_CREATED: + OsSwtmrDelete(swtmr); + break; + default: + ret = LOS_ERRNO_SWTMR_STATUS_INVALID; + break; + } + + SWTMR_UNLOCK(intSave); + OsHookCall(LOS_HOOK_TYPE_SWTMR_DELETE, swtmr); + return ret; +} + +#endif /* LOSCFG_BASE_CORE_SWTMR_ENABLE */ diff --git a/src/kernel_liteos_a/kernel/base/core/los_sys.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/core/los_sys.c similarity index 100% rename from src/kernel_liteos_a/kernel/base/core/los_sys.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/core/los_sys.c diff --git a/src/kernel_liteos_a/kernel/base/core/los_task.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/core/los_task.c similarity index 80% rename from src/kernel_liteos_a/kernel/base/core/los_task.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/core/los_task.c index 2bd80726..de763596 100644 --- a/src/kernel_liteos_a/kernel/base/core/los_task.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/core/los_task.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2023 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -61,9 +61,6 @@ #ifdef LOSCFG_ENABLE_OOM_LOOP_TASK #include "los_oom.h" #endif -#ifdef LOSCFG_KERNEL_CONTAINER -#include "los_container_pri.h" -#endif #if (LOSCFG_BASE_CORE_TSK_LIMIT <= 0) #error "task maxnum cannot be zero" @@ -84,42 +81,28 @@ STATIC VOID OsConsoleIDSetHook(UINT32 param1, /* temp task blocks for booting procedure */ LITE_OS_SEC_BSS STATIC LosTaskCB g_mainTask[LOSCFG_KERNEL_CORE_NUM]; -LosTaskCB *OsGetMainTask(VOID) +LosTaskCB *OsGetMainTask() { return (LosTaskCB *)(g_mainTask + ArchCurrCpuid()); } -VOID OsSetMainTask(VOID) +VOID OsSetMainTask() { UINT32 i; CHAR *name = "osMain"; - SchedParam schedParam = { 0 }; - - schedParam.policy = LOS_SCHED_RR; - schedParam.basePrio = OS_PROCESS_PRIORITY_HIGHEST; - schedParam.priority = OS_TASK_PRIORITY_LOWEST; for (i = 0; i < LOSCFG_KERNEL_CORE_NUM; i++) { g_mainTask[i].taskStatus = OS_TASK_STATUS_UNUSED; g_mainTask[i].taskID = LOSCFG_BASE_CORE_TSK_LIMIT; - g_mainTask[i].processCB = OS_KERNEL_PROCESS_GROUP; + g_mainTask[i].processID = OS_KERNEL_PROCESS_GROUP; + g_mainTask[i].basePrio = OS_TASK_PRIORITY_HIGHEST; + g_mainTask[i].priority = OS_TASK_PRIORITY_LOWEST; #ifdef LOSCFG_KERNEL_SMP_LOCKDEP g_mainTask[i].lockDep.lockDepth = 0; g_mainTask[i].lockDep.waitLock = NULL; #endif (VOID)strncpy_s(g_mainTask[i].taskName, OS_TCB_NAME_LEN, name, OS_TCB_NAME_LEN - 1); LOS_ListInit(&g_mainTask[i].lockList); - (VOID)OsSchedParamInit(&g_mainTask[i], schedParam.policy, &schedParam, NULL); - } -} - -VOID OsSetMainTaskProcess(UINTPTR processCB) -{ - for (UINT32 i = 0; i < LOSCFG_KERNEL_CORE_NUM; i++) { - g_mainTask[i].processCB = processCB; -#ifdef LOSCFG_PID_CONTAINER - g_mainTask[i].pidContainer = OS_PID_CONTAINER_FROM_PCB((LosProcessCB *)processCB); -#endif } } @@ -137,11 +120,13 @@ VOID OsTaskInsertToRecycleList(LosTaskCB *taskCB) LITE_OS_SEC_TEXT_INIT VOID OsTaskJoinPostUnsafe(LosTaskCB *taskCB) { + LosTaskCB *resumedTask = NULL; + if (taskCB->taskStatus & OS_TASK_FLAG_PTHREAD_JOIN) { if (!LOS_ListEmpty(&taskCB->joinList)) { - LosTaskCB *resumedTask = OS_TCB_FROM_PENDLIST(LOS_DL_LIST_FIRST(&(taskCB->joinList))); + resumedTask = OS_TCB_FROM_PENDLIST(LOS_DL_LIST_FIRST(&(taskCB->joinList))); OsTaskWakeClearPendMask(resumedTask); - resumedTask->ops->wake(resumedTask); + OsSchedTaskWake(resumedTask); } } taskCB->taskStatus |= OS_TASK_STATUS_EXIT; @@ -159,8 +144,7 @@ LITE_OS_SEC_TEXT UINT32 OsTaskJoinPendUnsafe(LosTaskCB *taskCB) if ((taskCB->taskStatus & OS_TASK_FLAG_PTHREAD_JOIN) && LOS_ListEmpty(&taskCB->joinList)) { OsTaskWaitSetPendMask(OS_TASK_WAIT_JOIN, taskCB->taskID, LOS_WAIT_FOREVER); - LosTaskCB *runTask = OsCurrTaskGet(); - return runTask->ops->wait(runTask, &taskCB->joinList, LOS_WAIT_FOREVER); + return OsSchedTaskWait(&taskCB->joinList, LOS_WAIT_FOREVER, TRUE); } return LOS_EINVAL; @@ -181,7 +165,7 @@ LITE_OS_SEC_TEXT UINT32 OsTaskSetDetachUnsafe(LosTaskCB *taskCB) return LOS_EINVAL; } -LITE_OS_SEC_TEXT_INIT UINT32 OsTaskInit(UINTPTR processCB) +LITE_OS_SEC_TEXT_INIT UINT32 OsTaskInit(VOID) { UINT32 index; UINT32 size; @@ -205,14 +189,9 @@ LITE_OS_SEC_TEXT_INIT UINT32 OsTaskInit(UINTPTR processCB) for (index = 0; index < g_taskMaxNum; index++) { g_taskCBArray[index].taskStatus = OS_TASK_STATUS_UNUSED; g_taskCBArray[index].taskID = index; - g_taskCBArray[index].processCB = processCB; LOS_ListTailInsert(&g_losFreeTask, &g_taskCBArray[index].pendList); } - g_taskCBArray[index].taskStatus = OS_TASK_STATUS_UNUSED; - g_taskCBArray[index].taskID = index; - g_taskCBArray[index].processCB = processCB; - ret = OsSchedInit(); EXIT: @@ -224,10 +203,10 @@ EXIT: UINT32 OsGetIdleTaskId(VOID) { - return OsSchedRunqueueIdleGet()->taskID; + return OsSchedGetRunQueIdle(); } -LITE_OS_SEC_TEXT_INIT UINT32 OsIdleTaskCreate(UINTPTR processID) +LITE_OS_SEC_TEXT_INIT UINT32 OsIdleTaskCreate(VOID) { UINT32 ret; TSK_INIT_PARAM_S taskInitParam; @@ -237,21 +216,18 @@ LITE_OS_SEC_TEXT_INIT UINT32 OsIdleTaskCreate(UINTPTR processID) taskInitParam.pfnTaskEntry = (TSK_ENTRY_FUNC)OsIdleTask; taskInitParam.uwStackSize = LOSCFG_BASE_CORE_TSK_IDLE_STACK_SIZE; taskInitParam.pcName = "Idle"; - taskInitParam.policy = LOS_SCHED_IDLE; taskInitParam.usTaskPrio = OS_TASK_PRIORITY_LOWEST; - taskInitParam.processID = processID; + taskInitParam.processID = OsGetIdleProcessID(); #ifdef LOSCFG_KERNEL_SMP taskInitParam.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif ret = LOS_TaskCreateOnly(&idleTaskID, &taskInitParam); - if (ret != LOS_OK) { - return ret; - } LosTaskCB *idleTask = OS_TCB_FROM_TID(idleTaskID); idleTask->taskStatus |= OS_TASK_FLAG_SYSTEM_TASK; - OsSchedRunqueueIdleInit(idleTask); + OsSchedRunQueIdleInit(idleTaskID); + OsSchedSetIdleTaskSchedParam(idleTask); - return LOS_TaskResume(idleTaskID); + return ret; } /* @@ -268,7 +244,7 @@ LITE_OS_SEC_TEXT UINT32 LOS_CurTaskIDGet(VOID) return runTask->taskID; } -STATIC INLINE UINT32 TaskSyncCreate(LosTaskCB *taskCB) +STATIC INLINE UINT32 OsTaskSyncCreate(LosTaskCB *taskCB) { #ifdef LOSCFG_KERNEL_SMP_TASK_SYNC UINT32 ret = LOS_SemCreate(0, &taskCB->syncSignal); @@ -328,14 +304,11 @@ STATIC INLINE VOID OsTaskSyncWake(const LosTaskCB *taskCB) STATIC INLINE VOID OsInsertTCBToFreeList(LosTaskCB *taskCB) { -#ifdef LOSCFG_PID_CONTAINER - OsFreeVtid(taskCB); -#endif UINT32 taskID = taskCB->taskID; (VOID)memset_s(taskCB, sizeof(LosTaskCB), 0, sizeof(LosTaskCB)); taskCB->taskID = taskID; - taskCB->processCB = (UINTPTR)OsGetDefaultProcessCB(); taskCB->taskStatus = OS_TASK_STATUS_UNUSED; + taskCB->processID = OS_INVALID_VALUE; LOS_ListAdd(&g_losFreeTask, &taskCB->pendList); } @@ -361,12 +334,12 @@ STATIC VOID OsTaskResourcesToFree(LosTaskCB *taskCB) taskCB->userArea = 0; SCHEDULER_UNLOCK(intSave); - LosProcessCB *processCB = OS_PCB_FROM_TCB(taskCB); + LosProcessCB *processCB = OS_PCB_FROM_PID(taskCB->processID); LOS_ASSERT(!(OsProcessVmSpaceGet(processCB) == NULL)); UINT32 ret = OsUnMMap(OsProcessVmSpaceGet(processCB), (UINTPTR)mapBase, mapSize); if ((ret != LOS_OK) && (mapBase != 0) && !OsProcessIsInit(processCB)) { PRINT_ERR("process(%u) unmmap user task(%u) stack failed! mapbase: 0x%x size :0x%x, error: %d\n", - processCB->processID, taskCB->taskID, mapBase, mapSize, ret); + taskCB->processID, taskCB->taskID, mapBase, mapSize, ret); } #ifdef LOSCFG_KERNEL_LITEIPC @@ -394,13 +367,14 @@ STATIC VOID OsTaskResourcesToFree(LosTaskCB *taskCB) return; } -LITE_OS_SEC_TEXT VOID OsTaskCBRecycleToFree(void) +LITE_OS_SEC_TEXT VOID OsTaskCBRecycleToFree() { + LosTaskCB *taskCB = NULL; UINT32 intSave; SCHEDULER_LOCK(intSave); while (!LOS_ListEmpty(&g_taskRecycleList)) { - LosTaskCB *taskCB = OS_TCB_FROM_PENDLIST(LOS_DL_LIST_FIRST(&g_taskRecycleList)); + taskCB = OS_TCB_FROM_PENDLIST(LOS_DL_LIST_FIRST(&g_taskRecycleList)); LOS_ListDelete(&taskCB->pendList); SCHEDULER_UNLOCK(intSave); @@ -417,6 +391,8 @@ LITE_OS_SEC_TEXT VOID OsTaskCBRecycleToFree(void) */ LITE_OS_SEC_TEXT_INIT VOID OsTaskEntry(UINT32 taskID) { + LosTaskCB *taskCB = NULL; + LOS_ASSERT(!OS_TID_CHECK_INVALID(taskID)); /* @@ -427,7 +403,7 @@ LITE_OS_SEC_TEXT_INIT VOID OsTaskEntry(UINT32 taskID) LOS_SpinUnlock(&g_taskSpin); (VOID)LOS_IntUnLock(); - LosTaskCB *taskCB = OS_TCB_FROM_TID(taskID); + taskCB = OS_TCB_FROM_TID(taskID); taskCB->joinRetval = taskCB->taskEntry(taskCB->args[0], taskCB->args[1], taskCB->args[2], taskCB->args[3]); /* 2 & 3: just for args array index */ if (!(taskCB->taskStatus & OS_TASK_FLAG_PTHREAD_JOIN)) { @@ -437,9 +413,11 @@ LITE_OS_SEC_TEXT_INIT VOID OsTaskEntry(UINT32 taskID) OsRunningTaskToExit(taskCB, 0); } -STATIC UINT32 TaskCreateParamCheck(const UINT32 *taskID, TSK_INIT_PARAM_S *initParam) +LITE_OS_SEC_TEXT_INIT STATIC UINT32 OsTaskCreateParamCheck(const UINT32 *taskID, + TSK_INIT_PARAM_S *initParam, VOID **pool) { UINT32 poolSize = OS_SYS_MEM_SIZE; + *pool = (VOID *)m_aucSysMem1; if (taskID == NULL) { return LOS_ERRNO_TSK_ID_INVALID; @@ -449,7 +427,8 @@ STATIC UINT32 TaskCreateParamCheck(const UINT32 *taskID, TSK_INIT_PARAM_S *initP return LOS_ERRNO_TSK_PTR_NULL; } - if (!OsProcessIsUserMode((LosProcessCB *)initParam->processID)) { + LosProcessCB *process = OS_PCB_FROM_PID(initParam->processID); + if (!OsProcessIsUserMode(process)) { if (initParam->pcName == NULL) { return LOS_ERRNO_TSK_NAME_EMPTY; } @@ -479,52 +458,33 @@ STATIC UINT32 TaskCreateParamCheck(const UINT32 *taskID, TSK_INIT_PARAM_S *initP return LOS_OK; } -STATIC VOID TaskCBDeInit(LosTaskCB *taskCB) +LITE_OS_SEC_TEXT_INIT STATIC VOID OsTaskStackAlloc(VOID **topStack, UINT32 stackSize, VOID *pool) { - UINT32 intSave; -#ifdef LOSCFG_KERNEL_SMP_TASK_SYNC - if (taskCB->syncSignal != OS_INVALID_VALUE) { - OsTaskSyncDestroy(taskCB->syncSignal); - taskCB->syncSignal = OS_INVALID_VALUE; - } -#endif - - if (taskCB->topOfStack != (UINTPTR)NULL) { - (VOID)LOS_MemFree(m_aucSysMem1, (VOID *)taskCB->topOfStack); - taskCB->topOfStack = (UINTPTR)NULL; - } - - SCHEDULER_LOCK(intSave); - LosProcessCB *processCB = OS_PCB_FROM_TCB(taskCB); - if (processCB != OsGetDefaultProcessCB()) { - LOS_ListDelete(&taskCB->threadList); - processCB->threadNumber--; - processCB->threadCount--; - } - - OsInsertTCBToFreeList(taskCB); - SCHEDULER_UNLOCK(intSave); + *topStack = (VOID *)LOS_MemAllocAlign(pool, stackSize, LOSCFG_STACK_POINT_ALIGN_SIZE); } -STATIC VOID TaskCBBaseInit(LosTaskCB *taskCB, const TSK_INIT_PARAM_S *initParam) +LITE_OS_SEC_TEXT_INIT STATIC VOID OsTaskCBInitBase(LosTaskCB *taskCB, + const VOID *stackPtr, + const VOID *topStack, + const TSK_INIT_PARAM_S *initParam) { - taskCB->stackPointer = NULL; + taskCB->stackPointer = (VOID *)stackPtr; taskCB->args[0] = initParam->auwArgs[0]; /* 0~3: just for args array index */ taskCB->args[1] = initParam->auwArgs[1]; taskCB->args[2] = initParam->auwArgs[2]; taskCB->args[3] = initParam->auwArgs[3]; - taskCB->topOfStack = (UINTPTR)NULL; + taskCB->topOfStack = (UINTPTR)topStack; taskCB->stackSize = initParam->uwStackSize; + taskCB->priority = initParam->usTaskPrio; taskCB->taskEntry = initParam->pfnTaskEntry; taskCB->signal = SIGNAL_NONE; -#ifdef LOSCFG_KERNEL_SMP_TASK_SYNC - taskCB->syncSignal = OS_INVALID_VALUE; -#endif + #ifdef LOSCFG_KERNEL_SMP taskCB->currCpu = OS_TASK_INVALID_CPUID; taskCB->cpuAffiMask = (initParam->usCpuAffiMask) ? initParam->usCpuAffiMask : LOSCFG_KERNEL_CPU_MASK; #endif + taskCB->policy = (initParam->policy == LOS_SCHED_FIFO) ? LOS_SCHED_FIFO : LOS_SCHED_RR; taskCB->taskStatus = OS_TASK_STATUS_INIT; if (initParam->uwResved & LOS_TASK_ATTR_JOINABLE) { taskCB->taskStatus |= OS_TASK_FLAG_PTHREAD_JOIN; @@ -533,38 +493,26 @@ STATIC VOID TaskCBBaseInit(LosTaskCB *taskCB, const TSK_INIT_PARAM_S *initParam) LOS_ListInit(&taskCB->lockList); SET_SORTLIST_VALUE(&taskCB->sortList, OS_SORT_LINK_INVALID_TIME); -#ifdef LOSCFG_KERNEL_VM - taskCB->futex.index = OS_INVALID_VALUE; -#endif } -STATIC UINT32 TaskCBInit(LosTaskCB *taskCB, const TSK_INIT_PARAM_S *initParam) +STATIC UINT32 OsTaskCBInit(LosTaskCB *taskCB, const TSK_INIT_PARAM_S *initParam, + const VOID *stackPtr, const VOID *topStack) { UINT32 ret; UINT32 numCount; - SchedParam schedParam = { 0 }; - LosSchedParam initSchedParam = {0}; - UINT16 policy = (initParam->policy == LOS_SCHED_NORMAL) ? LOS_SCHED_RR : initParam->policy; - TaskCBBaseInit(taskCB, initParam); - - schedParam.policy = policy; - ret = OsProcessAddNewTask(initParam->processID, taskCB, &schedParam, &numCount); - if (ret != LOS_OK) { - return ret; - } + OsTaskCBInitBase(taskCB, stackPtr, topStack, initParam); - if (policy == LOS_SCHED_DEADLINE) { - initSchedParam.runTimeUs = initParam->runTimeUs; - initSchedParam.deadlineUs = initParam->deadlineUs; - initSchedParam.periodUs = initParam->periodUs; - } else { - initSchedParam.priority = initParam->usTaskPrio; - } - ret = OsSchedParamInit(taskCB, policy, &schedParam, &initSchedParam); - if (ret != LOS_OK) { - return ret; + numCount = OsProcessAddNewTask(initParam->processID, taskCB); +#ifdef LOSCFG_KERNEL_VM + taskCB->futex.index = OS_INVALID_VALUE; + if (taskCB->taskStatus & OS_TASK_FLAG_USER_MODE) { + taskCB->userArea = initParam->userParam.userArea; + taskCB->userMapBase = initParam->userParam.userMapBase; + taskCB->userMapSize = initParam->userParam.userMapSize; + OsUserTaskStackInit(taskCB->stackPointer, (UINTPTR)taskCB->taskEntry, initParam->userParam.userSP); } +#endif if (initParam->pcName != NULL) { ret = (UINT32)OsSetTaskName(taskCB, initParam->pcName, FALSE); @@ -579,29 +527,10 @@ STATIC UINT32 TaskCBInit(LosTaskCB *taskCB, const TSK_INIT_PARAM_S *initParam) return LOS_OK; } -STATIC UINT32 TaskStackInit(LosTaskCB *taskCB, const TSK_INIT_PARAM_S *initParam) -{ - VOID *topStack = (VOID *)LOS_MemAllocAlign(m_aucSysMem1, initParam->uwStackSize, LOSCFG_STACK_POINT_ALIGN_SIZE); - if (topStack == NULL) { - return LOS_ERRNO_TSK_NO_MEMORY; - } - - taskCB->topOfStack = (UINTPTR)topStack; - taskCB->stackPointer = OsTaskStackInit(taskCB->taskID, initParam->uwStackSize, topStack, TRUE); -#ifdef LOSCFG_KERNEL_VM - if (taskCB->taskStatus & OS_TASK_FLAG_USER_MODE) { - taskCB->userArea = initParam->userParam.userArea; - taskCB->userMapBase = initParam->userParam.userMapBase; - taskCB->userMapSize = initParam->userParam.userMapSize; - OsUserTaskStackInit(taskCB->stackPointer, (UINTPTR)taskCB->taskEntry, initParam->userParam.userSP); - } -#endif - return LOS_OK; -} - -STATIC LosTaskCB *GetFreeTaskCB(VOID) +LITE_OS_SEC_TEXT LosTaskCB *OsGetFreeTaskCB(VOID) { UINT32 intSave; + LosTaskCB *taskCB = NULL; SCHEDULER_LOCK(intSave); if (LOS_ListEmpty(&g_losFreeTask)) { @@ -610,7 +539,7 @@ STATIC LosTaskCB *GetFreeTaskCB(VOID) return NULL; } - LosTaskCB *taskCB = OS_TCB_FROM_PENDLIST(LOS_DL_LIST_FIRST(&g_losFreeTask)); + taskCB = OS_TCB_FROM_PENDLIST(LOS_DL_LIST_FIRST(&g_losFreeTask)); LOS_ListDelete(LOS_DL_LIST_FIRST(&g_losFreeTask)); SCHEDULER_UNLOCK(intSave); @@ -619,31 +548,39 @@ STATIC LosTaskCB *GetFreeTaskCB(VOID) LITE_OS_SEC_TEXT_INIT UINT32 LOS_TaskCreateOnly(UINT32 *taskID, TSK_INIT_PARAM_S *initParam) { - UINT32 errRet = TaskCreateParamCheck(taskID, initParam); + UINT32 intSave, errRet; + VOID *topStack = NULL; + VOID *stackPtr = NULL; + LosTaskCB *taskCB = NULL; + VOID *pool = NULL; + + errRet = OsTaskCreateParamCheck(taskID, initParam, &pool); if (errRet != LOS_OK) { return errRet; } - LosTaskCB *taskCB = GetFreeTaskCB(); + taskCB = OsGetFreeTaskCB(); if (taskCB == NULL) { - return LOS_ERRNO_TSK_TCB_UNAVAILABLE; + errRet = LOS_ERRNO_TSK_TCB_UNAVAILABLE; + goto LOS_ERREND; } - errRet = TaskCBInit(taskCB, initParam); + errRet = OsTaskSyncCreate(taskCB); if (errRet != LOS_OK) { - goto DEINIT_TCB; + goto LOS_ERREND_REWIND_TCB; } - errRet = TaskSyncCreate(taskCB); - if (errRet != LOS_OK) { - goto DEINIT_TCB; + OsTaskStackAlloc(&topStack, initParam->uwStackSize, pool); + if (topStack == NULL) { + errRet = LOS_ERRNO_TSK_NO_MEMORY; + goto LOS_ERREND_REWIND_SYNC; } - errRet = TaskStackInit(taskCB, initParam); + stackPtr = OsTaskStackInit(taskCB->taskID, initParam->uwStackSize, topStack, TRUE); + errRet = OsTaskCBInit(taskCB, initParam, stackPtr, topStack); if (errRet != LOS_OK) { - goto DEINIT_TCB; + goto LOS_ERREND_TCB_INIT; } - if (OsConsoleIDSetHook != NULL) { OsConsoleIDSetHook(taskCB->taskID, OsCurrTaskGet()->taskID); } @@ -652,8 +589,17 @@ LITE_OS_SEC_TEXT_INIT UINT32 LOS_TaskCreateOnly(UINT32 *taskID, TSK_INIT_PARAM_S OsHookCall(LOS_HOOK_TYPE_TASK_CREATE, taskCB); return LOS_OK; -DEINIT_TCB: - TaskCBDeInit(taskCB); +LOS_ERREND_TCB_INIT: + (VOID)LOS_MemFree(pool, topStack); +LOS_ERREND_REWIND_SYNC: +#ifdef LOSCFG_KERNEL_SMP_TASK_SYNC + OsTaskSyncDestroy(taskCB->syncSignal); +#endif +LOS_ERREND_REWIND_TCB: + SCHEDULER_LOCK(intSave); + OsInsertTCBToFreeList(taskCB); + SCHEDULER_UNLOCK(intSave); +LOS_ERREND: return errRet; } @@ -671,9 +617,9 @@ LITE_OS_SEC_TEXT_INIT UINT32 LOS_TaskCreate(UINT32 *taskID, TSK_INIT_PARAM_S *in } if (OsProcessIsUserMode(OsCurrProcessGet())) { - initParam->processID = (UINTPTR)OsGetKernelInitProcess(); + initParam->processID = OsGetKernelInitProcessID(); } else { - initParam->processID = (UINTPTR)OsCurrProcessGet(); + initParam->processID = OsCurrProcessGet()->processID; } ret = LOS_TaskCreateOnly(taskID, initParam); @@ -684,7 +630,7 @@ LITE_OS_SEC_TEXT_INIT UINT32 LOS_TaskCreate(UINT32 *taskID, TSK_INIT_PARAM_S *in LosTaskCB *taskCB = OS_TCB_FROM_TID(*taskID); SCHEDULER_LOCK(intSave); - taskCB->ops->enqueue(OsSchedRunqueue(), taskCB); + OsSchedTaskEnQueue(taskCB); SCHEDULER_UNLOCK(intSave); /* in case created task not running on this core, @@ -701,13 +647,13 @@ LITE_OS_SEC_TEXT_INIT UINT32 LOS_TaskResume(UINT32 taskID) { UINT32 intSave; UINT32 errRet; - BOOL needSched = FALSE; + LosTaskCB *taskCB = NULL; if (OS_TID_CHECK_INVALID(taskID)) { return LOS_ERRNO_TSK_ID_INVALID; } - LosTaskCB *taskCB = OS_TCB_FROM_TID(taskID); + taskCB = OS_TCB_FROM_TID(taskID); SCHEDULER_LOCK(intSave); /* clear pending signal */ @@ -721,7 +667,7 @@ LITE_OS_SEC_TEXT_INIT UINT32 LOS_TaskResume(UINT32 taskID) OS_GOTO_ERREND(); } - errRet = taskCB->ops->resume(taskCB, &needSched); + BOOL needSched = OsSchedResume(taskCB); SCHEDULER_UNLOCK(intSave); LOS_MpSchedule(OS_MP_CPU_ALL); @@ -729,7 +675,7 @@ LITE_OS_SEC_TEXT_INIT UINT32 LOS_TaskResume(UINT32 taskID) LOS_Schedule(); } - return errRet; + return LOS_OK; LOS_ERREND: SCHEDULER_UNLOCK(intSave); @@ -777,7 +723,9 @@ LITE_OS_SEC_TEXT_INIT STATIC BOOL OsTaskSuspendCheckOnRun(LosTaskCB *taskCB, UIN LITE_OS_SEC_TEXT STATIC UINT32 OsTaskSuspend(LosTaskCB *taskCB) { UINT32 errRet; - UINT16 tempStatus = taskCB->taskStatus; + UINT16 tempStatus; + + tempStatus = taskCB->taskStatus; if (tempStatus & OS_TASK_STATUS_UNUSED) { return LOS_ERRNO_TSK_NOT_CREATED; } @@ -791,19 +739,21 @@ LITE_OS_SEC_TEXT STATIC UINT32 OsTaskSuspend(LosTaskCB *taskCB) return errRet; } - return taskCB->ops->suspend(taskCB); + OsSchedSuspend(taskCB); + return LOS_OK; } LITE_OS_SEC_TEXT_INIT UINT32 LOS_TaskSuspend(UINT32 taskID) { UINT32 intSave; + LosTaskCB *taskCB = NULL; UINT32 errRet; if (OS_TID_CHECK_INVALID(taskID)) { return LOS_ERRNO_TSK_ID_INVALID; } - LosTaskCB *taskCB = OS_TCB_FROM_TID(taskID); + taskCB = OS_TCB_FROM_TID(taskID); if (taskCB->taskStatus & OS_TASK_FLAG_SYSTEM_TASK) { return LOS_ERRNO_TSK_OPERATE_SYSTEM_TASK; } @@ -851,7 +801,7 @@ LITE_OS_SEC_TEXT VOID OsRunningTaskToExit(LosTaskCB *runTask, UINT32 status) { UINT32 intSave; - if (OsIsProcessThreadGroup(runTask)) { + if (OsProcessThreadGroupIDGet(runTask) == runTask->taskID) { OsProcessThreadGroupDestroy(); } @@ -862,11 +812,11 @@ LITE_OS_SEC_TEXT VOID OsRunningTaskToExit(LosTaskCB *runTask, UINT32 status) SCHEDULER_UNLOCK(intSave); OsTaskResourcesToFree(runTask); - OsProcessResourcesToFree(OS_PCB_FROM_TCB(runTask)); + OsProcessResourcesToFree(OS_PCB_FROM_PID(runTask->processID)); SCHEDULER_LOCK(intSave); - OsProcessNaturalExit(OS_PCB_FROM_TCB(runTask), status); + OsProcessNaturalExit(OS_PCB_FROM_PID(runTask->processID), status); OsTaskReleaseHoldLock(runTask); OsTaskStatusUnusedSet(runTask); } else if (runTask->taskStatus & OS_TASK_FLAG_PTHREAD_JOIN) { @@ -892,11 +842,11 @@ LITE_OS_SEC_TEXT VOID OsInactiveTaskDelete(LosTaskCB *taskCB) OsTaskReleaseHoldLock(taskCB); - taskCB->ops->exit(taskCB); + OsSchedTaskExit(taskCB); if (taskStatus & OS_TASK_STATUS_PENDING) { LosMux *mux = (LosMux *)taskCB->taskMux; if (LOS_MuxIsValid(mux) == TRUE) { - OsMuxBitmapRestore(mux, NULL, taskCB); + OsMuxBitmapRestore(mux, taskCB, (LosTaskCB *)mux->owner); } } @@ -922,17 +872,13 @@ LITE_OS_SEC_TEXT_INIT UINT32 LOS_TaskDelete(UINT32 taskID) LosTaskCB *taskCB = OS_TCB_FROM_TID(taskID); if (taskCB == OsCurrTaskGet()) { - if (!OsPreemptable()) { - return LOS_ERRNO_TSK_DELETE_LOCKED; - } - OsRunningTaskToExit(taskCB, OS_PRO_EXIT_OK); return LOS_NOK; } SCHEDULER_LOCK(intSave); - if (OsTaskIsNotDelete(taskCB)) { - if (OsTaskIsUnused(taskCB)) { + if (taskCB->taskStatus & (OS_TASK_STATUS_UNUSED | OS_TASK_FLAG_SYSTEM_TASK | OS_TASK_FLAG_NO_DELETE)) { + if (taskCB->taskStatus & OS_TASK_STATUS_UNUSED) { ret = LOS_ERRNO_TSK_NOT_CREATED; } else { ret = LOS_ERRNO_TSK_OPERATE_SYSTEM_TASK; @@ -954,22 +900,20 @@ LITE_OS_SEC_TEXT_INIT UINT32 LOS_TaskDelete(UINT32 taskID) LOS_ERREND: SCHEDULER_UNLOCK(intSave); - if (ret == LOS_OK) { - LOS_Schedule(); - } return ret; } LITE_OS_SEC_TEXT UINT32 LOS_TaskDelay(UINT32 tick) { UINT32 intSave; + LosTaskCB *runTask = NULL; if (OS_INT_ACTIVE) { PRINT_ERR("In interrupt not allow delay task!\n"); return LOS_ERRNO_TSK_DELAY_IN_INT; } - LosTaskCB *runTask = OsCurrTaskGet(); + runTask = OsCurrTaskGet(); if (runTask->taskStatus & OS_TASK_FLAG_SYSTEM_TASK) { OsBackTrace(); return LOS_ERRNO_TSK_OPERATE_SYSTEM_TASK; @@ -984,37 +928,39 @@ LITE_OS_SEC_TEXT UINT32 LOS_TaskDelay(UINT32 tick) } SCHEDULER_LOCK(intSave); - UINT32 ret = runTask->ops->delay(runTask, OS_SCHED_TICK_TO_CYCLE(tick)); + OsSchedDelay(runTask, tick); OsHookCall(LOS_HOOK_TYPE_MOVEDTASKTODELAYEDLIST, runTask); SCHEDULER_UNLOCK(intSave); - return ret; + + return LOS_OK; } LITE_OS_SEC_TEXT_MINOR UINT16 LOS_TaskPriGet(UINT32 taskID) { UINT32 intSave; - SchedParam param = { 0 }; + LosTaskCB *taskCB = NULL; + UINT16 priority; if (OS_TID_CHECK_INVALID(taskID)) { return (UINT16)OS_INVALID; } - LosTaskCB *taskCB = OS_TCB_FROM_TID(taskID); + taskCB = OS_TCB_FROM_TID(taskID); SCHEDULER_LOCK(intSave); if (taskCB->taskStatus & OS_TASK_STATUS_UNUSED) { SCHEDULER_UNLOCK(intSave); return (UINT16)OS_INVALID; } - taskCB->ops->schedParamGet(taskCB, ¶m); + priority = taskCB->priority; SCHEDULER_UNLOCK(intSave); - return param.priority; + return priority; } LITE_OS_SEC_TEXT_MINOR UINT32 LOS_TaskPriSet(UINT32 taskID, UINT16 taskPrio) { UINT32 intSave; - SchedParam param = { 0 }; + LosTaskCB *taskCB = NULL; if (taskPrio > OS_TASK_PRIORITY_LOWEST) { return LOS_ERRNO_TSK_PRIOR_ERROR; @@ -1024,7 +970,7 @@ LITE_OS_SEC_TEXT_MINOR UINT32 LOS_TaskPriSet(UINT32 taskID, UINT16 taskPrio) return LOS_ERRNO_TSK_ID_INVALID; } - LosTaskCB *taskCB = OS_TCB_FROM_TID(taskID); + taskCB = OS_TCB_FROM_TID(taskID); if (taskCB->taskStatus & OS_TASK_FLAG_SYSTEM_TASK) { return LOS_ERRNO_TSK_OPERATE_SYSTEM_TASK; } @@ -1035,15 +981,11 @@ LITE_OS_SEC_TEXT_MINOR UINT32 LOS_TaskPriSet(UINT32 taskID, UINT16 taskPrio) return LOS_ERRNO_TSK_NOT_CREATED; } - taskCB->ops->schedParamGet(taskCB, ¶m); - - param.priority = taskPrio; - - BOOL needSched = taskCB->ops->schedParamModify(taskCB, ¶m); + BOOL isReady = OsSchedModifyTaskSchedParam(taskCB, taskCB->policy, taskPrio); SCHEDULER_UNLOCK(intSave); LOS_MpSchedule(OS_MP_CPU_ALL); - if (needSched && OS_SCHEDULER_ACTIVE) { + if (isReady && OS_SCHEDULER_ACTIVE) { LOS_Schedule(); } return LOS_OK; @@ -1073,7 +1015,7 @@ LITE_OS_SEC_TEXT_MINOR UINT32 LOS_TaskYield(VOID) SCHEDULER_LOCK(intSave); /* reset timeslice of yielded task */ - runTask->ops->yield(runTask); + OsSchedYield(); SCHEDULER_UNLOCK(intSave); return LOS_OK; } @@ -1103,7 +1045,7 @@ LITE_OS_SEC_TEXT_MINOR VOID LOS_TaskUnlock(VOID) LITE_OS_SEC_TEXT_MINOR UINT32 LOS_TaskInfoGet(UINT32 taskID, TSK_INFO_S *taskInfo) { UINT32 intSave; - SchedParam param = { 0 }; + LosTaskCB *taskCB = NULL; if (taskInfo == NULL) { return LOS_ERRNO_TSK_PTR_NULL; @@ -1113,7 +1055,7 @@ LITE_OS_SEC_TEXT_MINOR UINT32 LOS_TaskInfoGet(UINT32 taskID, TSK_INFO_S *taskInf return LOS_ERRNO_TSK_ID_INVALID; } - LosTaskCB *taskCB = OS_TCB_FROM_TID(taskID); + taskCB = OS_TCB_FROM_TID(taskID); SCHEDULER_LOCK(intSave); if (taskCB->taskStatus & OS_TASK_STATUS_UNUSED) { SCHEDULER_UNLOCK(intSave); @@ -1126,9 +1068,8 @@ LITE_OS_SEC_TEXT_MINOR UINT32 LOS_TaskInfoGet(UINT32 taskID, TSK_INFO_S *taskInf taskInfo->uwSP = ArchSPGet(); } - taskCB->ops->schedParamGet(taskCB, ¶m); taskInfo->usTaskStatus = taskCB->taskStatus; - taskInfo->usTaskPrio = param.priority; + taskInfo->usTaskPrio = taskCB->priority; taskInfo->uwStackSize = taskCB->stackSize; taskInfo->uwTopOfStack = taskCB->topOfStack; taskInfo->uwEventMask = taskCB->eventMask; @@ -1172,6 +1113,7 @@ LITE_OS_SEC_TEXT BOOL OsTaskCpuAffiSetUnsafe(UINT32 taskID, UINT16 newCpuAffiMas LITE_OS_SEC_TEXT_MINOR UINT32 LOS_TaskCpuAffiSet(UINT32 taskID, UINT16 cpuAffiMask) { + LosTaskCB *taskCB = NULL; BOOL needSched = FALSE; UINT32 intSave; UINT16 currCpuMask; @@ -1184,7 +1126,7 @@ LITE_OS_SEC_TEXT_MINOR UINT32 LOS_TaskCpuAffiSet(UINT32 taskID, UINT16 cpuAffiMa return LOS_ERRNO_TSK_CPU_AFFINITY_MASK_ERR; } - LosTaskCB *taskCB = OS_TCB_FROM_TID(taskID); + taskCB = OS_TCB_FROM_TID(taskID); SCHEDULER_LOCK(intSave); if (taskCB->taskStatus & OS_TASK_STATUS_UNUSED) { SCHEDULER_UNLOCK(intSave); @@ -1205,6 +1147,7 @@ LITE_OS_SEC_TEXT_MINOR UINT16 LOS_TaskCpuAffiGet(UINT32 taskID) { #ifdef LOSCFG_KERNEL_SMP #define INVALID_CPU_AFFI_MASK 0 + LosTaskCB *taskCB = NULL; UINT16 cpuAffiMask; UINT32 intSave; @@ -1212,7 +1155,7 @@ LITE_OS_SEC_TEXT_MINOR UINT16 LOS_TaskCpuAffiGet(UINT32 taskID) return INVALID_CPU_AFFI_MASK; } - LosTaskCB *taskCB = OS_TCB_FROM_TID(taskID); + taskCB = OS_TCB_FROM_TID(taskID); SCHEDULER_LOCK(intSave); if (taskCB->taskStatus & OS_TASK_STATUS_UNUSED) { SCHEDULER_UNLOCK(intSave); @@ -1265,7 +1208,7 @@ LITE_OS_SEC_TEXT_MINOR VOID OsTaskProcSignal(VOID) } else if (runTask->signal & SIGNAL_AFFI) { runTask->signal &= ~SIGNAL_AFFI; - /* priority queue has updated, notify the target cpu */ + /* pri-queue has updated, notify the target cpu */ LOS_MpSchedule((UINT32)runTask->cpuAffiMask); #endif } @@ -1302,8 +1245,8 @@ LITE_OS_SEC_TEXT INT32 OsSetTaskName(LosTaskCB *taskCB, const CHAR *name, BOOL s err = LOS_OK; /* if thread is main thread, then set processName as taskName */ - if (OsIsProcessThreadGroup(taskCB) && (setPName == TRUE)) { - err = (INT32)OsSetProcessName(OS_PCB_FROM_TCB(taskCB), (const CHAR *)taskCB->taskName); + if ((taskCB->taskID == OsProcessThreadGroupIDGet(taskCB)) && (setPName == TRUE)) { + err = (INT32)OsSetProcessName(OS_PCB_FROM_PID(taskCB->processID), (const CHAR *)taskCB->taskName); if (err != LOS_OK) { err = EINVAL; } @@ -1316,16 +1259,16 @@ EXIT: INT32 OsUserTaskOperatePermissionsCheck(const LosTaskCB *taskCB) { - return OsUserProcessOperatePermissionsCheck(taskCB, (UINTPTR)OsCurrProcessGet()); + return OsUserProcessOperatePermissionsCheck(taskCB, OsCurrProcessGet()->processID); } -INT32 OsUserProcessOperatePermissionsCheck(const LosTaskCB *taskCB, UINTPTR processCB) +INT32 OsUserProcessOperatePermissionsCheck(const LosTaskCB *taskCB, UINT32 processID) { if (taskCB == NULL) { return LOS_EINVAL; } - if (processCB == (UINTPTR)OsGetDefaultProcessCB()) { + if (processID == OS_INVALID_VALUE) { return LOS_EINVAL; } @@ -1333,7 +1276,7 @@ INT32 OsUserProcessOperatePermissionsCheck(const LosTaskCB *taskCB, UINTPTR proc return LOS_EINVAL; } - if (processCB != taskCB->processCB) { + if (processID != taskCB->processID) { return LOS_EPERM; } @@ -1368,13 +1311,11 @@ LITE_OS_SEC_TEXT_INIT STATIC UINT32 OsCreateUserTaskParamCheck(UINT32 processID, return LOS_OK; } -LITE_OS_SEC_TEXT_INIT UINT32 OsCreateUserTask(UINTPTR processID, TSK_INIT_PARAM_S *initParam) +LITE_OS_SEC_TEXT_INIT UINT32 OsCreateUserTask(UINT32 processID, TSK_INIT_PARAM_S *initParam) { UINT32 taskID; UINT32 ret; UINT32 intSave; - INT32 policy; - SchedParam param; ret = OsCreateUserTaskParamCheck(processID, initParam); if (ret != LOS_OK) { @@ -1383,25 +1324,14 @@ LITE_OS_SEC_TEXT_INIT UINT32 OsCreateUserTask(UINTPTR processID, TSK_INIT_PARAM_ initParam->uwStackSize = OS_USER_TASK_SYSCALL_STACK_SIZE; initParam->usTaskPrio = OS_TASK_PRIORITY_LOWEST; + initParam->policy = LOS_SCHED_RR; if (processID == OS_INVALID_VALUE) { SCHEDULER_LOCK(intSave); LosProcessCB *processCB = OsCurrProcessGet(); - initParam->processID = (UINTPTR)processCB; + initParam->processID = processCB->processID; initParam->consoleID = processCB->consoleID; SCHEDULER_UNLOCK(intSave); - ret = LOS_GetProcessScheduler(processCB->processID, &policy, NULL); - if (ret != LOS_OK) { - return OS_INVALID_VALUE; - } - initParam->policy = policy; - if (policy == LOS_SCHED_DEADLINE) { - OsSchedProcessDefaultSchedParamGet((UINT16)policy, ¶m); - initParam->runTimeUs = param.runTimeUs; - initParam->deadlineUs = param.deadlineUs; - initParam->periodUs = param.periodUs; - } } else { - initParam->policy = LOS_SCHED_RR; initParam->processID = processID; initParam->consoleID = 0; } @@ -1417,22 +1347,21 @@ LITE_OS_SEC_TEXT_INIT UINT32 OsCreateUserTask(UINTPTR processID, TSK_INIT_PARAM_ LITE_OS_SEC_TEXT INT32 LOS_GetTaskScheduler(INT32 taskID) { UINT32 intSave; + LosTaskCB *taskCB = NULL; INT32 policy; - SchedParam param = { 0 }; if (OS_TID_CHECK_INVALID(taskID)) { return -LOS_EINVAL; } - LosTaskCB *taskCB = OS_TCB_FROM_TID(taskID); + taskCB = OS_TCB_FROM_TID(taskID); SCHEDULER_LOCK(intSave); if (taskCB->taskStatus & OS_TASK_STATUS_UNUSED) { policy = -LOS_EINVAL; OS_GOTO_ERREND(); } - taskCB->ops->schedParamGet(taskCB, ¶m); - policy = (INT32)param.policy; + policy = taskCB->policy; LOS_ERREND: SCHEDULER_UNLOCK(intSave); @@ -1441,8 +1370,8 @@ LOS_ERREND: LITE_OS_SEC_TEXT INT32 LOS_SetTaskScheduler(INT32 taskID, UINT16 policy, UINT16 priority) { - SchedParam param = { 0 }; UINT32 intSave; + BOOL needSched = FALSE; if (OS_TID_CHECK_INVALID(taskID)) { return LOS_ESRCH; @@ -1456,21 +1385,8 @@ LITE_OS_SEC_TEXT INT32 LOS_SetTaskScheduler(INT32 taskID, UINT16 policy, UINT16 return LOS_EINVAL; } - LosTaskCB *taskCB = OS_TCB_FROM_TID(taskID); - if (taskCB->taskStatus & OS_TASK_FLAG_SYSTEM_TASK) { - return LOS_EPERM; - } - SCHEDULER_LOCK(intSave); - if (taskCB->taskStatus & OS_TASK_STATUS_UNUSED) { - SCHEDULER_UNLOCK(intSave); - return LOS_EINVAL; - } - - taskCB->ops->schedParamGet(taskCB, ¶m); - param.policy = policy; - param.priority = priority; - BOOL needSched = taskCB->ops->schedParamModify(taskCB, ¶m); + needSched = OsSchedModifyTaskSchedParam(OS_TCB_FROM_TID(taskID), policy, priority); SCHEDULER_UNLOCK(intSave); LOS_MpSchedule(OS_MP_CPU_ALL); @@ -1495,15 +1411,9 @@ STATIC UINT32 OsTaskJoinCheck(UINT32 taskID) return LOS_EINVAL; } - LosTaskCB *taskCB = OS_TCB_FROM_TID(taskID); - if (taskCB->taskStatus & OS_TASK_FLAG_SYSTEM_TASK) { - return LOS_EPERM; - } - - if (taskCB == OsCurrTaskGet()) { + if (taskID == OsCurrTaskGet()->taskID) { return LOS_EDEADLK; } - return LOS_OK; } @@ -1511,6 +1421,7 @@ UINT32 LOS_TaskJoin(UINT32 taskID, UINTPTR *retval) { UINT32 intSave; LosTaskCB *runTask = OsCurrTaskGet(); + LosTaskCB *taskCB = NULL; UINT32 errRet; errRet = OsTaskJoinCheck(taskID); @@ -1518,14 +1429,14 @@ UINT32 LOS_TaskJoin(UINT32 taskID, UINTPTR *retval) return errRet; } - LosTaskCB *taskCB = OS_TCB_FROM_TID(taskID); + taskCB = OS_TCB_FROM_TID(taskID); SCHEDULER_LOCK(intSave); if (taskCB->taskStatus & OS_TASK_STATUS_UNUSED) { SCHEDULER_UNLOCK(intSave); return LOS_EINVAL; } - if (runTask->processCB != taskCB->processCB) { + if (runTask->processID != taskCB->processID) { SCHEDULER_UNLOCK(intSave); return LOS_EPERM; } @@ -1551,6 +1462,7 @@ UINT32 LOS_TaskDetach(UINT32 taskID) { UINT32 intSave; LosTaskCB *runTask = OsCurrTaskGet(); + LosTaskCB *taskCB = NULL; UINT32 errRet; if (OS_TID_CHECK_INVALID(taskID)) { @@ -1561,14 +1473,14 @@ UINT32 LOS_TaskDetach(UINT32 taskID) return LOS_EINTR; } - LosTaskCB *taskCB = OS_TCB_FROM_TID(taskID); + taskCB = OS_TCB_FROM_TID(taskID); SCHEDULER_LOCK(intSave); if (taskCB->taskStatus & OS_TASK_STATUS_UNUSED) { SCHEDULER_UNLOCK(intSave); return LOS_EINVAL; } - if (runTask->processCB != taskCB->processCB) { + if (runTask->processID != taskCB->processID) { SCHEDULER_UNLOCK(intSave); return LOS_EPERM; } @@ -1588,11 +1500,6 @@ LITE_OS_SEC_TEXT UINT32 LOS_GetSystemTaskMaximum(VOID) return g_taskMaxNum; } -LosTaskCB *OsGetDefaultTaskCB(VOID) -{ - return &g_taskCBArray[g_taskMaxNum]; -} - LITE_OS_SEC_TEXT VOID OsWriteResourceEvent(UINT32 events) { (VOID)LOS_EventWrite(&g_resourceEvent, events); diff --git a/src/kernel_liteos_a/kernel/base/core/los_tick.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/core/los_tick.c similarity index 100% rename from src/kernel_liteos_a/kernel/base/core/los_tick.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/core/los_tick.c diff --git a/src/kernel_liteos_a/kernel/base/include/los_base_pri.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/include/los_base_pri.h similarity index 100% rename from src/kernel_liteos_a/kernel/base/include/los_base_pri.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/include/los_base_pri.h diff --git a/src/kernel_liteos_a/kernel/base/include/los_binarytree_pri.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/include/los_binarytree_pri.h similarity index 100% rename from src/kernel_liteos_a/kernel/base/include/los_binarytree_pri.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/include/los_binarytree_pri.h diff --git a/src/kernel_liteos_a/kernel/base/include/los_err_pri.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/include/los_err_pri.h similarity index 100% rename from src/kernel_liteos_a/kernel/base/include/los_err_pri.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/include/los_err_pri.h diff --git a/src/kernel_liteos_a/kernel/base/include/los_event_pri.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/include/los_event_pri.h similarity index 100% rename from src/kernel_liteos_a/kernel/base/include/los_event_pri.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/include/los_event_pri.h diff --git a/src/kernel_liteos_a/kernel/base/include/los_futex_pri.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/include/los_futex_pri.h similarity index 100% rename from src/kernel_liteos_a/kernel/base/include/los_futex_pri.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/include/los_futex_pri.h diff --git a/src/kernel_liteos_a/kernel/base/include/los_ipcdebug_pri.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/include/los_ipcdebug_pri.h similarity index 100% rename from src/kernel_liteos_a/kernel/base/include/los_ipcdebug_pri.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/include/los_ipcdebug_pri.h diff --git a/src/kernel_liteos_a/kernel/base/include/los_membox_pri.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/include/los_membox_pri.h similarity index 100% rename from src/kernel_liteos_a/kernel/base/include/los_membox_pri.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/include/los_membox_pri.h diff --git a/src/kernel_liteos_a/kernel/base/include/los_memory_pri.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/include/los_memory_pri.h similarity index 100% rename from src/kernel_liteos_a/kernel/base/include/los_memory_pri.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/include/los_memory_pri.h diff --git a/src/kernel_liteos_a/kernel/base/include/los_memstat_pri.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/include/los_memstat_pri.h similarity index 100% rename from src/kernel_liteos_a/kernel/base/include/los_memstat_pri.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/include/los_memstat_pri.h diff --git a/src/kernel_liteos_a/kernel/base/include/los_mux_pri.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/include/los_mux_pri.h similarity index 92% rename from src/kernel_liteos_a/kernel/base/include/los_mux_pri.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/include/los_mux_pri.h index 8837114c..129902a8 100644 --- a/src/kernel_liteos_a/kernel/base/include/los_mux_pri.h +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/include/los_mux_pri.h @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2022 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -43,7 +43,7 @@ extern "C" { #define OS_MUX_MAGIC 0xEBCFDEA0 -extern VOID OsMuxBitmapRestore(const LosMux *mutex, const LOS_DL_LIST *list, const LosTaskCB *runTask); +extern VOID OsMuxBitmapRestore(const LosMux *mutex, const LosTaskCB *taskCB, LosTaskCB *owner); extern UINT32 OsMuxLockUnsafe(LosMux *mutex, UINT32 timeout); extern UINT32 OsMuxTrylockUnsafe(LosMux *mutex, UINT32 timeout); extern UINT32 OsMuxUnlockUnsafe(LosTaskCB *taskCB, LosMux *mutex, BOOL *needSched); diff --git a/src/kernel_liteos_a/kernel/base/include/los_oom.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/include/los_oom.h similarity index 100% rename from src/kernel_liteos_a/kernel/base/include/los_oom.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/include/los_oom.h diff --git a/src/kernel_liteos_a/kernel/base/include/los_percpu_pri.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/include/los_percpu_pri.h similarity index 100% rename from src/kernel_liteos_a/kernel/base/include/los_percpu_pri.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/include/los_percpu_pri.h diff --git a/src/kernel_liteos_a/kernel/base/include/los_printf_pri.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/include/los_printf_pri.h similarity index 100% rename from src/kernel_liteos_a/kernel/base/include/los_printf_pri.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/include/los_printf_pri.h diff --git a/src/kernel_liteos_a/kernel/base/include/los_process_pri.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/include/los_process_pri.h similarity index 77% rename from src/kernel_liteos_a/kernel/base/include/los_process_pri.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/include/los_process_pri.h index accd618c..dd39accd 100644 --- a/src/kernel_liteos_a/kernel/base/include/los_process_pri.h +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/include/los_process_pri.h @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2023 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -33,7 +33,6 @@ #define _LOS_PROCESS_PRI_H #include "los_task_pri.h" -#include "sched.h" #include "los_sem_pri.h" #include "los_process.h" #include "los_vm_map.h" @@ -47,12 +46,6 @@ #include "vid_type.h" #endif #include "sys/resource.h" -#ifdef LOSCFG_KERNEL_CONTAINER -#include "los_container_pri.h" -#endif -#ifdef LOSCFG_KERNEL_PLIMITS -#include "los_plimits.h" -#endif #ifdef __cplusplus #if __cplusplus @@ -75,11 +68,11 @@ typedef struct { } User; #endif -typedef struct ProcessGroup { - UINTPTR pgroupLeader; /**< Process group leader is the the process that created the group */ - LOS_DL_LIST processList; /**< List of processes under this process group */ - LOS_DL_LIST exitProcessList; /**< List of closed processes (zombie processes) under this group */ - LOS_DL_LIST groupList; /**< Process group list */ +typedef struct { + UINT32 groupID; /**< Process group ID is the PID of the process that created the group */ + LOS_DL_LIST processList; /**< List of processes under this process group */ + LOS_DL_LIST exitProcessList; /**< List of closed processes (zombie processes) under this group */ + LOS_DL_LIST groupList; /**< Process group list */ } ProcessGroup; typedef struct ProcessCB { @@ -89,15 +82,15 @@ typedef struct ProcessCB { running in the process */ UINT16 consoleID; /**< The console id of task belongs */ UINT16 processMode; /**< Kernel Mode:0; User Mode:1; */ - struct ProcessCB *parentProcess; /**< Parent process */ + UINT32 parentProcessID; /**< Parent process ID */ UINT32 exitCode; /**< Process exit status */ LOS_DL_LIST pendList; /**< Block list to which the process belongs */ LOS_DL_LIST childrenList; /**< Children process list */ LOS_DL_LIST exitChildList; /**< Exit children process list */ LOS_DL_LIST siblingList; /**< Linkage in parent's children list */ - ProcessGroup *pgroup; /**< Process group to which a process belongs */ + ProcessGroup *group; /**< Process group to which a process belongs */ LOS_DL_LIST subordinateGroupList; /**< Linkage in group list */ - LosTaskCB *threadGroup; + UINT32 threadGroupID; /**< Which thread group , is the main thread ID of the process */ LOS_DL_LIST threadSiblingList; /**< List of threads under this process */ volatile UINT32 threadNumber; /**< Number of threads alive under this process */ UINT32 threadCount; /**< Total number of threads created under this process */ @@ -133,36 +126,20 @@ typedef struct ProcessCB { OsCpupBase *processCpup; /**< Process cpu usage */ #endif struct rlimit *resourceLimit; -#ifdef LOSCFG_KERNEL_CONTAINER - Container *container; -#ifdef LOSCFG_USER_CONTAINER - struct Credentials *credentials; -#endif -#endif -#ifdef LOSCFG_PROC_PROCESS_DIR - struct ProcDirEntry *procDir; -#endif -#ifdef LOSCFG_KERNEL_PLIMITS - ProcLimiterSet *plimits; - LOS_DL_LIST plimitsList; /* plimit process list */ - PLimitsData limitStat; -#endif } LosProcessCB; -extern LosProcessCB *g_processCBArray; -extern UINT32 g_processMaxNum; +#define CLONE_VM 0x00000100 +#define CLONE_FS 0x00000200 +#define CLONE_FILES 0x00000400 +#define CLONE_SIGHAND 0x00000800 +#define CLONE_PTRACE 0x00002000 +#define CLONE_VFORK 0x00004000 +#define CLONE_PARENT 0x00008000 +#define CLONE_THREAD 0x00010000 -#define OS_PCB_FROM_RPID(processID) (((LosProcessCB *)g_processCBArray) + (processID)) -#ifdef LOSCFG_PID_CONTAINER -#define OS_PCB_FROM_PID(processID) OsGetPCBFromVpid(processID) -#else -#define OS_PCB_FROM_PID(processID) OS_PCB_FROM_RPID(processID) -#endif -#define OS_PCB_FROM_TCB(taskCB) ((LosProcessCB *)((taskCB)->processCB)) -#define OS_PCB_FROM_TID(taskID) ((LosProcessCB *)(OS_TCB_FROM_TID(taskID)->processCB)) -#define OS_GET_PGROUP_LEADER(pgroup) ((LosProcessCB *)((pgroup)->pgroupLeader)) -#define OS_PCB_FROM_SIBLIST(ptr) LOS_DL_LIST_ENTRY((ptr), LosProcessCB, siblingList) -#define OS_PCB_FROM_PENDLIST(ptr) LOS_DL_LIST_ENTRY((ptr), LosProcessCB, pendList) +#define OS_PCB_FROM_PID(processID) (((LosProcessCB *)g_processCBArray) + (processID)) +#define OS_PCB_FROM_SIBLIST(ptr) LOS_DL_LIST_ENTRY((ptr), LosProcessCB, siblingList) +#define OS_PCB_FROM_PENDLIST(ptr) LOS_DL_LIST_ENTRY((ptr), LosProcessCB, pendList) /** * @ingroup los_process @@ -269,17 +246,12 @@ STATIC INLINE BOOL OsProcessIsInactive(const LosProcessCB *processCB) */ STATIC INLINE BOOL OsProcessIsDead(const LosProcessCB *processCB) { - return ((processCB->processStatus & OS_PROCESS_STATUS_ZOMBIES) != 0); + return ((processCB->processStatus & (OS_PROCESS_FLAG_UNUSED | OS_PROCESS_STATUS_ZOMBIES)) != 0); } STATIC INLINE BOOL OsProcessIsInit(const LosProcessCB *processCB) { - return ((processCB->processStatus & OS_PROCESS_STATUS_INIT) != 0); -} - -STATIC INLINE BOOL OsProcessIsPGroupLeader(const LosProcessCB *processCB) -{ - return ((processCB->processStatus & OS_PROCESS_FLAG_GROUP_LEADER) != 0); + return (processCB->processStatus & OS_PROCESS_STATUS_INIT); } /** @@ -312,24 +284,6 @@ STATIC INLINE BOOL OsProcessIsPGroupLeader(const LosProcessCB *processCB) */ #define OS_PROCESS_USERINIT_PRIORITY 28 -/** - * @ingroup los_process - * ID of the kernel idle process - */ -#define OS_KERNEL_IDLE_PROCESS_ID 0U - -/** - * @ingroup los_process - * ID of the user root process - */ -#define OS_USER_ROOT_PROCESS_ID 1U - -/** - * @ingroup los_process - * ID of the kernel root process - */ -#define OS_KERNEL_ROOT_PROCESS_ID 2U - #define OS_TASK_DEFAULT_STACK_SIZE 0x2000 #define OS_USER_TASK_SYSCALL_STACK_SIZE 0x3000 #define OS_USER_TASK_STACK_SIZE 0x100000 @@ -341,12 +295,17 @@ STATIC INLINE BOOL OsProcessIsUserMode(const LosProcessCB *processCB) return (processCB->processMode == OS_USER_MODE); } +#define LOS_SCHED_NORMAL 0U +#define LOS_SCHED_FIFO 1U +#define LOS_SCHED_RR 2U +#define LOS_SCHED_IDLE 3U + #define LOS_PRIO_PROCESS 0U #define LOS_PRIO_PGRP 1U #define LOS_PRIO_USER 2U -#define OS_USER_PRIVILEGE_PROCESS_GROUP ((UINTPTR)OsGetUserInitProcess()) -#define OS_KERNEL_PROCESS_GROUP ((UINTPTR)OsGetKernelInitProcess()) +#define OS_USER_PRIVILEGE_PROCESS_GROUP 1U +#define OS_KERNEL_PROCESS_GROUP 2U /* * Process exit code @@ -380,6 +339,9 @@ STATIC INLINE VOID OsProcessExitCodeSet(LosProcessCB *processCB, UINT32 code) processCB->exitCode |= ((code & 0x000000FFU) << 8U) & 0x0000FF00U; /* 8: Move 8 bits to the left, exitCode */ } +extern LosProcessCB *g_processCBArray; +extern UINT32 g_processMaxNum; + #define OS_PID_CHECK_INVALID(pid) (((UINT32)(pid)) >= g_processMaxNum) STATIC INLINE BOOL OsProcessIDUserCheckInvalid(UINT32 pid) @@ -392,7 +354,7 @@ STATIC INLINE LosProcessCB *OsCurrProcessGet(VOID) UINT32 intSave; intSave = LOS_IntLock(); - LosProcessCB *runProcess = OS_PCB_FROM_TCB(OsCurrTaskGet()); + LosProcessCB *runProcess = OS_PCB_FROM_PID(OsCurrTaskGet()->processID); LOS_IntRestore(intSave); return runProcess; } @@ -414,7 +376,7 @@ STATIC INLINE UINT32 OsProcessUserIDGet(const LosTaskCB *taskCB) UINT32 intSave = LOS_IntLock(); UINT32 uid = OS_INVALID; - LosProcessCB *process = OS_PCB_FROM_TCB(taskCB); + LosProcessCB *process = OS_PCB_FROM_PID(taskCB->processID); if (process->user != NULL) { uid = process->user->userID; } @@ -423,14 +385,14 @@ STATIC INLINE UINT32 OsProcessUserIDGet(const LosTaskCB *taskCB) } #endif -STATIC INLINE BOOL OsIsProcessThreadGroup(const LosTaskCB *taskCB) +STATIC INLINE UINT32 OsProcessThreadGroupIDGet(const LosTaskCB *taskCB) { - return (OS_PCB_FROM_TCB(taskCB)->threadGroup == taskCB); + return OS_PCB_FROM_PID(taskCB->processID)->threadGroupID; } STATIC INLINE UINT32 OsProcessThreadNumberGet(const LosTaskCB *taskCB) { - return OS_PCB_FROM_TCB(taskCB)->threadNumber; + return OS_PCB_FROM_PID(taskCB->processID)->threadNumber; } #ifdef LOSCFG_KERNEL_VM @@ -446,26 +408,6 @@ STATIC INLINE struct Vnode *OsProcessExecVnodeGet(const LosProcessCB *processCB) return processCB->execVnode; } #endif - -STATIC INLINE UINT32 OsGetPid(const LosProcessCB *processCB) -{ -#ifdef LOSCFG_PID_CONTAINER - if (OS_PROCESS_CONTAINER_CHECK(processCB, OsCurrProcessGet())) { - return OsGetVpidFromCurrContainer(processCB); - } -#endif - return processCB->processID; -} - -STATIC INLINE UINT32 OsGetRootPid(const LosProcessCB *processCB) -{ -#ifdef LOSCFG_PID_CONTAINER - return OsGetVpidFromRootContainer(processCB); -#else - return processCB->processID; -#endif -} - /* * return immediately if no child has exited. */ @@ -523,7 +465,6 @@ extern UINTPTR __user_init_entry; extern UINTPTR __user_init_bss; extern UINTPTR __user_init_end; extern UINTPTR __user_init_load_addr; -extern UINT32 OsProcessInit(VOID); extern UINT32 OsSystemProcessCreate(VOID); extern VOID OsProcessNaturalExit(LosProcessCB *processCB, UINT32 status); extern VOID OsProcessCBRecycleToFree(VOID); @@ -535,25 +476,22 @@ extern LosVmSpace *OsExecProcessVmSpaceReplace(LosVmSpace *newSpace, UINTPTR sta extern UINT32 OsExecRecycleAndInit(LosProcessCB *processCB, const CHAR *name, LosVmSpace *oldAspace, UINTPTR oldFiles); extern UINT32 OsExecStart(const TSK_ENTRY_FUNC entry, UINTPTR sp, UINTPTR mapBase, UINT32 mapSize); extern UINT32 OsSetProcessName(LosProcessCB *processCB, const CHAR *name); -extern INT32 OsSetProcessScheduler(INT32 which, INT32 pid, UINT16 policy, const LosSchedParam *param); +extern INT32 OsSetProcessScheduler(INT32 which, INT32 pid, UINT16 prio, UINT16 policy); extern INT32 OsGetProcessPriority(INT32 which, INT32 pid); -extern LosProcessCB *OsGetUserInitProcess(VOID); -extern LosProcessCB *OsGetIdleProcess(VOID); +extern UINT32 OsGetUserInitProcessID(VOID); +extern UINT32 OsGetIdleProcessID(VOID); extern INT32 OsSetProcessGroupID(UINT32 pid, UINT32 gid); extern INT32 OsSetCurrProcessGroupID(UINT32 gid); -extern LosProcessCB *OsGetKernelInitProcess(VOID); +extern UINT32 OsGetKernelInitProcessID(VOID); extern VOID OsSetSigHandler(UINTPTR addr); extern UINTPTR OsGetSigHandler(VOID); extern VOID OsWaitWakeTask(LosTaskCB *taskCB, UINT32 wakePID); extern INT32 OsSendSignalToProcessGroup(INT32 pid, siginfo_t *info, INT32 permission); extern INT32 OsSendSignalToAllProcess(siginfo_t *info, INT32 permission); -extern UINT32 OsProcessAddNewTask(UINTPTR processID, LosTaskCB *taskCB, SchedParam *param, UINT32 *numCount); +extern UINT32 OsProcessAddNewTask(UINT32 pid, LosTaskCB *taskCB); extern VOID OsDeleteTaskFromProcess(LosTaskCB *taskCB); extern VOID OsProcessThreadGroupDestroy(VOID); -extern UINT32 OsGetProcessGroupCB(UINT32 pid, UINTPTR *ppgroupLeader); -extern LosProcessCB *OsGetDefaultProcessCB(VOID); -extern ProcessGroup *OsCreateProcessGroup(LosProcessCB *processCB); -INT32 OsSchedulerParamCheck(UINT16 policy, BOOL isThread, const LosSchedParam *param); + #ifdef __cplusplus #if __cplusplus } diff --git a/src/kernel_liteos_a/kernel/base/include/los_queue_debug_pri.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/include/los_queue_debug_pri.h similarity index 100% rename from src/kernel_liteos_a/kernel/base/include/los_queue_debug_pri.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/include/los_queue_debug_pri.h diff --git a/src/kernel_liteos_a/kernel/base/include/los_queue_pri.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/include/los_queue_pri.h similarity index 96% rename from src/kernel_liteos_a/kernel/base/include/los_queue_pri.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/include/los_queue_pri.h index 4efafe23..96472859 100644 --- a/src/kernel_liteos_a/kernel/base/include/los_queue_pri.h +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/include/los_queue_pri.h @@ -65,7 +65,7 @@ typedef enum { * @ingroup los_queue * Queue information block structure */ -typedef struct TagQueueCB { +typedef struct { UINT8 *queueHandle; /**< Pointer to a queue handle */ UINT16 queueState; /**< Queue state */ UINT16 queueLen; /**< Queue length */ @@ -108,9 +108,6 @@ typedef struct TagQueueCB { * Queue information control block */ extern LosQueueCB *g_allQueue; -#ifndef LOSCFG_IPC_CONTAINER -#define IPC_ALL_QUEUE g_allQueue -#endif /** * @ingroup los_queue @@ -140,7 +137,7 @@ extern LosQueueCB *g_allQueue; * Obtain a handle of the queue that has a specified ID. * */ -#define GET_QUEUE_HANDLE(queueID) (((LosQueueCB *)IPC_ALL_QUEUE) + GET_QUEUE_INDEX(queueID)) +#define GET_QUEUE_HANDLE(queueID) (((LosQueueCB *)g_allQueue) + GET_QUEUE_INDEX(queueID)) /** * @ingroup los_queue @@ -199,8 +196,6 @@ extern VOID *OsQueueMailAlloc(UINT32 queueID, VOID *mailPool, UINT32 timeout); */ extern UINT32 OsQueueMailFree(UINT32 queueID, VOID *mailPool, VOID *mailMem); -extern LosQueueCB *OsAllQueueCBInit(LOS_DL_LIST *freeQueueList); - extern UINT32 OsQueueInit(VOID); #ifdef __cplusplus diff --git a/src/kernel_liteos_a/kernel/base/include/los_rwlock_pri.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/include/los_rwlock_pri.h similarity index 96% rename from src/kernel_liteos_a/kernel/base/include/los_rwlock_pri.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/include/los_rwlock_pri.h index 4b0711f7..cf1158a7 100644 --- a/src/kernel_liteos_a/kernel/base/include/los_rwlock_pri.h +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/include/los_rwlock_pri.h @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2022 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -41,7 +41,7 @@ extern "C" { #endif /* __cplusplus */ #endif /* __cplusplus */ -#define OS_RWLOCK_MAGIC 0xEFDCAU +#define OS_RWLOCK_MAGIC 0xBEFDCAU enum RwlockMode { RWLOCK_NONE_MODE, diff --git a/src/kernel_liteos_a/kernel/base/include/los_sched_pri.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/include/los_sched_pri.h similarity index 50% rename from src/kernel_liteos_a/kernel/base/include/los_sched_pri.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/include/los_sched_pri.h index 1bbf0070..08552b5b 100644 --- a/src/kernel_liteos_a/kernel/base/include/los_sched_pri.h +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/include/los_sched_pri.h @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2023 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -37,13 +37,10 @@ #include "los_hwi.h" #include "hal_timer.h" #ifdef LOSCFG_SCHED_DEBUG -#include "los_statistics_pri.h" +#include "los_stat_pri.h" #endif #include "los_stackinfo_pri.h" #include "los_futex_pri.h" -#ifdef LOSCFG_KERNEL_PM -#include "los_pm_pri.h" -#endif #include "los_signal.h" #ifdef LOSCFG_KERNEL_CPUP #include "los_cpup_pri.h" @@ -51,10 +48,6 @@ #ifdef LOSCFG_KERNEL_LITEIPC #include "hm_liteipc.h" #endif -#include "los_mp.h" -#ifdef LOSCFG_KERNEL_CONTAINER -#include "los_container_pri.h" -#endif #ifdef __cplusplus #if __cplusplus @@ -62,21 +55,14 @@ extern "C" { #endif /* __cplusplus */ #endif /* __cplusplus */ -#define OS_SCHED_MINI_PERIOD (OS_SYS_CLOCK / LOSCFG_BASE_CORE_TICK_PER_SECOND_MINI) -#define OS_TICK_RESPONSE_PRECISION (UINT32)((OS_SCHED_MINI_PERIOD * 75) / 100) -#define OS_SCHED_MAX_RESPONSE_TIME OS_SORT_LINK_INVALID_TIME -#define OS_SCHED_TICK_TO_CYCLE(ticks) ((UINT64)ticks * OS_CYCLE_PER_TICK) -#define AFFI_MASK_TO_CPUID(mask) ((UINT16)((mask) - 1)) - -#define OS_SCHED_EDF_MIN_RUNTIME 100 /* 100 us */ -#define OS_SCHED_EDF_MIN_DEADLINE 400 /* 400 us */ -#define OS_SCHED_EDF_MAX_DEADLINE 5000000 /* 5 s */ +#define OS_SCHED_MINI_PERIOD (OS_SYS_CLOCK / LOSCFG_BASE_CORE_TICK_PER_SECOND_MINI) +#define OS_TICK_RESPONSE_PRECISION (UINT32)((OS_SCHED_MINI_PERIOD * 75) / 100) +#define OS_SCHED_MAX_RESPONSE_TIME (UINT64)(((UINT64)-1) - 1U) extern UINT32 g_taskScheduled; #define OS_SCHEDULER_ACTIVE (g_taskScheduled & (1U << ArchCurrCpuid())) #define OS_SCHEDULER_ALL_ACTIVE (g_taskScheduled == LOSCFG_KERNEL_CPU_MASK) -typedef struct TagTaskCB LosTaskCB; typedef BOOL (*SCHED_TL_FIND_FUNC)(UINTPTR, UINTPTR); STATIC INLINE UINT64 OsGetCurrSchedTimeCycle(VOID) @@ -90,72 +76,53 @@ typedef enum { INT_PEND_TICK = 0x2, /* pending tick */ } SchedFlag; -#define OS_PRIORITY_QUEUE_NUM 32 -typedef struct { - LOS_DL_LIST priQueList[OS_PRIORITY_QUEUE_NUM]; - UINT32 readyTasks[OS_PRIORITY_QUEUE_NUM]; - UINT32 queueBitmap; -} HPFQueue; - -typedef struct { - HPFQueue queueList[OS_PRIORITY_QUEUE_NUM]; - UINT32 queueBitmap; -} HPFRunqueue; - -typedef struct { - LOS_DL_LIST root; - LOS_DL_LIST waitList; - UINT64 period; -} EDFRunqueue; - typedef struct { - SortLinkAttribute timeoutQueue; /* task timeout queue */ - HPFRunqueue *hpfRunqueue; - EDFRunqueue *edfRunqueue; - UINT64 responseTime; /* Response time for current CPU tick interrupts */ - UINT32 responseID; /* The response ID of the current CPU tick interrupt */ - LosTaskCB *idleTask; /* idle task id */ - UINT32 taskLockCnt; /* task lock flag */ - UINT32 schedFlag; /* pending scheduler flag */ -} SchedRunqueue; + SortLinkAttribute taskSortLink; /* task sort link */ + SortLinkAttribute swtmrSortLink; /* swtmr sort link */ + UINT64 responseTime; /* Response time for current CPU tick interrupts */ + UINT32 responseID; /* The response ID of the current CPU tick interrupt */ + UINT32 idleTaskID; /* idle task id */ + UINT32 taskLockCnt; /* task lock flag */ + UINT32 swtmrTaskID; /* software timer task id */ + UINT32 swtmrHandlerQueue; /* software timer timeout queue id */ + UINT32 schedFlag; /* pending scheduler flag */ +} SchedRunQue; -extern SchedRunqueue g_schedRunqueue[LOSCFG_KERNEL_CORE_NUM]; +extern SchedRunQue g_schedRunQue[LOSCFG_KERNEL_CORE_NUM]; -VOID OsSchedExpireTimeUpdate(VOID); - -STATIC INLINE SchedRunqueue *OsSchedRunqueue(VOID) +STATIC INLINE SchedRunQue *OsSchedRunQue(VOID) { - return &g_schedRunqueue[ArchCurrCpuid()]; + return &g_schedRunQue[ArchCurrCpuid()]; } -STATIC INLINE SchedRunqueue *OsSchedRunqueueByID(UINT16 id) +STATIC INLINE SchedRunQue *OsSchedRunQueByID(UINT16 id) { - return &g_schedRunqueue[id]; + return &g_schedRunQue[id]; } STATIC INLINE UINT32 OsSchedLockCountGet(VOID) { - return OsSchedRunqueue()->taskLockCnt; + return OsSchedRunQue()->taskLockCnt; } STATIC INLINE VOID OsSchedLockSet(UINT32 count) { - OsSchedRunqueue()->taskLockCnt = count; + OsSchedRunQue()->taskLockCnt = count; } STATIC INLINE VOID OsSchedLock(VOID) { - OsSchedRunqueue()->taskLockCnt++; + OsSchedRunQue()->taskLockCnt++; } STATIC INLINE VOID OsSchedUnlock(VOID) { - OsSchedRunqueue()->taskLockCnt--; + OsSchedRunQue()->taskLockCnt--; } STATIC INLINE BOOL OsSchedUnlockResch(VOID) { - SchedRunqueue *rq = OsSchedRunqueue(); + SchedRunQue *rq = OsSchedRunQue(); if (rq->taskLockCnt > 0) { rq->taskLockCnt--; if ((rq->taskLockCnt == 0) && (rq->schedFlag & INT_PEND_RESCH) && OS_SCHEDULER_ACTIVE) { @@ -168,13 +135,13 @@ STATIC INLINE BOOL OsSchedUnlockResch(VOID) STATIC INLINE BOOL OsSchedIsLock(VOID) { - return (OsSchedRunqueue()->taskLockCnt != 0); + return (OsSchedRunQue()->taskLockCnt != 0); } /* Check if preemptible with counter flag */ STATIC INLINE BOOL OsPreemptable(VOID) { - SchedRunqueue *rq = OsSchedRunqueue(); + SchedRunQue *rq = OsSchedRunQue(); /* * Unlike OsPreemptableInSched, the int may be not disabled when OsPreemptable * is called, needs manually disable interrupt, to prevent current task from @@ -193,7 +160,7 @@ STATIC INLINE BOOL OsPreemptable(VOID) STATIC INLINE BOOL OsPreemptableInSched(VOID) { BOOL preemptible = FALSE; - SchedRunqueue *rq = OsSchedRunqueue(); + SchedRunQue *rq = OsSchedRunQue(); #ifdef LOSCFG_KERNEL_SMP /* @@ -213,84 +180,85 @@ STATIC INLINE BOOL OsPreemptableInSched(VOID) return preemptible; } -STATIC INLINE LosTaskCB *OsSchedRunqueueIdleGet(VOID) +STATIC INLINE UINT32 OsSchedGetRunQueIdle(VOID) { - return OsSchedRunqueue()->idleTask; + return OsSchedRunQue()->idleTaskID; } -STATIC INLINE VOID OsSchedRunqueuePendingSet(VOID) +STATIC INLINE VOID OsSchedRunQuePendingSet(VOID) { - OsSchedRunqueue()->schedFlag |= INT_PEND_RESCH; + OsSchedRunQue()->schedFlag |= INT_PEND_RESCH; } -#define LOS_SCHED_NORMAL 0U -#define LOS_SCHED_FIFO 1U -#define LOS_SCHED_RR 2U -#define LOS_SCHED_IDLE 3U -#define LOS_SCHED_DEADLINE 6U +#ifdef LOSCFG_KERNEL_SMP +STATIC INLINE VOID FindIdleRunQue(UINT16 *idleCpuID) +{ + SchedRunQue *idleRq = OsSchedRunQueByID(0); + UINT32 nodeNum = OsGetSortLinkNodeNum(&idleRq->taskSortLink) + OsGetSortLinkNodeNum(&idleRq->swtmrSortLink); + UINT16 cpuID = 1; + do { + SchedRunQue *rq = OsSchedRunQueByID(cpuID); + UINT32 temp = OsGetSortLinkNodeNum(&rq->taskSortLink) + OsGetSortLinkNodeNum(&rq->swtmrSortLink); + if (nodeNum > temp) { + *idleCpuID = cpuID; + nodeNum = temp; + } + cpuID++; + } while (cpuID < LOSCFG_KERNEL_CORE_NUM); +} +#endif -typedef struct { - UINT16 policy; - /* HPF scheduling parameters */ - UINT16 basePrio; - UINT16 priority; - UINT32 timeSlice; - - /* EDF scheduling parameters */ - INT32 runTimeUs; - UINT32 deadlineUs; - UINT32 periodUs; -} SchedParam; +STATIC INLINE VOID OsSchedAddTask2TimeList(SortLinkList *node, UINT64 startTime, UINT32 waitTicks) +{ + UINT16 idleCpu = 0; +#ifdef LOSCFG_KERNEL_SMP + FindIdleRunQue(&idleCpu); +#endif + SchedRunQue *rq = OsSchedRunQueByID(idleCpu); + UINT64 responseTime = startTime + (UINT64)waitTicks * OS_CYCLE_PER_TICK; + OsAdd2SortLink(&rq->taskSortLink, node, responseTime, idleCpu); +} -typedef struct { - UINT16 policy; /* This field must be present for all scheduling policies and must be the first in the structure */ - UINT16 basePrio; - UINT16 priority; - UINT32 initTimeSlice; /* cycle */ - UINT32 priBitmap; /* Bitmap for recording the change of task priority, the priority can not be greater than 31 */ -} SchedHPF; - -#define EDF_UNUSED 0 -#define EDF_NEXT_PERIOD 1 -#define EDF_WAIT_FOREVER 2 -#define EDF_INIT 3 -typedef struct { - UINT16 policy; - UINT16 cpuid; - UINT32 flags; - INT32 runTime; /* cycle */ - UINT64 deadline; /* deadline >> runTime */ - UINT64 period; /* period >= deadline */ - UINT64 finishTime; /* startTime + deadline */ -} SchedEDF; +STATIC INLINE UINT32 OsSchedSwtmrHandlerQueueGet(VOID) +{ + return OsSchedRunQue()->swtmrHandlerQueue; +} -typedef struct { - union { - SchedEDF edf; - SchedHPF hpf; - }; -} SchedPolicy; +STATIC INLINE VOID OsSchedDeTaskFromTimeList(SortLinkList *node) +{ +#ifdef LOSCFG_KERNEL_SMP + SchedRunQue *rq = OsSchedRunQueByID(node->cpuid); +#else + SchedRunQue *rq = OsSchedRunQueByID(0); +#endif + OsDeleteFromSortLink(&rq->taskSortLink, node); +} -typedef struct { - VOID (*dequeue)(SchedRunqueue *rq, LosTaskCB *taskCB); - VOID (*enqueue)(SchedRunqueue *rq, LosTaskCB *taskCB); - VOID (*start)(SchedRunqueue *rq, LosTaskCB *taskCB); - VOID (*exit)(LosTaskCB *taskCB); - UINT64 (*waitTimeGet)(LosTaskCB *taskCB); - UINT32 (*wait)(LosTaskCB *runTask, LOS_DL_LIST *list, UINT32 timeout); - VOID (*wake)(LosTaskCB *taskCB); - BOOL (*schedParamModify)(LosTaskCB *taskCB, const SchedParam *param); - UINT32 (*schedParamGet)(const LosTaskCB *taskCB, SchedParam *param); - UINT32 (*delay)(LosTaskCB *taskCB, UINT64 waitTime); - VOID (*yield)(LosTaskCB *taskCB); - UINT32 (*suspend)(LosTaskCB *taskCB); - UINT32 (*resume)(LosTaskCB *taskCB, BOOL *needSched); - UINT64 (*deadlineGet)(const LosTaskCB *taskCB); - VOID (*timeSliceUpdate)(SchedRunqueue *rq, LosTaskCB *taskCB, UINT64 currTime); - INT32 (*schedParamCompare)(const SchedPolicy *sp1, const SchedPolicy *sp2); - VOID (*priorityInheritance)(LosTaskCB *owner, const SchedParam *param); - VOID (*priorityRestore)(LosTaskCB *owner, const LOS_DL_LIST *list, const SchedParam *param); -} SchedOps; +STATIC INLINE VOID OsSchedAddSwtmr2TimeList(SortLinkList *node, UINT64 startTime, UINT32 waitTicks) +{ + UINT16 idleCpu = 0; +#ifdef LOSCFG_KERNEL_SMP + FindIdleRunQue(&idleCpu); +#endif + SchedRunQue *rq = OsSchedRunQueByID(idleCpu); + UINT64 responseTime = startTime + (UINT64)waitTicks * OS_CYCLE_PER_TICK; + OsAdd2SortLink(&rq->swtmrSortLink, node, responseTime, idleCpu); +} + +STATIC INLINE VOID OsSchedDeSwtmrFromTimeList(SortLinkList *node) +{ +#ifdef LOSCFG_KERNEL_SMP + SchedRunQue *rq = OsSchedRunQueByID(node->cpuid); +#else + SchedRunQue *rq = OsSchedRunQueByID(0); +#endif + OsDeleteFromSortLink(&rq->swtmrSortLink, node); +} + +VOID OsSchedRunQueIdleInit(UINT32 idleTaskID); +VOID OsSchedRunQueSwtmrInit(UINT32 swtmrTaskID, UINT32 swtmrQueue); +VOID OsSchedRunQueInit(VOID); +BOOL OsSchedSwtmrTimeListFind(SCHED_TL_FIND_FUNC checkFunc, UINTPTR arg); /** * @ingroup los_sched @@ -380,31 +348,23 @@ typedef struct { */ #define OS_TASK_STATUS_EXIT 0x0100U -#define OS_TASK_STATUS_BLOCKED (OS_TASK_STATUS_INIT | OS_TASK_STATUS_PENDING | \ - OS_TASK_STATUS_DELAY | OS_TASK_STATUS_PEND_TIME) - -/** - * @ingroup los_task - * Flag that indicates the task or task control block status. - * - * The delayed operation of this task is frozen. - */ -#define OS_TASK_STATUS_FROZEN 0x0200U - #define OS_TCB_NAME_LEN 32 -typedef struct TagTaskCB { +typedef struct { VOID *stackPointer; /**< Task stack pointer */ UINT16 taskStatus; /**< Task status */ + /* The scheduling */ + UINT16 basePrio; + UINT16 priority; /**< Task priority */ + UINT16 policy; UINT64 startTime; /**< The start time of each phase of task */ - UINT64 waitTime; /**< Task delay time, tick number */ UINT64 irqStartTime; /**< Interrupt start time */ UINT32 irqUsedTime; /**< Interrupt consumption time */ + UINT32 initTimeSlice; /**< Task init time slice */ INT32 timeSlice; /**< Task remaining time slice */ + UINT32 waitTimes; /**< Task delay time, tick number */ SortLinkList sortList; /**< Task sortlink node */ - const SchedOps *ops; - SchedPolicy sp; UINT32 stackSize; /**< Task stack size */ UINTPTR topOfStack; /**< Task stack top */ @@ -419,6 +379,8 @@ typedef struct TagTaskCB { LOS_DL_LIST threadList; /**< thread list */ UINT32 eventMask; /**< Event mask */ UINT32 eventMode; /**< Event mode */ + UINT32 priBitMap; /**< BitMap for recording the change of task priority, + the priority can not be greater than 31 */ #ifdef LOSCFG_KERNEL_CPUP OsCpupBase taskCpup; /**< task cpu usage */ #endif @@ -446,7 +408,7 @@ typedef struct TagTaskCB { UINT32 userMapSize; /**< user thread stack size ,real size : userMapSize + USER_STACK_MIN_SIZE */ FutexNode futex; #endif - UINTPTR processCB; /**< Which belong process */ + UINT32 processID; /**< Which belong process */ LOS_DL_LIST joinList; /**< join list */ LOS_DL_LIST lockList; /**< Hold the lock list */ UINTPTR waitID; /**< Wait for the PID or GID of the child process */ @@ -459,12 +421,6 @@ typedef struct TagTaskCB { UINTPTR pc; UINTPTR fp; #endif -#ifdef LOSCFG_PID_CONTAINER - PidContainer *pidContainer; -#endif -#ifdef LOSCFG_IPC_CONTAINER - BOOL cloneIpc; -#endif } LosTaskCB; STATIC INLINE BOOL OsTaskIsRunning(const LosTaskCB *taskCB) @@ -497,12 +453,6 @@ STATIC INLINE BOOL OsTaskIsBlocked(const LosTaskCB *taskCB) return ((taskCB->taskStatus & (OS_TASK_STATUS_SUSPENDED | OS_TASK_STATUS_PENDING | OS_TASK_STATUS_DELAY)) != 0); } -STATIC INLINE BOOL OsSchedPolicyIsEDF(const LosTaskCB *taskCB) -{ - const SchedEDF *sched = (const SchedEDF *)&taskCB->sp; - return (sched->policy == LOS_SCHED_DEADLINE); -} - STATIC INLINE LosTaskCB *OsCurrTaskGet(VOID) { return (LosTaskCB *)ArchCurrTaskGet(); @@ -518,7 +468,7 @@ STATIC INLINE VOID OsCurrUserTaskSet(UINTPTR thread) ArchCurrUserTaskSet(thread); } -STATIC INLINE VOID OsSchedIrqUsedTimeUpdate(VOID) +STATIC INLINE VOID OsSchedIrqUpdateUsedTime(VOID) { LosTaskCB *runTask = OsCurrTaskGet(); runTask->irqUsedTime = OsGetCurrSchedTimeCycle() - runTask->irqStartTime; @@ -530,123 +480,6 @@ STATIC INLINE VOID OsSchedIrqStartTime(VOID) runTask->irqStartTime = OsGetCurrSchedTimeCycle(); } -#ifdef LOSCFG_KERNEL_SMP -STATIC INLINE VOID IdleRunqueueFind(UINT16 *idleCpuid) -{ - SchedRunqueue *idleRq = OsSchedRunqueueByID(0); - UINT32 nodeNum = OsGetSortLinkNodeNum(&idleRq->timeoutQueue); - UINT16 cpuid = 1; - do { - SchedRunqueue *rq = OsSchedRunqueueByID(cpuid); - UINT32 temp = OsGetSortLinkNodeNum(&rq->timeoutQueue); - if (nodeNum > temp) { - *idleCpuid = cpuid; - nodeNum = temp; - } - cpuid++; - } while (cpuid < LOSCFG_KERNEL_CORE_NUM); -} -#endif - -STATIC INLINE VOID OsSchedTimeoutQueueAdd(LosTaskCB *taskCB, UINT64 responseTime) -{ -#ifdef LOSCFG_KERNEL_SMP - UINT16 cpuid = AFFI_MASK_TO_CPUID(taskCB->cpuAffiMask); - if (cpuid >= LOSCFG_KERNEL_CORE_NUM) { - cpuid = 0; - IdleRunqueueFind(&cpuid); - } -#else - UINT16 cpuid = 0; -#endif - - SchedRunqueue *rq = OsSchedRunqueueByID(cpuid); - OsAdd2SortLink(&rq->timeoutQueue, &taskCB->sortList, responseTime, cpuid); -#ifdef LOSCFG_KERNEL_SMP - if ((cpuid != ArchCurrCpuid()) && (responseTime < rq->responseTime)) { - rq->schedFlag |= INT_PEND_TICK; - LOS_MpSchedule(CPUID_TO_AFFI_MASK(cpuid)); - } -#endif -} - -STATIC INLINE VOID OsSchedTimeoutQueueDelete(LosTaskCB *taskCB) -{ - SortLinkList *node = &taskCB->sortList; -#ifdef LOSCFG_KERNEL_SMP - SchedRunqueue *rq = OsSchedRunqueueByID(node->cpuid); -#else - SchedRunqueue *rq = OsSchedRunqueueByID(0); -#endif - UINT64 oldResponseTime = GET_SORTLIST_VALUE(node); - OsDeleteFromSortLink(&rq->timeoutQueue, node); - if (oldResponseTime <= rq->responseTime) { - rq->responseTime = OS_SCHED_MAX_RESPONSE_TIME; - } -} - -STATIC INLINE UINT32 OsSchedTimeoutQueueAdjust(LosTaskCB *taskCB, UINT64 responseTime) -{ - UINT32 ret; - SortLinkList *node = &taskCB->sortList; -#ifdef LOSCFG_KERNEL_SMP - UINT16 cpuid = node->cpuid; -#else - UINT16 cpuid = 0; -#endif - SchedRunqueue *rq = OsSchedRunqueueByID(cpuid); - ret = OsSortLinkAdjustNodeResponseTime(&rq->timeoutQueue, node, responseTime); - if (ret == LOS_OK) { - rq->schedFlag |= INT_PEND_TICK; - } - return ret; -} - -STATIC INLINE VOID SchedTaskFreeze(LosTaskCB *taskCB) -{ - UINT64 responseTime; - -#ifdef LOSCFG_KERNEL_PM - if (!OsIsPmMode()) { - return; - } -#endif - - if (!(taskCB->taskStatus & (OS_TASK_STATUS_PEND_TIME | OS_TASK_STATUS_DELAY))) { - return; - } - - responseTime = GET_SORTLIST_VALUE(&taskCB->sortList); - OsSchedTimeoutQueueDelete(taskCB); - SET_SORTLIST_VALUE(&taskCB->sortList, responseTime); - taskCB->taskStatus |= OS_TASK_STATUS_FROZEN; - return; -} - -STATIC INLINE VOID SchedTaskUnfreeze(LosTaskCB *taskCB) -{ - UINT64 currTime, responseTime; - - if (!(taskCB->taskStatus & OS_TASK_STATUS_FROZEN)) { - return; - } - - taskCB->taskStatus &= ~OS_TASK_STATUS_FROZEN; - currTime = OsGetCurrSchedTimeCycle(); - responseTime = GET_SORTLIST_VALUE(&taskCB->sortList); - if (responseTime > currTime) { - OsSchedTimeoutQueueAdd(taskCB, responseTime); - return; - } - - SET_SORTLIST_VALUE(&taskCB->sortList, OS_SORT_LINK_INVALID_TIME); - if (taskCB->taskStatus & OS_TASK_STATUS_PENDING) { - LOS_ListDelete(&taskCB->pendList); - } - taskCB->taskStatus &= ~OS_TASK_STATUS_BLOCKED; - return; -} - /* * Schedule flag, one bit represents one core. * This flag is used to prevent kernel scheduling before OSStartToRun. @@ -659,87 +492,25 @@ STATIC INLINE VOID SchedTaskUnfreeze(LosTaskCB *taskCB) g_taskScheduled &= ~(1U << (cpuid)); \ } while (0); -#ifdef LOSCFG_KERNEL_SCHED_PLIMIT -BOOL OsSchedLimitCheckTime(LosTaskCB *task); -#endif - -STATIC INLINE LosTaskCB *EDFRunqueueTopTaskGet(EDFRunqueue *rq) -{ - LOS_DL_LIST *root = &rq->root; - if (LOS_ListEmpty(root)) { - return NULL; - } - - return LOS_DL_LIST_ENTRY(LOS_DL_LIST_FIRST(root), LosTaskCB, pendList); -} - -STATIC INLINE LosTaskCB *HPFRunqueueTopTaskGet(HPFRunqueue *rq) -{ - LosTaskCB *newTask = NULL; - UINT32 baseBitmap = rq->queueBitmap; -#ifdef LOSCFG_KERNEL_SMP - UINT32 cpuid = ArchCurrCpuid(); -#endif - - while (baseBitmap) { - UINT32 basePrio = CLZ(baseBitmap); - HPFQueue *queueList = &rq->queueList[basePrio]; - UINT32 bitmap = queueList->queueBitmap; - while (bitmap) { - UINT32 priority = CLZ(bitmap); - LOS_DL_LIST_FOR_EACH_ENTRY(newTask, &queueList->priQueList[priority], LosTaskCB, pendList) { -#ifdef LOSCFG_KERNEL_SCHED_PLIMIT - if (!OsSchedLimitCheckTime(newTask)) { - bitmap &= ~(1U << (OS_PRIORITY_QUEUE_NUM - priority - 1)); - continue; - } -#endif -#ifdef LOSCFG_KERNEL_SMP - if (newTask->cpuAffiMask & (1U << cpuid)) { -#endif - return newTask; -#ifdef LOSCFG_KERNEL_SMP - } -#endif - } - bitmap &= ~(1U << (OS_PRIORITY_QUEUE_NUM - priority - 1)); - } - baseBitmap &= ~(1U << (OS_PRIORITY_QUEUE_NUM - basePrio - 1)); - } - - return NULL; -} - -VOID EDFProcessDefaultSchedParamGet(SchedParam *param); -VOID EDFSchedPolicyInit(SchedRunqueue *rq); -UINT32 EDFTaskSchedParamInit(LosTaskCB *taskCB, UINT16 policy, - const SchedParam *parentParam, - const LosSchedParam *param); - -VOID HPFSchedPolicyInit(SchedRunqueue *rq); -VOID HPFTaskSchedParamInit(LosTaskCB *taskCB, UINT16 policy, - const SchedParam *parentParam, - const LosSchedParam *param); -VOID HPFProcessDefaultSchedParamGet(SchedParam *param); - -VOID IdleTaskSchedParamInit(LosTaskCB *taskCB); - -INT32 OsSchedParamCompare(const LosTaskCB *task1, const LosTaskCB *task2); -VOID OsSchedPriorityInheritance(LosTaskCB *owner, const SchedParam *param); -UINT32 OsSchedParamInit(LosTaskCB *taskCB, UINT16 policy, - const SchedParam *parentParam, - const LosSchedParam *param); -VOID OsSchedProcessDefaultSchedParamGet(UINT16 policy, SchedParam *param); - -VOID OsSchedResponseTimeReset(UINT64 responseTime); +VOID OsSchedSetIdleTaskSchedParam(LosTaskCB *idleTask); +VOID OsSchedResetSchedResponseTime(UINT64 responseTime); +VOID OsSchedUpdateExpireTime(VOID); VOID OsSchedToUserReleaseLock(VOID); +VOID OsSchedTaskDeQueue(LosTaskCB *taskCB); +VOID OsSchedTaskEnQueue(LosTaskCB *taskCB); +UINT32 OsSchedTaskWait(LOS_DL_LIST *list, UINT32 timeout, BOOL needSched); +VOID OsSchedTaskWake(LosTaskCB *resumedTask); +BOOL OsSchedModifyTaskSchedParam(LosTaskCB *taskCB, UINT16 policy, UINT16 priority); +BOOL OsSchedModifyProcessSchedParam(UINT32 pid, UINT16 policy, UINT16 priority); +VOID OsSchedSuspend(LosTaskCB *taskCB); +BOOL OsSchedResume(LosTaskCB *taskCB); +VOID OsSchedDelay(LosTaskCB *runTask, UINT32 tick); +VOID OsSchedYield(VOID); +VOID OsSchedTaskExit(LosTaskCB *taskCB); VOID OsSchedTick(VOID); UINT32 OsSchedInit(VOID); VOID OsSchedStart(VOID); -VOID OsSchedRunqueueIdleInit(LosTaskCB *idleTask); -VOID OsSchedRunqueueInit(VOID); - /* * This function simply picks the next task and switches to it. * Current task needs to already be in the right state or the right @@ -754,6 +525,14 @@ VOID OsSchedIrqEndCheckNeedSched(VOID); */ LOS_DL_LIST *OsSchedLockPendFindPos(const LosTaskCB *runTask, LOS_DL_LIST *lockList); +#ifdef LOSCFG_SCHED_TICK_DEBUG +VOID OsSchedDebugRecordData(VOID); +#endif + +UINT32 OsShellShowTickRespo(VOID); + +UINT32 OsShellShowSchedParam(VOID); + #ifdef __cplusplus #if __cplusplus } diff --git a/src/kernel_liteos_a/kernel/base/include/los_sem_debug_pri.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/include/los_sem_debug_pri.h similarity index 95% rename from src/kernel_liteos_a/kernel/base/include/los_sem_debug_pri.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/include/los_sem_debug_pri.h index f58d4bca..e684c3dc 100644 --- a/src/kernel_liteos_a/kernel/base/include/los_sem_debug_pri.h +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/include/los_sem_debug_pri.h @@ -61,11 +61,11 @@ STATIC INLINE VOID OsSemDbgTimeUpdateHook(UINT32 semID) return; } /* Update the SEM_DEBUG_CB of the semaphore when created or deleted */ -extern VOID OsSemDbgUpdate(UINT32 semID, TSK_ENTRY_FUNC creator, UINT16 count); -STATIC INLINE VOID OsSemDbgUpdateHook(UINT32 semID, TSK_ENTRY_FUNC creator, UINT16 count) +extern VOID OsSemDbgUpdate(UINT32 semID, TSK_ENTRY_FUNC creater, UINT16 count); +STATIC INLINE VOID OsSemDbgUpdateHook(UINT32 semID, TSK_ENTRY_FUNC creater, UINT16 count) { #ifdef LOSCFG_DEBUG_SEMAPHORE - OsSemDbgUpdate(semID, creator, count); + OsSemDbgUpdate(semID, creater, count); #endif return; } diff --git a/src/kernel_liteos_a/kernel/base/include/los_sem_pri.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/include/los_sem_pri.h similarity index 100% rename from src/kernel_liteos_a/kernel/base/include/los_sem_pri.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/include/los_sem_pri.h diff --git a/src/kernel_liteos_a/kernel/base/include/los_signal.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/include/los_signal.h similarity index 97% rename from src/kernel_liteos_a/kernel/base/include/los_signal.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/include/los_signal.h index ce39c484..eabc2b09 100644 --- a/src/kernel_liteos_a/kernel/base/include/los_signal.h +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/include/los_signal.h @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2023 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -151,8 +151,6 @@ typedef struct { unsigned int count; } sig_cb; -typedef struct ProcessCB LosProcessCB; - #define SIGEV_THREAD_ID 4 int sys_sigqueue(pid_t, int, const union sigval); @@ -167,7 +165,6 @@ int OsSigEmptySet(sigset_t *); int OsSigAddSet(sigset_t *, int); int OsSigIsMember(const sigset_t *, int); int OsKill(pid_t pid, int sig, int permission); -int OsSendSigToProcess(LosProcessCB *spcb, int sig, int permission); int OsDispatch(pid_t pid, siginfo_t *info, int permission); int OsSigTimedWait(sigset_t *set, siginfo_t *info, unsigned int timeout); int OsPause(void); diff --git a/src/kernel_liteos_a/kernel/base/include/los_sortlink_pri.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/include/los_sortlink_pri.h similarity index 88% rename from src/kernel_liteos_a/kernel/base/include/los_sortlink_pri.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/include/los_sortlink_pri.h index 788947d3..89fa1761 100644 --- a/src/kernel_liteos_a/kernel/base/include/los_sortlink_pri.h +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/include/los_sortlink_pri.h @@ -72,42 +72,28 @@ STATIC INLINE UINT64 OsGetSortLinkNextExpireTime(SortLinkAttribute *sortHeader, LOS_DL_LIST *head = &sortHeader->sortLink; LOS_DL_LIST *list = head->pstNext; - LOS_SpinLock(&sortHeader->spinLock); if (LOS_ListEmpty(head)) { - LOS_SpinUnlock(&sortHeader->spinLock); return OS_SORT_LINK_INVALID_TIME - tickPrecision; } SortLinkList *listSorted = LOS_DL_LIST_ENTRY(list, SortLinkList, sortLinkNode); if (listSorted->responseTime <= (startTime + tickPrecision)) { - LOS_SpinUnlock(&sortHeader->spinLock); return startTime + tickPrecision; } - LOS_SpinUnlock(&sortHeader->spinLock); return listSorted->responseTime; } -STATIC INLINE UINT32 OsGetSortLinkNodeNum(const SortLinkAttribute *head) +STATIC INLINE UINT32 OsGetSortLinkNodeNum(SortLinkAttribute *head) { return head->nodeNum; } -STATIC INLINE UINT16 OsGetSortLinkNodeCpuid(const SortLinkList *node) -{ -#ifdef LOSCFG_KERNEL_SMP - return node->cpuid; -#else - return 0; -#endif -} - VOID OsSortLinkInit(SortLinkAttribute *sortLinkHeader); VOID OsAdd2SortLink(SortLinkAttribute *head, SortLinkList *node, UINT64 responseTime, UINT16 idleCpu); VOID OsDeleteFromSortLink(SortLinkAttribute *head, SortLinkList *node); UINT64 OsSortLinkGetTargetExpireTime(UINT64 currTime, const SortLinkList *targetSortList); UINT64 OsSortLinkGetNextExpireTime(UINT64 currTime, const SortLinkAttribute *sortLinkHeader); -UINT32 OsSortLinkAdjustNodeResponseTime(SortLinkAttribute *head, SortLinkList *node, UINT64 responseTime); #ifdef __cplusplus #if __cplusplus diff --git a/src/kernel_liteos_a/kernel/base/include/los_stackinfo_pri.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/include/los_stackinfo_pri.h similarity index 100% rename from src/kernel_liteos_a/kernel/base/include/los_stackinfo_pri.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/include/los_stackinfo_pri.h diff --git a/src/kernel_liteos_a/kernel/base/include/los_statistics_pri.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/include/los_stat_pri.h similarity index 88% rename from src/kernel_liteos_a/kernel/base/include/los_statistics_pri.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/include/los_stat_pri.h index c1ec0d68..8d81c417 100644 --- a/src/kernel_liteos_a/kernel/base/include/los_statistics_pri.h +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/include/los_stat_pri.h @@ -40,6 +40,11 @@ extern "C" { #endif /* __cplusplus */ #endif /* __cplusplus */ +typedef struct { + UINT64 runtime; + UINT32 contexSwitch; +} SchedPercpu; + typedef struct { UINT64 allRuntime; UINT64 runTime; @@ -51,19 +56,9 @@ typedef struct { UINT64 pendCount; UINT64 waitSchedTime; /* task status is ready to running times */ UINT64 waitSchedCount; + SchedPercpu schedPercpu[LOSCFG_KERNEL_CORE_NUM]; } SchedStat; -#ifdef LOSCFG_SCHED_DEBUG -#ifdef LOSCFG_SCHED_TICK_DEBUG -VOID OsSchedDebugRecordData(VOID); -UINT32 OsShellShowTickResponse(VOID); -UINT32 OsSchedDebugInit(VOID); -#endif -UINT32 OsShellShowSchedStatistics(VOID); -UINT32 OsShellShowEdfSchedStatistics(VOID); -VOID EDFDebugRecord(UINTPTR *taskCB, UINT64 oldFinish); -#endif - #ifdef __cplusplus #if __cplusplus } diff --git a/src/kernel_liteos_a/kernel/base/include/los_swtmr_pri.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/include/los_swtmr_pri.h similarity index 79% rename from src/kernel_liteos_a/kernel/base/include/los_swtmr_pri.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/include/los_swtmr_pri.h index 02d6c0db..b41f6840 100644 --- a/src/kernel_liteos_a/kernel/base/include/los_swtmr_pri.h +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/include/los_swtmr_pri.h @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2023 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -66,10 +66,6 @@ typedef struct { SWTMR_PROC_FUNC handler; /**< Callback function that handles software timer timeout */ UINTPTR arg; /**< Parameter passed in when the callback function that handles software timer timeout is called */ - LOS_DL_LIST node; -#ifdef LOSCFG_SWTMR_DEBUG - UINT32 swtmrID; -#endif } SwtmrHandlerItem; /** @@ -104,42 +100,13 @@ extern SWTMR_CTRL_S *g_swtmrCBArray; * @see LOS_SwtmrStop */ -extern UINT32 OsSwtmrGetNextTimeout(VOID); extern BOOL OsIsSwtmrTask(const LosTaskCB *taskCB); -extern VOID OsSwtmrResponseTimeReset(UINT64 startTime); +extern VOID OsSwtmrRestart(UINT64 startTime, SortLinkList *sortList); +extern VOID OsSwtmrWake(SchedRunQue *rq, UINT64 currTime, SortLinkList *sortList); extern UINT32 OsSwtmrInit(VOID); -extern VOID OsSwtmrRecycle(UINTPTR ownerID); +extern VOID OsSwtmrRecycle(UINT32 processID); extern BOOL OsSwtmrWorkQueueFind(SCHED_TL_FIND_FUNC checkFunc, UINTPTR arg); extern SPIN_LOCK_S g_swtmrSpin; -extern UINT32 OsSwtmrTaskIDGetByCpuid(UINT16 cpuid); - -#ifdef LOSCFG_SWTMR_DEBUG -typedef struct { - UINT64 startTime; - UINT64 waitTimeMax; - UINT64 waitTime; - UINT64 waitCount; - UINT64 readyStartTime; - UINT64 readyTime; - UINT64 readyTimeMax; - UINT64 runTime; - UINT64 runTimeMax; - UINT64 runCount; - UINT32 times; -} SwtmrDebugBase; - -typedef struct { - SwtmrDebugBase base; - SWTMR_PROC_FUNC handler; - UINT32 period; - UINT32 cpuid; - BOOL swtmrUsed; -} SwtmrDebugData; - -extern BOOL OsSwtmrDebugDataUsed(UINT32 swtmrID); -extern UINT32 OsSwtmrDebugDataGet(UINT32 swtmrID, SwtmrDebugData *data, UINT32 len, UINT8 *mode); -#endif - #ifdef __cplusplus #if __cplusplus } diff --git a/src/kernel_liteos_a/kernel/base/include/los_sys_pri.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/include/los_sys_pri.h similarity index 89% rename from src/kernel_liteos_a/kernel/base/include/los_sys_pri.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/include/los_sys_pri.h index 01a90e8b..e937e3aa 100644 --- a/src/kernel_liteos_a/kernel/base/include/los_sys_pri.h +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/include/los_sys_pri.h @@ -101,16 +101,6 @@ extern "C" { */ #define OS_NS_PER_TICK (OS_SYS_NS_PER_SECOND / LOSCFG_BASE_CORE_TICK_PER_SECOND) -#define OS_US_TO_CYCLE(time, freq) ((((time) / OS_SYS_US_PER_SECOND) * (freq)) + \ - (((time) % OS_SYS_US_PER_SECOND) * (freq) / OS_SYS_US_PER_SECOND)) - -#define OS_SYS_US_TO_CYCLE(time) OS_US_TO_CYCLE((time), OS_SYS_CLOCK) - -#define OS_CYCLE_TO_US(cycle, freq) ((((cycle) / (freq)) * OS_SYS_US_PER_SECOND) + \ - ((cycle) % (freq) * OS_SYS_US_PER_SECOND / (freq))) - -#define OS_SYS_CYCLE_TO_US(cycle) OS_CYCLE_TO_US((cycle), OS_SYS_CLOCK) - /** * @ingroup los_sys * The maximum length of name. diff --git a/src/kernel_liteos_a/kernel/base/include/los_task_pri.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/include/los_task_pri.h similarity index 89% rename from src/kernel_liteos_a/kernel/base/include/los_task_pri.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/include/los_task_pri.h index fd487a0c..f5e399e4 100644 --- a/src/kernel_liteos_a/kernel/base/include/los_task_pri.h +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/include/los_task_pri.h @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2023 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -54,7 +54,6 @@ extern "C" { /* scheduler lock */ extern SPIN_LOCK_S g_taskSpin; -#define SCHEDULER_HELD() LOS_SpinHeld(&g_taskSpin) #define SCHEDULER_LOCK(state) LOS_SpinLockSave(&g_taskSpin, &(state)) #define SCHEDULER_UNLOCK(state) LOS_SpinUnlockRestore(&g_taskSpin, state) @@ -74,7 +73,7 @@ extern SPIN_LOCK_S g_taskSpin; * * The task control block is unused. */ -#define OS_TASK_STATUS_UNUSED 0x0400U +#define OS_TASK_STATUS_UNUSED 0x0200U /** * @ingroup los_task @@ -82,7 +81,7 @@ extern SPIN_LOCK_S g_taskSpin; * * The task is joinable. */ -#define OS_TASK_FLAG_PTHREAD_JOIN 0x0800U +#define OS_TASK_FLAG_PTHREAD_JOIN 0x0400U /** * @ingroup los_task @@ -90,7 +89,7 @@ extern SPIN_LOCK_S g_taskSpin; * * The task is user mode task. */ -#define OS_TASK_FLAG_USER_MODE 0x1000U +#define OS_TASK_FLAG_USER_MODE 0x0800U /** * @ingroup los_task @@ -98,7 +97,7 @@ extern SPIN_LOCK_S g_taskSpin; * * The task is system-level task, like idle, swtmr and etc. */ -#define OS_TASK_FLAG_SYSTEM_TASK 0x2000U +#define OS_TASK_FLAG_SYSTEM_TASK 0x1000U /** * @ingroup los_task @@ -106,7 +105,7 @@ extern SPIN_LOCK_S g_taskSpin; * * The task is no-delete system task, like resourceTask. */ -#define OS_TASK_FLAG_NO_DELETE 0x4000U +#define OS_TASK_FLAG_NO_DELETE 0x2000U /** * @ingroup los_task @@ -114,7 +113,15 @@ extern SPIN_LOCK_S g_taskSpin; * * Kills the thread during process exit. */ -#define OS_TASK_FLAG_EXIT_KILL 0x8000U +#define OS_TASK_FLAG_EXIT_KILL 0x4000U + +/** + * @ingroup los_task + * Flag that indicates the task or task control block status. + * + * The delayed operation of this task is frozen. + */ +#define OS_TASK_FLAG_FREEZE 0x8000U /** * @ingroup los_task @@ -193,12 +200,7 @@ extern SPIN_LOCK_S g_taskSpin; *
    • los_task_pri.h: the header file that contains the API declaration.
    * @see */ -#define OS_TCB_FROM_RTID(taskID) (((LosTaskCB *)g_taskCBArray) + (taskID)) -#ifdef LOSCFG_PID_CONTAINER -#define OS_TCB_FROM_TID(taskID) OsGetTCBFromVtid(taskID) -#else -#define OS_TCB_FROM_TID(taskID) OS_TCB_FROM_RTID(taskID) -#endif +#define OS_TCB_FROM_TID(taskID) (((LosTaskCB *)g_taskCBArray) + (taskID)) #ifndef LOSCFG_STACK_POINT_ALIGN_SIZE #define LOSCFG_STACK_POINT_ALIGN_SIZE (sizeof(UINTPTR) * 2) @@ -261,12 +263,7 @@ STATIC INLINE BOOL OsTaskIsUnused(const LosTaskCB *taskCB) STATIC INLINE BOOL OsTaskIsKilled(const LosTaskCB *taskCB) { - return((taskCB->taskStatus & OS_TASK_FLAG_EXIT_KILL) != 0); -} - -STATIC INLINE BOOL OsTaskIsNotDelete(const LosTaskCB *taskCB) -{ - return ((taskCB->taskStatus & (OS_TASK_STATUS_UNUSED | OS_TASK_FLAG_SYSTEM_TASK | OS_TASK_FLAG_NO_DELETE)) != 0); + return ((taskCB->taskStatus & OS_TASK_FLAG_EXIT_KILL) != 0); } STATIC INLINE BOOL OsTaskIsUserMode(const LosTaskCB *taskCB) @@ -313,8 +310,8 @@ extern BOOL OsTaskCpuAffiSetUnsafe(UINT32 taskID, UINT16 newCpuAffiMask, UINT16 extern VOID OsTaskSchedule(LosTaskCB *, LosTaskCB *); extern VOID OsTaskContextLoad(LosTaskCB *newTask); extern VOID OsIdleTask(VOID); -extern UINT32 OsIdleTaskCreate(UINTPTR processID); -extern UINT32 OsTaskInit(UINTPTR processCB); +extern UINT32 OsIdleTaskCreate(VOID); +extern UINT32 OsTaskInit(VOID); extern UINT32 OsShellCmdDumpTask(INT32 argc, const CHAR **argv); extern UINT32 OsShellCmdTskInfoGet(UINT32 taskID, VOID *seqfile, UINT16 flag); extern LosTaskCB *OsGetMainTask(VOID); @@ -322,20 +319,18 @@ extern VOID OsSetMainTask(VOID); extern UINT32 OsGetIdleTaskId(VOID); extern VOID OsTaskEntry(UINT32 taskID); extern VOID OsTaskProcSignal(VOID); -extern UINT32 OsCreateUserTask(UINTPTR processID, TSK_INIT_PARAM_S *initParam); +extern UINT32 OsCreateUserTask(UINT32 processID, TSK_INIT_PARAM_S *initParam); extern INT32 OsSetTaskName(LosTaskCB *taskCB, const CHAR *name, BOOL setPName); extern VOID OsTaskCBRecycleToFree(VOID); extern VOID OsRunningTaskToExit(LosTaskCB *runTask, UINT32 status); extern INT32 OsUserTaskOperatePermissionsCheck(const LosTaskCB *taskCB); -extern INT32 OsUserProcessOperatePermissionsCheck(const LosTaskCB *taskCB, UINTPTR processCB); +extern INT32 OsUserProcessOperatePermissionsCheck(const LosTaskCB *taskCB, UINT32 processID); extern INT32 OsTcbDispatch(LosTaskCB *stcb, siginfo_t *info); extern VOID OsWriteResourceEvent(UINT32 events); extern VOID OsWriteResourceEventUnsafe(UINT32 events); extern UINT32 OsResourceFreeTaskCreate(VOID); extern VOID OsTaskInsertToRecycleList(LosTaskCB *taskCB); extern VOID OsInactiveTaskDelete(LosTaskCB *taskCB); -extern VOID OsSetMainTaskProcess(UINTPTR processCB); -extern LosTaskCB *OsGetDefaultTaskCB(VOID); #ifdef __cplusplus #if __cplusplus diff --git a/src/kernel_liteos_a/kernel/base/include/los_tick_pri.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/include/los_tick_pri.h similarity index 100% rename from src/kernel_liteos_a/kernel/base/include/los_tick_pri.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/include/los_tick_pri.h diff --git a/src/kernel_liteos_a/kernel/base/include/los_typedef_pri.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/include/los_typedef_pri.h similarity index 100% rename from src/kernel_liteos_a/kernel/base/include/los_typedef_pri.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/include/los_typedef_pri.h diff --git a/src/kernel_liteos_a/kernel/base/include/los_vm_boot.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/include/los_vm_boot.h similarity index 100% rename from src/kernel_liteos_a/kernel/base/include/los_vm_boot.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/include/los_vm_boot.h diff --git a/src/kernel_liteos_a/kernel/base/include/los_vm_common.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/include/los_vm_common.h similarity index 100% rename from src/kernel_liteos_a/kernel/base/include/los_vm_common.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/include/los_vm_common.h diff --git a/src/kernel_liteos_a/kernel/base/include/los_vm_dump.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/include/los_vm_dump.h similarity index 91% rename from src/kernel_liteos_a/kernel/base/include/los_vm_dump.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/include/los_vm_dump.h index 01b11858..e8d13a7c 100644 --- a/src/kernel_liteos_a/kernel/base/include/los_vm_dump.h +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/include/los_vm_dump.h @@ -59,9 +59,9 @@ extern "C" { const CHAR *OsGetRegionNameOrFilePath(LosVmMapRegion *region); INT32 OsRegionOverlapCheckUnlock(LosVmSpace *space, LosVmMapRegion *region); UINT32 OsShellCmdProcessVmUsage(LosVmSpace *space); -UINT32 OsShellCmdProcessPmUsage(LosVmSpace *space, UINT32 *sharePm, UINT32 *actualPm); -UINT32 OsUProcessPmUsage(LosVmSpace *space, UINT32 *sharePm, UINT32 *actualPm); -UINT32 OsKProcessPmUsage(LosVmSpace *kAspace, UINT32 *actualPm); +VOID OsShellCmdProcessPmUsage(LosVmSpace *space, UINT32 *sharePm, UINT32 *actualPm); +VOID OsUProcessPmUsage(LosVmSpace *space, UINT32 *sharePm, UINT32 *actualPm); +VOID OsKProcessPmUsage(LosVmSpace *kAspace, UINT32 *actualPm); VOID OsDumpAspace(LosVmSpace *space); UINT32 OsCountRegionPages(LosVmSpace *space, LosVmMapRegion *region, UINT32 *pssPages); UINT32 OsCountAspacePages(LosVmSpace *space); @@ -70,7 +70,7 @@ VOID OsVmPhysDump(VOID); VOID OsVmPhysUsedInfoGet(UINT32 *usedCount, UINT32 *totalCount); INT32 OsRegionOverlapCheck(LosVmSpace *space, LosVmMapRegion *region); VOID OsDumpPte(VADDR_T vaddr); -LosProcessCB *OsGetPIDByAspace(const LosVmSpace *space); +LosProcessCB *OsGetPIDByAspace(LosVmSpace *space); CHAR *OsArchFlagsToStr(const UINT32 archFlags); #ifdef __cplusplus diff --git a/src/kernel_liteos_a/kernel/base/include/los_vm_fault.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/include/los_vm_fault.h similarity index 100% rename from src/kernel_liteos_a/kernel/base/include/los_vm_fault.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/include/los_vm_fault.h diff --git a/src/kernel_liteos_a/kernel/base/include/los_vm_filemap.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/include/los_vm_filemap.h similarity index 97% rename from src/kernel_liteos_a/kernel/base/include/los_vm_filemap.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/include/los_vm_filemap.h index c8cceb21..7784cb56 100644 --- a/src/kernel_liteos_a/kernel/base/include/los_vm_filemap.h +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/include/los_vm_filemap.h @@ -193,7 +193,7 @@ VOID OsVmmFileRegionFree(struct file *filep, LosProcessCB *processCB); LosFilePage *OsPageCacheAlloc(struct page_mapping *mapping, VM_OFFSET_T pgoff); LosFilePage *OsFindGetEntry(struct page_mapping *mapping, VM_OFFSET_T pgoff); -LosMapInfo *OsGetMapInfo(const LosFilePage *page, const LosArchMmu *archMmu, VADDR_T vaddr); +LosMapInfo *OsGetMapInfo(LosFilePage *page, LosArchMmu *archMmu, VADDR_T vaddr); VOID OsAddMapInfo(LosFilePage *page, LosArchMmu *archMmu, VADDR_T vaddr); VOID OsDelMapInfo(LosVmMapRegion *region, LosVmPgFault *pgFault, BOOL cleanDirty); VOID OsFileCacheFlush(struct page_mapping *mapping); @@ -208,7 +208,7 @@ VOID OsDeletePageCacheLru(LosFilePage *page); VOID OsPageRefDecNoLock(LosFilePage *page); VOID OsPageRefIncLocked(LosFilePage *page); int OsTryShrinkMemory(size_t nPage); -VOID OsMarkPageDirty(LosFilePage *fpage, const LosVmMapRegion *region, int off, int len); +VOID OsMarkPageDirty(LosFilePage *fpage, LosVmMapRegion *region, int off, int len); #ifdef LOSCFG_DEBUG_VERSION VOID ResetPageCacheHitInfo(int *try, int *hit); diff --git a/src/kernel_liteos_a/kernel/base/include/los_vm_iomap.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/include/los_vm_iomap.h similarity index 100% rename from src/kernel_liteos_a/kernel/base/include/los_vm_iomap.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/include/los_vm_iomap.h diff --git a/src/kernel_liteos_a/kernel/base/include/los_vm_lock.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/include/los_vm_lock.h similarity index 100% rename from src/kernel_liteos_a/kernel/base/include/los_vm_lock.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/include/los_vm_lock.h diff --git a/src/kernel_liteos_a/kernel/base/include/los_vm_map.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/include/los_vm_map.h similarity index 98% rename from src/kernel_liteos_a/kernel/base/include/los_vm_map.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/include/los_vm_map.h index 344e1ad8..b0d2fa8b 100644 --- a/src/kernel_liteos_a/kernel/base/include/los_vm_map.h +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/include/los_vm_map.h @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2023 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -290,7 +290,7 @@ STATUS_T LOS_VmSpaceFree(LosVmSpace *space); STATUS_T LOS_VaddrToPaddrMmap(LosVmSpace *space, VADDR_T vaddr, PADDR_T paddr, size_t len, UINT32 flags); BOOL OsUserVmSpaceInit(LosVmSpace *vmSpace, VADDR_T *virtTtb); LosVmSpace *OsCreateUserVmSpace(VOID); -STATUS_T LOS_VmSpaceClone(UINT32 cloneFlags, LosVmSpace *oldVmSpace, LosVmSpace *newVmSpace); +STATUS_T LOS_VmSpaceClone(LosVmSpace *oldVmSpace, LosVmSpace *newVmSpace); LosMux *OsGVmSpaceMuxGet(VOID); STATUS_T OsUnMMap(LosVmSpace *space, VADDR_T addr, size_t size); STATUS_T OsVmSpaceRegionFree(LosVmSpace *space); diff --git a/src/kernel_liteos_a/kernel/base/include/los_vm_page.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/include/los_vm_page.h similarity index 100% rename from src/kernel_liteos_a/kernel/base/include/los_vm_page.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/include/los_vm_page.h diff --git a/src/kernel_liteos_a/kernel/base/include/los_vm_phys.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/include/los_vm_phys.h similarity index 100% rename from src/kernel_liteos_a/kernel/base/include/los_vm_phys.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/include/los_vm_phys.h diff --git a/src/kernel_liteos_a/kernel/base/include/los_vm_shm_pri.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/include/los_vm_shm_pri.h similarity index 76% rename from src/kernel_liteos_a/kernel/base/include/los_vm_shm_pri.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/include/los_vm_shm_pri.h index 3320d569..e817e6a9 100644 --- a/src/kernel_liteos_a/kernel/base/include/los_vm_shm_pri.h +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/include/los_vm_shm_pri.h @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2023 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -34,7 +34,6 @@ #include "los_typedef.h" #include "los_vm_map.h" -#include "los_process_pri.h" #ifdef __cplusplus #if __cplusplus @@ -42,28 +41,10 @@ extern "C" { #endif /* __cplusplus */ #endif /* __cplusplus */ -/* The upper limit size of total shared memory is default 16M */ -#define SHM_MAX_PAGES 4096 -#define SHM_MAX (SHM_MAX_PAGES * PAGE_SIZE) -#define SHM_MIN 1 -#define SHM_MNI 192 -#define SHM_SEG 128 -#define SHM_ALL (SHM_MAX_PAGES) - -struct shmIDSource { - struct shmid_ds ds; - UINT32 status; - LOS_DL_LIST node; -#ifdef LOSCFG_SHELL - CHAR ownerName[OS_PCB_NAME_LEN]; -#endif -}; - VOID OsShmFork(LosVmSpace *space, LosVmMapRegion *oldRegion, LosVmMapRegion *newRegion); VOID OsShmRegionFree(LosVmSpace *space, LosVmMapRegion *region); BOOL OsIsShmRegion(LosVmMapRegion *region); -struct shmIDSource *OsShmCBInit(LosMux *sysvShmMux, struct shminfo *shmInfo, UINT32 *shmUsedPageCount); -VOID OsShmCBDestroy(struct shmIDSource *shmSegs, struct shminfo *shmInfo, LosMux *sysvShmMux); + #ifdef __cplusplus #if __cplusplus } diff --git a/src/kernel_liteos_a/kernel/base/include/los_vm_syscall.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/include/los_vm_syscall.h similarity index 100% rename from src/kernel_liteos_a/kernel/base/include/los_vm_syscall.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/include/los_vm_syscall.h diff --git a/src/kernel_liteos_a/kernel/base/include/los_vm_zone.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/include/los_vm_zone.h similarity index 100% rename from src/kernel_liteos_a/kernel/base/include/los_vm_zone.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/include/los_vm_zone.h diff --git a/src/kernel_liteos_a/kernel/base/ipc/los_event.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/ipc/los_event.c similarity index 98% rename from src/kernel_liteos_a/kernel/base/ipc/los_event.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/ipc/los_event.c index dc55aa25..635283cb 100644 --- a/src/kernel_liteos_a/kernel/base/ipc/los_event.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/ipc/los_event.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2022 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -147,7 +147,7 @@ LITE_OS_SEC_TEXT STATIC UINT32 OsEventReadImp(PEVENT_CB_S eventCB, UINT32 eventM runTask->eventMode = mode; runTask->taskEvent = eventCB; OsTaskWaitSetPendMask(OS_TASK_WAIT_EVENT, eventMask, timeout); - ret = runTask->ops->wait(runTask, &eventCB->stEventList, timeout); + ret = OsSchedTaskWait(&eventCB->stEventList, timeout, TRUE); if (ret == LOS_ERRNO_TSK_TIMEOUT) { return LOS_ERRNO_EVENT_READ_TIMEOUT; } @@ -185,7 +185,7 @@ LITE_OS_SEC_TEXT STATIC UINT8 OsEventResume(LosTaskCB *resumedTask, const PEVENT resumedTask->taskEvent = NULL; OsTaskWakeClearPendMask(resumedTask); - resumedTask->ops->wake(resumedTask); + OsSchedTaskWake(resumedTask); } return exitFlag; diff --git a/src/kernel_liteos_a/kernel/base/ipc/los_futex.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/ipc/los_futex.c similarity index 94% rename from src/kernel_liteos_a/kernel/base/ipc/los_futex.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/ipc/los_futex.c index 384bb483..df0b8276 100644 --- a/src/kernel_liteos_a/kernel/base/ipc/los_futex.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/ipc/los_futex.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2022 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -118,10 +118,10 @@ STATIC VOID OsFutexShowTaskNodeAttr(const LOS_DL_LIST *futexList) lastNode = OS_FUTEX_FROM_QUEUELIST(queueList); if (!LOS_ListEmpty(&(lastNode->pendList))) { taskCB = OS_TCB_FROM_PENDLIST(LOS_DL_LIST_FIRST(&(lastNode->pendList))); - PRINTK(" %u ->", taskCB->taskID); + PRINTK(" %u(%u) ->", taskCB->taskID, taskCB->priority); } else { taskCB = LOS_DL_LIST_ENTRY(lastNode, LosTaskCB, futex); - PRINTK(" %u ->", taskCB->taskID); + PRINTK(" %u(%d) ->", taskCB->taskID, -1); } queueList = queueList->pstNext; if (queueList == &tempNode->queueList) { @@ -336,19 +336,20 @@ STATIC INT32 OsFutexInsertFindFormBackToFront(LOS_DL_LIST *queueList, const LosT { LOS_DL_LIST *listHead = queueList; LOS_DL_LIST *listTail = queueList->pstPrev; + FutexNode *tempNode = NULL; + LosTaskCB *taskTail = NULL; for (; listHead != listTail; listTail = listTail->pstPrev) { - FutexNode *tempNode = OS_FUTEX_FROM_QUEUELIST(listTail); + tempNode = OS_FUTEX_FROM_QUEUELIST(listTail); tempNode = OsFutexDeleteAlreadyWakeTaskAndGetNext(tempNode, NULL, FALSE); if (tempNode == NULL) { return LOS_NOK; } - LosTaskCB *taskTail = OS_TCB_FROM_PENDLIST(LOS_DL_LIST_FIRST(&(tempNode->pendList))); - INT32 ret = OsSchedParamCompare(runTask, taskTail); - if (ret >= 0) { + taskTail = OS_TCB_FROM_PENDLIST(LOS_DL_LIST_FIRST(&(tempNode->pendList))); + if (runTask->priority >= taskTail->priority) { LOS_ListHeadInsert(&(tempNode->queueList), &(node->queueList)); return LOS_OK; - } else { + } else if (runTask->priority < taskTail->priority) { if (listTail->pstPrev == listHead) { LOS_ListTailInsert(&(tempNode->queueList), &(node->queueList)); return LOS_OK; @@ -363,25 +364,26 @@ STATIC INT32 OsFutexInsertFindFromFrontToBack(LOS_DL_LIST *queueList, const LosT { LOS_DL_LIST *listHead = queueList; LOS_DL_LIST *listTail = queueList->pstPrev; + FutexNode *tempNode = NULL; + LosTaskCB *taskHead = NULL; for (; listHead != listTail; listHead = listHead->pstNext) { - FutexNode *tempNode = OS_FUTEX_FROM_QUEUELIST(listHead); + tempNode = OS_FUTEX_FROM_QUEUELIST(listHead); tempNode = OsFutexDeleteAlreadyWakeTaskAndGetNext(tempNode, NULL, FALSE); if (tempNode == NULL) { return LOS_NOK; } - LosTaskCB *taskHead = OS_TCB_FROM_PENDLIST(LOS_DL_LIST_FIRST(&(tempNode->pendList))); + taskHead = OS_TCB_FROM_PENDLIST(LOS_DL_LIST_FIRST(&(tempNode->pendList))); /* High priority comes before low priority, * in the case of the same priority, after the current node */ - INT32 ret = OsSchedParamCompare(runTask, taskHead); - if (ret >= 0) { + if (runTask->priority >= taskHead->priority) { if (listHead->pstNext == listTail) { LOS_ListHeadInsert(&(tempNode->queueList), &(node->queueList)); return LOS_OK; } continue; - } else { + } else if (runTask->priority < taskHead->priority) { LOS_ListTailInsert(&(tempNode->queueList), &(node->queueList)); return LOS_OK; } @@ -412,9 +414,10 @@ STATIC INT32 OsFutexInsertTasktoPendList(FutexNode **firstNode, FutexNode *node, { LosTaskCB *taskHead = OS_TCB_FROM_PENDLIST(LOS_DL_LIST_FIRST(&((*firstNode)->pendList))); LOS_DL_LIST *queueList = &((*firstNode)->queueList); + FutexNode *tailNode = NULL; + LosTaskCB *taskTail = NULL; - INT32 ret1 = OsSchedParamCompare(run, taskHead); - if (ret1 < 0) { + if (run->priority < taskHead->priority) { /* The one with the highest priority is inserted at the top of the queue */ LOS_ListTailInsert(queueList, &(node->queueList)); OsFutexReplaceQueueListHeadNode(*firstNode, node); @@ -422,16 +425,16 @@ STATIC INT32 OsFutexInsertTasktoPendList(FutexNode **firstNode, FutexNode *node, return LOS_OK; } - if (LOS_ListEmpty(queueList) && (ret1 >= 0)) { + if (LOS_ListEmpty(queueList) && (run->priority >= taskHead->priority)) { /* Insert the next position in the queue with equal priority */ LOS_ListHeadInsert(queueList, &(node->queueList)); return LOS_OK; } - FutexNode *tailNode = OS_FUTEX_FROM_QUEUELIST(LOS_DL_LIST_LAST(queueList)); - LosTaskCB *taskTail = OS_TCB_FROM_PENDLIST(LOS_DL_LIST_FIRST(&(tailNode->pendList))); - INT32 ret2 = OsSchedParamCompare(taskTail, run); - if ((ret2 <= 0) || (ret1 > ret2)) { + tailNode = OS_FUTEX_FROM_QUEUELIST(LOS_DL_LIST_LAST(queueList)); + taskTail = OS_TCB_FROM_PENDLIST(LOS_DL_LIST_FIRST(&(tailNode->pendList))); + if ((run->priority >= taskTail->priority) || + ((run->priority - taskHead->priority) > (taskTail->priority - run->priority))) { return OsFutexInsertFindFormBackToFront(queueList, run, node); } @@ -521,7 +524,7 @@ STATIC INT32 OsFutexWaitParamCheck(const UINT32 *userVaddr, UINT32 flags, UINT32 } if (!absTime) { - return LOS_ETIMEDOUT; + return LOS_EINVAL; } return LOS_OK; @@ -566,7 +569,7 @@ STATIC INT32 OsFutexInsertTaskToHash(LosTaskCB **taskCB, FutexNode **node, const return LOS_OK; } -STATIC INT32 OsFutexWaitTask(const UINT32 *userVaddr, const UINT32 flags, const UINT32 val, const UINT32 timeout) +STATIC INT32 OsFutexWaitTask(const UINT32 *userVaddr, const UINT32 flags, const UINT32 val, const UINT32 timeOut) { INT32 futexRet; UINT32 intSave, lockVal; @@ -597,9 +600,9 @@ STATIC INT32 OsFutexWaitTask(const UINT32 *userVaddr, const UINT32 flags, const } SCHEDULER_LOCK(intSave); + OsTaskWaitSetPendMask(OS_TASK_WAIT_FUTEX, futexKey, timeOut); + OsSchedTaskWait(&(node->pendList), timeOut, FALSE); OsSchedLock(); - OsTaskWaitSetPendMask(OS_TASK_WAIT_FUTEX, futexKey, timeout); - taskCB->ops->wait(taskCB, &(node->pendList), timeout); LOS_SpinUnlock(&g_taskSpin); futexRet = OsFutexUnlock(&hashNode->listLock); @@ -636,17 +639,17 @@ EXIT_UNLOCK_ERR: INT32 OsFutexWait(const UINT32 *userVaddr, UINT32 flags, UINT32 val, UINT32 absTime) { INT32 ret; - UINT32 timeout = LOS_WAIT_FOREVER; + UINT32 timeOut = LOS_WAIT_FOREVER; ret = OsFutexWaitParamCheck(userVaddr, flags, absTime); if (ret) { return ret; } if (absTime != LOS_WAIT_FOREVER) { - timeout = OsNS2Tick((UINT64)absTime * OS_SYS_NS_PER_US); + timeOut = OsNS2Tick((UINT64)absTime * OS_SYS_NS_PER_US); } - return OsFutexWaitTask(userVaddr, flags, val, timeout); + return OsFutexWaitTask(userVaddr, flags, val, timeOut); } STATIC INT32 OsFutexWakeParamCheck(const UINT32 *userVaddr, UINT32 flags) @@ -690,7 +693,7 @@ STATIC VOID OsFutexCheckAndWakePendTask(FutexNode *headNode, const INT32 wakeNum node = *nextNode; taskCB = OS_TCB_FROM_PENDLIST(LOS_DL_LIST_FIRST(&(node->pendList))); OsTaskWakeClearPendMask(taskCB); - taskCB->ops->wake(taskCB); + OsSchedTaskWake(taskCB); *wakeAny = TRUE; *nextNode = OS_FUTEX_FROM_QUEUELIST(LOS_DL_LIST_FIRST(&(node->queueList))); if (node != headNode) { diff --git a/src/kernel_liteos_a/kernel/base/ipc/los_ipcdebug.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/ipc/los_ipcdebug.c similarity index 100% rename from src/kernel_liteos_a/kernel/base/ipc/los_ipcdebug.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/ipc/los_ipcdebug.c diff --git a/src/kernel_liteos_a/kernel/base/ipc/los_mux.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/ipc/los_mux.c similarity index 80% rename from src/kernel_liteos_a/kernel/base/ipc/los_mux.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/ipc/los_mux.c index fa4a67b8..61ee89e0 100644 --- a/src/kernel_liteos_a/kernel/base/ipc/los_mux.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/ipc/los_mux.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2022 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -257,36 +257,40 @@ LITE_OS_SEC_TEXT UINT32 LOS_MuxDestroy(LosMux *mutex) return LOS_OK; } -STATIC VOID OsMuxBitmapSet(const LosMux *mutex, const LosTaskCB *runTask) +STATIC VOID OsMuxBitmapSet(const LosMux *mutex, const LosTaskCB *runTask, LosTaskCB *owner) { - if (mutex->attr.protocol != LOS_MUX_PRIO_INHERIT) { - return; - } - - SchedParam param = { 0 }; - LosTaskCB *owner = (LosTaskCB *)mutex->owner; - INT32 ret = OsSchedParamCompare(owner, runTask); - if (ret > 0) { - runTask->ops->schedParamGet(runTask, ¶m); - owner->ops->priorityInheritance(owner, ¶m); + if ((owner->priority > runTask->priority) && (mutex->attr.protocol == LOS_MUX_PRIO_INHERIT)) { + LOS_BitmapSet(&(owner->priBitMap), owner->priority); + (VOID)OsSchedModifyTaskSchedParam(owner, owner->policy, runTask->priority); } } -VOID OsMuxBitmapRestore(const LosMux *mutex, const LOS_DL_LIST *list, const LosTaskCB *runTask) +VOID OsMuxBitmapRestore(const LosMux *mutex, const LosTaskCB *taskCB, LosTaskCB *owner) { + UINT16 bitMapPri; + if (mutex->attr.protocol != LOS_MUX_PRIO_INHERIT) { return; } - SchedParam param = { 0 }; - LosTaskCB *owner = (LosTaskCB *)mutex->owner; - runTask->ops->schedParamGet(runTask, ¶m); - owner->ops->priorityRestore(owner, list, ¶m); + if (owner->priority >= taskCB->priority) { + bitMapPri = LOS_LowBitGet(owner->priBitMap); + if (bitMapPri != LOS_INVALID_BIT_INDEX) { + LOS_BitmapClr(&(owner->priBitMap), bitMapPri); + OsSchedModifyTaskSchedParam(owner, owner->policy, bitMapPri); + } + } else { + if (LOS_HighBitGet(owner->priBitMap) != taskCB->priority) { + LOS_BitmapClr(&(owner->priBitMap), taskCB->priority); + } + } } STATIC UINT32 OsMuxPendOp(LosTaskCB *runTask, LosMux *mutex, UINT32 timeout) { UINT32 ret; + LOS_DL_LIST *node = NULL; + LosTaskCB *owner = NULL; if ((mutex->muxList.pstPrev == NULL) || (mutex->muxList.pstNext == NULL)) { /* This is for mutex macro initialization. */ @@ -299,11 +303,9 @@ STATIC UINT32 OsMuxPendOp(LosTaskCB *runTask, LosMux *mutex, UINT32 timeout) mutex->muxCount++; mutex->owner = (VOID *)runTask; LOS_ListTailInsert(&runTask->lockList, &mutex->holdList); - if (mutex->attr.protocol == LOS_MUX_PRIO_PROTECT) { - SchedParam param = { 0 }; - runTask->ops->schedParamGet(runTask, ¶m); - param.priority = mutex->attr.prioceiling; - runTask->ops->priorityInheritance(runTask, ¶m); + if ((mutex->attr.protocol == LOS_MUX_PRIO_PROTECT) && (runTask->priority > mutex->attr.prioceiling)) { + LOS_BitmapSet(&runTask->priBitMap, runTask->priority); + (VOID)OsSchedModifyTaskSchedParam(runTask, runTask->policy, mutex->attr.prioceiling); } return LOS_OK; } @@ -321,23 +323,27 @@ STATIC UINT32 OsMuxPendOp(LosTaskCB *runTask, LosMux *mutex, UINT32 timeout) return LOS_EDEADLK; } - OsMuxBitmapSet(mutex, runTask); + OsMuxBitmapSet(mutex, runTask, (LosTaskCB *)mutex->owner); + owner = (LosTaskCB *)mutex->owner; runTask->taskMux = (VOID *)mutex; - LOS_DL_LIST *node = OsSchedLockPendFindPos(runTask, &mutex->muxList); + node = OsSchedLockPendFindPos(runTask, &mutex->muxList); if (node == NULL) { ret = LOS_NOK; return ret; } OsTaskWaitSetPendMask(OS_TASK_WAIT_MUTEX, (UINTPTR)mutex, timeout); - ret = runTask->ops->wait(runTask, node, timeout); + ret = OsSchedTaskWait(node, timeout, TRUE); if (ret == LOS_ERRNO_TSK_TIMEOUT) { - OsMuxBitmapRestore(mutex, NULL, runTask); runTask->taskMux = NULL; ret = LOS_ETIMEDOUT; } + if (timeout != LOS_WAIT_FOREVER) { + OsMuxBitmapRestore(mutex, runTask, owner); + } + return ret; } @@ -434,23 +440,50 @@ LITE_OS_SEC_TEXT UINT32 LOS_MuxTrylock(LosMux *mutex) return ret; } +STATIC VOID OsMuxPostOpSub(LosTaskCB *taskCB, LosMux *mutex) +{ + LosTaskCB *pendedTask = NULL; + UINT16 bitMapPri; + + if (!LOS_ListEmpty(&mutex->muxList)) { + bitMapPri = LOS_HighBitGet(taskCB->priBitMap); + LOS_DL_LIST_FOR_EACH_ENTRY(pendedTask, (&mutex->muxList), LosTaskCB, pendList) { + if (bitMapPri != pendedTask->priority) { + LOS_BitmapClr(&taskCB->priBitMap, pendedTask->priority); + } + } + } + bitMapPri = LOS_LowBitGet(taskCB->priBitMap); + LOS_BitmapClr(&taskCB->priBitMap, bitMapPri); + (VOID)OsSchedModifyTaskSchedParam((LosTaskCB *)mutex->owner, ((LosTaskCB *)mutex->owner)->policy, bitMapPri); +} + STATIC UINT32 OsMuxPostOp(LosTaskCB *taskCB, LosMux *mutex, BOOL *needSched) { + LosTaskCB *resumedTask = NULL; + if (LOS_ListEmpty(&mutex->muxList)) { LOS_ListDelete(&mutex->holdList); mutex->owner = NULL; return LOS_OK; } - LosTaskCB *resumedTask = OS_TCB_FROM_PENDLIST(LOS_DL_LIST_FIRST(&(mutex->muxList))); - OsMuxBitmapRestore(mutex, &mutex->muxList, resumedTask); - + resumedTask = OS_TCB_FROM_PENDLIST(LOS_DL_LIST_FIRST(&(mutex->muxList))); + if (mutex->attr.protocol == LOS_MUX_PRIO_INHERIT) { + if (resumedTask->priority > taskCB->priority) { + if (LOS_HighBitGet(taskCB->priBitMap) != resumedTask->priority) { + LOS_BitmapClr(&taskCB->priBitMap, resumedTask->priority); + } + } else if (taskCB->priBitMap != 0) { + OsMuxPostOpSub(taskCB, mutex); + } + } mutex->muxCount = 1; mutex->owner = (VOID *)resumedTask; LOS_ListDelete(&mutex->holdList); LOS_ListTailInsert(&resumedTask->lockList, &mutex->holdList); OsTaskWakeClearPendMask(resumedTask); - resumedTask->ops->wake(resumedTask); + OsSchedTaskWake(resumedTask); resumedTask->taskMux = NULL; if (needSched != NULL) { *needSched = TRUE; @@ -461,6 +494,8 @@ STATIC UINT32 OsMuxPostOp(LosTaskCB *taskCB, LosMux *mutex, BOOL *needSched) UINT32 OsMuxUnlockUnsafe(LosTaskCB *taskCB, LosMux *mutex, BOOL *needSched) { + UINT16 bitMapPri; + if (mutex->magic != OS_MUX_MAGIC) { return LOS_EBADF; } @@ -482,9 +517,11 @@ UINT32 OsMuxUnlockUnsafe(LosTaskCB *taskCB, LosMux *mutex, BOOL *needSched) } if (mutex->attr.protocol == LOS_MUX_PRIO_PROTECT) { - SchedParam param = { 0 }; - taskCB->ops->schedParamGet(taskCB, ¶m); - taskCB->ops->priorityRestore(taskCB, NULL, ¶m); + bitMapPri = LOS_HighBitGet(taskCB->priBitMap); + if (bitMapPri != LOS_INVALID_BIT_INDEX) { + LOS_BitmapClr(&taskCB->priBitMap, bitMapPri); + (VOID)OsSchedModifyTaskSchedParam(taskCB, taskCB->policy, bitMapPri); + } } /* Whether a task block the mutex lock. */ diff --git a/src/kernel_liteos_a/kernel/base/ipc/los_queue.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/ipc/los_queue.c similarity index 90% rename from src/kernel_liteos_a/kernel/base/ipc/los_queue.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/ipc/los_queue.c index 8fe06ba2..871a1004 100644 --- a/src/kernel_liteos_a/kernel/base/ipc/los_queue.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/ipc/los_queue.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2023 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -37,64 +37,42 @@ #include "los_mp.h" #include "los_percpu_pri.h" #include "los_hook.h" -#ifdef LOSCFG_IPC_CONTAINER -#include "los_ipc_container_pri.h" -#endif #ifdef LOSCFG_BASE_IPC_QUEUE #if (LOSCFG_BASE_IPC_QUEUE_LIMIT <= 0) #error "queue maxnum cannot be zero" #endif /* LOSCFG_BASE_IPC_QUEUE_LIMIT <= 0 */ -#ifndef LOSCFG_IPC_CONTAINER LITE_OS_SEC_BSS LosQueueCB *g_allQueue = NULL; LITE_OS_SEC_BSS STATIC LOS_DL_LIST g_freeQueueList; -#define FREE_QUEUE_LIST g_freeQueueList -#endif -LITE_OS_SEC_TEXT_INIT LosQueueCB *OsAllQueueCBInit(LOS_DL_LIST *freeQueueList) +/* + * Description : queue initial + * Return : LOS_OK on success or error code on failure + */ +LITE_OS_SEC_TEXT_INIT UINT32 OsQueueInit(VOID) { + LosQueueCB *queueNode = NULL; UINT32 index; + UINT32 size; - if (freeQueueList == NULL) { - return NULL; - } - - UINT32 size = LOSCFG_BASE_IPC_QUEUE_LIMIT * sizeof(LosQueueCB); + size = LOSCFG_BASE_IPC_QUEUE_LIMIT * sizeof(LosQueueCB); /* system resident memory, don't free */ - LosQueueCB *allQueue = (LosQueueCB *)LOS_MemAlloc(m_aucSysMem0, size); - if (allQueue == NULL) { - return NULL; + g_allQueue = (LosQueueCB *)LOS_MemAlloc(m_aucSysMem0, size); + if (g_allQueue == NULL) { + return LOS_ERRNO_QUEUE_NO_MEMORY; } - (VOID)memset_s(allQueue, size, 0, size); - LOS_ListInit(freeQueueList); + (VOID)memset_s(g_allQueue, size, 0, size); + LOS_ListInit(&g_freeQueueList); for (index = 0; index < LOSCFG_BASE_IPC_QUEUE_LIMIT; index++) { - LosQueueCB *queueNode = ((LosQueueCB *)allQueue) + index; + queueNode = ((LosQueueCB *)g_allQueue) + index; queueNode->queueID = index; - LOS_ListTailInsert(freeQueueList, &queueNode->readWriteList[OS_QUEUE_WRITE]); + LOS_ListTailInsert(&g_freeQueueList, &queueNode->readWriteList[OS_QUEUE_WRITE]); } -#ifndef LOSCFG_IPC_CONTAINER if (OsQueueDbgInitHook() != LOS_OK) { - (VOID)LOS_MemFree(m_aucSysMem0, allQueue); - return NULL; - } -#endif - return allQueue; -} - -/* - * Description : queue initial - * Return : LOS_OK on success or error code on failure - */ -LITE_OS_SEC_TEXT_INIT UINT32 OsQueueInit(VOID) -{ -#ifndef LOSCFG_IPC_CONTAINER - g_allQueue = OsAllQueueCBInit(&g_freeQueueList); - if (g_allQueue == NULL) { return LOS_ERRNO_QUEUE_NO_MEMORY; } -#endif return LOS_OK; } @@ -133,14 +111,14 @@ LITE_OS_SEC_TEXT_INIT UINT32 LOS_QueueCreate(CHAR *queueName, UINT16 len, UINT32 } SCHEDULER_LOCK(intSave); - if (LOS_ListEmpty(&FREE_QUEUE_LIST)) { + if (LOS_ListEmpty(&g_freeQueueList)) { SCHEDULER_UNLOCK(intSave); OsQueueCheckHook(); (VOID)LOS_MemFree(m_aucSysMem1, queue); return LOS_ERRNO_QUEUE_CB_UNAVAILABLE; } - unusedQueue = LOS_DL_LIST_FIRST(&FREE_QUEUE_LIST); + unusedQueue = LOS_DL_LIST_FIRST(&g_freeQueueList); LOS_ListDelete(unusedQueue); queueCB = GET_QUEUE_LIST(unusedQueue); queueCB->queueLen = len; @@ -245,7 +223,6 @@ STATIC VOID OsQueueBufferOperate(LosQueueCB *queueCB, UINT32 operateType, VOID * PRINT_ERR("get msgdatasize failed\n"); return; } - msgDataSize = (*bufferSize < msgDataSize) ? *bufferSize : msgDataSize; if (memcpy_s(bufferAddr, *bufferSize, queueNode, msgDataSize) != EOK) { PRINT_ERR("copy message to buffer failed\n"); return; @@ -272,7 +249,9 @@ STATIC UINT32 OsQueueOperateParamCheck(const LosQueueCB *queueCB, UINT32 queueID return LOS_ERRNO_QUEUE_NOT_CREATE; } - if (OS_QUEUE_IS_WRITE(operateType) && (*bufferSize > (queueCB->queueSize - sizeof(UINT32)))) { + if (OS_QUEUE_IS_READ(operateType) && (*bufferSize < (queueCB->queueSize - sizeof(UINT32)))) { + return LOS_ERRNO_QUEUE_READ_SIZE_TOO_SMALL; + } else if (OS_QUEUE_IS_WRITE(operateType) && (*bufferSize > (queueCB->queueSize - sizeof(UINT32)))) { return LOS_ERRNO_QUEUE_WRITE_SIZE_TOO_BIG; } return LOS_OK; @@ -280,13 +259,15 @@ STATIC UINT32 OsQueueOperateParamCheck(const LosQueueCB *queueCB, UINT32 queueID UINT32 OsQueueOperate(UINT32 queueID, UINT32 operateType, VOID *bufferAddr, UINT32 *bufferSize, UINT32 timeout) { + LosQueueCB *queueCB = NULL; + LosTaskCB *resumedTask = NULL; UINT32 ret; UINT32 readWrite = OS_QUEUE_READ_WRITE_GET(operateType); UINT32 intSave; OsHookCall(LOS_HOOK_TYPE_QUEUE_READ, (LosQueueCB *)GET_QUEUE_HANDLE(queueID), operateType, *bufferSize, timeout); SCHEDULER_LOCK(intSave); - LosQueueCB *queueCB = (LosQueueCB *)GET_QUEUE_HANDLE(queueID); + queueCB = (LosQueueCB *)GET_QUEUE_HANDLE(queueID); ret = OsQueueOperateParamCheck(queueCB, queueID, operateType, bufferSize); if (ret != LOS_OK) { goto QUEUE_END; @@ -303,9 +284,8 @@ UINT32 OsQueueOperate(UINT32 queueID, UINT32 operateType, VOID *bufferAddr, UINT goto QUEUE_END; } - LosTaskCB *runTask = OsCurrTaskGet(); OsTaskWaitSetPendMask(OS_TASK_WAIT_QUEUE, queueCB->queueID, timeout); - ret = runTask->ops->wait(runTask, &queueCB->readWriteList[readWrite], timeout); + ret = OsSchedTaskWait(&queueCB->readWriteList[readWrite], timeout, TRUE); if (ret == LOS_ERRNO_TSK_TIMEOUT) { ret = LOS_ERRNO_QUEUE_TIMEOUT; goto QUEUE_END; @@ -317,9 +297,9 @@ UINT32 OsQueueOperate(UINT32 queueID, UINT32 operateType, VOID *bufferAddr, UINT OsQueueBufferOperate(queueCB, operateType, bufferAddr, bufferSize); if (!LOS_ListEmpty(&queueCB->readWriteList[!readWrite])) { - LosTaskCB *resumedTask = OS_TCB_FROM_PENDLIST(LOS_DL_LIST_FIRST(&queueCB->readWriteList[!readWrite])); + resumedTask = OS_TCB_FROM_PENDLIST(LOS_DL_LIST_FIRST(&queueCB->readWriteList[!readWrite])); OsTaskWakeClearPendMask(resumedTask); - resumedTask->ops->wake(resumedTask); + OsSchedTaskWake(resumedTask); SCHEDULER_UNLOCK(intSave); LOS_MpSchedule(OS_MP_CPU_ALL); LOS_Schedule(); @@ -455,7 +435,7 @@ LITE_OS_SEC_TEXT_INIT UINT32 LOS_QueueDelete(UINT32 queueID) queueCB->queueID = SET_QUEUE_ID(GET_QUEUE_COUNT(queueCB->queueID) + 1, GET_QUEUE_INDEX(queueCB->queueID)); OsQueueDbgUpdateHook(queueCB->queueID, NULL); - LOS_ListTailInsert(&FREE_QUEUE_LIST, &queueCB->readWriteList[OS_QUEUE_WRITE]); + LOS_ListTailInsert(&g_freeQueueList, &queueCB->readWriteList[OS_QUEUE_WRITE]); SCHEDULER_UNLOCK(intSave); OsHookCall(LOS_HOOK_TYPE_QUEUE_DELETE, queueCB); ret = LOS_MemFree(m_aucSysMem1, (VOID *)queue); diff --git a/src/kernel_liteos_a/kernel/base/ipc/los_queue_debug.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/ipc/los_queue_debug.c similarity index 96% rename from src/kernel_liteos_a/kernel/base/ipc/los_queue_debug.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/ipc/los_queue_debug.c index 78fa1676..d2a8738d 100644 --- a/src/kernel_liteos_a/kernel/base/ipc/los_queue_debug.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/ipc/los_queue_debug.c @@ -40,7 +40,7 @@ #ifdef LOSCFG_DEBUG_QUEUE typedef struct { - TSK_ENTRY_FUNC creator; /* The task entry who created this queue */ + TSK_ENTRY_FUNC creater; /* The task entry who created this queue */ UINT64 lastAccessTime; /* The last access time */ } QueueDebugCB; STATIC QueueDebugCB *g_queueDebugArray = NULL; @@ -74,7 +74,7 @@ VOID OsQueueDbgTimeUpdate(UINT32 queueID) VOID OsQueueDbgUpdate(UINT32 queueID, TSK_ENTRY_FUNC entry) { QueueDebugCB *queueDebug = &g_queueDebugArray[GET_QUEUE_INDEX(queueID)]; - queueDebug->creator = entry; + queueDebug->creater = entry; queueDebug->lastAccessTime = LOS_TickCountGet(); return; } @@ -91,8 +91,8 @@ STATIC INLINE VOID OsQueueInfoOutPut(const LosQueueCB *node) STATIC INLINE VOID OsQueueOpsOutput(const QueueDebugCB *node) { - PRINTK("TaskEntry of creator:0x%p, Latest operation time: 0x%llx\n", - node->creator, node->lastAccessTime); + PRINTK("TaskEntry of creater:0x%p, Latest operation time: 0x%llx\n", + node->creater, node->lastAccessTime); } STATIC VOID SortQueueIndexArray(UINT32 *indexArray, UINT32 count) @@ -149,7 +149,7 @@ VOID OsQueueCheck(VOID) &g_queueDebugArray[index], sizeof(QueueDebugCB)); SCHEDULER_UNLOCK(intSave); if ((queueNode.queueState == OS_QUEUE_UNUSED) || - ((queueNode.queueState == OS_QUEUE_INUSED) && (queueDebugNode.creator == NULL))) { + ((queueNode.queueState == OS_QUEUE_INUSED) && (queueDebugNode.creater == NULL))) { continue; } if ((queueNode.queueState == OS_QUEUE_INUSED) && diff --git a/src/kernel_liteos_a/kernel/base/ipc/los_rwlock.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/ipc/los_rwlock.c similarity index 93% rename from src/kernel_liteos_a/kernel/base/ipc/los_rwlock.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/ipc/los_rwlock.c index 546fe831..f15e94ad 100644 --- a/src/kernel_liteos_a/kernel/base/ipc/los_rwlock.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/ipc/los_rwlock.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2022 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -37,6 +37,7 @@ #include "los_exc.h" #include "los_sched_pri.h" + #ifdef LOSCFG_BASE_IPC_RWLOCK #define RWLOCK_COUNT_MASK 0x00FFFFFFU @@ -96,7 +97,7 @@ UINT32 LOS_RwlockDestroy(LosRwlock *rwlock) return LOS_OK; } -STATIC UINT32 OsRwlockCheck(const LosRwlock *rwlock) +STATIC UINT32 OsRwlockCheck(LosRwlock *rwlock) { if (rwlock == NULL) { return LOS_EINVAL; @@ -119,7 +120,7 @@ STATIC BOOL OsRwlockPriCompare(LosTaskCB *runTask, LOS_DL_LIST *rwList) { if (!LOS_ListEmpty(rwList)) { LosTaskCB *highestTask = OS_TCB_FROM_PENDLIST(LOS_DL_LIST_FIRST(rwList)); - if (OsSchedParamCompare(runTask, highestTask) < 0) { + if (runTask->priority < highestTask->priority) { return TRUE; } return FALSE; @@ -163,7 +164,7 @@ STATIC UINT32 OsRwlockRdPendOp(LosTaskCB *runTask, LosRwlock *rwlock, UINT32 tim * is lower than the first pended write task, current read task will be pended. */ LOS_DL_LIST *node = OsSchedLockPendFindPos(runTask, &(rwlock->readList)); - ret = runTask->ops->wait(runTask, node, timeout); + ret = OsSchedTaskWait(node, timeout, TRUE); if (ret == LOS_ERRNO_TSK_TIMEOUT) { return LOS_ETIMEDOUT; } @@ -204,7 +205,7 @@ STATIC UINT32 OsRwlockWrPendOp(LosTaskCB *runTask, LosRwlock *rwlock, UINT32 tim * write task will be pended. */ LOS_DL_LIST *node = OsSchedLockPendFindPos(runTask, &(rwlock->writeList)); - ret = runTask->ops->wait(runTask, node, timeout); + ret = OsSchedTaskWait(node, timeout, TRUE); if (ret == LOS_ERRNO_TSK_TIMEOUT) { ret = LOS_ETIMEDOUT; } @@ -354,7 +355,7 @@ STATIC UINT32 OsRwlockGetMode(LOS_DL_LIST *readList, LOS_DL_LIST *writeList) } LosTaskCB *pendedReadTask = OS_TCB_FROM_PENDLIST(LOS_DL_LIST_FIRST(readList)); LosTaskCB *pendedWriteTask = OS_TCB_FROM_PENDLIST(LOS_DL_LIST_FIRST(writeList)); - if (OsSchedParamCompare(pendedWriteTask, pendedReadTask) <= 0) { + if (pendedWriteTask->priority <= pendedReadTask->priority) { return RWLOCK_WRITEFIRST_MODE; } return RWLOCK_READFIRST_MODE; @@ -364,6 +365,7 @@ STATIC UINT32 OsRwlockPostOp(LosRwlock *rwlock, BOOL *needSched) { UINT32 rwlockMode; LosTaskCB *resumedTask = NULL; + UINT16 pendedWriteTaskPri; rwlock->rwCount = 0; rwlock->writeOwner = NULL; @@ -376,29 +378,29 @@ STATIC UINT32 OsRwlockPostOp(LosRwlock *rwlock, BOOL *needSched) resumedTask = OS_TCB_FROM_PENDLIST(LOS_DL_LIST_FIRST(&(rwlock->writeList))); rwlock->rwCount = -1; rwlock->writeOwner = (VOID *)resumedTask; - resumedTask->ops->wake(resumedTask); + OsSchedTaskWake(resumedTask); if (needSched != NULL) { *needSched = TRUE; } return LOS_OK; } - - rwlock->rwCount = 1; + /* In this case, rwlock will wake the valid pended read task. */ + if (rwlockMode == RWLOCK_READFIRST_MODE) { + pendedWriteTaskPri = OS_TCB_FROM_PENDLIST(LOS_DL_LIST_FIRST(&(rwlock->writeList)))->priority; + } resumedTask = OS_TCB_FROM_PENDLIST(LOS_DL_LIST_FIRST(&(rwlock->readList))); - resumedTask->ops->wake(resumedTask); + rwlock->rwCount = 1; + OsSchedTaskWake(resumedTask); while (!LOS_ListEmpty(&(rwlock->readList))) { resumedTask = OS_TCB_FROM_PENDLIST(LOS_DL_LIST_FIRST(&(rwlock->readList))); - if (rwlockMode == RWLOCK_READFIRST_MODE) { - LosTaskCB *pendedWriteTask = OS_TCB_FROM_PENDLIST(LOS_DL_LIST_FIRST(&(rwlock->writeList))); - if (OsSchedParamCompare(resumedTask, pendedWriteTask) >= 0) { - break; - } + if ((rwlockMode == RWLOCK_READFIRST_MODE) && (resumedTask->priority >= pendedWriteTaskPri)) { + break; } if (rwlock->rwCount == INT8_MAX) { return EINVAL; } rwlock->rwCount++; - resumedTask->ops->wake(resumedTask); + OsSchedTaskWake(resumedTask); } if (needSched != NULL) { *needSched = TRUE; diff --git a/src/kernel_liteos_a/kernel/base/ipc/los_sem.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/ipc/los_sem.c similarity index 97% rename from src/kernel_liteos_a/kernel/base/ipc/los_sem.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/ipc/los_sem.c index 31d484a1..f6633b92 100644 --- a/src/kernel_liteos_a/kernel/base/ipc/los_sem.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/ipc/los_sem.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2022 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -225,7 +225,7 @@ LITE_OS_SEC_TEXT UINT32 LOS_SemPend(UINT32 semHandle, UINT32 timeout) OsHookCall(LOS_HOOK_TYPE_SEM_PEND, semPended, runTask, timeout); OsTaskWaitSetPendMask(OS_TASK_WAIT_SEM, semPended->semID, timeout); - retErr = runTask->ops->wait(runTask, &semPended->semList, timeout); + retErr = OsSchedTaskWait(&semPended->semList, timeout, TRUE); if (retErr == LOS_ERRNO_TSK_TIMEOUT) { retErr = LOS_ERRNO_SEM_TIMEOUT; } @@ -237,8 +237,10 @@ OUT: LITE_OS_SEC_TEXT UINT32 OsSemPostUnsafe(UINT32 semHandle, BOOL *needSched) { + LosSemCB *semPosted = NULL; LosTaskCB *resumedTask = NULL; - LosSemCB *semPosted = GET_SEM(semHandle); + + semPosted = GET_SEM(semHandle); if ((semPosted->semID != semHandle) || (semPosted->semStat == OS_SEM_UNUSED)) { return LOS_ERRNO_SEM_INVALID; } @@ -252,7 +254,7 @@ LITE_OS_SEC_TEXT UINT32 OsSemPostUnsafe(UINT32 semHandle, BOOL *needSched) if (!LOS_ListEmpty(&semPosted->semList)) { resumedTask = OS_TCB_FROM_PENDLIST(LOS_DL_LIST_FIRST(&(semPosted->semList))); OsTaskWakeClearPendMask(resumedTask); - resumedTask->ops->wake(resumedTask); + OsSchedTaskWake(resumedTask); if (needSched != NULL) { *needSched = TRUE; } diff --git a/src/kernel_liteos_a/kernel/base/ipc/los_sem_debug.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/ipc/los_sem_debug.c similarity index 96% rename from src/kernel_liteos_a/kernel/base/ipc/los_sem_debug.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/ipc/los_sem_debug.c index 1ed42515..733974dc 100644 --- a/src/kernel_liteos_a/kernel/base/ipc/los_sem_debug.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/ipc/los_sem_debug.c @@ -80,7 +80,7 @@ STATIC VOID OsSemPendedTaskNamePrint(LosSemCB *semNode) typedef struct { UINT16 origSemCount; /* Number of original available semaphores */ UINT64 lastAccessTime; /* The last operation time */ - TSK_ENTRY_FUNC creator; /* The task entry who created this sem */ + TSK_ENTRY_FUNC creater; /* The task entry who created this sem */ } SemDebugCB; STATIC SemDebugCB *g_semDebugArray = NULL; @@ -110,10 +110,10 @@ VOID OsSemDbgTimeUpdate(UINT32 semID) return; } -VOID OsSemDbgUpdate(UINT32 semID, TSK_ENTRY_FUNC creator, UINT16 count) +VOID OsSemDbgUpdate(UINT32 semID, TSK_ENTRY_FUNC creater, UINT16 count) { SemDebugCB *semDebug = &g_semDebugArray[GET_SEM_INDEX(semID)]; - semDebug->creator = creator; + semDebug->creater = creater; semDebug->lastAccessTime = LOS_TickCountGet(); semDebug->origSemCount = count; return; @@ -133,7 +133,7 @@ STATIC VOID OsSemSort(UINT32 *semIndexArray, UINT32 usedCount) /* It will Print out ALL the Used Semaphore List. */ PRINTK("Used Semaphore List: \n"); - PRINTK("\r\n SemID Count OriginalCount Creator(TaskEntry) LastAccessTime\n"); + PRINTK("\r\n SemID Count OriginalCount Creater(TaskEntry) LastAccessTime\n"); PRINTK(" ------ ------ ------------- ------------------ -------------- \n"); SCHEDULER_LOCK(intSave); @@ -145,11 +145,11 @@ STATIC VOID OsSemSort(UINT32 *semIndexArray, UINT32 usedCount) (VOID)memcpy_s(&semNode, sizeof(LosSemCB), semCB, sizeof(LosSemCB)); (VOID)memcpy_s(&semDebug, sizeof(SemDebugCB), &g_semDebugArray[semIndexArray[i]], sizeof(SemDebugCB)); SCHEDULER_UNLOCK(intSave); - if ((semNode.semStat != OS_SEM_USED) || (semDebug.creator == NULL)) { + if ((semNode.semStat != OS_SEM_USED) || (semDebug.creater == NULL)) { continue; } PRINTK(" 0x%-07x0x%-07u0x%-14u%-22p0x%llx\n", semNode.semID, semDebug.origSemCount, - semNode.semCount, semDebug.creator, semDebug.lastAccessTime); + semNode.semCount, semDebug.creater, semDebug.lastAccessTime); if (!LOS_ListEmpty(&semNode.semList)) { OsSemPendedTaskNamePrint(semCB); } @@ -170,7 +170,7 @@ UINT32 OsSemInfoGetFullData(VOID) for (i = 0; i < LOSCFG_BASE_IPC_SEM_LIMIT; i++) { semNode = GET_SEM(i); semDebug = &g_semDebugArray[i]; - if ((semNode->semStat == OS_SEM_USED) && (semDebug->creator != NULL)) { + if ((semNode->semStat == OS_SEM_USED) && (semDebug->creater != NULL)) { usedSemCnt++; } } @@ -190,7 +190,7 @@ UINT32 OsSemInfoGetFullData(VOID) for (i = 0; i < LOSCFG_BASE_IPC_SEM_LIMIT; i++) { semNode = GET_SEM(i); semDebug = &g_semDebugArray[i]; - if ((semNode->semStat != OS_SEM_USED) || (semDebug->creator == NULL)) { + if ((semNode->semStat != OS_SEM_USED) || (semDebug->creater == NULL)) { continue; } *(semIndexArray + count) = i; diff --git a/src/kernel_liteos_a/kernel/base/ipc/los_signal.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/ipc/los_signal.c similarity index 93% rename from src/kernel_liteos_a/kernel/base/ipc/los_signal.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/ipc/los_signal.c index bb7bd2f7..dd179d86 100644 --- a/src/kernel_liteos_a/kernel/base/ipc/los_signal.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/ipc/los_signal.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2023 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -78,6 +78,7 @@ STATIC VOID OsMoveTmpInfoToUnbInfo(sig_cb *sigcb, INT32 signo) /* delete tmpinfo from tmpList. */ *prevHook = tmpInfoNode->next; (VOID)LOS_MemFree(m_aucSysMem0, tmpInfoNode); + tmpInfoNode = *prevHook; break; } prevHook = &tmpInfoNode->next; @@ -128,14 +129,14 @@ STATIC INLINE VOID OsSigWaitTaskWake(LosTaskCB *taskCB, INT32 signo) if (!LOS_ListEmpty(&sigcb->waitList) && OsSigIsMember(&sigcb->sigwaitmask, signo)) { OsMoveTmpInfoToUnbInfo(sigcb, signo); OsTaskWakeClearPendMask(taskCB); - taskCB->ops->wake(taskCB); + OsSchedTaskWake(taskCB); OsSigEmptySet(&sigcb->sigwaitmask); } } STATIC UINT32 OsPendingTaskWake(LosTaskCB *taskCB, INT32 signo) { - if (!OsTaskIsPending(taskCB) || !OsProcessIsUserMode(OS_PCB_FROM_TCB(taskCB))) { + if (!OsTaskIsPending(taskCB) || !OsProcessIsUserMode(OS_PCB_FROM_PID(taskCB->processID))) { return 0; } @@ -151,19 +152,19 @@ STATIC UINT32 OsPendingTaskWake(LosTaskCB *taskCB, INT32 signo) break; case OS_TASK_WAIT_JOIN: OsTaskWakeClearPendMask(taskCB); - taskCB->ops->wake(taskCB); + OsSchedTaskWake(taskCB); break; case OS_TASK_WAIT_SIGNAL: OsSigWaitTaskWake(taskCB, signo); break; case OS_TASK_WAIT_LITEIPC: OsTaskWakeClearPendMask(taskCB); - taskCB->ops->wake(taskCB); + OsSchedTaskWake(taskCB); break; case OS_TASK_WAIT_FUTEX: OsFutexNodeDeleteFromFutexHash(&taskCB->futex, TRUE, NULL, NULL); OsTaskWakeClearPendMask(taskCB); - taskCB->ops->wake(taskCB); + OsSchedTaskWake(taskCB); break; default: break; @@ -283,7 +284,7 @@ static int SigProcessSignalHandler(LosTaskCB *tcb, void *arg) return 0; } - /* If the default tcb is not set, then set this one as default. */ + /* If the default tcb is not setted, then set this one as default. */ if (!info->defaultTcb) { info->defaultTcb = tcb; } @@ -304,7 +305,7 @@ static int SigProcessSignalHandler(LosTaskCB *tcb, void *arg) /* Is this signal unblocked on this thread? */ isMember = OsSigIsMember(&tcb->sig.sigprocmask, info->sigInfo->si_signo); if ((!isMember) && (!info->receivedTcb) && (tcb != info->awakenedTcb)) { - /* if unblockedTcb of this signal is not set, then set it. */ + /* if unblockedTcb of this signal is not setted, then set it. */ if (!info->unblockedTcb) { info->unblockedTcb = tcb; } @@ -381,7 +382,8 @@ int OsSigEmptySet(sigset_t *set) /* Privilege process can't send to kernel and privilege process */ static int OsSignalPermissionToCheck(const LosProcessCB *spcb) { - UINTPTR gid = (UINTPTR)OS_GET_PGROUP_LEADER(spcb->pgroup); + UINT32 gid = spcb->group->groupID; + if (gid == OS_KERNEL_PROCESS_GROUP) { return -EPERM; } else if (gid == OS_USER_PRIVILEGE_PROCESS_GROUP) { @@ -391,16 +393,22 @@ static int OsSignalPermissionToCheck(const LosProcessCB *spcb) return 0; } -STATIC int SendSigPermissionCheck(LosProcessCB *spcb, int permission) +int OsDispatch(pid_t pid, siginfo_t *info, int permission) { - if (spcb == NULL) { + if (OsProcessIDUserCheckInvalid(pid) || pid < 0) { return -ESRCH; } + LosProcessCB *spcb = OS_PCB_FROM_PID(pid); if (OsProcessIsUnused(spcb)) { return -ESRCH; } + /* If the process you want to kill had been inactive, but still exist. should return LOS_OK */ + if (OsProcessIsInactive(spcb)) { + return LOS_OK; + } + #ifdef LOSCFG_SECURITY_CAPABILITY LosProcessCB *current = OsCurrProcessGet(); /* Kernel process always has kill permission and user process should check permission */ @@ -413,50 +421,6 @@ STATIC int SendSigPermissionCheck(LosProcessCB *spcb, int permission) if ((permission == OS_USER_KILL_PERMISSION) && (OsSignalPermissionToCheck(spcb) < 0)) { return -EPERM; } - return LOS_OK; -} - -int OsSendSigToProcess(LosProcessCB *spcb, int sig, int permission) -{ - siginfo_t info; - int ret = SendSigPermissionCheck(spcb, permission); - if (ret != LOS_OK) { - return ret; - } - - /* If the process you want to kill had been inactive, but still exist. should return LOS_OK */ - if (OsProcessIsInactive(spcb)) { - return LOS_OK; - } - - if (!GOOD_SIGNO(sig)) { - return -EINVAL; - } - - info.si_signo = sig; - info.si_code = SI_USER; - info.si_value.sival_ptr = NULL; - - return OsSigProcessSend(spcb, &info); -} - -int OsDispatch(pid_t pid, siginfo_t *info, int permission) -{ - if (OsProcessIDUserCheckInvalid(pid) || pid < 0) { - return -ESRCH; - } - - LosProcessCB *spcb = OS_PCB_FROM_PID(pid); - int ret = SendSigPermissionCheck(spcb, permission); - if (ret != LOS_OK) { - return ret; - } - - /* If the process you want to kill had been inactive, but still exist. should return LOS_OK */ - if (OsProcessIsInactive(spcb)) { - return LOS_OK; - } - return OsSigProcessSend(spcb, info); } @@ -603,7 +567,7 @@ int OsSigTimedWaitNoLock(sigset_t *set, siginfo_t *info, unsigned int timeout) sigcb->sigwaitmask |= *set; OsTaskWaitSetPendMask(OS_TASK_WAIT_SIGNAL, sigcb->sigwaitmask, timeout); - ret = task->ops->wait(task, &sigcb->waitList, timeout); + ret = OsSchedTaskWait(&sigcb->waitList, timeout, TRUE); if (ret == LOS_ERRNO_TSK_TIMEOUT) { ret = -EAGAIN; } @@ -743,7 +707,7 @@ VOID *OsSaveSignalContext(VOID *sp, VOID *newSp) sigcb->sigFlag = 0; process->sigShare = 0; SCHEDULER_UNLOCK(intSave); - PRINT_ERR("The signal processing function for the current process pid =%d is NULL!\n", process->processID); + PRINT_ERR("The signal processing function for the current process pid =%d is NULL!\n", task->processID); return sp; } /* One pthread do the share signal */ diff --git a/src/kernel_liteos_a/kernel/base/mem/common/los_memstat.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/mem/common/los_memstat.c similarity index 100% rename from src/kernel_liteos_a/kernel/base/mem/common/los_memstat.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/mem/common/los_memstat.c diff --git a/src/kernel_liteos_a/kernel/base/mem/membox/los_membox.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/mem/membox/los_membox.c similarity index 100% rename from src/kernel_liteos_a/kernel/base/mem/membox/los_membox.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/mem/membox/los_membox.c diff --git a/src/kernel_liteos_a/kernel/base/mem/tlsf/los_memory.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/mem/tlsf/los_memory.c similarity index 98% rename from src/kernel_liteos_a/kernel/base/mem/tlsf/los_memory.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/mem/tlsf/los_memory.c index 3441b613..20221c99 100644 --- a/src/kernel_liteos_a/kernel/base/mem/tlsf/los_memory.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/mem/tlsf/los_memory.c @@ -498,7 +498,7 @@ STATIC INLINE VOID OsLmsReallocMergeNodeMark(struct OsMemNodeHead *node) } g_lms->simpleMark((UINTPTR)node + OS_MEM_NODE_HEAD_SIZE, (UINTPTR)OS_MEM_NEXT_NODE(node), - LMS_SHADOW_ACCESSIBLE_U8); + LMS_SHADOW_ACCESSABLE_U8); } STATIC INLINE VOID OsLmsReallocSplitNodeMark(struct OsMemNodeHead *node) @@ -837,9 +837,6 @@ STATIC UINT32 OsMemPoolInit(VOID *pool, UINT32 size) struct OsMemPoolHead *poolHead = (struct OsMemPoolHead *)pool; struct OsMemNodeHead *newNode = NULL; struct OsMemNodeHead *endNode = NULL; - - (VOID)memset_s(poolHead, sizeof(struct OsMemPoolHead), 0, sizeof(struct OsMemPoolHead)); - #ifdef LOSCFG_KERNEL_LMS UINT32 resize = 0; if (g_lms != NULL) { @@ -851,6 +848,7 @@ STATIC UINT32 OsMemPoolInit(VOID *pool, UINT32 size) size = (resize == 0) ? size : resize; } #endif + (VOID)memset(poolHead, 0, sizeof(struct OsMemPoolHead)); LOS_SpinInit(&poolHead->spinlock); poolHead->info.pool = pool; @@ -887,14 +885,9 @@ STATIC UINT32 OsMemPoolInit(VOID *pool, UINT32 size) } #ifdef LOSCFG_MEM_MUL_POOL -STATIC VOID OsMemPoolDeinit(const VOID *pool, UINT32 size) +STATIC VOID OsMemPoolDeinit(VOID *pool) { -#ifdef LOSCFG_KERNEL_LMS - if (g_lms != NULL) { - g_lms->deInit(pool); - } -#endif - (VOID)memset_s(pool, size, 0, sizeof(struct OsMemPoolHead)); + (VOID)memset(pool, 0, sizeof(struct OsMemPoolHead)); } STATIC UINT32 OsMemPoolAdd(VOID *pool, UINT32 size) @@ -925,7 +918,7 @@ STATIC UINT32 OsMemPoolAdd(VOID *pool, UINT32 size) return LOS_OK; } -STATIC UINT32 OsMemPoolDelete(const VOID *pool) +STATIC UINT32 OsMemPoolDelete(VOID *pool) { UINT32 ret = LOS_NOK; VOID *nextPool = NULL; @@ -968,7 +961,7 @@ UINT32 LOS_MemInit(VOID *pool, UINT32 size) #ifdef LOSCFG_MEM_MUL_POOL if (OsMemPoolAdd(pool, size)) { - (VOID)OsMemPoolDeInit(pool, size); + (VOID)OsMemPoolDeinit(pool); return OS_ERROR; } #endif @@ -980,21 +973,17 @@ UINT32 LOS_MemInit(VOID *pool, UINT32 size) #ifdef LOSCFG_MEM_MUL_POOL UINT32 LOS_MemDeInit(VOID *pool) { - struct OsMemPoolHead *tmpPool = (struct OsMemPoolHead *)pool; - - if ((tmpPool == NULL) || - (tmpPool->info.pool != pool) || - (tmpPool->info.totalSize <= OS_MEM_MIN_POOL_SIZE)) { + if (pool == NULL) { return OS_ERROR; } - if (OsMemPoolDelete(tmpPool)) { + if (OsMemPoolDelete(pool)) { return OS_ERROR; } - OsMemPoolDeInit(tmpPool, tmpPool->info.totalSize); + OsMemPoolDeinit(pool); - OsHookCall(LOS_HOOK_TYPE_MEM_DEINIT, tmpPool); + OsHookCall(LOS_HOOK_TYPE_MEM_DEINIT, pool); return LOS_OK; } @@ -1907,7 +1896,7 @@ UINT32 LOS_MemInfoGet(VOID *pool, LOS_MEM_POOL_STATUS *poolStatus) return LOS_NOK; } - (VOID)memset_s(poolStatus, sizeof(LOS_MEM_POOL_STATUS), 0, sizeof(LOS_MEM_POOL_STATUS)); + (VOID)memset(poolStatus, 0, sizeof(LOS_MEM_POOL_STATUS)); struct OsMemNodeHead *tmpNode = NULL; struct OsMemNodeHead *endNode = NULL; @@ -2081,3 +2070,5 @@ BOOL OsMemIsHeapNode(const VOID *ptr) #endif return FALSE; } + + diff --git a/src/kernel_liteos_a/kernel/base/misc/kill_shellcmd.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/misc/kill_shellcmd.c similarity index 100% rename from src/kernel_liteos_a/kernel/base/misc/kill_shellcmd.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/misc/kill_shellcmd.c diff --git a/src/kernel_liteos_a/kernel/base/misc/los_misc.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/misc/los_misc.c similarity index 100% rename from src/kernel_liteos_a/kernel/base/misc/los_misc.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/misc/los_misc.c diff --git a/src/kernel_liteos_a/kernel/base/misc/los_stackinfo.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/misc/los_stackinfo.c similarity index 100% rename from src/kernel_liteos_a/kernel/base/misc/los_stackinfo.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/misc/los_stackinfo.c diff --git a/src/kernel_liteos_a/kernel/base/misc/mempt_shellcmd.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/misc/mempt_shellcmd.c similarity index 100% rename from src/kernel_liteos_a/kernel/base/misc/mempt_shellcmd.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/misc/mempt_shellcmd.c diff --git a/src/kernel_liteos_a/kernel/base/misc/panic_shellcmd.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/misc/panic_shellcmd.c similarity index 100% rename from src/kernel_liteos_a/kernel/base/misc/panic_shellcmd.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/misc/panic_shellcmd.c diff --git a/src/kernel_liteos_a/kernel/base/misc/swtmr_shellcmd.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/misc/swtmr_shellcmd.c similarity index 64% rename from src/kernel_liteos_a/kernel/base/misc/swtmr_shellcmd.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/misc/swtmr_shellcmd.c index 81573ef4..091dc3d2 100644 --- a/src/kernel_liteos_a/kernel/base/misc/swtmr_shellcmd.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/misc/swtmr_shellcmd.c @@ -36,7 +36,7 @@ #include "shcmd.h" #include "shell.h" -#define OS_ALL_SWTMR_MASK 0xffffffff + #define SWTMR_STRLEN 12 LITE_OS_SEC_DATA_MINOR STATIC CHAR g_shellSwtmrMode[][SWTMR_STRLEN] = { @@ -57,7 +57,13 @@ STATIC VOID OsPrintSwtmrMsg(const SWTMR_CTRL_S *swtmr) UINT32 ticks = 0; (VOID)LOS_SwtmrTimeGet(swtmr->usTimerID, &ticks); - PRINTK("%7u%10s%8s%12u%7u%#12x%#12x\n", + PRINTK("0x%08x " + "%-7s " + "%-6s " + "%-6u " + "%-6u " + "0x%08x " + "%p\n", swtmr->usTimerID % LOSCFG_BASE_CORE_SWTMR_LIMIT, g_shellSwtmrStatus[swtmr->ucState], g_shellSwtmrMode[swtmr->ucMode], @@ -69,15 +75,34 @@ STATIC VOID OsPrintSwtmrMsg(const SWTMR_CTRL_S *swtmr) STATIC INLINE VOID OsPrintSwtmrMsgHead(VOID) { - PRINTK("\r\nSwTmrID State Mode Interval Count Arg handlerAddr\n"); + PRINTK("\r\nSwTmrID State Mode Interval Count Arg handlerAddr\n"); + PRINTK("---------- ------- ------- --------- ------- ---------- --------\n"); } -STATIC UINT32 SwtmrBaseInfoGet(UINT32 timerID) +LITE_OS_SEC_TEXT_MINOR UINT32 OsShellCmdSwtmrInfoGet(INT32 argc, const UINT8 **argv) { +#define OS_ALL_SWTMR_MASK 0xffffffff SWTMR_CTRL_S *swtmr = g_swtmrCBArray; SWTMR_CTRL_S *swtmr1 = g_swtmrCBArray; UINT16 index; + size_t timerID; UINT16 num = 0; + CHAR *endPtr = NULL; + + if (argc > 1) { + PRINTK("\nUsage: swtmr [ID]\n"); + return OS_ERROR; + } + + if (argc == 0) { + timerID = OS_ALL_SWTMR_MASK; + } else { + timerID = strtoul((CHAR *)argv[0], &endPtr, 0); + if ((endPtr == NULL) || (*endPtr != 0) || (timerID > LOSCFG_BASE_CORE_SWTMR_LIMIT)) { + PRINTK("\nswtmr ID can't access %s.\n", argv[0]); + return OS_ERROR; + } + } for (index = 0; index < LOSCFG_BASE_CORE_SWTMR_LIMIT; index++, swtmr1++) { if (swtmr1->ucState == 0) { @@ -87,13 +112,13 @@ STATIC UINT32 SwtmrBaseInfoGet(UINT32 timerID) if (num == LOSCFG_BASE_CORE_SWTMR_LIMIT) { PRINTK("\r\nThere is no swtmr was created!\n"); - return LOS_NOK; + return OS_ERROR; } if (timerID == OS_ALL_SWTMR_MASK) { - OsPrintSwtmrMsgHead(); for (index = 0; index < LOSCFG_BASE_CORE_SWTMR_LIMIT; index++, swtmr++) { if (swtmr->ucState != 0) { + OsPrintSwtmrMsgHead(); OsPrintSwtmrMsg(swtmr); } } @@ -110,70 +135,6 @@ STATIC UINT32 SwtmrBaseInfoGet(UINT32 timerID) return LOS_OK; } -#ifdef LOSCFG_SWTMR_DEBUG -STATIC VOID OsSwtmrTimeInfoShow(VOID) -{ - UINT8 mode; - SwtmrDebugData data; - - PRINTK("SwtmrID Cpuid Mode Period(us) WaitTime(us) WaitMax(us) RTime(us) RTimeMax(us) ReTime(us)" - " ReTimeMax(us) RunCount LostNum Handler\n"); - for (UINT32 index = 0; index < LOSCFG_BASE_CORE_SWTMR_LIMIT; index++) { - if (!OsSwtmrDebugDataUsed(index)) { - continue; - } - - UINT32 ret = OsSwtmrDebugDataGet(index, &data, sizeof(SwtmrDebugData), &mode); - if (ret != LOS_OK) { - break; - } - - SwtmrDebugBase *base = &data.base; - UINT64 waitTime = ((base->waitTime / base->waitCount) * OS_NS_PER_CYCLE) / OS_SYS_NS_PER_US; - UINT64 waitTimeMax = (base->waitTimeMax * OS_NS_PER_CYCLE) / OS_SYS_NS_PER_US; - UINT64 runTime = ((base->runTime / base->runCount) * OS_NS_PER_CYCLE) / OS_SYS_NS_PER_US; - UINT64 runTimeMax = (base->runTimeMax * OS_NS_PER_CYCLE) / OS_SYS_NS_PER_US; - UINT64 readyTime = ((base->readyTime / base->runCount) * OS_NS_PER_CYCLE) / OS_SYS_NS_PER_US; - UINT64 readyTimeMax = (base->readyTimeMax * OS_NS_PER_CYCLE) / OS_SYS_NS_PER_US; - PRINTK("%4u%10u%7s%14u%13llu%12llu%10llu%13llu%10llu%14llu%15llu%11u%#12x\n", - index, data.cpuid, g_shellSwtmrMode[mode], data.period * OS_US_PER_TICK, waitTime, waitTimeMax, - runTime, runTimeMax, readyTime, readyTimeMax, base->runCount, base->times, data.handler); - } -} -#endif - -LITE_OS_SEC_TEXT_MINOR UINT32 OsShellCmdSwtmrInfoGet(INT32 argc, const CHAR **argv) -{ - UINT32 timerID; - CHAR *endPtr = NULL; - - if (argc > 1) { - goto SWTMR_HELP; - } - - if (argc == 0) { - timerID = OS_ALL_SWTMR_MASK; -#ifdef LOSCFG_SWTMR_DEBUG - } else if (strcmp("-t", argv[0]) == 0) { - OsSwtmrTimeInfoShow(); - return LOS_OK; -#endif - } else { - timerID = strtoul(argv[0], &endPtr, 0); - if ((endPtr == NULL) || (*endPtr != 0) || (timerID > LOSCFG_BASE_CORE_SWTMR_LIMIT)) { - PRINTK("\nswtmr ID can't access %s.\n", argv[0]); - return LOS_NOK; - } - } - - return SwtmrBaseInfoGet(timerID); -SWTMR_HELP: - PRINTK("Usage:\n"); - PRINTK(" swtmr --- Information about all created software timers.\n"); - PRINTK(" swtmr ID --- Specifies information about a software timer.\n"); - return LOS_OK; -} - SHELLCMD_ENTRY(swtmr_shellcmd, CMD_TYPE_EX, "swtmr", 1, (CmdCallBackFunc)OsShellCmdSwtmrInfoGet); #endif /* LOSCFG_SHELL */ diff --git a/src/kernel_liteos_a/kernel/base/misc/sysinfo_shellcmd.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/misc/sysinfo_shellcmd.c similarity index 98% rename from src/kernel_liteos_a/kernel/base/misc/sysinfo_shellcmd.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/misc/sysinfo_shellcmd.c index b7c56f84..46f85f08 100644 --- a/src/kernel_liteos_a/kernel/base/misc/sysinfo_shellcmd.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/misc/sysinfo_shellcmd.c @@ -35,9 +35,6 @@ #include "los_queue_pri.h" #include "los_swtmr_pri.h" #include "los_task_pri.h" -#ifdef LOSCFG_IPC_CONTAINER -#include "los_ipc_container_pri.h" -#endif #ifdef LOSCFG_SHELL #include "shcmd.h" @@ -91,7 +88,7 @@ UINT32 OsShellCmdQueueCntGet(VOID) LosQueueCB *queueCB = NULL; intSave = LOS_IntLock(); - queueCB = IPC_ALL_QUEUE; + queueCB = g_allQueue; for (loop = 0; loop < LOSCFG_BASE_IPC_QUEUE_LIMIT; loop++, queueCB++) { if (queueCB->queueState == OS_QUEUE_INUSED) { queueCnt++; diff --git a/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/misc/task_shellcmd.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/misc/task_shellcmd.c new file mode 100644 index 00000000..0659eedf --- /dev/null +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/misc/task_shellcmd.c @@ -0,0 +1,624 @@ +/* + * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. + * + * 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. + */ + +#include "stdlib.h" +#include "los_config.h" +#include "los_exc.h" +#include "los_memstat_pri.h" +#include "los_sem_pri.h" +#include "los_seq_buf.h" +#include "los_task_pri.h" +#ifdef LOSCFG_SHELL +#include "shcmd.h" +#include "shell.h" +#endif +#ifdef LOSCFG_KERNEL_CPUP +#include "los_cpup_pri.h" +#endif +#ifdef LOSCFG_SAVE_EXCINFO +#include "los_excinfo_pri.h" +#endif +#include "los_process_pri.h" +#include "los_vm_dump.h" +#ifdef LOSCFG_FS_VFS +#include "fs/file.h" +#endif +#include "los_sched_pri.h" + + +#define OS_PROCESS_MEM_INFO 0x2U +#define OS_PROCESS_INFO_LEN (g_processMaxNum * (sizeof(LosProcessCB))) +#define OS_PROCESS_GROUP_INFO_LEN (g_processMaxNum * sizeof(UINT32)) +#define OS_PROCESS_UID_INFO_LEN (g_processMaxNum * sizeof(UINT32)) +#define OS_PROCESS_MEM_ALL_INFO_LEN (g_processMaxNum * PROCESS_MEMINFO_LEN) +#ifdef LOSCFG_KERNEL_CPUP +#define OS_PROCESS_CPUP_LEN (g_processMaxNum * sizeof(CPUP_INFO_S)) +#define OS_PROCESS_AND_TASK_CPUP_LEN ((g_processMaxNum + g_taskMaxNum) * sizeof(CPUP_INFO_S)) +#define OS_PROCESS_CPUP_ALLINFO_LEN (OS_PROCESS_AND_TASK_CPUP_LEN * 3) +#else +#define OS_PROCESS_CPUP_ALLINFO_LEN 0 +#endif +#define OS_PROCESS_ALL_INFO_LEN (g_processMaxNum * (sizeof(LosProcessCB) + sizeof(UINT32)) + \ + OS_PROCESS_CPUP_ALLINFO_LEN + OS_PROCESS_UID_INFO_LEN) + +#ifdef LOSCFG_KERNEL_CPUP +LITE_OS_SEC_BSS STATIC CPUP_INFO_S *processCpupAll = NULL; +LITE_OS_SEC_BSS STATIC CPUP_INFO_S *processCpup10s = NULL; +LITE_OS_SEC_BSS STATIC CPUP_INFO_S *processCpup1s = NULL; +LITE_OS_SEC_BSS STATIC CPUP_INFO_S *taskCpupAll = NULL; +LITE_OS_SEC_BSS STATIC CPUP_INFO_S *taskCpup10s = NULL; +LITE_OS_SEC_BSS STATIC CPUP_INFO_S *taskCpup1s = NULL; +#endif + +STATIC UINT32 *taskWaterLine = NULL; +#define OS_INVALID_SEM_ID 0xFFFFFFFF +#define OS_TASK_WATER_LINE_SIZE (g_taskMaxNum * sizeof(UINT32)) +#define OS_TASK_INFO_LEN (g_taskMaxNum * sizeof(LosTaskCB)) +#define OS_TASK_ALL_INFO_LEN (g_taskMaxNum * (sizeof(LosTaskCB) + sizeof(UINT32))) + +#ifdef LOSCFG_FS_VFS +#if defined(LOSCFG_BLACKBOX) && defined(LOSCFG_SAVE_EXCINFO) +#define SaveExcInfo(arg, ...) WriteExcInfoToBuf(arg, ##__VA_ARGS__) +#else +#define SaveExcInfo(arg, ...) +#endif +#define PROCESS_INFO_SHOW(seqBuf, arg...) do { \ + if (seqBuf != NULL) { \ + (void)LosBufPrintf((struct SeqBuf *)seqBuf, ##arg); \ + } else { \ + PRINTK(arg); \ + } \ + SaveExcInfo(arg); \ +} while (0) +#else +#define PROCESS_INFO_SHOW(seqBuf, arg...) PRINTK(arg) +#endif + +LITE_OS_SEC_TEXT_MINOR UINT8 *OsShellCmdProcessMode(UINT16 mode) +{ + if (mode == OS_KERNEL_MODE) { + return (UINT8 *)"kernel"; + } else if (mode == OS_USER_MODE) { + return (UINT8 *)"user"; + } + + return (UINT8 *)"ERROR"; +} + +LITE_OS_SEC_TEXT_MINOR UINT8 *OsShellCmdSchedPolicy(UINT16 policy) +{ + if (policy == LOS_SCHED_RR) { + return (UINT8 *)"RR"; + } else if (policy == LOS_SCHED_FIFO) { + return (UINT8 *)"FIFO"; + } else if (policy == LOS_SCHED_IDLE) { + return (UINT8 *)"IDLE"; + } + + return (UINT8 *)"ERROR"; +} + +LITE_OS_SEC_TEXT_MINOR UINT8 *OsShellProcessStatus(UINT16 status) +{ + if (status & OS_PROCESS_STATUS_ZOMBIES) { + return (UINT8 *)"Zombies"; + } else if (status & OS_PROCESS_STATUS_INIT) { + return (UINT8 *)"Init"; + } else if (status & OS_PROCESS_STATUS_RUNNING) { + return (UINT8 *)"Running"; + } else if (status & OS_PROCESS_STATUS_READY) { + return (UINT8 *)"Ready"; + } + return (UINT8 *)"Pending"; +} + +STATIC VOID OsShellCmdProcessTitle(VOID *seqBuf, UINT16 flag) +{ + PROCESS_INFO_SHOW(seqBuf, "\r\n PID PPID PGID UID Status "); + if (flag & OS_PROCESS_MEM_INFO) { + PROCESS_INFO_SHOW(seqBuf, "VirtualMem ShareMem PhysicalMem "); + } + + if (flag & OS_PROCESS_INFO_ALL) { +#ifdef LOSCFG_KERNEL_CPUP + PROCESS_INFO_SHOW(seqBuf, "CPUUSE CPUUSE10s CPUUSE1s "); +#endif /* LOSCFG_KERNEL_CPUP */ + PROCESS_INFO_SHOW(seqBuf, "Policy Priority MTID TaskTotal Mode "); + } else { +#ifdef LOSCFG_KERNEL_CPUP + PROCESS_INFO_SHOW(seqBuf, "CPUUSE10s "); +#endif /* LOSCFG_KERNEL_CPUP */ + } + PROCESS_INFO_SHOW(seqBuf, " PName\n"); +} + +STATIC VOID OsShellCmdProcessInfoShow(const LosProcessCB *processCB, const INT32 *group, + const UINT32 *memArray, VOID *seqBuf, UINT16 flag) +{ + const UINT32 *procMemUsage = NULL; + const INT32 *user = (const INT32 *)((UINTPTR)group + OS_PROCESS_GROUP_INFO_LEN); + UINT32 pid = processCB->processID; + PROCESS_INFO_SHOW(seqBuf, "%5u%6d%5d%10d%8s", pid, (INT32)processCB->parentProcessID, group[pid], user[pid], + OsShellProcessStatus(processCB->processStatus)); + + if (flag & OS_PROCESS_MEM_INFO) { + procMemUsage = &memArray[pid * PROCESS_VM_INDEX_MAX]; + PROCESS_INFO_SHOW(seqBuf, "%#11x%#9x%#12x", procMemUsage[PROCESS_VM_INDEX], procMemUsage[PROCESS_SM_INDEX], + procMemUsage[PROCESS_PM_INDEX]); + } + if (flag & OS_PROCESS_INFO_ALL) { +#ifdef LOSCFG_KERNEL_CPUP + PROCESS_INFO_SHOW(seqBuf, "%4u.%-2u%7u.%-2u%6u.%-2u ", + processCpupAll[pid].usage / LOS_CPUP_PRECISION_MULT, + processCpupAll[pid].usage % LOS_CPUP_PRECISION_MULT, + processCpup10s[pid].usage / LOS_CPUP_PRECISION_MULT, + processCpup10s[pid].usage % LOS_CPUP_PRECISION_MULT, + processCpup1s[pid].usage / LOS_CPUP_PRECISION_MULT, + processCpup1s[pid].usage % LOS_CPUP_PRECISION_MULT); +#endif /* LOSCFG_KERNEL_CPUP */ + PROCESS_INFO_SHOW(seqBuf, "%6s%9u%5d%10u%7s ", + OsShellCmdSchedPolicy(LOS_SCHED_RR), OS_TCB_FROM_TID(processCB->threadGroupID)->basePrio, + (INT32)processCB->threadGroupID, processCB->threadNumber, + OsShellCmdProcessMode(processCB->processMode)); + } else { +#ifdef LOSCFG_KERNEL_CPUP + PROCESS_INFO_SHOW(seqBuf, "%7u.%-2u ", + processCpup10s[pid].usage / LOS_CPUP_PRECISION_MULT, + processCpup10s[pid].usage % LOS_CPUP_PRECISION_MULT); +#endif /* LOSCFG_KERNEL_CPUP */ + } + PROCESS_INFO_SHOW(seqBuf, " %-32s\n", processCB->processName); +} + +STATIC VOID OsShellCmdAllProcessInfoShow(const LosProcessCB *pcbArray, const INT32 *group, + const UINT32 *memArray, VOID *seqBuf, UINT16 flag) +{ + const LosProcessCB *processCB = NULL; + UINT32 pid; + + for (pid = 1; pid < g_processMaxNum; ++pid) { + processCB = pcbArray + pid; + if (OsProcessIsUnused(processCB)) { + continue; + } + + OsShellCmdProcessInfoShow(processCB, group, memArray, seqBuf, flag); + } +} + +#ifdef LOSCFG_KERNEL_VM +STATIC VOID OsProcessMemUsageGet(UINT32 *memArray) +{ + UINT32 pid; + LosProcessCB *processCB = NULL; + UINT32 *proMemUsage = NULL; + + for (pid = 0; pid < g_processMaxNum; ++pid) { + processCB = g_processCBArray + pid; + if (OsProcessIsUnused(processCB)) { + continue; + } + proMemUsage = &memArray[pid * PROCESS_VM_INDEX_MAX]; + + /* Process memory usage statistics, idle task defaults to 0 */ + if (pid == OsGetIdleProcessID()) { + proMemUsage[PROCESS_VM_INDEX] = 0; + proMemUsage[PROCESS_SM_INDEX] = 0; + proMemUsage[PROCESS_PM_INDEX] = 0; + } else { + proMemUsage[PROCESS_VM_INDEX] = OsShellCmdProcessVmUsage(processCB->vmSpace); + OsShellCmdProcessPmUsage(processCB->vmSpace, &proMemUsage[PROCESS_SM_INDEX], + &proMemUsage[PROCESS_PM_INDEX]); + } + } +} +#endif + +#define OS_TASK_STATUS_MASK 0x00FF +STATIC VOID OsProcessInfoGet(LosProcessCB **pcbArray, INT32 **group, + UINT32 **memArray, LosTaskCB **tcbArray, + UINT16 flag) +{ + *group = (INT32 *)((UINTPTR)*pcbArray + OS_PROCESS_INFO_LEN); + INT32 *user = (INT32 *)((UINTPTR)*group + OS_PROCESS_GROUP_INFO_LEN); + + for (UINT32 tid = 0; tid < g_taskMaxNum; tid++) { + LosTaskCB *taskCB = *tcbArray + tid; + if (OsTaskIsUnused(taskCB)) { + continue; + } + + LosProcessCB *processCB = *pcbArray + taskCB->processID; + if (!OsProcessIsDead(processCB) && !OsProcessIsInit(processCB)) { + processCB->processStatus |= (taskCB->taskStatus & OS_TASK_STATUS_MASK); + } + } + + for (UINT32 pid = 0; pid < g_processMaxNum; ++pid) { + LosProcessCB *processCB = *pcbArray + pid; + if (OsProcessIsUnused(processCB)) { + continue; + } + + if (processCB->group != NULL) { + (*group)[processCB->processID] = processCB->group->groupID; + } else { + (*group)[processCB->processID] = -1; + } + +#ifdef LOSCFG_SECURITY_CAPABILITY + if (processCB->user != NULL) { + user[processCB->processID] = processCB->user->userID; + } else { + user[processCB->processID] = -1; + } +#else + user[processCB->processID] = 0; +#endif + } + +#ifdef LOSCFG_KERNEL_CPUP + processCpupAll = (CPUP_INFO_S *)((UINTPTR)user + OS_PROCESS_UID_INFO_LEN); + taskCpupAll = (CPUP_INFO_S *)((UINTPTR)processCpupAll + OS_PROCESS_CPUP_LEN); + processCpup10s = (CPUP_INFO_S *)((UINTPTR)processCpupAll + OS_PROCESS_AND_TASK_CPUP_LEN); + taskCpup10s = (CPUP_INFO_S *)((UINTPTR)processCpup10s + OS_PROCESS_CPUP_LEN); + processCpup1s = (CPUP_INFO_S *)((UINTPTR)processCpup10s + OS_PROCESS_AND_TASK_CPUP_LEN); + taskCpup1s = (CPUP_INFO_S *)((UINTPTR)processCpup1s + OS_PROCESS_CPUP_LEN); + + (VOID)OsGetAllProcessAndTaskCpuUsageUnsafe(CPUP_ALL_TIME, processCpupAll, OS_PROCESS_AND_TASK_CPUP_LEN); + (VOID)OsGetAllProcessAndTaskCpuUsageUnsafe(CPUP_LAST_TEN_SECONDS, processCpup10s, OS_PROCESS_AND_TASK_CPUP_LEN); + (VOID)OsGetAllProcessAndTaskCpuUsageUnsafe(CPUP_LAST_ONE_SECONDS, processCpup1s, OS_PROCESS_AND_TASK_CPUP_LEN); +#endif + +#ifdef LOSCFG_KERNEL_VM + if (flag & OS_PROCESS_MEM_INFO) { + *memArray = (UINT32 *)((UINTPTR)*pcbArray + OS_PROCESS_ALL_INFO_LEN); + OsProcessMemUsageGet(*memArray); + } +#endif +} + +STATIC VOID OsShellCmdProcessInfoData(const LosProcessCB *pcbArray, const INT32 *group, + const UINT32 *memArray, VOID *seqBuf, UINT16 flag) +{ +#ifdef LOSCFG_KERNEL_CPUP + UINT32 pid = OsGetIdleProcessID(); + UINT32 sysUsage = LOS_CPUP_PRECISION - processCpupAll[pid].usage; + + PROCESS_INFO_SHOW(seqBuf, "\n allCpu(%%): %4u.%02u sys, %4u.%02u idle\n", + sysUsage / LOS_CPUP_PRECISION_MULT, + sysUsage % LOS_CPUP_PRECISION_MULT, + processCpupAll[pid].usage / LOS_CPUP_PRECISION_MULT, + processCpupAll[pid].usage % LOS_CPUP_PRECISION_MULT); +#endif + + OsShellCmdProcessTitle(seqBuf, flag); + OsShellCmdAllProcessInfoShow(pcbArray, group, memArray, seqBuf, flag); +} + +LITE_OS_SEC_TEXT_MINOR UINT8 *OsShellCmdConvertTskStatus(UINT16 taskStatus) +{ + if (taskStatus & OS_TASK_STATUS_INIT) { + return (UINT8 *)"Init"; + } else if (taskStatus & OS_TASK_STATUS_RUNNING) { + return (UINT8 *)"Running"; + } else if (taskStatus & OS_TASK_STATUS_READY) { + return (UINT8 *)"Ready"; + } else if (taskStatus & OS_TASK_STATUS_SUSPENDED) { + return (UINT8 *)"Suspended"; + } else if (taskStatus & OS_TASK_STATUS_DELAY) { + return (UINT8 *)"Delay"; + } else if (taskStatus & OS_TASK_STATUS_PENDING) { + if (taskStatus & OS_TASK_STATUS_PEND_TIME) { + return (UINT8 *)"PendTime"; + } else { + return (UINT8 *)"Pending"; + } + } else if (taskStatus & OS_TASK_STATUS_EXIT) { + return (UINT8 *)"Exit"; + } + + return (UINT8 *)"Invalid"; +} + +STATIC VOID OsShellCmdTaskWaterLineGet(const LosTaskCB *allTaskArray) +{ + const LosTaskCB *taskCB = NULL; + UINT32 loop; + + for (loop = 0; loop < g_taskMaxNum; ++loop) { + taskCB = allTaskArray + loop; + if (OsTaskIsUnused(taskCB)) { + continue; + } + + (VOID)OsStackWaterLineGet((const UINTPTR *)((UINTPTR)taskCB->topOfStack + taskCB->stackSize), + (const UINTPTR *)taskCB->topOfStack, &taskWaterLine[taskCB->taskID]); + } +} + +#ifdef LOSCFG_SHELL_CMD_DEBUG +#define OS_PEND_REASON_MAX_LEN 20 + +STATIC CHAR *OsShellCheckTaskWaitFlag(const LosTaskCB *taskCB, UINTPTR *lockID) +{ + *lockID = taskCB->waitID; + switch (taskCB->waitFlag) { + case OS_TASK_WAIT_PROCESS: + return "Child"; + case OS_TASK_WAIT_GID: + return "PGroup"; + case OS_TASK_WAIT_ANYPROCESS: + return "AnyChild"; + case OS_TASK_WAIT_SEM: + return "Semaphore"; + case OS_TASK_WAIT_QUEUE: + return "Queue"; + case OS_TASK_WAIT_JOIN: + return "Join"; + case OS_TASK_WAIT_SIGNAL: + return "Signal"; + case OS_TASK_WAIT_LITEIPC: + return "LiteIPC"; + case OS_TASK_WAIT_MUTEX: + return "Mutex"; + case OS_TASK_WAIT_EVENT: + return "Event"; + case OS_TASK_WAIT_FUTEX: + return "Futex"; + case OS_TASK_WAIT_COMPLETE: + return "Complete"; + default: + break; + } + + return NULL; +} + +STATIC VOID OsShellCmdCheckTaskPend(const LosTaskCB *taskCB, CHAR *pendReason, UINT32 maxLen, UINTPTR *lockID) +{ + CHAR *reason = NULL; + LosTaskCB *owner = NULL; + + if (!(taskCB->taskStatus & OS_TASK_STATUS_PENDING)) { + reason = (CHAR *)OsShellCmdConvertTskStatus(taskCB->taskStatus); + goto EXIT; + } + + reason = OsShellCheckTaskWaitFlag(taskCB, lockID); + if (reason == NULL) { + reason = "Others"; + } + + if (taskCB->taskMux != NULL) { + *lockID = (UINTPTR)taskCB->taskMux; + owner = ((LosMux *)taskCB->taskMux)->owner; + if (owner != NULL) { + if (snprintf_s(pendReason, maxLen, maxLen - 1, "Mutex-%u", owner->taskID) == EOK) { + return; + } + } + } + +EXIT: + if (strcpy_s(pendReason, maxLen, reason) != EOK) { + PRINT_ERR("Get pend reason copy failed !\n"); + } +} +#endif + +STATIC VOID OsShellCmdTskInfoTitle(VOID *seqBuf, UINT16 flag) +{ + PROCESS_INFO_SHOW(seqBuf, "\r\n TID PID "); +#ifdef LOSCFG_KERNEL_SMP + PROCESS_INFO_SHOW(seqBuf, "Affi CPU "); +#endif + PROCESS_INFO_SHOW(seqBuf, " Status StackSize WaterLine "); + if (flag & OS_PROCESS_INFO_ALL) { +#ifdef LOSCFG_KERNEL_CPUP + PROCESS_INFO_SHOW(seqBuf, "CPUUSE CPUUSE10s CPUUSE1s "); +#endif /* LOSCFG_KERNEL_CPUP */ +#ifdef LOSCFG_SHELL_CMD_DEBUG + PROCESS_INFO_SHOW(seqBuf, " StackPoint TopOfStack PendReason LockID "); +#endif + PROCESS_INFO_SHOW(seqBuf, "Policy Priority "); + } else { +#ifdef LOSCFG_KERNEL_CPUP + PROCESS_INFO_SHOW(seqBuf, "CPUUSE10s "); +#endif /* LOSCFG_KERNEL_CPUP */ + } + PROCESS_INFO_SHOW(seqBuf, " MEMUSE TaskName\n"); +} + +STATIC INLINE VOID OsShellTskInfoData(const LosTaskCB *taskCB, VOID *seqBuf, UINT16 flag) +{ +#ifdef LOSCFG_SHELL_CMD_DEBUG + UINTPTR lockID = 0; + CHAR pendReason[OS_PEND_REASON_MAX_LEN] = { 0 }; +#endif + PROCESS_INFO_SHOW(seqBuf, " %4u%5u", taskCB->taskID, taskCB->processID); + +#ifdef LOSCFG_KERNEL_SMP + PROCESS_INFO_SHOW(seqBuf, "%#5x%4d ", taskCB->cpuAffiMask, (INT16)(taskCB->currCpu)); +#endif + + PROCESS_INFO_SHOW(seqBuf, "%12s%#10x%#10x", OsShellCmdConvertTskStatus(taskCB->taskStatus), + taskCB->stackSize, taskWaterLine[taskCB->taskID]); + if (flag & OS_PROCESS_INFO_ALL) { +#ifdef LOSCFG_KERNEL_CPUP + PROCESS_INFO_SHOW(seqBuf, "%4u.%-2u%7u.%-2u%6u.%-2u ", + taskCpupAll[taskCB->taskID].usage / LOS_CPUP_PRECISION_MULT, + taskCpupAll[taskCB->taskID].usage % LOS_CPUP_PRECISION_MULT, + taskCpup10s[taskCB->taskID].usage / LOS_CPUP_PRECISION_MULT, + taskCpup10s[taskCB->taskID].usage % LOS_CPUP_PRECISION_MULT, + taskCpup1s[taskCB->taskID].usage / LOS_CPUP_PRECISION_MULT, + taskCpup1s[taskCB->taskID].usage % LOS_CPUP_PRECISION_MULT); +#endif /* LOSCFG_KERNEL_CPUP */ +#ifdef LOSCFG_SHELL_CMD_DEBUG + OsShellCmdCheckTaskPend(taskCB, pendReason, OS_PEND_REASON_MAX_LEN, &lockID); + PROCESS_INFO_SHOW(seqBuf, "%#12x%#12x%11s%#11x", taskCB->stackPointer, taskCB->topOfStack, pendReason, lockID); +#endif + PROCESS_INFO_SHOW(seqBuf, "%7s%9u", OsShellCmdSchedPolicy(taskCB->policy), taskCB->priority); + } else { +#ifdef LOSCFG_KERNEL_CPUP + PROCESS_INFO_SHOW(seqBuf, "%7u.%-2u ", + taskCpup10s[taskCB->taskID].usage / LOS_CPUP_PRECISION_MULT, + taskCpup10s[taskCB->taskID].usage % LOS_CPUP_PRECISION_MULT); +#endif /* LOSCFG_KERNEL_CPUP */ + } + PROCESS_INFO_SHOW(seqBuf, "%#10x %-32s\n", OsTaskMemUsage(taskCB->taskID), taskCB->taskName); +} + +STATIC VOID OsShellCmdAllTaskInfoData(const LosTaskCB *allTaskArray, VOID *seqBuf, UINT16 flag) +{ + const LosTaskCB *taskCB = NULL; + UINT32 pid; + UINT32 loop; + + for (pid = 1; pid < g_processMaxNum; ++pid) { + for (loop = 0; loop < g_taskMaxNum; ++loop) { + taskCB = allTaskArray + loop; + if (OsTaskIsUnused(taskCB) || (taskCB->processID != pid)) { + continue; + } + + OsShellTskInfoData(taskCB, seqBuf, flag); + } + } +} + +STATIC VOID OsShellCmdTskInfoData(const LosTaskCB *allTaskArray, VOID *seqBuf, UINT16 flag) +{ + OsShellCmdTskInfoTitle(seqBuf, flag); + OsShellCmdAllTaskInfoData(allTaskArray, seqBuf, flag); +} + +STATIC VOID OsProcessAndTaskInfoGet(LosProcessCB **pcbArray, INT32 **group, LosTaskCB **tcbArray, + UINT32 **memArray, UINT16 flag) +{ + BOOL lockFlag = FALSE; + UINT32 intSave = 0; + UINT32 processInfoLen = OS_PROCESS_ALL_INFO_LEN; + + if (LOS_SpinHeld(&g_taskSpin) == FALSE) { + SCHEDULER_LOCK(intSave); + lockFlag = TRUE; + } + +#ifdef LOSCFG_KERNEL_VM + if (flag & OS_PROCESS_MEM_INFO) { + processInfoLen += OS_PROCESS_MEM_ALL_INFO_LEN; + } +#endif + + (VOID)memcpy_s(*pcbArray, OS_PROCESS_INFO_LEN, g_processCBArray, OS_PROCESS_INFO_LEN); + *tcbArray = (LosTaskCB *)((UINTPTR)*pcbArray + processInfoLen); + (VOID)memcpy_s(*tcbArray, OS_TASK_INFO_LEN, g_taskCBArray, OS_TASK_INFO_LEN); + + OsProcessInfoGet(pcbArray, group, memArray, tcbArray, flag); + taskWaterLine = (UINT32 *)((UINTPTR)*tcbArray + OS_TASK_INFO_LEN); + OsShellCmdTaskWaterLineGet(*tcbArray); + if (lockFlag == TRUE) { + SCHEDULER_UNLOCK(intSave); + } +} + +LITE_OS_SEC_TEXT_MINOR UINT32 OsShellCmdTskInfoGet(UINT32 taskID, VOID *seqBuf, UINT16 flag) +{ + UINT32 size; + LosProcessCB *pcbArray = NULL; + INT32 *group = NULL; + LosTaskCB *tcbArray = NULL; + UINT32 *memArray = NULL; + + if (taskID == OS_ALL_TASK_MASK) { + if (flag & OS_PROCESS_MEM_INFO) { + size = OS_PROCESS_ALL_INFO_LEN + OS_PROCESS_MEM_ALL_INFO_LEN + OS_TASK_ALL_INFO_LEN; + } else { + size = OS_PROCESS_ALL_INFO_LEN + OS_TASK_ALL_INFO_LEN; + } + pcbArray = (LosProcessCB *)LOS_MemAlloc(m_aucSysMem1, size); + if (pcbArray == NULL) { + PRINT_ERR("Memory is not enough to save task info!\n"); + return LOS_NOK; + } + (VOID)memset_s(pcbArray, size, 0, size); + OsProcessAndTaskInfoGet(&pcbArray, &group, &tcbArray, &memArray, flag); + OsShellCmdProcessInfoData(pcbArray, group, memArray, seqBuf, flag); + OsShellCmdTskInfoData(tcbArray, seqBuf, flag); + + (VOID)LOS_MemFree(m_aucSysMem1, pcbArray); + } + + return LOS_OK; +} + +LITE_OS_SEC_TEXT_MINOR UINT32 OsShellCmdDumpTask(INT32 argc, const CHAR **argv) +{ + UINT32 flag = 0; +#ifdef LOSCFG_KERNEL_VM + flag |= OS_PROCESS_MEM_INFO; +#endif + + if (argc >= 2) { /* 2: The task shell name restricts the parameters */ + goto TASK_HELP; + } + + if (argc == 1) { + if (strcmp("-a", argv[0]) == 0) { + flag |= OS_PROCESS_INFO_ALL; + } else if (strcmp("-i", argv[0]) == 0) { + if (!OsShellShowTickRespo()) { + return LOS_OK; + } + goto TASK_HELP; + } else if (strcmp("-t", argv[0]) == 0) { + if (!OsShellShowSchedParam()) { + return LOS_OK; + } + goto TASK_HELP; + } else { + goto TASK_HELP; + } + } + + return OsShellCmdTskInfoGet(OS_ALL_TASK_MASK, NULL, flag); + +TASK_HELP: + PRINTK("Unknown option: %s\n", argv[0]); + PRINTK("usage: task or task -a\n"); + return LOS_NOK; +} + +#ifdef LOSCFG_SHELL +SHELLCMD_ENTRY(task_shellcmd, CMD_TYPE_EX, "task", 1, (CmdCallBackFunc)OsShellCmdDumpTask); +#endif + diff --git a/src/kernel_liteos_a/kernel/base/misc/vm_shellcmd.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/misc/vm_shellcmd.c similarity index 100% rename from src/kernel_liteos_a/kernel/base/misc/vm_shellcmd.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/misc/vm_shellcmd.c diff --git a/src/kernel_liteos_a/kernel/base/mp/los_lockdep.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/mp/los_lockdep.c similarity index 97% rename from src/kernel_liteos_a/kernel/base/mp/los_lockdep.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/mp/los_lockdep.c index fb093591..65e5f2f8 100644 --- a/src/kernel_liteos_a/kernel/base/mp/los_lockdep.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/mp/los_lockdep.c @@ -190,7 +190,11 @@ VOID OsLockDepCheckIn(SPIN_LOCK_S *lock) { UINT32 intSave; enum LockDepErrType checkResult = LOCKDEP_SUCCESS; +#ifdef LOSCFG_COMPILER_CLANG_LLVM VOID *requestAddr = (VOID *)__builtin_return_address(1); +#else + VOID *requestAddr = (VOID *)__builtin_return_address(0); +#endif LosTaskCB *current = OsCurrTaskGet(); LockDep *lockDep = ¤t->lockDep; LosTaskCB *lockOwner = NULL; @@ -271,8 +275,12 @@ VOID OsLockDepCheckOut(SPIN_LOCK_S *lock) { UINT32 intSave; INT32 depth; - enum LockDepErrType checkResult; + enum LockDepErrType checkResult = LOCKDEP_SUCCESS; +#ifdef LOSCFG_COMPILER_CLANG_LLVM VOID *requestAddr = (VOID *)__builtin_return_address(1); +#else + VOID *requestAddr = (VOID *)__builtin_return_address(0); +#endif LosTaskCB *current = OsCurrTaskGet(); LosTaskCB *owner = NULL; LockDep *lockDep = NULL; diff --git a/src/kernel_liteos_a/kernel/base/mp/los_mp.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/mp/los_mp.c similarity index 99% rename from src/kernel_liteos_a/kernel/base/mp/los_mp.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/mp/los_mp.c index 67bc7012..c4e9b183 100644 --- a/src/kernel_liteos_a/kernel/base/mp/los_mp.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/mp/los_mp.c @@ -62,7 +62,7 @@ VOID OsMpScheduleHandler(VOID) * set schedule flag to differ from wake function, * so that the scheduler can be triggered at the end of irq. */ - OsSchedRunqueuePendingSet(); + OsSchedRunQuePendingSet(); } VOID OsMpHaltHandler(VOID) diff --git a/src/kernel_liteos_a/kernel/base/mp/los_percpu.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/mp/los_percpu.c similarity index 100% rename from src/kernel_liteos_a/kernel/base/mp/los_percpu.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/mp/los_percpu.c diff --git a/src/kernel_liteos_a/kernel/base/mp/los_spinlock.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/mp/los_spinlock.c similarity index 100% rename from src/kernel_liteos_a/kernel/base/mp/los_spinlock.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/mp/los_spinlock.c diff --git a/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/mp/los_stat.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/mp/los_stat.c new file mode 100644 index 00000000..2810c2ec --- /dev/null +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/mp/los_stat.c @@ -0,0 +1,323 @@ +/* + * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. + * + * 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. + */ + +#include "los_task_pri.h" + + +#ifdef LOSCFG_KERNEL_SCHED_STATISTICS +#define HIGHTASKPRI 16 +#define NS_PER_MS 1000000 +#define DECIMAL_TO_PERCENTAGE 100 + +typedef struct { + UINT64 idleRuntime; + UINT64 idleStarttime; + UINT64 highTaskRuntime; + UINT64 highTaskStarttime; + UINT64 spinWaitRuntime; + UINT64 sumPriority; + UINT32 prioritySwitch; + UINT32 highTaskSwitch; + UINT32 contexSwitch; + UINT32 hwiNum; + UINT32 ipiIrqNum; +} MpStatPercpu; + +STATIC BOOL g_mpStaticStartFlag = FALSE; +STATIC UINT64 g_mpStaticStartTime; +STATIC MpStatPercpu g_mpStatPercpu[LOSCFG_KERNEL_SMP_CORE_NUM] = {0}; + +STATIC VOID OsMpSchedStatistics(LosTaskCB *runTask, LosTaskCB *newTask) +{ + UINT32 cpuid; + UINT32 idleTaskID; + UINT64 now, runtime; + + if (g_mpStaticStartFlag != TRUE) { + return; + } + + cpuid = ArchCurrCpuid(); + idleTaskID = OsGetIdleTaskId(); + now = LOS_CurrNanosec(); + + g_mpStatPercpu[cpuid].contexSwitch++; + + if ((runTask->taskID != idleTaskID) && (newTask->taskID == idleTaskID)) { + g_mpStatPercpu[cpuid].idleStarttime = now; + } + + if ((runTask->taskID == idleTaskID) && (newTask->taskID != idleTaskID)) { + runtime = now - g_mpStatPercpu[cpuid].idleStarttime; + g_mpStatPercpu[cpuid].idleRuntime += runtime; + g_mpStatPercpu[cpuid].idleStarttime = 0; + } + + if ((runTask->priority >= HIGHTASKPRI) && (newTask->priority < HIGHTASKPRI)) { + g_mpStatPercpu[cpuid].highTaskStarttime = now; + } + + if ((runTask->priority < HIGHTASKPRI) && (newTask->priority >= HIGHTASKPRI)) { + runtime = now - g_mpStatPercpu[cpuid].highTaskStarttime; + g_mpStatPercpu[cpuid].highTaskRuntime += runtime; + g_mpStatPercpu[cpuid].highTaskStarttime = 0; + } + + if (newTask->priority < HIGHTASKPRI) { + g_mpStatPercpu[cpuid].highTaskSwitch++; + } + + if (newTask->taskID != idleTaskID) { + g_mpStatPercpu[cpuid].sumPriority += newTask->priority; + g_mpStatPercpu[cpuid].prioritySwitch++; + } + + return; +} + +LITE_OS_SEC_TEXT_MINOR VOID OsSchedStatistics(LosTaskCB *runTask, LosTaskCB *newTask) +{ + UINT64 runtime; + UINT32 cpuid = ArchCurrCpuid(); + UINT64 now = LOS_CurrNanosec(); + + SchedStat *schedRun = &runTask->schedStat; + SchedStat *schedNew = &newTask->schedStat; + SchedPercpu *cpuRun = &schedRun->schedPercpu[cpuid]; + SchedPercpu *cpuNew = &schedNew->schedPercpu[cpuid]; + + /* calculate one chance of running time */ + runtime = now - schedRun->startRuntime; + + /* add running timer to running task statistics */ + cpuRun->runtime += runtime; + schedRun->allRuntime += runtime; + + /* add context switch counters and schedule start time */ + cpuNew->contexSwitch++; + schedNew->allContextSwitch++; + schedNew->startRuntime = now; + OsMpSchedStatistics(runTask, newTask); +} + +LITE_OS_SEC_TEXT_MINOR VOID OsSpinWaitStatistics(UINT64 spinWaitRuntime) +{ + UINT32 cpuid = ArchCurrCpuid(); + g_mpStatPercpu[cpuid].spinWaitRuntime += spinWaitRuntime; + return; +} + +LITE_OS_SEC_TEXT_MINOR VOID OsHwiStatistics(size_t intNum) +{ + UINT32 cpuid = ArchCurrCpuid(); + + if ((g_mpStaticStartFlag != TRUE) || (intNum == OS_TICK_INT_NUM)) { + return; + } + + g_mpStatPercpu[cpuid].hwiNum++; + /* 16: 0~15 is ipi interrupts */ + if (intNum < 16) { + g_mpStatPercpu[cpuid].ipiIrqNum++; + } + + return; +} + +LITE_OS_SEC_TEXT_MINOR VOID OsShellCmdDumpSched(VOID) +{ + LosTaskCB *taskCB = NULL; + UINT32 loop; + UINT32 cpuid; + UINT32 affinity; + + PRINTK("\n"); + PRINTK("Task TID Total Time Total CST " + "CPU Time CST\n"); + PRINTK("---- --- ------------------ ---------- -" + "--- ------------------ ----------\n"); + + for (loop = 0; loop < g_taskMaxNum; loop++) { + taskCB = (((LosTaskCB *)g_taskCBArray) + loop); + if (OsTaskIsUnused(taskCB)) { + continue; + } + + affinity = (UINT32)taskCB->cpuAffiMask; + + PRINTK("%-30s0x%-6x%+16lf ms %10u\n", taskCB->taskName, taskCB->taskID, + (DOUBLE)(taskCB->schedStat.allRuntime) / NS_PER_MS, + taskCB->schedStat.allContextSwitch); + + for (cpuid = 0; cpuid < LOSCFG_KERNEL_CORE_NUM; cpuid++) { + if (!((1U << cpuid) & affinity)) { + continue; + } + + PRINTK(" " + "CPU%u %+16lf ms %12u\n", cpuid, + (DOUBLE)(taskCB->schedStat.schedPercpu[cpuid].runtime) / NS_PER_MS, + taskCB->schedStat.schedPercpu[cpuid].contexSwitch); + } + } + + PRINTK("\n"); +} + +LITE_OS_SEC_TEXT_MINOR VOID OsShellMpStaticStart(VOID) +{ + LosTaskCB *taskCB = NULL; + UINT32 loop; + UINT32 cpuid = 0; + UINT32 intSave; + + SCHEDULER_LOCK(intSave); + + if (g_mpStaticStartFlag) { + PRINT_WARN("mp static has started\n"); + SCHEDULER_UNLOCK(intSave); + return; + } + + g_mpStaticStartTime = LOS_CurrNanosec(); + + for (loop = 0; loop < g_taskMaxNum; loop++) { + taskCB = (((LosTaskCB *)g_taskCBArray) + loop); + if (taskCB->taskStatus & OS_TASK_STATUS_RUNNING) { +#ifdef LOSCFG_KERNEL_SMP + cpuid = taskCB->currCpu; +#endif + if ((UINT32)(OS_TASK_INVALID_CPUID) == cpuid) { + continue; + } + if (!strcmp(taskCB->taskName, "Idle")) { + g_mpStatPercpu[cpuid].idleStarttime = g_mpStaticStartTime; + } + if (taskCB->priority < HIGHTASKPRI) { + g_mpStatPercpu[cpuid].highTaskStarttime = g_mpStaticStartTime; + g_mpStatPercpu[cpuid].highTaskSwitch++; + } + if (strcmp(taskCB->taskName, "Idle")) { + g_mpStatPercpu[cpuid].sumPriority += taskCB->priority; + g_mpStatPercpu[cpuid].prioritySwitch++; + } + } + } + g_mpStaticStartFlag = TRUE; + SCHEDULER_UNLOCK(intSave); + + PRINTK("mp static start\n"); + + return; +} + +LITE_OS_SEC_TEXT_MINOR VOID OsMpStaticShow(UINT64 mpStaticPastTime) +{ + UINT32 cpuid; + PRINTK("\n"); + PRINTK("Passed Time: %+16lf ms\n", (DOUBLE)mpStaticPastTime / NS_PER_MS); + PRINTK("--------------------------------\n"); + PRINTK("CPU Idle(%%) schedule noTick Hwi MP Hwi MP Loss(%%) " + "avg PRI HiTSK(%%) HiTSK SCH HiTSK P(ms)\n"); + PRINTK("---- --------- ---------- ---------- ---------- ---------- " + "---------- ---------- ---------- ----------\n"); + + for (cpuid = 0; cpuid < LOSCFG_KERNEL_CORE_NUM; cpuid++) { + PRINTK("CPU%u %+10lf%14u%14u%14u %+11lf %+11lf %+11lf%14u %+11lf\n", cpuid, + ((DOUBLE)(g_mpStatPercpu[cpuid].idleRuntime) / mpStaticPastTime) * DECIMAL_TO_PERCENTAGE, + g_mpStatPercpu[cpuid].contexSwitch, + g_mpStatPercpu[cpuid].hwiNum, + g_mpStatPercpu[cpuid].ipiIrqNum, + ((DOUBLE)(g_mpStatPercpu[cpuid].spinWaitRuntime) / mpStaticPastTime) * DECIMAL_TO_PERCENTAGE, + (g_mpStatPercpu[cpuid].prioritySwitch == 0) ? OS_TASK_PRIORITY_LOWEST : + ((DOUBLE)(g_mpStatPercpu[cpuid].sumPriority) / (g_mpStatPercpu[cpuid].prioritySwitch)), + ((DOUBLE)(g_mpStatPercpu[cpuid].highTaskRuntime) / mpStaticPastTime) * DECIMAL_TO_PERCENTAGE, + g_mpStatPercpu[cpuid].highTaskSwitch, + (g_mpStatPercpu[cpuid].highTaskSwitch == 0) ? 0 : + ((DOUBLE)(g_mpStatPercpu[cpuid].highTaskRuntime) / (g_mpStatPercpu[cpuid].highTaskSwitch)) / NS_PER_MS); + } + + PRINTK("\n"); +} + +LITE_OS_SEC_TEXT_MINOR VOID OsShellMpStaticStop(VOID) +{ + LosTaskCB *taskCB = NULL; + UINT32 loop; + UINT32 cpuid = 0; + UINT64 mpStaticStopTime; + UINT64 mpStaticPastTime; + UINT64 runtime; + UINT32 intSave; + + SCHEDULER_LOCK(intSave); + + if (g_mpStaticStartFlag != TRUE) { + PRINT_WARN("Please set mp static start\n"); + SCHEDULER_UNLOCK(intSave); + return; + } + + g_mpStaticStartFlag = FALSE; + mpStaticStopTime = LOS_CurrNanosec(); + mpStaticPastTime = mpStaticStopTime - g_mpStaticStartTime; + + for (loop = 0; loop < g_taskMaxNum; loop++) { + taskCB = (((LosTaskCB *)g_taskCBArray) + loop); + if (taskCB->taskStatus & OS_TASK_STATUS_RUNNING) { +#ifdef LOSCFG_KERNEL_SMP + cpuid = taskCB->currCpu; +#endif + if (cpuid == (UINT32)(OS_TASK_INVALID_CPUID)) { + continue; + } + if (!strcmp(taskCB->taskName, "Idle")) { + runtime = mpStaticStopTime - g_mpStatPercpu[cpuid].idleStarttime; + g_mpStatPercpu[cpuid].idleRuntime += runtime; + g_mpStatPercpu[cpuid].idleStarttime = 0; + } + if (taskCB->priority < HIGHTASKPRI) { + runtime = mpStaticStopTime - g_mpStatPercpu[cpuid].highTaskStarttime; + g_mpStatPercpu[cpuid].highTaskRuntime += runtime; + g_mpStatPercpu[cpuid].highTaskStarttime = 0; + } + } + } + SCHEDULER_UNLOCK(intSave); + OsMpStaticShow(mpStaticPastTime); + + (VOID)memset_s(g_mpStatPercpu, sizeof(g_mpStatPercpu), 0, sizeof(g_mpStatPercpu)); + g_mpStaticStartTime = 0; + return; +} + +#endif + diff --git a/src/kernel_liteos_a/kernel/base/om/los_err.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/om/los_err.c similarity index 100% rename from src/kernel_liteos_a/kernel/base/om/los_err.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/om/los_err.c diff --git a/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/sched/sched_sq/los_sched.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/sched/sched_sq/los_sched.c new file mode 100644 index 00000000..e4f78d91 --- /dev/null +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/sched/sched_sq/los_sched.c @@ -0,0 +1,1231 @@ +/* + * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. + * + * 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. + */ + +#include "los_sched_pri.h" +#include "los_hw_pri.h" +#include "los_task_pri.h" +#include "los_swtmr_pri.h" +#include "los_process_pri.h" +#include "los_arch_mmu.h" +#include "los_hook.h" +#ifdef LOSCFG_KERNEL_CPUP +#include "los_cpup_pri.h" +#endif +#include "los_hw_tick_pri.h" +#include "los_tick_pri.h" +#ifdef LOSCFG_BASE_CORE_TSK_MONITOR +#include "los_stackinfo_pri.h" +#endif +#include "los_mp.h" +#ifdef LOSCFG_SCHED_DEBUG +#include "los_stat_pri.h" +#endif +#include "los_pm_pri.h" + +#define OS_32BIT_MAX 0xFFFFFFFFUL +#define OS_SCHED_FIFO_TIMEOUT 0x7FFFFFFF +#define OS_PRIORITY_QUEUE_NUM 32 +#define PRIQUEUE_PRIOR0_BIT 0x80000000U +#define OS_SCHED_TIME_SLICES_MIN ((5000 * OS_SYS_NS_PER_US) / OS_NS_PER_CYCLE) /* 5ms */ +#define OS_SCHED_TIME_SLICES_MAX ((LOSCFG_BASE_CORE_TIMESLICE_TIMEOUT * OS_SYS_NS_PER_US) / OS_NS_PER_CYCLE) +#define OS_SCHED_TIME_SLICES_DIFF (OS_SCHED_TIME_SLICES_MAX - OS_SCHED_TIME_SLICES_MIN) +#define OS_SCHED_READY_MAX 30 +#define OS_TIME_SLICE_MIN (INT32)((50 * OS_SYS_NS_PER_US) / OS_NS_PER_CYCLE) /* 50us */ + +#define OS_TASK_STATUS_BLOCKED (OS_TASK_STATUS_INIT | OS_TASK_STATUS_PENDING | \ + OS_TASK_STATUS_DELAY | OS_TASK_STATUS_PEND_TIME) + +typedef struct { + LOS_DL_LIST priQueueList[OS_PRIORITY_QUEUE_NUM]; + UINT32 readyTasks[OS_PRIORITY_QUEUE_NUM]; + UINT32 queueBitmap; +} SchedQueue; + +typedef struct { + SchedQueue queueList[OS_PRIORITY_QUEUE_NUM]; + UINT32 queueBitmap; +} Sched; + +SchedRunQue g_schedRunQue[LOSCFG_KERNEL_CORE_NUM]; +STATIC Sched g_sched; + +#ifdef LOSCFG_SCHED_TICK_DEBUG +#define OS_SCHED_DEBUG_DATA_NUM 1000 +typedef struct { + UINT32 tickResporeTime[OS_SCHED_DEBUG_DATA_NUM]; + UINT32 index; + UINT32 setTickCount; + UINT64 oldResporeTime; +} SchedTickDebug; +STATIC SchedTickDebug *g_schedTickDebug = NULL; + +STATIC UINT32 OsSchedDebugInit(VOID) +{ + UINT32 size = sizeof(SchedTickDebug) * LOSCFG_KERNEL_CORE_NUM; + g_schedTickDebug = (SchedTickDebug *)LOS_MemAlloc(m_aucSysMem0, size); + if (g_schedTickDebug == NULL) { + return LOS_ERRNO_TSK_NO_MEMORY; + } + + (VOID)memset_s(g_schedTickDebug, size, 0, size); + return LOS_OK; +} + +VOID OsSchedDebugRecordData(VOID) +{ + SchedTickDebug *schedDebug = &g_schedTickDebug[ArchCurrCpuid()]; + if (schedDebug->index < OS_SCHED_DEBUG_DATA_NUM) { + UINT64 currTime = OsGetCurrSchedTimeCycle(); + schedDebug->tickResporeTime[schedDebug->index] = currTime - schedDebug->oldResporeTime; + schedDebug->oldResporeTime = currTime; + schedDebug->index++; + } +} + +SchedTickDebug *OsSchedDebugGet(VOID) +{ + return g_schedTickDebug; +} + +UINT32 OsShellShowTickRespo(VOID) +{ + UINT32 intSave; + UINT16 cpu; + UINT64 allTime; + + UINT32 tickSize = sizeof(SchedTickDebug) * LOSCFG_KERNEL_CORE_NUM; + SchedTickDebug *schedDebug = (SchedTickDebug *)LOS_MemAlloc(m_aucSysMem1, tickSize); + if (schedDebug == NULL) { + return LOS_NOK; + } + + UINT32 sortLinkNum[LOSCFG_KERNEL_CORE_NUM]; + SCHEDULER_LOCK(intSave); + (VOID)memcpy_s((CHAR *)schedDebug, tickSize, (CHAR *)OsSchedDebugGet(), tickSize); + (VOID)memset_s((CHAR *)OsSchedDebugGet(), tickSize, 0, tickSize); + for (cpu = 0; cpu < LOSCFG_KERNEL_CORE_NUM; cpu++) { + SchedRunQue *rq = OsSchedRunQueByID(cpu); + sortLinkNum[cpu] = OsGetSortLinkNodeNum(&rq->taskSortLink) + OsGetSortLinkNodeNum(&rq->swtmrSortLink); + } + SCHEDULER_UNLOCK(intSave); + + for (cpu = 0; cpu < LOSCFG_KERNEL_CORE_NUM; cpu++) { + SchedTickDebug *schedData = &schedDebug[cpu]; + PRINTK("cpu : %u sched data num : %u set time count : %u SortMax : %u\n", + cpu, schedData->index, schedData->setTickCount, sortLinkNum[cpu]); + UINT32 *data = schedData->tickResporeTime; + allTime = 0; + for (UINT32 i = 1; i < schedData->index; i++) { + allTime += data[i]; + UINT32 timeUs = (data[i] * OS_NS_PER_CYCLE) / OS_SYS_NS_PER_US; + PRINTK(" %u(%u)", timeUs, timeUs / OS_US_PER_TICK); + if ((i != 0) && ((i % 5) == 0)) { /* A row of 5 data */ + PRINTK("\n"); + } + } + + allTime = (allTime * OS_NS_PER_CYCLE) / OS_SYS_NS_PER_US; + PRINTK("\nTick Indicates the average response period: %llu(us)\n", allTime / (schedData->index - 1)); + } + + (VOID)LOS_MemFree(m_aucSysMem1, schedDebug); + return LOS_OK; +} + +#else + +UINT32 OsShellShowTickRespo(VOID) +{ + return LOS_NOK; +} +#endif + +#ifdef LOSCFG_SCHED_DEBUG +STATIC VOID SchedDataGet(LosTaskCB *taskCB, UINT64 *runTime, UINT64 *timeSlice, UINT64 *pendTime, UINT64 *schedWait) +{ + if (taskCB->schedStat.switchCount >= 1) { + UINT64 averRunTime = taskCB->schedStat.runTime / taskCB->schedStat.switchCount; + *runTime = (averRunTime * OS_NS_PER_CYCLE) / OS_SYS_NS_PER_US; + } + + if (taskCB->schedStat.timeSliceCount > 1) { + UINT64 averTimeSlice = taskCB->schedStat.timeSliceTime / (taskCB->schedStat.timeSliceCount - 1); + *timeSlice = (averTimeSlice * OS_NS_PER_CYCLE) / OS_SYS_NS_PER_US; + } + + if (taskCB->schedStat.pendCount > 1) { + UINT64 averPendTime = taskCB->schedStat.pendTime / taskCB->schedStat.pendCount; + *pendTime = (averPendTime * OS_NS_PER_CYCLE) / OS_SYS_NS_PER_US; + } + + if (taskCB->schedStat.waitSchedCount > 0) { + UINT64 averSchedWait = taskCB->schedStat.waitSchedTime / taskCB->schedStat.waitSchedCount; + *schedWait = (averSchedWait * OS_NS_PER_CYCLE) / OS_SYS_NS_PER_US; + } +} + +UINT32 OsShellShowSchedParam(VOID) +{ + UINT64 averRunTime; + UINT64 averTimeSlice; + UINT64 averSchedWait; + UINT64 averPendTime; + UINT32 intSave; + UINT32 size = g_taskMaxNum * sizeof(LosTaskCB); + LosTaskCB *taskCBArray = LOS_MemAlloc(m_aucSysMem1, size); + if (taskCBArray == NULL) { + return LOS_NOK; + } + + SCHEDULER_LOCK(intSave); + (VOID)memcpy_s(taskCBArray, size, g_taskCBArray, size); + SCHEDULER_UNLOCK(intSave); + PRINTK(" Tid AverRunTime(us) SwitchCount AverTimeSlice(us) TimeSliceCount AverReadyWait(us) " + "AverPendTime(us) TaskName \n"); + for (UINT32 tid = 0; tid < g_taskMaxNum; tid++) { + LosTaskCB *taskCB = taskCBArray + tid; + if (OsTaskIsUnused(taskCB)) { + continue; + } + + averRunTime = 0; + averTimeSlice = 0; + averPendTime = 0; + averSchedWait = 0; + + SchedDataGet(taskCB, &averRunTime, &averTimeSlice, &averPendTime, &averSchedWait); + + PRINTK("%5u%19llu%15llu%19llu%18llu%19llu%18llu %-32s\n", taskCB->taskID, + averRunTime, taskCB->schedStat.switchCount, + averTimeSlice, taskCB->schedStat.timeSliceCount - 1, + averSchedWait, averPendTime, taskCB->taskName); + } + + (VOID)LOS_MemFree(m_aucSysMem1, taskCBArray); + + return LOS_OK; +} + +#else + +UINT32 OsShellShowSchedParam(VOID) +{ + return LOS_NOK; +} +#endif + +STATIC INLINE VOID TimeSliceUpdate(LosTaskCB *taskCB, UINT64 currTime) +{ + LOS_ASSERT(currTime >= taskCB->startTime); + + INT32 incTime = (currTime - taskCB->startTime - taskCB->irqUsedTime); + + LOS_ASSERT(incTime >= 0); + + if (taskCB->policy == LOS_SCHED_RR) { + taskCB->timeSlice -= incTime; +#ifdef LOSCFG_SCHED_DEBUG + taskCB->schedStat.timeSliceRealTime += incTime; +#endif + } + taskCB->irqUsedTime = 0; + taskCB->startTime = currTime; + +#ifdef LOSCFG_SCHED_DEBUG + taskCB->schedStat.allRuntime += incTime; +#endif +} + +STATIC INLINE UINT64 GetNextExpireTime(SchedRunQue *rq, UINT64 startTime, UINT32 tickPrecision) +{ + SortLinkAttribute *taskHeader = &rq->taskSortLink; + SortLinkAttribute *swtmrHeader = &rq->swtmrSortLink; + + LOS_SpinLock(&taskHeader->spinLock); + UINT64 taskExpireTime = OsGetSortLinkNextExpireTime(taskHeader, startTime, tickPrecision); + LOS_SpinUnlock(&taskHeader->spinLock); + + LOS_SpinLock(&swtmrHeader->spinLock); + UINT64 swtmrExpireTime = OsGetSortLinkNextExpireTime(swtmrHeader, startTime, tickPrecision); + LOS_SpinUnlock(&swtmrHeader->spinLock); + + return (taskExpireTime < swtmrExpireTime) ? taskExpireTime : swtmrExpireTime; +} + +STATIC INLINE VOID SchedSetNextExpireTime(UINT32 responseID, UINT64 taskEndTime, UINT32 oldResponseID) +{ + SchedRunQue *rq = OsSchedRunQue(); + BOOL isTimeSlice = FALSE; + UINT64 currTime = OsGetCurrSchedTimeCycle(); + UINT64 nextExpireTime = GetNextExpireTime(rq, currTime, OS_TICK_RESPONSE_PRECISION); + + rq->schedFlag &= ~INT_PEND_TICK; + if (rq->responseID == oldResponseID) { + /* This time has expired, and the next time the theory has expired is infinite */ + rq->responseTime = OS_SCHED_MAX_RESPONSE_TIME; + } + + /* The current thread's time slice has been consumed, but the current system lock task cannot + * trigger the schedule to release the CPU + */ + if ((nextExpireTime > taskEndTime) && ((nextExpireTime - taskEndTime) > OS_SCHED_MINI_PERIOD)) { + nextExpireTime = taskEndTime; + isTimeSlice = TRUE; + } + + if ((rq->responseTime <= nextExpireTime) || + ((rq->responseTime - nextExpireTime) < OS_TICK_RESPONSE_PRECISION)) { + return; + } + + if (isTimeSlice) { + /* The expiration time of the current system is the thread's slice expiration time */ + rq->responseID = responseID; + } else { + rq->responseID = OS_INVALID_VALUE; + } + + UINT64 nextResponseTime = nextExpireTime - currTime; + rq->responseTime = currTime + HalClockTickTimerReload(nextResponseTime); + +#ifdef LOSCFG_SCHED_TICK_DEBUG + SchedTickDebug *schedDebug = &g_schedTickDebug[ArchCurrCpuid()]; + if (schedDebug->index < OS_SCHED_DEBUG_DATA_NUM) { + schedDebug->setTickCount++; + } +#endif +} + +VOID OsSchedUpdateExpireTime(VOID) +{ + UINT64 endTime; + LosTaskCB *runTask = OsCurrTaskGet(); + + if (!OS_SCHEDULER_ACTIVE || OS_INT_ACTIVE) { + OsSchedRunQuePendingSet(); + return; + } + + if (runTask->policy == LOS_SCHED_RR) { + LOS_SpinLock(&g_taskSpin); + INT32 timeSlice = (runTask->timeSlice <= OS_TIME_SLICE_MIN) ? runTask->initTimeSlice : runTask->timeSlice; + endTime = runTask->startTime + timeSlice; + LOS_SpinUnlock(&g_taskSpin); + } else { + endTime = OS_SCHED_MAX_RESPONSE_TIME - OS_TICK_RESPONSE_PRECISION; + } + + SchedSetNextExpireTime(runTask->taskID, endTime, runTask->taskID); +} + +STATIC INLINE UINT32 SchedCalculateTimeSlice(UINT16 proPriority, UINT16 priority) +{ + UINT32 retTime; + UINT32 readyTasks; + + SchedQueue *queueList = &g_sched.queueList[proPriority]; + readyTasks = queueList->readyTasks[priority]; + if (readyTasks > OS_SCHED_READY_MAX) { + return OS_SCHED_TIME_SLICES_MIN; + } + retTime = ((OS_SCHED_READY_MAX - readyTasks) * OS_SCHED_TIME_SLICES_DIFF) / OS_SCHED_READY_MAX; + return (retTime + OS_SCHED_TIME_SLICES_MIN); +} + +STATIC INLINE VOID SchedPriQueueEnHead(UINT32 proPriority, LOS_DL_LIST *priqueueItem, UINT32 priority) +{ + SchedQueue *queueList = &g_sched.queueList[proPriority]; + LOS_DL_LIST *priQueueList = &queueList->priQueueList[0]; + UINT32 *bitMap = &queueList->queueBitmap; + + /* + * Task control blocks are inited as zero. And when task is deleted, + * and at the same time would be deleted from priority queue or + * other lists, task pend node will restored as zero. + */ + LOS_ASSERT(priqueueItem->pstNext == NULL); + + if (*bitMap == 0) { + g_sched.queueBitmap |= PRIQUEUE_PRIOR0_BIT >> proPriority; + } + + if (LOS_ListEmpty(&priQueueList[priority])) { + *bitMap |= PRIQUEUE_PRIOR0_BIT >> priority; + } + + LOS_ListHeadInsert(&priQueueList[priority], priqueueItem); + queueList->readyTasks[priority]++; +} + +STATIC INLINE VOID SchedPriQueueEnTail(UINT32 proPriority, LOS_DL_LIST *priqueueItem, UINT32 priority) +{ + SchedQueue *queueList = &g_sched.queueList[proPriority]; + LOS_DL_LIST *priQueueList = &queueList->priQueueList[0]; + UINT32 *bitMap = &queueList->queueBitmap; + + /* + * Task control blocks are inited as zero. And when task is deleted, + * and at the same time would be deleted from priority queue or + * other lists, task pend node will restored as zero. + */ + LOS_ASSERT(priqueueItem->pstNext == NULL); + + if (*bitMap == 0) { + g_sched.queueBitmap |= PRIQUEUE_PRIOR0_BIT >> proPriority; + } + + if (LOS_ListEmpty(&priQueueList[priority])) { + *bitMap |= PRIQUEUE_PRIOR0_BIT >> priority; + } + + LOS_ListTailInsert(&priQueueList[priority], priqueueItem); + queueList->readyTasks[priority]++; +} + +STATIC INLINE VOID SchedPriQueueDelete(UINT32 proPriority, LOS_DL_LIST *priqueueItem, UINT32 priority) +{ + SchedQueue *queueList = &g_sched.queueList[proPriority]; + LOS_DL_LIST *priQueueList = &queueList->priQueueList[0]; + UINT32 *bitMap = &queueList->queueBitmap; + + LOS_ListDelete(priqueueItem); + queueList->readyTasks[priority]--; + if (LOS_ListEmpty(&priQueueList[priority])) { + *bitMap &= ~(PRIQUEUE_PRIOR0_BIT >> priority); + } + + if (*bitMap == 0) { + g_sched.queueBitmap &= ~(PRIQUEUE_PRIOR0_BIT >> proPriority); + } +} + +STATIC INLINE VOID SchedEnTaskQueue(LosTaskCB *taskCB) +{ + LOS_ASSERT(!(taskCB->taskStatus & OS_TASK_STATUS_READY)); + + switch (taskCB->policy) { + case LOS_SCHED_RR: { + if (taskCB->timeSlice > OS_TIME_SLICE_MIN) { + SchedPriQueueEnHead(taskCB->basePrio, &taskCB->pendList, taskCB->priority); + } else { + taskCB->initTimeSlice = SchedCalculateTimeSlice(taskCB->basePrio, taskCB->priority); + taskCB->timeSlice = taskCB->initTimeSlice; + SchedPriQueueEnTail(taskCB->basePrio, &taskCB->pendList, taskCB->priority); +#ifdef LOSCFG_SCHED_DEBUG + taskCB->schedStat.timeSliceTime = taskCB->schedStat.timeSliceRealTime; + taskCB->schedStat.timeSliceCount++; +#endif + } + break; + } + case LOS_SCHED_FIFO: { + /* The time slice of FIFO is always greater than 0 unless the yield is called */ + if ((taskCB->timeSlice > OS_TIME_SLICE_MIN) && (taskCB->taskStatus & OS_TASK_STATUS_RUNNING)) { + SchedPriQueueEnHead(taskCB->basePrio, &taskCB->pendList, taskCB->priority); + } else { + taskCB->initTimeSlice = OS_SCHED_FIFO_TIMEOUT; + taskCB->timeSlice = taskCB->initTimeSlice; + SchedPriQueueEnTail(taskCB->basePrio, &taskCB->pendList, taskCB->priority); + } + break; + } + case LOS_SCHED_IDLE: +#ifdef LOSCFG_SCHED_DEBUG + taskCB->schedStat.timeSliceCount = 1; +#endif + break; + default: + LOS_ASSERT(0); + break; + } + + taskCB->taskStatus &= ~OS_TASK_STATUS_BLOCKED; + taskCB->taskStatus |= OS_TASK_STATUS_READY; +} + +VOID OsSchedTaskDeQueue(LosTaskCB *taskCB) +{ + if (taskCB->taskStatus & OS_TASK_STATUS_READY) { + if (taskCB->policy != LOS_SCHED_IDLE) { + SchedPriQueueDelete(taskCB->basePrio, &taskCB->pendList, taskCB->priority); + } + taskCB->taskStatus &= ~OS_TASK_STATUS_READY; + } +} + +VOID OsSchedTaskEnQueue(LosTaskCB *taskCB) +{ +#ifdef LOSCFG_SCHED_DEBUG + if (!(taskCB->taskStatus & OS_TASK_STATUS_RUNNING)) { + taskCB->startTime = OsGetCurrSchedTimeCycle(); + } +#endif + SchedEnTaskQueue(taskCB); +} + +VOID OsSchedTaskExit(LosTaskCB *taskCB) +{ + if (taskCB->taskStatus & OS_TASK_STATUS_READY) { + OsSchedTaskDeQueue(taskCB); + } else if (taskCB->taskStatus & OS_TASK_STATUS_PENDING) { + LOS_ListDelete(&taskCB->pendList); + taskCB->taskStatus &= ~OS_TASK_STATUS_PENDING; + } + + if (taskCB->taskStatus & (OS_TASK_STATUS_DELAY | OS_TASK_STATUS_PEND_TIME)) { + OsSchedDeTaskFromTimeList(&taskCB->sortList); + taskCB->taskStatus &= ~(OS_TASK_STATUS_DELAY | OS_TASK_STATUS_PEND_TIME); + } +} + +VOID OsSchedYield(VOID) +{ + LosTaskCB *runTask = OsCurrTaskGet(); + + runTask->timeSlice = 0; + + runTask->startTime = OsGetCurrSchedTimeCycle(); + OsSchedTaskEnQueue(runTask); + OsSchedResched(); +} + +VOID OsSchedDelay(LosTaskCB *runTask, UINT32 tick) +{ + OsSchedTaskDeQueue(runTask); + runTask->taskStatus |= OS_TASK_STATUS_DELAY; + runTask->waitTimes = tick; + + OsSchedResched(); +} + +UINT32 OsSchedTaskWait(LOS_DL_LIST *list, UINT32 ticks, BOOL needSched) +{ + LosTaskCB *runTask = OsCurrTaskGet(); + + runTask->taskStatus |= OS_TASK_STATUS_PENDING; + LOS_ListTailInsert(list, &runTask->pendList); + + if (ticks != LOS_WAIT_FOREVER) { + runTask->taskStatus |= OS_TASK_STATUS_PEND_TIME; + runTask->waitTimes = ticks; + } + + if (needSched == TRUE) { + OsSchedResched(); + if (runTask->taskStatus & OS_TASK_STATUS_TIMEOUT) { + runTask->taskStatus &= ~OS_TASK_STATUS_TIMEOUT; + return LOS_ERRNO_TSK_TIMEOUT; + } + } + + return LOS_OK; +} + +VOID OsSchedTaskWake(LosTaskCB *resumedTask) +{ + LOS_ListDelete(&resumedTask->pendList); + resumedTask->taskStatus &= ~OS_TASK_STATUS_PENDING; + + if (resumedTask->taskStatus & OS_TASK_STATUS_PEND_TIME) { + OsSchedDeTaskFromTimeList(&resumedTask->sortList); + resumedTask->taskStatus &= ~OS_TASK_STATUS_PEND_TIME; + } + + if (!(resumedTask->taskStatus & OS_TASK_STATUS_SUSPENDED)) { +#ifdef LOSCFG_SCHED_DEBUG + resumedTask->schedStat.pendTime += OsGetCurrSchedTimeCycle() - resumedTask->startTime; + resumedTask->schedStat.pendCount++; +#endif + OsSchedTaskEnQueue(resumedTask); + } +} + +BOOL OsSchedModifyTaskSchedParam(LosTaskCB *taskCB, UINT16 policy, UINT16 priority) +{ + if (taskCB->policy != policy) { + taskCB->policy = policy; + taskCB->timeSlice = 0; + } + + if (taskCB->taskStatus & OS_TASK_STATUS_READY) { + OsSchedTaskDeQueue(taskCB); + taskCB->priority = priority; + OsSchedTaskEnQueue(taskCB); + return TRUE; + } + + taskCB->priority = priority; + OsHookCall(LOS_HOOK_TYPE_TASK_PRIMODIFY, taskCB, taskCB->priority); + if (taskCB->taskStatus & OS_TASK_STATUS_INIT) { + OsSchedTaskEnQueue(taskCB); + return TRUE; + } + + if (taskCB->taskStatus & OS_TASK_STATUS_RUNNING) { + return TRUE; + } + + return FALSE; +} + +BOOL OsSchedModifyProcessSchedParam(UINT32 pid, UINT16 policy, UINT16 priority) +{ + LosProcessCB *processCB = OS_PCB_FROM_PID(pid); + LosTaskCB *taskCB = NULL; + BOOL needSched = FALSE; + (VOID)policy; + + LOS_DL_LIST_FOR_EACH_ENTRY(taskCB, &processCB->threadSiblingList, LosTaskCB, threadList) { + if (taskCB->taskStatus & OS_TASK_STATUS_READY) { + SchedPriQueueDelete(taskCB->basePrio, &taskCB->pendList, taskCB->priority); + SchedPriQueueEnTail(priority, &taskCB->pendList, taskCB->priority); + needSched = TRUE; + } else if (taskCB->taskStatus & OS_TASK_STATUS_RUNNING) { + needSched = TRUE; + } + taskCB->basePrio = priority; + } + + return needSched; +} + +STATIC VOID SchedFreezeTask(LosTaskCB *taskCB) +{ + UINT64 responseTime; + + if (!OsIsPmMode()) { + return; + } + + if (!(taskCB->taskStatus & (OS_TASK_STATUS_PEND_TIME | OS_TASK_STATUS_DELAY))) { + return; + } + + responseTime = GET_SORTLIST_VALUE(&taskCB->sortList); + OsSchedDeTaskFromTimeList(&taskCB->sortList); + SET_SORTLIST_VALUE(&taskCB->sortList, responseTime); + taskCB->taskStatus |= OS_TASK_FLAG_FREEZE; + return; +} + +STATIC VOID SchedUnfreezeTask(LosTaskCB *taskCB) +{ + UINT64 currTime, responseTime; + UINT32 remainTick; + + if (!(taskCB->taskStatus & OS_TASK_FLAG_FREEZE)) { + return; + } + + taskCB->taskStatus &= ~OS_TASK_FLAG_FREEZE; + currTime = OsGetCurrSchedTimeCycle(); + responseTime = GET_SORTLIST_VALUE(&taskCB->sortList); + if (responseTime > currTime) { + remainTick = ((responseTime - currTime) + OS_CYCLE_PER_TICK - 1) / OS_CYCLE_PER_TICK; + OsSchedAddTask2TimeList(&taskCB->sortList, currTime, remainTick); + return; + } + + SET_SORTLIST_VALUE(&taskCB->sortList, OS_SORT_LINK_INVALID_TIME); + if (taskCB->taskStatus & OS_TASK_STATUS_PENDING) { + LOS_ListDelete(&taskCB->pendList); + } + taskCB->taskStatus &= ~(OS_TASK_STATUS_DELAY | OS_TASK_STATUS_PEND_TIME | OS_TASK_STATUS_PENDING); + return; +} + +VOID OsSchedSuspend(LosTaskCB *taskCB) +{ + if (taskCB->taskStatus & OS_TASK_STATUS_READY) { + OsSchedTaskDeQueue(taskCB); + } + + SchedFreezeTask(taskCB); + + taskCB->taskStatus |= OS_TASK_STATUS_SUSPENDED; + OsHookCall(LOS_HOOK_TYPE_MOVEDTASKTOSUSPENDEDLIST, taskCB); + if (taskCB == OsCurrTaskGet()) { + OsSchedResched(); + } +} + +BOOL OsSchedResume(LosTaskCB *taskCB) +{ + BOOL needSched = FALSE; + + SchedUnfreezeTask(taskCB); + + taskCB->taskStatus &= ~OS_TASK_STATUS_SUSPENDED; + if (!OsTaskIsBlocked(taskCB)) { + OsSchedTaskEnQueue(taskCB); + needSched = TRUE; + } + + return needSched; +} + +STATIC INLINE BOOL SchedScanSwtmrTimeList(SchedRunQue *rq) +{ + BOOL needSched = FALSE; + SortLinkAttribute* swtmrSortLink = &rq->swtmrSortLink; + LOS_DL_LIST *listObject = &swtmrSortLink->sortLink; + + /* + * it needs to be carefully coped with, since the swtmr is in specific sortlink + * while other cores still has the chance to process it, like stop the timer. + */ + LOS_SpinLock(&swtmrSortLink->spinLock); + + if (LOS_ListEmpty(listObject)) { + LOS_SpinUnlock(&swtmrSortLink->spinLock); + return FALSE; + } + SortLinkList *sortList = LOS_DL_LIST_ENTRY(listObject->pstNext, SortLinkList, sortLinkNode); + + UINT64 currTime = OsGetCurrSchedTimeCycle(); + while (sortList->responseTime <= currTime) { + sortList = LOS_DL_LIST_ENTRY(listObject->pstNext, SortLinkList, sortLinkNode); + UINT64 startTime = GET_SORTLIST_VALUE(sortList); + OsDeleteNodeSortLink(swtmrSortLink, sortList); + LOS_SpinUnlock(&swtmrSortLink->spinLock); + + OsSwtmrWake(rq, startTime, sortList); + needSched = TRUE; + + LOS_SpinLock(&swtmrSortLink->spinLock); + if (LOS_ListEmpty(listObject)) { + break; + } + + sortList = LOS_DL_LIST_ENTRY(listObject->pstNext, SortLinkList, sortLinkNode); + } + + LOS_SpinUnlock(&swtmrSortLink->spinLock); + return needSched; +} + +STATIC INLINE VOID SchedSwtmrResponseTimeReset(SchedRunQue *rq, UINT64 startTime) +{ + SortLinkAttribute* swtmrSortLink = &rq->swtmrSortLink; + LOS_DL_LIST *listHead = &swtmrSortLink->sortLink; + LOS_DL_LIST *listNext = listHead->pstNext; + + LOS_SpinLock(&swtmrSortLink->spinLock); + while (listNext != listHead) { + SortLinkList *sortList = LOS_DL_LIST_ENTRY(listNext, SortLinkList, sortLinkNode); + OsDeleteNodeSortLink(swtmrSortLink, sortList); + LOS_SpinUnlock(&swtmrSortLink->spinLock); + + OsSwtmrRestart(startTime, sortList); + + LOS_SpinLock(&swtmrSortLink->spinLock); + listNext = listNext->pstNext; + } + LOS_SpinUnlock(&swtmrSortLink->spinLock); +} + +STATIC INLINE BOOL SchedSwtmrRunQueFind(SortLinkAttribute *swtmrSortLink, SCHED_TL_FIND_FUNC checkFunc, UINTPTR arg) +{ + LOS_DL_LIST *listObject = &swtmrSortLink->sortLink; + LOS_DL_LIST *list = listObject->pstNext; + + LOS_SpinLock(&swtmrSortLink->spinLock); + while (list != listObject) { + SortLinkList *listSorted = LOS_DL_LIST_ENTRY(list, SortLinkList, sortLinkNode); + if (checkFunc((UINTPTR)listSorted, arg)) { + LOS_SpinUnlock(&swtmrSortLink->spinLock); + return TRUE; + } + list = list->pstNext; + } + + LOS_SpinUnlock(&swtmrSortLink->spinLock); + return FALSE; +} + +BOOL OsSchedSwtmrTimeListFind(SCHED_TL_FIND_FUNC checkFunc, UINTPTR arg) +{ + for (UINT16 cpuid = 0; cpuid < LOSCFG_KERNEL_CORE_NUM; cpuid++) { + SchedRunQue *rq = OsSchedRunQueByID(cpuid); + SortLinkAttribute *swtmrSortLink = &rq->swtmrSortLink; + if (SchedSwtmrRunQueFind(swtmrSortLink, checkFunc, arg)) { + return TRUE; + } + } + return FALSE; +} + +STATIC INLINE VOID SchedWakePendTimeTask(UINT64 currTime, LosTaskCB *taskCB, BOOL *needSchedule) +{ +#ifndef LOSCFG_SCHED_DEBUG + (VOID)currTime; +#endif + + LOS_SpinLock(&g_taskSpin); + UINT16 tempStatus = taskCB->taskStatus; + if (tempStatus & (OS_TASK_STATUS_PENDING | OS_TASK_STATUS_DELAY)) { + taskCB->taskStatus &= ~(OS_TASK_STATUS_PENDING | OS_TASK_STATUS_PEND_TIME | OS_TASK_STATUS_DELAY); + if (tempStatus & OS_TASK_STATUS_PENDING) { + taskCB->taskStatus |= OS_TASK_STATUS_TIMEOUT; + LOS_ListDelete(&taskCB->pendList); + taskCB->taskMux = NULL; + OsTaskWakeClearPendMask(taskCB); + } + + if (!(tempStatus & OS_TASK_STATUS_SUSPENDED)) { +#ifdef LOSCFG_SCHED_DEBUG + taskCB->schedStat.pendTime += currTime - taskCB->startTime; + taskCB->schedStat.pendCount++; +#endif + OsSchedTaskEnQueue(taskCB); + *needSchedule = TRUE; + } + } + + LOS_SpinUnlock(&g_taskSpin); +} + +STATIC INLINE BOOL SchedScanTaskTimeList(SchedRunQue *rq) +{ + BOOL needSchedule = FALSE; + SortLinkAttribute *taskSortLink = &rq->taskSortLink; + LOS_DL_LIST *listObject = &taskSortLink->sortLink; + /* + * When task is pended with timeout, the task block is on the timeout sortlink + * (per cpu) and ipc(mutex,sem and etc.)'s block at the same time, it can be waken + * up by either timeout or corresponding ipc it's waiting. + * + * Now synchronize sortlink procedure is used, therefore the whole task scan needs + * to be protected, preventing another core from doing sortlink deletion at same time. + */ + LOS_SpinLock(&taskSortLink->spinLock); + + if (LOS_ListEmpty(listObject)) { + LOS_SpinUnlock(&taskSortLink->spinLock); + return needSchedule; + } + + SortLinkList *sortList = LOS_DL_LIST_ENTRY(listObject->pstNext, SortLinkList, sortLinkNode); + UINT64 currTime = OsGetCurrSchedTimeCycle(); + while (sortList->responseTime <= currTime) { + LosTaskCB *taskCB = LOS_DL_LIST_ENTRY(sortList, LosTaskCB, sortList); + OsDeleteNodeSortLink(taskSortLink, &taskCB->sortList); + LOS_SpinUnlock(&taskSortLink->spinLock); + + SchedWakePendTimeTask(currTime, taskCB, &needSchedule); + + LOS_SpinLock(&taskSortLink->spinLock); + if (LOS_ListEmpty(listObject)) { + break; + } + + sortList = LOS_DL_LIST_ENTRY(listObject->pstNext, SortLinkList, sortLinkNode); + } + + LOS_SpinUnlock(&taskSortLink->spinLock); + + return needSchedule; +} + +VOID OsSchedTick(VOID) +{ + SchedRunQue *rq = OsSchedRunQue(); + BOOL needSched = FALSE; + + if (rq->responseID == OS_INVALID_VALUE) { + + needSched |= SchedScanSwtmrTimeList(rq); + needSched |= SchedScanTaskTimeList(rq); + + if (needSched) { + LOS_MpSchedule(OS_MP_CPU_ALL); + rq->schedFlag |= INT_PEND_RESCH; + } + } + rq->schedFlag |= INT_PEND_TICK; + rq->responseTime = OS_SCHED_MAX_RESPONSE_TIME; +} + +VOID OsSchedSetIdleTaskSchedParam(LosTaskCB *idleTask) +{ + idleTask->basePrio = OS_TASK_PRIORITY_LOWEST; + idleTask->policy = LOS_SCHED_IDLE; + idleTask->initTimeSlice = OS_SCHED_FIFO_TIMEOUT; + idleTask->timeSlice = idleTask->initTimeSlice; + OsSchedTaskEnQueue(idleTask); +} + +VOID OsSchedResetSchedResponseTime(UINT64 responseTime) +{ + OsSchedRunQue()->responseTime = responseTime; +} + +VOID OsSchedRunQueInit(VOID) +{ + if (ArchCurrCpuid() != 0) { + return; + } + + for (UINT16 index = 0; index < LOSCFG_KERNEL_CORE_NUM; index++) { + SchedRunQue *rq = OsSchedRunQueByID(index); + OsSortLinkInit(&rq->taskSortLink); + OsSortLinkInit(&rq->swtmrSortLink); + rq->responseTime = OS_SCHED_MAX_RESPONSE_TIME; + } +} + +VOID OsSchedRunQueSwtmrInit(UINT32 swtmrTaskID, UINT32 swtmrQueue) +{ + SchedRunQue *rq = OsSchedRunQue(); + rq->swtmrTaskID = swtmrTaskID; + rq->swtmrHandlerQueue = swtmrQueue; +} + +VOID OsSchedRunQueIdleInit(UINT32 idleTaskID) +{ + SchedRunQue *rq = OsSchedRunQue(); + rq->idleTaskID = idleTaskID; +} + +UINT32 OsSchedInit(VOID) +{ + for (UINT16 index = 0; index < OS_PRIORITY_QUEUE_NUM; index++) { + SchedQueue *queueList = &g_sched.queueList[index]; + LOS_DL_LIST *priList = &queueList->priQueueList[0]; + for (UINT16 pri = 0; pri < OS_PRIORITY_QUEUE_NUM; pri++) { + LOS_ListInit(&priList[pri]); + } + } + +#ifdef LOSCFG_SCHED_TICK_DEBUG + UINT32 ret = OsSchedDebugInit(); + if (ret != LOS_OK) { + return ret; + } +#endif + return LOS_OK; +} + +STATIC LosTaskCB *GetTopTask(SchedRunQue *rq) +{ + UINT32 priority, processPriority; + UINT32 bitmap; + LosTaskCB *newTask = NULL; + UINT32 processBitmap = g_sched.queueBitmap; +#ifdef LOSCFG_KERNEL_SMP + UINT32 cpuid = ArchCurrCpuid(); +#endif + + while (processBitmap) { + processPriority = CLZ(processBitmap); + SchedQueue *queueList = &g_sched.queueList[processPriority]; + bitmap = queueList->queueBitmap; + while (bitmap) { + priority = CLZ(bitmap); + LOS_DL_LIST_FOR_EACH_ENTRY(newTask, &queueList->priQueueList[priority], LosTaskCB, pendList) { +#ifdef LOSCFG_KERNEL_SMP + if (newTask->cpuAffiMask & (1U << cpuid)) { +#endif + goto FIND_TASK; +#ifdef LOSCFG_KERNEL_SMP + } +#endif + } + bitmap &= ~(1U << (OS_PRIORITY_QUEUE_NUM - priority - 1)); + } + processBitmap &= ~(1U << (OS_PRIORITY_QUEUE_NUM - processPriority - 1)); + } + + newTask = OS_TCB_FROM_TID(rq->idleTaskID); + +FIND_TASK: + OsSchedTaskDeQueue(newTask); + return newTask; +} + +VOID OsSchedStart(VOID) +{ + UINT32 cpuid = ArchCurrCpuid(); + UINT32 intSave; + + PRINTK("cpu %d entering scheduler\n", cpuid); + + SCHEDULER_LOCK(intSave); + + if (cpuid == 0) { + OsTickStart(); + } + + SchedRunQue *rq = OsSchedRunQue(); + LosTaskCB *newTask = GetTopTask(rq); + newTask->taskStatus |= OS_TASK_STATUS_RUNNING; + +#ifdef LOSCFG_KERNEL_SMP + /* + * attention: current cpu needs to be set, in case first task deletion + * may fail because this flag mismatch with the real current cpu. + */ + newTask->currCpu = cpuid; +#endif + + OsCurrTaskSet((VOID *)newTask); + + newTask->startTime = OsGetCurrSchedTimeCycle(); + + SchedSwtmrResponseTimeReset(rq, newTask->startTime); + + /* System start schedule */ + OS_SCHEDULER_SET(cpuid); + + rq->responseID = OS_INVALID; + SchedSetNextExpireTime(newTask->taskID, newTask->startTime + newTask->timeSlice, OS_INVALID); + OsTaskContextLoad(newTask); +} + +#ifdef LOSCFG_KERNEL_SMP +VOID OsSchedToUserReleaseLock(VOID) +{ + /* The scheduling lock needs to be released before returning to user mode */ + LOCKDEP_CHECK_OUT(&g_taskSpin); + ArchSpinUnlock(&g_taskSpin.rawLock); + + OsSchedUnlock(); +} +#endif + +#ifdef LOSCFG_BASE_CORE_TSK_MONITOR +STATIC VOID TaskStackCheck(LosTaskCB *runTask, LosTaskCB *newTask) +{ + if (!OS_STACK_MAGIC_CHECK(runTask->topOfStack)) { + LOS_Panic("CURRENT task ID: %s:%d stack overflow!\n", runTask->taskName, runTask->taskID); + } + + if (((UINTPTR)(newTask->stackPointer) <= newTask->topOfStack) || + ((UINTPTR)(newTask->stackPointer) > (newTask->topOfStack + newTask->stackSize))) { + LOS_Panic("HIGHEST task ID: %s:%u SP error! StackPointer: %p TopOfStack: %p\n", + newTask->taskName, newTask->taskID, newTask->stackPointer, newTask->topOfStack); + } +} +#endif + +STATIC INLINE VOID SchedSwitchCheck(LosTaskCB *runTask, LosTaskCB *newTask) +{ +#ifdef LOSCFG_BASE_CORE_TSK_MONITOR + TaskStackCheck(runTask, newTask); +#endif /* LOSCFG_BASE_CORE_TSK_MONITOR */ + OsHookCall(LOS_HOOK_TYPE_TASK_SWITCHEDIN, newTask, runTask); +} + +STATIC VOID SchedTaskSwitch(LosTaskCB *runTask, LosTaskCB *newTask) +{ + UINT64 endTime; + + SchedSwitchCheck(runTask, newTask); + + runTask->taskStatus &= ~OS_TASK_STATUS_RUNNING; + newTask->taskStatus |= OS_TASK_STATUS_RUNNING; + +#ifdef LOSCFG_KERNEL_SMP + /* mask new running task's owner processor */ + runTask->currCpu = OS_TASK_INVALID_CPUID; + newTask->currCpu = ArchCurrCpuid(); +#endif + + OsCurrTaskSet((VOID *)newTask); +#ifdef LOSCFG_KERNEL_VM + if (newTask->archMmu != runTask->archMmu) { + LOS_ArchMmuContextSwitch((LosArchMmu *)newTask->archMmu); + } +#endif + +#ifdef LOSCFG_KERNEL_CPUP + OsCpupCycleEndStart(runTask->taskID, newTask->taskID); +#endif + +#ifdef LOSCFG_SCHED_DEBUG + UINT64 waitStartTime = newTask->startTime; +#endif + if (runTask->taskStatus & OS_TASK_STATUS_READY) { + /* When a thread enters the ready queue, its slice of time is updated */ + newTask->startTime = runTask->startTime; + } else { + /* The currently running task is blocked */ + newTask->startTime = OsGetCurrSchedTimeCycle(); + /* The task is in a blocking state and needs to update its time slice before pend */ + TimeSliceUpdate(runTask, newTask->startTime); + + if (runTask->taskStatus & (OS_TASK_STATUS_PEND_TIME | OS_TASK_STATUS_DELAY)) { + OsSchedAddTask2TimeList(&runTask->sortList, runTask->startTime, runTask->waitTimes); + } + } + + if (newTask->policy == LOS_SCHED_RR) { + endTime = newTask->startTime + newTask->timeSlice; + } else { + endTime = OS_SCHED_MAX_RESPONSE_TIME - OS_TICK_RESPONSE_PRECISION; + } + SchedSetNextExpireTime(newTask->taskID, endTime, runTask->taskID); + +#ifdef LOSCFG_SCHED_DEBUG + newTask->schedStat.waitSchedTime += newTask->startTime - waitStartTime; + newTask->schedStat.waitSchedCount++; + runTask->schedStat.runTime = runTask->schedStat.allRuntime; + runTask->schedStat.switchCount++; +#endif + /* do the task context switch */ + OsTaskSchedule(newTask, runTask); +} + +VOID OsSchedIrqEndCheckNeedSched(VOID) +{ + SchedRunQue *rq = OsSchedRunQue(); + LosTaskCB *runTask = OsCurrTaskGet(); + + TimeSliceUpdate(runTask, OsGetCurrSchedTimeCycle()); + if (runTask->timeSlice <= OS_TIME_SLICE_MIN) { + rq->schedFlag |= INT_PEND_RESCH; + } + + if (OsPreemptable() && (rq->schedFlag & INT_PEND_RESCH)) { + rq->schedFlag &= ~INT_PEND_RESCH; + + LOS_SpinLock(&g_taskSpin); + + OsSchedTaskEnQueue(runTask); + + LosTaskCB *newTask = GetTopTask(rq); + if (runTask != newTask) { + SchedTaskSwitch(runTask, newTask); + LOS_SpinUnlock(&g_taskSpin); + return; + } + + LOS_SpinUnlock(&g_taskSpin); + } + + if (rq->schedFlag & INT_PEND_TICK) { + OsSchedUpdateExpireTime(); + } +} + +VOID OsSchedResched(VOID) +{ + LOS_ASSERT(LOS_SpinHeld(&g_taskSpin)); + SchedRunQue *rq = OsSchedRunQue(); +#ifdef LOSCFG_KERNEL_SMP + LOS_ASSERT(rq->taskLockCnt == 1); +#else + LOS_ASSERT(rq->taskLockCnt == 0); +#endif + + rq->schedFlag &= ~INT_PEND_RESCH; + LosTaskCB *runTask = OsCurrTaskGet(); + LosTaskCB *newTask = GetTopTask(rq); + if (runTask == newTask) { + return; + } + + SchedTaskSwitch(runTask, newTask); +} + +VOID LOS_Schedule(VOID) +{ + UINT32 intSave; + LosTaskCB *runTask = OsCurrTaskGet(); + + if (OS_INT_ACTIVE) { + OsSchedRunQuePendingSet(); + return; + } + + if (!OsPreemptable()) { + return; + } + + /* + * trigger schedule in task will also do the slice check + * if necessary, it will give up the timeslice more in time. + * otherwise, there's no other side effects. + */ + SCHEDULER_LOCK(intSave); + + TimeSliceUpdate(runTask, OsGetCurrSchedTimeCycle()); + + /* add run task back to ready queue */ + OsSchedTaskEnQueue(runTask); + + /* reschedule to new thread */ + OsSchedResched(); + + SCHEDULER_UNLOCK(intSave); +} + +STATIC INLINE LOS_DL_LIST *OsSchedLockPendFindPosSub(const LosTaskCB *runTask, const LOS_DL_LIST *lockList) +{ + LosTaskCB *pendedTask = NULL; + LOS_DL_LIST *node = NULL; + + LOS_DL_LIST_FOR_EACH_ENTRY(pendedTask, lockList, LosTaskCB, pendList) { + if (pendedTask->priority < runTask->priority) { + continue; + } else if (pendedTask->priority > runTask->priority) { + node = &pendedTask->pendList; + break; + } else { + node = pendedTask->pendList.pstNext; + break; + } + } + + return node; +} + +LOS_DL_LIST *OsSchedLockPendFindPos(const LosTaskCB *runTask, LOS_DL_LIST *lockList) +{ + LOS_DL_LIST *node = NULL; + + if (LOS_ListEmpty(lockList)) { + node = lockList; + } else { + LosTaskCB *pendedTask1 = OS_TCB_FROM_PENDLIST(LOS_DL_LIST_FIRST(lockList)); + LosTaskCB *pendedTask2 = OS_TCB_FROM_PENDLIST(LOS_DL_LIST_LAST(lockList)); + if (pendedTask1->priority > runTask->priority) { + node = lockList->pstNext; + } else if (pendedTask2->priority <= runTask->priority) { + node = lockList; + } else { + node = OsSchedLockPendFindPosSub(runTask, lockList); + } + } + + return node; +} + diff --git a/src/kernel_liteos_a/kernel/base/sched/los_sortlink.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/sched/sched_sq/los_sortlink.c similarity index 89% rename from src/kernel_liteos_a/kernel/base/sched/los_sortlink.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/sched/sched_sq/los_sortlink.c index 4f68436f..af5d1592 100644 --- a/src/kernel_liteos_a/kernel/base/sched/los_sortlink.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/sched/sched_sq/los_sortlink.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2022 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -30,6 +30,7 @@ */ #include "los_sortlink_pri.h" +#include "los_mp.h" VOID OsSortLinkInit(SortLinkAttribute *sortLinkHeader) { @@ -81,30 +82,21 @@ VOID OsAdd2SortLink(SortLinkAttribute *head, SortLinkList *node, UINT64 response node->cpuid = idleCpu; #endif LOS_SpinUnlock(&head->spinLock); -} -VOID OsDeleteFromSortLink(SortLinkAttribute *head, SortLinkList *node) -{ - LOS_SpinLock(&head->spinLock); - if (node->responseTime != OS_SORT_LINK_INVALID_TIME) { - OsDeleteNodeSortLink(head, node); +#ifdef LOSCFG_KERNEL_SMP + if (idleCpu != ArchCurrCpuid()) { + LOS_MpSchedule(CPUID_TO_AFFI_MASK(idleCpu)); } - LOS_SpinUnlock(&head->spinLock); +#endif } -UINT32 OsSortLinkAdjustNodeResponseTime(SortLinkAttribute *head, SortLinkList *node, UINT64 responseTime) +VOID OsDeleteFromSortLink(SortLinkAttribute *head, SortLinkList *node) { - UINT32 ret = LOS_NOK; - LOS_SpinLock(&head->spinLock); if (node->responseTime != OS_SORT_LINK_INVALID_TIME) { OsDeleteNodeSortLink(head, node); - SET_SORTLIST_VALUE(node, responseTime); - AddNode2SortLink(head, node); - ret = LOS_OK; } LOS_SpinUnlock(&head->spinLock); - return ret; } UINT64 OsSortLinkGetTargetExpireTime(UINT64 currTime, const SortLinkList *targetSortList) diff --git a/src/kernel_liteos_a/kernel/base/vm/los_vm_boot.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/vm/los_vm_boot.c similarity index 100% rename from src/kernel_liteos_a/kernel/base/vm/los_vm_boot.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/vm/los_vm_boot.c diff --git a/src/kernel_liteos_a/kernel/base/vm/los_vm_dump.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/vm/los_vm_dump.c similarity index 92% rename from src/kernel_liteos_a/kernel/base/vm/los_vm_dump.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/vm/los_vm_dump.c index f326ea12..7e984214 100644 --- a/src/kernel_liteos_a/kernel/base/vm/los_vm_dump.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/vm/los_vm_dump.c @@ -121,22 +121,17 @@ UINT32 OsShellCmdProcessVmUsage(LosVmSpace *space) if (space == LOS_GetKVmSpace()) { OsShellCmdProcessPmUsage(space, NULL, &used); - return used; - } - UINT32 ret = LOS_MuxAcquire(&space->regionMux); - if (ret != 0) { - return 0; + } else { + RB_SCAN_SAFE(&space->regionRbTree, pstRbNode, pstRbNodeNext) + region = (LosVmMapRegion *)pstRbNode; + used += region->range.size; + RB_SCAN_SAFE_END(&space->regionRbTree, pstRbNode, pstRbNodeNext) } - RB_SCAN_SAFE(&space->regionRbTree, pstRbNode, pstRbNodeNext) - region = (LosVmMapRegion *)pstRbNode; - used += region->range.size; - RB_SCAN_SAFE_END(&space->regionRbTree, pstRbNode, pstRbNodeNext) - (VOID)LOS_MuxRelease(&space->regionMux); return used; } -UINT32 OsKProcessPmUsage(LosVmSpace *kSpace, UINT32 *actualPm) +VOID OsKProcessPmUsage(LosVmSpace *kSpace, UINT32 *actualPm) { UINT32 memUsed; UINT32 totalMem; @@ -146,9 +141,10 @@ UINT32 OsKProcessPmUsage(LosVmSpace *kSpace, UINT32 *actualPm) LosVmSpace *space = NULL; LOS_DL_LIST *spaceList = NULL; UINT32 UProcessUsed = 0; + UINT32 pmTmp; if (actualPm == NULL) { - return 0; + return; } memUsed = LOS_MemTotalUsedGet(m_aucSysMem1); @@ -160,15 +156,13 @@ UINT32 OsKProcessPmUsage(LosVmSpace *kSpace, UINT32 *actualPm) memUsed = SYS_MEM_SIZE_DEFAULT - (totalCount << PAGE_SHIFT); spaceList = LOS_GetVmSpaceList(); - LosMux *vmSpaceListMux = OsGVmSpaceMuxGet(); - (VOID)LOS_MuxAcquire(vmSpaceListMux); LOS_DL_LIST_FOR_EACH_ENTRY(space, spaceList, LosVmSpace, node) { if (space == LOS_GetKVmSpace()) { continue; } - UProcessUsed += OsUProcessPmUsage(space, NULL, NULL); + OsUProcessPmUsage(space, NULL, &pmTmp); + UProcessUsed += pmTmp; } - (VOID)LOS_MuxRelease(vmSpaceListMux); /* Kernel dynamic memory, include extended heap memory */ memUsed += ((usedCount << PAGE_SHIFT) - UProcessUsed); @@ -176,26 +170,26 @@ UINT32 OsKProcessPmUsage(LosVmSpace *kSpace, UINT32 *actualPm) memUsed -= freeMem; *actualPm = memUsed; - return memUsed; } -UINT32 OsShellCmdProcessPmUsage(LosVmSpace *space, UINT32 *sharePm, UINT32 *actualPm) +VOID OsShellCmdProcessPmUsage(LosVmSpace *space, UINT32 *sharePm, UINT32 *actualPm) { if (space == NULL) { - return 0; + return; } if ((sharePm == NULL) && (actualPm == NULL)) { - return 0; + return; } if (space == LOS_GetKVmSpace()) { - return OsKProcessPmUsage(space, actualPm); + OsKProcessPmUsage(space, actualPm); + } else { + OsUProcessPmUsage(space, sharePm, actualPm); } - return OsUProcessPmUsage(space, sharePm, actualPm); } -UINT32 OsUProcessPmUsage(LosVmSpace *space, UINT32 *sharePm, UINT32 *actualPm) +VOID OsUProcessPmUsage(LosVmSpace *space, UINT32 *sharePm, UINT32 *actualPm) { LosVmMapRegion *region = NULL; LosRbNode *pstRbNode = NULL; @@ -206,16 +200,15 @@ UINT32 OsUProcessPmUsage(LosVmSpace *space, UINT32 *sharePm, UINT32 *actualPm) PADDR_T paddr; STATUS_T ret; INT32 shareRef; - UINT32 pmSize = 0; if (sharePm != NULL) { *sharePm = 0; } - ret = LOS_MuxAcquire(&space->regionMux); - if (ret != 0) { - return 0; + if (actualPm != NULL) { + *actualPm = 0; } + RB_SCAN_SAFE(&space->regionRbTree, pstRbNode, pstRbNodeNext) region = (LosVmMapRegion *)pstRbNode; vaddr = region->range.base; @@ -235,23 +228,19 @@ UINT32 OsUProcessPmUsage(LosVmSpace *space, UINT32 *sharePm, UINT32 *actualPm) if (sharePm != NULL) { *sharePm += PAGE_SIZE; } - pmSize += PAGE_SIZE / shareRef; + if (actualPm != NULL) { + *actualPm += PAGE_SIZE / shareRef; + } } else { - pmSize += PAGE_SIZE; + if (actualPm != NULL) { + *actualPm += PAGE_SIZE; + } } } RB_SCAN_SAFE_END(&oldVmSpace->regionRbTree, pstRbNode, pstRbNodeNext) - - (VOID)LOS_MuxRelease(&space->regionMux); - - if (actualPm != NULL) { - *actualPm = pmSize; - } - - return pmSize; } -LosProcessCB *OsGetPIDByAspace(const LosVmSpace *space) +LosProcessCB *OsGetPIDByAspace(LosVmSpace *space) { UINT32 pid; UINT32 intSave; @@ -301,7 +290,7 @@ UINT32 OsCountRegionPages(LosVmSpace *space, LosVmMapRegion *region, UINT32 *pss } if (pssPages != NULL) { - *pssPages = (UINT32)(pss + 0.5); /* 0.5, for page alignment */ + *pssPages = (UINT32)(pss + 0.5); } return regionPages; diff --git a/src/kernel_liteos_a/kernel/base/vm/los_vm_fault.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/vm/los_vm_fault.c similarity index 98% rename from src/kernel_liteos_a/kernel/base/vm/los_vm_fault.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/vm/los_vm_fault.c index 86b08199..47eab9d7 100644 --- a/src/kernel_liteos_a/kernel/base/vm/los_vm_fault.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/vm/los_vm_fault.c @@ -359,12 +359,6 @@ STATUS_T OsVmPageFaultHandler(VADDR_T vaddr, UINT32 flags, ExcContext *frame) return LOS_ERRNO_VM_ACCESS_DENIED; } -#ifdef LOSCFG_KERNEL_PLIMITS - if (OsMemLimitCheckAndMemAdd(PAGE_SIZE) != LOS_OK) { - return LOS_ERRNO_VM_NO_MEMORY; - } -#endif - (VOID)LOS_MuxAcquire(&space->regionMux); region = LOS_RegionFind(space, vaddr); if (region == NULL) { @@ -456,9 +450,6 @@ VMM_MAP_FAILED: } CHECK_FAILED: OsFaultTryFixup(frame, excVaddr, &status); -#ifdef LOSCFG_KERNEL_PLIMITS - OsMemLimitMemFree(PAGE_SIZE); -#endif DONE: (VOID)LOS_MuxRelease(&space->regionMux); return status; diff --git a/src/kernel_liteos_a/kernel/base/vm/los_vm_filemap.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/vm/los_vm_filemap.c similarity index 98% rename from src/kernel_liteos_a/kernel/base/vm/los_vm_filemap.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/vm/los_vm_filemap.c index e95cd826..9d34aeec 100644 --- a/src/kernel_liteos_a/kernel/base/vm/los_vm_filemap.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/vm/los_vm_filemap.c @@ -125,10 +125,10 @@ VOID OsAddMapInfo(LosFilePage *page, LosArchMmu *archMmu, VADDR_T vaddr) page->n_maps++; } -LosMapInfo *OsGetMapInfo(const LosFilePage *page, const LosArchMmu *archMmu, VADDR_T vaddr) +LosMapInfo *OsGetMapInfo(LosFilePage *page, LosArchMmu *archMmu, VADDR_T vaddr) { LosMapInfo *info = NULL; - const LOS_DL_LIST *immap = &page->i_mmap; + LOS_DL_LIST *immap = &page->i_mmap; LOS_DL_LIST_FOR_EACH_ENTRY(info, immap, LosMapInfo, node) { if ((info->archMmu == archMmu) && (info->vaddr == vaddr) && (info->page == page)) { @@ -214,7 +214,7 @@ VOID OsVmmFileRemove(LosVmMapRegion *region, LosArchMmu *archMmu, VM_OFFSET_T pg return; } -VOID OsMarkPageDirty(LosFilePage *fpage, const LosVmMapRegion *region, INT32 off, INT32 len) +VOID OsMarkPageDirty(LosFilePage *fpage, LosVmMapRegion *region, INT32 off, INT32 len) { if (region != NULL) { OsSetPageDirty(fpage->vmPage); diff --git a/src/kernel_liteos_a/kernel/base/vm/los_vm_iomap.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/vm/los_vm_iomap.c similarity index 100% rename from src/kernel_liteos_a/kernel/base/vm/los_vm_iomap.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/vm/los_vm_iomap.c diff --git a/src/kernel_liteos_a/kernel/base/vm/los_vm_map.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/vm/los_vm_map.c similarity index 98% rename from src/kernel_liteos_a/kernel/base/vm/los_vm_map.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/vm/los_vm_map.c index 5d4f62b3..f41d16b0 100644 --- a/src/kernel_liteos_a/kernel/base/vm/los_vm_map.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/vm/los_vm_map.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2023 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -233,7 +233,7 @@ LosVmSpace *OsCreateUserVmSpace(VOID) return space; } -STATIC BOOL OsVmSpaceParamCheck(const LosVmSpace *vmSpace) +STATIC BOOL OsVmSpaceParamCheck(LosVmSpace *vmSpace) { if (vmSpace == NULL) { return FALSE; @@ -241,15 +241,20 @@ STATIC BOOL OsVmSpaceParamCheck(const LosVmSpace *vmSpace) return TRUE; } -STATUS_T LOS_VmSpaceClone(UINT32 cloneFlags, LosVmSpace *oldVmSpace, LosVmSpace *newVmSpace) +STATUS_T LOS_VmSpaceClone(LosVmSpace *oldVmSpace, LosVmSpace *newVmSpace) { + LosVmMapRegion *oldRegion = NULL; + LosVmMapRegion *newRegion = NULL; LosRbNode *pstRbNode = NULL; LosRbNode *pstRbNodeNext = NULL; STATUS_T ret = LOS_OK; + UINT32 numPages; PADDR_T paddr; VADDR_T vaddr; + UINT32 intSave; LosVmPage *page = NULL; - UINT32 flags, i, intSave, numPages; + UINT32 flags; + UINT32 i; if ((OsVmSpaceParamCheck(oldVmSpace) == FALSE) || (OsVmSpaceParamCheck(newVmSpace) == FALSE)) { return LOS_ERRNO_VM_INVALID_ARGS; @@ -265,13 +270,8 @@ STATUS_T LOS_VmSpaceClone(UINT32 cloneFlags, LosVmSpace *oldVmSpace, LosVmSpace newVmSpace->heapNow = oldVmSpace->heapNow; (VOID)LOS_MuxAcquire(&oldVmSpace->regionMux); RB_SCAN_SAFE(&oldVmSpace->regionRbTree, pstRbNode, pstRbNodeNext) - LosVmMapRegion *oldRegion = (LosVmMapRegion *)pstRbNode; -#if defined(LOSCFG_KERNEL_SHM) && defined(LOSCFG_IPC_CONTAINER) - if ((oldRegion->regionFlags & VM_MAP_REGION_FLAG_SHM) && (cloneFlags & CLONE_NEWIPC)) { - continue; - } -#endif - LosVmMapRegion *newRegion = OsVmRegionDup(newVmSpace, oldRegion, oldRegion->range.base, oldRegion->range.size); + oldRegion = (LosVmMapRegion *)pstRbNode; + newRegion = OsVmRegionDup(newVmSpace, oldRegion, oldRegion->range.base, oldRegion->range.size); if (newRegion == NULL) { VM_ERR("dup new region failed"); ret = LOS_ERRNO_VM_NO_MEMORY; diff --git a/src/kernel_liteos_a/kernel/base/vm/los_vm_page.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/vm/los_vm_page.c similarity index 94% rename from src/kernel_liteos_a/kernel/base/vm/los_vm_page.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/vm/los_vm_page.c index 650fd0b0..04ac1801 100644 --- a/src/kernel_liteos_a/kernel/base/vm/los_vm_page.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/vm/los_vm_page.c @@ -34,9 +34,7 @@ #include "los_vm_phys.h" #include "los_vm_boot.h" #include "los_vm_filemap.h" -#ifdef LOSCFG_KERNEL_MEM_PLIMIT -#include "los_plimits.h" -#endif + #ifdef LOSCFG_KERNEL_VM @@ -83,8 +81,7 @@ VOID OsVmPageStartup(VOID) * struct LosVmPage occupied, which satisfies the equation: * nPage * sizeof(LosVmPage) + nPage * PAGE_SIZE = OsVmPhysPageNumGet() * PAGE_SIZE. */ - UINT32 pageNum = OsVmPhysPageNumGet(); - nPage = pageNum * PAGE_SIZE / (sizeof(LosVmPage) + PAGE_SIZE); + nPage = OsVmPhysPageNumGet() * PAGE_SIZE / (sizeof(LosVmPage) + PAGE_SIZE); g_vmPageArraySize = nPage * sizeof(LosVmPage); g_vmPageArray = (LosVmPage *)OsVmBootMemAlloc(g_vmPageArraySize); @@ -92,9 +89,6 @@ VOID OsVmPageStartup(VOID) OsVmPhysSegAdd(); OsVmPhysInit(); -#ifdef LOSCFG_KERNEL_PLIMITS - OsMemLimitSetLimit(pageNum * PAGE_SIZE); -#endif for (segID = 0; segID < g_vmPhysSegNum; segID++) { seg = &g_vmPhysSeg[segID]; diff --git a/src/kernel_liteos_a/kernel/base/vm/los_vm_phys.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/vm/los_vm_phys.c similarity index 98% rename from src/kernel_liteos_a/kernel/base/vm/los_vm_phys.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/vm/los_vm_phys.c index 2c581456..c051bd1a 100644 --- a/src/kernel_liteos_a/kernel/base/vm/los_vm_phys.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/vm/los_vm_phys.c @@ -52,7 +52,7 @@ STATIC struct VmPhysArea g_physArea[] = { struct VmPhysSeg g_vmPhysSeg[VM_PHYS_SEG_MAX]; INT32 g_vmPhysSegNum = 0; -LosVmPhysSeg *OsGVmPhysSegGet(void) +LosVmPhysSeg *OsGVmPhysSegGet() { return g_vmPhysSeg; } @@ -456,9 +456,6 @@ VOID LOS_PhysPagesFreeContiguous(VOID *ptr, size_t nPages) OsVmPhysPagesFreeContiguous(page, nPages); LOS_SpinUnlockRestore(&seg->freeListLock, intSave); -#ifdef LOSCFG_KERNEL_PLIMITS - OsMemLimitMemFree(nPages * PAGE_SIZE); -#endif } PADDR_T OsKVaddrToPaddr(VADDR_T kvaddr) @@ -506,9 +503,6 @@ VOID LOS_PhysPageFree(LosVmPage *page) LOS_SpinUnlockRestore(&seg->freeListLock, intSave); } -#ifdef LOSCFG_KERNEL_PLIMITS - OsMemLimitMemFree(PAGE_SIZE); -#endif } LosVmPage *LOS_PhysPageAlloc(VOID) diff --git a/src/kernel_liteos_a/kernel/base/vm/los_vm_scan.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/vm/los_vm_scan.c similarity index 99% rename from src/kernel_liteos_a/kernel/base/vm/los_vm_scan.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/vm/los_vm_scan.c index ab467818..231ed18e 100644 --- a/src/kernel_liteos_a/kernel/base/vm/los_vm_scan.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/vm/los_vm_scan.c @@ -297,7 +297,7 @@ int OsTryShrinkMemory(size_t nPage) LosFilePage *fpage = NULL; LosFilePage *fnext = NULL; - if (nPage == 0) { + if (nPage <= 0) { nPage = VM_FILEMAP_MIN_SCAN; } diff --git a/src/kernel_liteos_a/kernel/base/vm/los_vm_syscall.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/vm/los_vm_syscall.c similarity index 99% rename from src/kernel_liteos_a/kernel/base/vm/los_vm_syscall.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/vm/los_vm_syscall.c index 6aa23993..1f6d600e 100644 --- a/src/kernel_liteos_a/kernel/base/vm/los_vm_syscall.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/vm/los_vm_syscall.c @@ -166,7 +166,7 @@ MMAP_DONE: STATUS_T LOS_UnMMap(VADDR_T addr, size_t size) { - if ((addr <= 0) || (size == 0)) { + if ((addr <= 0) || (size <= 0)) { return -EINVAL; } diff --git a/src/kernel_liteos_a/kernel/base/vm/oom.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/vm/oom.c similarity index 100% rename from src/kernel_liteos_a/kernel/base/vm/oom.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/vm/oom.c diff --git a/src/kernel_liteos_a/kernel/base/vm/shm.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/vm/shm.c similarity index 82% rename from src/kernel_liteos_a/kernel/base/vm/shm.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/vm/shm.c index 637c6167..b5b4d12f 100644 --- a/src/kernel_liteos_a/kernel/base/vm/shm.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/base/vm/shm.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2023 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -33,6 +33,7 @@ #include "string.h" #include "time.h" #include "sys/types.h" +#include "sys/shm.h" #include "sys/stat.h" #include "los_config.h" #include "los_init.h" @@ -45,8 +46,6 @@ #include "los_process.h" #include "los_process_pri.h" #include "user_copy.h" -#include "los_vm_shm_pri.h" -#include "sys/shm.h" #ifdef LOSCFG_SHELL #include "shcmd.h" #include "shell.h" @@ -55,6 +54,20 @@ #ifdef LOSCFG_KERNEL_SHM +STATIC LosMux g_sysvShmMux; + +/* private macro */ +#define SYSV_SHM_LOCK() (VOID)LOS_MuxLock(&g_sysvShmMux, LOS_WAIT_FOREVER) +#define SYSV_SHM_UNLOCK() (VOID)LOS_MuxUnlock(&g_sysvShmMux) + +/* The upper limit size of total shared memory is default 16M */ +#define SHM_MAX_PAGES 4096 +#define SHM_MAX (SHM_MAX_PAGES * PAGE_SIZE) +#define SHM_MIN 1 +#define SHM_MNI 192 +#define SHM_SEG 128 +#define SHM_ALL (SHM_MAX_PAGES) + #define SHM_SEG_FREE 0x2000 #define SHM_SEG_USED 0x4000 #define SHM_SEG_REMOVE 0x8000 @@ -78,75 +91,57 @@ #define SHM_GROUPE_TO_USER 3 #define SHM_OTHER_TO_USER 6 -#ifndef LOSCFG_IPC_CONTAINER -STATIC LosMux g_sysvShmMux; +struct shmIDSource { + struct shmid_ds ds; + UINT32 status; + LOS_DL_LIST node; +#ifdef LOSCFG_SHELL + CHAR ownerName[OS_PCB_NAME_LEN]; +#endif +}; /* private data */ -STATIC struct shminfo g_shmInfo; +STATIC struct shminfo g_shmInfo = { + .shmmax = SHM_MAX, + .shmmin = SHM_MIN, + .shmmni = SHM_MNI, + .shmseg = SHM_SEG, + .shmall = SHM_ALL, +}; + STATIC struct shmIDSource *g_shmSegs = NULL; STATIC UINT32 g_shmUsedPageCount; -#define IPC_SHM_INFO g_shmInfo -#define IPC_SHM_SYS_VSHM_MUTEX g_sysvShmMux -#define IPC_SHM_SEGS g_shmSegs -#define IPC_SHM_USED_PAGE_COUNT g_shmUsedPageCount -#endif - -/* private macro */ -#define SYSV_SHM_LOCK() (VOID)LOS_MuxLock(&IPC_SHM_SYS_VSHM_MUTEX, LOS_WAIT_FOREVER) -#define SYSV_SHM_UNLOCK() (VOID)LOS_MuxUnlock(&IPC_SHM_SYS_VSHM_MUTEX) - -struct shmIDSource *OsShmCBInit(LosMux *sysvShmMux, struct shminfo *shmInfo, UINT32 *shmUsedPageCount) +UINT32 ShmInit(VOID) { UINT32 ret; UINT32 i; - if ((sysvShmMux == NULL) || (shmInfo == NULL) || (shmUsedPageCount == NULL)) { - return NULL; - } - - ret = LOS_MuxInit(sysvShmMux, NULL); + ret = LOS_MuxInit(&g_sysvShmMux, NULL); if (ret != LOS_OK) { goto ERROR; } - shmInfo->shmmax = SHM_MAX; - shmInfo->shmmin = SHM_MIN; - shmInfo->shmmni = SHM_MNI; - shmInfo->shmseg = SHM_SEG; - shmInfo->shmall = SHM_ALL; - - struct shmIDSource *shmSegs = LOS_MemAlloc((VOID *)OS_SYS_MEM_ADDR, sizeof(struct shmIDSource) * shmInfo->shmmni); - if (shmSegs == NULL) { - (VOID)LOS_MuxDestroy(sysvShmMux); + g_shmSegs = LOS_MemAlloc((VOID *)OS_SYS_MEM_ADDR, sizeof(struct shmIDSource) * g_shmInfo.shmmni); + if (g_shmSegs == NULL) { + (VOID)LOS_MuxDestroy(&g_sysvShmMux); goto ERROR; } - (VOID)memset_s(shmSegs, (sizeof(struct shmIDSource) * shmInfo->shmmni), - 0, (sizeof(struct shmIDSource) * shmInfo->shmmni)); + (VOID)memset_s(g_shmSegs, (sizeof(struct shmIDSource) * g_shmInfo.shmmni), + 0, (sizeof(struct shmIDSource) * g_shmInfo.shmmni)); - for (i = 0; i < shmInfo->shmmni; i++) { - shmSegs[i].status = SHM_SEG_FREE; - shmSegs[i].ds.shm_perm.seq = i + 1; - LOS_ListInit(&shmSegs[i].node); + for (i = 0; i < g_shmInfo.shmmni; i++) { + g_shmSegs[i].status = SHM_SEG_FREE; + g_shmSegs[i].ds.shm_perm.seq = i + 1; + LOS_ListInit(&g_shmSegs[i].node); } - *shmUsedPageCount = 0; + g_shmUsedPageCount = 0; - return shmSegs; + return LOS_OK; ERROR: VM_ERR("ShmInit fail\n"); - return NULL; -} - -UINT32 ShmInit(VOID) -{ -#ifndef LOSCFG_IPC_CONTAINER - g_shmSegs = OsShmCBInit(&IPC_SHM_SYS_VSHM_MUTEX, &IPC_SHM_INFO, &IPC_SHM_USED_PAGE_COUNT); - if (g_shmSegs == NULL) { - return LOS_NOK; - } -#endif - return LOS_OK; + return LOS_NOK; } LOS_MODULE_INIT(ShmInit, LOS_INIT_LEVEL_VM_COMPLETE); @@ -155,10 +150,10 @@ UINT32 ShmDeinit(VOID) { UINT32 ret; - (VOID)LOS_MemFree((VOID *)OS_SYS_MEM_ADDR, IPC_SHM_SEGS); - IPC_SHM_SEGS = NULL; + (VOID)LOS_MemFree((VOID *)OS_SYS_MEM_ADDR, g_shmSegs); + g_shmSegs = NULL; - ret = LOS_MuxDestroy(&IPC_SHM_SYS_VSHM_MUTEX); + ret = LOS_MuxDestroy(&g_sysvShmMux); if (ret != LOS_OK) { return -1; } @@ -193,63 +188,43 @@ STATIC VOID ShmPagesRefDec(struct shmIDSource *seg) } } -STATIC INT32 ShmAllocSegCheck(key_t key, size_t *size, INT32 *segNum) +STATIC INT32 ShmAllocSeg(key_t key, size_t size, INT32 shmflg) { INT32 i; - if ((*size == 0) || (*size < IPC_SHM_INFO.shmmin) || - (*size > IPC_SHM_INFO.shmmax)) { - return -EINVAL; - } + INT32 segNum = -1; + struct shmIDSource *seg = NULL; + size_t count; - *size = LOS_Align(*size, PAGE_SIZE); - if ((IPC_SHM_USED_PAGE_COUNT + (*size >> PAGE_SHIFT)) > IPC_SHM_INFO.shmall) { - return -ENOMEM; + if ((size == 0) || (size < g_shmInfo.shmmin) || + (size > g_shmInfo.shmmax)) { + return -EINVAL; } - -#ifdef LOSCFG_KERNEL_IPC_PLIMIT - if (OsIPCLimitShmAlloc(*size) != LOS_OK) { + size = LOS_Align(size, PAGE_SIZE); + if ((g_shmUsedPageCount + (size >> PAGE_SHIFT)) > g_shmInfo.shmall) { return -ENOMEM; } -#endif - for (i = 0; i < IPC_SHM_INFO.shmmni; i++) { - if (IPC_SHM_SEGS[i].status & SHM_SEG_FREE) { - IPC_SHM_SEGS[i].status &= ~SHM_SEG_FREE; - *segNum = i; + for (i = 0; i < g_shmInfo.shmmni; i++) { + if (g_shmSegs[i].status & SHM_SEG_FREE) { + g_shmSegs[i].status &= ~SHM_SEG_FREE; + segNum = i; break; } } - if (*segNum < 0) { + if (segNum < 0) { return -ENOSPC; } - return 0; -} -STATIC INT32 ShmAllocSeg(key_t key, size_t size, INT32 shmflg) -{ - INT32 segNum = -1; - struct shmIDSource *seg = NULL; - size_t count; - - INT32 ret = ShmAllocSegCheck(key, &size, &segNum); - if (ret < 0) { - return ret; - } - - seg = &IPC_SHM_SEGS[segNum]; + seg = &g_shmSegs[segNum]; count = LOS_PhysPagesAlloc(size >> PAGE_SHIFT, &seg->node); if (count != (size >> PAGE_SHIFT)) { (VOID)LOS_PhysPagesFree(&seg->node); seg->status = SHM_SEG_FREE; -#ifdef LOSCFG_KERNEL_IPC_PLIMIT - OsIPCLimitShmFree(size); -#endif return -ENOMEM; } - ShmSetSharedFlag(seg); - IPC_SHM_USED_PAGE_COUNT += size >> PAGE_SHIFT; + g_shmUsedPageCount += size >> PAGE_SHIFT; seg->status |= SHM_SEG_USED; seg->ds.shm_perm.mode = (UINT32)shmflg & ACCESSPERMS; @@ -272,7 +247,7 @@ STATIC INT32 ShmAllocSeg(key_t key, size_t size, INT32 shmflg) return segNum; } -STATIC INLINE VOID ShmFreeSeg(struct shmIDSource *seg, UINT32 *shmUsedPageCount) +STATIC INLINE VOID ShmFreeSeg(struct shmIDSource *seg) { UINT32 count; @@ -282,12 +257,7 @@ STATIC INLINE VOID ShmFreeSeg(struct shmIDSource *seg, UINT32 *shmUsedPageCount) VM_ERR("free physical pages failed, count = %d, size = %d", count, seg->ds.shm_segsz >> PAGE_SHIFT); return; } -#ifdef LOSCFG_KERNEL_IPC_PLIMIT - OsIPCLimitShmFree(seg->ds.shm_segsz); -#endif - if (shmUsedPageCount != NULL) { - (*shmUsedPageCount) -= seg->ds.shm_segsz >> PAGE_SHIFT; - } + g_shmUsedPageCount -= seg->ds.shm_segsz >> PAGE_SHIFT; seg->status = SHM_SEG_FREE; LOS_ListInit(&seg->node); } @@ -297,8 +267,8 @@ STATIC INT32 ShmFindSegByKey(key_t key) INT32 i; struct shmIDSource *seg = NULL; - for (i = 0; i < IPC_SHM_INFO.shmmni; i++) { - seg = &IPC_SHM_SEGS[i]; + for (i = 0; i < g_shmInfo.shmmni; i++) { + seg = &g_shmSegs[i]; if ((seg->status & SHM_SEG_USED) && (seg->ds.shm_perm.key == key)) { return i; @@ -310,7 +280,7 @@ STATIC INT32 ShmFindSegByKey(key_t key) STATIC INT32 ShmSegValidCheck(INT32 segNum, size_t size, INT32 shmFlg) { - struct shmIDSource *seg = &IPC_SHM_SEGS[segNum]; + struct shmIDSource *seg = &g_shmSegs[segNum]; if (size > seg->ds.shm_segsz) { return -EINVAL; @@ -328,12 +298,12 @@ STATIC struct shmIDSource *ShmFindSeg(int shmid) { struct shmIDSource *seg = NULL; - if ((shmid < 0) || (shmid >= IPC_SHM_INFO.shmmni)) { + if ((shmid < 0) || (shmid >= g_shmInfo.shmmni)) { set_errno(EINVAL); return NULL; } - seg = &IPC_SHM_SEGS[shmid]; + seg = &g_shmSegs[shmid]; if ((seg->status & SHM_SEG_FREE) || ((seg->ds.shm_nattch == 0) && (seg->status & SHM_SEG_REMOVE))) { set_errno(EIDRM); return NULL; @@ -394,7 +364,7 @@ VOID OsShmRegionFree(LosVmSpace *space, LosVmMapRegion *region) ShmPagesRefDec(seg); seg->ds.shm_nattch--; if (seg->ds.shm_nattch <= 0 && (seg->status & SHM_SEG_REMOVE)) { - ShmFreeSeg(seg, &IPC_SHM_USED_PAGE_COUNT); + ShmFreeSeg(seg); } else { seg->ds.shm_dtime = time(NULL); seg->ds.shm_lpid = LOS_GetCurrProcessID(); /* may not be the space's PID. */ @@ -413,8 +383,8 @@ STATIC INT32 ShmSegUsedCount(VOID) INT32 count = 0; struct shmIDSource *seg = NULL; - for (i = 0; i < IPC_SHM_INFO.shmmni; i++) { - seg = &IPC_SHM_SEGS[i]; + for (i = 0; i < g_shmInfo.shmmni; i++) { + seg = &g_shmSegs[i]; if (seg->status & SHM_SEG_USED) { count++; } @@ -634,7 +604,7 @@ INT32 ShmCtl(INT32 shmid, INT32 cmd, struct shmid_ds *buf) { struct shmIDSource *seg = NULL; INT32 ret = 0; - struct shm_info shmInfo = { 0 }; + struct shm_info shmInfo; struct ipc_perm shm_perm; cmd = ((UINT32)cmd & ~IPC_64); @@ -702,16 +672,16 @@ INT32 ShmCtl(INT32 shmid, INT32 cmd, struct shmid_ds *buf) seg->status |= SHM_SEG_REMOVE; if (seg->ds.shm_nattch <= 0) { - ShmFreeSeg(seg, &IPC_SHM_USED_PAGE_COUNT); + ShmFreeSeg(seg); } break; case IPC_INFO: - ret = LOS_ArchCopyToUser(buf, &IPC_SHM_INFO, sizeof(struct shminfo)); + ret = LOS_ArchCopyToUser(buf, &g_shmInfo, sizeof(struct shminfo)); if (ret != 0) { ret = EFAULT; goto ERROR; } - ret = IPC_SHM_INFO.shmmni; + ret = g_shmInfo.shmmni; break; case SHM_INFO: shmInfo.shm_rss = 0; @@ -725,7 +695,7 @@ INT32 ShmCtl(INT32 shmid, INT32 cmd, struct shmid_ds *buf) ret = EFAULT; goto ERROR; } - ret = IPC_SHM_INFO.shmmni; + ret = g_shmInfo.shmmni; break; default: VM_ERR("the cmd(%d) is not supported!", cmd); @@ -788,7 +758,7 @@ INT32 ShmDt(const VOID *shmaddr) seg->ds.shm_nattch--; if ((seg->ds.shm_nattch <= 0) && (seg->status & SHM_SEG_REMOVE)) { - ShmFreeSeg(seg, &IPC_SHM_USED_PAGE_COUNT); + ShmFreeSeg(seg); } else { seg->ds.shm_dtime = time(NULL); seg->ds.shm_lpid = LOS_GetCurrProcessID(); @@ -805,27 +775,6 @@ ERROR: return -1; } -VOID OsShmCBDestroy(struct shmIDSource *shmSegs, struct shminfo *shmInfo, LosMux *sysvShmMux) -{ - if ((shmSegs == NULL) || (shmInfo == NULL) || (sysvShmMux == NULL)) { - return; - } - - for (UINT32 index = 0; index < shmInfo->shmmni; index++) { - struct shmIDSource *seg = &shmSegs[index]; - if (seg->status == SHM_SEG_FREE) { - continue; - } - - (VOID)LOS_MuxLock(sysvShmMux, LOS_WAIT_FOREVER); - ShmFreeSeg(seg, NULL); - (VOID)LOS_MuxUnlock(sysvShmMux); - } - - (VOID)LOS_MemFree((VOID *)OS_SYS_MEM_ADDR, shmSegs); - (VOID)LOS_MuxDestroy(sysvShmMux); -} - #ifdef LOSCFG_SHELL STATIC VOID OsShmInfoCmd(VOID) { @@ -835,8 +784,8 @@ STATIC VOID OsShmInfoCmd(VOID) PRINTK("\r\n------- Shared Memory Segments -------\n"); PRINTK("key shmid perms bytes nattch status owner\n"); SYSV_SHM_LOCK(); - for (i = 0; i < IPC_SHM_INFO.shmmni; i++) { - seg = &IPC_SHM_SEGS[i]; + for (i = 0; i < g_shmInfo.shmmni; i++) { + seg = &g_shmSegs[i]; if (!(seg->status & SHM_SEG_USED)) { continue; } @@ -852,7 +801,7 @@ STATIC VOID OsShmDeleteCmd(INT32 shmid) { struct shmIDSource *seg = NULL; - if ((shmid < 0) || (shmid >= IPC_SHM_INFO.shmmni)) { + if ((shmid < 0) || (shmid >= g_shmInfo.shmmni)) { PRINT_ERR("shmid is invalid: %d\n", shmid); return; } @@ -865,7 +814,7 @@ STATIC VOID OsShmDeleteCmd(INT32 shmid) } if (seg->ds.shm_nattch <= 0) { - ShmFreeSeg(seg, &IPC_SHM_USED_PAGE_COUNT); + ShmFreeSeg(seg); } SYSV_SHM_UNLOCK(); } diff --git a/src/kernel_liteos_a/kernel/common/BUILD.gn b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/common/BUILD.gn similarity index 100% rename from src/kernel_liteos_a/kernel/common/BUILD.gn rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/common/BUILD.gn diff --git a/src/kernel_liteos_a/kernel/common/Makefile b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/common/Makefile similarity index 100% rename from src/kernel_liteos_a/kernel/common/Makefile rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/common/Makefile diff --git a/src/kernel_liteos_a/kernel/common/console.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/common/console.c similarity index 99% rename from src/kernel_liteos_a/kernel/common/console.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/common/console.c index bfaa4c59..b8c59f5f 100644 --- a/src/kernel_liteos_a/kernel/common/console.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/common/console.c @@ -404,7 +404,7 @@ STATIC VOID EchoToTerminal(CONSOLE_CB *consoleCB, struct file *filep, const stru { if (consoleCB->consoleTermios.c_lflag & ECHO) { if (ch == '\b') { - (VOID)fops->write(filep, "\b \b", 3); // 3: length of "\b \b" + (VOID)fops->write(filep, "\b \b", 3); } else { (VOID)fops->write(filep, &ch, EACH_CHAR); } @@ -709,6 +709,7 @@ STATIC ssize_t DoWrite(CirBufSendCB *cirBufSendCB, CHAR *buffer, size_t bufLen) { INT32 cnt; size_t written = 0; + size_t toWrite = bufLen; UINT32 intSave; #ifdef LOSCFG_SHELL_DMESG @@ -729,6 +730,7 @@ STATIC ssize_t DoWrite(CirBufSendCB *cirBufSendCB, CHAR *buffer, size_t bufLen) if (cnt <= 0) { break; } + toWrite -= cnt; written += cnt; } LOS_SpinUnlockRestore(&g_consoleWriteSpinLock, intSave); @@ -1236,7 +1238,7 @@ STATIC CONSOLE_CB *OsConsoleCreate(UINT32 consoleID, const CHAR *deviceName) ret = (INT32)LOS_SemCreate(1, &consoleCB->consoleSem); if (ret != LOS_OK) { - PRINT_ERR("create sem for uart failed\n"); + PRINT_ERR("creat sem for uart failed\n"); goto ERR_WITH_BUF; } @@ -1420,7 +1422,7 @@ INT32 ConsoleTaskReg(INT32 consoleID, UINT32 taskID) if (!IsShellEntryRunning(g_console[consoleID - 1]->shellEntryId)) { g_console[consoleID - 1]->shellEntryId = taskID; LOS_SpinUnlockRestore(&g_consoleSpin, intSave); - (VOID)OsSetCurrProcessGroupID(OS_USER_ROOT_PROCESS_ID); + (VOID)OsSetCurrProcessGroupID(OsGetUserInitProcessID()); return LOS_OK; } LOS_SpinUnlockRestore(&g_consoleSpin, intSave); @@ -1534,15 +1536,7 @@ STATIC ssize_t WriteToTerminal(const CONSOLE_CB *consoleCB, const CHAR *buffer, fd = consoleCB->fd; ret = fs_getfilep(fd, &filep); - if (ret < 0) { - ret = -EPERM; - goto ERROUT; - } ret = GetFilepOps(filep, &privFilep, &fileOps); - if (ret != ENOERR) { - ret = -EINVAL; - goto ERROUT; - } if ((fileOps == NULL) || (fileOps->write == NULL)) { ret = EFAULT; diff --git a/src/kernel_liteos_a/kernel/common/console.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/common/console.h similarity index 100% rename from src/kernel_liteos_a/kernel/common/console.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/common/console.h diff --git a/src/kernel_liteos_a/kernel/common/los_config.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/common/los_config.c similarity index 97% rename from src/kernel_liteos_a/kernel/common/los_config.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/common/los_config.c index 02723ee0..b1c01a19 100644 --- a/src/kernel_liteos_a/kernel/common/los_config.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/common/los_config.c @@ -52,6 +52,9 @@ #include "los_tick.h" #include "los_vm_boot.h" #include "los_smp.h" +#ifdef LOSCFG_ENABLE_KERNEL_TEST +#include "los_test_pri.h" +#endif STATIC SystemRebootFunc g_rebootHook = NULL; @@ -70,7 +73,7 @@ LITE_OS_SEC_TEXT_INIT STATIC UINT32 EarliestInit(VOID) /* Must be placed at the beginning of the boot process */ OsSetMainTask(); OsCurrTaskSet(OsGetMainTask()); - OsSchedRunqueueInit(); + OsSchedRunQueInit(); g_sysClock = OS_SYS_CLOCK; g_tickPerSecond = LOSCFG_BASE_CORE_TICK_PER_SECOND; @@ -217,7 +220,7 @@ LITE_OS_SEC_TEXT_INIT UINT32 OsMain(VOID) startNsec = LOS_CurrNanosec(); #endif - ret = OsProcessInit(); + ret = OsTaskInit(); if (ret != LOS_OK) { return ret; } @@ -286,14 +289,17 @@ STATIC VOID SystemInit(VOID) extern VOID SystemInit(VOID); #endif -#ifndef LOSCFG_ENABLE_KERNEL_TEST STATIC UINT32 OsSystemInitTaskCreate(VOID) { UINT32 taskID; TSK_INIT_PARAM_S sysTask; (VOID)memset_s(&sysTask, sizeof(TSK_INIT_PARAM_S), 0, sizeof(TSK_INIT_PARAM_S)); +#ifndef LOSCFG_ENABLE_KERNEL_TEST sysTask.pfnTaskEntry = (TSK_ENTRY_FUNC)SystemInit; +#else + sysTask.pfnTaskEntry = (TSK_ENTRY_FUNC)TestSystemInit; +#endif sysTask.uwStackSize = LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE; sysTask.pcName = "SystemInit"; sysTask.usTaskPrio = LOSCFG_BASE_CORE_TSK_DEFAULT_PRIO; @@ -317,4 +323,3 @@ STATIC UINT32 OsSystemInit(VOID) } LOS_MODULE_INIT(OsSystemInit, LOS_INIT_LEVEL_KMOD_TASK); -#endif diff --git a/src/kernel_liteos_a/kernel/common/los_config.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/common/los_config.h similarity index 96% rename from src/kernel_liteos_a/kernel/common/los_config.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/common/los_config.h index f06ae174..4182458a 100644 --- a/src/kernel_liteos_a/kernel/common/los_config.h +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/common/los_config.h @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2022 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -272,15 +272,6 @@ extern UINT32 __heap_end; #define LOSCFG_BASE_IPC_MUX #endif -/****************************** rwlock module configuration ******************************/ -/** - * @ingroup los_config - * Configuration item for rwlock module tailoring - */ -#ifndef LOSCFG_BASE_IPC_RWLOCK -#define LOSCFG_BASE_IPC_RWLOCK -#endif - /****************************** Queue module configuration ********************************/ /** * @ingroup los_config @@ -373,7 +364,6 @@ extern UINT32 __heap_end; */ #define _T(x) x #define KERNEL_NAME "Huawei LiteOS" -#define KERNEL_NODE_NAME "hisilicon" #define KERNEL_SEP " " #define _V(v) _T(KERNEL_NAME)_T(KERNEL_SEP)_T(v) @@ -389,14 +379,6 @@ extern UINT32 __heap_end; #define VERSION_NUM(a, b, c, d) (((a) << 24) | ((b) << 16) | (c) << 8 | (d)) #define KERNEL_OPEN_VERSION_NUM VERSION_NUM(KERNEL_MAJOR, KERNEL_MINOR, KERNEL_PATCH, KERNEL_ITRE) -/** - * @ingroup los_config - * The container limit - */ -#ifndef LOSCFG_KERNEL_CONTAINER_DEFAULT_LIMIT -#define LOSCFG_KERNEL_CONTAINER_DEFAULT_LIMIT 10 -#endif - /****************************** Exception information configuration ******************************/ #ifdef LOSCFG_SAVE_EXCINFO /** diff --git a/src/kernel_liteos_a/kernel/common/los_excinfo.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/common/los_excinfo.c similarity index 100% rename from src/kernel_liteos_a/kernel/common/los_excinfo.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/common/los_excinfo.c diff --git a/src/kernel_liteos_a/kernel/common/los_excinfo_pri.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/common/los_excinfo_pri.h similarity index 100% rename from src/kernel_liteos_a/kernel/common/los_excinfo_pri.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/common/los_excinfo_pri.h diff --git a/src/kernel_liteos_a/kernel/common/los_init.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/common/los_init.c similarity index 99% rename from src/kernel_liteos_a/kernel/common/los_init.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/common/los_init.c index 3b9c4b41..408bace9 100644 --- a/src/kernel_liteos_a/kernel/common/los_init.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/common/los_init.c @@ -87,6 +87,7 @@ STATIC VOID InitLevelCall(const CHAR *name, const UINT32 level, struct ModuleIni LOS_SpinUnlock(&g_initLock); if (module->hook != NULL) { #ifdef LOS_INIT_DEBUG + ret = LOS_OK; startNsec = LOS_CurrNanosec(); ret = (UINT32)module->hook(); endNsec = LOS_CurrNanosec(); diff --git a/src/kernel_liteos_a/kernel/common/los_init_info.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/common/los_init_info.h similarity index 100% rename from src/kernel_liteos_a/kernel/common/los_init_info.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/common/los_init_info.h diff --git a/src/kernel_liteos_a/kernel/common/los_init_pri.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/common/los_init_pri.h similarity index 100% rename from src/kernel_liteos_a/kernel/common/los_init_pri.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/common/los_init_pri.h diff --git a/src/kernel_liteos_a/kernel/common/los_magickey.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/common/los_magickey.c similarity index 96% rename from src/kernel_liteos_a/kernel/common/los_magickey.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/common/los_magickey.c index af2f79e0..fba1c059 100644 --- a/src/kernel_liteos_a/kernel/common/los_magickey.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/common/los_magickey.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2022 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -32,7 +32,7 @@ #include "los_magickey.h" #include "console.h" #include "los_task_pri.h" -#include "los_process_pri.h" + #ifdef LOSCFG_ENABLE_MAGICKEY @@ -97,7 +97,9 @@ STATIC VOID OsMagicHelp(VOID) STATIC VOID OsMagicTaskShow(VOID) { - (VOID)OsShellCmdTskInfoGet(OS_ALL_TASK_MASK, NULL, OS_PROCESS_INFO_ALL); + const CHAR *arg = "-a"; + + (VOID)OsShellCmdDumpTask(1, &arg); return; } diff --git a/src/kernel_liteos_a/kernel/common/los_magickey.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/common/los_magickey.h similarity index 100% rename from src/kernel_liteos_a/kernel/common/los_magickey.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/common/los_magickey.h diff --git a/src/kernel_liteos_a/kernel/common/los_printf.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/common/los_printf.c similarity index 98% rename from src/kernel_liteos_a/kernel/common/los_printf.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/common/los_printf.c index e0126544..25f7c193 100644 --- a/src/kernel_liteos_a/kernel/common/los_printf.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/common/los_printf.c @@ -198,7 +198,6 @@ __attribute__((noinline)) VOID UartPrintf(const CHAR *fmt, ...) va_end(ap); } -#ifndef LOSCFG_LIBC_NEWLIB __attribute__((noinline)) VOID dprintf(const CHAR *fmt, ...) { va_list ap; @@ -211,7 +210,6 @@ __attribute__((noinline)) VOID dprintf(const CHAR *fmt, ...) #endif va_end(ap); } -#endif VOID LkDprintf(const CHAR *fmt, va_list ap) { @@ -281,7 +279,7 @@ VOID LOS_LkPrint(INT32 level, const CHAR *func, INT32 line, const CHAR *fmt, ... } if ((level != LOS_COMMON_LEVEL) && ((level > LOS_EMG_LEVEL) && (level <= LOS_TRACE_LEVEL))) { - PRINTK("[%s][%s:%s]", g_logString[level], + dprintf("[%s][%s:%s]", g_logString[level], ((OsCurrProcessGet() == NULL) ? "NULL" : OsCurrProcessGet()->processName), ((OsCurrTaskGet() == NULL) ? "NULL" : OsCurrTaskGet()->taskName)); } diff --git a/src/kernel_liteos_a/kernel/common/main.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/common/main.c similarity index 100% rename from src/kernel_liteos_a/kernel/common/main.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/common/main.c diff --git a/src/kernel_liteos_a/kernel/common/virtual_serial.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/common/virtual_serial.c similarity index 100% rename from src/kernel_liteos_a/kernel/common/virtual_serial.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/common/virtual_serial.c diff --git a/src/kernel_liteos_a/kernel/common/virtual_serial.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/common/virtual_serial.h similarity index 100% rename from src/kernel_liteos_a/kernel/common/virtual_serial.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/common/virtual_serial.h diff --git a/src/kernel_liteos_a/kernel/extended/BUILD.gn b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/BUILD.gn similarity index 96% rename from src/kernel_liteos_a/kernel/extended/BUILD.gn rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/BUILD.gn index 0a322355..0ddf4804 100644 --- a/src/kernel_liteos_a/kernel/extended/BUILD.gn +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/BUILD.gn @@ -32,7 +32,6 @@ import("//kernel/liteos_a/liteos.gni") group("extended") { deps = [ "blackbox", - "container", "cppsupport", "cpup", "dynload", @@ -43,7 +42,6 @@ group("extended") { "lms", "perf", "pipes", - "plimit", "power", "trace", "vdso", @@ -53,7 +51,6 @@ group("extended") { config("public") { configs = [ "blackbox:public", - "container:public", "cpup:public", "dynload:public", "hidumper:public", @@ -65,6 +62,5 @@ config("public") { "perf:public", "lms:public", "power:public", - "plimit:public", ] } diff --git a/src/kernel_liteos_a/kernel/extended/Kconfig b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/Kconfig similarity index 64% rename from src/kernel_liteos_a/kernel/extended/Kconfig rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/Kconfig index d7d133ec..abb7bec3 100644 --- a/src/kernel_liteos_a/kernel/extended/Kconfig +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/Kconfig @@ -76,31 +76,6 @@ config KERNEL_PIPE help Answer Y to enable LiteOS support pipes. -config KERNEL_PLIMITS - bool "Enable plimits Feature" - default n - depends on KERNEL_EXTKERNEL - -config KERNEL_MEM_PLIMIT - bool "Enable mem limits Feature" - default n - depends on KERNEL_PLIMITS - -config KERNEL_IPC_PLIMIT - bool "Enable ipc limits Feature" - default n - depends on KERNEL_PLIMITS - -config KERNEL_DEV_PLIMIT - bool "Enable dev limits Feature" - default n - depends on KERNEL_PLIMITS - -config KERNEL_SCHED_PLIMIT - bool "Enable sched limits Feature" - default n - depends on KERNEL_PLIMITS - config BASE_CORE_HILOG bool "Enable Hilog" default y @@ -113,54 +88,6 @@ config KERNEL_HOOK default n depends on KERNEL_EXTKERNEL && DEBUG_VERSION - -######################### config options of container #################### -config KERNEL_CONTAINER - bool "Enable container Feature" - default n - depends on KERNEL_VM - -config PID_CONTAINER - bool "Enable pid container Feature" - default n - depends on KERNEL_CONTAINER - -config UTS_CONTAINER - bool "Enable uts container Feature" - default n - depends on KERNEL_CONTAINER - -config MNT_CONTAINER - bool "Enable mnt container Feature" - default n - depends on KERNEL_CONTAINER - -config CHROOT - bool "Enable chroot" - default n - depends on MNT_CONTAINER - -config IPC_CONTAINER - bool "Enable ipc container Feature" - default n - depends on KERNEL_CONTAINER - -config TIME_CONTAINER - bool "Enable time container" - default n - depends on KERNEL_CONTAINER - -config USER_CONTAINER - bool "Enable user container" - default n - depends on KERNEL_CONTAINER - -config NET_CONTAINER - bool "Enable net container" - default n - depends on KERNEL_CONTAINER - - ######################### config options of trace ######################### source "kernel/extended/trace/Kconfig" @@ -177,4 +104,4 @@ source "kernel/extended/perf/Kconfig" source "kernel/extended/lms/Kconfig" ######################### config options of hilog ######################### -source "kernel/extended/hilog/Kconfig" +source "kernel/extended/hilog/Kconfig" \ No newline at end of file diff --git a/src/kernel_liteos_a/kernel/extended/blackbox/BUILD.gn b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/blackbox/BUILD.gn similarity index 100% rename from src/kernel_liteos_a/kernel/extended/blackbox/BUILD.gn rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/blackbox/BUILD.gn diff --git a/src/kernel_liteos_a/kernel/extended/blackbox/Kconfig b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/blackbox/Kconfig similarity index 100% rename from src/kernel_liteos_a/kernel/extended/blackbox/Kconfig rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/blackbox/Kconfig diff --git a/src/kernel_liteos_a/kernel/extended/blackbox/Makefile b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/blackbox/Makefile similarity index 100% rename from src/kernel_liteos_a/kernel/extended/blackbox/Makefile rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/blackbox/Makefile diff --git a/src/kernel_liteos_a/kernel/extended/blackbox/los_blackbox.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/blackbox/los_blackbox.h similarity index 100% rename from src/kernel_liteos_a/kernel/extended/blackbox/los_blackbox.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/blackbox/los_blackbox.h diff --git a/src/kernel_liteos_a/kernel/extended/blackbox/los_blackbox_common.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/blackbox/los_blackbox_common.c similarity index 100% rename from src/kernel_liteos_a/kernel/extended/blackbox/los_blackbox_common.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/blackbox/los_blackbox_common.c diff --git a/src/kernel_liteos_a/kernel/extended/blackbox/los_blackbox_common.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/blackbox/los_blackbox_common.h similarity index 100% rename from src/kernel_liteos_a/kernel/extended/blackbox/los_blackbox_common.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/blackbox/los_blackbox_common.h diff --git a/src/kernel_liteos_a/kernel/extended/blackbox/los_blackbox_core.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/blackbox/los_blackbox_core.c similarity index 100% rename from src/kernel_liteos_a/kernel/extended/blackbox/los_blackbox_core.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/blackbox/los_blackbox_core.c diff --git a/src/kernel_liteos_a/kernel/extended/blackbox/los_blackbox_detector.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/blackbox/los_blackbox_detector.c similarity index 100% rename from src/kernel_liteos_a/kernel/extended/blackbox/los_blackbox_detector.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/blackbox/los_blackbox_detector.c diff --git a/src/kernel_liteos_a/kernel/extended/blackbox/los_blackbox_detector.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/blackbox/los_blackbox_detector.h similarity index 100% rename from src/kernel_liteos_a/kernel/extended/blackbox/los_blackbox_detector.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/blackbox/los_blackbox_detector.h diff --git a/src/kernel_liteos_a/kernel/extended/blackbox/los_blackbox_system_adapter.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/blackbox/los_blackbox_system_adapter.c similarity index 100% rename from src/kernel_liteos_a/kernel/extended/blackbox/los_blackbox_system_adapter.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/blackbox/los_blackbox_system_adapter.c diff --git a/src/kernel_liteos_a/kernel/extended/blackbox/los_blackbox_system_adapter.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/blackbox/los_blackbox_system_adapter.h similarity index 100% rename from src/kernel_liteos_a/kernel/extended/blackbox/los_blackbox_system_adapter.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/blackbox/los_blackbox_system_adapter.h diff --git a/src/kernel_liteos_a/kernel/extended/cppsupport/BUILD.gn b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/cppsupport/BUILD.gn similarity index 100% rename from src/kernel_liteos_a/kernel/extended/cppsupport/BUILD.gn rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/cppsupport/BUILD.gn diff --git a/src/kernel_liteos_a/kernel/extended/cppsupport/Makefile b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/cppsupport/Makefile similarity index 100% rename from src/kernel_liteos_a/kernel/extended/cppsupport/Makefile rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/cppsupport/Makefile diff --git a/src/kernel_liteos_a/kernel/extended/cppsupport/los_cppsupport.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/cppsupport/los_cppsupport.c similarity index 100% rename from src/kernel_liteos_a/kernel/extended/cppsupport/los_cppsupport.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/cppsupport/los_cppsupport.c diff --git a/src/kernel_liteos_a/kernel/extended/cpup/BUILD.gn b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/cpup/BUILD.gn similarity index 100% rename from src/kernel_liteos_a/kernel/extended/cpup/BUILD.gn rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/cpup/BUILD.gn diff --git a/src/kernel_liteos_a/kernel/extended/cpup/Makefile b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/cpup/Makefile similarity index 100% rename from src/kernel_liteos_a/kernel/extended/cpup/Makefile rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/cpup/Makefile diff --git a/src/kernel_liteos_a/kernel/extended/cpup/cpup_shellcmd.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/cpup/cpup_shellcmd.c similarity index 96% rename from src/kernel_liteos_a/kernel/extended/cpup/cpup_shellcmd.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/cpup/cpup_shellcmd.c index edaec5d6..f504f426 100644 --- a/src/kernel_liteos_a/kernel/extended/cpup/cpup_shellcmd.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/cpup/cpup_shellcmd.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2023 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -120,7 +120,7 @@ LITE_OS_SEC_TEXT_MINOR UINT32 OsShellCmdCpup(INT32 argc, const CHAR **argv) return LOS_OK; } - if (OsProcessIsUnused(OS_PCB_FROM_PID(pid)) || OsProcessIsDead(OS_PCB_FROM_PID(pid))) { + if (OsProcessIsDead(OS_PCB_FROM_PID(pid))) { PRINTK("\nUnknown pid: %u\n", pid); return LOS_OK; } diff --git a/src/kernel_liteos_a/kernel/extended/cpup/los_cpup.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/cpup/los_cpup.c similarity index 78% rename from src/kernel_liteos_a/kernel/extended/cpup/los_cpup.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/cpup/los_cpup.c index 4563a9b8..077ee8e9 100644 --- a/src/kernel_liteos_a/kernel/extended/cpup/los_cpup.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/cpup/los_cpup.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2023 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -33,7 +33,6 @@ #include "los_base.h" #include "los_init.h" #include "los_process_pri.h" -#include "los_info_pri.h" #include "los_swtmr.h" @@ -42,10 +41,10 @@ LITE_OS_SEC_BSS STATIC UINT16 cpupSwtmrID; LITE_OS_SEC_BSS STATIC UINT16 cpupInitFlg = 0; LITE_OS_SEC_BSS OsIrqCpupCB *g_irqCpup = NULL; -LITE_OS_SEC_BSS STATIC UINT32 cpupMaxNum; +LITE_OS_SEC_BSS STATIC UINT16 cpupMaxNum; LITE_OS_SEC_BSS STATIC UINT16 cpupHisPos = 0; /* current Sampling point of historyTime */ LITE_OS_SEC_BSS STATIC UINT64 cpuHistoryTime[OS_CPUP_HISTORY_RECORD_NUM + 1]; -LITE_OS_SEC_BSS STATIC LosTaskCB *runningTasks[LOSCFG_KERNEL_CORE_NUM]; +LITE_OS_SEC_BSS STATIC UINT32 runningTasks[LOSCFG_KERNEL_CORE_NUM]; LITE_OS_SEC_BSS STATIC UINT64 cpupStartCycles = 0; #ifdef LOSCFG_CPUP_INCLUDE_IRQ LITE_OS_SEC_BSS UINT64 timeInIrqSwitch[LOSCFG_KERNEL_CORE_NUM]; @@ -86,8 +85,10 @@ LITE_OS_SEC_TEXT_INIT VOID OsCpupGuard(VOID) { UINT16 prevPos; UINT32 loop; + UINT32 runTaskID; UINT32 intSave; UINT64 cycle, cycleIncrement; + LosTaskCB *taskCB = NULL; LosProcessCB *processCB = NULL; SCHEDULER_LOCK(intSave); @@ -99,15 +100,12 @@ LITE_OS_SEC_TEXT_INIT VOID OsCpupGuard(VOID) #ifdef LOSCFG_CPUP_INCLUDE_IRQ for (loop = 0; loop < cpupMaxNum; loop++) { - if (g_irqCpup[loop].status == OS_CPUP_UNUSED) { - continue; - } g_irqCpup[loop].cpup.historyTime[prevPos] = g_irqCpup[loop].cpup.allTime; } #endif for (loop = 0; loop < g_processMaxNum; loop++) { - processCB = OS_PCB_FROM_RPID(loop); + processCB = OS_PCB_FROM_PID(loop); if (processCB->processCpup == NULL) { continue; } @@ -115,27 +113,26 @@ LITE_OS_SEC_TEXT_INIT VOID OsCpupGuard(VOID) } for (loop = 0; loop < g_taskMaxNum; loop++) { - LosTaskCB *taskCB = OS_TCB_FROM_RTID(loop); + taskCB = OS_TCB_FROM_TID(loop); taskCB->taskCpup.historyTime[prevPos] = taskCB->taskCpup.allTime; } for (loop = 0; loop < LOSCFG_KERNEL_CORE_NUM; loop++) { - LosTaskCB *runTask = runningTasks[loop]; - if (runTask == NULL) { + runTaskID = runningTasks[loop]; + if (runTaskID == INVALID_ID) { continue; } + taskCB = OS_TCB_FROM_TID(runTaskID); /* reacquire the cycle to prevent flip */ cycle = OsGetCpuCycle(); - cycleIncrement = cycle - runTask->taskCpup.startTime; + cycleIncrement = cycle - taskCB->taskCpup.startTime; #ifdef LOSCFG_CPUP_INCLUDE_IRQ cycleIncrement -= timeInIrqSwitch[loop]; #endif - runTask->taskCpup.historyTime[prevPos] += cycleIncrement; - processCB = OS_PCB_FROM_TCB(runTask); - if (processCB->processCpup != NULL) { - processCB->processCpup->historyTime[prevPos] += cycleIncrement; - } + taskCB->taskCpup.historyTime[prevPos] += cycleIncrement; + processCB = OS_PCB_FROM_PID(taskCB->processID); + processCB->processCpup->historyTime[prevPos] += cycleIncrement; } SCHEDULER_UNLOCK(intSave); @@ -163,7 +160,7 @@ LITE_OS_SEC_TEXT_INIT UINT32 OsCpupInit(VOID) #ifdef LOSCFG_CPUP_INCLUDE_IRQ UINT32 size; - cpupMaxNum = OS_HWI_MAX_NUM * LOSCFG_KERNEL_CORE_NUM; + cpupMaxNum = OS_HWI_MAX_NUM; /* every process has only one record, and it won't operated at the same time */ size = cpupMaxNum * sizeof(OsIrqCpupCB); @@ -177,7 +174,7 @@ LITE_OS_SEC_TEXT_INIT UINT32 OsCpupInit(VOID) #endif for (loop = 0; loop < LOSCFG_KERNEL_CORE_NUM; loop++) { - runningTasks[loop] = NULL; + runningTasks[loop] = INVALID_ID; } cpupInitFlg = 1; return LOS_OK; @@ -230,7 +227,6 @@ LITE_OS_SEC_TEXT_INIT VOID LOS_CpupReset(VOID) if (g_irqCpup != NULL) { for (index = 0; index < cpupMaxNum; index++) { OsResetCpup(&g_irqCpup[index].cpup, cycle); - g_irqCpup[index].timeMax = 0; } for (index = 0; index < LOSCFG_KERNEL_CORE_NUM; index++) { @@ -246,14 +242,15 @@ LITE_OS_SEC_TEXT_INIT VOID LOS_CpupReset(VOID) return; } -VOID OsCpupCycleEndStart(LosTaskCB *runTask, LosTaskCB *newTask) +VOID OsCpupCycleEndStart(UINT32 runTaskID, UINT32 newTaskID) { /* OsCurrTaskGet and OsCurrProcessGet are not allowed to be called. */ + LosTaskCB *runTask = OS_TCB_FROM_TID(runTaskID); OsCpupBase *runTaskCpup = &runTask->taskCpup; - OsCpupBase *newTaskCpup = &newTask->taskCpup; - OsCpupBase *processCpup = OS_PCB_FROM_TCB(runTask)->processCpup; + OsCpupBase *newTaskCpup = (OsCpupBase *)&(OS_TCB_FROM_TID(newTaskID)->taskCpup); + OsCpupBase *processCpup = OS_PCB_FROM_PID(runTask->processID)->processCpup; UINT64 cpuCycle, cycleIncrement; - UINT16 cpuid = ArchCurrCpuid(); + UINT16 cpuID = ArchCurrCpuid(); if (cpupInitFlg == 0) { return; @@ -263,8 +260,8 @@ VOID OsCpupCycleEndStart(LosTaskCB *runTask, LosTaskCB *newTask) if (runTaskCpup->startTime != 0) { cycleIncrement = cpuCycle - runTaskCpup->startTime; #ifdef LOSCFG_CPUP_INCLUDE_IRQ - cycleIncrement -= timeInIrqSwitch[cpuid]; - timeInIrqSwitch[cpuid] = 0; + cycleIncrement -= timeInIrqSwitch[cpuID]; + timeInIrqSwitch[cpuID] = 0; #endif runTaskCpup->allTime += cycleIncrement; if (processCpup != NULL) { @@ -274,7 +271,7 @@ VOID OsCpupCycleEndStart(LosTaskCB *runTask, LosTaskCB *newTask) } newTaskCpup->startTime = cpuCycle; - runningTasks[cpuid] = newTask; + runningTasks[cpuID] = newTaskID; } LITE_OS_SEC_TEXT_MINOR STATIC VOID OsCpupGetPos(UINT16 mode, UINT16 *curPosPointer, UINT16 *prePosPointer) @@ -326,6 +323,7 @@ STATIC UINT32 OsHistorySysCpuUsageUnsafe(UINT16 mode) UINT64 cpuAllCycle; UINT16 pos; UINT16 prePos; + UINT32 idleProcessID; OsCpupBase *processCpup = NULL; if (cpupInitFlg == 0) { @@ -335,7 +333,8 @@ STATIC UINT32 OsHistorySysCpuUsageUnsafe(UINT16 mode) OsCpupGetPos(mode, &pos, &prePos); cpuAllCycle = cpuHistoryTime[pos] - cpuHistoryTime[prePos]; - processCpup = OS_PCB_FROM_PID(OS_KERNEL_IDLE_PROCESS_ID)->processCpup; + idleProcessID = OsGetIdleProcessID(); + processCpup = OS_PCB_FROM_PID(idleProcessID)->processCpup; return (LOS_CPUP_PRECISION - OsCalculateCpupUsage(processCpup, pos, prePos, cpuAllCycle)); } @@ -441,7 +440,7 @@ STATIC UINT32 OsCpupUsageParamCheckAndReset(CPUP_INFO_S *cpupInfo, UINT32 len, U return LOS_OK; } -STATIC UINT32 GetAllProcessCpuUsageUnsafe(UINT16 mode, CPUP_INFO_S *cpupInfo, UINT32 len) +LITE_OS_SEC_TEXT_MINOR UINT32 OsGetAllProcessCpuUsageUnsafe(UINT16 mode, CPUP_INFO_S *cpupInfo, UINT32 len) { LosProcessCB *processCB = NULL; UINT64 cpuAllCycle; @@ -476,91 +475,76 @@ LITE_OS_SEC_TEXT_MINOR UINT32 LOS_GetAllProcessCpuUsage(UINT16 mode, CPUP_INFO_S UINT32 ret; SCHEDULER_LOCK(intSave); - ret = GetAllProcessCpuUsageUnsafe(mode, cpupInfo, len); + ret = OsGetAllProcessCpuUsageUnsafe(mode, cpupInfo, len); SCHEDULER_UNLOCK(intSave); return ret; } -UINT32 OsGetProcessAllCpuUsageUnsafe(OsCpupBase *processCpup, ProcessInfo *processInfo) +LITE_OS_SEC_TEXT_MINOR UINT32 OsGetAllProcessAndTaskCpuUsageUnsafe(UINT16 mode, CPUP_INFO_S *cpupInfo, UINT32 len) { UINT64 cpuAllCycle; UINT16 pos, prePos; - if ((processCpup == NULL) || (processInfo == NULL)) { - return LOS_ERRNO_CPUP_PTR_ERR; - } + UINT32 taskID; + UINT32 ret; + LosTaskCB *taskCB = NULL; + OsCpupBase *processCpupBase = NULL; + CPUP_INFO_S *processCpup = cpupInfo; + CPUP_INFO_S *taskCpup = (CPUP_INFO_S *)((UINTPTR)cpupInfo + sizeof(CPUP_INFO_S) * g_processMaxNum); - OsCpupGetPos(CPUP_LAST_ONE_SECONDS, &pos, &prePos); - cpuAllCycle = cpuHistoryTime[pos] - cpuHistoryTime[prePos]; - processInfo->cpup1sUsage = OsCalculateCpupUsage(processCpup, pos, prePos, cpuAllCycle); + ret = OsCpupUsageParamCheckAndReset(cpupInfo, len, g_taskMaxNum + g_processMaxNum); + if (ret != LOS_OK) { + return ret; + } - OsCpupGetPos(CPUP_LAST_TEN_SECONDS, &pos, &prePos); + OsCpupGetPos(mode, &pos, &prePos); cpuAllCycle = cpuHistoryTime[pos] - cpuHistoryTime[prePos]; - processInfo->cpup10sUsage = OsCalculateCpupUsage(processCpup, pos, prePos, cpuAllCycle); - OsCpupGetPos(CPUP_ALL_TIME, &pos, &prePos); - cpuAllCycle = cpuHistoryTime[pos] - cpuHistoryTime[prePos]; - processInfo->cpupAllsUsage = OsCalculateCpupUsage(processCpup, pos, prePos, cpuAllCycle); - return LOS_OK; -} + for (taskID = 0; taskID < g_taskMaxNum; taskID++) { + taskCB = OS_TCB_FROM_TID(taskID); + if (OsTaskIsUnused(taskCB)) { + continue; + } -UINT32 OsGetTaskAllCpuUsageUnsafe(OsCpupBase *taskCpup, TaskInfo *taskInfo) -{ - UINT64 cpuAllCycle; - UINT16 pos, prePos; - if ((taskCpup == NULL) || (taskInfo == NULL)) { - return LOS_ERRNO_CPUP_PTR_ERR; + taskCpup[taskID].usage = OsCalculateCpupUsage(&taskCB->taskCpup, pos, prePos, cpuAllCycle); + taskCpup[taskID].status = OS_CPUP_USED; + if (processCpup[taskCB->processID].status == OS_CPUP_UNUSED) { + processCpupBase = OS_PCB_FROM_PID(taskCB->processID)->processCpup; + if (processCpupBase != NULL) { + processCpup[taskCB->processID].usage = OsCalculateCpupUsage(processCpupBase, pos, prePos, cpuAllCycle); + processCpup[taskCB->processID].status = OS_CPUP_USED; + } + } } - OsCpupGetPos(CPUP_LAST_ONE_SECONDS, &pos, &prePos); - cpuAllCycle = cpuHistoryTime[pos] - cpuHistoryTime[prePos]; - taskInfo->cpup1sUsage = OsCalculateCpupUsage(taskCpup, pos, prePos, cpuAllCycle); - - OsCpupGetPos(CPUP_LAST_TEN_SECONDS, &pos, &prePos); - cpuAllCycle = cpuHistoryTime[pos] - cpuHistoryTime[prePos]; - taskInfo->cpup10sUsage = OsCalculateCpupUsage(taskCpup, pos, prePos, cpuAllCycle); - - OsCpupGetPos(CPUP_ALL_TIME, &pos, &prePos); - cpuAllCycle = cpuHistoryTime[pos] - cpuHistoryTime[prePos]; - taskInfo->cpupAllsUsage = OsCalculateCpupUsage(taskCpup, pos, prePos, cpuAllCycle); return LOS_OK; } #ifdef LOSCFG_CPUP_INCLUDE_IRQ -LITE_OS_SEC_TEXT_MINOR VOID OsCpupIrqStart(UINT16 cpuid) +LITE_OS_SEC_TEXT_MINOR VOID OsCpupIrqStart(VOID) { UINT32 high; UINT32 low; LOS_GetCpuCycle(&high, &low); - cpupIntTimeStart[cpuid] = ((UINT64)high << HIGH_BITS) + low; + cpupIntTimeStart[ArchCurrCpuid()] = ((UINT64)high << HIGH_BITS) + low; return; } -LITE_OS_SEC_TEXT_MINOR VOID OsCpupIrqEnd(UINT16 cpuid, UINT32 intNum) +LITE_OS_SEC_TEXT_MINOR VOID OsCpupIrqEnd(UINT32 intNum) { UINT32 high; UINT32 low; UINT64 intTimeEnd; - UINT64 usedTime; + UINT32 cpuID = ArchCurrCpuid(); LOS_GetCpuCycle(&high, &low); intTimeEnd = ((UINT64)high << HIGH_BITS) + low; - OsIrqCpupCB *irqCb = &g_irqCpup[(intNum * LOSCFG_KERNEL_CORE_NUM) + cpuid]; - irqCb->id = intNum; - irqCb->status = OS_CPUP_USED; - usedTime = intTimeEnd - cpupIntTimeStart[cpuid]; - timeInIrqSwitch[cpuid] += usedTime; - irqCb->cpup.allTime += usedTime; - if (irqCb->count <= 100) { /* Take 100 samples */ - irqCb->allTime += usedTime; - irqCb->count++; - } else { - irqCb->allTime = 0; - irqCb->count = 0; - } - if (usedTime > irqCb->timeMax) { - irqCb->timeMax = usedTime; - } + + g_irqCpup[intNum].id = intNum; + g_irqCpup[intNum].status = OS_CPUP_USED; + timeInIrqSwitch[cpuID] += (intTimeEnd - cpupIntTimeStart[cpuID]); + g_irqCpup[intNum].cpup.allTime += (intTimeEnd - cpupIntTimeStart[cpuID]); + return; } diff --git a/src/kernel_liteos_a/kernel/extended/cpup/los_cpup_pri.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/cpup/los_cpup_pri.h similarity index 82% rename from src/kernel_liteos_a/kernel/extended/cpup/los_cpup_pri.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/cpup/los_cpup_pri.h index 341997b9..fd0662e1 100644 --- a/src/kernel_liteos_a/kernel/extended/cpup/los_cpup_pri.h +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/cpup/los_cpup_pri.h @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2023 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -59,25 +59,19 @@ typedef struct { typedef struct { UINT32 id; /**< irq ID */ UINT16 status; /**< irq status */ - UINT64 allTime; - UINT64 timeMax; - UINT64 count; OsCpupBase cpup; /**< irq cpup base */ } OsIrqCpupCB; -typedef struct TagTaskCB LosTaskCB; -typedef struct TagTaskInfo TaskInfo; -typedef struct TagProcessInfo ProcessInfo; - extern UINT32 OsCpupInit(VOID); extern UINT32 OsCpupGuardCreator(VOID); -extern VOID OsCpupCycleEndStart(LosTaskCB *runTask, LosTaskCB *newTask); -extern UINT32 OsGetProcessAllCpuUsageUnsafe(OsCpupBase *processCpup, ProcessInfo *processInfo); -extern UINT32 OsGetTaskAllCpuUsageUnsafe(OsCpupBase *taskCpup, TaskInfo *taskInfo); +extern VOID OsCpupCycleEndStart(UINT32 runTaskID, UINT32 newTaskID); +extern UINT32 OsGetAllTaskCpuUsageUnsafe(UINT16 mode, CPUP_INFO_S *cpupInfo, UINT32 len); +extern UINT32 OsGetAllProcessCpuUsageUnsafe(UINT16 mode, CPUP_INFO_S *cpupInfo, UINT32 len); +extern UINT32 OsGetAllProcessAndTaskCpuUsageUnsafe(UINT16 mode, CPUP_INFO_S *cpupInfo, UINT32 len); #ifdef LOSCFG_CPUP_INCLUDE_IRQ extern UINT32 OsGetAllIrqCpuUsageUnsafe(UINT16 mode, CPUP_INFO_S *cpupInfo, UINT32 len); -extern VOID OsCpupIrqStart(UINT16); -extern VOID OsCpupIrqEnd(UINT16, UINT32); +extern VOID OsCpupIrqStart(VOID); +extern VOID OsCpupIrqEnd(UINT32); extern OsIrqCpupCB *OsGetIrqCpupArrayBase(VOID); #endif diff --git a/src/kernel_liteos_a/kernel/extended/dynload/BUILD.gn b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/dynload/BUILD.gn similarity index 100% rename from src/kernel_liteos_a/kernel/extended/dynload/BUILD.gn rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/dynload/BUILD.gn diff --git a/src/kernel_liteos_a/kernel/extended/dynload/Makefile b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/dynload/Makefile similarity index 100% rename from src/kernel_liteos_a/kernel/extended/dynload/Makefile rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/dynload/Makefile diff --git a/src/kernel_liteos_a/kernel/extended/dynload/include/los_elf_auxvec_pri.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/dynload/include/los_elf_auxvec_pri.h similarity index 100% rename from src/kernel_liteos_a/kernel/extended/dynload/include/los_elf_auxvec_pri.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/dynload/include/los_elf_auxvec_pri.h diff --git a/src/kernel_liteos_a/kernel/extended/dynload/include/los_exec_elf.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/dynload/include/los_exec_elf.h similarity index 100% rename from src/kernel_liteos_a/kernel/extended/dynload/include/los_exec_elf.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/dynload/include/los_exec_elf.h diff --git a/src/kernel_liteos_a/kernel/extended/dynload/include/los_ld_elf_pri.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/dynload/include/los_ld_elf_pri.h similarity index 100% rename from src/kernel_liteos_a/kernel/extended/dynload/include/los_ld_elf_pri.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/dynload/include/los_ld_elf_pri.h diff --git a/src/kernel_liteos_a/kernel/extended/dynload/include/los_load_elf.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/dynload/include/los_load_elf.h similarity index 100% rename from src/kernel_liteos_a/kernel/extended/dynload/include/los_load_elf.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/dynload/include/los_load_elf.h diff --git a/src/kernel_liteos_a/kernel/extended/dynload/src/los_exec_elf.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/dynload/src/los_exec_elf.c similarity index 100% rename from src/kernel_liteos_a/kernel/extended/dynload/src/los_exec_elf.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/dynload/src/los_exec_elf.c diff --git a/src/kernel_liteos_a/kernel/extended/dynload/src/los_load_elf.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/dynload/src/los_load_elf.c similarity index 99% rename from src/kernel_liteos_a/kernel/extended/dynload/src/los_load_elf.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/dynload/src/los_load_elf.c index 4fed46b4..a3851197 100644 --- a/src/kernel_liteos_a/kernel/extended/dynload/src/los_load_elf.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/dynload/src/los_load_elf.c @@ -51,7 +51,7 @@ STATIC BOOL g_srandInit; STATIC INT32 OsELFOpen(const CHAR *fileName, INT32 oflags) { - INT32 ret; + INT32 ret = -LOS_NOK; INT32 procFd; procFd = AllocProcessFd(); diff --git a/src/kernel_liteos_a/kernel/extended/hidumper/BUILD.gn b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/hidumper/BUILD.gn similarity index 100% rename from src/kernel_liteos_a/kernel/extended/hidumper/BUILD.gn rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/hidumper/BUILD.gn diff --git a/src/kernel_liteos_a/kernel/extended/hidumper/Kconfig b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/hidumper/Kconfig similarity index 100% rename from src/kernel_liteos_a/kernel/extended/hidumper/Kconfig rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/hidumper/Kconfig diff --git a/src/kernel_liteos_a/kernel/extended/hidumper/Makefile b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/hidumper/Makefile similarity index 100% rename from src/kernel_liteos_a/kernel/extended/hidumper/Makefile rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/hidumper/Makefile diff --git a/src/kernel_liteos_a/kernel/extended/hidumper/los_hidumper.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/hidumper/los_hidumper.c similarity index 100% rename from src/kernel_liteos_a/kernel/extended/hidumper/los_hidumper.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/hidumper/los_hidumper.c diff --git a/src/kernel_liteos_a/kernel/extended/hidumper/los_hidumper.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/hidumper/los_hidumper.h similarity index 100% rename from src/kernel_liteos_a/kernel/extended/hidumper/los_hidumper.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/hidumper/los_hidumper.h diff --git a/src/kernel_liteos_a/kernel/extended/hilog/BUILD.gn b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/hilog/BUILD.gn similarity index 91% rename from src/kernel_liteos_a/kernel/extended/hilog/BUILD.gn rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/hilog/BUILD.gn index 857a3c3c..b925ff76 100644 --- a/src/kernel_liteos_a/kernel/extended/hilog/BUILD.gn +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/hilog/BUILD.gn @@ -33,7 +33,7 @@ module_switch = defined(LOSCFG_BASE_CORE_HILOG) module_name = get_path_info(rebase_path("."), "name") kernel_module(module_name) { sources = [ - "$HIVIEWDFX_HILOG_LITE_DIR/frameworks/featured/hiview_log.c", + "//base/hiviewdfx/hilog_lite/frameworks/featured/hiview_log.c", "los_hilog.c", ] @@ -42,8 +42,8 @@ kernel_module(module_name) { config("public") { include_dirs = [ - "$HIVIEWDFX_HILOG_LITE_DIR/interfaces/native/kits", - "$HIVIEWDFX_HILOG_LITE_DIR/interfaces/native/kits/hilog", + "//base/hiviewdfx/hilog_lite/interfaces/native/kits", + "//base/hiviewdfx/hilog_lite/interfaces/native/kits/hilog", ".", ] } diff --git a/src/kernel_liteos_a/kernel/extended/hilog/Kconfig b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/hilog/Kconfig similarity index 100% rename from src/kernel_liteos_a/kernel/extended/hilog/Kconfig rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/hilog/Kconfig diff --git a/src/kernel_liteos_a/kernel/extended/hilog/Makefile b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/hilog/Makefile similarity index 100% rename from src/kernel_liteos_a/kernel/extended/hilog/Makefile rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/hilog/Makefile diff --git a/src/kernel_liteos_a/kernel/extended/hilog/los_hilog.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/hilog/los_hilog.c similarity index 94% rename from src/kernel_liteos_a/kernel/extended/hilog/los_hilog.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/hilog/los_hilog.c index 8ad4eb27..dd7c7c6f 100644 --- a/src/kernel_liteos_a/kernel/extended/hilog/los_hilog.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/hilog/los_hilog.c @@ -179,7 +179,7 @@ static ssize_t HiLogRead(struct file *filep, char *buffer, size_t bufLen) } if (bufLen < header.len + sizeof(header)) { - PRINTK("buffer too small,bufLen=%d, header.len=%d,%d\n", bufLen, header.len, header.hdrSize); + dprintf("buffer too small,bufLen=%d, header.len=%d,%d\n", bufLen, header.len, header.hdrSize); retval = -ENOMEM; goto out; } @@ -233,8 +233,14 @@ static int HiLogWriteRingBuffer(unsigned char *buffer, size_t bufLen) static void HiLogHeadInit(struct HiLogEntry *header, size_t len) { - struct timespec now = {0}; - (void)clock_gettime(CLOCK_REALTIME, &now); + struct timespec now; + int ret; + + ret = clock_gettime(CLOCK_REALTIME, &now); + if (ret != 0) { + dprintf("In %s line %d,clock_gettime fail\n", __FUNCTION__, __LINE__); + return; + } header->len = len; header->pid = LOS_GetCurrProcessID(); @@ -268,7 +274,7 @@ static void HiLogCoverOldLog(size_t bufLen) if (isLastTimeFull == 1 && isThisTimeFull == 0) { /* so we can only print one log if hilog ring buffer is full in a short time */ if (dropLogLines > 0) { - PRINTK("hilog ringbuffer full, drop %d line(s) log\n", dropLogLines); + dprintf("hilog ringbuffer full, drop %d line(s) log\n", dropLogLines); } isLastTimeFull = 0; dropLogLines = 0; @@ -313,7 +319,7 @@ out: wake_up_interruptible(&g_hiLogDev.wq); } if (retval < 0) { - PRINTK("write fail retval=%d\n", retval); + dprintf("write fail retval=%d\n", retval); } return retval; } @@ -322,7 +328,7 @@ static ssize_t HiLogWrite(struct file *filep, const char *buffer, size_t bufLen) { (void)filep; if (bufLen + sizeof(struct HiLogEntry) > HILOG_BUFFER) { - PRINTK("input too large\n"); + dprintf("input too large\n"); return -ENOMEM; } @@ -333,7 +339,7 @@ static void HiLogDeviceInit(void) { g_hiLogDev.buffer = LOS_MemAlloc((VOID *)OS_SYS_MEM_ADDR, HILOG_BUFFER); if (g_hiLogDev.buffer == NULL) { - PRINTK("In %s line %d,LOS_MemAlloc fail\n", __FUNCTION__, __LINE__); + dprintf("In %s line %d,LOS_MemAlloc fail\n", __FUNCTION__, __LINE__); } init_waitqueue_head(&g_hiLogDev.wq); diff --git a/src/kernel_liteos_a/kernel/extended/hilog/los_hilog.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/hilog/los_hilog.h similarity index 100% rename from src/kernel_liteos_a/kernel/extended/hilog/los_hilog.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/hilog/los_hilog.h diff --git a/src/kernel_liteos_a/kernel/extended/hook/BUILD.gn b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/hook/BUILD.gn similarity index 100% rename from src/kernel_liteos_a/kernel/extended/hook/BUILD.gn rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/hook/BUILD.gn diff --git a/src/kernel_liteos_a/kernel/extended/hook/Makefile b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/hook/Makefile similarity index 100% rename from src/kernel_liteos_a/kernel/extended/hook/Makefile rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/hook/Makefile diff --git a/src/kernel_liteos_a/kernel/extended/hook/include/los_hook_types.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/hook/include/los_hook_types.h similarity index 100% rename from src/kernel_liteos_a/kernel/extended/hook/include/los_hook_types.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/hook/include/los_hook_types.h diff --git a/src/kernel_liteos_a/kernel/extended/hook/include/los_hook_types_parse.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/hook/include/los_hook_types_parse.h similarity index 100% rename from src/kernel_liteos_a/kernel/extended/hook/include/los_hook_types_parse.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/hook/include/los_hook_types_parse.h diff --git a/src/kernel_liteos_a/kernel/extended/hook/los_hook.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/hook/los_hook.c similarity index 100% rename from src/kernel_liteos_a/kernel/extended/hook/los_hook.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/hook/los_hook.c diff --git a/src/kernel_liteos_a/kernel/extended/liteipc/BUILD.gn b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/liteipc/BUILD.gn similarity index 100% rename from src/kernel_liteos_a/kernel/extended/liteipc/BUILD.gn rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/liteipc/BUILD.gn diff --git a/src/kernel_liteos_a/kernel/extended/liteipc/Makefile b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/liteipc/Makefile similarity index 100% rename from src/kernel_liteos_a/kernel/extended/liteipc/Makefile rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/liteipc/Makefile diff --git a/src/kernel_liteos_a/kernel/extended/liteipc/hm_liteipc.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/liteipc/hm_liteipc.c similarity index 84% rename from src/kernel_liteos_a/kernel/extended/liteipc/hm_liteipc.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/liteipc/hm_liteipc.c index 2f2fbf71..4555a293 100644 --- a/src/kernel_liteos_a/kernel/extended/liteipc/hm_liteipc.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/liteipc/hm_liteipc.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2023 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -63,10 +63,6 @@ #define LITEIPC_TIMEOUT_MS 5000UL #define LITEIPC_TIMEOUT_NS 5000000000ULL -#define MAJOR_VERSION (2) -#define MINOR_VERSION (0) -#define DRIVER_VERSION (MAJOR_VERSION | MINOR_VERSION << 16) - typedef struct { LOS_DL_LIST list; VOID *ptr; @@ -316,6 +312,7 @@ STATIC VOID LiteIpcPoolDelete(ProcIpcInfo *ipcInfo, UINT32 processID) LITE_OS_SEC_TEXT UINT32 LiteIpcPoolDestroy(UINT32 processID) { LosProcessCB *pcb = OS_PCB_FROM_PID(processID); + if (pcb->ipcInfo == NULL) { return LOS_NOK; } @@ -339,10 +336,10 @@ LITE_OS_SEC_TEXT_INIT STATIC IpcTaskInfo *LiteIpcTaskInit(VOID) } /* Only when kernenl no longer access ipc node content, can user free the ipc node */ -LITE_OS_SEC_TEXT STATIC VOID EnableIpcNodeFreeByUser(LosProcessCB *pcb, VOID *buf) +LITE_OS_SEC_TEXT STATIC VOID EnableIpcNodeFreeByUser(UINT32 processID, VOID *buf) { UINT32 intSave; - ProcIpcInfo *ipcInfo = pcb->ipcInfo; + ProcIpcInfo *ipcInfo = OS_PCB_FROM_PID(processID)->ipcInfo; IpcUsedNode *node = (IpcUsedNode *)malloc(sizeof(IpcUsedNode)); if (node != NULL) { node->ptr = buf; @@ -352,26 +349,26 @@ LITE_OS_SEC_TEXT STATIC VOID EnableIpcNodeFreeByUser(LosProcessCB *pcb, VOID *bu } } -LITE_OS_SEC_TEXT STATIC VOID *LiteIpcNodeAlloc(LosProcessCB *pcb, UINT32 size) +LITE_OS_SEC_TEXT STATIC VOID *LiteIpcNodeAlloc(UINT32 processID, UINT32 size) { - VOID *ptr = LOS_MemAlloc(pcb->ipcInfo->pool.kvaddr, size); + VOID *ptr = LOS_MemAlloc(OS_PCB_FROM_PID(processID)->ipcInfo->pool.kvaddr, size); PRINT_INFO("LiteIpcNodeAlloc pid:%d, pool:%x buf:%x size:%d\n", - pcb->processID, pcb->ipcInfo->pool.kvaddr, ptr, size); + processID, OS_PCB_FROM_PID(processID)->ipcInfo->pool.kvaddr, ptr, size); return ptr; } -LITE_OS_SEC_TEXT STATIC UINT32 LiteIpcNodeFree(LosProcessCB *pcb, VOID *buf) +LITE_OS_SEC_TEXT STATIC UINT32 LiteIpcNodeFree(UINT32 processID, VOID *buf) { PRINT_INFO("LiteIpcNodeFree pid:%d, pool:%x buf:%x\n", - pcb->processID, pcb->ipcInfo->pool.kvaddr, buf); - return LOS_MemFree(pcb->ipcInfo->pool.kvaddr, buf); + processID, OS_PCB_FROM_PID(processID)->ipcInfo->pool.kvaddr, buf); + return LOS_MemFree(OS_PCB_FROM_PID(processID)->ipcInfo->pool.kvaddr, buf); } -LITE_OS_SEC_TEXT STATIC BOOL IsIpcNode(LosProcessCB *pcb, const VOID *buf) +LITE_OS_SEC_TEXT STATIC BOOL IsIpcNode(UINT32 processID, const VOID *buf) { IpcUsedNode *node = NULL; UINT32 intSave; - ProcIpcInfo *ipcInfo = pcb->ipcInfo; + ProcIpcInfo *ipcInfo = OS_PCB_FROM_PID(processID)->ipcInfo; IPC_LOCK(intSave); LOS_DL_LIST_FOR_EACH_ENTRY(node, &ipcInfo->ipcUsedNodelist, IpcUsedNode, list) { if (node->ptr == buf) { @@ -385,16 +382,16 @@ LITE_OS_SEC_TEXT STATIC BOOL IsIpcNode(LosProcessCB *pcb, const VOID *buf) return FALSE; } -LITE_OS_SEC_TEXT STATIC INTPTR GetIpcUserAddr(const LosProcessCB *pcb, INTPTR kernelAddr) +LITE_OS_SEC_TEXT STATIC INTPTR GetIpcUserAddr(UINT32 processID, INTPTR kernelAddr) { - IpcPool pool = pcb->ipcInfo->pool; + IpcPool pool = OS_PCB_FROM_PID(processID)->ipcInfo->pool; INTPTR offset = (INTPTR)(pool.uvaddr) - (INTPTR)(pool.kvaddr); return kernelAddr + offset; } -LITE_OS_SEC_TEXT STATIC INTPTR GetIpcKernelAddr(const LosProcessCB *pcb, INTPTR userAddr) +LITE_OS_SEC_TEXT STATIC INTPTR GetIpcKernelAddr(UINT32 processID, INTPTR userAddr) { - IpcPool pool = pcb->ipcInfo->pool; + IpcPool pool = OS_PCB_FROM_PID(processID)->ipcInfo->pool; INTPTR offset = (INTPTR)(pool.uvaddr) - (INTPTR)(pool.kvaddr); return userAddr - offset; } @@ -408,8 +405,8 @@ LITE_OS_SEC_TEXT STATIC UINT32 CheckUsedBuffer(const VOID *node, IpcListNode **o ((INTPTR)node > (INTPTR)(pool.uvaddr) + pool.poolSize)) { return -EINVAL; } - ptr = (VOID *)GetIpcKernelAddr(pcb, (INTPTR)(node)); - if (IsIpcNode(pcb, ptr) != TRUE) { + ptr = (VOID *)GetIpcKernelAddr(pcb->processID, (INTPTR)(node)); + if (IsIpcNode(pcb->processID, ptr) != TRUE) { return -EFAULT; } *outPtr = (IpcListNode *)ptr; @@ -482,14 +479,14 @@ LITE_OS_SEC_TEXT STATIC UINT32 AddServiceAccess(UINT32 taskID, UINT32 serviceHan PRINT_ERR("Liteipc AddServiceAccess GetTid failed\n"); return ret; } - LosTaskCB *tcb = OS_TCB_FROM_TID(serviceTid); - LosProcessCB *pcb = OS_PCB_FROM_TID(taskID); + UINT32 processID = OS_TCB_FROM_TID(taskID)->processID; + LosProcessCB *pcb = OS_PCB_FROM_PID(processID); if ((tcb->ipcTaskInfo == NULL) || (pcb->ipcInfo == NULL)) { - PRINT_ERR("Liteipc AddServiceAccess ipc not create! pid %u tid %u\n", pcb->processID, tcb->taskID); + PRINT_ERR("Liteipc AddServiceAccess ipc not create! pid %u tid %u\n", processID, tcb->taskID); return -EINVAL; } - tcb->ipcTaskInfo->accessMap[pcb->processID] = TRUE; + tcb->ipcTaskInfo->accessMap[processID] = TRUE; pcb->ipcInfo->access[serviceTid] = TRUE; return LOS_OK; } @@ -497,7 +494,7 @@ LITE_OS_SEC_TEXT STATIC UINT32 AddServiceAccess(UINT32 taskID, UINT32 serviceHan LITE_OS_SEC_TEXT STATIC BOOL HasServiceAccess(UINT32 serviceHandle) { UINT32 serviceTid = 0; - LosProcessCB *curr = OsCurrProcessGet(); + UINT32 curProcessID = LOS_GetCurrProcessID(); UINT32 ret; if (serviceHandle >= MAX_SERVICE_NUM) { return FALSE; @@ -510,16 +507,15 @@ LITE_OS_SEC_TEXT STATIC BOOL HasServiceAccess(UINT32 serviceHandle) PRINT_ERR("Liteipc HasServiceAccess GetTid failed\n"); return FALSE; } - LosTaskCB *taskCB = OS_TCB_FROM_TID(serviceTid); - if (taskCB->processCB == (UINTPTR)curr) { + if (OS_TCB_FROM_TID(serviceTid)->processID == curProcessID) { return TRUE; } - if (taskCB->ipcTaskInfo == NULL) { + if (OS_TCB_FROM_TID(serviceTid)->ipcTaskInfo == NULL) { return FALSE; } - return taskCB->ipcTaskInfo->accessMap[curr->processID]; + return OS_TCB_FROM_TID(serviceTid)->ipcTaskInfo->accessMap[curProcessID]; } LITE_OS_SEC_TEXT STATIC UINT32 SetIpcTask(VOID) @@ -540,12 +536,12 @@ LITE_OS_SEC_TEXT BOOL IsIpcTaskSet(VOID) return TRUE; } -LITE_OS_SEC_TEXT STATIC UINT32 GetIpcTaskID(LosProcessCB *pcb, UINT32 *ipcTaskID) +LITE_OS_SEC_TEXT STATIC UINT32 GetIpcTaskID(UINT32 processID, UINT32 *ipcTaskID) { - if (pcb->ipcInfo->ipcTaskID == INVAILD_ID) { + if (OS_PCB_FROM_PID(processID)->ipcInfo->ipcTaskID == INVAILD_ID) { return LOS_NOK; } - *ipcTaskID = pcb->ipcInfo->ipcTaskID; + *ipcTaskID = OS_PCB_FROM_PID(processID)->ipcInfo->ipcTaskID; return LOS_OK; } @@ -563,7 +559,7 @@ LITE_OS_SEC_TEXT STATIC UINT32 SendDeathMsg(UINT32 processID, UINT32 serviceHand pcb->ipcInfo->access[serviceHandle] = FALSE; - ret = GetIpcTaskID(pcb, &ipcTaskID); + ret = GetIpcTaskID(processID, &ipcTaskID); if (ret != LOS_OK) { return -EINVAL; } @@ -592,7 +588,7 @@ LITE_OS_SEC_TEXT VOID LiteIpcRemoveServiceHandle(UINT32 taskID) LOS_DL_LIST *listHead = NULL; LOS_DL_LIST *listNode = NULL; IpcListNode *node = NULL; - LosProcessCB *pcb = OS_PCB_FROM_TCB(taskCB); + UINT32 processID = taskCB->processID; listHead = &(ipcTaskInfo->msgListHead); do { @@ -606,12 +602,12 @@ LITE_OS_SEC_TEXT VOID LiteIpcRemoveServiceHandle(UINT32 taskID) node = LOS_DL_LIST_ENTRY(listNode, IpcListNode, listNode); SCHEDULER_UNLOCK(intSave); (VOID)HandleSpecialObjects(taskCB->taskID, node, TRUE); - (VOID)LiteIpcNodeFree(pcb, (VOID *)node); + (VOID)LiteIpcNodeFree(processID, (VOID *)node); } } while (1); - ipcTaskInfo->accessMap[pcb->processID] = FALSE; - for (j = 0; j < LOSCFG_BASE_CORE_PROCESS_LIMIT; j++) { + ipcTaskInfo->accessMap[processID] = FALSE; + for (j = 0; j < MAX_SERVICE_NUM; j++) { if (ipcTaskInfo->accessMap[j] == TRUE) { ipcTaskInfo->accessMap[j] = FALSE; (VOID)SendDeathMsg(j, taskCB->taskID); @@ -629,7 +625,7 @@ LITE_OS_SEC_TEXT VOID LiteIpcRemoveServiceHandle(UINT32 taskID) (VOID)LOS_MuxUnlock(&g_serviceHandleMapMux); /* run deathHandler */ if (i < MAX_SERVICE_NUM) { - for (j = 0; j < LOSCFG_BASE_CORE_PROCESS_LIMIT; j++) { + for (j = 0; j < MAX_SERVICE_NUM; j++) { if (ipcTaskInfo->accessMap[j] == TRUE) { (VOID)SendDeathMsg(j, i); } @@ -685,10 +681,10 @@ LITE_OS_SEC_TEXT STATIC BOOL IsCmsTask(UINT32 taskID) BOOL ret; (VOID)LOS_MuxLock(&g_serviceHandleMapMux, LOS_WAIT_FOREVER); #if (USE_TASKID_AS_HANDLE == 1) - ret = IsCmsSet() ? (OS_TCB_FROM_TID(taskID)->processCB == OS_TCB_FROM_TID(g_cmsTask.taskID)->processCB) : FALSE; + ret = IsCmsSet() ? (OS_TCB_FROM_TID(taskID)->processID == OS_TCB_FROM_TID(g_cmsTask.taskID)->processID) : FALSE; #else - ret = IsCmsSet() ? (OS_TCB_FROM_TID(taskID)->processCB == - OS_TCB_FROM_TID(g_serviceHandleMap[0].taskID)->processCB) : FALSE; + ret = IsCmsSet() ? (OS_TCB_FROM_TID(taskID)->processID == + OS_TCB_FROM_TID(g_serviceHandleMap[0].taskID)->processID) : FALSE; #endif (VOID)LOS_MuxUnlock(&g_serviceHandleMapMux); return ret; @@ -701,29 +697,29 @@ LITE_OS_SEC_TEXT STATIC BOOL IsTaskAlive(UINT32 taskID) return FALSE; } tcb = OS_TCB_FROM_TID(taskID); - if (OsTaskIsUnused(tcb)) { + if (!OsTaskIsUserMode(tcb)) { return FALSE; } - if (OsTaskIsInactive(tcb)) { + if (OsTaskIsUnused(tcb)) { return FALSE; } - if (!OsTaskIsUserMode(tcb)) { + if (OsTaskIsInactive(tcb)) { return FALSE; } return TRUE; } -LITE_OS_SEC_TEXT STATIC UINT32 HandleFd(const LosProcessCB *pcb, SpecialObj *obj, BOOL isRollback) +LITE_OS_SEC_TEXT STATIC UINT32 HandleFd(UINT32 processID, SpecialObj *obj, BOOL isRollback) { int ret; if (isRollback == FALSE) { - ret = CopyFdToProc(obj->content.fd, pcb->processID); + ret = CopyFdToProc(obj->content.fd, processID); if (ret < 0) { return ret; } obj->content.fd = ret; } else { - ret = CloseProcFd(obj->content.fd, pcb->processID); + ret = CloseProcFd(obj->content.fd, processID); if (ret < 0) { return ret; } @@ -732,7 +728,7 @@ LITE_OS_SEC_TEXT STATIC UINT32 HandleFd(const LosProcessCB *pcb, SpecialObj *obj return LOS_OK; } -LITE_OS_SEC_TEXT STATIC UINT32 HandlePtr(LosProcessCB *pcb, SpecialObj *obj, BOOL isRollback) +LITE_OS_SEC_TEXT STATIC UINT32 HandlePtr(UINT32 processID, SpecialObj *obj, BOOL isRollback) { VOID *buf = NULL; UINT32 ret; @@ -744,63 +740,40 @@ LITE_OS_SEC_TEXT STATIC UINT32 HandlePtr(LosProcessCB *pcb, SpecialObj *obj, BOO PRINT_ERR("Liteipc Bad ptr address\n"); return -EINVAL; } - buf = LiteIpcNodeAlloc(pcb, obj->content.ptr.buffSz); + buf = LiteIpcNodeAlloc(processID, obj->content.ptr.buffSz); if (buf == NULL) { PRINT_ERR("Liteipc DealPtr alloc mem failed\n"); return -EINVAL; } ret = copy_from_user(buf, obj->content.ptr.buff, obj->content.ptr.buffSz); if (ret != LOS_OK) { - LiteIpcNodeFree(pcb, buf); + LiteIpcNodeFree(processID, buf); return ret; } - obj->content.ptr.buff = (VOID *)GetIpcUserAddr(pcb, (INTPTR)buf); - EnableIpcNodeFreeByUser(pcb, (VOID *)buf); + obj->content.ptr.buff = (VOID *)GetIpcUserAddr(processID, (INTPTR)buf); + EnableIpcNodeFreeByUser(processID, (VOID *)buf); } else { - (VOID)LiteIpcNodeFree(pcb, (VOID *)GetIpcKernelAddr(pcb, (INTPTR)obj->content.ptr.buff)); + (VOID)LiteIpcNodeFree(processID, (VOID *)GetIpcKernelAddr(processID, (INTPTR)obj->content.ptr.buff)); } return LOS_OK; } -LITE_OS_SEC_TEXT STATIC UINT32 HandleSvc(UINT32 dstTid, SpecialObj *obj, BOOL isRollback) +LITE_OS_SEC_TEXT STATIC UINT32 HandleSvc(UINT32 dstTid, const SpecialObj *obj, BOOL isRollback) { UINT32 taskID = 0; if (isRollback == FALSE) { - if (obj->content.svc.handle == -1) { - if (obj->content.svc.token != 1) { - PRINT_ERR("Liteipc HandleSvc wrong svc token\n"); - return -EINVAL; - } - UINT32 selfTid = LOS_CurTaskIDGet(); - LosTaskCB *tcb = OS_TCB_FROM_TID(selfTid); - if (tcb->ipcTaskInfo == NULL) { - tcb->ipcTaskInfo = LiteIpcTaskInit(); - } - uint32_t serviceHandle = 0; - UINT32 ret = GenerateServiceHandle(selfTid, HANDLE_REGISTED, &serviceHandle); - if (ret != LOS_OK) { - PRINT_ERR("Liteipc GenerateServiceHandle failed.\n"); - return ret; - } - obj->content.svc.handle = serviceHandle; - (VOID)LOS_MuxLock(&g_serviceHandleMapMux, LOS_WAIT_FOREVER); - AddServiceAccess(dstTid, serviceHandle); - (VOID)LOS_MuxUnlock(&g_serviceHandleMapMux); - } if (IsTaskAlive(obj->content.svc.handle) == FALSE) { PRINT_ERR("Liteipc HandleSvc wrong svctid\n"); return -EINVAL; } if (HasServiceAccess(obj->content.svc.handle) == FALSE) { - PRINT_ERR("Liteipc %s, %d, svchandle:%d, tid:%d\n", __FUNCTION__, __LINE__, obj->content.svc.handle, LOS_CurTaskIDGet()); + PRINT_ERR("Liteipc %s, %d\n", __FUNCTION__, __LINE__); return -EACCES; } - LosTaskCB *taskCb = OS_TCB_FROM_TID(obj->content.svc.handle); - if (taskCb->ipcTaskInfo == NULL) { - taskCb->ipcTaskInfo = LiteIpcTaskInit(); - } if (GetTid(obj->content.svc.handle, &taskID) == 0) { - AddServiceAccess(dstTid, obj->content.svc.handle); + if (taskID == OS_PCB_FROM_PID(OS_TCB_FROM_TID(taskID)->processID)->ipcInfo->ipcTaskID) { + AddServiceAccess(dstTid, obj->content.svc.handle); + } } } return LOS_OK; @@ -809,16 +782,16 @@ LITE_OS_SEC_TEXT STATIC UINT32 HandleSvc(UINT32 dstTid, SpecialObj *obj, BOOL is LITE_OS_SEC_TEXT STATIC UINT32 HandleObj(UINT32 dstTid, SpecialObj *obj, BOOL isRollback) { UINT32 ret; - LosProcessCB *pcb = OS_PCB_FROM_TID(dstTid); + UINT32 processID = OS_TCB_FROM_TID(dstTid)->processID; switch (obj->type) { case OBJ_FD: - ret = HandleFd(pcb, obj, isRollback); + ret = HandleFd(processID, obj, isRollback); break; case OBJ_PTR: - ret = HandlePtr(pcb, obj, isRollback); + ret = HandlePtr(processID, obj, isRollback); break; case OBJ_SVC: - ret = HandleSvc(dstTid, (SpecialObj *)obj, isRollback); + ret = HandleSvc(dstTid, (const SpecialObj *)obj, isRollback); break; default: ret = -EINVAL; @@ -892,7 +865,7 @@ LITE_OS_SEC_TEXT STATIC UINT32 CheckMsgSize(IpcMsg *msg) totalSize += obj->content.ptr.buffSz; } } - (VOID)LOS_MuxLock(&g_serviceHandleMapMux, LOS_WAIT_FOREVER); + (VOID)LOS_MuxUnlock(&g_serviceHandleMapMux); if (totalSize > g_cmsTask.maxMsgSize) { (VOID)LOS_MuxUnlock(&g_serviceHandleMapMux); return -EINVAL; @@ -947,8 +920,8 @@ LITE_OS_SEC_TEXT STATIC UINT32 CopyDataFromUser(IpcListNode *node, UINT32 bufSz, LITE_OS_SEC_TEXT STATIC BOOL IsValidReply(const IpcContent *content) { - LosProcessCB *curr = OsCurrProcessGet(); - IpcListNode *node = (IpcListNode *)GetIpcKernelAddr(curr, (INTPTR)(content->buffToFree)); + UINT32 curProcessID = LOS_GetCurrProcessID(); + IpcListNode *node = (IpcListNode *)GetIpcKernelAddr(curProcessID, (INTPTR)(content->buffToFree)); IpcMsg *requestMsg = &node->msg; IpcMsg *replyMsg = content->outMsg; UINT32 reqDstTid = 0; @@ -958,7 +931,7 @@ LITE_OS_SEC_TEXT STATIC BOOL IsValidReply(const IpcContent *content) (replyMsg->timestamp != requestMsg->timestamp) || (replyMsg->target.handle != requestMsg->taskID) || (GetTid(requestMsg->target.handle, &reqDstTid) != 0) || - (OS_TCB_FROM_TID(reqDstTid)->processCB != (UINTPTR)curr)) { + (OS_TCB_FROM_TID(reqDstTid)->processID != curProcessID)) { return FALSE; } return TRUE; @@ -1011,7 +984,7 @@ LITE_OS_SEC_TEXT STATIC UINT32 CheckPara(IpcContent *content, UINT32 *dstTid) } #endif OsHookCall(LOS_HOOK_TYPE_IPC_WRITE_DROP, msg, *dstTid, - (*dstTid == INVAILD_ID) ? INVAILD_ID : OS_PCB_FROM_TID(*dstTid)->processID, 0); + (*dstTid == INVAILD_ID) ? INVAILD_ID : OS_TCB_FROM_TID(*dstTid)->processID, 0); PRINT_ERR("Liteipc A timeout reply, request timestamp:%lld, now:%lld\n", msg->timestamp, now); return -ETIME; } @@ -1025,7 +998,7 @@ LITE_OS_SEC_TEXT STATIC UINT32 CheckPara(IpcContent *content, UINT32 *dstTid) #endif break; default: - PRINT_DEBUG("Unknown msg type:%d\n", msg->type); + PRINT_DEBUG("Unknow msg type:%d\n", msg->type); return -EINVAL; } @@ -1048,14 +1021,14 @@ LITE_OS_SEC_TEXT STATIC UINT32 LiteIpcWrite(IpcContent *content) } LosTaskCB *tcb = OS_TCB_FROM_TID(dstTid); - LosProcessCB *pcb = OS_PCB_FROM_TCB(tcb); + LosProcessCB *pcb = OS_PCB_FROM_PID(tcb->processID); if (pcb->ipcInfo == NULL) { - PRINT_ERR("pid %u Liteipc not create\n", pcb->processID); + PRINT_ERR("pid %u Liteipc not create\n", tcb->processID); return -EINVAL; } UINT32 bufSz = sizeof(IpcListNode) + msg->dataSz + msg->spObjNum * sizeof(UINT32); - IpcListNode *buf = (IpcListNode *)LiteIpcNodeAlloc(pcb, bufSz); + IpcListNode *buf = (IpcListNode *)LiteIpcNodeAlloc(tcb->processID, bufSz); if (buf == NULL) { PRINT_ERR("%s, %d\n", __FUNCTION__, __LINE__); return -ENOMEM; @@ -1078,10 +1051,10 @@ LITE_OS_SEC_TEXT STATIC UINT32 LiteIpcWrite(IpcContent *content) /* add data to list and wake up dest task */ SCHEDULER_LOCK(intSave); LOS_ListTailInsert(&(tcb->ipcTaskInfo->msgListHead), &(buf->listNode)); - OsHookCall(LOS_HOOK_TYPE_IPC_WRITE, &buf->msg, dstTid, pcb->processID, tcb->waitFlag); + OsHookCall(LOS_HOOK_TYPE_IPC_WRITE, &buf->msg, dstTid, tcb->processID, tcb->waitFlag); if (tcb->waitFlag == OS_TASK_WAIT_LITEIPC) { OsTaskWakeClearPendMask(tcb); - tcb->ops->wake(tcb); + OsSchedTaskWake(tcb); SCHEDULER_UNLOCK(intSave); LOS_MpSchedule(OS_MP_CPU_ALL); LOS_Schedule(); @@ -1090,11 +1063,11 @@ LITE_OS_SEC_TEXT STATIC UINT32 LiteIpcWrite(IpcContent *content) } return LOS_OK; ERROR_COPY: - LiteIpcNodeFree(pcb, buf); + LiteIpcNodeFree(OS_TCB_FROM_TID(dstTid)->processID, buf); return ret; } -LITE_OS_SEC_TEXT STATIC UINT32 CheckReceivedMsg(IpcListNode *node, IpcContent *content, LosTaskCB *tcb) +LITE_OS_SEC_TEXT STATIC UINT32 CheckRecievedMsg(IpcListNode *node, IpcContent *content, LosTaskCB *tcb) { UINT32 ret = LOS_OK; if (node == NULL) { @@ -1117,13 +1090,13 @@ LITE_OS_SEC_TEXT STATIC UINT32 CheckReceivedMsg(IpcListNode *node, IpcContent *c } #if (USE_TIMESTAMP == 1) if (node->msg.timestamp != content->outMsg->timestamp) { - PRINT_ERR("Receive a unmatch reply, drop it\n"); + PRINT_ERR("Recieve a unmatch reply, drop it\n"); ret = -EINVAL; } #else if ((node->msg.code != content->outMsg->code) || (node->msg.target.token != content->outMsg->target.token)) { - PRINT_ERR("Receive a unmatch reply, drop it\n"); + PRINT_ERR("Recieve a unmatch reply, drop it\n"); ret = -EINVAL; } #endif @@ -1131,13 +1104,13 @@ LITE_OS_SEC_TEXT STATIC UINT32 CheckReceivedMsg(IpcListNode *node, IpcContent *c case MT_DEATH_NOTIFY: break; default: - PRINT_ERR("Unknown msg type:%d\n", node->msg.type); + PRINT_ERR("Unknow msg type:%d\n", node->msg.type); ret = -EINVAL; } if (ret != LOS_OK) { OsHookCall(LOS_HOOK_TYPE_IPC_READ_DROP, &node->msg, tcb->waitFlag); (VOID)HandleSpecialObjects(LOS_CurTaskIDGet(), node, TRUE); - (VOID)LiteIpcNodeFree(OsCurrProcessGet(), (VOID *)node); + (VOID)LiteIpcNodeFree(LOS_GetCurrProcessID(), (VOID *)node); } else { OsHookCall(LOS_HOOK_TYPE_IPC_READ, &node->msg, tcb->waitFlag); } @@ -1165,7 +1138,7 @@ LITE_OS_SEC_TEXT STATIC UINT32 LiteIpcRead(IpcContent *content) if (LOS_ListEmpty(listHead)) { OsTaskWaitSetPendMask(OS_TASK_WAIT_LITEIPC, OS_INVALID_VALUE, timeout); OsHookCall(LOS_HOOK_TYPE_IPC_TRY_READ, syncFlag ? MT_REPLY : MT_REQUEST, tcb->waitFlag); - ret = tcb->ops->wait(tcb, &g_ipcPendlist, timeout); + ret = OsSchedTaskWait(&g_ipcPendlist, timeout, TRUE); if (ret == LOS_ERRNO_TSK_TIMEOUT) { OsHookCall(LOS_HOOK_TYPE_IPC_READ_TIMEOUT, syncFlag ? MT_REPLY : MT_REQUEST, tcb->waitFlag); SCHEDULER_UNLOCK(intSave); @@ -1184,7 +1157,7 @@ LITE_OS_SEC_TEXT STATIC UINT32 LiteIpcRead(IpcContent *content) LOS_ListDelete(listNode); node = LOS_DL_LIST_ENTRY(listNode, IpcListNode, listNode); SCHEDULER_UNLOCK(intSave); - ret = CheckReceivedMsg(node, content, tcb); + ret = CheckRecievedMsg(node, content, tcb); if (ret == LOS_OK) { break; } @@ -1193,10 +1166,10 @@ LITE_OS_SEC_TEXT STATIC UINT32 LiteIpcRead(IpcContent *content) } } } while (1); - node->msg.data = (VOID *)GetIpcUserAddr(OsCurrProcessGet(), (INTPTR)(node->msg.data)); - node->msg.offsets = (VOID *)GetIpcUserAddr(OsCurrProcessGet(), (INTPTR)(node->msg.offsets)); - content->inMsg = (VOID *)GetIpcUserAddr(OsCurrProcessGet(), (INTPTR)(&(node->msg))); - EnableIpcNodeFreeByUser(OsCurrProcessGet(), (VOID *)node); + node->msg.data = (VOID *)GetIpcUserAddr(LOS_GetCurrProcessID(), (INTPTR)(node->msg.data)); + node->msg.offsets = (VOID *)GetIpcUserAddr(LOS_GetCurrProcessID(), (INTPTR)(node->msg.offsets)); + content->inMsg = (VOID *)GetIpcUserAddr(LOS_GetCurrProcessID(), (INTPTR)(&(node->msg))); + EnableIpcNodeFreeByUser(LOS_GetCurrProcessID(), (VOID *)node); return LOS_OK; } @@ -1247,7 +1220,7 @@ LITE_OS_SEC_TEXT STATIC UINT32 LiteIpcMsgHandle(IpcContent *con) } BUFFER_FREE: if (nodeNeedFree != NULL) { - UINT32 freeRet = LiteIpcNodeFree(OsCurrProcessGet(), nodeNeedFree); + UINT32 freeRet = LiteIpcNodeFree(LOS_GetCurrProcessID(), nodeNeedFree); ret = (freeRet == LOS_OK) ? ret : freeRet; } if (ret != LOS_OK) { @@ -1309,28 +1282,12 @@ LITE_OS_SEC_TEXT STATIC UINT32 HandleCmsCmd(CmsCmdContent *content) } return AddServiceAccess(localContent.taskID, localContent.serviceHandle); default: - PRINT_DEBUG("Unknown cmd cmd:%d\n", localContent.cmd); + PRINT_DEBUG("Unknow cmd cmd:%d\n", localContent.cmd); return -EINVAL; } return ret; } -LITE_OS_SEC_TEXT STATIC UINT32 HandleGetVersion(IpcVersion *version) -{ - UINT32 ret = LOS_OK; - IpcVersion localIpcVersion; - if (version == NULL) { - return -EINVAL; - } - - localIpcVersion.driverVersion = DRIVER_VERSION; - ret = copy_to_user((void *)version, (const void *)(&localIpcVersion), sizeof(IpcVersion)); - if (ret != LOS_OK) { - PRINT_ERR("%s, %d\n", __FUNCTION__, __LINE__); - } - return ret; -} - LITE_OS_SEC_TEXT int LiteIpcIoctl(struct file *filep, int cmd, unsigned long arg) { UINT32 ret = LOS_OK; @@ -1349,17 +1306,15 @@ LITE_OS_SEC_TEXT int LiteIpcIoctl(struct file *filep, int cmd, unsigned long arg switch (cmd) { case IPC_SET_CMS: - return (INT32)SetCms(arg); + return SetCms(arg); case IPC_CMS_CMD: - return (INT32)HandleCmsCmd((CmsCmdContent *)(UINTPTR)arg); - case IPC_GET_VERSION: - return (INT32)HandleGetVersion((IpcVersion *)(UINTPTR)arg); + return HandleCmsCmd((CmsCmdContent *)(UINTPTR)arg); case IPC_SET_IPC_THREAD: if (IsCmsSet() == FALSE) { PRINT_ERR("Liteipc ServiceManager not set!\n"); return -EINVAL; } - return (INT32)SetIpcTask(); + return SetIpcTask(); case IPC_SEND_RECV_MSG: if (arg == 0) { return -EINVAL; @@ -1370,12 +1325,12 @@ LITE_OS_SEC_TEXT int LiteIpcIoctl(struct file *filep, int cmd, unsigned long arg } ret = LiteIpcMsgHandle((IpcContent *)(UINTPTR)arg); if (ret != LOS_OK) { - return (INT32)ret; + return ret; } break; default: - PRINT_ERR("Unknown liteipc ioctl cmd:%d\n", cmd); + PRINT_ERR("Unknow liteipc ioctl cmd:%d\n", cmd); return -EINVAL; } - return (INT32)ret; + return ret; } diff --git a/src/kernel_liteos_a/kernel/extended/liteipc/hm_liteipc.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/liteipc/hm_liteipc.h similarity index 95% rename from src/kernel_liteos_a/kernel/extended/liteipc/hm_liteipc.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/liteipc/hm_liteipc.h index 9b82f90c..31938b86 100644 --- a/src/kernel_liteos_a/kernel/extended/liteipc/hm_liteipc.h +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/liteipc/hm_liteipc.h @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2023 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -75,7 +75,7 @@ typedef struct { typedef struct { LOS_DL_LIST msgListHead; - BOOL accessMap[LOSCFG_BASE_CORE_PROCESS_LIMIT]; + BOOL accessMap[LOSCFG_BASE_CORE_TSK_LIMIT]; } IpcTaskInfo; typedef enum { @@ -114,17 +114,12 @@ typedef enum { MT_NUM } MsgType; -typedef struct { - int32_t driverVersion; -} IpcVersion; - /* lite ipc ioctl */ #define IPC_IOC_MAGIC 'i' #define IPC_SET_CMS _IO(IPC_IOC_MAGIC, 1) #define IPC_CMS_CMD _IOWR(IPC_IOC_MAGIC, 2, CmsCmdContent) #define IPC_SET_IPC_THREAD _IO(IPC_IOC_MAGIC, 3) #define IPC_SEND_RECV_MSG _IOWR(IPC_IOC_MAGIC, 4, IpcContent) -#define IPC_GET_VERSION _IOR(IPC_IOC_MAGIC, 5, IpcVersion) typedef enum { CMS_GEN_HANDLE, diff --git a/src/kernel_liteos_a/kernel/extended/lms/BUILD.gn b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/lms/BUILD.gn similarity index 100% rename from src/kernel_liteos_a/kernel/extended/lms/BUILD.gn rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/lms/BUILD.gn diff --git a/src/kernel_liteos_a/kernel/extended/lms/Kconfig b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/lms/Kconfig similarity index 100% rename from src/kernel_liteos_a/kernel/extended/lms/Kconfig rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/lms/Kconfig diff --git a/src/kernel_liteos_a/kernel/extended/lms/Makefile b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/lms/Makefile similarity index 100% rename from src/kernel_liteos_a/kernel/extended/lms/Makefile rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/lms/Makefile diff --git a/src/kernel_liteos_a/kernel/extended/lms/lms_libc.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/lms/lms_libc.c similarity index 100% rename from src/kernel_liteos_a/kernel/extended/lms/lms_libc.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/lms/lms_libc.c diff --git a/src/kernel_liteos_a/kernel/extended/lms/los_lms.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/lms/los_lms.c similarity index 93% rename from src/kernel_liteos_a/kernel/extended/lms/los_lms.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/lms/los_lms.c index 81dd963e..a92c70dc 100644 --- a/src/kernel_liteos_a/kernel/extended/lms/los_lms.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/lms/los_lms.c @@ -80,25 +80,20 @@ EXIT: STATIC LmsMemListNode *OsLmsGetPoolNodeFromAddr(UINTPTR addr) { LmsMemListNode *current = NULL; - LmsMemListNode *previous = NULL; LOS_DL_LIST *listHead = &g_lmsCheckPoolList; if (LOS_ListEmpty(&g_lmsCheckPoolList)) { - return NULL; + goto EXIT; } LOS_DL_LIST_FOR_EACH_ENTRY(current, listHead, LmsMemListNode, node) { - if ((addr < current->poolAddr) || (addr >= (current->poolAddr + current->poolSize))) { - continue; - } - if ((previous == NULL) || - ((previous->poolAddr <= current->poolAddr) && - ((current->poolAddr + current->poolSize) <= (previous->poolAddr + previous->poolSize)))) { - previous = current; + if ((addr >= current->poolAddr) && (addr < current->poolAddr + current->poolSize)) { + return current; } } - return previous; +EXIT: + return NULL; } STATIC LmsMemListNode *OsLmsCheckPoolCreate(VOID) @@ -128,12 +123,18 @@ UINT32 LOS_LmsCheckPoolAdd(const VOID *pool, UINT32 size) LMS_LOCK(intSave); - lmsPoolNode = OsLmsGetPoolNode(pool); - if (lmsPoolNode != NULL) { /* if pool already on checklist */ - /* Re-initialize the same pool, maybe with different size */ - /* delete the old node, then add a new one */ - lmsPoolNode->used = LMS_POOL_UNUSED; - LOS_ListDelete(&(lmsPoolNode->node)); + lmsPoolNode = OsLmsGetPoolNodeFromAddr((UINTPTR)pool); + if (lmsPoolNode != NULL) { /* if pool range already on checklist */ + if (lmsPoolNode->poolAddr != (UINTPTR)pool) { /* pool is a subset of lmsPoolNode->poolAddr */ + /* do not add it again, just return */ + PRINT_DEBUG("[LMS]pool %p already on lms checklist !\n", pool); + LMS_UNLOCK(intSave); + return size; /* return size indicate the shadow memory init successful */ + } else { /* Re-initialize the same pool, maybe with different size */ + /* delete the old node, then add a new one */ + lmsPoolNode->used = LMS_POOL_UNUSED; + LOS_ListDelete(&(lmsPoolNode->node)); + } } lmsPoolNode = OsLmsCheckPoolCreate(); @@ -149,8 +150,7 @@ UINT32 LOS_LmsCheckPoolAdd(const VOID *pool, UINT32 size) lmsPoolNode->shadowStart = (UINTPTR)poolAddr + realSize; lmsPoolNode->shadowSize = poolAddr + size - lmsPoolNode->shadowStart; /* init shadow value */ - (VOID)memset_s((VOID *)lmsPoolNode->shadowStart, lmsPoolNode->shadowSize, - LMS_SHADOW_AFTERFREE_U8, lmsPoolNode->shadowSize); + (VOID)memset((VOID *)lmsPoolNode->shadowStart, LMS_SHADOW_AFTERFREE_U8, lmsPoolNode->shadowSize); LOS_ListAdd(&g_lmsCheckPoolList, &(lmsPoolNode->node)); @@ -179,11 +179,10 @@ Release: STATIC UINT32 OsLmsInit(VOID) { - (VOID)memset_s(g_lmsCheckPoolArray, sizeof(g_lmsCheckPoolArray), 0, sizeof(g_lmsCheckPoolArray)); + (VOID)memset(g_lmsCheckPoolArray, 0, sizeof(g_lmsCheckPoolArray)); LOS_ListInit(&g_lmsCheckPoolList); static LmsHook hook = { .init = LOS_LmsCheckPoolAdd, - .deInit = LOS_LmsCheckPoolDel, .mallocMark = OsLmsLosMallocMark, .freeMark = OsLmsLosFreeMark, .simpleMark = OsLmsSimpleMark, @@ -327,7 +326,7 @@ VOID OsLmsLosMallocMark(const VOID *curNodeStart, const VOID *nextNodeStart, UIN } OsLmsSetShadowValue(node, curNodeStartAddr, curNodeStartAddr + nodeHeadSize, LMS_SHADOW_REDZONE_U8); - OsLmsSetShadowValue(node, curNodeStartAddr + nodeHeadSize, nextNodeStartAddr, LMS_SHADOW_ACCESSIBLE_U8); + OsLmsSetShadowValue(node, curNodeStartAddr + nodeHeadSize, nextNodeStartAddr, LMS_SHADOW_ACCESSABLE_U8); OsLmsSetShadowValue(node, nextNodeStartAddr, nextNodeStartAddr + nodeHeadSize, LMS_SHADOW_REDZONE_U8); LMS_UNLOCK(intSave); } @@ -345,7 +344,7 @@ VOID OsLmsCheckValid(UINTPTR checkAddr, BOOL isFreeCheck) OsLmsGetShadowValue(node, checkAddr, &shadowValue); LMS_UNLOCK(intSave); - if ((shadowValue == LMS_SHADOW_ACCESSIBLE) || ((isFreeCheck) && (shadowValue == LMS_SHADOW_PAINT))) { + if ((shadowValue == LMS_SHADOW_ACCESSABLE) || ((isFreeCheck) && (shadowValue == LMS_SHADOW_PAINT))) { return; } @@ -368,7 +367,7 @@ VOID OsLmsLosFreeMark(const VOID *curNodeStart, const VOID *nextNodeStart, UINT3 UINTPTR nextNodeStartAddr = (UINTPTR)nextNodeStart; OsLmsGetShadowValue(node, curNodeStartAddr + nodeHeadSize, &shadowValue); - if ((shadowValue != LMS_SHADOW_ACCESSIBLE) && (shadowValue != LMS_SHADOW_PAINT)) { + if ((shadowValue != LMS_SHADOW_ACCESSABLE) && (shadowValue != LMS_SHADOW_PAINT)) { LMS_UNLOCK(intSave); OsLmsReportError(curNodeStartAddr + nodeHeadSize, MEM_REGION_SIZE_1, FREE_ERRORMODE); return; @@ -409,7 +408,7 @@ VOID LOS_LmsAddrDisableProtect(UINTPTR addrStart, UINTPTR addrEnd) LMS_LOCK(intSave); LmsMemListNode *node = OsLmsGetPoolNodeFromAddr(addrStart); if (node != NULL) { - OsLmsSetShadowValue(node, addrStart, addrEnd, LMS_SHADOW_ACCESSIBLE_U8); + OsLmsSetShadowValue(node, addrStart, addrEnd, LMS_SHADOW_ACCESSABLE_U8); } LMS_UNLOCK(intSave); } @@ -427,7 +426,7 @@ STATIC UINT32 OsLmsCheckAddr(UINTPTR addr) LmsMemListNode *node = OsLmsGetPoolNodeFromAddr(addr); if (node == NULL) { LMS_UNLOCK(intSave); - return LMS_SHADOW_ACCESSIBLE_U8; + return LMS_SHADOW_ACCESSABLE_U8; } OsLmsGetShadowValue(node, addr, &shadowValue); @@ -543,7 +542,7 @@ STATIC VOID OsLmsGetErrorInfo(UINTPTR addr, UINT32 size, LmsAddrInfo *info) { LmsMemListNode *node = OsLmsGetPoolNodeFromAddr(addr); OsLmsGetShadowInfo(node, addr, info); - if (info->shadowValue != LMS_SHADOW_ACCESSIBLE_U8) { + if (info->shadowValue != LMS_SHADOW_ACCESSABLE_U8) { return; } else { OsLmsGetShadowInfo(node, addr + size - 1, info); @@ -559,7 +558,7 @@ STATIC VOID OsLmsPrintErrInfo(LmsAddrInfo *info, UINT32 errMod) case LMS_SHADOW_REDZONE: PRINT_ERR("Heap buffer overflow error detected\n"); break; - case LMS_SHADOW_ACCESSIBLE: + case LMS_SHADOW_ACCESSABLE: PRINT_ERR("No error\n"); break; default: @@ -596,7 +595,7 @@ VOID OsLmsReportError(UINTPTR p, UINT32 size, UINT32 errMod) (VOID)LOS_AtomicAdd(&g_checkDepth, 1); LMS_LOCK(intSave); - (VOID)memset_s(&info, sizeof(LmsAddrInfo), 0, sizeof(LmsAddrInfo)); + (VOID)memset(&info, 0, sizeof(LmsAddrInfo)); PRINT_ERR("***** Kernel Address Sanitizer Error Detected Start *****\n"); @@ -615,7 +614,7 @@ VOID OsLmsReportError(UINTPTR p, UINT32 size, UINT32 errMod) #ifdef LOSCFG_LMS_STORE_CHECK VOID __asan_store1_noabort(UINTPTR p) { - if (OsLmsCheckAddr(p) != LMS_SHADOW_ACCESSIBLE_U8) { + if (OsLmsCheckAddr(p) != LMS_SHADOW_ACCESSABLE_U8) { OsLmsReportError(p, MEM_REGION_SIZE_1, STORE_ERRMODE); } } @@ -691,7 +690,7 @@ VOID __asan_storeN_noabort(UINTPTR p, UINT32 size) #ifdef LOSCFG_LMS_LOAD_CHECK VOID __asan_load1_noabort(UINTPTR p) { - if (OsLmsCheckAddr(p) != LMS_SHADOW_ACCESSIBLE_U8) { + if (OsLmsCheckAddr(p) != LMS_SHADOW_ACCESSABLE_U8) { OsLmsReportError(p, MEM_REGION_SIZE_1, LOAD_ERRMODE); } } @@ -767,4 +766,4 @@ VOID __asan_handle_no_return(VOID) return; } -LOS_MODULE_INIT(OsLmsInit, LOS_INIT_LEVEL_KMOD_PREVM); +LOS_MODULE_INIT(OsLmsInit, LOS_INIT_LEVEL_KMOD_PREVM); \ No newline at end of file diff --git a/src/kernel_liteos_a/kernel/extended/lms/los_lms_pri.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/lms/los_lms_pri.h similarity index 97% rename from src/kernel_liteos_a/kernel/extended/lms/los_lms_pri.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/lms/los_lms_pri.h index bb0cec13..c42c7d84 100644 --- a/src/kernel_liteos_a/kernel/extended/lms/los_lms_pri.h +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/lms/los_lms_pri.h @@ -59,13 +59,13 @@ extern "C" { #define LMS_POOL_RESIZE(size) ((size) / (LMS_SHADOW_U8_REFER_BYTES + 1) * LMS_SHADOW_U8_REFER_BYTES) #define LMS_ADDR_ALIGN(p) (((UINTPTR)(p) + sizeof(UINTPTR) - 1) & ~((UINTPTR)(sizeof(UINTPTR) - 1))) -#define LMS_SHADOW_ACCESSIBLE 0x00 +#define LMS_SHADOW_ACCESSABLE 0x00 #define LMS_SHADOW_AFTERFREE 0x03 #define LMS_SHADOW_REDZONE 0x02 #define LMS_SHADOW_PAINT 0x01 #define LMS_SHADOW_MASK 0x03 -#define LMS_SHADOW_ACCESSIBLE_U8 0x00 +#define LMS_SHADOW_ACCESSABLE_U8 0x00 #define LMS_SHADOW_AFTERFREE_U8 0xFF #define LMS_SHADOW_REDZONE_U8 0xAA #define LMS_SHADOW_MASK_U8 0xFF @@ -95,7 +95,6 @@ typedef struct { typedef struct { UINT32 (*init)(const VOID *pool, UINT32 size); - VOID (*deInit)(const VOID *pool); VOID (*mallocMark)(const VOID *curNodeStart, const VOID *nextNodeStart, UINT32 nodeHeadSize); VOID (*freeMark)(const VOID *curNodeStart, const VOID *nextNodeStart, UINT32 nodeHeadSize); VOID (*simpleMark)(UINTPTR startAddr, UINTPTR endAddr, UINT32 value); @@ -133,4 +132,4 @@ extern SANITIZER_INTERFACE_ATTRIBUTE VOID __asan_handle_no_return(VOID); #endif /* __cplusplus */ #endif /* __cplusplus */ -#endif /* _LOS_LMS_PRI_H */ +#endif /* _LOS_LMS_PRI_H */ \ No newline at end of file diff --git a/src/kernel_liteos_a/kernel/extended/lms/usr/BUILD.gn b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/lms/usr/BUILD.gn similarity index 100% rename from src/kernel_liteos_a/kernel/extended/lms/usr/BUILD.gn rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/lms/usr/BUILD.gn diff --git a/src/kernel_liteos_a/kernel/extended/lms/usr/los_lms.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/lms/usr/los_lms.c similarity index 95% rename from src/kernel_liteos_a/kernel/extended/lms/usr/los_lms.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/lms/usr/los_lms.c index 3d0b5d0b..f3c246dd 100644 --- a/src/kernel_liteos_a/kernel/extended/lms/usr/los_lms.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/lms/usr/los_lms.c @@ -124,8 +124,8 @@ ATTRIBUTE_NO_SANITIZE_ADDRESS void LmsSetShadowValue(uintptr_t startAddr, uintpt uint32_t startOffset; uint32_t endOffset; - unsigned char shadowValueMask; - unsigned char shadowValue; + char shadowValueMask; + char shadowValue; /* endAddr - 1, then we mark [startAddr, endAddr) to value */ LmsMem2Shadow(startAddr, &shadowStart, &startOffset); @@ -174,7 +174,7 @@ ATTRIBUTE_NO_SANITIZE_ADDRESS void LmsGetShadowValue(uintptr_t addr, uint32_t *s LmsMem2Shadow(addr, &shadowAddr, &shadowOffset); /* If the shadow addr is not mapped then regarded as legal access */ if (LmsIsShadowAddrMapped(shadowAddr, shadowAddr) != LMS_OK) { - *shadowValue = LMS_SHADOW_ACCESSIBLE_U8; + *shadowValue = LMS_SHADOW_ACCESSABLE_U8; return; } @@ -185,7 +185,7 @@ ATTRIBUTE_NO_SANITIZE_ADDRESS void LmsMallocMark(uintptr_t preRzStart, uintptr_t uintptr_t RzEndAddr) { LmsSetShadowValue(preRzStart, accessMemStart, LMS_SHADOW_REDZONE_U8); - LmsSetShadowValue(accessMemStart, nextRzStart, LMS_SHADOW_ACCESSIBLE_U8); + LmsSetShadowValue(accessMemStart, nextRzStart, LMS_SHADOW_ACCESSABLE_U8); LmsSetShadowValue(nextRzStart, RzEndAddr, LMS_SHADOW_REDZONE_U8); } @@ -266,7 +266,7 @@ ATTRIBUTE_NO_SANITIZE_ADDRESS void LmsPrintMemInfo(uintptr_t addr) } } - LMS_OUTPUT_INFO("|\t[0x%x | %2u]: ", shadowAddr, shadowOffset); + LMS_OUTPUT_INFO("|\t[0x%x | %2d]: ", shadowAddr, shadowOffset); for (int x = 0; x < printX; x += LMS_MEM_BYTES_PER_SHADOW_CELL) { LmsGetShadowValue(dumpAddr + x, &shadowValue); @@ -300,7 +300,7 @@ ATTRIBUTE_NO_SANITIZE_ADDRESS static inline void LmsGetShadowInfo(uintptr_t memA ATTRIBUTE_NO_SANITIZE_ADDRESS static void LmsGetErrorInfo(uintptr_t addr, size_t size, LmsAddrInfo *info) { LmsGetShadowInfo(addr, info); - if (info->shadowValue != LMS_SHADOW_ACCESSIBLE_U8) { + if (info->shadowValue != LMS_SHADOW_ACCESSABLE_U8) { return; } else { LmsGetShadowInfo(addr + size - 1, info); @@ -316,7 +316,7 @@ ATTRIBUTE_NO_SANITIZE_ADDRESS static void LmsPrintErrInfo(LmsAddrInfo *info, uin case LMS_SHADOW_REDZONE: LMS_OUTPUT_ERROR("Heap buffer overflow error detected!\n"); break; - case LMS_SHADOW_ACCESSIBLE: + case LMS_SHADOW_ACCESSABLE: LMS_OUTPUT_ERROR("No error!\n"); break; default: @@ -339,11 +339,11 @@ ATTRIBUTE_NO_SANITIZE_ADDRESS static void LmsPrintErrInfo(LmsAddrInfo *info, uin break; } - LMS_OUTPUT_INFO("Shadow memory address: [0x%x : %u] Shadow memory value: [%u] \n", info->shadowAddr, + LMS_OUTPUT_INFO("Shadow memory address: [0x%x : %d] Shadow memory value: [%d] \n", info->shadowAddr, info->shadowOffset, info->shadowValue); LMS_OUTPUT_INFO("\n"); - LMS_OUTPUT_INFO("%-25s%d\n", "Accessible heap addr", LMS_SHADOW_ACCESSIBLE); + LMS_OUTPUT_INFO("%-25s%d\n", "Accessable heap addr", LMS_SHADOW_ACCESSABLE); LMS_OUTPUT_INFO("%-25s%d\n", "Heap red zone", LMS_SHADOW_REDZONE); LMS_OUTPUT_INFO("%-25s%d\n", "Heap freed buffer", LMS_SHADOW_AFTERFREE); LMS_OUTPUT_INFO("\n"); @@ -373,23 +373,23 @@ ATTRIBUTE_NO_SANITIZE_ADDRESS void LmsReportError(uintptr_t p, size_t size, uint void LmsCheckValid(const char *dest, const char *src) { - if (LmsCheckAddr((uintptr_t)dest) != LMS_SHADOW_ACCESSIBLE_U8) { + if (LmsCheckAddr((uintptr_t)dest) != LMS_SHADOW_ACCESSABLE_U8) { LmsReportError((uintptr_t)dest, MEM_REGION_SIZE_1, STORE_ERRMODE); return; } - if (LmsCheckAddr((uintptr_t)src) != LMS_SHADOW_ACCESSIBLE_U8) { + if (LmsCheckAddr((uintptr_t)src) != LMS_SHADOW_ACCESSABLE_U8) { LmsReportError((uintptr_t)src, MEM_REGION_SIZE_1, LOAD_ERRMODE); return; } for (uint32_t i = 0; *(src + i) != '\0'; i++) { - if (LmsCheckAddr((uintptr_t)dest + i + 1) != LMS_SHADOW_ACCESSIBLE_U8) { + if (LmsCheckAddr((uintptr_t)dest + i + 1) != LMS_SHADOW_ACCESSABLE_U8) { LmsReportError((uintptr_t)dest + i + 1, MEM_REGION_SIZE_1, STORE_ERRMODE); return; } - if (LmsCheckAddr((uintptr_t)src + i + 1) != LMS_SHADOW_ACCESSIBLE_U8) { + if (LmsCheckAddr((uintptr_t)src + i + 1) != LMS_SHADOW_ACCESSABLE_U8) { LmsReportError((uintptr_t)src + i + 1, MEM_REGION_SIZE_1, LOAD_ERRMODE); return; } @@ -398,7 +398,7 @@ void LmsCheckValid(const char *dest, const char *src) void __asan_store1_noabort(uintptr_t p) { - if (LmsCheckAddr(p) != LMS_SHADOW_ACCESSIBLE_U8) { + if (LmsCheckAddr(p) != LMS_SHADOW_ACCESSABLE_U8) { LmsReportError(p, MEM_REGION_SIZE_1, STORE_ERRMODE); } } @@ -440,7 +440,7 @@ void __asan_storeN_noabort(uintptr_t p, size_t size) void __asan_load1_noabort(uintptr_t p) { - if (LmsCheckAddr(p) != LMS_SHADOW_ACCESSIBLE_U8) { + if (LmsCheckAddr(p) != LMS_SHADOW_ACCESSABLE_U8) { LmsReportError(p, MEM_REGION_SIZE_1, LOAD_ERRMODE); } } diff --git a/src/kernel_liteos_a/kernel/extended/lms/usr/los_lms.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/lms/usr/los_lms.h similarity index 100% rename from src/kernel_liteos_a/kernel/extended/lms/usr/los_lms.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/lms/usr/los_lms.h diff --git a/src/kernel_liteos_a/kernel/extended/lms/usr/los_lms_pri.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/lms/usr/los_lms_pri.h similarity index 98% rename from src/kernel_liteos_a/kernel/extended/lms/usr/los_lms_pri.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/lms/usr/los_lms_pri.h index 012c0dc6..fa1edcaa 100644 --- a/src/kernel_liteos_a/kernel/extended/lms/usr/los_lms_pri.h +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/lms/usr/los_lms_pri.h @@ -50,7 +50,7 @@ extern "C" { #define SANITIZER_INTERFACE_ATTRIBUTE #define ATTRIBUTE_NO_SANITIZE_ADDRESS __attribute__((no_sanitize_address)) -#define LMS_SHADOW_ACCESSIBLE 0x00 +#define LMS_SHADOW_ACCESSABLE 0x00 #define LMS_SHADOW_AFTERFREE 0x03 #define LMS_SHADOW_REDZONE 0x02 #define LMS_SHADOW_PAINT 0x01 @@ -61,7 +61,7 @@ extern "C" { #define LMS_SHADOW_U8_CELL_NUM 4 #define LMS_SHADOW_U8_REFER_BYTES 16 -#define LMS_SHADOW_ACCESSIBLE_U8 0x00 +#define LMS_SHADOW_ACCESSABLE_U8 0x00 #define LMS_SHADOW_AFTERFREE_U8 0xFF #define LMS_SHADOW_REDZONE_U8 0xAA #define LMS_SHADOW_MASK_U8 0xFF diff --git a/src/kernel_liteos_a/kernel/extended/lms/usr/los_lmslibc.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/lms/usr/los_lmslibc.c similarity index 99% rename from src/kernel_liteos_a/kernel/extended/lms/usr/los_lmslibc.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/lms/usr/los_lmslibc.c index 9fea4dc7..20143cfc 100644 --- a/src/kernel_liteos_a/kernel/extended/lms/usr/los_lmslibc.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/lms/usr/los_lmslibc.c @@ -45,7 +45,7 @@ ATTRIBUTE_NO_SANITIZE_ADDRESS void LmsFree(void *ptr) if (LmsIsShadowAddrMapped(shadowAddr, shadowAddr) == LMS_OK) { uint32_t acShadowValue; LmsGetShadowValue((uintptr_t)ptr, &acShadowValue); - if (acShadowValue != LMS_SHADOW_ACCESSIBLE) { + if (acShadowValue != LMS_SHADOW_ACCESSABLE) { char erroMode = (acShadowValue == LMS_SHADOW_AFTERFREE ? FREE_ERRORMODE : UNKNOWN_ERROR); LmsReportError((uintptr_t)ptr, MEM_REGION_SIZE_1, erroMode); goto UNLOCK_OUT; diff --git a/src/kernel_liteos_a/kernel/extended/perf/BUILD.gn b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/perf/BUILD.gn similarity index 100% rename from src/kernel_liteos_a/kernel/extended/perf/BUILD.gn rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/perf/BUILD.gn diff --git a/src/kernel_liteos_a/kernel/extended/perf/Kconfig b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/perf/Kconfig similarity index 100% rename from src/kernel_liteos_a/kernel/extended/perf/Kconfig rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/perf/Kconfig diff --git a/src/kernel_liteos_a/kernel/extended/perf/Makefile b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/perf/Makefile similarity index 100% rename from src/kernel_liteos_a/kernel/extended/perf/Makefile rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/perf/Makefile diff --git a/src/kernel_liteos_a/kernel/extended/perf/los_perf.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/perf/los_perf.c similarity index 99% rename from src/kernel_liteos_a/kernel/extended/perf/los_perf.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/perf/los_perf.c index ecb2644c..2223b802 100644 --- a/src/kernel_liteos_a/kernel/extended/perf/los_perf.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/perf/los_perf.c @@ -289,7 +289,7 @@ STATIC UINT32 OsPerfCollectData(Event *event, PerfSampleData *data, PerfRegs *re * return TRUE if user haven't specified any taskId(which is supposed * to instrument the whole system) */ -STATIC INLINE BOOL OsFilterId(UINT32 id, const UINT32 *ids, UINT8 idsNr) +STATIC INLINE BOOL OsFilterId(UINT32 id, UINT32 *ids, UINT8 idsNr) { UINT32 i; if (!idsNr) { diff --git a/src/kernel_liteos_a/kernel/extended/perf/los_perf_pri.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/perf/los_perf_pri.h similarity index 100% rename from src/kernel_liteos_a/kernel/extended/perf/los_perf_pri.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/perf/los_perf_pri.h diff --git a/src/kernel_liteos_a/kernel/extended/perf/perf_output.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/perf/perf_output.c similarity index 100% rename from src/kernel_liteos_a/kernel/extended/perf/perf_output.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/perf/perf_output.c diff --git a/src/kernel_liteos_a/kernel/extended/perf/perf_output_pri.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/perf/perf_output_pri.h similarity index 100% rename from src/kernel_liteos_a/kernel/extended/perf/perf_output_pri.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/perf/perf_output_pri.h diff --git a/src/kernel_liteos_a/kernel/extended/perf/perf_pmu.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/perf/perf_pmu.c similarity index 100% rename from src/kernel_liteos_a/kernel/extended/perf/perf_pmu.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/perf/perf_pmu.c diff --git a/src/kernel_liteos_a/kernel/extended/perf/perf_pmu_pri.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/perf/perf_pmu_pri.h similarity index 100% rename from src/kernel_liteos_a/kernel/extended/perf/perf_pmu_pri.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/perf/perf_pmu_pri.h diff --git a/src/kernel_liteos_a/kernel/extended/perf/pmu/perf_hw_pmu.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/perf/pmu/perf_hw_pmu.c similarity index 100% rename from src/kernel_liteos_a/kernel/extended/perf/pmu/perf_hw_pmu.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/perf/pmu/perf_hw_pmu.c diff --git a/src/kernel_liteos_a/kernel/extended/perf/pmu/perf_sw_pmu.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/perf/pmu/perf_sw_pmu.c similarity index 100% rename from src/kernel_liteos_a/kernel/extended/perf/pmu/perf_sw_pmu.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/perf/pmu/perf_sw_pmu.c diff --git a/src/kernel_liteos_a/kernel/extended/perf/pmu/perf_timed_pmu.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/perf/pmu/perf_timed_pmu.c similarity index 100% rename from src/kernel_liteos_a/kernel/extended/perf/pmu/perf_timed_pmu.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/perf/pmu/perf_timed_pmu.c diff --git a/src/kernel_liteos_a/kernel/extended/pipes/BUILD.gn b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/pipes/BUILD.gn similarity index 97% rename from src/kernel_liteos_a/kernel/extended/pipes/BUILD.gn rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/pipes/BUILD.gn index c70cf4df..5d589735 100644 --- a/src/kernel_liteos_a/kernel/extended/pipes/BUILD.gn +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/pipes/BUILD.gn @@ -28,7 +28,7 @@ # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. import("//kernel/liteos_a/liteos.gni") -import("$THIRDPARTY_NUTTX_DIR/NuttX.gni") +import("//third_party/NuttX/NuttX.gni") module_switch = defined(LOSCFG_KERNEL_PIPE) module_name = get_path_info(rebase_path("."), "name") diff --git a/src/kernel_liteos_a/kernel/extended/pipes/Makefile b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/pipes/Makefile similarity index 100% rename from src/kernel_liteos_a/kernel/extended/pipes/Makefile rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/pipes/Makefile diff --git a/src/kernel_liteos_a/kernel/extended/power/BUILD.gn b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/power/BUILD.gn similarity index 100% rename from src/kernel_liteos_a/kernel/extended/power/BUILD.gn rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/power/BUILD.gn diff --git a/src/kernel_liteos_a/kernel/extended/power/Makefile b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/power/Makefile similarity index 100% rename from src/kernel_liteos_a/kernel/extended/power/Makefile rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/power/Makefile diff --git a/src/kernel_liteos_a/kernel/extended/power/los_pm.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/power/los_pm.c similarity index 99% rename from src/kernel_liteos_a/kernel/extended/power/los_pm.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/power/los_pm.c index d34c9788..807ccaa5 100644 --- a/src/kernel_liteos_a/kernel/extended/power/los_pm.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/power/los_pm.c @@ -207,8 +207,8 @@ STATIC UINT32 OsPmSuspendSleep(LosPmCB *pm) tickTimerStop = OsPmTickTimerStop(pm); if (!tickTimerStop) { - OsSchedResponseTimeReset(0); - OsSchedExpireTimeUpdate(); + OsSchedResetSchedResponseTime(0); + OsSchedUpdateExpireTime(); } OsPmCpuSuspend(pm); @@ -300,7 +300,7 @@ UINT32 LOS_PmRegister(LOS_PmNodeType type, VOID *node) return LOS_EINVAL; } -STATIC UINT32 OsPmDeviceUnregister(LosPmCB *pm, const LosPmDevice *device) +STATIC UINT32 OsPmDeviceUnregister(LosPmCB *pm, LosPmDevice *device) { LOS_SpinLock(&g_pmSpin); if (pm->device == device) { diff --git a/src/kernel_liteos_a/kernel/extended/power/los_pm_pri.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/power/los_pm_pri.h similarity index 100% rename from src/kernel_liteos_a/kernel/extended/power/los_pm_pri.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/power/los_pm_pri.h diff --git a/src/kernel_liteos_a/kernel/extended/trace/BUILD.gn b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/trace/BUILD.gn similarity index 100% rename from src/kernel_liteos_a/kernel/extended/trace/BUILD.gn rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/trace/BUILD.gn diff --git a/src/kernel_liteos_a/kernel/extended/trace/Kconfig b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/trace/Kconfig similarity index 100% rename from src/kernel_liteos_a/kernel/extended/trace/Kconfig rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/trace/Kconfig diff --git a/src/kernel_liteos_a/kernel/extended/trace/Makefile b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/trace/Makefile similarity index 100% rename from src/kernel_liteos_a/kernel/extended/trace/Makefile rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/trace/Makefile diff --git a/src/kernel_liteos_a/kernel/extended/trace/cnv/trace_cnv.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/trace/cnv/trace_cnv.c similarity index 91% rename from src/kernel_liteos_a/kernel/extended/trace/cnv/trace_cnv.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/trace/cnv/trace_cnv.c index 1ade59c6..0a20b824 100644 --- a/src/kernel_liteos_a/kernel/extended/trace/cnv/trace_cnv.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/trace/cnv/trace_cnv.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2022 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -155,25 +155,12 @@ STATIC VOID LOS_TraceMuxDelete(const LosMux *muxCB) STATIC VOID LOS_TraceTaskCreate(const LosTaskCB *taskCB) { -#ifdef LOSCFG_KERNEL_TRACE - SchedParam param = { 0 }; - taskCB->ops->schedParamGet(taskCB, ¶m); - LOS_TRACE(TASK_CREATE, taskCB->taskID, taskCB->taskStatus, param.priority); -#else - (VOID)taskCB; -#endif + LOS_TRACE(TASK_CREATE, taskCB->taskID, taskCB->taskStatus, taskCB->priority); } STATIC VOID LOS_TraceTaskPriModify(const LosTaskCB *taskCB, UINT32 prio) { -#ifdef LOSCFG_KERNEL_TRACE - SchedParam param = { 0 }; - taskCB->ops->schedParamGet(taskCB, ¶m); - LOS_TRACE(TASK_PRIOSET, taskCB->taskID, taskCB->taskStatus, param.priority, prio); -#else - (VOID)taskCB; - (VOID)prio; -#endif + LOS_TRACE(TASK_PRIOSET, taskCB->taskID, taskCB->taskStatus, taskCB->priority, prio); } STATIC VOID LOS_TraceTaskDelete(const LosTaskCB *taskCB) @@ -183,28 +170,13 @@ STATIC VOID LOS_TraceTaskDelete(const LosTaskCB *taskCB) STATIC VOID LOS_TraceTaskSwitchedIn(const LosTaskCB *newTask, const LosTaskCB *runTask) { -#ifdef LOSCFG_KERNEL_TRACE - SchedParam runParam = { 0 }; - SchedParam newParam = { 0 }; - runTask->ops->schedParamGet(runTask, &runParam); - newTask->ops->schedParamGet(newTask, &newParam); - LOS_TRACE(TASK_SWITCH, newTask->taskID, runParam.priority, runTask->taskStatus, - newParam.priority, newTask->taskStatus); -#else - (VOID)newTask; - (VOID)runTask; -#endif + LOS_TRACE(TASK_SWITCH, newTask->taskID, runTask->priority, runTask->taskStatus, + newTask->priority, newTask->taskStatus); } STATIC VOID LOS_TraceTaskResume(const LosTaskCB *taskCB) { -#ifdef LOSCFG_KERNEL_TRACE - SchedParam param = { 0 }; - taskCB->ops->schedParamGet(taskCB, ¶m); - LOS_TRACE(TASK_RESUME, taskCB->taskID, taskCB->taskStatus, param.priority); -#else - (VOID)taskCB; -#endif + LOS_TRACE(TASK_RESUME, taskCB->taskID, taskCB->taskStatus, taskCB->priority); } STATIC VOID LOS_TraceTaskSuspend(const LosTaskCB *taskCB) diff --git a/src/kernel_liteos_a/kernel/extended/trace/cnv/trace_cnv.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/trace/cnv/trace_cnv.h similarity index 100% rename from src/kernel_liteos_a/kernel/extended/trace/cnv/trace_cnv.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/trace/cnv/trace_cnv.h diff --git a/src/kernel_liteos_a/kernel/extended/trace/los_trace.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/trace/los_trace.c similarity index 98% rename from src/kernel_liteos_a/kernel/extended/trace/los_trace.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/trace/los_trace.c index 7ece4516..959b2578 100644 --- a/src/kernel_liteos_a/kernel/extended/trace/los_trace.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/trace/los_trace.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2022 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -101,7 +101,7 @@ STATIC VOID OsTraceSetFrame(TraceEventFrame *frame, UINT32 eventType, UINTPTR id frame->eventType = eventType; #ifdef LOSCFG_TRACE_FRAME_CORE_MSG - frame->core.cpuid = ArchCurrCpuid(); + frame->core.cpuId = ArchCurrCpuid(); frame->core.hwiActive = OS_INT_ACTIVE ? TRUE : FALSE; frame->core.taskLockCnt = MIN(OsSchedLockCountGet(), 0xF); /* taskLockCnt is 4 bits, max value = 0xF */ frame->core.paramCount = paramCount; @@ -126,12 +126,10 @@ STATIC VOID OsTraceSetFrame(TraceEventFrame *frame, UINT32 eventType, UINTPTR id VOID OsTraceSetObj(ObjData *obj, const LosTaskCB *tcb) { errno_t ret; - SchedParam param = { 0 }; (VOID)memset_s(obj, sizeof(ObjData), 0, sizeof(ObjData)); obj->id = OsTraceGetMaskTid(tcb->taskID); - tcb->ops->schedParamGet(tcb, ¶m); - obj->prio = param.priority; + obj->prio = tcb->priority; ret = strncpy_s(obj->name, LOSCFG_TRACE_OBJ_MAX_NAME_SIZE, tcb->taskName, LOSCFG_TRACE_OBJ_MAX_NAME_SIZE - 1); if (ret != EOK) { diff --git a/src/kernel_liteos_a/kernel/extended/trace/los_trace_pri.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/trace/los_trace_pri.h similarity index 100% rename from src/kernel_liteos_a/kernel/extended/trace/los_trace_pri.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/trace/los_trace_pri.h diff --git a/src/kernel_liteos_a/kernel/extended/trace/pipeline/serial/trace_pipeline_serial.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/trace/pipeline/serial/trace_pipeline_serial.c similarity index 100% rename from src/kernel_liteos_a/kernel/extended/trace/pipeline/serial/trace_pipeline_serial.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/trace/pipeline/serial/trace_pipeline_serial.c diff --git a/src/kernel_liteos_a/kernel/extended/trace/pipeline/serial/trace_pipeline_serial.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/trace/pipeline/serial/trace_pipeline_serial.h similarity index 100% rename from src/kernel_liteos_a/kernel/extended/trace/pipeline/serial/trace_pipeline_serial.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/trace/pipeline/serial/trace_pipeline_serial.h diff --git a/src/kernel_liteos_a/kernel/extended/trace/pipeline/trace_pipeline.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/trace/pipeline/trace_pipeline.c similarity index 100% rename from src/kernel_liteos_a/kernel/extended/trace/pipeline/trace_pipeline.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/trace/pipeline/trace_pipeline.c diff --git a/src/kernel_liteos_a/kernel/extended/trace/pipeline/trace_pipeline.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/trace/pipeline/trace_pipeline.h similarity index 100% rename from src/kernel_liteos_a/kernel/extended/trace/pipeline/trace_pipeline.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/trace/pipeline/trace_pipeline.h diff --git a/src/kernel_liteos_a/kernel/extended/trace/pipeline/trace_tlv.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/trace/pipeline/trace_tlv.c similarity index 100% rename from src/kernel_liteos_a/kernel/extended/trace/pipeline/trace_tlv.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/trace/pipeline/trace_tlv.c diff --git a/src/kernel_liteos_a/kernel/extended/trace/pipeline/trace_tlv.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/trace/pipeline/trace_tlv.h similarity index 100% rename from src/kernel_liteos_a/kernel/extended/trace/pipeline/trace_tlv.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/trace/pipeline/trace_tlv.h diff --git a/src/kernel_liteos_a/kernel/extended/trace/trace_offline.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/trace/trace_offline.c similarity index 98% rename from src/kernel_liteos_a/kernel/extended/trace/trace_offline.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/trace/trace_offline.c index ad80087c..09a804ca 100644 --- a/src/kernel_liteos_a/kernel/extended/trace/trace_offline.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/trace/trace_offline.c @@ -157,7 +157,7 @@ STATIC VOID OsTraceInfoEventTitle(VOID) PRINTK("Index Time(cycles) EventType CurPid CurTask Identity "); #ifdef LOSCFG_TRACE_FRAME_CORE_MSG - PRINTK("cpuid hwiActive taskLockCnt "); + PRINTK("cpuId hwiActive taskLockCnt "); #endif #ifdef LOSCFG_TRACE_FRAME_EVENT_COUNT PRINTK("eventCount "); @@ -192,7 +192,7 @@ STATIC VOID OsTraceInfoEventData(VOID) */ taskLockCnt -= 1; #endif - PRINTK("%-11u %-11u %-11u", frame->core.cpuid, frame->core.hwiActive, taskLockCnt); + PRINTK("%-11u %-11u %-11u", frame->core.cpuId, frame->core.hwiActive, taskLockCnt); #endif #ifdef LOSCFG_TRACE_FRAME_EVENT_COUNT PRINTK("%-11u", frame->eventCount); diff --git a/src/kernel_liteos_a/kernel/extended/trace/trace_online.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/trace/trace_online.c similarity index 100% rename from src/kernel_liteos_a/kernel/extended/trace/trace_online.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/trace/trace_online.c diff --git a/src/kernel_liteos_a/kernel/extended/vdso/BUILD.gn b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/vdso/BUILD.gn similarity index 100% rename from src/kernel_liteos_a/kernel/extended/vdso/BUILD.gn rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/vdso/BUILD.gn diff --git a/src/kernel_liteos_a/kernel/extended/vdso/include/los_vdso.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/vdso/include/los_vdso.h similarity index 100% rename from src/kernel_liteos_a/kernel/extended/vdso/include/los_vdso.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/vdso/include/los_vdso.h diff --git a/src/kernel_liteos_a/kernel/extended/vdso/include/los_vdso_datapage.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/vdso/include/los_vdso_datapage.h similarity index 100% rename from src/kernel_liteos_a/kernel/extended/vdso/include/los_vdso_datapage.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/vdso/include/los_vdso_datapage.h diff --git a/src/kernel_liteos_a/kernel/extended/vdso/include/los_vdso_pri.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/vdso/include/los_vdso_pri.h similarity index 100% rename from src/kernel_liteos_a/kernel/extended/vdso/include/los_vdso_pri.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/vdso/include/los_vdso_pri.h diff --git a/src/kernel_liteos_a/kernel/extended/vdso/src/Makefile b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/vdso/src/Makefile similarity index 100% rename from src/kernel_liteos_a/kernel/extended/vdso/src/Makefile rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/vdso/src/Makefile diff --git a/src/kernel_liteos_a/kernel/extended/vdso/src/los_vdso.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/vdso/src/los_vdso.c similarity index 100% rename from src/kernel_liteos_a/kernel/extended/vdso/src/los_vdso.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/vdso/src/los_vdso.c diff --git a/src/kernel_liteos_a/kernel/extended/vdso/src/los_vdso_text.S b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/vdso/src/los_vdso_text.S similarity index 100% rename from src/kernel_liteos_a/kernel/extended/vdso/src/los_vdso_text.S rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/vdso/src/los_vdso_text.S diff --git a/src/kernel_liteos_a/kernel/extended/vdso/usr/BUILD.gn b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/vdso/usr/BUILD.gn similarity index 100% rename from src/kernel_liteos_a/kernel/extended/vdso/usr/BUILD.gn rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/vdso/usr/BUILD.gn diff --git a/src/kernel_liteos_a/kernel/extended/vdso/usr/Makefile b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/vdso/usr/Makefile similarity index 100% rename from src/kernel_liteos_a/kernel/extended/vdso/usr/Makefile rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/vdso/usr/Makefile diff --git a/src/kernel_liteos_a/kernel/extended/vdso/usr/los_vdso.ld b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/vdso/usr/los_vdso.ld similarity index 97% rename from src/kernel_liteos_a/kernel/extended/vdso/usr/los_vdso.ld rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/vdso/usr/los_vdso.ld index 5aa7b9d1..dfe1427f 100644 --- a/src/kernel_liteos_a/kernel/extended/vdso/usr/los_vdso.ld +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/vdso/usr/los_vdso.ld @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-2022 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: diff --git a/src/kernel_liteos_a/kernel/extended/vdso/usr/los_vdso_sys.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/vdso/usr/los_vdso_sys.c similarity index 100% rename from src/kernel_liteos_a/kernel/extended/vdso/usr/los_vdso_sys.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/extended/vdso/usr/los_vdso_sys.c diff --git a/src/kernel_liteos_a/kernel/include/los_base.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/include/los_base.h similarity index 100% rename from src/kernel_liteos_a/kernel/include/los_base.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/include/los_base.h diff --git a/src/kernel_liteos_a/kernel/include/los_bitmap.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/include/los_bitmap.h similarity index 100% rename from src/kernel_liteos_a/kernel/include/los_bitmap.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/include/los_bitmap.h diff --git a/src/kernel_liteos_a/kernel/include/los_builddef.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/include/los_builddef.h similarity index 100% rename from src/kernel_liteos_a/kernel/include/los_builddef.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/include/los_builddef.h diff --git a/src/kernel_liteos_a/kernel/include/los_cppsupport.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/include/los_cppsupport.h similarity index 100% rename from src/kernel_liteos_a/kernel/include/los_cppsupport.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/include/los_cppsupport.h diff --git a/src/kernel_liteos_a/kernel/include/los_cpup.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/include/los_cpup.h similarity index 100% rename from src/kernel_liteos_a/kernel/include/los_cpup.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/include/los_cpup.h diff --git a/src/kernel_liteos_a/kernel/include/los_err.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/include/los_err.h similarity index 100% rename from src/kernel_liteos_a/kernel/include/los_err.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/include/los_err.h diff --git a/src/kernel_liteos_a/kernel/include/los_errno.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/include/los_errno.h similarity index 100% rename from src/kernel_liteos_a/kernel/include/los_errno.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/include/los_errno.h diff --git a/src/kernel_liteos_a/kernel/include/los_event.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/include/los_event.h similarity index 100% rename from src/kernel_liteos_a/kernel/include/los_event.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/include/los_event.h diff --git a/src/kernel_liteos_a/kernel/include/los_hash.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/include/los_hash.h similarity index 100% rename from src/kernel_liteos_a/kernel/include/los_hash.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/include/los_hash.h diff --git a/src/kernel_liteos_a/kernel/include/los_hook.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/include/los_hook.h similarity index 100% rename from src/kernel_liteos_a/kernel/include/los_hook.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/include/los_hook.h diff --git a/src/kernel_liteos_a/kernel/include/los_init.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/include/los_init.h similarity index 92% rename from src/kernel_liteos_a/kernel/include/los_init.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/include/los_init.h index 632207cd..e19d49ae 100644 --- a/src/kernel_liteos_a/kernel/include/los_init.h +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/include/los_init.h @@ -55,7 +55,9 @@ * * @par Description: * This API is used to register a startup module to the startup process. - * + * @@周旭阳 在启动框架中,在同一_level内,启动顺序按注册的函数名排序。 * 如果调用此接口后没有注册启动过程,请尝试将-u_hook添加到liteos_tables_ldflags.mk中 + * @@周旭阳 此 API 用于将启动模块注册到启动流程。 + * @attention *
      *
    • Register a new module in the boot process of the kernel as part of the kernel capability component.
    • diff --git a/src/kernel_liteos_a/kernel/include/los_ld_elflib.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/include/los_ld_elflib.h similarity index 100% rename from src/kernel_liteos_a/kernel/include/los_ld_elflib.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/include/los_ld_elflib.h diff --git a/src/kernel_liteos_a/kernel/include/los_list.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/include/los_list.h similarity index 100% rename from src/kernel_liteos_a/kernel/include/los_list.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/include/los_list.h diff --git a/src/kernel_liteos_a/kernel/include/los_lms.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/include/los_lms.h similarity index 100% rename from src/kernel_liteos_a/kernel/include/los_lms.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/include/los_lms.h diff --git a/src/kernel_liteos_a/kernel/include/los_lockdep.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/include/los_lockdep.h similarity index 100% rename from src/kernel_liteos_a/kernel/include/los_lockdep.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/include/los_lockdep.h diff --git a/src/kernel_liteos_a/kernel/include/los_membox.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/include/los_membox.h similarity index 100% rename from src/kernel_liteos_a/kernel/include/los_membox.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/include/los_membox.h diff --git a/src/kernel_liteos_a/kernel/include/los_memory.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/include/los_memory.h similarity index 100% rename from src/kernel_liteos_a/kernel/include/los_memory.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/include/los_memory.h diff --git a/src/kernel_liteos_a/kernel/include/los_mp.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/include/los_mp.h similarity index 100% rename from src/kernel_liteos_a/kernel/include/los_mp.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/include/los_mp.h diff --git a/src/kernel_liteos_a/kernel/include/los_mux.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/include/los_mux.h similarity index 100% rename from src/kernel_liteos_a/kernel/include/los_mux.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/include/los_mux.h diff --git a/src/kernel_liteos_a/kernel/include/los_perf.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/include/los_perf.h similarity index 100% rename from src/kernel_liteos_a/kernel/include/los_perf.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/include/los_perf.h diff --git a/src/kernel_liteos_a/kernel/include/los_pm.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/include/los_pm.h similarity index 100% rename from src/kernel_liteos_a/kernel/include/los_pm.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/include/los_pm.h diff --git a/src/kernel_liteos_a/kernel/include/los_printf.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/include/los_printf.h similarity index 99% rename from src/kernel_liteos_a/kernel/include/los_printf.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/include/los_printf.h index 69f759e6..ae4e4949 100644 --- a/src/kernel_liteos_a/kernel/include/los_printf.h +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/include/los_printf.h @@ -87,9 +87,9 @@ typedef VOID (*pf_OUTPUT)(const CHAR *fmt, ...); *
      • los_printf.h: the header file that contains the API declaration.
      * @see printf */ -#ifndef LOSCFG_LIBC_NEWLIB extern void dprintf(const char *fmt, ...); -#endif + +#define diag_printf dprintf #define PRINT_DEBUG(fmt, args...) LOS_LkPrint(LOS_DEBUG_LEVEL, __FUNCTION__, __LINE__, fmt, ##args) #define PRINT_INFO(fmt, args...) LOS_LkPrint(LOS_INFO_LEVEL, __FUNCTION__, __LINE__, fmt, ##args) diff --git a/src/kernel_liteos_a/kernel/include/los_process.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/include/los_process.h similarity index 92% rename from src/kernel_liteos_a/kernel/include/los_process.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/include/los_process.h index af1a9e2e..ffb834a4 100644 --- a/src/kernel_liteos_a/kernel/include/los_process.h +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/include/los_process.h @@ -47,13 +47,13 @@ extern INT32 LOS_Fork(UINT32 flags, const CHAR *name, const TSK_ENTRY_FUNC entry, UINT32 stackSize); -extern INT32 LOS_SetProcessPriority(INT32 pid, INT32 prio); +extern INT32 LOS_SetProcessPriority(INT32 pid, UINT16 prio); extern INT32 LOS_GetProcessPriority(INT32 pid); -extern INT32 LOS_GetProcessScheduler(INT32 pid, INT32 *policy, LosSchedParam *schedParam); +extern INT32 LOS_GetProcessScheduler(INT32 pid); -extern INT32 LOS_SetProcessScheduler(INT32 pid, UINT16 policy, const LosSchedParam *schedParam); +extern INT32 LOS_SetProcessScheduler(INT32 pid, UINT16 policy, UINT16 prio); extern UINT32 LOS_GetCurrProcessID(VOID); diff --git a/src/kernel_liteos_a/kernel/include/los_queue.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/include/los_queue.h similarity index 100% rename from src/kernel_liteos_a/kernel/include/los_queue.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/include/los_queue.h diff --git a/src/kernel_liteos_a/kernel/include/los_rwlock.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/include/los_rwlock.h similarity index 98% rename from src/kernel_liteos_a/kernel/include/los_rwlock.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/include/los_rwlock.h index 9a20b8f6..73477d55 100644 --- a/src/kernel_liteos_a/kernel/include/los_rwlock.h +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/include/los_rwlock.h @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2022 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -50,8 +50,8 @@ extern "C" { * Rwlock object. */ typedef struct OsRwlock { - INT32 magic : 24; /**< Magic number */ - INT32 rwCount : 8; /**< Times of locking the rwlock, rwCount > 0 when rwkick is read mode, rwCount < 0 + INT32 magic:24; /**< Magic number */ + INT32 rwCount:8; /**< Times of locking the rwlock, rwCount > 0 when rwkick is read mode, rwCount < 0 when the rwlock is write mode, rwCount = 0 when the lock is free. */ VOID *writeOwner; /**< The current write thread that is locking the rwlock */ LOS_DL_LIST readList; /**< Read waiting list */ diff --git a/src/kernel_liteos_a/kernel/include/los_sem.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/include/los_sem.h similarity index 100% rename from src/kernel_liteos_a/kernel/include/los_sem.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/include/los_sem.h diff --git a/src/kernel_liteos_a/kernel/include/los_smp.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/include/los_smp.h similarity index 100% rename from src/kernel_liteos_a/kernel/include/los_smp.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/include/los_smp.h diff --git a/src/kernel_liteos_a/kernel/include/los_spinlock.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/include/los_spinlock.h similarity index 100% rename from src/kernel_liteos_a/kernel/include/los_spinlock.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/include/los_spinlock.h diff --git a/src/kernel_liteos_a/kernel/include/los_swtmr.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/include/los_swtmr.h similarity index 99% rename from src/kernel_liteos_a/kernel/include/los_swtmr.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/include/los_swtmr.h index c846ed62..a643933e 100644 --- a/src/kernel_liteos_a/kernel/include/los_swtmr.h +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/include/los_swtmr.h @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2023 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -275,7 +275,7 @@ typedef struct tagSwTmrCtrl { UINTPTR uwArg; /**< Parameter passed in when the callback function that handles software timer timeout is called */ SWTMR_PROC_FUNC pfnHandler; /**< Callback function that handles software timer timeout */ - UINTPTR uwOwnerPid; /** Owner of this software timer */ + UINT32 uwOwnerPid; /** Owner of this software timer */ UINT64 startTime; /**< Software timer start time */ } SWTMR_CTRL_S; diff --git a/src/kernel_liteos_a/kernel/include/los_sys.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/include/los_sys.h similarity index 88% rename from src/kernel_liteos_a/kernel/include/los_sys.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/include/los_sys.h index 26475697..debd9ba5 100644 --- a/src/kernel_liteos_a/kernel/include/los_sys.h +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/include/los_sys.h @@ -33,20 +33,33 @@ * @defgroup los_sys System time * @ingroup kernel */ - +/* +* name:周旭阳 +* 注释如下 +* time:23/12/3 +* +* +* +*/ #ifndef _LOS_SYS_H #define _LOS_SYS_H #include "los_base.h" #include "los_hwi.h" #include "los_hw.h" - +// 如果这个文件正在被 C++ 编译器处理,那么会执行这个代码块。这是为了确保 C++ 代码能正确地处理 C 语言的头文件。 #ifdef __cplusplus #if __cplusplus extern "C" { #endif /* __cplusplus */ #endif /* __cplusplus */ - +/* +*以下分别定义了错误码宏,1.表示系统指针为空。这是通过组合模块编号和错误码来完成的。 +*2.表示系统时钟无效。 +*3.表示系统最大核心数量无效 +*4.表示系统周边核心ID无效。 +*5.表示系统钩子已满。 +*/ /** * @ingroup los_sys * System time basic function error code: Null pointer. @@ -101,6 +114,11 @@ extern "C" { * @ingroup los_typedef * system time structure. */ + +/* +定义一个结构体,用于表示系统时间。这个结构体 +包含了年、月、日、小时、分钟、秒和星期几的时间信息。 +*/ typedef struct tagSysTime { UINT16 uwYear; /**< value 1970 ~ 2038 or 1970 ~ 2100 */ UINT8 ucMonth; /**< value 1 - 12 */ @@ -110,8 +128,8 @@ typedef struct tagSysTime { UINT8 ucSecond; /**< value 0 - 59 */ UINT8 ucWeek; /**< value 0 - 6 */ } SYS_TIME_S; - -/** +// 定义一些函数,这些函数可能用于获取系统时间或者进行时间转换。 +/* * @ingroup los_sys * @brief Obtain the number of Ticks. * diff --git a/src/kernel_liteos_a/kernel/include/los_tables.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/include/los_tables.h similarity index 100% rename from src/kernel_liteos_a/kernel/include/los_tables.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/include/los_tables.h diff --git a/src/kernel_liteos_a/kernel/include/los_task.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/include/los_task.h similarity index 98% rename from src/kernel_liteos_a/kernel/include/los_task.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/include/los_task.h index 73c40eb3..007b4bd1 100644 --- a/src/kernel_liteos_a/kernel/include/los_task.h +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/include/los_task.h @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2023 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -512,23 +512,10 @@ typedef struct tagTskInitParam { UINT32 uwResved; /**< It is automatically deleted if set to LOS_TASK_STATUS_DETACHED. It is unable to be deleted if set to 0. */ UINT16 consoleID; /**< The console id of task belongs */ - UINTPTR processID; + UINT32 processID; UserTaskParam userParam; - /* edf parameters */ - UINT32 runTimeUs; - UINT64 deadlineUs; - UINT64 periodUs; } TSK_INIT_PARAM_S; -typedef struct { - union { - INT32 priority; - INT32 runTimeUs; - }; - INT32 deadlineUs; - INT32 periodUs; -} LosSchedParam; - /** * @ingroup los_task * Task name length @@ -990,7 +977,7 @@ extern UINT32 LOS_TaskInfoGet(UINT32 taskID, TSK_INFO_S *taskInfo); * * @attention *
        - *
      • If any low LOSCFG_KERNEL_CORE_NUM bit of the mask is not set, an error is reported.
      • + *
      • If any low LOSCFG_KERNEL_CORE_NUM bit of the mask is not setted, an error is reported.
      • *
      * * @param uwTaskID [IN] Type #UINT32 Task ID. The task id value is obtained from task creation. @@ -1000,7 +987,7 @@ extern UINT32 LOS_TaskInfoGet(UINT32 taskID, TSK_INFO_S *taskInfo); * @retval #LOS_ERRNO_TSK_ID_INVALID Invalid task ID. * @retval #LOS_ERRNO_TSK_NOT_CREATED The task is not created. * @retval #LOS_ERRNO_TSK_CPU_AFFINITY_MASK_ERR The task cpu affinity mask is incorrect. - * @retval #LOS_OK The task cpu affinity mask is successfully set. + * @retval #LOS_OK The task cpu affinity mask is successfully setted. * @par Dependency: *
      • los_task.h: the header file that contains the API declaration.
      * @see LOS_TaskCpuAffiGet diff --git a/src/kernel_liteos_a/kernel/include/los_tick.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/include/los_tick.h similarity index 100% rename from src/kernel_liteos_a/kernel/include/los_tick.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/include/los_tick.h diff --git a/src/kernel_liteos_a/kernel/include/los_toolchain.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/include/los_toolchain.h similarity index 100% rename from src/kernel_liteos_a/kernel/include/los_toolchain.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/include/los_toolchain.h diff --git a/src/kernel_liteos_a/kernel/include/los_trace.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/include/los_trace.h similarity index 99% rename from src/kernel_liteos_a/kernel/include/los_trace.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/include/los_trace.h index 3d9652c9..f0c6948d 100644 --- a/src/kernel_liteos_a/kernel/include/los_trace.h +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/include/los_trace.h @@ -245,7 +245,7 @@ typedef struct { UINTPTR identity; /**< subject of the event description */ #ifdef LOSCFG_TRACE_FRAME_CORE_MSG struct CoreStatus { - UINT32 cpuid : 8, /**< cpuid */ + UINT32 cpuId : 8, /**< cpuid */ hwiActive : 4, /**< whether is in hwi response */ taskLockCnt : 4, /**< task lock count */ paramCount : 4, /**< event frame params' number */ diff --git a/src/kernel_liteos_a/kernel/include/los_typedef.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/include/los_typedef.h similarity index 100% rename from src/kernel_liteos_a/kernel/include/los_typedef.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/include/los_typedef.h diff --git a/src/kernel_liteos_a/kernel/user/BUILD.gn b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/user/BUILD.gn similarity index 100% rename from src/kernel_liteos_a/kernel/user/BUILD.gn rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/user/BUILD.gn diff --git a/src/kernel_liteos_a/kernel/user/Makefile b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/user/Makefile similarity index 100% rename from src/kernel_liteos_a/kernel/user/Makefile rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/user/Makefile diff --git a/src/kernel_liteos_a/kernel/user/include/los_user_init.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/user/include/los_user_init.h similarity index 100% rename from src/kernel_liteos_a/kernel/user/include/los_user_init.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/user/include/los_user_init.h diff --git a/src/kernel_liteos_a/kernel/user/src/los_user_init.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/user/src/los_user_init.c similarity index 100% rename from src/kernel_liteos_a/kernel/user/src/los_user_init.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/kernel/user/src/los_user_init.c diff --git a/src/kernel_liteos_a/lib/BUILD.gn b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/lib/BUILD.gn similarity index 100% rename from src/kernel_liteos_a/lib/BUILD.gn rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/lib/BUILD.gn diff --git a/src/kernel_liteos_a/lib/Kconfig b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/lib/Kconfig similarity index 58% rename from src/kernel_liteos_a/lib/Kconfig rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/lib/Kconfig index d9f3b54e..6bc561e8 100644 --- a/src/kernel_liteos_a/lib/Kconfig +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/lib/Kconfig @@ -5,20 +5,6 @@ config LIB_LIBC help Answer Y to enable libc for full code. -choice - prompt "choose libc" - default LIBC_MUSL - depends on LIB_LIBC - help - Choose libc. - -config LIBC_NEWLIB - bool "newlibc" - -config LIBC_MUSL - bool "musl libc" -endchoice - config LIB_ZLIB bool "Enable Zlib" default y diff --git a/src/kernel_liteos_a/lib/libc/musl/BUILD.gn b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/lib/libc/BUILD.gn similarity index 89% rename from src/kernel_liteos_a/lib/libc/musl/BUILD.gn rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/lib/libc/BUILD.gn index 0fdde2b3..6df2221c 100644 --- a/src/kernel_liteos_a/lib/libc/musl/BUILD.gn +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/lib/libc/BUILD.gn @@ -1,5 +1,5 @@ # Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. -# Copyright (c) 2020-2022 Huawei Device Co., Ltd. All rights reserved. +# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: @@ -28,10 +28,13 @@ # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. import("//kernel/liteos_a/liteos.gni") -import("$THIRDPARTY_MUSL_DIR/porting/liteos_a/kernel/musl.gni") -import("$THIRDPARTY_OPTIMIZED_ROUTINES_DIR/optimized-routines.gni") -module_switch = defined(LOSCFG_LIBC_MUSL) +MUSLDIR = "$LITEOSTHIRDPARTY/musl" + +import("//third_party/optimized-routines/optimized-routines.gni") +import("$MUSLDIR/porting/liteos_a/kernel/musl.gni") + +module_switch = defined(LOSCFG_LIB_LIBC) module_name = get_path_info(rebase_path("."), "name") kernel_module(module_name) { sources = MUSL_SRC_COMMON @@ -51,11 +54,7 @@ kernel_module(module_name) { "$MUSLPORTINGDIR/src/string/strcpy.c", "$MUSLPORTINGDIR/src/string/strlen.c", ] - sources += [ - "src/arch/arm/memcmp.S", - "src/arch/arm/memset.S", - ] - sources += OPTRT_STRING_ARM_SRC_FILES_FOR_ARMV7_A + sources += OPTRT_STRING_ARM_SRC_FILES asmflags = [ "-D__strlen_armv6t2=strlen", "-D__strcmp_arm=strcmp", @@ -72,8 +71,11 @@ kernel_module(module_name) { "-D__strcpy_arm=strcpy", ] } + sources += [ + "src/arch/arm/memcmp.S", + "src/arch/arm/memset.S", + ] } else { - # arch is not armv7-a sources += [ "src/memcmp.c", "src/memset.c", @@ -100,13 +102,13 @@ config("private") { if (defined(LOSCFG_COMPILER_CLANG_LLVM)) { cflags = [ "-Wno-char-subscripts", - "-Wno-ignored-pragmas", - "-Wno-strict-prototypes", + "-Wno-unknown-pragmas", ] } else { cflags = [ "-frounding-math", "-Wno-unused-but-set-variable", + "-Wno-unknown-pragmas", ] } @@ -114,6 +116,5 @@ config("private") { "-Wno-shift-op-parentheses", "-Wno-logical-op-parentheses", "-Wno-bitwise-op-parentheses", - "-Wno-unknown-pragmas", ] } diff --git a/src/kernel_liteos_a/lib/libc/musl/Makefile b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/lib/libc/Makefile similarity index 90% rename from src/kernel_liteos_a/lib/libc/musl/Makefile rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/lib/libc/Makefile index bb7fc68f..1de4959f 100644 --- a/src/kernel_liteos_a/lib/libc/musl/Makefile +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/lib/libc/Makefile @@ -59,11 +59,10 @@ LOCAL_INCLUDE += $(addprefix -I$(MUSLPORTINGDIR)/, src/include src/internal) LOCAL_FLAGS := $(LOCAL_INCLUDE) $(LOCAL_CMACRO) ifeq ($(LOSCFG_COMPILER_CLANG_LLVM), y) -LOCAL_FLAGS +=-Wno-char-subscripts -Wno-ignored-pragmas -Wno-strict-prototypes +LOCAL_FLAGS +=-Wno-char-subscripts -Wno-unknown-pragmas else -LOCAL_FLAGS += -frounding-math -Wno-unused-but-set-variable +LOCAL_FLAGS += -frounding-math -Wno-unused-but-set-variable -Wno-unknown-pragmas endif -LOCAL_FLAGS += -Wno-shift-op-parentheses -Wno-logical-op-parentheses -Wno-bitwise-op-parentheses -Wno-unknown-pragmas -LOCAL_FLAGS += -Wno-unused-but-set-variable +LOCAL_FLAGS += -Wno-shift-op-parentheses -Wno-logical-op-parentheses -Wno-bitwise-op-parentheses include $(MODULE) diff --git a/src/kernel_liteos_a/lib/libc/musl/src/arch/arm/memcmp.S b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/lib/libc/src/arch/arm/memcmp.S similarity index 100% rename from src/kernel_liteos_a/lib/libc/musl/src/arch/arm/memcmp.S rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/lib/libc/src/arch/arm/memcmp.S diff --git a/src/kernel_liteos_a/lib/libc/musl/src/arch/arm/memset.S b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/lib/libc/src/arch/arm/memset.S similarity index 97% rename from src/kernel_liteos_a/lib/libc/musl/src/arch/arm/memset.S rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/lib/libc/src/arch/arm/memset.S index 60819cf6..63700d5c 100644 --- a/src/kernel_liteos_a/lib/libc/musl/src/arch/arm/memset.S +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/lib/libc/src/arch/arm/memset.S @@ -131,10 +131,6 @@ Lreturn: pop {r4} bx lr Lfunc_end: -#if defined(LOSCFG_KERNEL_LMS) - .size __memset, Lfunc_end - __memset -#else .size memset, Lfunc_end - memset -#endif .cantunwind .fnend @ -- End function diff --git a/src/kernel_liteos_a/lib/libc/musl/src/memcmp.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/lib/libc/src/memcmp.c similarity index 64% rename from src/kernel_liteos_a/lib/libc/musl/src/memcmp.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/lib/libc/src/memcmp.c index 1583eff8..fce4dab7 100644 --- a/src/kernel_liteos_a/lib/libc/musl/src/memcmp.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/lib/libc/src/memcmp.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2021-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -31,9 +31,6 @@ #include #include -#define SIZE_U64 (sizeof(uint64_t)) -#define SIZE_U32 (sizeof(uint32_t)) - int memcmp(const void *str1, const void *str2, size_t n) { @@ -41,26 +38,26 @@ int memcmp(const void *str1, const void *str2, size_t n) const unsigned char *s2 = str2; size_t num = n; - while (num >= SIZE_U64) { + while (num >= 8) { /* 8, compare size, the number of chars of one uint64_t data */ if (*(const uint64_t *)(s1) != *(const uint64_t *)(s2)) { - goto L4_byte_cmp; + goto L8_byte_diff; } - s1 += SIZE_U64; - s2 += SIZE_U64; - num -= SIZE_U64; + s1 += 8; /* 8, compare size, the number of chars of one uint64_t data */ + s2 += 8; /* 8, compare size, the number of chars of one uint64_t data */ + num -= 8; /* 8, compare size, the number of chars of one uint64_t data */ } if (num == 0) { return 0; } -L4_byte_cmp: - if (num >= SIZE_U32) { + /* L4_byte_cmp */ + if (num >= 4) { /* 4, compare size, the number of chars of one uint32_t data */ if (*(const uint32_t *)(s1) != *(const uint32_t *)(s2)) { goto L4_byte_diff; } - s1 += SIZE_U32; - s2 += SIZE_U32; - num -= SIZE_U32; + s1 += 4; /* 4, compare size, the number of chars of one uint32_t data */ + s2 += 4; /* 4, compare size, the number of chars of one uint32_t data */ + num -= 4; /* 4, compare size, the number of chars of one uint32_t data */ } if (num == 0) { return 0; @@ -69,4 +66,13 @@ L4_byte_diff: for (; num && (*s1 == *s2); num--, s1++, s2++) { } return num ? *s1 - *s2 : 0; + +L8_byte_diff: + if (*(const uint32_t *)(s1) != *(const uint32_t *)(s2)) { + goto L4_byte_diff; + } + s1 += 4; /* 4, compare size, the number of chars of one uint32_t data */ + s2 += 4; /* 4, compare size, the number of chars of one uint32_t data */ + num -= 4; /* 4, compare size, the number of chars of one uint32_t data */ + goto L4_byte_diff; } \ No newline at end of file diff --git a/src/kernel_liteos_a/lib/libc/musl/src/memset.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/lib/libc/src/memset.c similarity index 100% rename from src/kernel_liteos_a/lib/libc/musl/src/memset.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/lib/libc/src/memset.c diff --git a/src/kernel_liteos_a/lib/libmbedtls/BUILD.gn b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/lib/libmbedtls/BUILD.gn similarity index 100% rename from src/kernel_liteos_a/lib/libmbedtls/BUILD.gn rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/lib/libmbedtls/BUILD.gn diff --git a/src/kernel_liteos_a/lib/libmbedtls/Makefile b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/lib/libmbedtls/Makefile similarity index 100% rename from src/kernel_liteos_a/lib/libmbedtls/Makefile rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/lib/libmbedtls/Makefile diff --git a/src/kernel_liteos_a/lib/libscrew/BUILD.gn b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/lib/libscrew/BUILD.gn similarity index 97% rename from src/kernel_liteos_a/lib/libscrew/BUILD.gn rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/lib/libscrew/BUILD.gn index 691915b0..e3cb2647 100644 --- a/src/kernel_liteos_a/lib/libscrew/BUILD.gn +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/lib/libscrew/BUILD.gn @@ -28,7 +28,7 @@ # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. import("//kernel/liteos_a/liteos.gni") -import("$THIRDPARTY_FREEBSD_DIR/FreeBSD.gni") +import("//third_party/FreeBSD/FreeBSD.gni") module_name = get_path_info(rebase_path("."), "name") kernel_module(module_name) { diff --git a/src/kernel_liteos_a/lib/libscrew/Makefile b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/lib/libscrew/Makefile similarity index 100% rename from src/kernel_liteos_a/lib/libscrew/Makefile rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/lib/libscrew/Makefile diff --git a/src/kernel_liteos_a/lib/libscrew/include/los_cir_buf.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/lib/libscrew/include/los_cir_buf.h similarity index 100% rename from src/kernel_liteos_a/lib/libscrew/include/los_cir_buf.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/lib/libscrew/include/los_cir_buf.h diff --git a/src/kernel_liteos_a/lib/libscrew/include/los_crc32.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/lib/libscrew/include/los_crc32.h similarity index 100% rename from src/kernel_liteos_a/lib/libscrew/include/los_crc32.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/lib/libscrew/include/los_crc32.h diff --git a/src/kernel_liteos_a/lib/libscrew/include/los_rbtree.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/lib/libscrew/include/los_rbtree.h similarity index 100% rename from src/kernel_liteos_a/lib/libscrew/include/los_rbtree.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/lib/libscrew/include/los_rbtree.h diff --git a/src/kernel_liteos_a/lib/libscrew/include/los_seq_buf.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/lib/libscrew/include/los_seq_buf.h similarity index 100% rename from src/kernel_liteos_a/lib/libscrew/include/los_seq_buf.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/lib/libscrew/include/los_seq_buf.h diff --git a/src/kernel_liteos_a/lib/libscrew/src/los_cir_buf.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/lib/libscrew/src/los_cir_buf.c similarity index 100% rename from src/kernel_liteos_a/lib/libscrew/src/los_cir_buf.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/lib/libscrew/src/los_cir_buf.c diff --git a/src/kernel_liteos_a/lib/libscrew/src/los_crc32.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/lib/libscrew/src/los_crc32.c similarity index 100% rename from src/kernel_liteos_a/lib/libscrew/src/los_crc32.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/lib/libscrew/src/los_crc32.c diff --git a/src/kernel_liteos_a/lib/libscrew/src/los_rbtree.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/lib/libscrew/src/los_rbtree.c similarity index 100% rename from src/kernel_liteos_a/lib/libscrew/src/los_rbtree.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/lib/libscrew/src/los_rbtree.c diff --git a/src/kernel_liteos_a/lib/libscrew/src/los_seq_buf.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/lib/libscrew/src/los_seq_buf.c similarity index 100% rename from src/kernel_liteos_a/lib/libscrew/src/los_seq_buf.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/lib/libscrew/src/los_seq_buf.c diff --git a/src/kernel_liteos_a/lib/libsec/BUILD.gn b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/lib/libsec/BUILD.gn similarity index 97% rename from src/kernel_liteos_a/lib/libsec/BUILD.gn rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/lib/libsec/BUILD.gn index 523cb219..ae17c178 100644 --- a/src/kernel_liteos_a/lib/libsec/BUILD.gn +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/lib/libsec/BUILD.gn @@ -28,7 +28,7 @@ # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. import("//kernel/liteos_a/liteos.gni") -import("$THIRDPARTY_BOUNDS_CHECKING_FUNCTION_DIR/libsec_src.gni") +import("//third_party/bounds_checking_function/libsec_src.gni") module_switch = defined(LOSCFG_LIB_LIBC) module_name = get_path_info(rebase_path("."), "name") diff --git a/src/kernel_liteos_a/lib/libsec/Makefile b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/lib/libsec/Makefile similarity index 100% rename from src/kernel_liteos_a/lib/libsec/Makefile rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/lib/libsec/Makefile diff --git a/src/kernel_liteos_a/lib/zlib/BUILD.gn b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/lib/zlib/BUILD.gn similarity index 100% rename from src/kernel_liteos_a/lib/zlib/BUILD.gn rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/lib/zlib/BUILD.gn diff --git a/src/kernel_liteos_a/lib/zlib/Makefile b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/lib/zlib/Makefile similarity index 100% rename from src/kernel_liteos_a/lib/zlib/Makefile rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/lib/zlib/Makefile diff --git a/src/kernel_liteos_a/liteos.gni b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/liteos.gni similarity index 87% rename from src/kernel_liteos_a/liteos.gni rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/liteos.gni index 6deef994..1d69c315 100644 --- a/src/kernel_liteos_a/liteos.gni +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/liteos.gni @@ -31,20 +31,7 @@ import("$root_out_dir/config.gni") LITEOSTOPDIR = "//kernel/liteos_a" LITEOSTHIRDPARTY = "//third_party" -HDFTOPDIR = "//drivers/hdf_core/adapter/khdf/liteos" -HIVIEWDFX_HILOG_LITE_DIR = "//base/hiviewdfx/hilog_lite" -DRIVERS_LITEOS_DIR = "//drivers/liteos" -THIRDPARTY_BOUNDS_CHECKING_FUNCTION_DIR = - "//third_party/bounds_checking_function" -THIRDPARTY_FATFS_DIR = "//third_party/FatFs" -THIRDPARTY_NUTTX_DIR = "//third_party/NuttX" -THIRDPARTY_MUSL_DIR = "//third_party/musl" -THIRDPARTY_TOYBOX_DIR = "//third_party/toybox" -THIRDPARTY_MKSH_DIR = "//third_party/mksh" -THIRDPARTY_FREEBSD_DIR = "//third_party/FreeBSD" -THIRDPARTY_OPTIMIZED_ROUTINES_DIR = "//third_party/optimized-routines" -THIRDPARTY_GOOGLETEST_DIR = "//third_party/googletest" -KERNEL_LINUX_DIR = "//kernel/linux/linux-5.10" +HDFTOPDIR = "//drivers/adapter/khdf/liteos" ARCH = "" if (defined(LOSCFG_ARCH_ARM_AARCH32)) { @@ -148,8 +135,8 @@ set_defaults("kernel_module") { "$LITEOSTOPDIR:los_config", ] visibility = [ - ":*", "$LITEOSTOPDIR:*", + ":*", "..:*", "../..:*", ] diff --git a/src/kernel_liteos_a/net/BUILD.gn b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/net/BUILD.gn similarity index 100% rename from src/kernel_liteos_a/net/BUILD.gn rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/net/BUILD.gn diff --git a/src/kernel_liteos_a/net/Kconfig b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/net/Kconfig similarity index 100% rename from src/kernel_liteos_a/net/Kconfig rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/net/Kconfig diff --git a/src/kernel_liteos_a/net/lwip-2.1/BUILD.gn b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/net/lwip-2.1/BUILD.gn similarity index 100% rename from src/kernel_liteos_a/net/lwip-2.1/BUILD.gn rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/net/lwip-2.1/BUILD.gn diff --git a/src/kernel_liteos_a/net/lwip-2.1/Makefile b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/net/lwip-2.1/Makefile similarity index 100% rename from src/kernel_liteos_a/net/lwip-2.1/Makefile rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/net/lwip-2.1/Makefile diff --git a/src/kernel_liteos_a/net/lwip-2.1/enhancement/include/lwip/api_shell.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/net/lwip-2.1/enhancement/include/lwip/api_shell.h similarity index 100% rename from src/kernel_liteos_a/net/lwip-2.1/enhancement/include/lwip/api_shell.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/net/lwip-2.1/enhancement/include/lwip/api_shell.h diff --git a/src/kernel_liteos_a/net/lwip-2.1/enhancement/include/lwip/dhcps.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/net/lwip-2.1/enhancement/include/lwip/dhcps.h similarity index 100% rename from src/kernel_liteos_a/net/lwip-2.1/enhancement/include/lwip/dhcps.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/net/lwip-2.1/enhancement/include/lwip/dhcps.h diff --git a/src/kernel_liteos_a/net/lwip-2.1/enhancement/include/lwip/fixme.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/net/lwip-2.1/enhancement/include/lwip/fixme.h similarity index 97% rename from src/kernel_liteos_a/net/lwip-2.1/enhancement/include/lwip/fixme.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/net/lwip-2.1/enhancement/include/lwip/fixme.h index 41b535df..49bec93d 100644 --- a/src/kernel_liteos_a/net/lwip-2.1/enhancement/include/lwip/fixme.h +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/net/lwip-2.1/enhancement/include/lwip/fixme.h @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2022 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -58,7 +58,7 @@ #define ip_addr_set_val(dest, src) do { \ IP_SET_TYPE_VAL(*dest, IP_GET_TYPE(src)); \ - if (IP_IS_V6_VAL(*(src))) { \ + if(IP_IS_V6_VAL(*(src))) { \ ip6_addr_set(ip_2_ip6(dest), ip_2_ip6(src)); \ } else { \ ip4_addr_set(ip_2_ip4(dest), ip_2_ip4(src)); \ diff --git a/src/kernel_liteos_a/net/lwip-2.1/enhancement/src/api_shell.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/net/lwip-2.1/enhancement/src/api_shell.c similarity index 95% rename from src/kernel_liteos_a/net/lwip-2.1/enhancement/src/api_shell.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/net/lwip-2.1/enhancement/src/api_shell.c index ebe65624..5831bf56 100644 --- a/src/kernel_liteos_a/net/lwip-2.1/enhancement/src/api_shell.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/net/lwip-2.1/enhancement/src/api_shell.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2022 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -243,7 +243,7 @@ struct ifconfig_option { unsigned char ethaddr[6]; u16_t mtu; /* when using telnet, print to the telnet socket will result in system */ - /* deadlock. So we cache the print data to a buf, and when the tcpip */ + /* deadlock. So we cahe the prinf data to a buf, and when the tcpip */ /* callback returns, then print the data out to the telnet socket */ sys_sem_t cb_completed; char cb_print_buf[PRINT_BUF_LEN]; @@ -273,9 +273,7 @@ int print_netif(struct netif *netif, char *print_buf, unsigned int buf_len) #if LWIP_IPV6 char *addr = NULL; #endif -#ifdef LOSCFG_NET_CONTAINER - struct net_group *group = get_net_group_from_netif(netif); -#endif + if (buf_len < 1) { goto out; } @@ -344,17 +342,13 @@ int print_netif(struct netif *netif, char *print_buf, unsigned int buf_len) buf_len -= (unsigned int)ret; ret = snprintf_s(tmp, buf_len, (buf_len - 1), " MTU:%d %s", netif->mtu, - (netif->flags & NETIF_FLAG_UP) ? "Running" : "Stop"); + netif->flags & NETIF_FLAG_UP ? "Running" : "Stop"); if ((ret <= 0) || ((unsigned int)ret >= buf_len)) goto out; tmp += ret; buf_len -= (unsigned int)ret; -#ifdef LOSCFG_NET_CONTAINER - if ((group->netif_default == netif) && (netif_is_up(netif))) { -#else if (netif_default == netif && netif_is_up(netif)) { -#endif ret = snprintf_s(tmp, buf_len, (buf_len - 1), " %s", "Default"); if ((ret <= 0) || ((unsigned int)ret >= buf_len)) goto out; @@ -362,8 +356,7 @@ int print_netif(struct netif *netif, char *print_buf, unsigned int buf_len) buf_len -= (unsigned int)ret; } - ret = snprintf_s(tmp, buf_len, (buf_len - 1), " %s\n", - (netif->flags & NETIF_FLAG_LINK_UP) ? "Link UP" : "Link Down"); + ret = snprintf_s(tmp, buf_len, (buf_len - 1), " %s\n", netif->flags & NETIF_FLAG_LINK_UP ? "Link UP" : "Link Down"); if ((ret <= 0) || ((unsigned int)ret >= buf_len)) goto out; tmp += ret; @@ -372,19 +365,19 @@ int print_netif(struct netif *netif, char *print_buf, unsigned int buf_len) ret = snprintf_s(tmp, buf_len, (buf_len - 1), "\tRX packets:%u ", netif->mib2_counters.ifinucastpkts + netif->mib2_counters.ifinnucastpkts); if ((ret <= 0) || ((unsigned int)ret >= buf_len)) - goto out; + goto out; tmp += ret; buf_len -= (unsigned int)ret; ret = snprintf_s(tmp, buf_len, (buf_len - 1), "errors:%u ", netif->mib2_counters.ifinerrors); if ((ret <= 0) || ((unsigned int)ret >= buf_len)) - goto out; + goto out; tmp += ret; buf_len -= (unsigned int)ret; ret = snprintf_s(tmp, buf_len, (buf_len - 1), "dropped:%u ", netif->mib2_counters.ifindiscards); if ((ret <= 0) || ((unsigned int)ret >= buf_len)) - goto out; + goto out; tmp += ret; buf_len -= (unsigned int)ret; @@ -438,12 +431,8 @@ void lwip_ifconfig_show_internal(void *arg) struct netif *netif = NULL; struct ifconfig_option *ifconfig_cmd = (struct ifconfig_option *)arg; int ret; -#ifdef LOSCFG_NET_CONTAINER - struct net_group *group = get_curr_process_net_group(); - if (group->netif_list == NULL) { -#else + if (netif_list == NULL) { -#endif ret = snprintf_s(ifconfig_cmd->cb_print_buf, PRINT_BUF_LEN - ifconfig_cmd->print_len, ((PRINT_BUF_LEN - ifconfig_cmd->print_len) - 1), "Device not init\n"); if ((ret > 0) && ((unsigned int)ret < (PRINT_BUF_LEN - ifconfig_cmd->print_len))) { @@ -455,11 +444,7 @@ void lwip_ifconfig_show_internal(void *arg) if (ifconfig_cmd->iface[0] == '\0') { /* display all netif */ -#ifdef LOSCFG_NET_CONTAINER - for (netif = group->netif_list; netif != NULL; netif = netif->next) { -#else for (netif = netif_list; netif != NULL; netif = netif->next) { -#endif ret = print_netif(netif, ifconfig_cmd->cb_print_buf + ifconfig_cmd->print_len, PRINT_BUF_LEN - ifconfig_cmd->print_len); ifconfig_cmd->print_len += (unsigned int)ret; @@ -500,9 +485,7 @@ void lwip_ifconfig_internal(void *arg) int ret; s8_t idx; err_t err; -#ifdef LOSCFG_NET_CONTAINER - struct net_group *group = get_curr_process_net_group(); -#endif + ifconfig_cmd = (struct ifconfig_option *)arg; netif = netif_find(ifconfig_cmd->iface); if (netif == NULL) { @@ -537,22 +520,13 @@ void lwip_ifconfig_internal(void *arg) /* reset gateway if new and previous ipaddr not in same net */ if (!ip_addr_netcmp_val(&ip_addr, &netif->ip_addr, ip_2_ip4(&netif->netmask))) { ip_addr_set_zero(&netif->gw); -#ifdef LOSCFG_NET_CONTAINER - if (netif == group->netif_default) { - (void)netif_set_default(NULL, group); -#else if (netif == netif_default) { (void)netif_set_default(NULL); -#endif } } /* lwip disallow two netif sit in same net at the same time */ -#ifdef LOSCFG_NET_CONTAINER - loc_netif = group->netif_list; -#else loc_netif = netif_list; -#endif while (loc_netif != NULL) { if (loc_netif == netif) { loc_netif = loc_netif->next; @@ -602,11 +576,7 @@ void lwip_ifconfig_internal(void *arg) #endif if (netif_ip4_netmask(netif)->addr != ip_2_ip4(&netmask)->addr) { /* lwip disallow two netif sit in same net at the same time */ -#ifdef LOSCFG_NET_CONTAINER - loc_netif = group->netif_list; -#else loc_netif = netif_list; -#endif while (loc_netif != NULL) { if (loc_netif == netif) { loc_netif = loc_netif->next; @@ -623,13 +593,8 @@ void lwip_ifconfig_internal(void *arg) /* check if gateway still reachable */ if (!ip_addr_netcmp(&netif->gw, &netif->ip_addr, ip_2_ip4(&netmask))) { ip_addr_set_zero(&(netif->gw)); -#ifdef LOSCFG_NET_CONTAINER - if (netif == group->netif_default) { - (void)netif_set_default(NULL, group); -#else if (netif == netif_default) { (void)netif_set_default(NULL); -#endif } } } @@ -664,15 +629,9 @@ void lwip_ifconfig_internal(void *arg) goto out; } -#ifdef LOSCFG_NET_CONTAINER - if (group->netif_default != netif) { - ip_addr_set_zero(&netif->gw); - (void)netif_set_default(netif, group); -#else if (netif_default != netif) { ip_addr_set_zero(&netif->gw); (void)netif_set_default(netif); -#endif } #if LWIP_DHCP @@ -1072,12 +1031,12 @@ u32_t lwip_ifconfig(int argc, const char **argv) #if LWIP_ARP && LWIP_ENABLE_IP_CONFLICT_SIGNAL if ((ifconfig_cmd.option & IFCONFIG_OPTION_SET_IP) && IP_IS_V4_VAL((ifconfig_cmd.ip_addr))) { /* Create the semaphore for ip conflict detection. */ - if (sys_sem_new(&ip_conflict_detect, 0) != ERR_OK) { - sys_sem_free(&ifconfig_cmd.cb_completed); - PRINTK("ifconfig: internal error\n"); - return 1; - } - is_ip_conflict_signal = 1; + if (sys_sem_new(&ip_conflict_detect, 0) != ERR_OK) { + sys_sem_free(&ifconfig_cmd.cb_completed); + PRINTK("ifconfig: internal error\n"); + return 1; + } + is_ip_conflict_signal = 1; } #endif /* LWIP_ARP && LWIP_ENABLE_IP_CONFLICT_SIGNAL */ @@ -1098,8 +1057,8 @@ u32_t lwip_ifconfig(int argc, const char **argv) sys_sem_free(&ifconfig_cmd.cb_completed); #if LWIP_ARP && LWIP_ENABLE_IP_CONFLICT_SIGNAL if ((ifconfig_cmd.option & IFCONFIG_OPTION_SET_IP) && IP_IS_V4_VAL((ifconfig_cmd.ip_addr))) { - is_ip_conflict_signal = 0; - sys_sem_free(&ip_conflict_detect); + is_ip_conflict_signal = 0; + sys_sem_free(&ip_conflict_detect); } #endif /* LWIP_ARP && LWIP_ENABLE_IP_CONFLICT_SIGNAL */ @@ -1117,37 +1076,37 @@ u32_t lwip_ifconfig(int argc, const char **argv) ifconfig_cmd.cb_print_buf[PRINT_BUF_LEN - 1] = '\0'; PRINTK("%s", ifconfig_cmd.cb_print_buf); #if LWIP_ARP && LWIP_ENABLE_IP_CONFLICT_SIGNAL - /* Pend 2 seconds for waiting the arp reply if the ip is already in use. */ + /* Pend 2 seconds for waiting the arp reply if the ip is already in use.*/ if ((ifconfig_cmd.option & IFCONFIG_OPTION_SET_IP) && IP_IS_V4_VAL((ifconfig_cmd.ip_addr))) { - err = (err_t)sys_arch_sem_wait(&ip_conflict_detect, DUP_ARP_DETECT_TIME); - is_ip_conflict_signal = 0; - sys_sem_free(&ip_conflict_detect); - if (err < 0) { - /* The result neither conflict nor timeout. */ - PRINT_ERR("ifconfig: internal error\n"); - sys_sem_free(&ifconfig_cmd.cb_completed); - return 1; - } else if (err < DUP_ARP_DETECT_TIME) { - /* Duplicate use of new ip, restore it to the old one. */ - PRINT_ERR("ifconfig: ip conflict!\n"); - ip_addr_set_ip4_u32_val(ifconfig_cmd.ip_addr, old_ip4addr); - ret = tcpip_callback(lwip_ifconfig_internal, &ifconfig_cmd); - if (ret != ERR_OK) { - sys_sem_free(&ifconfig_cmd.cb_completed); - PRINTK("%s : tcpip_callback failed in line %d : errnu %d", __FUNCTION__, __LINE__, ret); - return 1; - } - (void)sys_arch_sem_wait(&ifconfig_cmd.cb_completed, 0); - sys_sem_free(&ifconfig_cmd.cb_completed); - ifconfig_cmd.cb_print_buf[PRINT_BUF_LEN - 1] = '\0'; - PRINTK("%s", ifconfig_cmd.cb_print_buf); - return 1; + err = (err_t)sys_arch_sem_wait(&ip_conflict_detect, DUP_ARP_DETECT_TIME); + is_ip_conflict_signal = 0; + sys_sem_free(&ip_conflict_detect); + if (err < 0) { + /* The result neither conflict nor timeout. */ + PRINT_ERR("ifconfig: internal error\n"); + sys_sem_free(&ifconfig_cmd.cb_completed); + return 1; + } else if (err < DUP_ARP_DETECT_TIME) { + /* Duplicate use of new ip, restore it to the old one. */ + PRINT_ERR("ifconfig: ip conflict!\n"); + ip_addr_set_ip4_u32_val(ifconfig_cmd.ip_addr, old_ip4addr); + ret = tcpip_callback(lwip_ifconfig_internal, &ifconfig_cmd); + if (ret != ERR_OK) { + sys_sem_free(&ifconfig_cmd.cb_completed); + PRINTK("%s : tcpip_callback failed in line %d : errnu %d", __FUNCTION__, __LINE__, ret); + return 1; } + (void)sys_arch_sem_wait(&ifconfig_cmd.cb_completed, 0); + sys_sem_free(&ifconfig_cmd.cb_completed); + ifconfig_cmd.cb_print_buf[PRINT_BUF_LEN - 1] = '\0'; + PRINTK("%s", ifconfig_cmd.cb_print_buf); + return 1; + } } #endif /* LWIP_ARP && LWIP_ENABLE_IP_CONFLICT_SIGNAL */ #if LWIP_IPV6 if ((ifconfig_cmd.option & IFCONFIG_OPTION_SET_IP) && IP_IS_V6_VAL(ifconfig_cmd.ip_addr)) { - /* Pend 2 seconds for waiting the arp reply if the ip is already in use. */ + /* Pend 2 seconds for waiting the arp reply if the ip is already in use.*/ retval = sys_arch_sem_wait(&dup_addr_detect, DUP_ARP_DETECT_TIME); is_dup_detect_initialized = 0; sys_sem_free(&dup_addr_detect); @@ -1199,9 +1158,9 @@ struct arp_option { unsigned int ipaddr; /* hw addr */ unsigned char ethaddr[6]; - /* when using telnet, print to the telnet socket will result in system */ - /* deadlock.so don't do it. cache the data to print to a buf, and when */ - /* callback returns, then print the data out to the telnet socket */ + /* when using telnet, printf to the telnet socket will result in system */ + /* deadlock.so don't do it.cahe the data to prinf to a buf, and when */ + /* callback returns, then printf the data out to the telnet socket */ sys_sem_t cb_completed; char cb_print_buf[PRINT_BUF_LEN]; int print_buf_len; @@ -1232,6 +1191,7 @@ void lwip_arp_show_internal(struct netif *netif, char *printf_buf, unsigned int || (state == ETHARP_STATE_STATIC) #endif /* ETHARP_SUPPORT_STATIC_ENTRIES */ ) && arp_table[i].netif) { + if (strcmp(netif_get_name(netif), netif_get_name(arp_table[i].netif)) != 0) { continue; } @@ -1295,9 +1255,7 @@ void lwip_arp_internal(void *arg) ip4_addr_t ipaddr; err_t ret = 0; int type = 0; -#ifdef LOSCFG_NET_CONTAINER - struct net_group *group = get_curr_process_net_group(); -#endif + if (arp_cmd->iface[0] == 'd' && arp_cmd->iface[1] == 'e') { netif = NULL; } else { @@ -1344,14 +1302,10 @@ void lwip_arp_internal(void *arg) if (netif != NULL) { ret = etharp_delete_arp_entry(netif, &ipaddr); } else { -#ifdef LOSCFG_NET_CONTAINER - for (netif = group->netif_list; netif != NULL; netif = netif->next) { -#else for (netif = netif_list; netif != NULL; netif = netif->next) { -#endif ret = etharp_delete_arp_entry(netif, &ipaddr); if (ret == ERR_OK) { - /* only can del success one time */ + /*only can del success one time*/ break; } } @@ -1372,7 +1326,7 @@ out: } else if (ret == ERR_RTE) { (void)snprintf_s(arp_cmd->cb_print_buf, PRINT_BUF_LEN, (PRINT_BUF_LEN - 1), "Network is unreachable\n"); } else { - (void)snprintf_s(arp_cmd->cb_print_buf, PRINT_BUF_LEN, (PRINT_BUF_LEN - 1), "Succeeded\n"); + (void)snprintf_s(arp_cmd->cb_print_buf, PRINT_BUF_LEN, (PRINT_BUF_LEN - 1), "Successed\n"); } } #endif @@ -1433,7 +1387,7 @@ u32_t lwip_arp(int argc, const char **argv) goto arp_error; } i += 2; - argc -= 2; // 2: number of used parameters + argc -= 2; } else if (strcmp("-d", argv[i]) == 0 && (argc > 1)) { /* arp delete */ arp_cmd.option = ARP_OPTION_DEL; @@ -1445,8 +1399,8 @@ u32_t lwip_arp(int argc, const char **argv) } i += 2; - argc -= 2; // 2: number of used parameters - } else if (strcmp("-s", argv[i]) == 0 && (argc > 2)) { // 2: require more than 2 parameters + argc -= 2; + } else if (strcmp("-s", argv[i]) == 0 && (argc > 2)) { /* arp add */ char *digit = NULL; u32_t macaddrlen = strlen(argv[i + 2]) + 1; @@ -1464,7 +1418,7 @@ u32_t lwip_arp(int argc, const char **argv) goto arp_error; } - /* cannot add an arp entry of 127.*.*.* */ + /*cannot add an arp entry of 127.*.*.* */ if ((arp_cmd.ipaddr & (u32_t)0x0000007fUL) == (u32_t)0x0000007fUL) { PRINTK("IP address is not correct!\n"); goto arp_error; @@ -1498,7 +1452,7 @@ u32_t lwip_arp(int argc, const char **argv) } i += 3; - argc -= 3; // 3: number of used parameters + argc -= 3; } else { goto arp_error; } @@ -1773,7 +1727,7 @@ LWIP_STATIC int osPingFunc(u32_t destip, u32_t cnt, u32_t interval, u32_t data_l break; } intrvl -= 1000; - sys_msleep(1000); // 1000: delay 1 s + sys_msleep(1000); if (ping_kill == 1) break; } while (intrvl > 0); @@ -1865,7 +1819,7 @@ u32_t osShellPing(int argc, const char **argv) count = ret; count_set = 1; i += 2; - argc -= 2; // 2: nuber of arguments that has been checked + argc -= 2; } else if (strcmp("-t", argv[i]) == 0) { count = 0; /* ping forerver */ count_set = 1; @@ -1880,7 +1834,7 @@ u32_t osShellPing(int argc, const char **argv) interval = ret; i += 2; - argc -= 2; // 2:number of arguments that has been checked + argc -= 2; } else if (strcmp("-l", argv[i]) == 0 && (argc > 1)) { ret = atoi(argv[i + 1]); if (ret < 0 || ret > (int)(LWIP_MAX_UDP_RAW_SEND_SIZE - sizeof(struct icmp_echo_hdr))) { @@ -1890,7 +1844,7 @@ u32_t osShellPing(int argc, const char **argv) } data_len = ret; i += 2; - argc -= 2; // 2: number of elements has been checked + argc -= 2; } else if (strcmp("-k", argv[i]) == 0) { if (ping_taskid > 0) { ping_kill = 1; /* stop the current ping task */ @@ -1942,7 +1896,7 @@ u32_t osShellPing(int argc, const char **argv) stPingTask.auwArgs[0] = dst_ipaddr.addr; /* network order */ stPingTask.auwArgs[1] = count; stPingTask.auwArgs[2] = interval; - stPingTask.auwArgs[3] = data_len; // 3: index of data length + stPingTask.auwArgs[3] = data_len; ret = LOS_TaskCreate((UINT32 *)(&ping_taskid), &stPingTask); if (ret != LOS_OK) { PRINTK("ping_task create failed 0x%08x.\n", ret); @@ -1969,7 +1923,7 @@ ping_error: SHELLCMD_ENTRY(ping_shellcmd, CMD_TYPE_EX, "ping", XARGS, (CmdCallBackFunc)osShellPing); #endif /* LOSCFG_SHELL */ -#else /* LWIP_EXT_POLL_SUPPORT */ +#else /* LWIP_EXT_POLL_SUPPORT*/ u32_t osShellPing(int argc, const char **argv) { @@ -2122,7 +2076,7 @@ FAILURE: SHELLCMD_ENTRY(ping_shellcmd, CMD_TYPE_EX, "ping", XARGS, (CmdCallBackFunc)osShellPing); #endif /* LOSCFG_SHELL */ -#endif /* LWIP_EXT_POLL_SUPPORT */ +#endif /* LWIP_EXT_POLL_SUPPORT*/ #if LWIP_IPV6 u32_t osShellPing6(int argc, const char **argv) @@ -2221,6 +2175,8 @@ u32_t osShellPing6(int argc, const char **argv) /* Setting the start time of the entire ping task for statistics */ (void)clock_gettime(CLOCK_MONOTONIC_RAW, &first); + nsent = 0; + for (nsent = 0; nsent < ping6_params.pingcount; nsent++) { /* capture the start tick to calculate rtt */ (void)clock_gettime(CLOCK_MONOTONIC_RAW, &start); @@ -2278,13 +2234,13 @@ u32_t osShellPing6(int argc, const char **argv) } if ((u32_t)ret < sizeof(struct icmp6_echo_hdr *)) { - /* Drop the packet if its too short [Doesn't contain even the header !!] */ + /* Drop the packet if its too short [Doesnot contain even the header !!] */ PRINTK("ping6 : received ICMP echo response too short\n"); goto REDUCE_SELECT_TIME; } /* Acceping the ICMPv6 payload. */ - /* Here, pbuf_resp->payload won't contain IPv6 Header since its an AF_INET6 RAW Socket */ + /* Here, pbuf_resp->payload wont contain IPv6 Header since its an AF_INET6 RAW Socket */ iecho_resp = (struct icmp6_echo_hdr *)pbuf_resp->payload; if (iecho_resp->id == icmpv6_id) { @@ -2327,7 +2283,7 @@ u32_t osShellPing6(int argc, const char **argv) /* Checking if its a delayed packet */ if ((iecho_resp->seqno != icmpv6_seq) && (nsent < ping6_params.pingcount)) { - /* In case of delayed packet wait on socket for other response before sending a new PING */ + /* Incase of delayed packet wait on socket for other response before sending a new PING */ /* We have to reduce the timeout value now when selecting on socket */ goto REDUCE_SELECT_TIME; } @@ -2355,10 +2311,9 @@ REDUCE_SELECT_TIME: PRINTK("--- %s ping statistics ---\n", argv[ping6_params.host_index]); PRINTK("%d packets transmitted, %d received, %.2f%% packet loss, time %dms\n", nsent, nrecieve, (float)(((float)(nsent - nrecieve)) * ((float)(100)) / ((float)(nsent))), - /* 1000: convert seconds to milliseconds, 1000000: convert nanoseconds to milliseconds */ ((last.tv_sec - first.tv_sec) * 1000 + (last.tv_nsec - first.tv_nsec) / 1000000)); if (nrecieve) { - /* Display rtt stats only if at least one packet is received */ + /* Display rtt stats only if atleast one packet is received */ PRINTK("rtt min/avg/max = %u/%.2f/%u ms\n", ping6_stats.min_rtt, ping6_stats.avg_rtt, ping6_stats.max_rtt); } @@ -2674,7 +2629,7 @@ usage: SHELLCMD_ENTRY(ntpdate_shellcmd, CMD_TYPE_EX, "ntpdate", XARGS, (CmdCallBackFunc)osShellNtpdate); #endif /* LOSCFG_SHELL_CMD_DEBUG */ -#endif /* LWIP_SNTP */ +#endif /* LWIP_SNTP*/ #if LWIP_DNS u32_t osShellDns(int argc, const char **argv) @@ -2823,7 +2778,7 @@ int netstat_get_udp_sendQLen6(struct udp_pcb *udppcb, struct pbuf *udpbuf) goto FUNC_OUT; } - /* check if there is enough space for at least udp header available */ + /* check if there is enough space for atleast udp header available */ if (udpbuf->tot_len < UDP_HLEN) { goto FUNC_OUT; } @@ -2911,7 +2866,7 @@ int netstat_tcp_recvq(struct tcp_pcb *tpcb) case NETCONN_UDP_IPV6: #endif case NETCONN_UDP: - SYS_ARCH_GET(((unsigned int)conn->recv_avail), retVal); // + conn->lrcv_left + SYS_ARCH_GET(((unsigned int)conn->recv_avail /*+ conn->lrcv_left*/), retVal); break; default: retVal = 0; /* ur... very ugly, damn DHCP DNS and SNTP */ @@ -2967,7 +2922,7 @@ int netstat_udp_sendq6(struct udp_pcb *upcb) #else ret = netstat_get_udp_sendQLen6(upcb, neighbor_cache[idx].q); if (ret >= 0) { - retLen += ret; + retLen += ret; } #endif return retLen; @@ -3011,10 +2966,10 @@ int netstat_udp_sendq(struct udp_pcb *upcb) #else ret = netstat_get_udp_sendQLen(upcb, arp_table[arpidx].q); if (ret > 0) { - retLen += ret; - if (retLen <= 0) { // overflow, set rteLen = -1 to indicate - retLen = -1; - } + retLen += ret; + if (retLen <= 0) { // overflow, set rteLen = -1 to indicate + retLen = -1; + } } #endif } @@ -3037,7 +2992,7 @@ int netstat_netconn_recvq(const struct netconn *conn) case NETCONN_PKT_RAW: #endif case NETCONN_UDP: - SYS_ARCH_GET(((unsigned int)conn->recv_avail), retVal); // + conn->lrcv_left + SYS_ARCH_GET(((unsigned int)conn->recv_avail /*+ conn->lrcv_left*/), retVal); break; default: retVal = 0; /* ur... very ugly, damn DHCP DNS and SNTP */ @@ -3064,8 +3019,8 @@ int netstat_netconn_sendq(struct netconn *conn) #if PF_PKT_SUPPORT case NETCONN_PKT_RAW: retVal = 0; /* always be 0 as frame send to driver directly */ - break; #endif + break; case NETCONN_UDP: retVal = netstat_udp_sendq(conn->pcb.udp); break; @@ -3214,6 +3169,7 @@ void netstat_internal(void *ctx) } /* For listen PCBs */ + recvQlen = 0; sendQlen = 0; for (lpcb = tcp_listen_pcbs.listen_pcbs; lpcb != NULL; lpcb = lpcb->next) { @@ -3315,10 +3271,10 @@ void netstat_internal(void *ctx) recvQlen = netstat_netconn_recvq(rpcb->recv_arg); sendQlen = netstat_netconn_sendq(rpcb->recv_arg); - proto = rpcb->protocol; // raw_proto; + proto = rpcb->protocol;//raw_proto; iRet = snprintf_s((char *)(entry_buf + entry_buf_offset), entry_buf_len, entry_buf_len - 1, "%-8s%-12d%-12d%-20s%-20s%-16u%-16d\n", - "raw", recvQlen, sendQlen, local_ip_port, remote_ip_port, proto, 0); // rpcb->hdrincl + "raw", recvQlen, sendQlen, local_ip_port, remote_ip_port, proto, /*rpcb->hdrincl*/0); if ((iRet <= 0) || ((u32_t)(iRet) >= entry_buf_len)) { goto out; } @@ -3341,8 +3297,7 @@ void netstat_internal(void *ctx) sendQlen = netstat_netconn_sendq(rpcb->recv_arg); for (netif = netif_list; netif != NULL; netif = netif->next) { - /* netif->ifindex and index */ - if (netif_get_index(netif) == rpcb->netif_idx) { + if (netif_get_index(netif)/*netif->ifindex*/ == rpcb->netif_idx/*index*/) { (void)snprintf_s((char *)netif_name, IFNAMSIZ, IFNAMSIZ - 1, "%s", netif_get_name(netif)); break; } @@ -3352,7 +3307,7 @@ void netstat_internal(void *ctx) (void)snprintf_s((char *)netif_name, IFNAMSIZ, IFNAMSIZ - 1, "%s", "None"); } - proto = rpcb->protocol; // ntohs(rpcb->proto.eth_proto); + proto = rpcb->protocol;//ntohs(rpcb->proto.eth_proto); iRet = snprintf_s((char *)(entry_buf + entry_buf_offset), entry_buf_len, entry_buf_len - 1, "%-12s%-12d%-12d%-16x%-12s\n", "pkt-raw", recvQlen, sendQlen, proto, netif_name); @@ -3713,7 +3668,7 @@ u32_t netdebug_sock(int argc, const char **argv) int idx; u32_t ret = LOS_NOK; - if (argc == 2) { /* 2: Number of command parameters */ + if (argc == 2) { if (!strcmp("-i", argv[1])) { /* netdebug sock -i */ for (idx = 0; idx < (int)LWIP_CONFIG_NUM_SOCKETS; idx++) { @@ -3721,9 +3676,10 @@ u32_t netdebug_sock(int argc, const char **argv) } ret = LOS_OK; } - } else if (argc == 3) { /* 3: Number of command parameters */ + } else if (argc == 3) { if (!strcmp("-d", argv[1])) { - idx = atoi(argv[2]); /* 2: netdebug sock -d */ + /* netdebug sock -d */ + idx = atoi(argv[2]); if (idx >= 0) { debug_socket_info(idx, 1, 1); ret = LOS_OK; @@ -3840,9 +3796,8 @@ u32_t osShellIpDebug(int argc, const char **argv) PRINTK("%-50s ", acIPv6Addr); if (snprintf_s(aclladdr, sizeof(aclladdr), sizeof(aclladdr) - 1, "%02X:%02X:%02X:%02X:%02X:%02X", - neighbor_cache[i].lladdr[0], neighbor_cache[i].lladdr[1], /* 0, 1, member number */ - neighbor_cache[i].lladdr[2], neighbor_cache[i].lladdr[3], /* 2, 3, member number */ - neighbor_cache[i].lladdr[4], neighbor_cache[i].lladdr[5]) < 0) { /* 4, 5, member number */ + neighbor_cache[i].lladdr[0], neighbor_cache[i].lladdr[1], neighbor_cache[i].lladdr[2], + neighbor_cache[i].lladdr[3], neighbor_cache[i].lladdr[4], neighbor_cache[i].lladdr[5]) < 0) { return LOS_NOK; } PRINTK("%-25s ", aclladdr); @@ -3929,4 +3884,4 @@ SHELLCMD_ENTRY(reboot_shellcmd, CMD_TYPE_EX, "reboot", XARGS, (CmdCallBackFunc)o #endif /* LOSCFG_SHELL_CMD_DEBUG */ #endif -#endif // LWIP_ENABLE_LOS_SHELL_CMD +#endif //LWIP_ENABLE_LOS_SHELL_CMD diff --git a/src/kernel_liteos_a/net/lwip-2.1/enhancement/src/dhcps.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/net/lwip-2.1/enhancement/src/dhcps.c similarity index 99% rename from src/kernel_liteos_a/net/lwip-2.1/enhancement/src/dhcps.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/net/lwip-2.1/enhancement/src/dhcps.c index 602432a4..e31a4794 100644 --- a/src/kernel_liteos_a/net/lwip-2.1/enhancement/src/dhcps.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/net/lwip-2.1/enhancement/src/dhcps.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2022 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -435,9 +435,9 @@ LWIP_STATIC void handle_discover(struct netif *netif, struct dhcps *dhcps, } #else else { - LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, - ("handle_discover: sendto(OFFER, IP_ADDR_BROADCAST, DHCP_CLIENT_PORT)\n")); - (void)udp_sendto_if_src(dhcps->pcb, out_msg, IP_ADDR_BROADCAST, DHCP_CLIENT_PORT, netif, &(netif->ip_addr)); + LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, + ("handle_discover: sendto(OFFER, IP_ADDR_BROADCAST, DHCP_CLIENT_PORT)\n")); + (void)udp_sendto_if_src(dhcps->pcb, out_msg, IP_ADDR_BROADCAST, DHCP_CLIENT_PORT, netif, &(netif->ip_addr)); } #endif @@ -601,7 +601,7 @@ LWIP_STATIC void handle_request(struct netif *netif, struct dhcps *dhcps, struct dhcp_common_option_byte(srvr_msg, DHCP_NAK, &options_len); /* Just set this here, so that the NAK message is brcasted. - The correct flags has already been added in the response message during base message creation */ + The correct flags has already been added in the respose message during base message creation */ client_msg->flags |= htons(DHCP_BROADCAST_FLAG); client_msg->ciaddr.addr = 0; /* This is done so that NAK Gets brcasted */ #ifdef LWIP_DEV_DEBUG diff --git a/src/kernel_liteos_a/net/lwip-2.1/enhancement/src/fixme.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/net/lwip-2.1/enhancement/src/fixme.c similarity index 96% rename from src/kernel_liteos_a/net/lwip-2.1/enhancement/src/fixme.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/net/lwip-2.1/enhancement/src/fixme.c index f52b73ef..784e4901 100644 --- a/src/kernel_liteos_a/net/lwip-2.1/enhancement/src/fixme.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/net/lwip-2.1/enhancement/src/fixme.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2022 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -202,11 +202,7 @@ void netifapi_netif_rmv_ip6_address(struct netif *netif, ip_addr_t *ipaddr) (void)err; } -#ifdef LOSCFG_NET_CONTAINER -static struct netif *netif_find_by_name(const char *name, struct net_group *group) -#else static struct netif *netif_find_by_name(const char *name) -#endif { struct netif *netif = NULL; @@ -216,11 +212,7 @@ static struct netif *netif_find_by_name(const char *name) return NULL; } -#ifdef LOSCFG_NET_CONTAINER - NETIF_FOREACH(netif, group) { -#else NETIF_FOREACH(netif) { -#endif if (strcmp("lo", name) == 0 && (netif->name[0] == 'l' && netif->name[1] == 'o')) { LWIP_DEBUGF(NETIF_DEBUG, ("netif_find_by_name: found lo\n")); return netif; @@ -242,12 +234,7 @@ static err_t netifapi_do_find_by_name(struct tcpip_api_call_data *m) * We know it works because the structs have been instantiated as struct netifapi_msg */ struct netifapi_msg *msg = (struct netifapi_msg *)(void *)m; -#ifdef LOSCFG_NET_CONTAINER - struct net_group *group = get_curr_process_net_group(); - msg->netif = netif_find_by_name(msg->msg.ifs.name, group); -#else msg->netif = netif_find_by_name(msg->msg.ifs.name); -#endif return ERR_OK; } @@ -354,6 +341,7 @@ err_t etharp_delete_arp_entry(struct netif *netif, ip4_addr_t *ipaddr) return 0; } + err_t lwip_dns_setserver(u8_t numdns, ip_addr_t *dnsserver) { (void)numdns; @@ -424,7 +412,7 @@ int ip6addr_aton(const char *cp, ip6_addr_t *addr) int squash_pos = ipv6_blocks; int i; const char *s = cp; - const char *ss = cp - 1; + const char *ss = cp-1; for (; ; s++) { if (current_block_index >= ipv6_blocks) { diff --git a/src/kernel_liteos_a/net/lwip-2.1/lwip_porting.gni b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/net/lwip-2.1/lwip_porting.gni similarity index 100% rename from src/kernel_liteos_a/net/lwip-2.1/lwip_porting.gni rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/net/lwip-2.1/lwip_porting.gni diff --git a/src/kernel_liteos_a/net/lwip-2.1/porting/include/arch/cc.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/net/lwip-2.1/porting/include/arch/cc.h similarity index 100% rename from src/kernel_liteos_a/net/lwip-2.1/porting/include/arch/cc.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/net/lwip-2.1/porting/include/arch/cc.h diff --git a/src/kernel_liteos_a/net/lwip-2.1/porting/include/arch/perf.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/net/lwip-2.1/porting/include/arch/perf.h similarity index 93% rename from src/kernel_liteos_a/net/lwip-2.1/porting/include/arch/perf.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/net/lwip-2.1/porting/include/arch/perf.h index cc200260..dea6a694 100644 --- a/src/kernel_liteos_a/net/lwip-2.1/porting/include/arch/perf.h +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/net/lwip-2.1/porting/include/arch/perf.h @@ -34,8 +34,8 @@ #if LWIP_PERF -#define PERF_START do {} while (0) /* something to do */ -#define PERF_STOP(x) do {} while (0) /* something to do */ +#define PERF_START do {/* something to do */} while (0) +#define PERF_STOP(x) do {/* something to do */} while (0) #endif diff --git a/src/kernel_liteos_a/net/lwip-2.1/porting/include/arch/sys_arch.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/net/lwip-2.1/porting/include/arch/sys_arch.h similarity index 100% rename from src/kernel_liteos_a/net/lwip-2.1/porting/include/arch/sys_arch.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/net/lwip-2.1/porting/include/arch/sys_arch.h diff --git a/src/kernel_liteos_a/net/lwip-2.1/porting/include/lwip/dhcp.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/net/lwip-2.1/porting/include/lwip/dhcp.h similarity index 100% rename from src/kernel_liteos_a/net/lwip-2.1/porting/include/lwip/dhcp.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/net/lwip-2.1/porting/include/lwip/dhcp.h diff --git a/src/kernel_liteos_a/net/lwip-2.1/porting/include/lwip/inet.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/net/lwip-2.1/porting/include/lwip/inet.h similarity index 100% rename from src/kernel_liteos_a/net/lwip-2.1/porting/include/lwip/inet.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/net/lwip-2.1/porting/include/lwip/inet.h diff --git a/src/kernel_liteos_a/net/lwip-2.1/porting/include/lwip/lwipopts.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/net/lwip-2.1/porting/include/lwip/lwipopts.h similarity index 100% rename from src/kernel_liteos_a/net/lwip-2.1/porting/include/lwip/lwipopts.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/net/lwip-2.1/porting/include/lwip/lwipopts.h diff --git a/src/kernel_liteos_a/net/lwip-2.1/porting/include/lwip/netif.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/net/lwip-2.1/porting/include/lwip/netif.h similarity index 83% rename from src/kernel_liteos_a/net/lwip-2.1/porting/include/lwip/netif.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/net/lwip-2.1/porting/include/lwip/netif.h index 6109193f..2633cd71 100644 --- a/src/kernel_liteos_a/net/lwip-2.1/porting/include/lwip/netif.h +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/net/lwip-2.1/porting/include/lwip/netif.h @@ -41,27 +41,12 @@ #define LWIP_NETIF_CLIENT_DATA_INDEX_DHCP LWIP_NETIF_CLIENT_DATA_INDEX_DHCP, \ LWIP_NETIF_CLIENT_DATA_INDEX_DHCPS #endif - -#ifdef LOSCFG_NET_CONTAINER -#include "lwip/net_group.h" -#define VETH_DRIVER_IF 2 -void veth_init(struct netif *netif, struct net_group *group); -#define linkoutput linkoutput; \ - void (*drv_send)(struct netif *netif, struct pbuf *p); \ - u8_t (*drv_set_hwaddr)(struct netif *netif, u8_t *addr, u8_t len); \ - void (*drv_config)(struct netif *netif, u32_t config_flags, u8_t setBit); \ - char full_name[IFNAMSIZ]; \ - struct net_group *group; \ - struct netif *peer; \ - u16_t link_layer_type -#else #define linkoutput linkoutput; \ void (*drv_send)(struct netif *netif, struct pbuf *p); \ u8_t (*drv_set_hwaddr)(struct netif *netif, u8_t *addr, u8_t len); \ void (*drv_config)(struct netif *netif, u32_t config_flags, u8_t setBit); \ char full_name[IFNAMSIZ]; \ u16_t link_layer_type -#endif #include_next #undef linkoutput #if LWIP_DHCPS diff --git a/src/kernel_liteos_a/net/lwip-2.1/porting/include/lwip/netifapi.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/net/lwip-2.1/porting/include/lwip/netifapi.h similarity index 100% rename from src/kernel_liteos_a/net/lwip-2.1/porting/include/lwip/netifapi.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/net/lwip-2.1/porting/include/lwip/netifapi.h diff --git a/src/kernel_liteos_a/net/lwip-2.1/porting/include/lwip/pbuf.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/net/lwip-2.1/porting/include/lwip/pbuf.h similarity index 100% rename from src/kernel_liteos_a/net/lwip-2.1/porting/include/lwip/pbuf.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/net/lwip-2.1/porting/include/lwip/pbuf.h diff --git a/src/kernel_liteos_a/net/lwip-2.1/porting/include/lwip/priv/api_msg.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/net/lwip-2.1/porting/include/lwip/priv/api_msg.h similarity index 100% rename from src/kernel_liteos_a/net/lwip-2.1/porting/include/lwip/priv/api_msg.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/net/lwip-2.1/porting/include/lwip/priv/api_msg.h diff --git a/src/kernel_liteos_a/net/lwip-2.1/porting/include/lwip/priv/sockets_priv.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/net/lwip-2.1/porting/include/lwip/priv/sockets_priv.h similarity index 100% rename from src/kernel_liteos_a/net/lwip-2.1/porting/include/lwip/priv/sockets_priv.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/net/lwip-2.1/porting/include/lwip/priv/sockets_priv.h diff --git a/src/kernel_liteos_a/net/lwip-2.1/porting/include/lwip/sockets.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/net/lwip-2.1/porting/include/lwip/sockets.h similarity index 100% rename from src/kernel_liteos_a/net/lwip-2.1/porting/include/lwip/sockets.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/net/lwip-2.1/porting/include/lwip/sockets.h diff --git a/src/kernel_liteos_a/net/lwip-2.1/porting/include/lwipopts.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/net/lwip-2.1/porting/include/lwipopts.h similarity index 100% rename from src/kernel_liteos_a/net/lwip-2.1/porting/include/lwipopts.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/net/lwip-2.1/porting/include/lwipopts.h diff --git a/src/kernel_liteos_a/net/lwip-2.1/porting/src/driverif.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/net/lwip-2.1/porting/src/driverif.c similarity index 84% rename from src/kernel_liteos_a/net/lwip-2.1/porting/src/driverif.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/net/lwip-2.1/porting/src/driverif.c index bb387124..0852b17e 100644 --- a/src/kernel_liteos_a/net/lwip-2.1/porting/src/driverif.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/net/lwip-2.1/porting/src/driverif.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2022 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -35,9 +35,6 @@ #include #include #include -#ifdef LOSCFG_NET_CONTAINER -#include -#endif #define LWIP_NETIF_HOSTNAME_DEFAULT "default" #define LINK_SPEED_OF_YOUR_NETIF_IN_BPS 100000000 // 100Mbps @@ -65,11 +62,7 @@ driverif_init_ifname(struct netif *netif) "%s%d", prefix, i) < 0) { break; } -#ifdef LOSCFG_NET_CONTAINER - NETIF_FOREACH(tmpnetif, get_net_group_from_netif(netif)) { -#else NETIF_FOREACH(tmpnetif) { -#endif if (strcmp(tmpnetif->full_name, netif->full_name) == 0) { break; } @@ -105,10 +98,10 @@ driverif_output(struct netif *netif, struct pbuf *p) #if PF_PKT_SUPPORT if (all_pkt_raw_pcbs != NULL) { - p->flags = (u16_t)(p->flags & ~(PBUF_FLAG_LLMCAST | PBUF_FLAG_LLBCAST | PBUF_FLAG_HOST)); - p->flags |= PBUF_FLAG_OUTGOING; - (void)raw_pkt_input(p, netif, NULL); - } + p->flags = (u16_t)(p->flags & ~(PBUF_FLAG_LLMCAST | PBUF_FLAG_LLBCAST | PBUF_FLAG_HOST)); + p->flags |= PBUF_FLAG_OUTGOING; + (void)raw_pkt_input(p, netif, NULL); + } #endif #if ETH_PAD_SIZE @@ -321,60 +314,3 @@ driverif_init(struct netif *netif) LWIP_DEBUGF(DRIVERIF_DEBUG, ("driverif_init : Initialized netif 0x%p\n", (void *)netif)); return ERR_OK; } - -#ifdef LOSCFG_NET_CONTAINER -static err_t netif_veth_output(struct netif *netif, struct pbuf *p, const ip4_addr_t *addr) -{ - LWIP_UNUSED_ARG(addr); - return netif_loop_output(netif->peer, p); -} - -static void veth_init_fullname(struct netif *netif) -{ - struct netif *tmpnetif = NULL; - - for (int i = 0; i < LWIP_NETIF_IFINDEX_MAX_EX; ++i) { - if (snprintf_s(netif->full_name, sizeof(netif->full_name), sizeof(netif->full_name) - 1, - "%s%d", "veth", i) < 0) { - break; - } - NETIF_FOREACH(tmpnetif, get_net_group_from_netif(netif)) { - if (strcmp(tmpnetif->full_name, netif->full_name) == 0) { - break; - } - } - if (tmpnetif == NULL) { - return; - } - } - netif->full_name[0] = '\0'; -} - -static err_t netif_vethif_init(struct netif *netif) -{ - LWIP_ASSERT("netif_vethif_init: invalid netif", netif != NULL); - - /* initialize the snmp variables and counters inside the struct netif - * ifSpeed: no assumption can be made! - */ - MIB2_INIT_NETIF(netif, snmp_ifType_other, 0); - netif->link_layer_type = VETH_DRIVER_IF; - - netif->name[0] = 'v'; - netif->name[1] = 'e'; - - veth_init_fullname(netif); - netif->output = netif_veth_output; - - netif_set_flags(netif, NETIF_FLAG_IGMP); - NETIF_SET_CHECKSUM_CTRL(netif, NETIF_CHECKSUM_DISABLE_ALL); - return ERR_OK; -} - -void veth_init(struct netif *netif, struct net_group *group) -{ - netif_add_noaddr(netif, group, NULL, netif_vethif_init, tcpip_input); - netif_set_link_up(netif); - netif_set_up(netif); -} -#endif diff --git a/src/kernel_liteos_a/net/lwip-2.1/porting/src/sockets.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/net/lwip-2.1/porting/src/sockets.c similarity index 94% rename from src/kernel_liteos_a/net/lwip-2.1/porting/src/sockets.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/net/lwip-2.1/porting/src/sockets.c index cae2fc7a..cd7cd8a5 100644 --- a/src/kernel_liteos_a/net/lwip-2.1/porting/src/sockets.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/net/lwip-2.1/porting/src/sockets.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2022 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -404,11 +404,7 @@ int get_unused_socket_num(void) #include -#ifdef LOSCFG_NET_CONTAINER -static u8_t lwip_ioctl_internal_SIOCADDRT(struct rtentry *rmten, struct net_group *group) -#else static u8_t lwip_ioctl_internal_SIOCADDRT(struct rtentry *rmten) -#endif { struct netif *netif = NULL; ip_addr_t rtgw_addr; @@ -433,11 +429,7 @@ static u8_t lwip_ioctl_internal_SIOCADDRT(struct rtentry *rmten) } /* check if reachable */ -#ifdef LOSCFG_NET_CONTAINER - for (netif = group->netif_list; netif != NULL; netif = netif->next) { -#else for (netif = netif_list; netif != NULL; netif = netif->next) { -#endif if (ip_addr_netcmp(&rtgw_addr, &netif->ip_addr, ip_2_ip4(&netif->netmask))) { break; } @@ -458,15 +450,9 @@ static u8_t lwip_ioctl_internal_SIOCADDRT(struct rtentry *rmten) } /* Add validation */ -#ifdef LOSCFG_NET_CONTAINER - if ((group->netif_default != NULL) && (group->netif_default != netif)) { - ip_addr_set_zero(&group->netif_default->gw); - (void)netif_set_default(netif, group); -#else if ((netif_default != NULL) && (netif_default != netif)) { ip_addr_set_zero(&netif_default->gw); (void)netif_set_default(netif); -#endif } netif_set_gw(netif, ip_2_ip4(&rtgw_addr)); @@ -476,11 +462,8 @@ static u8_t lwip_ioctl_internal_SIOCADDRT(struct rtentry *rmten) #endif #if LWIP_IOCTL_IF -#ifdef LOSCFG_NET_CONTAINER -static u8_t lwip_ioctl_internal_SIOCGIFCONF(struct ifreq *ifr, struct net_group *group) -#else + static u8_t lwip_ioctl_internal_SIOCGIFCONF(struct ifreq *ifr) -#endif { struct ifconf *ifc = NULL; struct netif *netif = NULL; @@ -496,11 +479,7 @@ static u8_t lwip_ioctl_internal_SIOCGIFCONF(struct ifreq *ifr) /* Loop over the interfaces, and write an info block for each. */ pos = 0; -#ifdef LOSCFG_NET_CONTAINER - for (netif = group->netif_list; netif != NULL; netif = netif->next) { -#else for (netif = netif_list; netif != NULL; netif = netif->next) { -#endif if (ifc->ifc_buf == NULL) { pos = (pos + (int)sizeof(struct ifreq)); continue; @@ -575,11 +554,7 @@ static u8_t lwip_ioctl_internal_SIOCSIFADDR_6(struct ifreq *ifr) return ENOSYS; } -#ifdef LOSCFG_NET_CONTAINER -static u8_t lwip_ioctl_internal_SIOCSIFADDR(struct ifreq *ifr, struct net_group *group) -#else static u8_t lwip_ioctl_internal_SIOCSIFADDR(struct ifreq *ifr) -#endif { struct netif *netif = NULL; @@ -616,22 +591,13 @@ static u8_t lwip_ioctl_internal_SIOCSIFADDR(struct ifreq *ifr) /* reset gateway if new and previous ipaddr not in same net */ if (ip_addr_netcmp(&taget_addr, &netif->ip_addr, ip_2_ip4(&netif->netmask)) == 0) { ip_addr_set_zero(&netif->gw); -#ifdef LOSCFG_NET_CONTAINER - if (netif == group->netif_default) { - (void)netif_set_default(NULL, group); -#else if (netif == netif_default) { (void)netif_set_default(NULL); -#endif } } /* lwip disallow two netif sit in same net at the same time */ -#ifdef LOSCFG_NET_CONTAINER - loc_netif = group->netif_list; -#else loc_netif = netif_list; -#endif while (loc_netif != NULL) { if (loc_netif == netif) { loc_netif = loc_netif->next; @@ -671,11 +637,7 @@ static u8_t lwip_ioctl_internal_SIOCDIFADDR_6(struct ifreq *ifr) return ENOSYS; } -#ifdef LOSCFG_NET_CONTAINER -static u8_t lwip_ioctl_internal_SIOCDIFADDR(struct ifreq *ifr, struct net_group *group) -#else static u8_t lwip_ioctl_internal_SIOCDIFADDR(struct ifreq *ifr) -#endif { struct netif *netif = NULL; @@ -716,13 +678,8 @@ static u8_t lwip_ioctl_internal_SIOCDIFADDR(struct ifreq *ifr) ip_addr_set_zero(&netif->gw); ip_addr_set_zero(&netif->ip_addr); ip_addr_set_zero(&netif->netmask); -#ifdef LOSCFG_NET_CONTAINER - if (netif == group->netif_default) { - (void)netif_set_default(NULL, group); -#else if (netif == netif_default) { (void)netif_set_default(NULL); -#endif } #if LWIP_IPV4 && LWIP_ARP @@ -751,11 +708,7 @@ static u8_t lwip_ioctl_internal_SIOCGIFNETMASK(struct ifreq *ifr) } } -#ifdef LOSCFG_NET_CONTAINER -static u8_t lwip_ioctl_internal_SIOCSIFNETMASK(struct ifreq *ifr, struct net_group *group) -#else static u8_t lwip_ioctl_internal_SIOCSIFNETMASK(struct ifreq *ifr) -#endif { struct netif *netif = NULL; @@ -789,20 +742,12 @@ static u8_t lwip_ioctl_internal_SIOCSIFNETMASK(struct ifreq *ifr) return 0; } /* check data valid */ -#ifdef LOSCFG_NET_CONTAINER - if (ip_addr_netmask_valid(ip_2_ip4(&taget_addr)) == 0) { -#else if (ip_addr_netmask_valid(ip_2_ip4(&taget_addr)) != 0) { -#endif return EINVAL; } /* lwip disallow two netif sit in same net at the same time */ -#ifdef LOSCFG_NET_CONTAINER - loc_netif = group->netif_list; -#else loc_netif = netif_list; -#endif while (loc_netif != NULL) { if (loc_netif == netif) { loc_netif = loc_netif->next; @@ -828,13 +773,8 @@ static u8_t lwip_ioctl_internal_SIOCSIFNETMASK(struct ifreq *ifr) /* check if gateway still reachable */ if (!ip_addr_netcmp(&netif->gw, &netif->ip_addr, ip_2_ip4(&taget_addr))) { ip_addr_set_zero(&(netif->gw)); -#ifdef LOSCFG_NET_CONTAINER - if (netif == group->netif_default) { - (void)netif_set_default(NULL, group); -#else if (netif == netif_default) { (void)netif_set_default(NULL); -#endif } } return 0; @@ -863,10 +803,12 @@ static u8_t lwip_ioctl_internal_SIOCSIFHWADDR(struct ifreq *ifr) } #endif else { + /* bring netif down to clear all Neighbor Cache Entry */ (void)netif_set_down(netif); ret = netif_set_hwaddr(netif, (const unsigned char *)ifr->ifr_hwaddr.sa_data, netif->hwaddr_len); + if (ret != ERR_OK) { (void)netif_set_up(netif); return err_to_errno(ret); @@ -1037,6 +979,7 @@ static u8_t lwip_ioctl_internal_SIOCGIFFLAGS(struct ifreq *ifr) #endif /* LWIP_IGMP || LWIP_IPV6_MLD */ #if LWIP_DHCP + //if ((netif->flags & NETIF_FLAG_DHCP) != 0) { if (dhcp_supplied_address(netif)) { ifr->ifr_flags = (short)((unsigned short)ifr->ifr_flags | IFF_DYNAMIC); } else { @@ -1062,19 +1005,12 @@ static u8_t lwip_ioctl_internal_SIOCGIFFLAGS(struct ifreq *ifr) } } -#ifdef LOSCFG_NET_CONTAINER -static u8_t lwip_ioctl_internal_SIOCGIFNAME(struct ifreq *ifr, struct net_group *group) -#else static u8_t lwip_ioctl_internal_SIOCGIFNAME(struct ifreq *ifr) -#endif { struct netif *netif = NULL; int ret; -#ifdef LOSCFG_NET_CONTAINER - for (netif = group->netif_list; netif != NULL; netif = netif->next) { -#else + for (netif = netif_list; netif != NULL; netif = netif->next) { -#endif if (ifr->ifr_ifindex == netif_get_index(netif)) { break; } @@ -1154,6 +1090,7 @@ static u8_t lwip_ioctl_internal_SIOCSIFNAME(struct ifreq *ifr) #endif netif = netif_find(ifr->ifr_name); + if (netif == NULL) { return ENODEV; } else if (netif->link_layer_type == LOOPBACK_IF) { @@ -1228,6 +1165,7 @@ static u8_t lwip_ioctl_internal_SIOCGIFMTU(struct ifreq *ifr) /* get netif hw addr */ netif = netif_find(ifr->ifr_name); + if (netif == NULL) { return ENODEV; } else { @@ -1392,9 +1330,7 @@ static u8_t lwip_ioctl_impl(const struct lwip_sock *sock, long cmd, void *argp) /* allow it only on IPv6 sockets... */ is_ipv6 = NETCONNTYPE_ISIPV6((unsigned int)(sock->conn->type)); #endif -#ifdef LOSCFG_NET_CONTAINER - struct net_group *group = get_net_group_from_ippcb(sock->conn->pcb.ip); -#endif + switch ((u32_t)cmd) { #if LWIP_IPV6 #if LWIP_IPV6_DUP_DETECT_ATTEMPTS @@ -1440,11 +1376,7 @@ static u8_t lwip_ioctl_impl(const struct lwip_sock *sock, long cmd, void *argp) if (is_ipv6 != 0) { err = EINVAL; } else { -#ifdef LOSCFG_NET_CONTAINER - err = lwip_ioctl_internal_SIOCADDRT(rmten, group); -#else err = lwip_ioctl_internal_SIOCADDRT(rmten); -#endif } break; #endif @@ -1454,11 +1386,7 @@ static u8_t lwip_ioctl_impl(const struct lwip_sock *sock, long cmd, void *argp) if (is_ipv6 != 0) { err = EINVAL; } else { -#ifdef LOSCFG_NET_CONTAINER - err = lwip_ioctl_internal_SIOCGIFCONF(ifr, group); -#else err = lwip_ioctl_internal_SIOCGIFCONF(ifr); -#endif } break; case SIOCGIFADDR: @@ -1472,11 +1400,7 @@ static u8_t lwip_ioctl_impl(const struct lwip_sock *sock, long cmd, void *argp) if (is_ipv6 != 0) { err = lwip_ioctl_internal_SIOCSIFADDR_6(ifr); } else { -#ifdef LOSCFG_NET_CONTAINER - err = lwip_ioctl_internal_SIOCSIFADDR(ifr, group); -#else err = lwip_ioctl_internal_SIOCSIFADDR(ifr); -#endif } break; case SIOCDIFADDR: @@ -1484,11 +1408,7 @@ static u8_t lwip_ioctl_impl(const struct lwip_sock *sock, long cmd, void *argp) if (is_ipv6 != 0) { err = lwip_ioctl_internal_SIOCDIFADDR_6(ifr); } else { -#ifdef LOSCFG_NET_CONTAINER - err = lwip_ioctl_internal_SIOCDIFADDR(ifr, group); -#else err = lwip_ioctl_internal_SIOCDIFADDR(ifr); -#endif } break; case SIOCGIFNETMASK: @@ -1502,11 +1422,7 @@ static u8_t lwip_ioctl_impl(const struct lwip_sock *sock, long cmd, void *argp) if (is_ipv6 != 0) { err = EINVAL; } else { -#ifdef LOSCFG_NET_CONTAINER - err = lwip_ioctl_internal_SIOCSIFNETMASK(ifr, group); -#else err = lwip_ioctl_internal_SIOCSIFNETMASK(ifr); -#endif } break; case SIOCSIFHWADDR: @@ -1522,11 +1438,7 @@ static u8_t lwip_ioctl_impl(const struct lwip_sock *sock, long cmd, void *argp) err = lwip_ioctl_internal_SIOCGIFFLAGS(ifr); break; case SIOCGIFNAME: -#ifdef LOSCFG_NET_CONTAINER - err = lwip_ioctl_internal_SIOCGIFNAME(ifr, group); -#else err = lwip_ioctl_internal_SIOCGIFNAME(ifr); -#endif break; case SIOCSIFNAME: err = lwip_ioctl_internal_SIOCSIFNAME(ifr); diff --git a/src/kernel_liteos_a/net/lwip-2.1/porting/src/sys_arch.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/net/lwip-2.1/porting/src/sys_arch.c similarity index 100% rename from src/kernel_liteos_a/net/lwip-2.1/porting/src/sys_arch.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/net/lwip-2.1/porting/src/sys_arch.c diff --git a/src/kernel_liteos_a/net/mac/los_mac.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/net/mac/los_mac.h similarity index 100% rename from src/kernel_liteos_a/net/mac/los_mac.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/net/mac/los_mac.h diff --git a/src/kernel_liteos_a/net/telnet/BUILD.gn b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/net/telnet/BUILD.gn similarity index 100% rename from src/kernel_liteos_a/net/telnet/BUILD.gn rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/net/telnet/BUILD.gn diff --git a/src/kernel_liteos_a/net/telnet/Kconfig b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/net/telnet/Kconfig similarity index 100% rename from src/kernel_liteos_a/net/telnet/Kconfig rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/net/telnet/Kconfig diff --git a/src/kernel_liteos_a/net/telnet/Makefile b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/net/telnet/Makefile similarity index 100% rename from src/kernel_liteos_a/net/telnet/Makefile rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/net/telnet/Makefile diff --git a/src/kernel_liteos_a/net/telnet/include/telnet_dev.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/net/telnet/include/telnet_dev.h similarity index 100% rename from src/kernel_liteos_a/net/telnet/include/telnet_dev.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/net/telnet/include/telnet_dev.h diff --git a/src/kernel_liteos_a/net/telnet/include/telnet_loop.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/net/telnet/include/telnet_loop.h similarity index 100% rename from src/kernel_liteos_a/net/telnet/include/telnet_loop.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/net/telnet/include/telnet_loop.h diff --git a/src/kernel_liteos_a/net/telnet/include/telnet_pri.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/net/telnet/include/telnet_pri.h similarity index 100% rename from src/kernel_liteos_a/net/telnet/include/telnet_pri.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/net/telnet/include/telnet_pri.h diff --git a/src/kernel_liteos_a/net/telnet/src/telnet_dev.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/net/telnet/src/telnet_dev.c similarity index 100% rename from src/kernel_liteos_a/net/telnet/src/telnet_dev.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/net/telnet/src/telnet_dev.c diff --git a/src/kernel_liteos_a/net/telnet/src/telnet_loop.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/net/telnet/src/telnet_loop.c similarity index 100% rename from src/kernel_liteos_a/net/telnet/src/telnet_loop.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/net/telnet/src/telnet_loop.c diff --git a/src/kernel_liteos_a/platform/BUILD.gn b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/platform/BUILD.gn similarity index 100% rename from src/kernel_liteos_a/platform/BUILD.gn rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/platform/BUILD.gn diff --git a/src/kernel_liteos_a/platform/Kconfig b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/platform/Kconfig similarity index 92% rename from src/kernel_liteos_a/platform/Kconfig rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/platform/Kconfig index 57f14f37..39357095 100644 --- a/src/kernel_liteos_a/platform/Kconfig +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/platform/Kconfig @@ -27,7 +27,6 @@ choice - hi3518ev300 Qemu ARM Virt variants (based on different CPU types): - qemu_arm_virt_ca7 - - stm32mp157 config PLATFORM_HI3516DV300 bool "hi3516dv300" @@ -42,9 +41,7 @@ config PLATFORM_QEMU_ARM_VIRT_CA7 select ARCH_CORTEX_A7 help QEMU ARM Virtual Platform using Cortex-A7 CPU. -config PLATFORM_STM32MP157 - bool "stm32mp157" - select ARCH_CORTEX_A7 + endchoice choice @@ -64,9 +61,6 @@ config PRODUCT_HISPARK_ARIES config PRODUCT_QEMU_ARM bool "arm_virt" if PLATFORM_QEMU_ARM_VIRT_CA7 - -config LOSCFG_PRODUCT_BEARPI_HM_MICRO - bool "bearpi_hm_micro" if PLATFORM_STM32MP157 endchoice config BOARD_CONFIG_PATH diff --git a/src/kernel_liteos_a/platform/Makefile b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/platform/Makefile similarity index 100% rename from src/kernel_liteos_a/platform/Makefile rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/platform/Makefile diff --git a/src/kernel_liteos_a/platform/board.ld.S b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/platform/board.ld.S similarity index 100% rename from src/kernel_liteos_a/platform/board.ld.S rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/platform/board.ld.S diff --git a/src/kernel_liteos_a/platform/bsp.mk b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/platform/bsp.mk similarity index 100% rename from src/kernel_liteos_a/platform/bsp.mk rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/platform/bsp.mk diff --git a/src/kernel_liteos_a/security/BUILD.gn b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/security/BUILD.gn similarity index 100% rename from src/kernel_liteos_a/security/BUILD.gn rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/security/BUILD.gn diff --git a/src/kernel_liteos_a/security/Kconfig b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/security/Kconfig similarity index 100% rename from src/kernel_liteos_a/security/Kconfig rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/security/Kconfig diff --git a/src/kernel_liteos_a/security/Makefile b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/security/Makefile similarity index 100% rename from src/kernel_liteos_a/security/Makefile rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/security/Makefile diff --git a/src/kernel_liteos_a/security/cap/BUILD.gn b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/security/cap/BUILD.gn similarity index 100% rename from src/kernel_liteos_a/security/cap/BUILD.gn rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/security/cap/BUILD.gn diff --git a/src/kernel_liteos_a/security/cap/Makefile b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/security/cap/Makefile similarity index 100% rename from src/kernel_liteos_a/security/cap/Makefile rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/security/cap/Makefile diff --git a/src/kernel_liteos_a/security/cap/capability.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/security/cap/capability.c similarity index 100% rename from src/kernel_liteos_a/security/cap/capability.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/security/cap/capability.c diff --git a/src/kernel_liteos_a/security/cap/capability_api.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/security/cap/capability_api.h similarity index 100% rename from src/kernel_liteos_a/security/cap/capability_api.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/security/cap/capability_api.h diff --git a/src/kernel_liteos_a/security/cap/capability_type.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/security/cap/capability_type.h similarity index 100% rename from src/kernel_liteos_a/security/cap/capability_type.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/security/cap/capability_type.h diff --git a/src/kernel_liteos_a/security/vid/BUILD.gn b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/security/vid/BUILD.gn similarity index 100% rename from src/kernel_liteos_a/security/vid/BUILD.gn rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/security/vid/BUILD.gn diff --git a/src/kernel_liteos_a/security/vid/vid.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/security/vid/vid.c similarity index 98% rename from src/kernel_liteos_a/security/vid/vid.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/security/vid/vid.c index 98071cb7..ba3f48f4 100644 --- a/src/kernel_liteos_a/security/vid/vid.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/security/vid/vid.c @@ -116,8 +116,8 @@ static UINT16 GetFreeVid(VOID) for (i = 0; i < mapMaxNum; i++) { num = idMap->bitMap[i]; for (j = 0; j < INT_BIT_COUNT; j++) { - if ((num & (1U << j)) == 0) { - num |= 1U << j; + if ((num & (1 << j)) == 0) { + num |= 1 << j; idMap->bitMap[i] = num; return (INT_BIT_COUNT * i + j); } @@ -160,7 +160,7 @@ static VOID ReleaseVid(UINT16 vid) a = vid >> INT_BIT_SHIFT; b = vid & (INT_BIT_COUNT - 1); - idMap->bitMap[a] &= ~(1U << b); + idMap->bitMap[a] &= ~(1 << b); /* shrink bit map */ if (mapMaxNum > 1) { diff --git a/src/kernel_liteos_a/security/vid/vid_api.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/security/vid/vid_api.h similarity index 95% rename from src/kernel_liteos_a/security/vid/vid_api.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/security/vid/vid_api.h index ade2baac..12a7c75d 100644 --- a/src/kernel_liteos_a/security/vid/vid_api.h +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/security/vid/vid_api.h @@ -34,9 +34,9 @@ #include "los_typedef.h" #include "los_process_pri.h" -#define INT_BIT_COUNT 32U -#define INT_BIT_SHIFT 5U -#define VID_MAP_MAX_NUM 32U +#define INT_BIT_COUNT 32 +#define INT_BIT_SHIFT 5 +#define VID_MAP_MAX_NUM 32 #define MAX_INVALID_TIMER_VID (VID_MAP_MAX_NUM * INT_BIT_COUNT) diff --git a/src/kernel_liteos_a/security/vid/vid_type.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/security/vid/vid_type.h similarity index 100% rename from src/kernel_liteos_a/security/vid/vid_type.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/security/vid/vid_type.h diff --git a/src/kernel_liteos_a/shell/BUILD.gn b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/shell/BUILD.gn similarity index 100% rename from src/kernel_liteos_a/shell/BUILD.gn rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/shell/BUILD.gn diff --git a/src/kernel_liteos_a/shell/Kconfig b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/shell/Kconfig similarity index 100% rename from src/kernel_liteos_a/shell/Kconfig rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/shell/Kconfig diff --git a/src/kernel_liteos_a/shell/Makefile b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/shell/Makefile similarity index 100% rename from src/kernel_liteos_a/shell/Makefile rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/shell/Makefile diff --git a/src/kernel_liteos_a/shell/full/include/dmesg.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/shell/full/include/dmesg.h similarity index 100% rename from src/kernel_liteos_a/shell/full/include/dmesg.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/shell/full/include/dmesg.h diff --git a/src/kernel_liteos_a/shell/full/include/dmesg_pri.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/shell/full/include/dmesg_pri.h similarity index 100% rename from src/kernel_liteos_a/shell/full/include/dmesg_pri.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/shell/full/include/dmesg_pri.h diff --git a/src/kernel_liteos_a/shell/full/include/shcmd.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/shell/full/include/shcmd.h similarity index 100% rename from src/kernel_liteos_a/shell/full/include/shcmd.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/shell/full/include/shcmd.h diff --git a/src/kernel_liteos_a/shell/full/include/shcmdparse.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/shell/full/include/shcmdparse.h similarity index 100% rename from src/kernel_liteos_a/shell/full/include/shcmdparse.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/shell/full/include/shcmdparse.h diff --git a/src/kernel_liteos_a/shell/full/include/shell.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/shell/full/include/shell.h similarity index 100% rename from src/kernel_liteos_a/shell/full/include/shell.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/shell/full/include/shell.h diff --git a/src/kernel_liteos_a/shell/full/include/shell_lk.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/shell/full/include/shell_lk.h similarity index 100% rename from src/kernel_liteos_a/shell/full/include/shell_lk.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/shell/full/include/shell_lk.h diff --git a/src/kernel_liteos_a/shell/full/include/shell_pri.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/shell/full/include/shell_pri.h similarity index 100% rename from src/kernel_liteos_a/shell/full/include/shell_pri.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/shell/full/include/shell_pri.h diff --git a/src/kernel_liteos_a/shell/full/include/shmsg.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/shell/full/include/shmsg.h similarity index 100% rename from src/kernel_liteos_a/shell/full/include/shmsg.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/shell/full/include/shmsg.h diff --git a/src/kernel_liteos_a/shell/full/include/show.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/shell/full/include/show.h similarity index 100% rename from src/kernel_liteos_a/shell/full/include/show.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/shell/full/include/show.h diff --git a/src/kernel_liteos_a/shell/full/src/base/shcmd.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/shell/full/src/base/shcmd.c similarity index 100% rename from src/kernel_liteos_a/shell/full/src/base/shcmd.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/shell/full/src/base/shcmd.c diff --git a/src/kernel_liteos_a/shell/full/src/base/shcmdparse.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/shell/full/src/base/shcmdparse.c similarity index 100% rename from src/kernel_liteos_a/shell/full/src/base/shcmdparse.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/shell/full/src/base/shcmdparse.c diff --git a/src/kernel_liteos_a/shell/full/src/base/shell_lk.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/shell/full/src/base/shell_lk.c similarity index 98% rename from src/kernel_liteos_a/shell/full/src/base/shell_lk.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/shell/full/src/base/shell_lk.c index 88dad16a..1792d248 100644 --- a/src/kernel_liteos_a/shell/full/src/base/shell_lk.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/shell/full/src/base/shell_lk.c @@ -145,7 +145,7 @@ INT32 CmdLog(INT32 argc, const CHAR **argv) } } else if (!strncmp(argv[0], "module", strlen(argv[0]) + 1)) { module = strtoul(argv[1], &p, 0); - if ((*p != 0) || (module > MODULE4)) { + if ((*p != 0) || (module > MODULE4) || (module < MODULE0)) { PRINTK("log %s can't access %s\n", argv[0], argv[1]); PRINTK("not support yet\n"); return -1; diff --git a/src/kernel_liteos_a/shell/full/src/base/shmsg.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/shell/full/src/base/shmsg.c similarity index 99% rename from src/kernel_liteos_a/shell/full/src/base/shmsg.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/shell/full/src/base/shmsg.c index 52f80ff0..cf07fa48 100644 --- a/src/kernel_liteos_a/shell/full/src/base/shmsg.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/shell/full/src/base/shmsg.c @@ -329,7 +329,7 @@ END: LITE_OS_SEC_TEXT_MINOR UINT32 ShellEntry(UINTPTR param) { CHAR ch; - INT32 n; + INT32 n = 0; ShellCB *shellCB = (ShellCB *)param; CONSOLE_CB *consoleCB = OsGetConsoleByID((INT32)shellCB->consoleID); diff --git a/src/kernel_liteos_a/shell/full/src/base/show.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/shell/full/src/base/show.c similarity index 100% rename from src/kernel_liteos_a/shell/full/src/base/show.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/shell/full/src/base/show.c diff --git a/src/kernel_liteos_a/shell/full/src/cmds/date_shellcmd.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/shell/full/src/cmds/date_shellcmd.c similarity index 100% rename from src/kernel_liteos_a/shell/full/src/cmds/date_shellcmd.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/shell/full/src/cmds/date_shellcmd.c diff --git a/src/kernel_liteos_a/shell/full/src/cmds/dmesg.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/shell/full/src/cmds/dmesg.c similarity index 99% rename from src/kernel_liteos_a/shell/full/src/cmds/dmesg.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/shell/full/src/cmds/dmesg.c index 114669e0..a75a2c61 100644 --- a/src/kernel_liteos_a/shell/full/src/cmds/dmesg.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/shell/full/src/cmds/dmesg.c @@ -425,7 +425,7 @@ STATIC VOID OsBufFullWrite(const CHAR *dst, UINT32 logLen) STATIC VOID OsWriteTailToHead(const CHAR *dst, UINT32 logLen) { - UINT32 writeLen; + UINT32 writeLen = 0; UINT32 bufSize = g_logBufSize; UINT32 logSize = g_dmesgInfo->logSize; UINT32 tail = g_dmesgInfo->logTail; diff --git a/src/kernel_liteos_a/shell/full/src/cmds/hwi_shellcmd.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/shell/full/src/cmds/hwi_shellcmd.c similarity index 52% rename from src/kernel_liteos_a/shell/full/src/cmds/hwi_shellcmd.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/shell/full/src/cmds/hwi_shellcmd.c index 74f34d5f..4a4a062f 100644 --- a/src/kernel_liteos_a/shell/full/src/cmds/hwi_shellcmd.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/shell/full/src/cmds/hwi_shellcmd.c @@ -40,54 +40,15 @@ #ifdef LOSCFG_CPUP_INCLUDE_IRQ -#define IRQ_CPUP_INFO_SIZE (sizeof(CPUP_INFO_S) * OS_HWI_MAX_NUM * LOSCFG_KERNEL_CORE_NUM) -#define IRQ_CPUP_ALL_INFO_SIZE (3 * IRQ_CPUP_INFO_SIZE) -#define IRQ_DATA_SZIE (sizeof(OsIrqCpupCB) * LOSCFG_KERNEL_CORE_NUM) -#define CPUP_PRECISION_MULT LOS_CPUP_PRECISION_MULT - -STATIC VOID ShellCmdHwiInfoShow(OsIrqCpupCB *irqData, CPUP_INFO_S *hwiCpup1s, - CPUP_INFO_S *hwiCpup10s, CPUP_INFO_S *hwiCpupAll) -{ - UINT32 intSave; - OsIrqCpupCB *irqDataBase = OsGetIrqCpupArrayBase(); - - for (UINT32 i = OS_HWI_FORM_EXC_NUM; i < OS_HWI_MAX_NUM + OS_HWI_FORM_EXC_NUM; i++) { - if (!HWI_IS_REGISTED(i)) { - continue; - } - - intSave = LOS_IntLock(); - (VOID)memcpy_s(irqData, IRQ_DATA_SZIE, &irqDataBase[i * LOSCFG_KERNEL_CORE_NUM], IRQ_DATA_SZIE); - LOS_IntRestore(intSave); - - for (UINT32 cpu = 0; cpu < LOSCFG_KERNEL_CORE_NUM; cpu++) { - UINT64 cycles = 0; - UINT64 timeMax = 0; - OsIrqCpupCB *data = &irqData[cpu]; - if (data->status == 0) { - continue; - } - UINT32 count = OsGetHwiFormCnt(cpu, i); - if (count != 0) { - if (data->count != 0) { - cycles = (data->allTime * OS_NS_PER_CYCLE) / (data->count * OS_SYS_NS_PER_US); - } - timeMax = (data->timeMax * OS_NS_PER_CYCLE) / 1000; - } - CHAR *irqName = OsGetHwiFormName(i); - UINT32 index = (i * LOSCFG_KERNEL_CORE_NUM) + cpu; - PRINTK(" %10u:%5u%11u%11llu%10llu%6u.%-2u%8u.%-2u%7u.%-2u%7s %-12s\n", i, cpu, count, cycles, timeMax, - hwiCpupAll[index].usage / CPUP_PRECISION_MULT, hwiCpupAll[index].usage % CPUP_PRECISION_MULT, - hwiCpup10s[index].usage / CPUP_PRECISION_MULT, hwiCpup10s[index].usage % CPUP_PRECISION_MULT, - hwiCpup1s[index].usage / CPUP_PRECISION_MULT, hwiCpup1s[index].usage % CPUP_PRECISION_MULT, - (g_hwiForm[index].uwParam == IRQF_SHARED) ? "shared" : "normal", (irqName != NULL) ? irqName : ""); - } - } -} - +STATIC CPUP_INFO_S hwiCpupAll[OS_HWI_MAX_NUM]; +STATIC CPUP_INFO_S hwiCpup10s[OS_HWI_MAX_NUM]; +STATIC CPUP_INFO_S hwiCpup1s[OS_HWI_MAX_NUM]; LITE_OS_SEC_TEXT_MINOR UINT32 OsShellCmdHwi(INT32 argc, const CHAR **argv) { - UINT32 size; + UINT32 i; + UINT64 cycles; + size_t size = sizeof(CPUP_INFO_S) * OS_HWI_MAX_NUM; + OsIrqCpupCB *irqCpup = OsGetIrqCpupArrayBase(); (VOID)argv; if (argc > 0) { @@ -95,24 +56,38 @@ LITE_OS_SEC_TEXT_MINOR UINT32 OsShellCmdHwi(INT32 argc, const CHAR **argv) return OS_ERROR; } - size = IRQ_CPUP_ALL_INFO_SIZE + IRQ_DATA_SZIE; - CHAR *irqCpup = LOS_MemAlloc(m_aucSysMem0, size); if (irqCpup == NULL) { return OS_ERROR; } - CPUP_INFO_S *hwiCpupAll = (CPUP_INFO_S *)irqCpup; - CPUP_INFO_S *hwiCpup10s = (CPUP_INFO_S *)(irqCpup + IRQ_CPUP_INFO_SIZE); - CPUP_INFO_S *hwiCpup1s = (CPUP_INFO_S *)(irqCpup + 2 * IRQ_CPUP_INFO_SIZE); /* 2: offset */ - OsIrqCpupCB *irqData = (OsIrqCpupCB *)(irqCpup + IRQ_CPUP_ALL_INFO_SIZE); - - (VOID)LOS_GetAllIrqCpuUsage(CPUP_ALL_TIME, hwiCpupAll, IRQ_CPUP_INFO_SIZE); - (VOID)LOS_GetAllIrqCpuUsage(CPUP_LAST_TEN_SECONDS, hwiCpup10s, IRQ_CPUP_INFO_SIZE); - (VOID)LOS_GetAllIrqCpuUsage(CPUP_LAST_ONE_SECONDS, hwiCpup1s, IRQ_CPUP_INFO_SIZE); + (VOID)LOS_GetAllIrqCpuUsage(CPUP_ALL_TIME, hwiCpupAll, size); + (VOID)LOS_GetAllIrqCpuUsage(CPUP_LAST_TEN_SECONDS, hwiCpup10s, size); + (VOID)LOS_GetAllIrqCpuUsage(CPUP_LAST_ONE_SECONDS, hwiCpup1s, size); - PRINTK(" InterruptNo cpu Count ATime(us) MTime(us) CPUUSE CPUUSE10s CPUUSE1s Mode Name\n"); - ShellCmdHwiInfoShow(irqData, hwiCpup1s, hwiCpup10s, hwiCpupAll); - (VOID)LOS_MemFree(m_aucSysMem0, irqCpup); + PRINTK(" InterruptNo Count ATime(us) CPUUSE CPUUSE10s CPUUSE1s Mode Name\n"); + for (i = OS_HWI_FORM_EXC_NUM; i < OS_HWI_MAX_NUM + OS_HWI_FORM_EXC_NUM; i++) { + UINT32 count = OsGetHwiFormCnt(i); + if (count) { + cycles = (((OsIrqCpupCB *)(&irqCpup[i]))->cpup.allTime * OS_NS_PER_CYCLE) / (count * OS_SYS_NS_PER_US); + } else { + cycles = 0; + } + /* Different cores has different hwi form implementation */ + if (HWI_IS_REGISTED(i)) { + PRINTK(" %10u:%11u%11llu", i, count, cycles); + } else { + continue; + } + PRINTK("%6u.%-2u%8u.%-2u%7u.%-2u%7s %-12s\n", + hwiCpupAll[i].usage / LOS_CPUP_PRECISION_MULT, + hwiCpupAll[i].usage % LOS_CPUP_PRECISION_MULT, + hwiCpup10s[i].usage / LOS_CPUP_PRECISION_MULT, + hwiCpup10s[i].usage % LOS_CPUP_PRECISION_MULT, + hwiCpup1s[i].usage / LOS_CPUP_PRECISION_MULT, + hwiCpup1s[i].usage % LOS_CPUP_PRECISION_MULT, + (g_hwiForm[i].uwParam == IRQF_SHARED) ? "shared" : "normal", + (OsGetHwiFormName(i) != NULL) ? OsGetHwiFormName(i) : ""); + } return 0; } #else diff --git a/src/kernel_liteos_a/shell/full/src/cmds/shell_shellcmd.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/shell/full/src/cmds/shell_shellcmd.c similarity index 100% rename from src/kernel_liteos_a/shell/full/src/cmds/shell_shellcmd.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/shell/full/src/cmds/shell_shellcmd.c diff --git a/src/kernel_liteos_a/shell/full/src/cmds/watch_shellcmd.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/shell/full/src/cmds/watch_shellcmd.c similarity index 100% rename from src/kernel_liteos_a/shell/full/src/cmds/watch_shellcmd.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/shell/full/src/cmds/watch_shellcmd.c diff --git a/src/kernel_liteos_a/syscall/BUILD.gn b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/syscall/BUILD.gn similarity index 100% rename from src/kernel_liteos_a/syscall/BUILD.gn rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/syscall/BUILD.gn diff --git a/src/kernel_liteos_a/syscall/Makefile b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/syscall/Makefile similarity index 100% rename from src/kernel_liteos_a/syscall/Makefile rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/syscall/Makefile diff --git a/src/kernel_liteos_a/syscall/fs_syscall.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/syscall/fs_syscall.c similarity index 94% rename from src/kernel_liteos_a/syscall/fs_syscall.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/syscall/fs_syscall.c index eec9b5b4..40d4c0c2 100644 --- a/src/kernel_liteos_a/syscall/fs_syscall.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/syscall/fs_syscall.c @@ -291,135 +291,17 @@ ssize_t SysWrite(int fd, const void *buf, size_t nbytes) return ret; } -// int vfs_normalize_path(const char *directory, const char *filename, char **pathname) -#ifdef LOSCFG_PID_CONTAINER -#ifdef LOSCFG_PROC_PROCESS_DIR -#define PROCESS_DIR_ROOT "/proc" -static char *NextName(char *pos, uint8_t *len) -{ - char *name = NULL; - while (*pos != 0 && *pos == '/') { - pos++; - } - if (*pos == '\0') { - return NULL; - } - name = (char *)pos; - while (*pos != '\0' && *pos != '/') { - pos++; - } - *len = pos - name; - return name; -} - -static unsigned int ProcRealProcessIDGet(unsigned int pid) -{ - unsigned int intSave; - if (OS_PID_CHECK_INVALID(pid)) { - return 0; - } - - SCHEDULER_LOCK(intSave); - LosProcessCB *pcb = OsGetPCBFromVpid(pid); - if (OsProcessIsInactive(pcb)) { - SCHEDULER_UNLOCK(intSave); - return 0; - } - - int rootPid = OsGetRootPid(pcb); - SCHEDULER_UNLOCK(intSave); - if ((rootPid == OS_INVALID_VALUE) || (rootPid == pid)) { - return 0; - } - - return rootPid; -} - -static int ProcRealProcessDirGet(char *path) -{ - char pidBuf[PATH_MAX] = {0}; - char *fullPath = NULL; - uint8_t strLen = 0; - int pid, rootPid; - int ret = vfs_normalize_path(NULL, path, &fullPath); - if (ret < 0) { - return ret; - } - - int procLen = strlen(PROCESS_DIR_ROOT); - if (strncmp(fullPath, PROCESS_DIR_ROOT, procLen) != 0) { - free(fullPath); - return 0; - } - - char *pidStr = NextName(fullPath + procLen, &strLen); - if (pidStr == NULL) { - free(fullPath); - return 0; - } - - if ((*pidStr <= '0') || (*pidStr > '9')) { - free(fullPath); - return 0; - } - - if (memcpy_s(pidBuf, PATH_MAX, pidStr, strLen) != EOK) { - free(fullPath); - return 0; - } - pidBuf[strLen] = '\0'; - - pid = atoi(pidBuf); - if (pid == 0) { - free(fullPath); - return 0; - } - - rootPid = ProcRealProcessIDGet((unsigned)pid); - if (rootPid == 0) { - free(fullPath); - return 0; - } - - if (snprintf_s(path, PATH_MAX + 1, PATH_MAX, "/proc/%d%s", rootPid, (pidStr + strLen)) < 0) { - free(fullPath); - return -EFAULT; - } - - free(fullPath); - return 0; -} -#endif -#endif - -static int GetPath(const char *path, char **pathRet) -{ - int ret = UserPathCopy(path, pathRet); - if (ret != 0) { - return ret; - } -#ifdef LOSCFG_PID_CONTAINER -#ifdef LOSCFG_PROC_PROCESS_DIR - ret = ProcRealProcessDirGet(*pathRet); - if (ret != 0) { - return ret; - } -#endif -#endif - return 0; -} - int SysOpen(const char *path, int oflags, ...) { int ret; - int procFd = -1; + int procFd; mode_t mode = DEFAULT_FILE_MODE; /* 0666: File read-write properties. */ char *pathRet = NULL; if (path != NULL) { - ret = GetPath(path, &pathRet); + ret = UserPathCopy(path, &pathRet); if (ret != 0) { - goto ERROUT; + return ret; } } @@ -550,15 +432,6 @@ ssize_t SysReadlink(const char *pathname, char *buf, size_t bufsize) if (ret != 0) { goto OUT; } - -#ifdef LOSCFG_PID_CONTAINER -#ifdef LOSCFG_PROC_PROCESS_DIR - ret = ProcRealProcessDirGet(pathRet); - if (ret != 0) { - goto OUT; - } -#endif -#endif } if (!LOS_IsUserAddressRange((vaddr_t)(UINTPTR)buf, bufsize)) { @@ -1647,7 +1520,7 @@ ssize_t SysPread64(int fd, void *buf, size_t nbytes, off64_t offset) if (bufRet == NULL) { return -ENOMEM; } - (void)memset_s(bufRet, nbytes, 0, nbytes); + ret = pread64(fd, (buf ? bufRet : NULL), nbytes, offset); if (ret < 0) { (void)LOS_MemFree(OS_SYS_MEM_ADDR, bufRet); @@ -1967,15 +1840,6 @@ ssize_t SysReadlinkat(int dirfd, const char *pathname, char *buf, size_t bufsize if (ret != 0) { goto OUT; } - -#ifdef LOSCFG_PID_CONTAINER -#ifdef LOSCFG_PROC_PROCESS_DIR - ret = ProcRealProcessDirGet(pathRet); - if (ret != 0) { - goto OUT; - } -#endif -#endif } if (dirfd != AT_FDCWD) { @@ -2737,15 +2601,18 @@ int SysPselect6(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, return ret; } -static int DoEpollCreate1(int flags) +int SysEpollCreate(int size) { int ret; int procFd; - ret = epoll_create1(flags); + if (size <= 0) { + return -EINVAL; + } + + ret = epoll_create(size); if (ret < 0) { ret = -get_errno(); - return ret; } procFd = AllocAndAssocProcessFd((INTPTR)(ret), MIN_START_FD); @@ -2757,15 +2624,23 @@ static int DoEpollCreate1(int flags) return procFd; } -int SysEpollCreate(int size) -{ - (void)size; - return DoEpollCreate1(0); -} - int SysEpollCreate1(int flags) { - return DoEpollCreate1(flags); + int ret; + int procFd; + + ret = epoll_create(flags); + if (ret < 0) { + ret = -get_errno(); + } + + procFd = AllocAndAssocProcessFd((INTPTR)(ret), MIN_START_FD); + if (procFd == -1) { + epoll_close(ret); + return -EMFILE; + } + + return procFd; } int SysEpollCtl(int epfd, int op, int fd, struct epoll_event *ev) @@ -2853,28 +2728,4 @@ OUT: return (ret == -1) ? -get_errno() : ret; } -#ifdef LOSCFG_CHROOT -int SysChroot(const char *path) -{ - int ret; - char *pathRet = NULL; - - if (path != NULL) { - ret = UserPathCopy(path, &pathRet); - if (ret != 0) { - goto OUT; - } - } - - ret = chroot(path ? pathRet : NULL); - if (ret < 0) { - ret = -get_errno(); - } -OUT: - if (pathRet != NULL) { - (void)LOS_MemFree(OS_SYS_MEM_ADDR, pathRet); - } - return ret; -} -#endif #endif diff --git a/src/kernel_liteos_a/syscall/ipc_syscall.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/syscall/ipc_syscall.c similarity index 96% rename from src/kernel_liteos_a/syscall/ipc_syscall.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/syscall/ipc_syscall.c index ca337def..83ebac4b 100644 --- a/src/kernel_liteos_a/syscall/ipc_syscall.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/syscall/ipc_syscall.c @@ -94,15 +94,9 @@ int SysMqClose(mqd_t personal) int SysMqNotify(mqd_t personal, const struct sigevent *sigev) { int ret; - struct sigevent ksigev; - - ret = LOS_ArchCopyFromUser(&ksigev, sigev, sizeof(struct sigevent)); - if (ret != 0) { - return -EFAULT; - } MQUEUE_FD_U2K(personal); - ret = OsMqNotify(personal, &ksigev); + ret = OsMqNotify(personal, sigev); if (ret < 0) { return -get_errno(); } @@ -112,8 +106,7 @@ int SysMqNotify(mqd_t personal, const struct sigevent *sigev) int SysMqGetSetAttr(mqd_t mqd, const struct mq_attr *new, struct mq_attr *old) { int ret; - struct mq_attr knew; - struct mq_attr kold = { 0 }; + struct mq_attr knew, kold; if (new != NULL) { ret = LOS_ArchCopyFromUser(&knew, new, sizeof(struct mq_attr)); @@ -263,7 +256,7 @@ int SysSigTimedWait(const sigset_t_l *setl, siginfo_t *info, const struct timesp sigset_t set; unsigned int tick; int retVal, ret; - siginfo_t infoIntr = { 0 }; + siginfo_t infoIntr; struct timespec timeoutIntr; retVal = LOS_ArchCopyFromUser(&set, &(setl->sig[0]), sizeof(sigset_t)); diff --git a/src/kernel_liteos_a/syscall/los_syscall.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/syscall/los_syscall.c similarity index 100% rename from src/kernel_liteos_a/syscall/los_syscall.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/syscall/los_syscall.c diff --git a/src/kernel_liteos_a/syscall/los_syscall.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/syscall/los_syscall.h similarity index 95% rename from src/kernel_liteos_a/syscall/los_syscall.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/syscall/los_syscall.h index 94267398..99be00e8 100644 --- a/src/kernel_liteos_a/syscall/los_syscall.h +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/syscall/los_syscall.h @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2023 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -72,10 +72,10 @@ extern unsigned int SysGetGroupId(void); extern unsigned int SysGetTid(void); extern void SysSchedYield(int type); extern int SysSchedGetScheduler(int id, int flag); -extern int SysSchedSetScheduler(int id, int policy, const LosSchedParam *userParam, int flag); -extern int SysSchedGetParam(int id, LosSchedParam *userParam, int flag); -extern int SysSchedSetParam(int id, const LosSchedParam *userParam, int flag); -extern int SysSetProcessPriority(int which, int who, int prio); +extern int SysSchedSetScheduler(int id, int policy, int prio, int flag); +extern int SysSchedGetParam(int id, int flag); +extern int SysSchedSetParam(int id, unsigned int prio, int flag); +extern int SysSetProcessPriority(int which, int who, unsigned int prio); extern int SysGetProcessPriority(int which, int who); extern int SysSchedGetPriorityMin(int policy); extern int SysSchedGetPriorityMax(int policy); @@ -84,9 +84,6 @@ extern int SysWait(int pid, USER int *status, int options, void *rusage); extern int SysWaitid(idtype_t type, int pid, USER siginfo_t *info, int options, void *rusage); extern int SysFork(void); extern int SysVfork(void); -extern int SysClone(int flags, void *stack, int *parentTid, unsigned long tls, int *childTid); -extern int SysUnshare(int flags); -extern int SysSetns(int fd, int type); extern unsigned int SysGetPID(void); extern unsigned int SysGetPPID(void); extern int SysSetGroupID(unsigned int gid); @@ -179,9 +176,6 @@ extern int SysShmCtl(int shmid, int cmd, struct shmid_ds *buf); extern int SysShmDt(const void *shmaddr); /* misc */ -#ifdef LOSCFG_UTS_CONTAINER -extern int SysSetHostName(const char *name, size_t len); -#endif extern int SysUname(struct utsname *name); extern int SysInfo(struct sysinfo *info); @@ -219,7 +213,7 @@ extern int do_mkdir(int dirfd, const char *pathname, mode_t mode); extern int do_rmdir(int dirfd, const char *pathname); extern int do_rename(int oldfd, const char *oldpath, int newfd, const char *newpath); extern int do_select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, - struct timeval *timeout, PollFun poll); + struct timeval *timeout, PollFun poll); extern int do_readdir(int fd, struct dirent **de, unsigned int count); extern ssize_t preadv(int __fd, const struct iovec *__iov, int __count, off_t __offset); extern ssize_t pwritev(int __fd, const struct iovec *__iov, int __count, off_t __offset); @@ -286,7 +280,7 @@ extern int SysFstatat64(int fd, const char *restrict path, struct kstat *restric extern int SysFcntl64(int fd, int cmd, void *arg); extern int SysPoll(struct pollfd *fds, nfds_t nfds, int timeout); extern int SysPpoll(struct pollfd *fds, nfds_t nfds, const struct timespec *tmo_p, - const sigset_t *sigmask, int nsig); + const sigset_t *sigmask, int nsig); extern int SysPrctl(int option, ...); extern ssize_t SysPread64(int fd, void *buf, size_t nbytes, off64_t offset); extern ssize_t SysPwrite64(int fd, const void *buf, size_t nbytes, off64_t offset); @@ -319,8 +313,5 @@ extern int SysGetrusage(int what, struct rusage *ru); extern long SysSysconf(int name); extern int SysUgetrlimit(int resource, unsigned long long k_rlim[2]); extern int SysSetrlimit(int resource, unsigned long long k_rlim[2]); -#ifdef LOSCFG_CHROOT -extern int SysChroot(const char *path); -#endif #endif #endif /* _LOS_SYSCALL_H */ diff --git a/src/kernel_liteos_a/syscall/misc_syscall.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/syscall/misc_syscall.c similarity index 86% rename from src/kernel_liteos_a/syscall/misc_syscall.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/syscall/misc_syscall.c index 154e2890..d1627a94 100644 --- a/src/kernel_liteos_a/syscall/misc_syscall.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/syscall/misc_syscall.c @@ -46,44 +46,6 @@ #include "user_copy.h" #include "unistd.h" -#ifdef LOSCFG_UTS_CONTAINER -#define HOST_NAME_MAX_LEN 65 -int SysSetHostName(const char *name, size_t len) -{ - int ret; - char tmpName[HOST_NAME_MAX_LEN]; - unsigned int intSave; - - if (name == NULL) { - return -EFAULT; - } - - if ((len < 0) || (len > HOST_NAME_MAX_LEN)) { - return -EINVAL; - } - - ret = LOS_ArchCopyFromUser(&tmpName, name, len); - if (ret != 0) { - return -EFAULT; - } - - SCHEDULER_LOCK(intSave); - struct utsname *currentUtsName = OsGetCurrUtsName(); - if (currentUtsName == NULL) { - SCHEDULER_UNLOCK(intSave); - return -EFAULT; - } - - (VOID)memset_s(currentUtsName->nodename, sizeof(currentUtsName->nodename), 0, sizeof(currentUtsName->nodename)); - ret = memcpy_s(currentUtsName->nodename, sizeof(currentUtsName->nodename), tmpName, len); - if (ret != EOK) { - SCHEDULER_UNLOCK(intSave); - return -EFAULT; - } - SCHEDULER_UNLOCK(intSave); - return 0; -} -#endif int SysUname(struct utsname *name) { @@ -246,7 +208,7 @@ long SysSysconf(int name) int SysUgetrlimit(int resource, unsigned long long k_rlim[2]) { int ret; - struct rlimit lim = { 0 }; + struct rlimit lim; ret = getrlimit(resource, &lim); if (ret < 0) { diff --git a/src/kernel_liteos_a/syscall/net_syscall.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/syscall/net_syscall.c similarity index 100% rename from src/kernel_liteos_a/syscall/net_syscall.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/syscall/net_syscall.c diff --git a/src/kernel_liteos_a/syscall/process_syscall.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/syscall/process_syscall.c similarity index 71% rename from src/kernel_liteos_a/syscall/process_syscall.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/syscall/process_syscall.c index 48c5f817..59165d2b 100644 --- a/src/kernel_liteos_a/syscall/process_syscall.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/syscall/process_syscall.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2023 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -45,59 +45,36 @@ static int OsPermissionToCheck(unsigned int pid, unsigned int who) { - uintptr_t pgroupID = 0; - unsigned int ret = OsGetProcessGroupCB(pid, &pgroupID); - if (ret != 0) { - return -ret; - } else if (pgroupID == OS_KERNEL_PROCESS_GROUP) { + int ret = LOS_GetProcessGroupID(pid); + if (ret < 0) { + return ret; + } else if (ret == OS_KERNEL_PROCESS_GROUP) { return -EPERM; - } else if ((pgroupID == OS_USER_PRIVILEGE_PROCESS_GROUP) && (pid != who)) { + } else if ((ret == OS_USER_PRIVILEGE_PROCESS_GROUP) && (pid != who)) { return -EPERM; - } else if ((UINTPTR)OS_PCB_FROM_PID(pid) == OS_USER_PRIVILEGE_PROCESS_GROUP) { + } else if (pid == OsGetUserInitProcessID()) { return -EPERM; } return 0; } -static int UserTaskSchedulerCheck(unsigned int tid, int policy, const LosSchedParam *schedParam, bool policyFlag) +static int OsUserTaskSchedulerSet(unsigned int tid, unsigned short policy, unsigned short priority, bool policyFlag) { int ret; - int processPolicy; + unsigned int intSave; + bool needSched = false; if (OS_TID_CHECK_INVALID(tid)) { return EINVAL; } - ret = OsSchedulerParamCheck(policy, TRUE, schedParam); - if (ret != 0) { - return ret; - } - - if (policyFlag) { - ret = LOS_GetProcessScheduler(LOS_GetCurrProcessID(), &processPolicy, NULL); - if (ret < 0) { - return -ret; - } - if ((processPolicy != LOS_SCHED_DEADLINE) && (policy == LOS_SCHED_DEADLINE)) { - return EPERM; - } else if ((processPolicy == LOS_SCHED_DEADLINE) && (policy != LOS_SCHED_DEADLINE)) { - return EPERM; - } + if (priority > OS_TASK_PRIORITY_LOWEST) { + return EINVAL; } - return 0; -} - -static int OsUserTaskSchedulerSet(unsigned int tid, int policy, const LosSchedParam *schedParam, bool policyFlag) -{ - int ret; - unsigned int intSave; - bool needSched = false; - SchedParam param = { 0 }; - ret = UserTaskSchedulerCheck(tid, policy, schedParam, policyFlag); - if (ret != 0) { - return ret; + if ((policy != LOS_SCHED_FIFO) && (policy != LOS_SCHED_RR)) { + return EINVAL; } LosTaskCB *taskCB = OS_TCB_FROM_TID(tid); @@ -108,24 +85,8 @@ static int OsUserTaskSchedulerSet(unsigned int tid, int policy, const LosSchedPa return ret; } - taskCB->ops->schedParamGet(taskCB, ¶m); - param.policy = (policyFlag == true) ? (UINT16)policy : param.policy; - if ((param.policy == LOS_SCHED_RR) || (param.policy == LOS_SCHED_FIFO)) { - param.priority = schedParam->priority; - } else if (param.policy == LOS_SCHED_DEADLINE) { -#ifdef LOSCFG_SECURITY_CAPABILITY - /* user mode process with privilege of CAP_SCHED_SETPRIORITY can change the priority */ - if (!IsCapPermit(CAP_SCHED_SETPRIORITY)) { - SCHEDULER_UNLOCK(intSave); - return EPERM; - } -#endif - param.runTimeUs = schedParam->runTimeUs; - param.deadlineUs = schedParam->deadlineUs; - param.periodUs = schedParam->periodUs; - } - - needSched = taskCB->ops->schedParamModify(taskCB, ¶m); + policy = (policyFlag == true) ? policy : taskCB->policy; + needSched = OsSchedModifyTaskSchedParam(taskCB, policy, priority); SCHEDULER_UNLOCK(intSave); LOS_MpSchedule(OS_MP_CPU_ALL); @@ -147,7 +108,6 @@ void SysSchedYield(int type) int SysSchedGetScheduler(int id, int flag) { unsigned int intSave; - SchedParam param = { 0 }; int policy; int ret; @@ -164,46 +124,24 @@ int SysSchedGetScheduler(int id, int flag) return -ret; } - taskCB->ops->schedParamGet(taskCB, ¶m); + policy = (int)taskCB->policy; SCHEDULER_UNLOCK(intSave); - return (int)param.policy; - } - - if (id == 0) { - id = (int)LOS_GetCurrProcessID(); - } - - ret = LOS_GetProcessScheduler(id, &policy, NULL); - if (ret < 0) { - return ret; + return policy; } - return policy; + return LOS_GetProcessScheduler(id); } -int SysSchedSetScheduler(int id, int policy, const LosSchedParam *userParam, int flag) +int SysSchedSetScheduler(int id, int policy, int prio, int flag) { int ret; - LosSchedParam param; - - if (LOS_ArchCopyFromUser(¶m, userParam, sizeof(LosSchedParam)) != 0) { - return -EFAULT; - } if (flag < 0) { - return -OsUserTaskSchedulerSet(id, policy, ¶m, true); + return -OsUserTaskSchedulerSet(id, policy, prio, true); } - if (policy == LOS_SCHED_RR) { -#ifdef LOSCFG_KERNEL_PLIMITS - if (param.priority < OsPidLimitGetPriorityLimit()) { - return -EINVAL; - } -#else - if (param.priority < OS_USER_PROCESS_PRIORITY_HIGHEST) { - return -EINVAL; - } -#endif + if (prio < OS_USER_PROCESS_PRIORITY_HIGHEST) { + return -EINVAL; } if (id == 0) { @@ -215,15 +153,13 @@ int SysSchedSetScheduler(int id, int policy, const LosSchedParam *userParam, int return ret; } - return OsSetProcessScheduler(LOS_PRIO_PROCESS, id, policy, ¶m); + return OsSetProcessScheduler(LOS_PRIO_PROCESS, id, prio, policy); } -int SysSchedGetParam(int id, LosSchedParam *userParam, int flag) +int SysSchedGetParam(int id, int flag) { - LosSchedParam schedParam = {0}; - SchedParam param = { 0 }; + int prio; unsigned int intSave; - int ret; if (flag < 0) { if (OS_TID_CHECK_INVALID(id)) { @@ -232,47 +168,33 @@ int SysSchedGetParam(int id, LosSchedParam *userParam, int flag) LosTaskCB *taskCB = OS_TCB_FROM_TID(id); SCHEDULER_LOCK(intSave); - ret = OsUserTaskOperatePermissionsCheck(taskCB); - if (ret != LOS_OK) { + prio = OsUserTaskOperatePermissionsCheck(taskCB); + if (prio != LOS_OK) { SCHEDULER_UNLOCK(intSave); - return -ret; + return -prio; } - taskCB->ops->schedParamGet(taskCB, ¶m); + prio = (int)taskCB->priority; SCHEDULER_UNLOCK(intSave); - if (param.policy == LOS_SCHED_DEADLINE) { - schedParam.runTimeUs = param.runTimeUs; - schedParam.deadlineUs = param.deadlineUs; - schedParam.periodUs = param.periodUs; - } else { - schedParam.priority = param.priority; - } - } else { - if (id == 0) { - id = (int)LOS_GetCurrProcessID(); - } - - if (OS_PID_CHECK_INVALID(id)) { - return -EINVAL; - } + return prio; + } - ret = LOS_GetProcessScheduler(id, NULL, &schedParam); - if (ret < 0) { - return ret; - } + if (id == 0) { + id = (int)LOS_GetCurrProcessID(); } - if (LOS_ArchCopyToUser(userParam, &schedParam, sizeof(LosSchedParam))) { - return -EFAULT; + if (OS_PID_CHECK_INVALID(id)) { + return -EINVAL; } - return 0; + + return OsGetProcessPriority(LOS_PRIO_PROCESS, id); } -int SysSetProcessPriority(int which, int who, int prio) +int SysSetProcessPriority(int which, int who, unsigned int prio) { int ret; - if (which != LOS_PRIO_PROCESS) { + if (prio < OS_USER_PROCESS_PRIORITY_HIGHEST) { return -EINVAL; } @@ -280,46 +202,21 @@ int SysSetProcessPriority(int which, int who, int prio) who = (int)LOS_GetCurrProcessID(); } -#ifdef LOSCFG_KERNEL_PLIMITS - if (prio < OsPidLimitGetPriorityLimit()) { - return -EINVAL; - } -#else - if (prio < OS_USER_PROCESS_PRIORITY_HIGHEST) { - return -EINVAL; - } -#endif - ret = OsPermissionToCheck(who, LOS_GetCurrProcessID()); if (ret < 0) { return ret; } - return LOS_SetProcessPriority(who, prio); + return OsSetProcessScheduler(which, who, prio, LOS_GetProcessScheduler(who)); } -int SysSchedSetParam(int id, const LosSchedParam *userParam, int flag) +int SysSchedSetParam(int id, unsigned int prio, int flag) { - int ret, policy; - LosSchedParam param; - if (flag < 0) { - if (LOS_ArchCopyFromUser(¶m, userParam, sizeof(LosSchedParam)) != 0) { - return -EFAULT; - } - return -OsUserTaskSchedulerSet(id, LOS_SCHED_RR, ¶m, false); - } - - if (id == 0) { - id = (int)LOS_GetCurrProcessID(); + return -OsUserTaskSchedulerSet(id, LOS_SCHED_RR, prio, false); } - ret = LOS_GetProcessScheduler(id, &policy, NULL); - if (ret < 0) { - return ret; - } - - return SysSchedSetScheduler(id, policy, userParam, flag); + return SysSetProcessPriority(LOS_PRIO_PROCESS, id, prio); } int SysGetProcessPriority(int which, int who) @@ -353,9 +250,8 @@ int SysSchedRRGetInterval(int pid, struct timespec *tp) { unsigned int intSave; int ret; - SchedParam param = { 0 }; time_t timeSlice = 0; - struct timespec tv = { 0 }; + struct timespec tv; LosTaskCB *taskCB = NULL; LosProcessCB *processCB = NULL; @@ -381,11 +277,8 @@ int SysSchedRRGetInterval(int pid, struct timespec *tp) } LOS_DL_LIST_FOR_EACH_ENTRY(taskCB, &processCB->threadSiblingList, LosTaskCB, threadList) { - if (!OsTaskIsInactive(taskCB)) { - taskCB->ops->schedParamGet(taskCB, ¶m); - if (param.policy == LOS_SCHED_RR) { - timeSlice += param.timeSlice; - } + if (!OsTaskIsInactive(taskCB) && (taskCB->policy == LOS_SCHED_RR)) { + timeSlice += taskCB->initTimeSlice; } } @@ -455,41 +348,9 @@ int SysVfork(void) return OsClone(CLONE_VFORK, 0, 0); } -int SysClone(int flags, void *stack, int *parentTid, unsigned long tls, int *childTid) -{ - (void)parentTid; - (void)tls; - (void)childTid; - - return OsClone((UINT32)flags, (UINTPTR)stack, 0); -} - -int SysUnshare(int flags) -{ -#ifdef LOSCFG_KERNEL_CONTAINER - return OsUnshare(flags); -#else - return -ENOSYS; -#endif -} - -int SysSetns(int fd, int type) -{ -#ifdef LOSCFG_KERNEL_CONTAINER - return OsSetNs(fd, type); -#else - return -ENOSYS; -#endif -} - unsigned int SysGetPPID(void) { -#ifdef LOSCFG_PID_CONTAINER - if (OsCurrProcessGet()->processID == OS_USER_ROOT_PROCESS_ID) { - return 0; - } -#endif - return OsCurrProcessGet()->parentProcess->processID; + return OsCurrProcessGet()->parentProcessID; } unsigned int SysGetPID(void) @@ -507,6 +368,8 @@ int SysSetProcessGroupID(unsigned int pid, unsigned int gid) if (gid == 0) { gid = pid; + } else if (gid <= OS_USER_PRIVILEGE_PROCESS_GROUP) { + return -EPERM; } ret = OsPermissionToCheck(pid, gid); @@ -543,11 +406,7 @@ int SysGetEffUserID(void) int euid; SCHEDULER_LOCK(intSave); -#ifdef LOSCFG_USER_CONTAINER - euid = OsFromKuidMunged(OsCurrentUserContainer(), CurrentCredentials()->euid); -#else euid = (int)OsCurrUserGet()->effUserID; -#endif SCHEDULER_UNLOCK(intSave); return euid; #else @@ -562,11 +421,7 @@ int SysGetEffGID(void) int egid; SCHEDULER_LOCK(intSave); -#ifdef LOSCFG_USER_CONTAINER - egid = OsFromKuidMunged(OsCurrentUserContainer(), CurrentCredentials()->egid); -#else egid = (int)OsCurrUserGet()->effGid; -#endif SCHEDULER_UNLOCK(intSave); return egid; #else @@ -582,15 +437,9 @@ int SysGetRealEffSaveUserID(int *ruid, int *euid, int *suid) unsigned int intSave; SCHEDULER_LOCK(intSave); -#ifdef LOSCFG_USER_CONTAINER - realUserID = OsFromKuidMunged(OsCurrentUserContainer(), CurrentCredentials()->uid); - effUserID = OsFromKuidMunged(OsCurrentUserContainer(), CurrentCredentials()->euid); - saveUserID = OsFromKuidMunged(OsCurrentUserContainer(), CurrentCredentials()->euid); -#else realUserID = OsCurrUserGet()->userID; effUserID = OsCurrUserGet()->effUserID; saveUserID = OsCurrUserGet()->effUserID; -#endif SCHEDULER_UNLOCK(intSave); #else realUserID = 0; @@ -616,62 +465,6 @@ int SysGetRealEffSaveUserID(int *ruid, int *euid, int *suid) return 0; } -#ifdef LOSCFG_USER_CONTAINER -long SysSetUserID(int uid) -{ -#ifdef LOSCFG_SECURITY_CAPABILITY - UserContainer *userContainer = CurrentCredentials()->userContainer; - int retval = -EPERM; - unsigned int intSave; - - if (uid < 0) { - return -EINVAL; - } - - UINT32 kuid = OsMakeKuid(userContainer, uid); - if (kuid == (UINT32)-1) { - return -EINVAL; - } - - Credentials *newCredentials = PrepareCredential(OsCurrProcessGet()); - if (newCredentials == NULL) { - return -ENOMEM; - } - - Credentials *oldCredentials = CurrentCredentials(); - - SCHEDULER_LOCK(intSave); - User *user = OsCurrUserGet(); - if (IsCapPermit(CAP_SETUID)) { - newCredentials->uid = kuid; - if (kuid != oldCredentials->uid) { - user->userID = kuid; - user->effUserID = kuid; - } - retval = LOS_OK; - } else if (kuid != oldCredentials->uid) { - goto ERROR; - } - newCredentials->euid = kuid; - - retval = CommitCredentials(newCredentials); - SCHEDULER_UNLOCK(intSave); - return retval; - -ERROR: - FreeCredential(newCredentials); - SCHEDULER_UNLOCK(intSave); - return retval; -#else - if (uid != 0) { - return -EPERM; - } - return 0; -#endif -} - -#else - int SysSetUserID(int uid) { #ifdef LOSCFG_SECURITY_CAPABILITY @@ -705,7 +498,6 @@ EXIT: return 0; #endif } -#endif #ifdef LOSCFG_SECURITY_CAPABILITY static int SetRealEffSaveUserIDCheck(int ruid, int euid, int suid) @@ -773,66 +565,6 @@ int SysSetRealEffUserID(int ruid, int euid) #endif } -#ifdef LOSCFG_USER_CONTAINER -int SysSetGroupID(int gid) -{ -#ifdef LOSCFG_SECURITY_CAPABILITY - UserContainer *userContainer = CurrentCredentials()->userContainer; - int retval = -EPERM; - unsigned int oldGid; - unsigned int intSave; - int count; - - if (gid < 0) { - return -EINVAL; - } - - unsigned int kgid = OsMakeKgid(userContainer, gid); - if (kgid == (UINT32)-1) { - return -EINVAL; - } - - Credentials *newCredentials = PrepareCredential(OsCurrProcessGet()); - if (newCredentials == NULL) { - return -ENOMEM; - } - - SCHEDULER_LOCK(intSave); - User *user = OsCurrUserGet(); - if (IsCapPermit(CAP_SETGID)) { - newCredentials->gid = kgid; - newCredentials->egid = kgid; - oldGid = user->gid; - user->gid = kgid; - user->effGid = kgid; - for (count = 0; count < user->groupNumber; count++) { - if (user->groups[count] == oldGid) { - user->groups[count] = kgid; - retval = LOS_OK; - break; - } - } - } else if (user->gid != kgid) { - goto ERROR; - } - - retval = CommitCredentials(newCredentials); - SCHEDULER_UNLOCK(intSave); - return retval; - -ERROR: - FreeCredential(newCredentials); - SCHEDULER_UNLOCK(intSave); - return retval; - -#else - if (gid != 0) { - return -EPERM; - } - return 0; -#endif -} -#else int SysSetGroupID(int gid) { #ifdef LOSCFG_SECURITY_CAPABILITY @@ -877,7 +609,6 @@ EXIT: return 0; #endif } -#endif int SysGetRealEffSaveGroupID(int *rgid, int *egid, int *sgid) { @@ -887,15 +618,9 @@ int SysGetRealEffSaveGroupID(int *rgid, int *egid, int *sgid) unsigned int intSave; SCHEDULER_LOCK(intSave); -#ifdef LOSCFG_USER_CONTAINER - realGroupID = OsFromKuidMunged(OsCurrentUserContainer(), CurrentCredentials()->gid); - effGroupID = OsFromKuidMunged(OsCurrentUserContainer(), CurrentCredentials()->egid); - saveGroupID = OsFromKuidMunged(OsCurrentUserContainer(), CurrentCredentials()->egid); -#else realGroupID = OsCurrUserGet()->gid; effGroupID = OsCurrUserGet()->effGid; saveGroupID = OsCurrUserGet()->effGid; -#endif SCHEDULER_UNLOCK(intSave); #else realGroupID = 0; @@ -1176,7 +901,7 @@ int SysSetThreadArea(const char *area) LosTaskCB *taskCB = OsCurrTaskGet(); SCHEDULER_LOCK(intSave); - LosProcessCB *processCB = OS_PCB_FROM_TCB(taskCB); + LosProcessCB *processCB = OS_PCB_FROM_PID(taskCB->processID); if (processCB->processMode != OS_USER_MODE) { ret = EPERM; goto OUT; @@ -1299,12 +1024,8 @@ static int SchedAffinityParameterPreprocess(int id, int flag, unsigned int *task if (OS_PID_CHECK_INVALID(id)) { return -ESRCH; } - LosProcessCB *ProcessCB = OS_PCB_FROM_PID((UINT32)id); - if (ProcessCB->threadGroup == NULL) { - return -ESRCH; - } - *taskID = (id == 0) ? (OsCurrTaskGet()->taskID) : (ProcessCB->threadGroup->taskID); - *processID = (id == 0) ? (OS_PCB_FROM_TID(*taskID)->processID) : id; + *taskID = (id == 0) ? (OsCurrTaskGet()->taskID) : (OS_PCB_FROM_PID((UINT32)id)->threadGroupID); + *processID = (id == 0) ? (OS_TCB_FROM_TID(*taskID)->processID) : id; } else { if (OS_TID_CHECK_INVALID(id)) { return -ESRCH; diff --git a/src/kernel_liteos_a/syscall/syscall_lookup.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/syscall/syscall_lookup.h similarity index 96% rename from src/kernel_liteos_a/syscall/syscall_lookup.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/syscall/syscall_lookup.h index c5fcdb30..c9494096 100644 --- a/src/kernel_liteos_a/syscall/syscall_lookup.h +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/syscall/syscall_lookup.h @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2023 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -139,9 +139,6 @@ SYSCALL_HAND_DEF(__NR_shellexec, SysShellExec, UINT32, ARG_NUM_2) SYSCALL_HAND_DEF(__NR_exit, SysThreadExit, void, ARG_NUM_1) SYSCALL_HAND_DEF(__NR_fork, SysFork, int, ARG_NUM_0) SYSCALL_HAND_DEF(__NR_vfork, SysVfork, int, ARG_NUM_0) -SYSCALL_HAND_DEF(__NR_clone, SysClone, int, ARG_NUM_5) -SYSCALL_HAND_DEF(__NR_unshare, SysUnshare, int, ARG_NUM_1) -SYSCALL_HAND_DEF(__NR_setns, SysSetns, int, ARG_NUM_2) SYSCALL_HAND_DEF(__NR_getpid, SysGetPID, unsigned int, ARG_NUM_0) SYSCALL_HAND_DEF(__NR_pause, SysPause, int, ARG_NUM_0) @@ -163,13 +160,10 @@ SYSCALL_HAND_DEF(__NR_getitimer, SysGetiTimer, int, ARG_NUM_2) SYSCALL_HAND_DEF(__NR_wait4, SysWait, int, ARG_NUM_4) SYSCALL_HAND_DEF(__NR_waitid, SysWaitid, int, ARG_NUM_5) SYSCALL_HAND_DEF(__NR_uname, SysUname, int, ARG_NUM_1) -#ifdef LOSCFG_UTS_CONTAINER -SYSCALL_HAND_DEF(__NR_sethostname, SysSetHostName, int, ARG_NUM_2) -#endif SYSCALL_HAND_DEF(__NR_mprotect, SysMprotect, int, ARG_NUM_3) SYSCALL_HAND_DEF(__NR_getpgid, SysGetProcessGroupID, int, ARG_NUM_1) SYSCALL_HAND_DEF(__NR_sched_setparam, SysSchedSetParam, int, ARG_NUM_3) -SYSCALL_HAND_DEF(__NR_sched_getparam, SysSchedGetParam, int, ARG_NUM_3) +SYSCALL_HAND_DEF(__NR_sched_getparam, SysSchedGetParam, int, ARG_NUM_2) SYSCALL_HAND_DEF(__NR_sched_setscheduler, SysSchedSetScheduler, int, ARG_NUM_4) SYSCALL_HAND_DEF(__NR_sched_getscheduler, SysSchedGetScheduler, int, ARG_NUM_2) SYSCALL_HAND_DEF(__NR_sched_yield, SysSchedYield, void, ARG_NUM_1) @@ -265,15 +259,11 @@ SYSCALL_HAND_DEF(__NR_shmctl, SysShmCtl, int, ARG_NUM_3) SYSCALL_HAND_DEF(__NR_statx, SysStatx, int, ARG_NUM_5) -#ifdef LOSCFG_CHROOT -SYSCALL_HAND_DEF(__NR_chroot, SysChroot, int, ARG_NUM_1) -#endif - /* LiteOS customized syscalls, not compatible with ARM EABI */ SYSCALL_HAND_DEF(__NR_pthread_set_detach, SysUserThreadSetDetach, int, ARG_NUM_1) SYSCALL_HAND_DEF(__NR_pthread_join, SysThreadJoin, int, ARG_NUM_1) SYSCALL_HAND_DEF(__NR_pthread_deatch, SysUserThreadDetach, int, ARG_NUM_1) -SYSCALL_HAND_DEF(__NR_create_user_thread, SysCreateUserThread, unsigned int, ARG_NUM_3) +SYSCALL_HAND_DEF(__NR_creat_user_thread, SysCreateUserThread, unsigned int, ARG_NUM_3) SYSCALL_HAND_DEF(__NR_getrusage, SysGetrusage, int, ARG_NUM_2) SYSCALL_HAND_DEF(__NR_sysconf, SysSysconf, long, ARG_NUM_1) SYSCALL_HAND_DEF(__NR_ugetrlimit, SysUgetrlimit, int, ARG_NUM_2) diff --git a/src/kernel_liteos_a/syscall/syscall_pub.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/syscall/syscall_pub.c similarity index 98% rename from src/kernel_liteos_a/syscall/syscall_pub.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/syscall/syscall_pub.c index 6934e880..b3d761af 100644 --- a/src/kernel_liteos_a/syscall/syscall_pub.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/syscall/syscall_pub.c @@ -83,10 +83,6 @@ int GetFullpath(int fd, const char *path, char **fullpath) fd = GetAssociatedSystemFd(fd); } ret = fs_getfilep(fd, &file); - if (ret < 0) { - ret = -EPERM; - goto OUT; - } if (file) { ret = stat(file->f_path, &bufRet); if (!ret) { diff --git a/src/kernel_liteos_a/syscall/syscall_pub.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/syscall/syscall_pub.h similarity index 100% rename from src/kernel_liteos_a/syscall/syscall_pub.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/syscall/syscall_pub.h diff --git a/src/kernel_liteos_a/syscall/time_syscall.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/syscall/time_syscall.c similarity index 100% rename from src/kernel_liteos_a/syscall/time_syscall.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/syscall/time_syscall.c diff --git a/src/kernel_liteos_a/syscall/vm_syscall.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/syscall/vm_syscall.c similarity index 100% rename from src/kernel_liteos_a/syscall/vm_syscall.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/syscall/vm_syscall.c diff --git a/src/kernel_liteos_a/testsuites/BUILD.gn b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/BUILD.gn similarity index 93% rename from src/kernel_liteos_a/testsuites/BUILD.gn rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/BUILD.gn index c09cb41c..17bddbfe 100644 --- a/src/kernel_liteos_a/testsuites/BUILD.gn +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/BUILD.gn @@ -29,13 +29,9 @@ import("//kernel/liteos_a/liteos.gni") -declare_args() { - liteos_kernel_unittest = true -} - group("testsuites") { - deps = [] - if (liteos_kernel_unittest) { - deps += [ "unittest" ] - } + deps = [ + #"kernel", + "unittest", + ] } diff --git a/src/kernel_liteos_a/testsuites/Kconfig b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/Kconfig similarity index 100% rename from src/kernel_liteos_a/testsuites/Kconfig rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/Kconfig diff --git a/src/kernel_liteos_a/testsuites/LICENSE b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/LICENSE similarity index 100% rename from src/kernel_liteos_a/testsuites/LICENSE rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/LICENSE diff --git a/src/kernel_liteos_a/testsuites/Makefile b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/Makefile similarity index 100% rename from src/kernel_liteos_a/testsuites/Makefile rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/Makefile diff --git a/src/kernel_liteos_a/testsuites/build/los_test_config.mk b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/build/los_test_config.mk similarity index 100% rename from src/kernel_liteos_a/testsuites/build/los_test_config.mk rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/build/los_test_config.mk diff --git a/src/kernel_liteos_a/testsuites/config.mk b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/config.mk similarity index 100% rename from src/kernel_liteos_a/testsuites/config.mk rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/config.mk diff --git a/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/BUILD.gn b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/BUILD.gn new file mode 100644 index 00000000..ee97651b --- /dev/null +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/BUILD.gn @@ -0,0 +1,148 @@ +# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. +# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. +# +# 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. + +import("//build/lite/config/component/lite_component.gni") + +static_library("test_base") { + sources = [ + "src/ChipTest.c", + "src/iCunit.c", + "src/osTest.c", + "src/testrun_shellcmd.c", + "src/testusb_shellcmd.c", + ] + + include_dirs = [ + "../kernel/base/includ", + "../kernel/include", + "../kernel/extended/include", + "include", + "../fs/vfs", + "../fs/proc/include", + "../fs/jffs2/include", + "../fs/nfs/include", + "../bsd/compat/linuxkpi/include", + ] + + public_configs = [ ":public" ] +} + +config("public") { + include_dirs = [ "include" ] +} + +lite_component("test") { + features = [ ":test_base" ] + + # KERNEL BASE TEST + if (LOSCFG_TEST_KERNEL_BASE_IPC) { + features += [ "sample/kernel_base/ipc:test_ipc" ] + } + if (LOSCFG_TEST_KERNEL_BASE_CORE) { + features += [ "sample/kernel_base/core:test_core" ] + } + if (LOSCFG_TEST_KERNEL_BASE_MP) { + features += [ "sample/kernel_base/mp:test_mp" ] + } + if (LOSCFG_TEST_KERNEL_BASE_MEM) { + features += [ "sample/kernel_base/mem:test_mem" ] + } + if (LOSCFG_TEST_KERNEL_BASE_MISC) { + features += [ "sample/kernel_base/misc:test_misc" ] + } + if (LOSCFG_TEST_KERNEL_BASE_OM) { + features += [ "sample/kernel_base/om:test_om" ] + } + if (LOSCFG_TEST_KERNEL_BASE_ATOMIC) { + features += [ "sample/kernel_base/atomic:test_atomic" ] + } + + # KERNEL EXTEND TEST + if (LOSCFG_TEST_KERNEL_EXTEND_CPP) { + features += [ "sample/kernel_extend/cpp:test_cpp" ] + } + if (LOSCFG_TEST_KERNEL_EXTEND_CPUP) { + features += [ "sample/kernel_extend/cpup:test_cpup" ] + } + if (LOSCFG_TEST_KERNEL_EXTEND_MMU) { + features += [ "sample/kernel_extend/mmu:test_mmu" ] + } + + # COMPAT TEST + if (LOSCFG_TEST_POSIX) { + features += [ + "sample/posix:test_posix", + # "sample/posix/smp:test_posix_smp", + ] + } + + # if (LOSCFG_TEST_POSIX_MEM) { + # features += [ "sample/posix/mem:test_posix_mem" ] + # } + # if (LOSCFG_TEST_POSIX_MQUEUE) { + # features += [ "sample/posix/mqueue:test_posix_mqueue" ] + # } + # if (LOSCFG_TEST_POSIX_MUTEX) { + # features += [ "sample/posix/mutex:test_posix_mutex" ] + # } + # if (LOSCFG_TEST_POSIX_PTHREAD) { + # features += [ "sample/posix/pthread:test_posix_pthread" ] + # } + # if (LOSCFG_TEST_POSIX_SCHED) { + # features += [ "sample/posix/sched:test_posix_sched" ] + # } + # if (LOSCFG_TEST_POSIX_SEM) { + # features += [ "sample/posix/sem:test_posix_sem" ] + # } + # if (LOSCFG_TEST_POSIX_SWTMR) { + # features += [ "sample/posix/swtmr:test_posix_swtmr" ] + # } + if (LOSCFG_TEST_LINUX) { + features += [ "sample/linux:test_linux" ] + } + + #if (LOSCFG_TEST_LINUX_HRTIMER) { + # features += [ "sample/linux/hrtimer:test_linux_hrtimer" ] + #} + + # LIBC TEST + if (LOSCFG_TEST_LIBC) { + features += [ "sample/libc:test_libc" ] + } + + # LIBM TEST + if (LOSCFG_TEST_LIBM) { + features += [ "sample/libm:test_libm" ] + } + + # SHELL TEST + if (LOSCFG_TEST_SHELL) { + features += [ "sample/shell:test_shell" ] + } +} diff --git a/src/kernel_liteos_a/testsuites/kernel/Kconfig b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/Kconfig similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/Kconfig rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/Kconfig diff --git a/src/kernel_liteos_a/testsuites/kernel/Makefile b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/Makefile similarity index 89% rename from src/kernel_liteos_a/testsuites/kernel/Makefile rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/Makefile index 6112372c..c3e417a5 100644 --- a/src/kernel_liteos_a/testsuites/kernel/Makefile +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/Makefile @@ -35,7 +35,12 @@ MODULE_NAME := ktest LOCAL_INCLUDE := -I $(LITEOSTESTTOPDIR)/kernel/include LOCAL_SRCS := $(wildcard src/osTest.c) \ + $(wildcard src/runstop_osTest.c) \ + $(wildcard src/scatter_osTest.c) \ $(wildcard src/iCunit.c) \ + $(wildcard src/ChipTest.c) \ + $(wildcard src/testusb_shellcmd.c) \ + $(wildcard src/testrun_shellcmd.c) LOCAL_FLAGS := $(LOCAL_INCLUDE) -Wno-error -I $(LITEOSTOPDIR)/../../$(LOSCFG_BOARD_CONFIG_PATH)/include \ -I $(LITEOSTOPDIR)/fs/fat/os_adapt diff --git a/src/kernel_liteos_a/testsuites/kernel/include/iCunit.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/include/iCunit.h similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/include/iCunit.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/include/iCunit.h diff --git a/src/kernel_liteos_a/testsuites/kernel/include/iCunit.inc b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/include/iCunit.inc similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/include/iCunit.inc rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/include/iCunit.inc diff --git a/src/kernel_liteos_a/testsuites/kernel/include/iCunit_config.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/include/iCunit_config.h similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/include/iCunit_config.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/include/iCunit_config.h diff --git a/src/kernel_liteos_a/testsuites/kernel/include/los_test_pri.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/include/los_test_pri.h similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/include/los_test_pri.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/include/los_test_pri.h diff --git a/src/kernel_liteos_a/testsuites/kernel/include/osTest.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/include/osTest.h similarity index 93% rename from src/kernel_liteos_a/testsuites/kernel/include/osTest.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/include/osTest.h index 3486e4b1..522a53d4 100644 --- a/src/kernel_liteos_a/testsuites/kernel/include/osTest.h +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/include/osTest.h @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2022 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -36,6 +36,7 @@ #define SWTMR_TEST #endif +#include "test_menuconfig.h" #include "stdarg.h" #include "los_config.h" #include "iCunit.h" @@ -73,7 +74,6 @@ #include "los_process_pri.h" #include "pthread.h" -#define LOSCFG_TEST 1 #ifdef LOSCFG_PLATFORM_HI3516DV300 #define TEST3516DV300 #elif LOSCFG_PLATFORM_HI3518EV300 @@ -86,14 +86,14 @@ extern "C" { #endif /* __cpluscplus */ #endif /* __cpluscplus */ -#define TEST_TASK_PARAM_INIT(testTask, task_name, entry, prio) \ - do { \ - (void)memset_s(&(testTask), sizeof(TSK_INIT_PARAM_S), 0, sizeof(TSK_INIT_PARAM_S)); \ - testTask.pfnTaskEntry = (TSK_ENTRY_FUNC)entry; \ - testTask.uwStackSize = 0x1000; \ - testTask.pcName = task_name; \ - testTask.usTaskPrio = prio; \ - testTask.uwResved = LOS_TASK_STATUS_DETACHED; \ +#define TEST_TASK_PARAM_INIT(testTask, task_name, entry, prio) \ + do { \ + memset(&testTask, 0, sizeof(TSK_INIT_PARAM_S)); \ + testTask.pfnTaskEntry = (TSK_ENTRY_FUNC)entry; \ + testTask.uwStackSize = LOS_TASK_MIN_STACK_SIZE; \ + testTask.pcName = task_name; \ + testTask.usTaskPrio = prio; \ + testTask.uwResved = LOS_TASK_STATUS_DETACHED; \ } while (0); #ifdef LOSCFG_KERNEL_SMP @@ -108,8 +108,8 @@ extern "C" { #define JFFS_BASE_MTD_LEN 0x600000 -#define TASK_PRIO_TEST (LOS_TaskPriGet(LOS_CurTaskIDGet())) // 25 -#define TASK_PRIO_TEST_TASK 25 +#define TASK_PRIO_TEST 25 +#define TASK_PRIO_TEST_TASK 4 #define TASK_PRIO_TEST_SWTMR 4 #ifdef LOSCFG_AARCH64 #define TASK_STACK_SIZE_TEST (LOS_TASK_MIN_STACK_SIZE * 3) @@ -117,7 +117,6 @@ extern "C" { #define TASK_STACK_SIZE_TEST LOS_TASK_MIN_STACK_SIZE #endif #define LOS_MS_PER_TICK (OS_SYS_MS_PER_SECOND / LOSCFG_BASE_CORE_TICK_PER_SECOND) -#define LOS_US_PER_TICK (OS_SYS_US_PER_SECOND / LOSCFG_BASE_CORE_TICK_PER_SECOND) #define HWI_NUM_INTVALID OS_HWI_MAX_NUM #define writel(g_value, address) WRITE_UINT32(g_value, address) @@ -314,7 +313,7 @@ extern void msleep(unsigned int msecs); extern unsigned int sleep(unsigned int seconds); extern int usleep(unsigned useconds); -#define OS_TASK_STATUS_DETACHED 0 +#define OS_TASK_STATUS_DETACHED OS_TASK_FLAG_DETACHED extern UINT32 LOS_MemTotalUsedGet(VOID *pool); extern VOID ptestTickConsume(VOID); extern UINT32 TEST_TskDelete(UINT32 taskID); @@ -343,8 +342,6 @@ extern void TestSystemInit(void); extern void TEST_DT_COMMON(void); extern VOID dprintf(const char *fmt, ...); -extern UINT32 OsSwtmrTaskIDGetByCpuid(UINT16 cpuid); - #define BIG_FD 512 typedef struct testrunParam { CHAR testcase_sequence[16]; @@ -368,8 +365,6 @@ typedef struct testrunParam { extern void InitRebootHook(void); -#define LOSCFG_TEST_SMOKE -#define LOSCFG_TEST_FULL #ifdef __cplusplus #if __cplusplus } diff --git a/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/BUILD.gn b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/BUILD.gn new file mode 100644 index 00000000..7302e05f --- /dev/null +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/BUILD.gn @@ -0,0 +1,63 @@ +# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. +# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. +# +# 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. + +static_library("test_core") { + sources = [ + "hwi/It_smp_hwi.c", + "hwi_nesting/It_hwi_nesting.c", + "swtmr/It_los_swtmr.c", + "task/It_los_task.c", + ] + + if (LOSCFG_TEST_SMOKE) { + sources += [ + "swtmr/smoke/It_los_swtmr_053.c", + "swtmr/smoke/It_los_swtmr_058.c", + "task/smoke/It_los_task_045.c", + "task/smoke/It_los_task_046.c", + "task/smoke/It_los_task_049.c", + "task/smoke/It_los_task_081.c", + "task/smoke/It_los_task_089.c", + "task/smoke/It_los_task_097.c", + "task/smoke/It_los_task_099.c", + "task/smoke/It_los_task_101.c", + "task/smoke/It_los_task_105.c", + "task/smoke/It_los_task_timeslice_001.c", + ] + } + include_dirs = [ + "../../../include/", + "task", + "swtmr", + "hwi", + "hwi_nesting", + ] + + cflags = [ "-Wno-error" ] +} diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/Makefile b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/Makefile similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/Makefile rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/Makefile diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/hwi/It_smp_hwi.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/hwi/It_smp_hwi.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/hwi/It_smp_hwi.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/hwi/It_smp_hwi.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/hwi/It_smp_hwi.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/hwi/It_smp_hwi.h similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/hwi/It_smp_hwi.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/hwi/It_smp_hwi.h diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_001.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_001.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_001.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_001.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_002.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_002.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_002.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_002.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_003.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_003.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_003.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_003.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_004.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_004.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_004.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_004.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_005.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_005.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_005.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_005.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_006.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_006.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_006.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_006.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_007.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_007.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_007.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_007.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_008.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_008.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_008.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_008.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_009.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_009.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_009.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_009.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_010.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_010.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_010.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_010.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_011.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_011.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_011.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_011.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_012.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_012.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_012.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_012.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_013.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_013.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_013.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_013.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_ipi_001.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_ipi_001.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_ipi_001.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_ipi_001.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_ipi_002.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_ipi_002.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_ipi_002.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_ipi_002.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_ipi_003.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_ipi_003.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_ipi_003.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_ipi_003.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_ipi_004.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_ipi_004.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_ipi_004.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_ipi_004.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_ipi_005.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_ipi_005.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_ipi_005.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_ipi_005.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_ipi_006.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_ipi_006.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_ipi_006.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_ipi_006.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_ipi_007.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_ipi_007.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_ipi_007.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_ipi_007.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_ipi_008.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_ipi_008.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_ipi_008.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_ipi_008.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_nest_001.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_nest_001.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_nest_001.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_nest_001.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_nest_002.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_nest_002.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_nest_002.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_nest_002.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_nest_003.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_nest_003.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_nest_003.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_nest_003.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_nest_004.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_nest_004.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_nest_004.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_nest_004.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_nest_005.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_nest_005.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_nest_005.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_nest_005.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_nest_006.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_nest_006.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_nest_006.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_nest_006.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_nest_007.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_nest_007.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_nest_007.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_nest_007.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_nest_008.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_nest_008.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_nest_008.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_nest_008.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_share_001.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_share_001.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_share_001.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_share_001.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_share_002.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_share_002.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_share_002.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_share_002.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_share_003.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_share_003.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_share_003.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_share_003.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_share_004.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_share_004.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_share_004.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_share_004.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_share_005.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_share_005.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_share_005.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_share_005.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_share_006.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_share_006.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_share_006.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_share_006.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_share_007.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_share_007.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_share_007.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_share_007.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_share_008.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_share_008.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_share_008.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_share_008.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_share_009.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_share_009.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_share_009.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_share_009.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_share_010.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_share_010.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_share_010.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/hwi/smp/It_smp_los_hwi_share_010.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/hwi_nesting/It_hwi_nesting.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/hwi_nesting/It_hwi_nesting.c similarity index 97% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/hwi_nesting/It_hwi_nesting.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/hwi_nesting/It_hwi_nesting.c index 8c330828..2d0d43ab 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/hwi_nesting/It_hwi_nesting.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/hwi_nesting/It_hwi_nesting.c @@ -50,7 +50,7 @@ VOID RecordIntrTrace(INT32 irq, INT32 direction) VOID ResetIntrTrace(VOID) { g_traceIdx = 0; - (void)memset_s(g_intrTrace, RECORD_SIZE, 0, RECORD_SIZE); + memset(g_intrTrace, 0, RECORD_SIZE); } UINT32 CheckIntrTrace(UINT32 *expect, UINT32 num) diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/hwi_nesting/It_hwi_nesting.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/hwi_nesting/It_hwi_nesting.h similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/hwi_nesting/It_hwi_nesting.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/hwi_nesting/It_hwi_nesting.h diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/hwi_nesting/full/It_los_hwi_nesting_001.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/hwi_nesting/full/It_los_hwi_nesting_001.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/hwi_nesting/full/It_los_hwi_nesting_001.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/hwi_nesting/full/It_los_hwi_nesting_001.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/hwi_nesting/full/It_los_hwi_nesting_002.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/hwi_nesting/full/It_los_hwi_nesting_002.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/hwi_nesting/full/It_los_hwi_nesting_002.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/hwi_nesting/full/It_los_hwi_nesting_002.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/hwi_nesting/full/It_los_hwi_nesting_003.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/hwi_nesting/full/It_los_hwi_nesting_003.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/hwi_nesting/full/It_los_hwi_nesting_003.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/hwi_nesting/full/It_los_hwi_nesting_003.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/hwi_nesting/full/It_los_hwi_nesting_004.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/hwi_nesting/full/It_los_hwi_nesting_004.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/hwi_nesting/full/It_los_hwi_nesting_004.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/hwi_nesting/full/It_los_hwi_nesting_004.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/hwi_nesting/full/It_los_hwi_nesting_005.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/hwi_nesting/full/It_los_hwi_nesting_005.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/hwi_nesting/full/It_los_hwi_nesting_005.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/hwi_nesting/full/It_los_hwi_nesting_005.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/hwi_nesting/full/It_los_hwi_nesting_006.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/hwi_nesting/full/It_los_hwi_nesting_006.c similarity index 96% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/hwi_nesting/full/It_los_hwi_nesting_006.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/hwi_nesting/full/It_los_hwi_nesting_006.c index 2421bfa9..58be6103 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/hwi_nesting/full/It_los_hwi_nesting_006.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/hwi_nesting/full/It_los_hwi_nesting_006.c @@ -44,7 +44,7 @@ static VOID NestingPrioHigh(INT32 irq, VOID *data) { g_intrHandleEnd = 1; UINT32 temp[0x100][2] = {0}; - (void)memset_s(temp, sizeof(UINT32) * 0x100 * 2, 1, sizeof(UINT32) * 0x100 * 2); // 2, buffer size. + memset(temp, 1, sizeof(UINT32) * 0x100 * 2); // 2, buffer size. } static VOID TaskF01(VOID) diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/hwi_nesting/full/It_los_hwi_nesting_007.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/hwi_nesting/full/It_los_hwi_nesting_007.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/hwi_nesting/full/It_los_hwi_nesting_007.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/hwi_nesting/full/It_los_hwi_nesting_007.c index 6fc6c219..43bf4cf9 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/hwi_nesting/full/It_los_hwi_nesting_007.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/hwi_nesting/full/It_los_hwi_nesting_007.c @@ -49,13 +49,13 @@ static VOID NestingPrioHigh(INT32 irq, VOID *data) UINT64 curTime; curTime = LOS_CurrNanosec(); g_recordTime[g_saveIndex] = curTime - g_intPendTime; + if (g_saveIndex == MAX_RECORD_SIZE) { + g_saveIndex = 0; + } dprintf("curTime = %lld, pendTime = %lld \n", curTime, g_intPendTime); dprintf("%lld\n", curTime - g_intPendTime); dprintf("[swtmr] hwi response time : ##%lld \n", g_recordTime[g_saveIndex]); g_saveIndex++; - if (g_saveIndex == MAX_RECORD_SIZE) { - g_saveIndex = 0; - } } static VOID DumpResult() diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/It_los_swtmr.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/It_los_swtmr.c similarity index 81% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/It_los_swtmr.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/It_los_swtmr.c index 44c53550..f49d472c 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/It_los_swtmr.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/It_los_swtmr.c @@ -41,6 +41,14 @@ EVENT_CB_S g_eventCB1, g_eventCB2, g_eventCB3; VOID ItSuiteLosSwtmr(VOID) { + int ret = LOS_SetProcessScheduler(LOS_GetCurrProcessID(), LOS_SCHED_RR, TASK_PRIO_TEST_SWTMR); + if (ret != LOS_OK) { + dprintf("%s set test process schedule failed! %d\n", ret); + } + ret = LOS_SetTaskScheduler(LOS_CurTaskIDGet(), LOS_SCHED_RR, TASK_PRIO_TEST_SWTMR); + if (ret != LOS_OK) { + dprintf("%s set test task schedule failed! %d\n", ret); + } #if defined(LOSCFG_TEST_SMOKE) ItLosSwtmr053(); ItLosSwtmr058(); @@ -67,8 +75,10 @@ VOID ItSuiteLosSwtmr(VOID) ItSmpLosSwtmr019(); ItSmpLosSwtmr020(); ItSmpLosSwtmr021(); + ItSmpLosSwtmr022(); ItSmpLosSwtmr023(); ItSmpLosSwtmr024(); + ItSmpLosSwtmr025(); ItSmpLosSwtmr026(); ItSmpLosSwtmr027(); ItSmpLosSwtmr028(); @@ -76,6 +86,7 @@ VOID ItSuiteLosSwtmr(VOID) ItSmpLosSwtmr030(); ItSmpLosSwtmr031(); ItSmpLosSwtmr032(); + ItSmpLosSwtmr033(); ItSmpLosSwtmr034(); ItSmpLosSwtmr035(); #endif @@ -101,10 +112,16 @@ VOID ItSuiteLosSwtmr(VOID) ItLosSwtmr019(); ItLosSwtmr020(); ItLosSwtmr021(); + ItLosSwtmr022(); ItLosSwtmr030(); + ItLosSwtmr033(); ItLosSwtmr036(); ItLosSwtmr037(); + ItLosSwtmr039(); + ItLosSwtmr040(); + ItLosSwtmr041(); ItLosSwtmr042(); + ItLosSwtmr043(); ItLosSwtmr044(); ItLosSwtmr045(); ItLosSwtmr046(); @@ -119,9 +136,12 @@ VOID ItSuiteLosSwtmr(VOID) ItLosSwtmr056(); ItLosSwtmr057(); ItLosSwtmr059(); + ItLosSwtmr060(); ItLosSwtmr061(); ItLosSwtmr062(); ItLosSwtmr063(); + ItLosSwtmr064(); + ItLosSwtmr065(); ItLosSwtmr066(); ItLosSwtmr067(); ItLosSwtmr068(); @@ -159,6 +179,14 @@ VOID ItSuiteLosSwtmr(VOID) ItLosSwtmr080(); ItLosSwtmr023(); #endif + ret = LOS_SetProcessScheduler(LOS_GetCurrProcessID(), LOS_SCHED_RR, 20); // 20, set a reasonable priority. + if (ret != LOS_OK) { + dprintf("%s set test process schedule failed! %d\n", ret); + } + ret = LOS_SetTaskScheduler(LOS_CurTaskIDGet(), LOS_SCHED_RR, TASK_PRIO_TEST); + if (ret != LOS_OK) { + dprintf("%s set test task schedule failed! %d\n", ret); + } } #ifdef __cplusplus diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/It_los_swtmr.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/It_los_swtmr.h similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/It_los_swtmr.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/It_los_swtmr.h diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_001.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_001.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_001.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_001.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_002.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_002.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_002.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_002.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_003.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_003.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_003.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_003.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_005.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_005.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_005.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_005.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_006.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_006.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_006.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_006.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_007.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_007.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_007.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_007.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_008.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_008.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_008.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_008.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_009.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_009.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_009.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_009.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_010.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_010.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_010.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_010.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_011.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_011.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_011.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_011.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_012.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_012.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_012.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_012.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_013.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_013.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_013.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_013.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_014.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_014.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_014.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_014.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_015.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_015.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_015.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_015.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_016.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_016.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_016.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_016.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_017.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_017.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_017.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_017.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_018.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_018.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_018.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_018.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_019.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_019.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_019.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_019.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_020.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_020.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_020.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_020.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_021.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_021.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_021.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_021.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_022.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_022.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_022.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_022.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_030.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_030.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_030.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_030.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_033.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_033.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_033.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_033.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_036.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_036.c similarity index 94% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_036.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_036.c index f027814e..61b8667d 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_036.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_036.c @@ -36,22 +36,20 @@ extern "C" { #endif /* __cpluscplus */ #endif /* __cpluscplus */ - -static UINT32 g_testSwtmrCount; static VOID SwtmrF01(UINT32 arg) { if (arg != 0xffff) { return; } - g_testSwtmrCount++; + g_testCount++; return; } static UINT32 Testcase(VOID) { UINT32 ret; UINT16 swTmrID; - g_testSwtmrCount = 0; + g_testCount = 0; ret = LOS_SwtmrCreate(1, LOS_SWTMR_MODE_ONCE, SwtmrF01, &swTmrID, 0xffff); ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret); @@ -64,8 +62,7 @@ static UINT32 Testcase(VOID) ret = LOS_TaskDelay(10); // 10, set delay time ICUNIT_GOTO_EQUAL(ret, LOS_OK, ret, EXIT); - ICUNIT_GOTO_EQUAL(g_testSwtmrCount, 1, g_testSwtmrCount, EXIT); - + ICUNIT_GOTO_EQUAL(g_testCount, 1, g_testCount, EXIT); #if SELF_DELETED ret = LOS_SwtmrDelete(swTmrID); ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret); diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_037.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_037.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_037.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_037.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_039.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_039.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_039.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_039.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_040.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_040.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_040.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_040.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_041.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_041.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_041.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_041.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_042.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_042.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_042.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_042.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_043.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_043.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_043.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_043.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_044.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_044.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_044.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_044.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_045.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_045.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_045.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_045.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_046.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_046.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_046.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_046.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_047.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_047.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_047.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_047.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_048.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_048.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_048.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_048.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_049.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_049.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_049.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_049.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_050.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_050.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_050.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_050.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_051.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_051.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_051.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_051.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_052.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_052.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_052.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_052.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_054.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_054.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_054.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_054.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_055.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_055.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_055.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_055.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_056.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_056.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_056.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_056.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_057.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_057.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_057.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_057.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_059.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_059.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_059.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_059.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_060.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_060.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_060.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_060.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_061.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_061.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_061.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_061.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_062.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_062.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_062.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_062.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_063.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_063.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_063.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_063.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_064.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_064.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_064.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_064.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_065.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_065.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_065.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_065.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_066.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_066.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_066.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_066.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_067.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_067.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_067.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_067.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_068.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_068.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_068.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_068.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_069.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_069.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_069.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_069.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_070.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_070.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_070.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_070.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_071.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_071.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_071.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_071.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_075.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_075.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_075.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_075.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_076.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_076.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_076.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_076.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_077.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_077.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_077.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_077.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_078.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_078.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_078.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/full/It_los_swtmr_078.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/smoke/It_los_swtmr_053.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/smoke/It_los_swtmr_053.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/smoke/It_los_swtmr_053.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/smoke/It_los_swtmr_053.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/smoke/It_los_swtmr_058.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/smoke/It_los_swtmr_058.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/smoke/It_los_swtmr_058.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/smoke/It_los_swtmr_058.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_001.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_001.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_001.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_001.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_002.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_002.c similarity index 96% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_002.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_002.c index 87029a71..c62c2c92 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_002.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_002.c @@ -82,14 +82,11 @@ static UINT32 Testcase(void) TEST_TASK_PARAM_INIT(testTask, "it_swtmr_002_task", TaskF01, TASK_PRIO_TEST_SWTMR + 1); // not set cpuaffi testTask.auwArgs[0] = g_swtmrHandle[i]; - testTask.usCpuAffiMask = CPUID_TO_AFFI_MASK(i); ret = LOS_TaskCreate(&testid, &testTask); ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret); } - UINT64 startTime = LOS_CurrNanosec(); LOS_TaskDelay(g_testPeriod * g_testTimes + 5); // g_testPeriod * g_testTimes + 5, set delay time - UINT64 usedTime = LOS_CurrNanosec() - startTime; ICUNIT_ASSERT_EQUAL(g_testCount, g_testTimes * LOSCFG_KERNEL_CORE_NUM, g_testCount); diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_003.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_003.c similarity index 98% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_003.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_003.c index 28d1e937..51f45b59 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_003.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_003.c @@ -71,8 +71,7 @@ static UINT32 Testcase(void) CPUID_TO_AFFI_MASK(ArchCurrCpuid())); ret = LOS_TaskCreate(&g_testTaskID01, &testTask); ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret); - - LOS_TaskDelay(g_testPeriod + 10); // period is 10 + LOS_TaskDelay(g_testPeriod + 1); ICUNIT_GOTO_EQUAL(g_testCount, 1, g_testCount, EXIT); diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_004.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_004.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_004.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_004.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_005.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_005.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_005.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_005.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_006.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_006.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_006.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_006.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_007.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_007.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_007.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_007.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_008.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_008.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_008.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_008.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_009.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_009.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_009.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_009.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_010.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_010.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_010.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_010.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_011.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_011.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_011.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_011.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_012.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_012.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_012.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_012.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_013.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_013.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_013.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_013.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_014.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_014.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_014.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_014.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_015.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_015.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_015.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_015.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_016.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_016.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_016.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_016.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_017.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_017.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_017.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_017.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_018.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_018.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_018.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_018.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_019.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_019.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_019.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_019.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_020.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_020.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_020.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_020.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_021.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_021.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_021.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_021.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_022.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_022.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_022.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_022.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_023.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_023.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_023.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_023.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_024.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_024.c similarity index 84% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_024.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_024.c index 496966fe..ccfcbe06 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_024.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_024.c @@ -88,15 +88,13 @@ static UINT32 Testcase(void) ret = LOS_SwtmrCreate(g_testPeriod, LOS_SWTMR_MODE_PERIOD, (SWTMR_PROC_FUNC)SwtmrF01, &g_swTmrID, 0); ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret); - TEST_TASK_PARAM_INIT_AFFI(testTask, "it_swtmr_024_task1", TaskF01, - TASK_PRIO_TEST_SWTMR + 1, CPUID_TO_AFFI_MASK(ArchCurrCpuid())); - testTask.uwResved = LOS_TASK_ATTR_JOINABLE; + TEST_TASK_PARAM_INIT(testTask, "it_swtmr_024_task1", TaskF01, + TASK_PRIO_TEST_SWTMR + 1); // not set cpuaffi ret = LOS_TaskCreate(&g_testTaskID01, &testTask); ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret); - TEST_TASK_PARAM_INIT_AFFI(testTask, "it_swtmr_024_task2", TaskF02, - TASK_PRIO_TEST_SWTMR + 1, CPUID_TO_AFFI_MASK((ArchCurrCpuid() + 1) % LOSCFG_KERNEL_CORE_NUM)); - testTask.uwResved = LOS_TASK_ATTR_JOINABLE; + TEST_TASK_PARAM_INIT(testTask, "it_swtmr_024_task2", TaskF02, + TASK_PRIO_TEST_SWTMR + 1); // not set cpuaffi ret = LOS_TaskCreate(&g_testTaskID02, &testTask); ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret); @@ -104,12 +102,6 @@ static UINT32 Testcase(void) ICUNIT_GOTO_EQUAL(g_testCount, 1, g_testCount, EXIT); - ret = LOS_TaskJoin(g_testTaskID01, NULL); - ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret); - - ret = LOS_TaskJoin(g_testTaskID02, NULL); - ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret); - LOS_SwtmrDelete(g_swTmrID); ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret); diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_025.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_025.c similarity index 83% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_025.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_025.c index 0377b465..69d3f1ee 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_025.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_025.c @@ -38,10 +38,10 @@ extern "C" { #endif /* __cpluscplus */ static UINT32 g_szId[LOSCFG_KERNEL_CORE_NUM] = {0}; -static UINT32 g_testSwtmtCount = 0; + static VOID SwtmrF01(void) { - LOS_AtomicInc(&g_testSwtmtCount); + LOS_AtomicInc(&g_testCount); } static void TaskF01(UINT32 index) @@ -61,31 +61,26 @@ static UINT32 Testcase(void) UINT32 ret; UINT32 currCpuid; UINT32 i; - UINT32 taskID[LOSCFG_KERNEL_CORE_NUM]; - g_testSwtmtCount = 0; + + g_testCount = 0; g_testPeriod = 10; // period is 10 for (i = 0; i < LOSCFG_KERNEL_CORE_NUM; i++) { TEST_TASK_PARAM_INIT_AFFI(testTask, "it_swtmr_025_task1", TaskF01, TASK_PRIO_TEST_SWTMR + 1, CPUID_TO_AFFI_MASK(i)); testTask.auwArgs[0] = i; - testTask.uwResved = LOS_TASK_ATTR_JOINABLE; - ret = LOS_TaskCreate(&taskID[i], &testTask); + ret = LOS_TaskCreate(&g_testTaskID01, &testTask); ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret); } - for (i = 0; i < LOSCFG_KERNEL_CORE_NUM; i++) { - ret = LOS_TaskJoin(taskID[i], NULL); - ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret); - } + LOS_TaskDelay(1); for (i = 0; i < LOSCFG_KERNEL_CORE_NUM; i++) { - ret = LOS_SwtmrStart(g_szId[i]); - ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret); + LOS_SwtmrStart(g_szId[i]); } - LOS_TaskDelay(g_testPeriod + 5); /* 5 ticks */ + LOS_TaskDelay(g_testPeriod); - ICUNIT_GOTO_EQUAL(g_testSwtmtCount, LOSCFG_KERNEL_CORE_NUM, g_testSwtmtCount, EXIT); + ICUNIT_GOTO_EQUAL(g_testCount, LOSCFG_KERNEL_CORE_NUM, g_testCount, EXIT); for (i = 0; i < LOSCFG_KERNEL_CORE_NUM; i++) { ret = LOS_SwtmrDelete(g_szId[i]); diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_026.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_026.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_026.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_026.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_027.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_027.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_027.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_027.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_028.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_028.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_028.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_028.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_029.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_029.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_029.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_029.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_030.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_030.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_030.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_030.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_031.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_031.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_031.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_031.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_032.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_032.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_032.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_032.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_033.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_033.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_033.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_033.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_034.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_034.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_034.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_034.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_035.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_035.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_035.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/swtmr/smp/It_smp_los_swtmr_035.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/It_los_task.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/It_los_task.c similarity index 55% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/It_los_task.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/It_los_task.c index c48f04e3..fb194fa1 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/It_los_task.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/It_los_task.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2022 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -43,15 +43,27 @@ volatile INT32 g_timesliceTestCount = 0; void ItSuiteLosTask(void) { + int ret = LOS_SetProcessScheduler(LOS_GetCurrProcessID(), LOS_SCHED_RR, TASK_PRIO_TEST_TASK); + if (ret != LOS_OK) { + dprintf("%s set test process schedule failed! %d\n", ret); + } + ret = LOS_SetTaskScheduler(LOS_CurTaskIDGet(), LOS_SCHED_RR, TASK_PRIO_TEST_TASK); + if (ret != LOS_OK) { + dprintf("%s set test task schedule failed! %d\n", ret); + } #if defined(LOSCFG_TEST_SMOKE) ItLosTask045(); ItLosTask046(); + ItLosTask049(); + ItLosTask081(); ItLosTask089(); ItLosTask097(); ItLosTask101(); + ItLosTask105(); ItLosTask099(); ItLosTaskTimeslice001(); #ifdef LOSCFG_KERNEL_SMP + // reserved 20 for smoke test ItSmpLosTask001(); /* Task Affinity */ ItSmpLosTask002(); /* Task Deletion Across Cores */ ItSmpLosTask003(); /* Task Suspend Across Cores */ @@ -60,6 +72,138 @@ void ItSuiteLosTask(void) #endif #if defined(LOSCFG_TEST_FULL) + ItLosTask001(); + ItLosTask002(); + ItLosTask004(); + ItLosTask007(); + ItLosTask008(); + ItLosTask009(); + ItLosTask010(); + ItLosTask011(); + ItLosTask012(); + ItLosTask013(); + ItLosTask014(); + ItLosTask015(); + ItLosTask016(); + ItLosTask017(); + ItLosTask018(); + ItLosTask019(); + ItLosTask020(); + ItLosTask021(); + ItLosTask022(); + ItLosTask023(); + ItLosTask024(); + ItLosTask025(); + ItLosTask026(); + ItLosTask027(); + ItLosTask028(); + ItLosTask029(); + ItLosTask031(); + ItLosTask032(); + ItLosTask033(); + ItLosTask034(); + ItLosTask035(); + ItLosTask036(); + ItLosTask037(); + ItLosTask038(); + ItLosTask039(); +#ifndef TESTHI1980IMU + ItLosTask040(); +#endif + ItLosTask041(); + ItLosTask042(); + ItLosTask043(); + ItLosTask047(); + ItLosTask048(); + ItLosTask050(); + ItLosTask051(); + ItLosTask052(); + ItLosTask053(); + ItLosTask054(); + ItLosTask055(); + ItLosTask056(); + ItLosTask057(); + ItLosTask058(); + ItLosTask060(); + ItLosTask061(); + ItLosTask063(); + ItLosTask064(); + ItLosTask065(); + ItLosTask066(); + ItLosTask067(); + ItLosTask068(); + ItLosTask069(); + ItLosTask071(); + ItLosTask072(); + ItLosTask073(); + ItLosTask074(); +#ifndef LOSCFG_KERNEL_SMP + ItLosTask075(); +#endif + ItLosTask076(); + ItLosTask077(); + ItLosTask078(); + ItLosTask079(); + ItLosTask080(); // LOS_TaskYeild is not allowed in irq + ItLosTask082(); + ItLosTask090(); + ItLosTask092(); + ItLosTask093(); + ItLosTask094(); + ItLosTask095(); + ItLosTask096(); + ItLosTask098(); + ItLosTask100(); + ItLosTask102(); + ItLosTask103(); + ItLosTask104(); + ItLosTask106(); + ItLosTask107(); + ItLosTask108(); + ItLosTask109(); + ItLosTask110(); + ItLosTask111(); + ItLosTask112(); + ItLosTask113(); + ItLosTask114(); + ItLosTask115(); + ItLosTask116(); // Not used the API LOS_CurTaskPriSet to change the task priority for the software timer + ItLosTask119(); + ItLosTask120(); + ItLosTask121(); + ItLosTask122(); + ItLosTask123(); + ItLosTask124(); + ItLosTask125(); + ItLosTask126(); + ItLosTask127(); + ItLosTask128(); + ItLosTask129(); + ItLosTask130(); + ItLosTask131(); + ItLosTask132(); + ItLosTask133(); + ItLosTask134(); + ItLosTask135(); + ItLosTask136(); +#ifndef LOSCFG_ARCH_FPU_DISABLE + ItLosTask141(); /* fpu regs check in task switch */ + ItLosTask142(); /* fpu regs check in irq context switch */ +#endif + ItLosTaskTimeslice002(); + ItLosTaskTimeslice003(); + ItLosTaskTimeslice004(); +#ifdef LOSCFG_KERNEL_SMP +#ifndef LOSCFG_ARCH_FPU_DISABLE + + ItSmpLosFloatSwitch001(); + ItSmpLosFloatSwitch002(); + ItSmpLosFloatSwitch003(); + ItSmpLosFloatSwitch004(); + ItSmpLosFloatSwitch005(); + ItSmpLosFloatSwitch006(); + ItSmpLosFloatSwitch007(); +#endif // fixed ItSmpLosTask099(); ItSmpLosTask049(); @@ -67,6 +211,7 @@ void ItSuiteLosTask(void) ItSmpLosTask159(); ItSmpLosTask161(); ItSmpLosTask137(); + ItSmpLosTask158(); ItSmpLosTask021(); ItSmpLosTask022(); ItSmpLosTask023(); @@ -90,6 +235,7 @@ void ItSuiteLosTask(void) ItSmpLosTask047(); ItSmpLosTask048(); ItSmpLosTask050(); + ItSmpLosTask051(); ItSmpLosTask052(); ItSmpLosTask053(); ItSmpLosTask054(); @@ -117,6 +263,7 @@ void ItSuiteLosTask(void) ItSmpLosTask078(); ItSmpLosTask079(); ItSmpLosTask081(); + ItSmpLosTask082(); ItSmpLosTask084(); ItSmpLosTask087(); ItSmpLosTask088(); @@ -128,6 +275,7 @@ void ItSuiteLosTask(void) ItSmpLosTask094(); ItSmpLosTask095(); ItSmpLosTask096(); + ItSmpLosTask097(); ItSmpLosTask098(); ItSmpLosTask100(); ItSmpLosTask101(); @@ -175,6 +323,21 @@ void ItSuiteLosTask(void) ItSmpLosTask156(); ItSmpLosTask157(); #endif +#endif + +#ifdef LOSCFG_KERNEL_SMP + HalIrqSetAffinity(HWI_NUM_TEST, 1); + HalIrqSetAffinity(HWI_NUM_TEST1, 1); + HalIrqSetAffinity(HWI_NUM_TEST3, 1); +#endif + ret = LOS_SetProcessScheduler(LOS_GetCurrProcessID(), LOS_SCHED_RR, 20); // 20, set a reasonable priority. + if (ret != LOS_OK) { + dprintf("%s set test process schedule failed! %d\n", ret); + } + ret = LOS_SetTaskScheduler(LOS_CurTaskIDGet(), LOS_SCHED_RR, TASK_PRIO_TEST); + if (ret != LOS_OK) { + dprintf("%s set test task schedule failed! %d\n", ret); + } } #ifdef __cplusplus #if __cplusplus diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/It_los_task.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/It_los_task.h similarity index 99% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/It_los_task.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/It_los_task.h index ab1e54f4..7f47bb5f 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/It_los_task.h +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/It_los_task.h @@ -39,7 +39,6 @@ #include "los_list.h" #include "los_process_pri.h" #include "los_percpu_pri.h" -#include "los_swtmr_pri.h" #ifdef __cplusplus #if __cplusplus diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/float/It_los_float.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/float/It_los_float.h similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/float/It_los_float.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/float/It_los_float.h diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/float/It_smp_los_float_switch_001.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/float/It_smp_los_float_switch_001.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/float/It_smp_los_float_switch_001.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/float/It_smp_los_float_switch_001.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/float/It_smp_los_float_switch_002.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/float/It_smp_los_float_switch_002.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/float/It_smp_los_float_switch_002.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/float/It_smp_los_float_switch_002.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/float/It_smp_los_float_switch_003.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/float/It_smp_los_float_switch_003.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/float/It_smp_los_float_switch_003.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/float/It_smp_los_float_switch_003.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/float/It_smp_los_float_switch_004.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/float/It_smp_los_float_switch_004.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/float/It_smp_los_float_switch_004.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/float/It_smp_los_float_switch_004.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/float/It_smp_los_float_switch_005.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/float/It_smp_los_float_switch_005.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/float/It_smp_los_float_switch_005.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/float/It_smp_los_float_switch_005.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/float/It_smp_los_float_switch_006.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/float/It_smp_los_float_switch_006.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/float/It_smp_los_float_switch_006.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/float/It_smp_los_float_switch_006.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/float/It_smp_los_float_switch_007.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/float/It_smp_los_float_switch_007.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/float/It_smp_los_float_switch_007.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/float/It_smp_los_float_switch_007.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_001.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_001.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_001.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_001.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_002.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_002.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_002.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_002.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_004.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_004.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_004.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_004.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_007.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_007.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_007.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_007.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_008.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_008.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_008.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_008.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_009.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_009.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_009.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_009.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_010.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_010.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_010.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_010.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_011.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_011.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_011.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_011.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_012.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_012.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_012.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_012.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_013.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_013.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_013.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_013.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_014.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_014.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_014.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_014.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_015.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_015.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_015.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_015.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_016.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_016.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_016.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_016.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_017.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_017.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_017.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_017.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_018.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_018.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_018.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_018.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_019.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_019.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_019.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_019.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_020.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_020.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_020.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_020.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_021.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_021.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_021.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_021.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_022.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_022.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_022.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_022.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_023.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_023.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_023.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_023.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_024.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_024.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_024.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_024.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_025.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_025.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_025.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_025.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_026.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_026.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_026.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_026.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_027.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_027.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_027.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_027.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_028.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_028.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_028.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_028.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_029.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_029.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_029.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_029.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_031.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_031.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_031.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_031.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_032.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_032.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_032.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_032.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_033.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_033.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_033.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_033.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_034.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_034.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_034.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_034.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_035.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_035.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_035.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_035.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_036.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_036.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_036.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_036.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_037.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_037.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_037.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_037.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_038.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_038.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_038.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_038.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_039.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_039.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_039.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_039.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_040.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_040.c similarity index 96% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_040.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_040.c index 5b9deb01..9b7fcb23 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_040.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_040.c @@ -58,7 +58,7 @@ static UINT32 Testcase(void) // 32, number of cycles for (index = 0; index < 32; index++) { task1.usTaskPrio = index; - (void)snprintf_s(acName, TASK_NAME_NUM, TASK_NAME_NUM - 1, "Tsk040A%2d", index); + snprintf(acName, 10, "Tsk040A%2d", index); // 10, snprintf size. task1.pcName = acName; task1.uwResved = LOS_TASK_STATUS_DETACHED; diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_041.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_041.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_041.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_041.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_042.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_042.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_042.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_042.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_043.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_043.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_043.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_043.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_047.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_047.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_047.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_047.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_048.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_048.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_048.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_048.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_050.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_050.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_050.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_050.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_051.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_051.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_051.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_051.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_052.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_052.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_052.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_052.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_053.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_053.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_053.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_053.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_054.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_054.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_054.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_054.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_055.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_055.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_055.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_055.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_056.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_056.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_056.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_056.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_057.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_057.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_057.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_057.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_058.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_058.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_058.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_058.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_060.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_060.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_060.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_060.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_061.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_061.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_061.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_061.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_063.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_063.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_063.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_063.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_064.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_064.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_064.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_064.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_065.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_065.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_065.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_065.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_066.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_066.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_066.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_066.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_067.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_067.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_067.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_067.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_068.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_068.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_068.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_068.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_069.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_069.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_069.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_069.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_071.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_071.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_071.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_071.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_072.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_072.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_072.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_072.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_073.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_073.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_073.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_073.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_074.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_074.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_074.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_074.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_075.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_075.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_075.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_075.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_076.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_076.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_076.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_076.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_077.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_077.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_077.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_077.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_078.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_078.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_078.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_078.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_079.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_079.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_079.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_079.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_080.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_080.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_080.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_080.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_082.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_082.c similarity index 97% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_082.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_082.c index 8fc8eb7e..ac9b3a88 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_082.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_082.c @@ -58,10 +58,9 @@ EXIT: static UINT32 Testcase(void) { UINT32 ret; - TSK_INIT_PARAM_S task1 = {0}; - + TSK_INIT_PARAM_S task1; LOS_EventInit(&g_eventCb01); - + memset(&task1, 0, sizeof(TSK_INIT_PARAM_S)); task1.pfnTaskEntry = (TSK_ENTRY_FUNC)TaskF01; task1.pcName = "Tsk082A"; task1.uwStackSize = TASK_STACK_SIZE_TEST; diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_090.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_090.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_090.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_090.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_092.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_092.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_092.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_092.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_093.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_093.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_093.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_093.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_094.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_094.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_094.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_094.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_095.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_095.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_095.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_095.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_096.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_096.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_096.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_096.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_098.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_098.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_098.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_098.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_100.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_100.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_100.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_100.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_102.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_102.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_102.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_102.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_103.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_103.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_103.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_103.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_104.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_104.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_104.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_104.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_106.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_106.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_106.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_106.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_107.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_107.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_107.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_107.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_108.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_108.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_108.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_108.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_109.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_109.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_109.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_109.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_110.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_110.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_110.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_110.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_111.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_111.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_111.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_111.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_112.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_112.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_112.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_112.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_113.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_113.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_113.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_113.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_114.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_114.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_114.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_114.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_115.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_115.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_115.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_115.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_116.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_116.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_116.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_116.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_118.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_118.c similarity index 97% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_118.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_118.c index e3ea1bf7..7054a2fd 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_118.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_118.c @@ -142,8 +142,7 @@ static UINT32 Testcase(void) ret = LOS_TaskCreate(&g_testTaskID01, &task1); ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret); - ret = memset_s(&task1, sizeof(TSK_INIT_PARAM_S), 0, sizeof(TSK_INIT_PARAM_S)); - ICUNIT_ASSERT_EQUAL(ret, 0, ret); + memset(&task1, 0, sizeof(TSK_INIT_PARAM_S)); task1.pfnTaskEntry = (TSK_ENTRY_FUNC)TaskF02; task1.uwStackSize = TASK_STACK_SIZE_TEST; task1.pcName = "Tsk118B"; diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_119.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_119.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_119.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_119.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_120.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_120.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_120.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_120.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_121.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_121.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_121.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_121.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_122.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_122.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_122.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_122.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_123.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_123.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_123.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_123.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_124.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_124.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_124.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_124.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_125.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_125.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_125.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_125.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_126.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_126.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_126.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_126.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_127.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_127.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_127.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_127.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_128.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_128.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_128.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_128.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_129.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_129.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_129.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_129.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_130.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_130.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_130.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_130.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_131.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_131.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_131.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_131.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_132.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_132.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_132.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_132.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_133.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_133.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_133.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_133.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_134.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_134.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_134.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_134.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_135.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_135.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_135.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_135.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_136.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_136.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_136.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_136.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_138.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_138.c similarity index 97% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_138.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_138.c index 6a4210d0..e3410976 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_138.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_138.c @@ -142,8 +142,7 @@ static UINT32 Testcase(void) ret = LOS_TaskCreate(&g_testTaskID01, &task1); ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret); - ret = memset_s(&task1, sizeof(TSK_INIT_PARAM_S), 0, sizeof(TSK_INIT_PARAM_S)); - ICUNIT_ASSERT_EQUAL(ret, 0, ret); + memset(&task1, 0, sizeof(TSK_INIT_PARAM_S)); task1.pfnTaskEntry = (TSK_ENTRY_FUNC)TaskF02; task1.uwStackSize = TASK_STACK_SIZE_TEST; task1.pcName = "Tsk118B"; diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_141.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_141.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_141.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_141.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_142.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_142.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_142.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_142.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_timeslice_002.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_timeslice_002.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_timeslice_002.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_timeslice_002.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_timeslice_003.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_timeslice_003.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_timeslice_003.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_timeslice_003.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_timeslice_004.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_timeslice_004.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_timeslice_004.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/full/It_los_task_timeslice_004.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smoke/It_los_task_045.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smoke/It_los_task_045.c similarity index 98% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smoke/It_los_task_045.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smoke/It_los_task_045.c index 6cc62a2e..b8894d8c 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smoke/It_los_task_045.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smoke/It_los_task_045.c @@ -67,7 +67,7 @@ static UINT32 Testcase(void) ret = LOS_SwtmrStart(swTmrID); ICUNIT_GOTO_EQUAL(ret, LOS_OK, ret, EXIT); - ret = LOS_TaskDelay(100); // 100, set delay time. + ret = LOS_TaskDelay(10); // 10, set delay time. ICUNIT_GOTO_EQUAL(ret, LOS_OK, ret, EXIT); ICUNIT_ASSERT_EQUAL(g_testCount, 1, g_testCount); diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smoke/It_los_task_046.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smoke/It_los_task_046.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smoke/It_los_task_046.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smoke/It_los_task_046.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smoke/It_los_task_049.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smoke/It_los_task_049.c similarity index 95% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smoke/It_los_task_049.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smoke/It_los_task_049.c index f1cb1b56..3742a238 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smoke/It_los_task_049.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smoke/It_los_task_049.c @@ -38,7 +38,6 @@ extern "C" { #endif /* __cpluscplus */ static TSK_INFO_S g_taskInfo; -static UINT16 g_testPrio; static void TaskF01(void) { UINT32 ret; @@ -57,7 +56,7 @@ static void TaskF01(void) ICUNIT_GOTO_STRING_EQUAL(g_taskInfo.acName, "Tsk049A", g_taskInfo.acName, EXIT1); ICUNIT_GOTO_EQUAL(g_taskInfo.uwTaskID, g_testTaskID01, g_taskInfo.uwTaskID, EXIT1); // 2, assert usTaskPrio change. - ICUNIT_GOTO_EQUAL(g_taskInfo.usTaskPrio, g_testPrio - 2, g_taskInfo.usTaskPrio, EXIT1); + ICUNIT_GOTO_EQUAL(g_taskInfo.usTaskPrio, TASK_PRIO_TEST_TASK - 2, g_taskInfo.usTaskPrio, EXIT1); ICUNIT_GOTO_EQUAL(OS_TASK_STATUS_RUNNING & g_taskInfo.usTaskStatus, OS_TASK_STATUS_RUNNING, OS_TASK_STATUS_RUNNING & g_taskInfo.usTaskStatus, EXIT1); ICUNIT_GOTO_EQUAL(g_taskInfo.uwBottomOfStack, g_taskInfo.uwSP + g_taskInfo.uwCurrUsed, g_taskInfo.uwBottomOfStack, @@ -78,12 +77,11 @@ static UINT32 Testcase(void) UINT32 ret; TSK_INIT_PARAM_S task1 = { 0 }; - g_testPrio = TASK_PRIO_TEST_TASK; task1.pfnTaskEntry = (TSK_ENTRY_FUNC)TaskF01; task1.uwStackSize = TASK_STACK_SIZE_TEST; task1.pcName = "Tsk049A"; // 2, It is used to calculate a priority relative to TASK_PRIO_TEST_TASK. - task1.usTaskPrio = g_testPrio - 2; + task1.usTaskPrio = TASK_PRIO_TEST_TASK - 2; task1.uwResved = LOS_TASK_STATUS_DETACHED; #ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smoke/It_los_task_081.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smoke/It_los_task_081.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smoke/It_los_task_081.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smoke/It_los_task_081.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smoke/It_los_task_089.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smoke/It_los_task_089.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smoke/It_los_task_089.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smoke/It_los_task_089.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smoke/It_los_task_097.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smoke/It_los_task_097.c similarity index 97% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smoke/It_los_task_097.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smoke/It_los_task_097.c index f7b83b3a..dee48ee6 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smoke/It_los_task_097.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smoke/It_los_task_097.c @@ -102,6 +102,9 @@ static UINT32 Testcase(void) ret = LOS_TaskDelete(g_testTaskID01); ICUNIT_GOTO_EQUAL(ret, LOS_ERRNO_TSK_NOT_CREATED, ret, EXIT); + ret = LOS_TaskDelete(g_testTaskID02); + ICUNIT_GOTO_EQUAL(ret, LOS_OK, ret, EXIT); + return LOS_OK; EXIT: diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smoke/It_los_task_099.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smoke/It_los_task_099.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smoke/It_los_task_099.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smoke/It_los_task_099.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smoke/It_los_task_101.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smoke/It_los_task_101.c similarity index 95% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smoke/It_los_task_101.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smoke/It_los_task_101.c index 223c11cb..d16703f0 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smoke/It_los_task_101.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smoke/It_los_task_101.c @@ -37,7 +37,6 @@ extern "C" { #endif /* __cpluscplus */ #endif /* __cpluscplus */ -static UINT32 g_testPrio; static void TaskF01(void) { UINT32 ret; @@ -47,7 +46,7 @@ static void TaskF01(void) ICUNIT_ASSERT_EQUAL_VOID(g_testCount, 1, g_testCount); ret = LOS_TaskPriGet(g_testTaskID01); - ICUNIT_ASSERT_EQUAL_VOID(ret, g_testPrio, ret); + ICUNIT_ASSERT_EQUAL_VOID(ret, TASK_PRIO_TEST_TASK - 1, ret); g_testCount++; } @@ -56,11 +55,10 @@ static UINT32 Testcase(void) { UINT32 ret; TSK_INIT_PARAM_S task1 = { 0 }; - g_testPrio = TASK_PRIO_TEST_TASK - 1; task1.pfnTaskEntry = (TSK_ENTRY_FUNC)TaskF01; task1.uwStackSize = TASK_STACK_SIZE_TEST; task1.pcName = "Tsk101A"; - task1.usTaskPrio = g_testPrio; + task1.usTaskPrio = TASK_PRIO_TEST_TASK - 1; task1.uwResved = LOS_TASK_STATUS_DETACHED; #ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smoke/It_los_task_105.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smoke/It_los_task_105.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smoke/It_los_task_105.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smoke/It_los_task_105.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smoke/It_los_task_timeslice_001.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smoke/It_los_task_timeslice_001.c similarity index 99% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smoke/It_los_task_timeslice_001.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smoke/It_los_task_timeslice_001.c index b5100a99..bc5ad154 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smoke/It_los_task_timeslice_001.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smoke/It_los_task_timeslice_001.c @@ -67,7 +67,7 @@ static UINT32 Testcase(void) g_itTimesliceTestCount1 = 0; g_timesliceTestCount = 0; LOS_TaskLock(); - TSK_INIT_PARAM_S task = { 0 }; + TSK_INIT_PARAM_S task; task.pfnTaskEntry = (TSK_ENTRY_FUNC)TaskF01; task.pcName = "TimesTsk001A"; diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_001.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_001.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_001.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_001.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_002.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_002.c similarity index 95% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_002.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_002.c index b7ae2ae4..0958e7bc 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_002.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_002.c @@ -61,14 +61,14 @@ static UINT32 Testcase(void) LOS_TaskDelay(2); // 2, set delay time. ret = LOS_TaskDelete(testid); - ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret); #ifndef LOSCFG_KERNEL_SMP_TASK_SYNC /* delay and check */ LOS_TaskDelay(10); // 10, set delay time. #endif - ret = LOS_TaskDelete(testid); - ICUNIT_ASSERT_EQUAL(ret, LOS_ERRNO_TSK_NOT_CREATED, ret); + + ret = OS_TCB_FROM_TID(testid)->taskStatus; + ICUNIT_ASSERT_EQUAL(ret & OS_TASK_STATUS_UNUSED, OS_TASK_STATUS_UNUSED, ret); return LOS_OK; } diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_003.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_003.c similarity index 95% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_003.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_003.c index af402953..cdf68a71 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_003.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_003.c @@ -60,11 +60,10 @@ static UINT32 Testcase(void) ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret); LOS_TaskDelay(2); // 2, set delay time. - ret = LOS_TaskSuspend(testid); - ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret); + LOS_TaskSuspend(testid); /* delay and check */ - LOS_TaskDelay(100); // 10, set delay time. + LOS_TaskDelay(10); // 10, set delay time. ret = OS_TCB_FROM_TID(testid)->taskStatus; ICUNIT_GOTO_EQUAL(ret & OS_TASK_STATUS_SUSPEND, OS_TASK_STATUS_SUSPEND, ret, EXIT); diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_004.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_004.c similarity index 95% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_004.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_004.c index f1ed6a5b..6204ca15 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_004.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_004.c @@ -58,6 +58,10 @@ static UINT32 Testcase(void) while (g_testCount == 0) { } ICUNIT_ASSERT_EQUAL(g_testCount, 1, g_testCount); + LosTaskCB *runTask; + + runTask = OsCurrTaskGet(); + ICUNIT_ASSERT_EQUAL(strcmp(runTask->taskName, "IT_TST_INI"), 0, 1); return LOS_OK; diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_021.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_021.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_021.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_021.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_022.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_022.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_022.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_022.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_023.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_023.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_023.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_023.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_024.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_024.c similarity index 97% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_024.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_024.c index 7ed3dcd4..d1b38e31 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_024.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_024.c @@ -80,8 +80,7 @@ static UINT32 Testcase(void) currCpuid = (ArchCurrCpuid() + 1) % LOSCFG_KERNEL_CORE_NUM; #endif - ret = memset_s(&task, sizeof(TSK_INIT_PARAM_S), 0, sizeof(TSK_INIT_PARAM_S)); - ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT); + memset(&task, 0, sizeof(TSK_INIT_PARAM_S)); task.pfnTaskEntry = (TSK_ENTRY_FUNC)ItTimeslice001F01; task.usTaskPrio = TASK_PRIO_TEST_TASK + 1; task.pcName = "it_timeslice_001_f01"; diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_025.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_025.c similarity index 97% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_025.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_025.c index 4c6909e2..33270a17 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_025.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_025.c @@ -99,8 +99,7 @@ static UINT32 Testcase(void) currCpuid = (ArchCurrCpuid() + 1) % LOSCFG_KERNEL_CORE_NUM; #endif - ret = memset_s(&task, sizeof(TSK_INIT_PARAM_S), 0, sizeof(TSK_INIT_PARAM_S)); - ICUNIT_ASSERT_EQUAL(ret, 0, ret); + memset(&task, 0, sizeof(TSK_INIT_PARAM_S)); task.pfnTaskEntry = (TSK_ENTRY_FUNC)ItTimeslice002F01; task.usTaskPrio = TASK_PRIO_TEST_TASK + 1; task.pcName = "it_timeslice_002_f01"; diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_026.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_026.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_026.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_026.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_027.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_027.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_027.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_027.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_028.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_028.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_028.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_028.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_029.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_029.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_029.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_029.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_030.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_030.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_030.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_030.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_032.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_032.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_032.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_032.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_033.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_033.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_033.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_033.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_034.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_034.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_034.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_034.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_035.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_035.c similarity index 98% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_035.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_035.c index ccbe59ff..be51a961 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_035.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_035.c @@ -51,7 +51,7 @@ static UINT32 Testcase(void) g_testCount = 0; TEST_TASK_PARAM_INIT(task1, "it_smp_task_035", (TSK_ENTRY_FUNC)TaskF02Preempt, TASK_PRIO_TEST_TASK - 1); - /* create preempt task */ + /* creat preempt task */ task1.usCpuAffiMask = 0; ret = LOS_TaskCreate(&g_testTaskID01, &task1); ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret); diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_036.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_036.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_036.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_036.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_037.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_037.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_037.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_037.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_040.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_040.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_040.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_040.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_042.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_042.c similarity index 98% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_042.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_042.c index 0933d379..79cb1f15 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_042.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_042.c @@ -61,7 +61,7 @@ static UINT32 Testcase(void) TEST_TASK_PARAM_INIT(task1, "it_smp_task_042", (TSK_ENTRY_FUNC)TaskF01, TASK_PRIO_TEST_TASK); int i; - /* create high prio task on every cores */ + /* creat high prio task on every cores */ for (i = 0; i < LOSCFG_KERNEL_CORE_NUM - 1; i++) { /* take control of every cores */ task1.usCpuAffiMask = CPUID_TO_AFFI_MASK((ArchCurrCpuid() + i + 1) % (LOSCFG_KERNEL_CORE_NUM)); diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_043.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_043.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_043.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_043.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_044.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_044.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_044.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_044.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_046.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_046.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_046.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_046.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_047.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_047.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_047.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_047.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_048.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_048.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_048.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_048.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_049.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_049.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_049.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_049.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_050.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_050.c similarity index 91% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_050.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_050.c index c744494d..28094b40 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_050.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_050.c @@ -65,22 +65,25 @@ static UINT32 Testcase(void) ret = OS_TCB_FROM_TID(g_testTaskID01)->taskStatus; ICUNIT_GOTO_NOT_EQUAL(ret & OS_TASK_STATUS_RUNNING, 0, ret, EXIT); + ICUNIT_GOTO_NOT_EQUAL(ret & OS_TASK_STATUS_DETACHED, 0, ret, EXIT); ret = LOS_TaskSuspend(g_testTaskID01); ICUNIT_GOTO_EQUAL(ret, LOS_OK, ret, EXIT); - TestBusyTaskDelay(100); // 100, set delay time + TestBusyTaskDelay(10); // 10, set delay time ret = OS_TCB_FROM_TID(g_testTaskID01)->taskStatus; ICUNIT_GOTO_NOT_EQUAL(ret & OS_TASK_STATUS_SUSPEND, 0, ret, EXIT); + ICUNIT_GOTO_NOT_EQUAL(ret & OS_TASK_STATUS_DETACHED, 0, ret, EXIT); ret = LOS_TaskResume(g_testTaskID01); ICUNIT_GOTO_EQUAL(ret, LOS_OK, ret, EXIT); - TestBusyTaskDelay(100); // 100, set delay time + TestBusyTaskDelay(10); // 10, set delay time ret = OS_TCB_FROM_TID(g_testTaskID01)->taskStatus; ICUNIT_GOTO_NOT_EQUAL(ret & OS_TASK_STATUS_RUNNING, 0, ret, EXIT); + ICUNIT_GOTO_NOT_EQUAL(ret & OS_TASK_STATUS_DETACHED, 0, ret, EXIT); ret = LOS_TaskDelete(g_testTaskID01); ICUNIT_GOTO_EQUAL(ret, LOS_OK, ret, EXIT); diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_051.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_051.c similarity index 97% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_051.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_051.c index 99a49c20..f7379696 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_051.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_051.c @@ -101,7 +101,7 @@ static UINT32 Testcase(void) TestBusyTaskDelay(10); // 10, set delay time ret = OS_TCB_FROM_TID(g_testTaskID02)->taskStatus; - ICUNIT_GOTO_EQUAL(ret & OS_TASK_STATUS_SUSPEND, OS_TASK_STATUS_SUSPEND, ret, EXIT); + ICUNIT_GOTO_EQUAL(ret, OS_TASK_STATUS_SUSPEND | OS_TASK_STATUS_DETACHED, ret, EXIT); ICUNIT_GOTO_EQUAL(g_testCount, 4, g_testCount, EXIT); // 4, assert that g_testCount is equal to this. diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_052.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_052.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_052.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_052.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_053.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_053.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_053.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_053.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_054.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_054.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_054.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_054.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_055.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_055.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_055.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_055.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_056.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_056.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_056.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_056.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_057.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_057.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_057.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_057.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_058.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_058.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_058.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_058.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_059.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_059.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_059.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_059.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_060.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_060.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_060.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_060.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_061.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_061.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_061.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_061.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_062.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_062.c similarity index 98% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_062.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_062.c index 7c055bee..84267764 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_062.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_062.c @@ -59,7 +59,7 @@ static UINT32 Testcase(void) TSK_INIT_PARAM_S task1 = { 0 }; g_testCount = 0; - // 5, length of the queue; 50, max queue msg size. + // 5, lengh of the queue; 50, max queue msg size. ret = LOS_QueueCreate("queue", 5, &g_queue, 0, 50); ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret); diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_063.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_063.c similarity index 98% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_063.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_063.c index 16ba91d8..b15acee9 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_063.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_063.c @@ -58,7 +58,7 @@ static UINT32 Testcase(void) TSK_INIT_PARAM_S task1 = { 0 }; g_testCount = 0; - // 5, length of the queue; 50, max queue msg size. + // 5, lengh of the queue; 50, max queue msg size. ret = LOS_QueueCreate("queue", 5, &g_queue, 0, 50); TEST_TASK_PARAM_INIT(task1, "it_smp_task_063", (TSK_ENTRY_FUNC)TaskF01, TASK_PRIO_TEST_TASK - 1); diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_064.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_064.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_064.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_064.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_065.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_065.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_065.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_065.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_066.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_066.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_066.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_066.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_067.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_067.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_067.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_067.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_068.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_068.c similarity index 98% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_068.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_068.c index ab7fc3fb..ef09a714 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_068.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_068.c @@ -72,7 +72,7 @@ static UINT32 Testcase(void) TSK_INIT_PARAM_S task1 = { 0 }; g_testCount = 0; - // 5, length of the queue; 50, max queue msg size. + // 5, lengh of the queue; 50, max queue msg size. ret = LOS_QueueCreate("queue", 5, &g_queue, 0, 50); TEST_TASK_PARAM_INIT(task1, "it_smp_task_068", (TSK_ENTRY_FUNC)TaskF01, TASK_PRIO_TEST_TASK - 1); diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_069.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_069.c similarity index 98% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_069.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_069.c index edf0c6ac..4a66a49c 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_069.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_069.c @@ -71,7 +71,7 @@ static UINT32 Testcase(void) UINT32 ret; TSK_INIT_PARAM_S task1 = { 0 }; g_testCount = 0; - // 5, length of the queue; 50, max queue msg size. + // 5, lengh of the queue; 50, max queue msg size. ret = LOS_QueueCreate("queue", 5, &g_queue, 0, 50); TEST_TASK_PARAM_INIT(task1, "it_smp_task_065", (TSK_ENTRY_FUNC)TaskF01, TASK_PRIO_TEST_TASK - 1); diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_070.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_070.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_070.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_070.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_071.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_071.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_071.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_071.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_072.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_072.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_072.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_072.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_073.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_073.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_073.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_073.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_074.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_074.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_074.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_074.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_075.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_075.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_075.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_075.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_076.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_076.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_076.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_076.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_077.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_077.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_077.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_077.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_078.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_078.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_078.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_078.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_079.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_079.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_079.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_079.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_081.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_081.c similarity index 97% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_081.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_081.c index eed2544c..8c209973 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_081.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_081.c @@ -49,7 +49,7 @@ static UINT32 Testcase(void) ret = LOS_TaskSuspend(gTestIdleTaskID); ICUNIT_ASSERT_EQUAL(ret, LOS_ERRNO_TSK_OPERATE_SYSTEM_TASK, ret); - gTestSwtmrTaskID = OsSwtmrTaskIDGetByCpuid(cpuid); + gTestSwtmrTaskID = g_percpu[cpuid].swtmrTaskID; ret = LOS_TaskSuspend(gTestSwtmrTaskID); ICUNIT_ASSERT_EQUAL(ret, LOS_ERRNO_TSK_OPERATE_SYSTEM_TASK, ret); diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_082.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_082.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_082.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_082.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_084.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_084.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_084.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_084.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_087.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_087.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_087.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_087.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_088.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_088.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_088.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_088.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_089.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_089.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_089.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_089.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_090.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_090.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_090.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_090.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_091.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_091.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_091.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_091.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_092.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_092.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_092.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_092.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_093.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_093.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_093.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_093.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_094.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_094.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_094.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_094.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_095.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_095.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_095.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_095.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_096.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_096.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_096.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_096.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_097.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_097.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_097.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_097.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_098.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_098.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_098.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_098.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_099.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_099.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_099.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_099.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_100.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_100.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_100.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_100.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_101.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_101.c similarity index 97% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_101.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_101.c index 26ef5a45..7163f044 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_101.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_101.c @@ -97,7 +97,7 @@ static UINT32 Testcase(void) ICUNIT_GOTO_NOT_EQUAL((ret & OS_TASK_STATUS_READY), 0, ret, EXIT); /* check if other core is Task_locked */ - gTestTaskLock = OsSchedRunqueueByID((ArchCurrCpuid() + 1) % (LOSCFG_KERNEL_CORE_NUM))->taskLockCnt; + gTestTaskLock = g_percpu[(ArchCurrCpuid() + 1) % (LOSCFG_KERNEL_CORE_NUM)].taskLockCnt; ICUNIT_ASSERT_NOT_EQUAL(gTestTaskLock, 0, gTestTaskLock); ret = LOS_TaskSuspend(g_testTaskID02); diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_102.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_102.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_102.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_102.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_103.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_103.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_103.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_103.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_105.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_105.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_105.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_105.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_106.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_106.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_106.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_106.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_107.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_107.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_107.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_107.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_108.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_108.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_108.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_108.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_109.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_109.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_109.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_109.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_110.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_110.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_110.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_110.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_112.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_112.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_112.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_112.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_113.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_113.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_113.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_113.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_114.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_114.c similarity index 97% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_114.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_114.c index ca48b5da..2ccb8961 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_114.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_114.c @@ -49,7 +49,7 @@ static UINT32 Testcase(void) ret = LOS_TaskDelete(gTestIdleTaskID); ICUNIT_ASSERT_EQUAL(ret, LOS_ERRNO_TSK_OPERATE_SYSTEM_TASK, ret); - gTestSwtmrTaskID = OsSwtmrTaskIDGetByCpuid(cpuid); + gTestSwtmrTaskID = g_percpu[cpuid].swtmrTaskID; ret = LOS_TaskDelete(gTestSwtmrTaskID); ICUNIT_ASSERT_EQUAL(ret, LOS_ERRNO_TSK_OPERATE_SYSTEM_TASK, ret); diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_115.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_115.c similarity index 91% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_115.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_115.c index b5b7d165..3b5a0a8f 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_115.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_115.c @@ -44,7 +44,12 @@ static UINT32 Testcase(void) UINT32 gTestSwtmrTaskID; UINT32 cpuid = (ArchCurrCpuid() + 1) % (LOSCFG_KERNEL_CORE_NUM); - gTestSwtmrTaskID = OsSwtmrTaskIDGetByCpuid(cpuid); + gTestIdleTaskID = g_percpu[cpuid].idleTaskID; + + ret = LOS_TaskDelete(gTestIdleTaskID); + ICUNIT_ASSERT_EQUAL(ret, LOS_ERRNO_TSK_OPERATE_SYSTEM_TASK, ret); + + gTestSwtmrTaskID = g_percpu[cpuid].swtmrTaskID; ret = LOS_TaskDelete(gTestSwtmrTaskID); ICUNIT_ASSERT_EQUAL(ret, LOS_ERRNO_TSK_OPERATE_SYSTEM_TASK, ret); diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_117.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_117.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_117.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_117.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_126.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_126.c similarity index 97% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_126.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_126.c index 9bf825d2..2d3cf903 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_126.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_126.c @@ -30,7 +30,6 @@ */ #include "It_los_task.h" -#include "los_swtmr_pri.h" #ifdef __cplusplus #if __cplusplus @@ -54,7 +53,7 @@ static void HwiF01(void) LOS_AtomicInc(&g_testCount); - gTestSwtmrTaskID = OsSwtmrTaskIDGetByCpuid(cpuid); + gTestSwtmrTaskID = g_percpu[cpuid].swtmrTaskID; ret = LOS_TaskDelete(gTestSwtmrTaskID); ICUNIT_ASSERT_EQUAL_VOID(ret, LOS_ERRNO_TSK_YIELD_IN_INT, ret); diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_127.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_127.c similarity index 95% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_127.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_127.c index 26de0819..bcba1ca2 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_127.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_127.c @@ -44,12 +44,12 @@ static void HwiF01(void) UINT32 gTestSwtmrTaskID; UINT32 cpuid = (ArchCurrCpuid() + 1) % (LOSCFG_KERNEL_CORE_NUM); - gTestIdleTaskID = OsSchedRunqueueByID(cpuid)->idleTaskID; + gTestIdleTaskID = g_percpu[cpuid].idleTaskID; ret = LOS_TaskDelete(gTestIdleTaskID); ICUNIT_ASSERT_EQUAL_VOID(ret, LOS_ERRNO_TSK_YIELD_IN_INT, ret); - gTestSwtmrTaskID = OsSwtmrTaskIDGetByCpuid(cpuid); + gTestSwtmrTaskID = g_percpu[cpuid].swtmrTaskID; ret = LOS_TaskDelete(gTestSwtmrTaskID); ICUNIT_ASSERT_EQUAL_VOID(ret, LOS_ERRNO_TSK_YIELD_IN_INT, ret); diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_128.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_128.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_128.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_128.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_129.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_129.c similarity index 96% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_129.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_129.c index a3bf8d37..eeb685fc 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_129.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_129.c @@ -57,7 +57,7 @@ static UINT32 Testcase(void) int i; for (i = 0; i < LOSCFG_KERNEL_CORE_NUM; i++) { - /* create core_num same priority tasks */ + /* creat core_num same priority tasks */ task1.usCpuAffiMask = 0; ret = LOS_TaskCreate(&testTaskIDSmp[i], &task1); ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret); @@ -72,7 +72,7 @@ static UINT32 Testcase(void) timesliceCount2 = TestTickCountGet(); - /* Check if task yield definitely succeeded */ + /* Check if task yield definitely successed */ ICUNIT_GOTO_NOT_EQUAL(timesliceCount2, timesliceCount1, timesliceCount2 - timesliceCount1, EXIT); for (i = 0; i < LOSCFG_KERNEL_CORE_NUM; i++) { diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_130.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_130.c similarity index 95% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_130.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_130.c index 4bd26689..fdd52701 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_130.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_130.c @@ -62,14 +62,16 @@ static UINT32 Testcase(void) TSK_INIT_PARAM_S task1 = { 0 }; g_testCount = 0; - UINT16 prio = LOS_TaskPriGet(LOS_CurTaskIDGet()); - TEST_TASK_PARAM_INIT(task1, "it_smp_task_130", (TSK_ENTRY_FUNC)TaskF01, prio); + TEST_TASK_PARAM_INIT(task1, "it_smp_task_130", (TSK_ENTRY_FUNC)TaskF01, TASK_PRIO_TEST_TASK); int i; task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); ret = LOS_TaskCreate(&g_testTaskID01, &task1); ICUNIT_GOTO_EQUAL(ret, LOS_OK, ret, EXIT); + ret = OS_TCB_FROM_TID(g_testTaskID01)->taskStatus; + ICUNIT_GOTO_NOT_EQUAL((ret & OS_TASK_STATUS_READY), 0, ret, EXIT); + /* Wait TaskF01 to yield, then testTask timeslice is LOSCFG_BASE_CORE_TIMESLICE_TIMEOUT */ if (g_testCount != 1) { LOS_TaskYield(); diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_131.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_131.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_131.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_131.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_132.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_132.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_132.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_132.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_133.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_133.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_133.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_133.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_134.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_134.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_134.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_134.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_135.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_135.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_135.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_135.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_136.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_136.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_136.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_136.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_137.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_137.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_137.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_137.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_138.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_138.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_138.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_138.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_139.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_139.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_139.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_139.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_141.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_141.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_141.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_141.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_142.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_142.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_142.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_142.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_143.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_143.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_143.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_143.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_144.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_144.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_144.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_144.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_145.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_145.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_145.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_145.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_146.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_146.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_146.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_146.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_147.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_147.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_147.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_147.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_148.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_148.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_148.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_148.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_149.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_149.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_149.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_149.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_150.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_150.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_150.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_150.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_151.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_151.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_151.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_151.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_152.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_152.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_152.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_152.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_153.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_153.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_153.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_153.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_154.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_154.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_154.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_154.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_155.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_155.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_155.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_155.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_156.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_156.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_156.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_156.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_157.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_157.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_157.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_157.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_158.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_158.c similarity index 97% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_158.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_158.c index fa4620b3..5a0158ca 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_158.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_158.c @@ -73,7 +73,7 @@ static UINT32 Testcase(void) ICUNIT_GOTO_EQUAL(g_testCount, 0, g_testCount, EXIT); for (i = 0; i < 100; i++) { // 100, Number of cycles. - TestBusyTaskDelay((LOSCFG_BASE_CORE_TIMESLICE_TIMEOUT / LOS_US_PER_TICK) - 1); + TestBusyTaskDelay(LOSCFG_BASE_CORE_TIMESLICE_TIMEOUT - 1); /* if same priority task is executedbreak loop */ if (g_testCount != i) { diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_159.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_159.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_159.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_159.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_160.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_160.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_160.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_160.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_161.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_161.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_161.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/core/task/smp/It_smp_los_task_161.c diff --git a/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/BUILD.gn b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/BUILD.gn new file mode 100644 index 00000000..df7789dd --- /dev/null +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/BUILD.gn @@ -0,0 +1,67 @@ +# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. +# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. +# +# 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. + +static_library("test_ipc") { + sources = [ + "event/It_los_event.c", + "mux/It_los_mux.c", + "queue/It_los_queue.c", + "sem/It_los_sem.c", + ] + + if (LOSCFG_TEST_SMOKE) { + sources += [ + "event/smoke/It_los_event_031.c", + "event/smoke/It_los_event_035.c", + "event/smoke/It_los_event_036.c", + "event/smoke/It_los_event_041.c", + "mux/smoke/It_los_mutex_001.c", + "mux/smoke/It_los_mutex_002.c", + "mux/smoke/It_los_mutex_003.c", + "mux/smoke/It_los_mutex_004.c", + "queue/smoke/It_los_queue_001.c", + "queue/smoke/It_los_queue_097.c", + "queue/smoke/It_los_queue_100.c", + "queue/smoke/It_los_queue_105.c", + "queue/smoke/It_los_queue_head_002.c", + "sem/smoke/It_los_sem_001.c", + "sem/smoke/It_los_sem_003.c", + "sem/smoke/It_los_sem_006.c", + ] + } + include_dirs = [ + "../../../include/", + "sem", + "event", + "mux", + "queue", + ] + + cflags = [ "-Wno-error" ] +} diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/Makefile b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/Makefile similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/Makefile rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/Makefile diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/It_los_event.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/It_los_event.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/It_los_event.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/It_los_event.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/It_los_event.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/It_los_event.h similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/It_los_event.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/It_los_event.h diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_001.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_001.c similarity index 97% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_001.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_001.c index 6b46ebb7..48a40bc7 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_001.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_001.c @@ -57,8 +57,8 @@ EXIT: static UINT32 Testcase(VOID) { UINT32 ret; - TSK_INIT_PARAM_S task1 = {0}; - + TSK_INIT_PARAM_S task1; + memset(&task1, 0, sizeof(TSK_INIT_PARAM_S)); task1.pfnTaskEntry = (TSK_ENTRY_FUNC)TaskF01; task1.pcName = "EventTsk1"; task1.uwStackSize = TASK_STACK_SIZE_TEST; diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_002.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_002.c similarity index 97% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_002.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_002.c index 032e53a5..758036c4 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_002.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_002.c @@ -60,8 +60,8 @@ EXIT: static UINT32 Testcase(VOID) { UINT32 ret; - TSK_INIT_PARAM_S task1 = {0}; - + TSK_INIT_PARAM_S task1; + memset(&task1, 0, sizeof(TSK_INIT_PARAM_S)); task1.pfnTaskEntry = (TSK_ENTRY_FUNC)TaskF01; task1.pcName = "EventTsk2"; task1.uwStackSize = TASK_STACK_SIZE_TEST; diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_003.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_003.c similarity index 97% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_003.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_003.c index bf8a5fb1..f64c9979 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_003.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_003.c @@ -56,8 +56,8 @@ EXIT: static UINT32 Testcase(VOID) { UINT32 ret; - TSK_INIT_PARAM_S task1 = {0}; - + TSK_INIT_PARAM_S task1; + memset(&task1, 0, sizeof(TSK_INIT_PARAM_S)); task1.pfnTaskEntry = (TSK_ENTRY_FUNC)TaskF01; task1.pcName = "EventTsk3"; task1.uwStackSize = TASK_STACK_SIZE_TEST; diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_004.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_004.c similarity index 97% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_004.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_004.c index 566cadca..3b080e9f 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_004.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_004.c @@ -57,8 +57,8 @@ EXIT: static UINT32 Testcase(VOID) { UINT32 ret; - TSK_INIT_PARAM_S task1 = {0}; - + TSK_INIT_PARAM_S task1; + memset(&task1, 0, sizeof(TSK_INIT_PARAM_S)); task1.pfnTaskEntry = (TSK_ENTRY_FUNC)TaskF01; task1.pcName = "EventTsk4"; task1.uwStackSize = TASK_STACK_SIZE_TEST; diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_005.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_005.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_005.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_005.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_006.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_006.c similarity index 98% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_006.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_006.c index 930d1617..84bd9b90 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_006.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_006.c @@ -62,8 +62,8 @@ EXIT: static UINT32 Testcase(VOID) { UINT32 ret; - TSK_INIT_PARAM_S task1 = {0}; - + TSK_INIT_PARAM_S task1; + memset(&task1, 0, sizeof(TSK_INIT_PARAM_S)); task1.pfnTaskEntry = (TSK_ENTRY_FUNC)TaskF01; task1.pcName = "EventTsk6"; task1.uwStackSize = TASK_STACK_SIZE_TEST; diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_007.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_007.c similarity index 98% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_007.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_007.c index 890f8c82..7823fa10 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_007.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_007.c @@ -88,8 +88,8 @@ EXIT: static UINT32 Testcase(VOID) { UINT32 ret; - TSK_INIT_PARAM_S task1 = {0}; - + TSK_INIT_PARAM_S task1; + memset(&task1, 0, sizeof(TSK_INIT_PARAM_S)); task1.pfnTaskEntry = (TSK_ENTRY_FUNC)TaskF01; task1.pcName = "EventTsk7"; task1.uwStackSize = TASK_STACK_SIZE_TEST; diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_008.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_008.c similarity index 97% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_008.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_008.c index 27e60a74..5f9caa63 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_008.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_008.c @@ -62,8 +62,8 @@ EXIT: static UINT32 Testcase(VOID) { UINT32 ret; - TSK_INIT_PARAM_S task1 = {0}; - + TSK_INIT_PARAM_S task1; + memset(&task1, 0, sizeof(TSK_INIT_PARAM_S)); task1.pfnTaskEntry = (TSK_ENTRY_FUNC)TaskF01; task1.pcName = "EventTsk8"; task1.uwStackSize = TASK_STACK_SIZE_TEST; diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_009.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_009.c similarity index 97% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_009.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_009.c index 63f734cf..214fa11f 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_009.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_009.c @@ -70,8 +70,8 @@ EXIT: static UINT32 Testcase(VOID) { UINT32 ret; - TSK_INIT_PARAM_S task1 = {0}; - + TSK_INIT_PARAM_S task1; + memset(&task1, 0, sizeof(TSK_INIT_PARAM_S)); task1.pfnTaskEntry = (TSK_ENTRY_FUNC)TaskF01; task1.pcName = "EventTsk9"; task1.uwStackSize = TASK_STACK_SIZE_TEST; diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_010.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_010.c similarity index 98% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_010.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_010.c index 4ddddb6e..ff0e6d67 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_010.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_010.c @@ -62,8 +62,8 @@ EXIT: static UINT32 Testcase(VOID) { UINT32 ret; - TSK_INIT_PARAM_S task1 = {0}; - + TSK_INIT_PARAM_S task1; + memset(&task1, 0, sizeof(TSK_INIT_PARAM_S)); task1.pfnTaskEntry = (TSK_ENTRY_FUNC)TaskF01; task1.pcName = "EventTsk10"; task1.uwStackSize = TASK_STACK_SIZE_TEST; diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_011.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_011.c similarity index 98% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_011.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_011.c index 83b447e3..5bd31ef7 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_011.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_011.c @@ -69,8 +69,8 @@ EXIT: static UINT32 Testcase(VOID) { UINT32 ret; - TSK_INIT_PARAM_S task1 = {0}; - + TSK_INIT_PARAM_S task1; + memset(&task1, 0, sizeof(TSK_INIT_PARAM_S)); task1.pfnTaskEntry = (TSK_ENTRY_FUNC)TaskF01; task1.pcName = "EventTsk11"; task1.uwStackSize = TASK_STACK_SIZE_TEST; diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_012.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_012.c similarity index 98% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_012.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_012.c index 8a68e30d..1ff137c7 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_012.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_012.c @@ -74,8 +74,8 @@ static UINT32 Testcase(VOID) { UINT32 ret; - TSK_INIT_PARAM_S task1 = {0}; - + TSK_INIT_PARAM_S task1; + memset(&task1, 0, sizeof(TSK_INIT_PARAM_S)); task1.pfnTaskEntry = (TSK_ENTRY_FUNC)TaskF01; task1.pcName = "EventTsk12"; task1.uwStackSize = TASK_STACK_SIZE_TEST; diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_013.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_013.c similarity index 98% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_013.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_013.c index 5c88cbe9..e5138c2b 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_013.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_013.c @@ -75,8 +75,8 @@ EXIT: static UINT32 Testcase(VOID) { UINT32 ret; - TSK_INIT_PARAM_S task1 = {0}; - + TSK_INIT_PARAM_S task1; + memset(&task1, 0, sizeof(TSK_INIT_PARAM_S)); task1.pfnTaskEntry = (TSK_ENTRY_FUNC)TaskF01; task1.pcName = "EventTsk13"; task1.uwStackSize = TASK_STACK_SIZE_TEST; diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_014.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_014.c similarity index 98% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_014.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_014.c index 75051c1c..efa80792 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_014.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_014.c @@ -67,8 +67,8 @@ EXIT: static UINT32 Testcase(VOID) { UINT32 ret; - TSK_INIT_PARAM_S task1 = {0}; - + TSK_INIT_PARAM_S task1; + memset(&task1, 0, sizeof(TSK_INIT_PARAM_S)); task1.pfnTaskEntry = (TSK_ENTRY_FUNC)TaskF01; task1.pcName = "EventTsk14"; task1.uwStackSize = TASK_STACK_SIZE_TEST; diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_015.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_015.c similarity index 98% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_015.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_015.c index c25036b2..e694d325 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_015.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_015.c @@ -65,8 +65,8 @@ EXIT: static UINT32 Testcase(VOID) { UINT32 ret; - TSK_INIT_PARAM_S task1 = {0}; - + TSK_INIT_PARAM_S task1; + memset(&task1, 0, sizeof(TSK_INIT_PARAM_S)); task1.pfnTaskEntry = (TSK_ENTRY_FUNC)TaskF01; task1.pcName = "EventTsk15"; task1.uwStackSize = TASK_STACK_SIZE_TEST; diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_016.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_016.c similarity index 97% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_016.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_016.c index d8f96bc1..6bc9a0bb 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_016.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_016.c @@ -60,8 +60,8 @@ EXIT: static UINT32 Testcase(VOID) { UINT32 ret; - TSK_INIT_PARAM_S task1 = {0}; - + TSK_INIT_PARAM_S task1; + memset(&task1, 0, sizeof(TSK_INIT_PARAM_S)); task1.pfnTaskEntry = (TSK_ENTRY_FUNC)TaskF01; task1.pcName = "EventTsk16"; task1.uwStackSize = TASK_STACK_SIZE_TEST; diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_018.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_018.c similarity index 98% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_018.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_018.c index a7464cb5..9f43e7cb 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_018.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_018.c @@ -74,8 +74,8 @@ EXIT: static UINT32 Testcase(VOID) { UINT32 ret; - TSK_INIT_PARAM_S task1 = {0}; - + TSK_INIT_PARAM_S task1; + memset(&task1, 0, sizeof(TSK_INIT_PARAM_S)); task1.pfnTaskEntry = (TSK_ENTRY_FUNC)TaskF01; task1.pcName = "EvtTsk18A"; task1.uwStackSize = TASK_STACK_SIZE_TEST; diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_019.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_019.c similarity index 98% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_019.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_019.c index e7563697..641b7d58 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_019.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_019.c @@ -83,8 +83,8 @@ EXIT: static UINT32 Testcase(VOID) { UINT32 ret; - TSK_INIT_PARAM_S task1 = {0}; - + TSK_INIT_PARAM_S task1; + memset(&task1, 0, sizeof(TSK_INIT_PARAM_S)); task1.pfnTaskEntry = (TSK_ENTRY_FUNC)TaskF01; task1.pcName = "EvtTsk19A"; task1.uwStackSize = TASK_STACK_SIZE_TEST; diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_020.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_020.c similarity index 98% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_020.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_020.c index 0d3ecd97..118fb0b8 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_020.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_020.c @@ -84,8 +84,8 @@ EXIT: static UINT32 Testcase(VOID) { UINT32 ret; - TSK_INIT_PARAM_S task1 = {0}; - + TSK_INIT_PARAM_S task1; + memset(&task1, 0, sizeof(TSK_INIT_PARAM_S)); task1.pfnTaskEntry = (TSK_ENTRY_FUNC)TaskF01; task1.pcName = "EvtTsk20A"; task1.uwStackSize = TASK_STACK_SIZE_TEST; diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_021.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_021.c similarity index 95% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_021.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_021.c index 7b1e1673..27b1c774 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_021.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_021.c @@ -54,8 +54,8 @@ EXIT: static VOID TaskF01(VOID) { UINT32 ret; - TSK_INIT_PARAM_S task1 = {0}; - + TSK_INIT_PARAM_S task1; + memset(&task1, 0, sizeof(TSK_INIT_PARAM_S)); task1.pfnTaskEntry = (TSK_ENTRY_FUNC)TaskF02; task1.pcName = "EvtTsk21B"; task1.uwStackSize = TASK_STACK_SIZE_TEST; @@ -85,8 +85,8 @@ EXIT: static UINT32 Testcase(VOID) { UINT32 ret; - TSK_INIT_PARAM_S task1 = {0}; - + TSK_INIT_PARAM_S task1; + memset(&task1, 0, sizeof(TSK_INIT_PARAM_S)); task1.pfnTaskEntry = (TSK_ENTRY_FUNC)TaskF01; task1.pcName = "EvtTsk21A"; task1.uwStackSize = TASK_STACK_SIZE_TEST; diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_022.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_022.c similarity index 98% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_022.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_022.c index bd635ce2..686c18cd 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_022.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_022.c @@ -73,8 +73,8 @@ EXIT: static UINT32 Testcase(VOID) { UINT32 ret; - TSK_INIT_PARAM_S task1 = {0}; - + TSK_INIT_PARAM_S task1; + memset(&task1, 0, sizeof(TSK_INIT_PARAM_S)); task1.pfnTaskEntry = (TSK_ENTRY_FUNC)TaskF01; task1.pcName = "EvtTsk22A"; task1.uwStackSize = TASK_STACK_SIZE_TEST; diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_023.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_023.c similarity index 98% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_023.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_023.c index 86865e17..24ffccee 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_023.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_023.c @@ -92,8 +92,9 @@ EXIT: static UINT32 Testcase(VOID) { UINT32 ret; - TSK_INIT_PARAM_S task1 = {0}; + TSK_INIT_PARAM_S task1; + memset(&task1, 0, sizeof(TSK_INIT_PARAM_S)); task1.pfnTaskEntry = (TSK_ENTRY_FUNC)TaskF01; task1.pcName = "EvtTsk23A"; task1.uwStackSize = TASK_STACK_SIZE_TEST; diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_024.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_024.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_024.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_024.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_025.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_025.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_025.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_025.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_026.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_026.c similarity index 97% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_026.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_026.c index 74064d8d..fc30d6a2 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_026.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_026.c @@ -66,8 +66,8 @@ EXIT: static UINT32 Testcase(VOID) { UINT32 ret; - TSK_INIT_PARAM_S task1 = {0}; - + TSK_INIT_PARAM_S task1; + memset(&task1, 0, sizeof(TSK_INIT_PARAM_S)); task1.pfnTaskEntry = (TSK_ENTRY_FUNC)TaskF01; task1.pcName = "EventTsk26"; task1.uwStackSize = TASK_STACK_SIZE_TEST; diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_027.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_027.c similarity index 96% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_027.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_027.c index 5754cbd9..bcd10b33 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_027.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_027.c @@ -48,9 +48,8 @@ static VOID SwtmrF01(VOID) g_eventMask = g_eventMask | (1 << g_testCount); - if (g_testCount > 17) { // g_testCount > 17, do noting return + if (g_testCount > 17) // g_testCount > 17, do noting return return; - } ret = LOS_EventWrite(&g_event, g_eventMask); ICUNIT_ASSERT_EQUAL_VOID(ret, LOS_OK, ret); @@ -82,8 +81,8 @@ static UINT32 Testcase(VOID) UINT16 swTmrID; - TSK_INIT_PARAM_S task1 = {0}; - + TSK_INIT_PARAM_S task1; + memset(&task1, 0, sizeof(TSK_INIT_PARAM_S)); task1.pfnTaskEntry = (TSK_ENTRY_FUNC)TaskF01; task1.pcName = "EventTsk27"; task1.uwStackSize = TASK_STACK_SIZE_TEST; diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_029.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_029.c similarity index 97% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_029.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_029.c index 3ac2c858..3ade02c9 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_029.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_029.c @@ -55,9 +55,10 @@ static UINT32 Testcase(VOID) { UINT32 ret; UINT32 event; - TSK_INIT_PARAM_S task1 = {0}; + TSK_INIT_PARAM_S task1; LOS_EventInit(&g_event); + memset(&task1, 0, sizeof(TSK_INIT_PARAM_S)); task1.pfnTaskEntry = (TSK_ENTRY_FUNC)TaskF01; task1.pcName = "EventTsk29"; task1.uwStackSize = TASK_STACK_SIZE_TEST; diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_030.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_030.c similarity index 97% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_030.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_030.c index d52f38d3..b3824929 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_030.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_030.c @@ -52,8 +52,8 @@ EXIT: static UINT32 Testcase(VOID) { UINT32 ret; - TSK_INIT_PARAM_S task1 = {0}; - + TSK_INIT_PARAM_S task1; + memset(&task1, 0, sizeof(TSK_INIT_PARAM_S)); task1.pfnTaskEntry = (TSK_ENTRY_FUNC)TaskF01; task1.pcName = "EventTsk30"; task1.uwStackSize = TASK_STACK_SIZE_TEST; diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_032.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_032.c similarity index 98% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_032.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_032.c index 8d844212..ec039583 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_032.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_032.c @@ -83,11 +83,12 @@ EXIT: static UINT32 Testcase(VOID) { UINT32 ret; - TSK_INIT_PARAM_S task1 = {0}; + TSK_INIT_PARAM_S task1; g_testCount = 0; LOS_EventInit(&g_event); + memset(&task1, 0, sizeof(TSK_INIT_PARAM_S)); task1.pfnTaskEntry = (TSK_ENTRY_FUNC)TaskF01; task1.pcName = "EventTsk32A"; task1.uwStackSize = TASK_STACK_SIZE_TEST; diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_033.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_033.c similarity index 98% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_033.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_033.c index 11e39058..28a33c49 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_033.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_033.c @@ -96,11 +96,12 @@ EXIT: static UINT32 Testcase(VOID) { UINT32 ret; - TSK_INIT_PARAM_S task1 = {0}; + TSK_INIT_PARAM_S task1; g_testCount = 0; LOS_EventInit(&g_event); + memset(&task1, 0, sizeof(TSK_INIT_PARAM_S)); task1.pfnTaskEntry = (TSK_ENTRY_FUNC)TaskF01; task1.pcName = "EventTsk33A"; task1.uwStackSize = TASK_STACK_SIZE_TEST; diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_037.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_037.c similarity index 97% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_037.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_037.c index 5cf5c025..4a5db7d2 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_037.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_037.c @@ -60,9 +60,9 @@ EXIT: static UINT32 Testcase(VOID) { UINT32 ret; - TSK_INIT_PARAM_S task1 = {0}; + TSK_INIT_PARAM_S task1; LOS_EventInit(&g_event); - + memset(&task1, 0, sizeof(TSK_INIT_PARAM_S)); task1.pfnTaskEntry = (TSK_ENTRY_FUNC)TaskF01; task1.pcName = "EventTsk37"; task1.uwStackSize = TASK_STACK_SIZE_TEST; diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_038.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_038.c similarity index 98% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_038.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_038.c index 19e68eb1..ff269c61 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_038.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_038.c @@ -104,12 +104,13 @@ EXIT: static UINT32 Testcase(VOID) { UINT32 ret; - TSK_INIT_PARAM_S task1 = {0}; + TSK_INIT_PARAM_S task1; LOS_EventInit(&g_event); LOS_EventInit(&g_pevent2); g_testCount = 0; + memset(&task1, 0, sizeof(TSK_INIT_PARAM_S)); task1.pfnTaskEntry = (TSK_ENTRY_FUNC)TaskF01; task1.pcName = "EventTsk38A"; task1.uwStackSize = TASK_STACK_SIZE_TEST; diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_039.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_039.c similarity index 98% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_039.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_039.c index c434a846..7ded8636 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_039.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_039.c @@ -56,8 +56,10 @@ static UINT32 Testcase(VOID) { UINT32 ret; TSK_INIT_PARAM_S task1 = { 0 }; + LOS_EventInit(&g_event); + memset(&task1, 0, sizeof(TSK_INIT_PARAM_S)); task1.pfnTaskEntry = (TSK_ENTRY_FUNC)TaskF01; task1.pcName = "EventTsk39"; task1.uwStackSize = TASK_STACK_SIZE_TEST; diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_040.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_040.c similarity index 97% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_040.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_040.c index f1ded303..0d8d3c8d 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_040.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_040.c @@ -55,8 +55,8 @@ EXIT: static UINT32 Testcase(VOID) { UINT32 ret; - TSK_INIT_PARAM_S task1 = {0}; - + TSK_INIT_PARAM_S task1; + memset(&task1, 0, sizeof(TSK_INIT_PARAM_S)); task1.pfnTaskEntry = (TSK_ENTRY_FUNC)TaskF01; task1.pcName = "EventTsk40"; task1.uwStackSize = TASK_STACK_SIZE_TEST; diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_042.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_042.c similarity index 97% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_042.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_042.c index 2cad4637..40439fda 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_042.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_042.c @@ -56,9 +56,9 @@ EXIT: static UINT32 Testcase(VOID) { UINT32 ret; - TSK_INIT_PARAM_S task1 = {0}; + TSK_INIT_PARAM_S task1; EVENT_CB_S pevent = { 0 }; - + memset(&task1, 0, sizeof(TSK_INIT_PARAM_S)); task1.pfnTaskEntry = (TSK_ENTRY_FUNC)TaskF01; task1.pcName = "EventTsk42"; task1.uwStackSize = TASK_STACK_SIZE_TEST; diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_043.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_043.c similarity index 98% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_043.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_043.c index 0777cac5..4a5abb7f 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_043.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/full/It_los_event_043.c @@ -81,8 +81,8 @@ EXIT: static UINT32 Testcase(VOID) { UINT32 ret; - TSK_INIT_PARAM_S task1 = {0}; - + TSK_INIT_PARAM_S task1; + memset(&task1, 0, sizeof(TSK_INIT_PARAM_S)); task1.pfnTaskEntry = (TSK_ENTRY_FUNC)TaskF01; task1.pcName = "EventTsk43"; task1.uwStackSize = TASK_STACK_SIZE_TEST; diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/smoke/It_los_event_031.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/smoke/It_los_event_031.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/smoke/It_los_event_031.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/smoke/It_los_event_031.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/smoke/It_los_event_035.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/smoke/It_los_event_035.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/smoke/It_los_event_035.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/smoke/It_los_event_035.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/smoke/It_los_event_036.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/smoke/It_los_event_036.c similarity index 97% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/smoke/It_los_event_036.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/smoke/It_los_event_036.c index 81fdf88b..7428ff16 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/smoke/It_los_event_036.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/smoke/It_los_event_036.c @@ -56,10 +56,11 @@ EXIT: static UINT32 Testcase(VOID) { UINT32 ret; - TSK_INIT_PARAM_S task1 = {0}; + TSK_INIT_PARAM_S task1; LOS_EventInit(&g_event); + memset(&task1, 0, sizeof(TSK_INIT_PARAM_S)); task1.pfnTaskEntry = (TSK_ENTRY_FUNC)TaskF01; task1.pcName = "EventTsk36"; task1.uwStackSize = TASK_STACK_SIZE_TEST; diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/smoke/It_los_event_041.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/smoke/It_los_event_041.c similarity index 97% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/smoke/It_los_event_041.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/smoke/It_los_event_041.c index 2f5cf515..2afd1b0a 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/smoke/It_los_event_041.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/smoke/It_los_event_041.c @@ -57,8 +57,8 @@ EXIT: static UINT32 Testcase(VOID) { UINT32 ret; - TSK_INIT_PARAM_S task1 = {0}; - + TSK_INIT_PARAM_S task1; + memset(&task1, 0, sizeof(TSK_INIT_PARAM_S)); task1.pfnTaskEntry = (TSK_ENTRY_FUNC)TaskF01; task1.pcName = "EventTsk41"; task1.uwStackSize = TASK_STACK_SIZE_TEST; diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_001.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_001.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_001.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_001.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_002.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_002.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_002.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_002.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_003.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_003.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_003.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_003.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_004.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_004.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_004.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_004.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_005.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_005.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_005.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_005.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_006.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_006.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_006.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_006.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_007.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_007.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_007.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_007.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_008.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_008.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_008.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_008.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_009.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_009.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_009.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_009.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_010.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_010.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_010.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_010.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_011.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_011.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_011.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_011.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_012.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_012.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_012.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_012.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_013.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_013.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_013.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_013.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_014.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_014.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_014.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_014.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_015.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_015.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_015.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_015.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_016.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_016.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_016.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_016.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_017.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_017.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_017.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_017.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_018.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_018.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_018.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_018.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_019.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_019.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_019.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_019.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_020.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_020.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_020.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_020.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_021.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_021.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_021.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_021.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_022.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_022.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_022.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_022.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_023.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_023.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_023.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_023.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_024.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_024.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_024.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_024.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_025.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_025.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_025.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_025.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_026.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_026.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_026.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_026.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_027.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_027.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_027.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_027.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_028.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_028.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_028.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_028.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_029.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_029.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_029.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_029.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_030.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_030.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_030.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_030.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_031.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_031.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_031.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_031.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_032.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_032.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_032.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_032.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_033.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_033.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_033.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_033.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_034.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_034.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_034.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_034.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_035.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_035.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_035.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_035.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_036.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_036.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_036.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_036.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_037.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_037.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_037.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/event/smp/It_smp_los_event_037.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/It_los_mux.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/It_los_mux.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/It_los_mux.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/It_los_mux.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/It_los_mux.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/It_los_mux.h similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/It_los_mux.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/It_los_mux.h diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_006.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_006.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_006.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_006.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_007.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_007.c similarity index 94% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_007.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_007.c index 4e5c132b..5f68d13a 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_007.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_007.c @@ -85,7 +85,7 @@ static UINT32 Testcase(VOID) g_testCount = 0; task.pfnTaskEntry = (TSK_ENTRY_FUNC)TaskF01; - task.usTaskPrio = (TASK_PRIO_TEST_TASK - 1); + task.usTaskPrio = (TASK_PRIO_TEST - 1); task.pcName = "VMuteB2_1"; task.uwStackSize = 0x900; task.uwResved = 0; @@ -98,7 +98,7 @@ static UINT32 Testcase(VOID) TestExtraTaskDelay(2); // 2, delay for Timing control. task2.pfnTaskEntry = (TSK_ENTRY_FUNC)TaskF02; - task2.usTaskPrio = (TASK_PRIO_TEST_TASK - 2); // 2, set reasonable priority. + task2.usTaskPrio = (TASK_PRIO_TEST - 2); // 2, set reasonable priority. task2.pcName = "VMuteB2_2"; task2.uwStackSize = 0x900; task2.uwResved = 0; @@ -115,7 +115,8 @@ static UINT32 Testcase(VOID) ret = LOS_TaskDelete(g_testTaskID01); ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret); - LOS_TaskDelete(g_testTaskID02); + ret = LOS_TaskDelete(g_testTaskID02); + ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret); return LOS_OK; } @@ -129,4 +130,4 @@ VOID ItLosMux007(void) #if __cplusplus } #endif /* __cpluscplus */ -#endif +#endif /* __cpluscplus */ diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_008.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_008.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_008.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_008.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_009.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_009.c similarity index 95% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_009.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_009.c index 23c110f9..41f045b2 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_009.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_009.c @@ -58,7 +58,7 @@ static UINT32 Testcase(VOID) g_testCount = 0; task.pfnTaskEntry = (TSK_ENTRY_FUNC)TestHook091; - task.usTaskPrio = (TASK_PRIO_TEST_TASK - 1); + task.usTaskPrio = (TASK_PRIO_TEST - 1); task.pcName = "VMutexB4"; task.uwStackSize = TASK_STACK_SIZE_TEST; task.uwResved = 0; @@ -70,7 +70,8 @@ static UINT32 Testcase(VOID) ret = LOS_MuxDestroy(&g_mutexkernelTest); ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret); - LOS_TaskDelete(g_testTaskID01); + ret = LOS_TaskDelete(g_testTaskID01); + ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret); return LOS_OK; } diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_010.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_010.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_010.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_010.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_011.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_011.c similarity index 95% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_011.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_011.c index fc64f0ab..0ad77c4d 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_011.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_011.c @@ -67,7 +67,7 @@ static UINT32 Testcase(VOID) g_testCount = 0; task.pfnTaskEntry = (TSK_ENTRY_FUNC)TaskF01; - task.usTaskPrio = (TASK_PRIO_TEST_TASK - 1); + task.usTaskPrio = (TASK_PRIO_TEST - 1); task.pcName = "VMutexB6"; task.uwStackSize = TASK_STACK_SIZE_TEST; task.uwResved = 0; @@ -84,7 +84,9 @@ static UINT32 Testcase(VOID) ret = LOS_MuxDestroy(&g_mutexkernelTest); ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret); - LOS_TaskDelete(g_testTaskID01); + + ret = LOS_TaskDelete(g_testTaskID01); + ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret); return LOS_OK; } @@ -98,4 +100,4 @@ VOID ItLosMux011(void) #if __cplusplus } #endif /* __cpluscplus */ -#endif /* __cpluscplus */ +#endif /* __cpluscplus */ \ No newline at end of file diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_012.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_012.c similarity index 95% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_012.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_012.c index 01d6a1c0..fc154cdc 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_012.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_012.c @@ -71,7 +71,7 @@ static UINT32 Testcase(VOID) g_testCount = 0; task.pfnTaskEntry = (TSK_ENTRY_FUNC)TaskF01; - task.usTaskPrio = (TASK_PRIO_TEST_TASK - 1); + task.usTaskPrio = (TASK_PRIO_TEST - 1); task.pcName = "VMutexB7"; task.uwStackSize = TASK_STACK_SIZE_TEST; task.uwResved = 0; @@ -91,7 +91,8 @@ static UINT32 Testcase(VOID) ret = LOS_MuxDestroy(&g_mutexkernelTest); ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret); - LOS_TaskDelete(g_testTaskID01); + ret = LOS_TaskDelete(g_testTaskID01); + ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret); return LOS_OK; } @@ -106,4 +107,4 @@ VOID ItLosMux012(void) #if __cplusplus } #endif /* __cpluscplus */ -#endif /* __cpluscplus */ +#endif /* __cpluscplus */ \ No newline at end of file diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_013.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_013.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_013.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_013.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_015.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_015.c similarity index 91% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_015.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_015.c index ebabcde4..09337729 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_015.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_015.c @@ -66,7 +66,7 @@ static VOID TaskF01(void) static UINT32 Testcase(VOID) { UINT32 ret; - TSK_INIT_PARAM_S task = {0}; + TSK_INIT_PARAM_S task = { 0 }; ret = LosMuxCreate(&g_mutexkernelTest); ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret); @@ -74,7 +74,7 @@ static UINT32 Testcase(VOID) g_testCount = 0; task.pfnTaskEntry = (TSK_ENTRY_FUNC)TaskF01; - task.usTaskPrio = (TASK_PRIO_TEST_TASK - 1); + task.usTaskPrio = (TASK_PRIO_TEST - 1); task.pcName = "VMuteB010"; task.uwStackSize = TASK_STACK_SIZE_TEST; task.uwResved = 0; @@ -86,14 +86,15 @@ static UINT32 Testcase(VOID) ret = LOS_MuxUnlock(&g_mutexkernelTest); ICUNIT_ASSERT_EQUAL(ret, EPERM, ret); - LOS_TaskDelay(15); // 15, delay for Timing control. + LOS_TaskDelay(10); // 10, delay for Timing control. + TestExtraTaskDelay(5); // 5, delay for Timing control. ICUNIT_ASSERT_EQUAL(g_testCount, 1, g_testCount); ret = LOS_MuxUnlock(&g_mutexkernelTest); ICUNIT_ASSERT_EQUAL(ret, EPERM, ret); - LOS_TaskDelay(20); // 20, delay for Timing control. + LOS_TaskDelay(10); // 10, delay for Timing control. ret = LOS_MuxUnlock(&g_mutexkernelTest); ICUNIT_ASSERT_EQUAL(ret, EPERM, ret); @@ -103,7 +104,8 @@ static UINT32 Testcase(VOID) ret = LOS_MuxDestroy(&g_mutexkernelTest); ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret); - LOS_TaskDelete(g_testTaskID01); + ret = LOS_TaskDelete(g_testTaskID01); + ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret); return LOS_OK; } diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_016.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_016.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_016.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_016.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_017.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_017.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_017.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_017.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_018.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_018.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_018.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_018.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_020.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_020.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_020.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_020.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_021.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_021.c similarity index 94% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_021.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_021.c index 09869413..b91b06af 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_021.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_021.c @@ -60,14 +60,14 @@ static VOID TaskF01(void) VOID TaskF02(void) { UINT32 ret; - TSK_INIT_PARAM_S task1 = {0}; + TSK_INIT_PARAM_S task1; g_testCount++; task1.pfnTaskEntry = (TSK_ENTRY_FUNC)TaskF01; task1.pcName = "LosMB2_2"; task1.uwStackSize = TASK_STACK_SIZE_TEST; - task1.usTaskPrio = TASK_PRIO_TEST_TASK - 3; // 3, set reasonable priority. + task1.usTaskPrio = TASK_PRIO_TEST - 3; // 3, set reasonable priority. task1.uwResved = 0; #ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); @@ -97,7 +97,7 @@ static UINT32 Testcase(VOID) ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret); task.pfnTaskEntry = (TSK_ENTRY_FUNC)TaskF02; - task.usTaskPrio = (TASK_PRIO_TEST_TASK - 1); + task.usTaskPrio = (TASK_PRIO_TEST - 1); task.pcName = "LosMB2_1"; task.uwStackSize = 0x900; task.uwResved = 0; @@ -116,8 +116,8 @@ static UINT32 Testcase(VOID) ret = LOS_TaskDelete(g_testTaskID02); ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret); - - LOS_TaskDelete(g_testTaskID01); + ret = LOS_TaskDelete(g_testTaskID01); + ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret); return LOS_OK; } @@ -131,4 +131,4 @@ VOID ItLosMux021(void) #if __cplusplus } #endif /* __cpluscplus */ -#endif /* __cpluscplus */ +#endif /* __cpluscplus */ \ No newline at end of file diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_025.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_025.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_025.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_025.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_026.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_026.c similarity index 84% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_026.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_026.c index d4d4707c..edb52dfe 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_026.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_026.c @@ -52,8 +52,7 @@ static VOID TaskDFunc(VOID) ICUNIT_ASSERT_EQUAL_VOID(ret, LOS_OK, ret); g_testCount++; - UINT16 priority = LOS_TaskPriGet(OsCurrTaskGet()->taskID); - ICUNIT_ASSERT_EQUAL_VOID(priority, 2, priority); // 2, here assert the result. + ICUNIT_ASSERT_EQUAL_VOID(OsCurrTaskGet()->priority, 2, OsCurrTaskGet()->priority); // 2, here assert the result. ICUNIT_ASSERT_EQUAL_VOID(g_testCount, 9, g_testCount); // 9, here assert the result. g_testCount++; @@ -74,8 +73,7 @@ static VOID TaskCFunc(VOID) ICUNIT_ASSERT_EQUAL_VOID(ret, LOS_OK, ret); g_testCount++; - UINT16 priority = LOS_TaskPriGet(OsCurrTaskGet()->taskID); - ICUNIT_ASSERT_EQUAL_VOID(priority, 3, priority); // 3, here assert the result. + ICUNIT_ASSERT_EQUAL_VOID(OsCurrTaskGet()->priority, 3, OsCurrTaskGet()->priority); // 3, here assert the result. ICUNIT_ASSERT_EQUAL_VOID(g_testCount, 11, g_testCount); // 11, here assert the result. g_testCount++; @@ -98,8 +96,7 @@ static VOID TaskBFunc(VOID) g_testCount++; - UINT16 priority = LOS_TaskPriGet(OsCurrTaskGet()->taskID); - ICUNIT_ASSERT_EQUAL_VOID(priority, 5, priority); // 5, here assert the result. + ICUNIT_ASSERT_EQUAL_VOID(OsCurrTaskGet()->priority, 5, OsCurrTaskGet()->priority); // 5, here assert the result. ICUNIT_ASSERT_EQUAL_VOID(g_testCount, 13, g_testCount); // 13, here assert the result. g_testCount++; } @@ -107,9 +104,7 @@ static VOID TaskBFunc(VOID) static VOID TaskAFunc(VOID) { UINT32 ret; - TSK_INIT_PARAM_S task1 = { 0 }; - TSK_INIT_PARAM_S task2 = { 0 }; - TSK_INIT_PARAM_S task3 = { 0 }; + TSK_INIT_PARAM_S task1, task2, task3; g_testCount++; @@ -165,25 +160,22 @@ static VOID TaskAFunc(VOID) g_testCount++; ICUNIT_ASSERT_EQUAL_VOID(g_testCount, 8, g_testCount); // 8, here assert the result. +#if 1 // post mutex 3 -> mutex2 -> mutex1 ret = LOS_MuxUnlock(&g_mutexTest3); ICUNIT_ASSERT_EQUAL_VOID(ret, LOS_OK, ret); ICUNIT_ASSERT_EQUAL_VOID(g_testCount, 10, g_testCount); // 10, here assert the result. - UINT16 priority = LOS_TaskPriGet(OsCurrTaskGet()->taskID); - ICUNIT_ASSERT_EQUAL_VOID(priority, 3, priority); // 3, here assert the result. - ret = LOS_MuxUnlock(&g_mutexTest2); ICUNIT_ASSERT_EQUAL_VOID(ret, LOS_OK, ret); ICUNIT_ASSERT_EQUAL_VOID(g_testCount, 12, g_testCount); // 12, here assert the result. - priority = LOS_TaskPriGet(OsCurrTaskGet()->taskID); - ICUNIT_ASSERT_EQUAL_VOID(priority, 5, priority); // 5, here assert the result. ret = LOS_MuxUnlock(&g_mutexTest1); ICUNIT_ASSERT_EQUAL_VOID(ret, LOS_OK, ret); ICUNIT_ASSERT_EQUAL_VOID(g_testCount, 14, g_testCount); // 14, here assert the result. +#endif ret = LOS_MuxDestroy(&g_mutexTest1); ICUNIT_ASSERT_EQUAL_VOID(ret, LOS_OK, ret); @@ -195,20 +187,20 @@ static VOID TaskAFunc(VOID) ICUNIT_ASSERT_EQUAL_VOID(ret, LOS_OK, ret); ICUNIT_ASSERT_EQUAL_VOID(g_testCount, 14, g_testCount); // 14, here assert the result. - priority = LOS_TaskPriGet(OsCurrTaskGet()->taskID); - ICUNIT_ASSERT_EQUAL_VOID(priority, 10, priority); // 10, here assert the result. + ICUNIT_ASSERT_EQUAL_VOID(OsCurrTaskGet()->priority, 10, OsCurrTaskGet()->priority); // 10, here assert the result. + ICUNIT_ASSERT_EQUAL_VOID(LOS_HighBitGet(OsCurrTaskGet()->priBitMap), LOS_INVALID_BIT_INDEX, + LOS_HighBitGet(OsCurrTaskGet()->priBitMap)); } static UINT32 Testcase(VOID) { UINT32 ret; - TSK_INIT_PARAM_S task = { 0 }; + TSK_INIT_PARAM_S task; g_testCount = 0; - UINT16 priority = LOS_TaskPriGet(OsCurrTaskGet()->taskID); - ICUNIT_ASSERT_EQUAL(priority, 25, priority); // 25, here assert the result. + ICUNIT_ASSERT_EQUAL(OsCurrTaskGet()->priority, 25, OsCurrTaskGet()->priority); // 25, here assert the result. ret = LosMuxCreate(&g_mutexTest1); ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret); @@ -224,9 +216,8 @@ static UINT32 Testcase(VOID) ret = LOS_TaskCreate(&g_testTaskID01, &task); ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret); - ICUNIT_ASSERT_EQUAL(g_testCount, 14, g_testCount); // 14, here assert the result. - priority = LOS_TaskPriGet(OsCurrTaskGet()->taskID); - ICUNIT_ASSERT_EQUAL(priority, 25, priority); // 25, here assert the result. + ICUNIT_ASSERT_EQUAL(g_testCount, 14, g_testCount); // 14, here assert the result. + ICUNIT_ASSERT_EQUAL(OsCurrTaskGet()->priority, 25, OsCurrTaskGet()->priority); // 25, here assert the result. return LOS_OK; } diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_027.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_027.c similarity index 87% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_027.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_027.c index f825b878..01db9295 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_027.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_027.c @@ -52,8 +52,8 @@ static VOID TaskD1Func(VOID) g_testCount++; ICUNIT_ASSERT_EQUAL_VOID(g_testCount, 5, g_testCount); // 5, here assert the result. - UINT16 priority = LOS_TaskPriGet(OsCurrTaskGet()->taskID); - ICUNIT_ASSERT_EQUAL_VOID(priority, 2, priority); // 2, here assert the result. + + ICUNIT_ASSERT_EQUAL_VOID(OsCurrTaskGet()->priority, 2, OsCurrTaskGet()->priority); // 2, here assert the result. g_testCount++; } @@ -72,8 +72,7 @@ static VOID TaskC1Func(VOID) ICUNIT_ASSERT_EQUAL_VOID(g_testCount, 6, g_testCount); // 6, here assert the result. - UINT16 priority = LOS_TaskPriGet(OsCurrTaskGet()->taskID); - ICUNIT_ASSERT_EQUAL_VOID(priority, 3, priority); // 3, here assert the result. + ICUNIT_ASSERT_EQUAL_VOID(OsCurrTaskGet()->priority, 3, OsCurrTaskGet()->priority); // 3, here assert the result. g_testCount++; } @@ -92,17 +91,14 @@ static VOID TaskB1Func(VOID) ICUNIT_ASSERT_EQUAL_VOID(g_testCount, 7, g_testCount); // 7, here assert the result. - UINT16 priority = LOS_TaskPriGet(OsCurrTaskGet()->taskID); - ICUNIT_ASSERT_EQUAL_VOID(priority, 5, priority); // 5, here assert the result. + ICUNIT_ASSERT_EQUAL_VOID(OsCurrTaskGet()->priority, 5, OsCurrTaskGet()->priority); // 5, here assert the result. g_testCount++; } static VOID TaskA1Func(VOID) { UINT32 ret; - TSK_INIT_PARAM_S task1 = {0}; - TSK_INIT_PARAM_S task2 = {0}; - TSK_INIT_PARAM_S task3 = {0}; + TSK_INIT_PARAM_S task1, task2, task3; g_testCount++; ICUNIT_ASSERT_EQUAL_VOID(g_testCount, 1, g_testCount); @@ -151,8 +147,9 @@ static VOID TaskA1Func(VOID) ret = LOS_MuxDestroy(&g_mutexTest1); ICUNIT_ASSERT_EQUAL_VOID(ret, LOS_OK, ret); - UINT16 priority = LOS_TaskPriGet(OsCurrTaskGet()->taskID); - ICUNIT_ASSERT_EQUAL_VOID(priority, 10, priority); // 10, here assert the result. + ICUNIT_ASSERT_EQUAL_VOID(OsCurrTaskGet()->priority, 10, OsCurrTaskGet()->priority); // 10, here assert the result. + ICUNIT_ASSERT_EQUAL_VOID(LOS_HighBitGet(OsCurrTaskGet()->priBitMap), LOS_INVALID_BIT_INDEX, + LOS_HighBitGet(OsCurrTaskGet()->priBitMap)); ICUNIT_ASSERT_EQUAL_VOID(g_testCount, 8, g_testCount); // 8, here assert the result. } @@ -160,7 +157,7 @@ static VOID TaskA1Func(VOID) static UINT32 Testcase(void) { UINT32 ret; - TSK_INIT_PARAM_S task = {0}; + TSK_INIT_PARAM_S task; g_testCount = 0; ret = LosMuxCreate(&g_mutexTest1); @@ -178,8 +175,7 @@ static UINT32 Testcase(void) ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret); ICUNIT_ASSERT_EQUAL(g_testCount, 8, g_testCount); // 8, here assert the result. - UINT16 priority = LOS_TaskPriGet(OsCurrTaskGet()->taskID); - ICUNIT_ASSERT_EQUAL(priority, 25, priority); // 25, here assert the result. + ICUNIT_ASSERT_EQUAL(OsCurrTaskGet()->priority, 25, OsCurrTaskGet()->priority); // 25, here assert the result. return LOS_OK; } diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_028.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_028.c similarity index 89% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_028.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_028.c index 52bbb8cc..6e367d5a 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_028.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_028.c @@ -50,8 +50,7 @@ static VOID TaskD2Func(VOID) ICUNIT_ASSERT_EQUAL_VOID(ret, LOS_OK, ret); ICUNIT_ASSERT_EQUAL_VOID(g_testCount, 6, g_testCount); // 6, here assert the result. - UINT16 priority = LOS_TaskPriGet(OsCurrTaskGet()->taskID); - ICUNIT_ASSERT_EQUAL_VOID(priority, 10, priority); // 10, here assert the result. + ICUNIT_ASSERT_EQUAL_VOID(OsCurrTaskGet()->priority, 10, OsCurrTaskGet()->priority); // 10, here assert the result. g_testCount++; } @@ -68,8 +67,7 @@ static VOID TaskC2Func(VOID) ICUNIT_ASSERT_EQUAL_VOID(ret, LOS_OK, ret); ICUNIT_ASSERT_EQUAL_VOID(g_testCount, 5, g_testCount); // 5, here assert the result. - UINT16 priority = LOS_TaskPriGet(OsCurrTaskGet()->taskID); - ICUNIT_ASSERT_EQUAL_VOID(priority, 10, priority); // 10, here assert the result. + ICUNIT_ASSERT_EQUAL_VOID(OsCurrTaskGet()->priority, 10, OsCurrTaskGet()->priority); // 10, here assert the result. g_testCount++; } @@ -86,17 +84,14 @@ static VOID TaskB2Func(VOID) ICUNIT_ASSERT_EQUAL_VOID(ret, LOS_OK, ret); ICUNIT_ASSERT_EQUAL_VOID(g_testCount, 4, g_testCount); // 4, here assert the result. - UINT16 priority = LOS_TaskPriGet(OsCurrTaskGet()->taskID); - ICUNIT_ASSERT_EQUAL_VOID(priority, 10, priority); // 10, here assert the result. + ICUNIT_ASSERT_EQUAL_VOID(OsCurrTaskGet()->priority, 10, OsCurrTaskGet()->priority); // 10, here assert the result. g_testCount++; } static VOID TaskA2Func(VOID) { UINT32 ret; - TSK_INIT_PARAM_S task1 = {0}; - TSK_INIT_PARAM_S task2 = {0}; - TSK_INIT_PARAM_S task3 = {0}; + TSK_INIT_PARAM_S task1, task2, task3; g_testCount++; ICUNIT_ASSERT_EQUAL_VOID(g_testCount, 1, g_testCount); @@ -147,8 +142,9 @@ static VOID TaskA2Func(VOID) ret = LOS_MuxDestroy(&g_mutexTest1); ICUNIT_ASSERT_EQUAL_VOID(ret, LOS_OK, ret); - UINT16 priority = LOS_TaskPriGet(OsCurrTaskGet()->taskID); - ICUNIT_ASSERT_EQUAL_VOID(priority, 10, priority); // 10, here assert the result. + ICUNIT_ASSERT_EQUAL_VOID(OsCurrTaskGet()->priority, 10, OsCurrTaskGet()->priority); // 10, here assert the result. + ICUNIT_ASSERT_EQUAL_VOID(LOS_HighBitGet(OsCurrTaskGet()->priBitMap), LOS_INVALID_BIT_INDEX, + LOS_HighBitGet(OsCurrTaskGet()->priBitMap)); ICUNIT_ASSERT_EQUAL_VOID(g_testCount, 8, g_testCount); // 8, here assert the result. g_testCount++; } @@ -157,7 +153,7 @@ static VOID TaskA2Func(VOID) static UINT32 Testcase(VOID) { UINT32 ret; - TSK_INIT_PARAM_S task = {0}; + TSK_INIT_PARAM_S task; g_testCount = 0; ret = LosMuxCreate(&g_mutexTest1); diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_029.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_029.c similarity index 88% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_029.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_029.c index 7037fb86..a46e0e36 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_029.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_029.c @@ -53,15 +53,14 @@ static VOID TaskD3Func(VOID) g_testCount++; ICUNIT_ASSERT_EQUAL_VOID(g_testCount, 6, g_testCount); // 6, here assert the result. - UINT16 priority = LOS_TaskPriGet(OsCurrTaskGet()->taskID); - ICUNIT_ASSERT_EQUAL_VOID(priority, 2, priority); // 2, here assert the result. + ICUNIT_ASSERT_EQUAL_VOID(OsCurrTaskGet()->priority, 2, OsCurrTaskGet()->priority); // 2, here assert the result. g_testCount++; } static VOID TaskC3Func(VOID) { UINT32 ret; - TSK_INIT_PARAM_S task1 = {0}; + TSK_INIT_PARAM_S task1; g_testCount++; ICUNIT_ASSERT_EQUAL_VOID(g_testCount, 3, g_testCount); // 3, here assert the result. @@ -95,8 +94,7 @@ static VOID TaskC3Func(VOID) ICUNIT_ASSERT_EQUAL_VOID(ret, LOS_OK, ret); ICUNIT_ASSERT_EQUAL_VOID(g_testCount, 7, g_testCount); // 7, here assert the result. - UINT16 priority = LOS_TaskPriGet(OsCurrTaskGet()->taskID); - ICUNIT_ASSERT_EQUAL_VOID(priority, 3, priority); // 3, here assert the result. + ICUNIT_ASSERT_EQUAL_VOID(OsCurrTaskGet()->priority, 3, OsCurrTaskGet()->priority); // 3, here assert the result. g_testCount++; } @@ -113,16 +111,14 @@ static VOID TaskB3Func(VOID) ICUNIT_ASSERT_EQUAL_VOID(ret, LOS_OK, ret); ICUNIT_ASSERT_EQUAL_VOID(g_testCount, 8, g_testCount); // 8, here assert the result. - UINT16 priority = LOS_TaskPriGet(OsCurrTaskGet()->taskID); - ICUNIT_ASSERT_EQUAL_VOID(priority, 5, priority); // 5, here assert the result. + ICUNIT_ASSERT_EQUAL_VOID(OsCurrTaskGet()->priority, 5, OsCurrTaskGet()->priority); // 5, here assert the result. g_testCount++; } static VOID TaskA3Func(VOID) { UINT32 ret; - TSK_INIT_PARAM_S task1 = {0}; - TSK_INIT_PARAM_S task2 = {0}; + TSK_INIT_PARAM_S task1, task2, task3; g_testCount++; ICUNIT_ASSERT_EQUAL_VOID(g_testCount, 1, g_testCount); @@ -162,15 +158,16 @@ static VOID TaskA3Func(VOID) ICUNIT_ASSERT_EQUAL_VOID(ret, LOS_OK, ret); ICUNIT_ASSERT_EQUAL_VOID(g_testCount, 9, g_testCount); // 9, here assert the result. - UINT16 priority = LOS_TaskPriGet(OsCurrTaskGet()->taskID); - ICUNIT_ASSERT_EQUAL_VOID(priority, 10, priority); // 10, here assert the result. + ICUNIT_ASSERT_EQUAL_VOID(OsCurrTaskGet()->priority, 10, OsCurrTaskGet()->priority); // 10, here assert the result. + ICUNIT_ASSERT_EQUAL_VOID(LOS_HighBitGet(OsCurrTaskGet()->priBitMap), LOS_INVALID_BIT_INDEX, + LOS_HighBitGet(OsCurrTaskGet()->priBitMap)); g_testCount++; } static UINT32 Testcase(VOID) { UINT32 ret; - TSK_INIT_PARAM_S task = {0}; + TSK_INIT_PARAM_S task; g_testCount = 0; ret = LosMuxCreate(&g_mutexTest1); @@ -188,8 +185,7 @@ static UINT32 Testcase(VOID) ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret); ICUNIT_ASSERT_EQUAL(g_testCount, 10, g_testCount); // 10, here assert the result. - UINT16 priority = LOS_TaskPriGet(OsCurrTaskGet()->taskID); - ICUNIT_ASSERT_EQUAL(priority, 25, priority); // 25, here assert the result. + ICUNIT_ASSERT_EQUAL(OsCurrTaskGet()->priority, 25, OsCurrTaskGet()->priority); // 25, here assert the result. return LOS_OK; } diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_031.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_031.c similarity index 88% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_031.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_031.c index ccd01cb9..dde87d11 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_031.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_031.c @@ -52,8 +52,7 @@ static VOID TaskD5Func(VOID) ret = LOS_MuxUnlock(&g_mutexTest2); ICUNIT_ASSERT_EQUAL_VOID(ret, LOS_OK, ret); - UINT16 priority = LOS_TaskPriGet(OsCurrTaskGet()->taskID); - ICUNIT_ASSERT_EQUAL_VOID(priority, 2, priority); // 2, here assert the result. + ICUNIT_ASSERT_EQUAL_VOID(OsCurrTaskGet()->priority, 2, OsCurrTaskGet()->priority); // 2, here assert the result. ICUNIT_ASSERT_EQUAL_VOID(g_testCount, 5, g_testCount); // 5, here assert the result. g_testCount++; } @@ -73,8 +72,7 @@ static VOID TaskC5Func(VOID) ret = LOS_MuxUnlock(&g_mutexTest2); ICUNIT_ASSERT_EQUAL_VOID(ret, LOS_OK, ret); - UINT16 priority = LOS_TaskPriGet(OsCurrTaskGet()->taskID); - ICUNIT_ASSERT_EQUAL_VOID(priority, 3, priority); // 3, here assert the result. + ICUNIT_ASSERT_EQUAL_VOID(OsCurrTaskGet()->priority, 3, OsCurrTaskGet()->priority); // 3, here assert the result. ICUNIT_ASSERT_EQUAL_VOID(g_testCount, 6, g_testCount); // 6, here assert the result. g_testCount++; @@ -95,8 +93,7 @@ static VOID TaskB5Func(VOID) ret = LOS_MuxUnlock(&g_mutexTest1); ICUNIT_ASSERT_EQUAL_VOID(ret, LOS_OK, ret); - UINT16 priority = LOS_TaskPriGet(OsCurrTaskGet()->taskID); - ICUNIT_ASSERT_EQUAL_VOID(priority, 5, priority); // 5, here assert the result. + ICUNIT_ASSERT_EQUAL_VOID(OsCurrTaskGet()->priority, 5, OsCurrTaskGet()->priority); // 5, here assert the result. g_testCount++; } @@ -153,16 +150,17 @@ static VOID TaskA5Func(VOID) g_testCount++; ICUNIT_ASSERT_EQUAL_VOID(g_testCount, 5, g_testCount); // 5, here assert the result. - ret = LOS_MuxUnlock(&g_mutexTest2); + ret = LOS_MuxUnlock(&g_mutexTest1); ICUNIT_ASSERT_EQUAL_VOID(ret, LOS_OK, ret); - ICUNIT_ASSERT_EQUAL_VOID(g_testCount, 7, g_testCount); // 5, here assert the result. + ICUNIT_ASSERT_EQUAL_VOID(g_testCount, 5, g_testCount); // 5, here assert the result. - ret = LOS_MuxUnlock(&g_mutexTest1); + ret = LOS_MuxUnlock(&g_mutexTest2); ICUNIT_ASSERT_EQUAL_VOID(ret, LOS_OK, ret); - UINT16 priority = LOS_TaskPriGet(OsCurrTaskGet()->taskID); - ICUNIT_ASSERT_EQUAL_VOID(priority, 10, priority); // 10, here assert the result. + ICUNIT_ASSERT_EQUAL_VOID(OsCurrTaskGet()->priority, 10, OsCurrTaskGet()->priority); // 10, here assert the result. + ICUNIT_ASSERT_EQUAL_VOID(LOS_HighBitGet(OsCurrTaskGet()->priBitMap), LOS_INVALID_BIT_INDEX, + LOS_HighBitGet(OsCurrTaskGet()->priBitMap)); ICUNIT_ASSERT_EQUAL_VOID(g_testCount, 8, g_testCount); // 8, here assert the result. g_testCount++; } @@ -170,7 +168,7 @@ static VOID TaskA5Func(VOID) static UINT32 Testcase(VOID) { UINT32 ret; - TSK_INIT_PARAM_S task = {0}; + TSK_INIT_PARAM_S task; g_testCount = 0; ret = LosMuxCreate(&g_mutexTest1); @@ -198,8 +196,7 @@ static UINT32 Testcase(VOID) ICUNIT_ASSERT_EQUAL(g_testCount, 9, g_testCount); // 9, here assert the result. - UINT16 priority = LOS_TaskPriGet(OsCurrTaskGet()->taskID); - ICUNIT_ASSERT_EQUAL(priority, 25, priority); // 25, here assert the result. + ICUNIT_ASSERT_EQUAL(OsCurrTaskGet()->priority, 25, OsCurrTaskGet()->priority); // 25, here assert the result. return LOS_OK; } diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_035.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_035.c similarity index 94% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_035.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_035.c index f5290e71..db1e4f62 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_035.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_035.c @@ -87,7 +87,7 @@ static VOID TaskService3Func(VOID) static VOID TaskMisc10Func(VOID) { UINT32 ret; - TSK_INIT_PARAM_S task1 = {0}; + TSK_INIT_PARAM_S task1, task2, task3; g_testCount++; ICUNIT_ASSERT_EQUAL_VOID(g_testCount, 1, g_testCount); @@ -99,7 +99,7 @@ static VOID TaskMisc10Func(VOID) task1.usTaskPrio = 3; // 3, set reasonable priority. task1.pcName = "TaskService_3"; task1.uwStackSize = LOS_TASK_MIN_STACK_SIZE; - task1.uwResved = LOS_TASK_ATTR_JOINABLE; + task1.uwResved = 0; #ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif @@ -120,7 +120,7 @@ static VOID TaskMisc10Func(VOID) static UINT32 Testcase(VOID) { UINT32 ret; - TSK_INIT_PARAM_S task = {0}; + TSK_INIT_PARAM_S task; g_testCount = 0; ret = LosMuxCreate(&g_mutexTest1); @@ -133,7 +133,7 @@ static UINT32 Testcase(VOID) task.usTaskPrio = 10; // 10, set reasonable priority. task.pcName = "TaskMisc_10"; task.uwStackSize = LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE; - task.uwResved = LOS_TASK_ATTR_JOINABLE; + task.uwResved = 0; #ifdef LOSCFG_KERNEL_SMP task.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif @@ -145,7 +145,7 @@ static UINT32 Testcase(VOID) task.usTaskPrio = 2; // 2, set reasonable priority. task.pcName = "TaskFe_2"; task.uwStackSize = LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE; - task.uwResved = LOS_TASK_ATTR_JOINABLE; + task.uwResved = 0; #ifdef LOSCFG_KERNEL_SMP task.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif @@ -163,7 +163,6 @@ static UINT32 Testcase(VOID) ret = LOS_MuxDestroy(&g_mutexTest2); ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret); - OsShellCmdTskInfoGet(0xffffffff, NULL, 0); // 10, here assert the result. ICUNIT_GOTO_EQUAL(LOS_TaskPriGet(g_testTaskID01), 10, LOS_TaskPriGet(g_testTaskID01), EXIT); // 3, here assert the result. @@ -171,11 +170,11 @@ static UINT32 Testcase(VOID) // 2, here assert the result. ICUNIT_GOTO_EQUAL(LOS_TaskPriGet(g_testTaskID03), 2, LOS_TaskPriGet(g_testTaskID03), EXIT); EXIT: - ret = LOS_TaskJoin(g_testTaskID01, NULL); + ret = LOS_TaskDelete(g_testTaskID01); ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret); - ret = LOS_TaskJoin(g_testTaskID02, NULL); + ret = LOS_TaskDelete(g_testTaskID02); ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret); - ret = LOS_TaskJoin(g_testTaskID03, NULL); + ret = LOS_TaskDelete(g_testTaskID03); ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret); return LOS_OK; diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_036.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_036.c similarity index 94% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_036.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_036.c index 1241fd36..a050575e 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_036.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_036.c @@ -75,7 +75,7 @@ static VOID TaskService5Func(VOID) static VOID TaskMisc10Func(VOID) { UINT32 ret; - TSK_INIT_PARAM_S task1 = {0}; + TSK_INIT_PARAM_S task1, task2, task3; g_testCount++; ICUNIT_ASSERT_EQUAL_VOID(g_testCount, 1, g_testCount); @@ -86,7 +86,7 @@ static VOID TaskMisc10Func(VOID) task1.usTaskPrio = 5; // 5, set reasonable priority. task1.pcName = "TaskService_5"; task1.uwStackSize = LOS_TASK_MIN_STACK_SIZE; - task1.uwResved = LOS_TASK_ATTR_JOINABLE; + task1.uwResved = 0; #ifdef LOSCFG_KERNEL_SMP task1.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif @@ -107,7 +107,7 @@ static VOID TaskMisc10Func(VOID) static UINT32 Testcase(VOID) { UINT32 ret; - TSK_INIT_PARAM_S task = {0}; + TSK_INIT_PARAM_S task; g_testCount = 0; ret = LosMuxCreate(&g_mutexTest1); @@ -117,7 +117,7 @@ static UINT32 Testcase(VOID) task.usTaskPrio = 10; // 10, set reasonable priority. task.pcName = "TaskMisc_10"; task.uwStackSize = LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE; - task.uwResved = LOS_TASK_ATTR_JOINABLE; + task.uwResved = 0; #ifdef LOSCFG_KERNEL_SMP task.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif @@ -131,7 +131,7 @@ static UINT32 Testcase(VOID) task.usTaskPrio = 4; // 4, set reasonable priority. task.pcName = "TaskFe_4"; task.uwStackSize = LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE; - task.uwResved = LOS_TASK_ATTR_JOINABLE; + task.uwResved = 0; #ifdef LOSCFG_KERNEL_SMP task.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif @@ -153,11 +153,11 @@ static UINT32 Testcase(VOID) ICUNIT_GOTO_EQUAL(LOS_TaskPriGet(g_testTaskID03), 4, LOS_TaskPriGet(g_testTaskID03), EXIT); EXIT: - ret = LOS_TaskJoin(g_testTaskID01, NULL); + ret = LOS_TaskDelete(g_testTaskID01); ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret); - ret = LOS_TaskJoin(g_testTaskID02, NULL); + ret = LOS_TaskDelete(g_testTaskID02); ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret); - ret = LOS_TaskJoin(g_testTaskID03, NULL); + ret = LOS_TaskDelete(g_testTaskID03); ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret); return LOS_OK; } diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_037.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_037.c similarity index 98% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_037.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_037.c index a1db4fce..e0cf203b 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_037.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_037.c @@ -60,6 +60,7 @@ static VOID TaskFe4Func(VOID) static VOID TaskMisc10Func(VOID) { UINT32 ret; + TSK_INIT_PARAM_S task1, task2, task3; g_testCount++; for (INT32 i = 0; i < OS_MUX_NUM; i++) { @@ -76,7 +77,7 @@ static VOID TaskMisc10Func(VOID) static UINT32 Testcase(VOID) { UINT32 ret; - TSK_INIT_PARAM_S task = {0}; + TSK_INIT_PARAM_S task; g_testCount = 0; g_testMux = LOS_MemAlloc(m_aucSysMem0, OS_MUX_NUM * sizeof(LosMux)); diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_038.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_038.c similarity index 98% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_038.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_038.c index 5f079ef1..a4560186 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_038.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_038.c @@ -60,6 +60,7 @@ static VOID TaskFe4Func(VOID) static VOID TaskMisc10Func(VOID) { UINT32 ret; + TSK_INIT_PARAM_S task1, task2, task3; g_testCount++; for (INT32 i = 0; i < OS_MUX_NUM; i++) { @@ -75,7 +76,7 @@ static VOID TaskMisc10Func(VOID) static UINT32 Testcase(VOID) { UINT32 ret; - TSK_INIT_PARAM_S task = {0}; + TSK_INIT_PARAM_S task; g_testCount = 0; ret = LosMuxCreate(&g_testMux1); diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_039.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_039.c similarity index 97% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_039.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_039.c index fc024814..63d13309 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_039.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_039.c @@ -66,6 +66,7 @@ static VOID TaskFe4Func(VOID) static VOID TaskMisc10Func(VOID) { UINT32 ret; + TSK_INIT_PARAM_S task1, task2, task3; g_testCount++; @@ -86,7 +87,7 @@ static VOID TaskMisc10Func(VOID) static UINT32 Testcase(VOID) { UINT32 ret; - TSK_INIT_PARAM_S task = {0}; + TSK_INIT_PARAM_S task; g_testCount = 0; ret = LosMuxCreate(&g_testMux1); @@ -157,8 +158,7 @@ EXIT: ret = LOS_MuxUnlock(&g_testMux2); ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret); - UINT16 priority = LOS_TaskPriGet(OsCurrTaskGet()->taskID); - ICUNIT_ASSERT_EQUAL(priority, TASK_PRIO_TEST_TASK, priority); + ICUNIT_ASSERT_EQUAL(OsCurrTaskGet()->priority, TASK_PRIO_TEST, OsCurrTaskGet()->priority); ret = LOS_MuxDestroy(&g_testMux1); ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret); diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_040.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_040.c similarity index 96% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_040.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_040.c index 16f0a76c..e362c7fe 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_040.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_040.c @@ -63,7 +63,7 @@ static VOID TaskFe7Func(VOID) ret = LOS_MuxLock(&g_testMux1, LOS_WAIT_FOREVER); ICUNIT_ASSERT_EQUAL_VOID(ret, LOS_OK, ret); - ICUNIT_ASSERT_EQUAL_VOID(g_testCount, 21, g_testCount); // 21, here assert the result. + ICUNIT_ASSERT_EQUAL_VOID(g_testCount, 19, g_testCount); // 19, here assert the result. g_testCount++; return; } @@ -79,13 +79,13 @@ static VOID TaskFe8Func(VOID) ret = LOS_MuxLock(&g_testMux3, LOS_WAIT_FOREVER); ICUNIT_ASSERT_EQUAL_VOID(ret, LOS_OK, ret); - ICUNIT_ASSERT_EQUAL_VOID(g_testCount, 18, g_testCount); // 18, here assert the result. + ICUNIT_ASSERT_EQUAL_VOID(g_testCount, 20, g_testCount); // 20, here assert the result. g_testCount++; ret = LOS_MuxLock(&g_testMux1, LOS_WAIT_FOREVER); ICUNIT_ASSERT_EQUAL_VOID(ret, LOS_OK, ret); - ICUNIT_ASSERT_EQUAL_VOID(g_testCount, 22, g_testCount); // 22, here assert the result. + ICUNIT_ASSERT_EQUAL_VOID(g_testCount, 21, g_testCount); // 21, here assert the result. g_testCount++; return; } @@ -100,7 +100,7 @@ static VOID TaskFe9Func(VOID) ret = LOS_MuxLock(&g_testMux2, LOS_WAIT_FOREVER); ICUNIT_ASSERT_EQUAL_VOID(ret, LOS_OK, ret); - ICUNIT_ASSERT_EQUAL_VOID(g_testCount, 19, g_testCount); // 19, here assert the result. + ICUNIT_ASSERT_EQUAL_VOID(g_testCount, 22, g_testCount); // 22, here assert the result. g_testCount++; ret = LOS_MuxLock(&g_testMux1, LOS_WAIT_FOREVER); @@ -114,6 +114,7 @@ static VOID TaskFe9Func(VOID) static VOID TaskMisc10Func(VOID) { UINT32 ret; + TSK_INIT_PARAM_S task1, task2, task3; g_testCount++; @@ -173,7 +174,7 @@ static VOID TaskMisc10Func(VOID) static UINT32 Testcase(VOID) { UINT32 ret; - TSK_INIT_PARAM_S task = {0}; + TSK_INIT_PARAM_S task; g_testCount = 0; ret = LosMuxCreate(&g_testMux1); @@ -256,7 +257,7 @@ static UINT32 Testcase(VOID) ret = LOS_TaskDelete(g_testTaskID01); ICUNIT_GOTO_EQUAL(ret, LOS_OK, ret, EXIT); - ICUNIT_GOTO_EQUAL(g_testCount, 20, g_testCount, EXIT); // 20, here assert the result. + ICUNIT_GOTO_EQUAL(g_testCount, 18, g_testCount, EXIT); // 18, here assert the result. g_testCount++; ret = LOS_MuxUnlock(&g_testMux1); @@ -285,8 +286,7 @@ EXIT: ret = LOS_MuxUnlock(&g_testMux4); ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret); - UINT16 priority = LOS_TaskPriGet(OsCurrTaskGet()->taskID); - ICUNIT_ASSERT_EQUAL(priority, TASK_PRIO_TEST_TASK, priority); + ICUNIT_ASSERT_EQUAL(OsCurrTaskGet()->priority, TASK_PRIO_TEST, OsCurrTaskGet()->priority); ret = LOS_MuxDestroy(&g_testMux1); ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret); diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_041.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_041.c similarity index 88% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_041.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_041.c index f36ffe68..4fb84b90 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_041.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_041.c @@ -45,9 +45,11 @@ static UINT32 g_mainTaskID; static VOID TaskMisc10Func(VOID) { UINT32 ret; + TSK_INIT_PARAM_S task1, task2, task3; + LosTaskCB *taskCB = OS_TCB_FROM_TID(g_mainTaskID); g_testCount++; - ret = LOS_MuxLock(&g_testMux1, 100); // 100, init mutex. + ret = LOS_MuxLock(&g_testMux1, 10); // 10, init mutex. ICUNIT_ASSERT_EQUAL_VOID(ret, LOS_ETIMEDOUT, ret); ICUNIT_ASSERT_EQUAL_VOID(g_testCount, 3, g_testCount); // 3, here assert the result. @@ -56,13 +58,14 @@ static VOID TaskMisc10Func(VOID) return; } + static UINT32 Testcase(VOID) { UINT32 ret; - TSK_INIT_PARAM_S taskParam = {0}; + TSK_INIT_PARAM_S taskParam; g_testCount = 0; LosTaskCB *task = NULL; - UINT16 prio = LOS_TaskPriGet(OsCurrTaskGet()->taskID); + UINT16 prio = OsCurrTaskGet()->priority; g_mainTaskID = OsCurrTaskGet()->taskID; ret = LosMuxCreate(&g_testMux1); @@ -85,12 +88,11 @@ static UINT32 Testcase(VOID) ret = LOS_TaskCreate(&g_testTaskID01, &taskParam); ICUNIT_GOTO_EQUAL(ret, LOS_OK, ret, EXIT); - UINT16 priority = LOS_TaskPriGet(OsCurrTaskGet()->taskID); - ICUNIT_GOTO_EQUAL(priority, 10, priority, EXIT); // 10, here assert the result. + ICUNIT_GOTO_EQUAL(OsCurrTaskGet()->priority, 10, OsCurrTaskGet()->priority, EXIT); // 10, here assert the result. ICUNIT_GOTO_EQUAL(g_testCount, 2, g_testCount, EXIT); // 2, here assert the result. g_testCount++; - LOS_TaskDelay(110); // 110, set delay time. + LOS_TaskDelay(11); // 11, set delay time. ICUNIT_GOTO_EQUAL(g_testCount, 4, g_testCount, EXIT); // 4, here assert the result. g_testCount++; @@ -98,8 +100,7 @@ static UINT32 Testcase(VOID) ret = LOS_MuxUnlock(&g_testMux1); ICUNIT_GOTO_EQUAL(ret, LOS_OK, ret, EXIT); - priority = LOS_TaskPriGet(OsCurrTaskGet()->taskID); - ICUNIT_GOTO_EQUAL(priority, prio, priority, EXIT); + ICUNIT_GOTO_EQUAL(OsCurrTaskGet()->priority, prio, OsCurrTaskGet()->priority, EXIT); EXIT: LOS_MuxUnlock(&g_testMux1); diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_042.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_042.c similarity index 87% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_042.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_042.c index 2126ec0c..f0cdfc3d 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_042.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_042.c @@ -61,13 +61,14 @@ static VOID TaskFe4Func(VOID) static VOID TaskMisc10Func(VOID) { UINT32 ret; + TSK_INIT_PARAM_S task1, task2, task3; + LosTaskCB *taskCB = OS_TCB_FROM_TID(g_mainTaskID); g_testCount++; - ret = LOS_MuxLock(&g_testMux1, 100); // 100, init mutex. + ret = LOS_MuxLock(&g_testMux1, 10); // 10, init mutex. ICUNIT_ASSERT_EQUAL_VOID(ret, LOS_ETIMEDOUT, ret); - UINT16 priority = LOS_TaskPriGet(g_mainTaskID); - ICUNIT_ASSERT_EQUAL_VOID(priority, 4, priority); // 4, here assert the result. + ICUNIT_ASSERT_EQUAL_VOID(taskCB->priority, 4, taskCB->priority); // 4, here assert the result. ICUNIT_ASSERT_EQUAL_VOID(g_testCount, 6, g_testCount); // 6, here assert the result. g_testCount++; @@ -78,10 +79,10 @@ static VOID TaskMisc10Func(VOID) static UINT32 Testcase(VOID) { UINT32 ret; - TSK_INIT_PARAM_S taskParam = {0}; + TSK_INIT_PARAM_S taskParam; g_testCount = 0; LosTaskCB *task = NULL; - UINT16 prio = LOS_TaskPriGet(OsCurrTaskGet()->taskID); + UINT16 prio = OsCurrTaskGet()->priority; g_mainTaskID = OsCurrTaskGet()->taskID; ret = LosMuxCreate(&g_testMux1); @@ -105,8 +106,7 @@ static UINT32 Testcase(VOID) ret = LOS_TaskCreate(&g_testTaskID01, &taskParam); ICUNIT_GOTO_EQUAL(ret, LOS_OK, ret, EXIT); - UINT16 priority = LOS_TaskPriGet(OsCurrTaskGet()->taskID); - ICUNIT_GOTO_EQUAL(priority, 10, priority, EXIT); // 10, here assert the result. + ICUNIT_GOTO_EQUAL(OsCurrTaskGet()->priority, 10, OsCurrTaskGet()->priority, EXIT); // 10, here assert the result. ICUNIT_GOTO_EQUAL(g_testCount, 3, g_testCount, EXIT); // 3, here assert the result. g_testCount++; @@ -122,12 +122,11 @@ static UINT32 Testcase(VOID) ret = LOS_TaskCreate(&g_testTaskID03, &taskParam); ICUNIT_GOTO_EQUAL(ret, LOS_OK, ret, EXIT); - priority = LOS_TaskPriGet(OsCurrTaskGet()->taskID); - ICUNIT_GOTO_EQUAL(priority, 4, priority, EXIT); // 4, here assert the result. + ICUNIT_GOTO_EQUAL(OsCurrTaskGet()->priority, 4, OsCurrTaskGet()->priority, EXIT); // 4, here assert the result. ICUNIT_GOTO_EQUAL(g_testCount, 5, g_testCount, EXIT); // 5, here assert the result. g_testCount++; - LOS_TaskDelay(200); // 200, set delay time. + LOS_TaskDelay(11); // 11, set delay time. ICUNIT_GOTO_EQUAL(g_testCount, 7, g_testCount, EXIT); // 7, here assert the result. g_testCount++; @@ -135,8 +134,7 @@ static UINT32 Testcase(VOID) ret = LOS_MuxUnlock(&g_testMux1); ICUNIT_GOTO_EQUAL(ret, LOS_OK, ret, EXIT); - priority = LOS_TaskPriGet(OsCurrTaskGet()->taskID); - ICUNIT_GOTO_EQUAL(priority, prio, priority, EXIT); + ICUNIT_GOTO_EQUAL(OsCurrTaskGet()->priority, prio, OsCurrTaskGet()->priority, EXIT); ret = LOS_MuxLock(&g_testMux1, LOS_WAIT_FOREVER); ICUNIT_GOTO_EQUAL(ret, LOS_OK, ret, EXIT); diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_043.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_043.c similarity index 89% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_043.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_043.c index 685e5aa3..41324aef 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_043.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/full/It_los_mutex_043.c @@ -46,6 +46,7 @@ static UINT32 g_mainTaskID; static VOID TaskFe4Func(VOID) { UINT32 ret; + LosTaskCB *taskCB = OS_TCB_FROM_TID(g_mainTaskID); ICUNIT_ASSERT_EQUAL_VOID(g_testCount, 4, g_testCount); // 4, here assert the result. g_testCount++; @@ -53,8 +54,7 @@ static VOID TaskFe4Func(VOID) ret = LOS_MuxLock(&g_testMux2, LOS_WAIT_FOREVER); ICUNIT_ASSERT_EQUAL_VOID(ret, LOS_OK, ret); - UINT16 priority = LOS_TaskPriGet(g_mainTaskID); - ICUNIT_ASSERT_EQUAL_VOID(priority, 10, priority); // 10, here assert the result. + ICUNIT_ASSERT_EQUAL_VOID(taskCB->priority, 10, taskCB->priority); // 10, here assert the result. ICUNIT_ASSERT_EQUAL_VOID(g_testCount, 6, g_testCount); // 6, here assert the result. g_testCount++; @@ -67,6 +67,8 @@ static VOID TaskFe4Func(VOID) static VOID TaskMisc10Func(VOID) { UINT32 ret; + TSK_INIT_PARAM_S task1, task2, task3; + LosTaskCB *taskCB = OS_TCB_FROM_TID(g_mainTaskID); g_testCount++; ret = LOS_MuxLock(&g_testMux1, LOS_WAIT_FOREVER); @@ -84,12 +86,12 @@ static VOID TaskMisc10Func(VOID) static UINT32 Testcase(VOID) { UINT32 ret; - TSK_INIT_PARAM_S taskParam = { 0 }; + TSK_INIT_PARAM_S taskParam; g_testCount = 0; LosTaskCB *task = NULL; LosMuxAttr attr = { 0 }; - UINT16 prio = LOS_TaskPriGet(OsCurrTaskGet()->taskID); + UINT16 prio = OsCurrTaskGet()->priority; g_mainTaskID = OsCurrTaskGet()->taskID; ret = LosMuxCreate(&g_testMux1); @@ -125,8 +127,7 @@ static UINT32 Testcase(VOID) ret = LOS_TaskCreate(&g_testTaskID01, &taskParam); ICUNIT_GOTO_EQUAL(ret, LOS_OK, ret, EXIT); - UINT16 priority = LOS_TaskPriGet(OsCurrTaskGet()->taskID); - ICUNIT_GOTO_EQUAL(priority, 10, priority, EXIT); // 10, here assert the result. + ICUNIT_GOTO_EQUAL(OsCurrTaskGet()->priority, 10, OsCurrTaskGet()->priority, EXIT); // 10, here assert the result. ICUNIT_GOTO_EQUAL(g_testCount, 3, g_testCount, EXIT); // 3, here assert the result. g_testCount++; @@ -142,8 +143,7 @@ static UINT32 Testcase(VOID) ret = LOS_TaskCreate(&g_testTaskID03, &taskParam); ICUNIT_GOTO_EQUAL(ret, LOS_OK, ret, EXIT); - priority = LOS_TaskPriGet(OsCurrTaskGet()->taskID); - ICUNIT_GOTO_EQUAL(priority, 10, priority, EXIT); // 10, here assert the result. + ICUNIT_GOTO_EQUAL(OsCurrTaskGet()->priority, 10, OsCurrTaskGet()->priority, EXIT); // 10, here assert the result. ICUNIT_GOTO_EQUAL(g_testCount, 5, g_testCount, EXIT); // 5, here assert the result. g_testCount++; @@ -156,8 +156,7 @@ static UINT32 Testcase(VOID) ret = LOS_MuxUnlock(&g_testMux1); ICUNIT_GOTO_EQUAL(ret, LOS_OK, ret, EXIT); - priority = LOS_TaskPriGet(OsCurrTaskGet()->taskID); - ICUNIT_GOTO_EQUAL(priority, prio, priority, EXIT); + ICUNIT_GOTO_EQUAL(OsCurrTaskGet()->priority, prio, OsCurrTaskGet()->priority, EXIT); ICUNIT_GOTO_EQUAL(g_testCount, 9, g_testCount, EXIT); // 9, here assert the result. diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smoke/It_los_mutex_001.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smoke/It_los_mutex_001.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smoke/It_los_mutex_001.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smoke/It_los_mutex_001.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smoke/It_los_mutex_002.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smoke/It_los_mutex_002.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smoke/It_los_mutex_002.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smoke/It_los_mutex_002.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smoke/It_los_mutex_003.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smoke/It_los_mutex_003.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smoke/It_los_mutex_003.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smoke/It_los_mutex_003.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smoke/It_los_mutex_004.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smoke/It_los_mutex_004.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smoke/It_los_mutex_004.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smoke/It_los_mutex_004.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_001.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_001.c similarity index 97% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_001.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_001.c index 55b27696..679c594f 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_001.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_001.c @@ -67,7 +67,7 @@ static UINT32 Testcase(VOID) task.pfnTaskEntry = (TSK_ENTRY_FUNC)Task01; task.pcName = "Test Case 1"; task.uwStackSize = TASK_STACK_SIZE_TEST; - task.usTaskPrio = TASK_PRIO_TEST_TASK; + task.usTaskPrio = TASK_PRIO_TEST; task.uwResved = LOS_TASK_STATUS_DETACHED; task.usCpuAffiMask = CPUID_TO_AFFI_MASK(currCpuid); diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_002.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_002.c similarity index 97% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_002.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_002.c index 7f8215d1..a862d1da 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_002.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_002.c @@ -64,7 +64,7 @@ static UINT32 Testcase(VOID) task.pfnTaskEntry = (TSK_ENTRY_FUNC)Task01; task.pcName = "Test Case 1"; task.uwStackSize = TASK_STACK_SIZE_TEST; - task.usTaskPrio = TASK_PRIO_TEST_TASK; + task.usTaskPrio = TASK_PRIO_TEST; task.uwResved = LOS_TASK_STATUS_DETACHED; task.usCpuAffiMask = CPUID_TO_AFFI_MASK(currCpuid); diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_003.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_003.c similarity index 98% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_003.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_003.c index 48dab1f0..9c5304ae 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_003.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_003.c @@ -78,7 +78,7 @@ static UINT32 Testcase(VOID) task.pfnTaskEntry = (TSK_ENTRY_FUNC)Task01; task.pcName = "Test Case 1"; task.uwStackSize = TASK_STACK_SIZE_TEST; - task.usTaskPrio = TASK_PRIO_TEST_TASK; + task.usTaskPrio = TASK_PRIO_TEST; task.uwResved = LOS_TASK_STATUS_DETACHED; task.usCpuAffiMask = CPUID_TO_AFFI_MASK(currCpuid); diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_004.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_004.c similarity index 97% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_004.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_004.c index a7a0f1ff..c953130b 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_004.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_004.c @@ -61,7 +61,7 @@ static UINT32 Testcase(VOID) task.pfnTaskEntry = (TSK_ENTRY_FUNC)Task01; task.pcName = "Test Case 1"; task.uwStackSize = TASK_STACK_SIZE_TEST; - task.usTaskPrio = TASK_PRIO_TEST_TASK; + task.usTaskPrio = TASK_PRIO_TEST; task.uwResved = LOS_TASK_STATUS_DETACHED; task.usCpuAffiMask = CPUID_TO_AFFI_MASK(currCpuid); diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_005.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_005.c similarity index 97% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_005.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_005.c index 886278e9..5af5b2c9 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_005.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_005.c @@ -64,7 +64,7 @@ static UINT32 Testcase(VOID) task.pfnTaskEntry = (TSK_ENTRY_FUNC)Task01; task.pcName = "Test Case 1"; task.uwStackSize = TASK_STACK_SIZE_TEST; - task.usTaskPrio = TASK_PRIO_TEST_TASK; + task.usTaskPrio = TASK_PRIO_TEST; task.uwResved = LOS_TASK_STATUS_DETACHED; task.usCpuAffiMask = CPUID_TO_AFFI_MASK(currCpuid); diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_006.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_006.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_006.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_006.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_007.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_007.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_007.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_007.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2001.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2001.c similarity index 97% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2001.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2001.c index d9b9860b..c867725d 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2001.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2001.c @@ -55,14 +55,14 @@ static VOID TaskF01(VOID) static UINT32 Testcase(VOID) { UINT32 ret; - TSK_INIT_PARAM_S testTask = {0}; + TSK_INIT_PARAM_S testTask; g_testCount = 0; ret = LosMuxCreate(&g_mutexkernelTest); ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret); - TEST_TASK_PARAM_INIT_AFFI(testTask, "it_event_001_task", TaskF01, TASK_PRIO_TEST_TASK - 1, + TEST_TASK_PARAM_INIT_AFFI(testTask, "it_event_001_task", TaskF01, TASK_PRIO_TEST - 1, CPUID_TO_AFFI_MASK(ArchCurrCpuid())); ret = LOS_TaskCreate(&g_testTaskID01, &testTask); ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret); diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2002.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2002.c similarity index 97% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2002.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2002.c index 16df543b..63f06ba0 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2002.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2002.c @@ -55,7 +55,7 @@ static VOID TaskF01(VOID) static UINT32 Testcase(VOID) { UINT32 ret, currCpuid; - TSK_INIT_PARAM_S testTask = {0}; + TSK_INIT_PARAM_S testTask; g_testCount = 0; @@ -64,7 +64,7 @@ static UINT32 Testcase(VOID) ret = LosMuxCreate(&g_mutexkernelTest); ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret); - TEST_TASK_PARAM_INIT_AFFI(testTask, "it_event_001_task", TaskF01, TASK_PRIO_TEST_TASK - 1, + TEST_TASK_PARAM_INIT_AFFI(testTask, "it_event_001_task", TaskF01, TASK_PRIO_TEST - 1, CPUID_TO_AFFI_MASK(currCpuid)); // other cpu ret = LOS_TaskCreate(&g_testTaskID01, &testTask); ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret); diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2003.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2003.c similarity index 98% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2003.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2003.c index 94127af4..7b374af5 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2003.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2003.c @@ -55,7 +55,7 @@ static VOID HwiF01(VOID) static UINT32 Testcase(VOID) { UINT32 ret, currCpuid; - TSK_INIT_PARAM_S testTask = {0}; + TSK_INIT_PARAM_S testTask; g_testCount = 0; diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2004.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2004.c similarity index 97% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2004.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2004.c index 67286fa6..63b33689 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2004.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2004.c @@ -56,14 +56,14 @@ static VOID TaskF01(VOID) static UINT32 Testcase(VOID) { UINT32 ret; - TSK_INIT_PARAM_S testTask = {0}; + TSK_INIT_PARAM_S testTask; g_testCount = 0; ret = LosMuxCreate(&g_mutexkernelTest); ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret); - TEST_TASK_PARAM_INIT_AFFI(testTask, "it_event_001_task", TaskF01, TASK_PRIO_TEST_TASK - 1, + TEST_TASK_PARAM_INIT_AFFI(testTask, "it_event_001_task", TaskF01, TASK_PRIO_TEST - 1, CPUID_TO_AFFI_MASK(ArchCurrCpuid())); ret = LOS_TaskCreate(&g_testTaskID01, &testTask); ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret); diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2005.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2005.c similarity index 97% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2005.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2005.c index 2794a3da..60dd6694 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2005.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2005.c @@ -82,7 +82,7 @@ static VOID TaskF02(VOID) static UINT32 Testcase(VOID) { UINT32 ret, currCpuid; - TSK_INIT_PARAM_S testTask = {0}; + TSK_INIT_PARAM_S testTask; g_testCount = 0; @@ -91,12 +91,12 @@ static UINT32 Testcase(VOID) currCpuid = (ArchCurrCpuid() + 1) % (LOSCFG_KERNEL_CORE_NUM); - TEST_TASK_PARAM_INIT_AFFI(testTask, "it_event_005_task2", TaskF02, TASK_PRIO_TEST_TASK - 1, + TEST_TASK_PARAM_INIT_AFFI(testTask, "it_event_005_task2", TaskF02, TASK_PRIO_TEST - 1, CPUID_TO_AFFI_MASK(currCpuid)); // other cpu ret = LOS_TaskCreate(&g_testTaskID02, &testTask); ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret); - TEST_TASK_PARAM_INIT_AFFI(testTask, "it_event_005_task1", TaskF01, TASK_PRIO_TEST_TASK - 1, + TEST_TASK_PARAM_INIT_AFFI(testTask, "it_event_005_task1", TaskF01, TASK_PRIO_TEST - 1, CPUID_TO_AFFI_MASK(ArchCurrCpuid())); // current cpu ret = LOS_TaskCreate(&g_testTaskID01, &testTask); ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret); diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2006.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2006.c similarity index 98% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2006.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2006.c index 674998bf..dc871546 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2006.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2006.c @@ -67,7 +67,7 @@ static VOID TaskF01(VOID) static UINT32 Testcase(VOID) { UINT32 ret, currCpuid; - TSK_INIT_PARAM_S testTask = {0}; + TSK_INIT_PARAM_S testTask; g_testCount = 0; g_runFlag = 1; @@ -77,7 +77,7 @@ static UINT32 Testcase(VOID) currCpuid = (ArchCurrCpuid() + 1) % (LOSCFG_KERNEL_CORE_NUM); - TEST_TASK_PARAM_INIT_AFFI(testTask, "it_event_006_task1", TaskF01, TASK_PRIO_TEST_TASK - 1, + TEST_TASK_PARAM_INIT_AFFI(testTask, "it_event_006_task1", TaskF01, TASK_PRIO_TEST - 1, CPUID_TO_AFFI_MASK(currCpuid)); // other cpu ret = LOS_TaskCreate(&g_testTaskID01, &testTask); ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret); diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2007.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2007.c similarity index 97% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2007.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2007.c index 6a5f871b..d5a33896 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2007.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2007.c @@ -72,7 +72,7 @@ static VOID TaskF02(VOID) static UINT32 Testcase(VOID) { UINT32 ret, currCpuid; - TSK_INIT_PARAM_S testTask = {0}; + TSK_INIT_PARAM_S testTask; g_testCount = 0; @@ -82,12 +82,12 @@ static UINT32 Testcase(VOID) currCpuid = (ArchCurrCpuid() + 1) % (LOSCFG_KERNEL_CORE_NUM); // 2, set reasonable priority. - TEST_TASK_PARAM_INIT_AFFI(testTask, "it_event_007_task1", TaskF01, TASK_PRIO_TEST_TASK - 2, + TEST_TASK_PARAM_INIT_AFFI(testTask, "it_event_007_task1", TaskF01, TASK_PRIO_TEST - 2, CPUID_TO_AFFI_MASK(currCpuid)); // other cpu ret = LOS_TaskCreate(&g_testTaskID01, &testTask); ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret); - TEST_TASK_PARAM_INIT_AFFI(testTask, "it_event_007_task2", TaskF02, TASK_PRIO_TEST_TASK - 1, + TEST_TASK_PARAM_INIT_AFFI(testTask, "it_event_007_task2", TaskF02, TASK_PRIO_TEST - 1, CPUID_TO_AFFI_MASK(currCpuid)); // other cpu ret = LOS_TaskCreate(&g_testTaskID02, &testTask); ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret); diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2008.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2008.c similarity index 98% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2008.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2008.c index 1c65cf77..069edf33 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2008.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2008.c @@ -56,7 +56,7 @@ static VOID HwiF01(VOID) static UINT32 Testcase(VOID) { UINT32 ret, currCpuid; - TSK_INIT_PARAM_S testTask = {0}; + TSK_INIT_PARAM_S testTask; g_testCount = 0; diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2009.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2009.c similarity index 98% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2009.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2009.c index 4769261d..195de233 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2009.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2009.c @@ -72,7 +72,7 @@ static VOID HwiF01(VOID) static UINT32 Testcase(VOID) { UINT32 ret, currCpuid; - TSK_INIT_PARAM_S testTask = {0}; + TSK_INIT_PARAM_S testTask; g_testCount = 0; @@ -86,7 +86,7 @@ static UINT32 Testcase(VOID) currCpuid = (ArchCurrCpuid() + 1) % (LOSCFG_KERNEL_CORE_NUM); - TEST_TASK_PARAM_INIT_AFFI(testTask, "it_event_009_task", TaskF01, TASK_PRIO_TEST_TASK - 1, + TEST_TASK_PARAM_INIT_AFFI(testTask, "it_event_009_task", TaskF01, TASK_PRIO_TEST - 1, CPUID_TO_AFFI_MASK(currCpuid)); // other cpu ret = LOS_TaskCreate(&g_testTaskID01, &testTask); ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret); diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2010.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2010.c similarity index 98% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2010.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2010.c index 7debeca2..cbc9a074 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2010.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2010.c @@ -58,7 +58,7 @@ EXIT: static UINT32 Testcase(VOID) { UINT32 ret; - TSK_INIT_PARAM_S testTask = {0}; + TSK_INIT_PARAM_S testTask; g_testCount = 0; @@ -68,7 +68,7 @@ static UINT32 Testcase(VOID) ret = LOS_MuxLock(&g_mutexkernelTest, LOS_WAIT_FOREVER); ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret); - TEST_TASK_PARAM_INIT_AFFI(testTask, "it_event_010_task1", TaskF01, TASK_PRIO_TEST_TASK - 1, + TEST_TASK_PARAM_INIT_AFFI(testTask, "it_event_010_task1", TaskF01, TASK_PRIO_TEST - 1, CPUID_TO_AFFI_MASK(ArchCurrCpuid())); // current cpu ret = LOS_TaskCreate(&g_testTaskID01, &testTask); ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret); diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2011.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2011.c similarity index 97% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2011.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2011.c index c1f5ddc8..bd21a827 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2011.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2011.c @@ -79,7 +79,7 @@ static VOID TaskF01(VOID) static UINT32 Testcase(VOID) { UINT32 ret, currCpuid; - TSK_INIT_PARAM_S testTask = {0}; + TSK_INIT_PARAM_S testTask; g_testCount = 0; @@ -88,7 +88,7 @@ static UINT32 Testcase(VOID) currCpuid = (ArchCurrCpuid() + 1) % (LOSCFG_KERNEL_CORE_NUM); - TEST_TASK_PARAM_INIT_AFFI(testTask, "it_event_011_task2", TaskF02, TASK_PRIO_TEST_TASK - 1, + TEST_TASK_PARAM_INIT_AFFI(testTask, "it_event_011_task2", TaskF02, TASK_PRIO_TEST - 1, CPUID_TO_AFFI_MASK(currCpuid)); // other cpu ret = LOS_TaskCreate(&g_testTaskID02, &testTask); ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret); @@ -97,7 +97,7 @@ static UINT32 Testcase(VOID) __asm__ volatile("nop"); } while (g_testCount != 1); - TEST_TASK_PARAM_INIT_AFFI(testTask, "it_event_011_task1", TaskF01, TASK_PRIO_TEST_TASK + 1, + TEST_TASK_PARAM_INIT_AFFI(testTask, "it_event_011_task1", TaskF01, TASK_PRIO_TEST + 1, CPUID_TO_AFFI_MASK(ArchCurrCpuid())); // current cpu ret = LOS_TaskCreate(&g_testTaskID01, &testTask); ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret); diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2012.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2012.c similarity index 98% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2012.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2012.c index 9650daa5..7eeff1b0 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2012.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2012.c @@ -96,7 +96,7 @@ EXIT: static UINT32 Testcase(VOID) { UINT32 ret, currCpuid; - TSK_INIT_PARAM_S testTask = {0}; + TSK_INIT_PARAM_S testTask; g_testCount = 0; @@ -110,7 +110,7 @@ static UINT32 Testcase(VOID) HalIrqSetAffinity(HWI_NUM_TEST, CPUID_TO_AFFI_MASK(currCpuid)); // other cpu - TEST_TASK_PARAM_INIT_AFFI(testTask, "it_MUX_2012_task1", TaskF02, TASK_PRIO_TEST_TASK - 1, + TEST_TASK_PARAM_INIT_AFFI(testTask, "it_MUX_2012_task1", TaskF02, TASK_PRIO_TEST - 1, CPUID_TO_AFFI_MASK(currCpuid)); // other cpu ret = LOS_TaskCreate(&g_testTaskID02, &testTask); @@ -119,7 +119,7 @@ static UINT32 Testcase(VOID) TestAssertBusyTaskDelay(100, 2); // 100, 2, delay for Timing control. ICUNIT_GOTO_EQUAL(g_testCount, 2, g_testCount, EXIT); // 2, here assert the result. - TEST_TASK_PARAM_INIT_AFFI(testTask, "it_MUX_2012_task2", TaskF01, TASK_PRIO_TEST_TASK + 1, + TEST_TASK_PARAM_INIT_AFFI(testTask, "it_MUX_2012_task2", TaskF01, TASK_PRIO_TEST + 1, CPUID_TO_AFFI_MASK(ArchCurrCpuid())); // current cpu ret = LOS_TaskCreate(&g_testTaskID01, &testTask); ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret); diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2013.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2013.c similarity index 97% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2013.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2013.c index 13561559..7a3b4575 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2013.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2013.c @@ -75,7 +75,7 @@ static VOID TaskF02(VOID) static UINT32 Testcase(VOID) { UINT32 ret, currCpuid; - TSK_INIT_PARAM_S testTask = {0}; + TSK_INIT_PARAM_S testTask; g_testCount = 0; @@ -87,14 +87,14 @@ static UINT32 Testcase(VOID) currCpuid = (ArchCurrCpuid() + 1) % (LOSCFG_KERNEL_CORE_NUM); - TEST_TASK_PARAM_INIT_AFFI(testTask, "it_event_013_task1", TaskF01, TASK_PRIO_TEST_TASK - 1, + TEST_TASK_PARAM_INIT_AFFI(testTask, "it_event_013_task1", TaskF01, TASK_PRIO_TEST - 1, CPUID_TO_AFFI_MASK(ArchCurrCpuid())); // current cpu ret = LOS_TaskCreate(&g_testTaskID01, &testTask); ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret); ICUNIT_GOTO_EQUAL(g_testCount, 1, g_testCount, EXIT); - TEST_TASK_PARAM_INIT_AFFI(testTask, "it_event_013_task2", TaskF02, TASK_PRIO_TEST_TASK - 1, + TEST_TASK_PARAM_INIT_AFFI(testTask, "it_event_013_task2", TaskF02, TASK_PRIO_TEST - 1, CPUID_TO_AFFI_MASK(currCpuid)); // other cpu ret = LOS_TaskCreate(&g_testTaskID02, &testTask); ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret); diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2014.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2014.c similarity index 97% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2014.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2014.c index 4c25064f..8ccdcd6d 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2014.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2014.c @@ -81,7 +81,7 @@ static VOID TaskF01(VOID) static UINT32 Testcase(VOID) { UINT32 ret, currCpuid; - TSK_INIT_PARAM_S testTask = {0}; + TSK_INIT_PARAM_S testTask; g_testCount = 0; @@ -90,7 +90,7 @@ static UINT32 Testcase(VOID) currCpuid = (ArchCurrCpuid() + 1) % (LOSCFG_KERNEL_CORE_NUM); - TEST_TASK_PARAM_INIT_AFFI(testTask, "it_event_014_task2", TaskF02, TASK_PRIO_TEST_TASK - 1, + TEST_TASK_PARAM_INIT_AFFI(testTask, "it_event_014_task2", TaskF02, TASK_PRIO_TEST - 1, CPUID_TO_AFFI_MASK(currCpuid)); // other cpu ret = LOS_TaskCreate(&g_testTaskID02, &testTask); ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret); @@ -99,7 +99,7 @@ static UINT32 Testcase(VOID) __asm__ volatile("nop"); } while (g_testCount != 1); - TEST_TASK_PARAM_INIT_AFFI(testTask, "it_event_014_task1", TaskF01, TASK_PRIO_TEST_TASK + 1, + TEST_TASK_PARAM_INIT_AFFI(testTask, "it_event_014_task1", TaskF01, TASK_PRIO_TEST + 1, CPUID_TO_AFFI_MASK(ArchCurrCpuid())); // current cpu ret = LOS_TaskCreate(&g_testTaskID01, &testTask); ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret); diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2015.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2015.c similarity index 98% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2015.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2015.c index a1d94ed9..f57e6eac 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2015.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2015.c @@ -97,7 +97,7 @@ static VOID HwiF02(VOID) static UINT32 Testcase(VOID) { UINT32 ret, currCpuid; - TSK_INIT_PARAM_S testTask = {0}; + TSK_INIT_PARAM_S testTask; g_testCount = 0; @@ -115,7 +115,7 @@ static UINT32 Testcase(VOID) HalIrqSetAffinity(HWI_NUM_TEST, CPUID_TO_AFFI_MASK(currCpuid)); // other cpu HalIrqSetAffinity(HWI_NUM_TEST1, CPUID_TO_AFFI_MASK(currCpuid)); // other cpu - TEST_TASK_PARAM_INIT_AFFI(testTask, "it_MUX_2015_task2", TaskF02, TASK_PRIO_TEST_TASK - 1, + TEST_TASK_PARAM_INIT_AFFI(testTask, "it_MUX_2015_task2", TaskF02, TASK_PRIO_TEST - 1, CPUID_TO_AFFI_MASK(currCpuid)); // other cpu ret = LOS_TaskCreate(&g_testTaskID02, &testTask); ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret); @@ -124,7 +124,7 @@ static UINT32 Testcase(VOID) __asm__ volatile("nop"); } while (g_testCount != 2); // 2, wait until g_testCount == 2. - TEST_TASK_PARAM_INIT_AFFI(testTask, "it_MUX_2015_task1", TaskF01, TASK_PRIO_TEST_TASK + 1, + TEST_TASK_PARAM_INIT_AFFI(testTask, "it_MUX_2015_task1", TaskF01, TASK_PRIO_TEST + 1, CPUID_TO_AFFI_MASK(ArchCurrCpuid())); // current cpu ret = LOS_TaskCreate(&g_testTaskID01, &testTask); ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret); diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2016.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2016.c similarity index 98% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2016.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2016.c index 7b0444e3..f57bf84e 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2016.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2016.c @@ -55,7 +55,7 @@ static VOID TaskF01(VOID) static UINT32 Testcase(VOID) { UINT32 ret; - TSK_INIT_PARAM_S testTask = {0}; + TSK_INIT_PARAM_S testTask; g_testCount = 0; @@ -65,7 +65,7 @@ static UINT32 Testcase(VOID) ret = LOS_MuxLock(&g_mutexkernelTest, LOS_WAIT_FOREVER); ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret); - TEST_TASK_PARAM_INIT_AFFI(testTask, "it_event_001_task", TaskF01, TASK_PRIO_TEST_TASK - 1, + TEST_TASK_PARAM_INIT_AFFI(testTask, "it_event_001_task", TaskF01, TASK_PRIO_TEST - 1, CPUID_TO_AFFI_MASK(ArchCurrCpuid())); ret = LOS_TaskCreate(&g_testTaskID01, &testTask); ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret); diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2017.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2017.c similarity index 96% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2017.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2017.c index 43e52e94..728f25ce 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2017.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2017.c @@ -55,7 +55,7 @@ static VOID TaskF01(VOID) static UINT32 Testcase(VOID) { UINT32 ret, currCpuid; - TSK_INIT_PARAM_S testTask = {0}; + TSK_INIT_PARAM_S testTask; g_testCount = 0; @@ -67,7 +67,7 @@ static UINT32 Testcase(VOID) currCpuid = (ArchCurrCpuid() + 1) % (LOSCFG_KERNEL_CORE_NUM); - TEST_TASK_PARAM_INIT_AFFI(testTask, "it_event_001_task", TaskF01, TASK_PRIO_TEST_TASK - 1, + TEST_TASK_PARAM_INIT_AFFI(testTask, "it_event_001_task", TaskF01, TASK_PRIO_TEST - 1, CPUID_TO_AFFI_MASK(currCpuid)); // other cpu ret = LOS_TaskCreate(&g_testTaskID01, &testTask); ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret); @@ -94,7 +94,7 @@ static UINT32 Testcase(VOID) ICUNIT_GOTO_EQUAL(g_testCount, 1, g_testCount, EXIT); EXIT: - LOS_TaskPriSet(g_testTskHandle, TASK_PRIO_TEST_TASK); // recovery test task's prio + LOS_TaskPriSet(g_testTskHandle, TASK_PRIO_TEST); // recovery test task's prio LOS_TaskDelete(g_testTaskID01); ret = LOS_MuxDestroy(&g_mutexkernelTest); ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret); diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2018.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2018.c similarity index 98% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2018.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2018.c index 0ecc5bca..2d0a3287 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2018.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2018.c @@ -86,7 +86,7 @@ static VOID TaskF02(VOID) static UINT32 Testcase(VOID) { UINT32 ret, currCpuid; - TSK_INIT_PARAM_S testTask = {0}; + TSK_INIT_PARAM_S testTask; g_testCount = 0; g_flag1 = 1; @@ -100,12 +100,12 @@ static UINT32 Testcase(VOID) currCpuid = (ArchCurrCpuid() + 1) % (LOSCFG_KERNEL_CORE_NUM); - TEST_TASK_PARAM_INIT_AFFI(testTask, "it_MUX_2018_task1", TaskF01, TASK_PRIO_TEST_TASK + 1, + TEST_TASK_PARAM_INIT_AFFI(testTask, "it_MUX_2018_task1", TaskF01, TASK_PRIO_TEST + 1, CPUID_TO_AFFI_MASK(currCpuid)); // other cpu ret = LOS_TaskCreate(&g_testTaskID01, &testTask); ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret); - TEST_TASK_PARAM_INIT_AFFI(testTask, "it_MUX_2018_task2", TaskF02, TASK_PRIO_TEST_TASK + 1, + TEST_TASK_PARAM_INIT_AFFI(testTask, "it_MUX_2018_task2", TaskF02, TASK_PRIO_TEST + 1, CPUID_TO_AFFI_MASK(ArchCurrCpuid())); // current cpu, low prio ret = LOS_TaskCreate(&g_testTaskID02, &testTask); ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret); diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2021.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2021.c similarity index 98% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2021.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2021.c index 919a0570..20fb6c50 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2021.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2021.c @@ -59,7 +59,7 @@ static VOID TaskF01(VOID) static UINT32 Testcase(VOID) { UINT32 ret, currCpuid; - TSK_INIT_PARAM_S testTask = {0}; + TSK_INIT_PARAM_S testTask; g_testCount = 0; @@ -71,7 +71,7 @@ static UINT32 Testcase(VOID) ret = LOS_MuxLock(&g_mutexkernelTest, LOS_WAIT_FOREVER); ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret); - TEST_TASK_PARAM_INIT_AFFI(testTask, "it_event_021_task", TaskF01, TASK_PRIO_TEST_TASK - 1, + TEST_TASK_PARAM_INIT_AFFI(testTask, "it_event_021_task", TaskF01, TASK_PRIO_TEST - 1, CPUID_TO_AFFI_MASK(currCpuid)); // other cpu ret = LOS_TaskCreate(&g_testTaskID01, &testTask); ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret); diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2022.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2022.c similarity index 98% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2022.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2022.c index d9d13bff..7c6f7460 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2022.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2022.c @@ -50,7 +50,7 @@ static VOID HwiF01(VOID) static UINT32 Testcase(VOID) { UINT32 ret, currCpuid; - TSK_INIT_PARAM_S testTask = {0}; + TSK_INIT_PARAM_S testTask; g_testCount = 0; diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2024.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2024.c similarity index 97% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2024.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2024.c index 6b922233..31f903d5 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2024.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2024.c @@ -62,7 +62,7 @@ static VOID TaskF02(VOID) static UINT32 Testcase(VOID) { UINT32 ret, currCpuid; - TSK_INIT_PARAM_S testTask = {0}; + TSK_INIT_PARAM_S testTask; g_testCount = 0; @@ -74,7 +74,7 @@ static UINT32 Testcase(VOID) currCpuid = (ArchCurrCpuid() + 1) % (LOSCFG_KERNEL_CORE_NUM); - TEST_TASK_PARAM_INIT_AFFI(testTask, "it_event_014_task2", TaskF02, TASK_PRIO_TEST_TASK - 1, + TEST_TASK_PARAM_INIT_AFFI(testTask, "it_event_014_task2", TaskF02, TASK_PRIO_TEST - 1, CPUID_TO_AFFI_MASK(currCpuid)); // other cpu ret = LOS_TaskCreate(&g_testTaskID02, &testTask); ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret); diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2025.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2025.c similarity index 98% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2025.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2025.c index 958a97d1..eb007781 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2025.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2025.c @@ -55,7 +55,7 @@ static VOID HwiF01(VOID) static UINT32 Testcase(VOID) { UINT32 ret, currCpuid; - TSK_INIT_PARAM_S testTask = {0}; + TSK_INIT_PARAM_S testTask; g_testCount = 0; diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2026.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2026.c similarity index 98% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2026.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2026.c index 8b410a54..95fd8a97 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2026.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2026.c @@ -77,7 +77,7 @@ static VOID TaskF02(VOID) static UINT32 Testcase(VOID) { UINT32 ret, currCpuid, i, uvIntSave; - TSK_INIT_PARAM_S testTask = {0}; + TSK_INIT_PARAM_S testTask; g_testCount = 0; @@ -90,7 +90,7 @@ static UINT32 Testcase(VOID) currCpuid = (ArchCurrCpuid() + 1) % (LOSCFG_KERNEL_CORE_NUM); // 3, set reasonable priority. - TEST_TASK_PARAM_INIT_AFFI(testTask, "it_MUX_2026_task2", TaskF02, TASK_PRIO_TEST_TASK - 3, + TEST_TASK_PARAM_INIT_AFFI(testTask, "it_MUX_2026_task2", TaskF02, TASK_PRIO_TEST - 3, CPUID_TO_AFFI_MASK(currCpuid)); // let the task f02 pend mux first ret = LOS_TaskCreate(&g_testTaskID02, &testTask); ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret); @@ -98,7 +98,7 @@ static UINT32 Testcase(VOID) TestAssertBusyTaskDelay(100, 1); // 100, delay for Timing control. ICUNIT_GOTO_EQUAL(g_testCount, 1, g_testCount, EXIT); - TEST_TASK_PARAM_INIT_AFFI(testTask, "it_MUX_2026_task1", TaskF01, TASK_PRIO_TEST_TASK - 1, + TEST_TASK_PARAM_INIT_AFFI(testTask, "it_MUX_2026_task1", TaskF01, TASK_PRIO_TEST - 1, CPUID_TO_AFFI_MASK(ArchCurrCpuid())); ret = LOS_TaskCreate(&g_testTaskID01, &testTask); ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret); diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2027.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2027.c similarity index 97% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2027.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2027.c index cf145ddb..9fa9a020 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2027.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2027.c @@ -77,7 +77,7 @@ static VOID TaskF02(VOID) static UINT32 Testcase(VOID) { UINT32 ret, currCpuid, i; - TSK_INIT_PARAM_S testTask = {0}; + TSK_INIT_PARAM_S testTask; g_testCount = 0; g_runFlag = 1; @@ -90,12 +90,12 @@ static UINT32 Testcase(VOID) currCpuid = (ArchCurrCpuid() + 1) % (LOSCFG_KERNEL_CORE_NUM); - TEST_TASK_PARAM_INIT_AFFI(testTask, "it_sem_034_task1", TaskF01, TASK_PRIO_TEST_TASK - 2, // 2, set reasonable priority. + TEST_TASK_PARAM_INIT_AFFI(testTask, "it_sem_034_task1", TaskF01, TASK_PRIO_TEST - 2, // 2, set reasonable priority. CPUID_TO_AFFI_MASK(currCpuid)); // other cpu ret = LOS_TaskCreate(&g_testTaskID02, &testTask); ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret); - TEST_TASK_PARAM_INIT_AFFI(testTask, "it_sem_034_task2", TaskF02, TASK_PRIO_TEST_TASK - 1, + TEST_TASK_PARAM_INIT_AFFI(testTask, "it_sem_034_task2", TaskF02, TASK_PRIO_TEST - 1, CPUID_TO_AFFI_MASK(currCpuid)); // other cpu ret = LOS_TaskCreate(&g_testTaskID01, &testTask); ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret); diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2028.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2028.c similarity index 96% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2028.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2028.c index 5b0abe3d..b513a57c 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2028.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2028.c @@ -65,7 +65,7 @@ static VOID TaskF01(VOID) static UINT32 Testcase(VOID) { UINT32 ret, currCpuid, i, j; - TSK_INIT_PARAM_S testTask = {0}; + TSK_INIT_PARAM_S testTask; for (i = 0; i < LOOP; i++) { g_testCount = 0; @@ -78,7 +78,7 @@ static UINT32 Testcase(VOID) currCpuid = (ArchCurrCpuid() + 1) % (LOSCFG_KERNEL_CORE_NUM); - TEST_TASK_PARAM_INIT_AFFI(testTask, "it_mux_028_task", TaskF01, TASK_PRIO_TEST_TASK - 1, + TEST_TASK_PARAM_INIT_AFFI(testTask, "it_mux_028_task", TaskF01, TASK_PRIO_TEST - 1, CPUID_TO_AFFI_MASK(currCpuid)); // other cpu ret = LOS_TaskCreate(&g_testTaskID01, &testTask); ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret); @@ -108,7 +108,7 @@ static UINT32 Testcase(VOID) } EXIT: - LOS_TaskPriSet(g_testTskHandle, TASK_PRIO_TEST_TASK); // recovery test task's prio + LOS_TaskPriSet(g_testTskHandle, TASK_PRIO_TEST); // recovery test task's prio LOS_TaskDelete(g_testTaskID01); LOS_MuxDestroy(&g_mutexkernelTest); return LOS_OK; diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2029.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2029.c similarity index 95% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2029.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2029.c index 6e7dae6e..e66a65f0 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2029.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/mux/smp/It_smp_los_mux_2029.c @@ -76,7 +76,7 @@ static VOID TaskF02(VOID) static UINT32 Testcase(VOID) { UINT32 ret, currCpuid, i, j; - TSK_INIT_PARAM_S testTask = {0}; + TSK_INIT_PARAM_S testTask; g_testCount = 0; currCpuid = (ArchCurrCpuid() + 1) % (LOSCFG_KERNEL_CORE_NUM); @@ -89,12 +89,12 @@ static UINT32 Testcase(VOID) ret = LOS_MuxLock(&g_mutexkernelTest, LOS_WAIT_FOREVER); ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret); - TEST_TASK_PARAM_INIT_AFFI(testTask, "it_smp_event_037_task1", TaskF01, TASK_PRIO_TEST_TASK - 1, + TEST_TASK_PARAM_INIT_AFFI(testTask, "it_smp_event_037_task1", TaskF01, TASK_PRIO_TEST - 1, CPUID_TO_AFFI_MASK(ArchCurrCpuid())); // current cpu ret = LOS_TaskCreate(&g_testTaskID01, &testTask); ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret); - TEST_TASK_PARAM_INIT_AFFI(testTask, "it_smp_event_037_task2", TaskF02, TASK_PRIO_TEST_TASK - 1, + TEST_TASK_PARAM_INIT_AFFI(testTask, "it_smp_event_037_task2", TaskF02, TASK_PRIO_TEST - 1, CPUID_TO_AFFI_MASK(currCpuid)); // other cpu ret = LOS_TaskCreate(&g_testTaskID02, &testTask); ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret); @@ -123,6 +123,8 @@ static UINT32 Testcase(VOID) PRINT_DEBUG("g_testCount = %d ,g_ret = 0x%x\n", g_testCount, g_ret); + ret = OS_TCB_FROM_TID(g_testTaskID02)->taskStatus; + ICUNIT_GOTO_NOT_EQUAL(ret & OS_TASK_STATUS_UNUSED, 0, ret, EXIT); LOS_MuxDestroy(&g_mutexkernelTest); } EXIT: diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/It_los_queue.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/It_los_queue.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/It_los_queue.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/It_los_queue.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/It_los_queue.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/It_los_queue.h similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/It_los_queue.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/It_los_queue.h diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_002.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_002.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_002.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_002.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_003.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_003.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_003.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_003.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_005.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_005.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_005.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_005.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_006.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_006.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_006.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_006.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_007.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_007.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_007.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_007.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_008.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_008.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_008.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_008.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_009.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_009.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_009.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_009.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_010.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_010.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_010.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_010.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_011.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_011.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_011.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_011.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_012.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_012.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_012.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_012.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_013.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_013.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_013.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_013.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_014.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_014.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_014.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_014.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_015.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_015.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_015.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_015.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_017.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_017.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_017.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_017.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_018.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_018.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_018.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_018.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_019.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_019.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_019.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_019.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_020.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_020.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_020.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_020.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_021.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_021.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_021.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_021.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_022.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_022.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_022.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_022.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_023.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_023.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_023.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_023.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_024.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_024.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_024.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_024.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_025.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_025.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_025.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_025.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_026.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_026.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_026.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_026.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_027.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_027.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_027.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_027.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_028.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_028.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_028.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_028.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_029.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_029.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_029.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_029.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_032.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_032.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_032.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_032.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_033.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_033.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_033.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_033.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_037.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_037.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_037.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_037.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_038.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_038.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_038.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_038.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_040.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_040.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_040.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_040.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_041.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_041.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_041.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_041.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_042.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_042.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_042.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_042.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_043.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_043.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_043.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_043.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_044.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_044.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_044.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_044.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_045.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_045.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_045.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_045.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_046.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_046.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_046.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_046.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_047.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_047.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_047.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_047.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_048.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_048.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_048.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_048.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_049.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_049.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_049.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_049.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_050.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_050.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_050.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_050.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_051.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_051.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_051.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_051.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_052.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_052.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_052.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_052.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_053.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_053.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_053.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_053.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_054.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_054.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_054.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_054.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_055.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_055.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_055.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_055.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_056.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_056.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_056.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_056.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_057.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_057.c similarity index 96% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_057.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_057.c index 96f50eb6..8ac781b5 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_057.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_057.c @@ -46,8 +46,7 @@ static UINT32 Testcase(VOID) g_testQueueID01 = 0; - ret = memset_s(bufname, 5001, 'a', 5001); // 5001, buffer size. - ICUNIT_ASSERT_EQUAL(ret, 0, ret); + memset(bufname, 'a', 5001); // 5001, buffer size. bufname[5001] = '\0'; // 5001, buffer size. ret = LOS_QueueCreate(bufname, 3, &g_testQueueID01, 0, sizeof(UINTPTR)); // 3, Set the queue length. ICUNIT_GOTO_EQUAL(ret, LOS_OK, ret, EXIT); diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_058.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_058.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_058.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_058.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_059.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_059.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_059.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_059.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_061.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_061.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_061.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_061.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_062.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_062.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_062.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_062.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_064.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_064.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_064.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_064.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_065.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_065.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_065.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_065.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_066.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_066.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_066.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_066.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_067.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_067.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_067.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_067.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_068.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_068.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_068.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_068.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_069.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_069.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_069.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_069.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_070.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_070.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_070.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_070.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_071.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_071.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_071.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_071.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_072.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_072.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_072.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_072.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_073.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_073.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_073.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_073.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_074.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_074.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_074.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_074.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_075.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_075.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_075.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_075.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_076.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_076.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_076.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_076.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_077.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_077.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_077.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_077.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_078.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_078.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_078.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_078.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_079.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_079.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_079.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_079.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_080.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_080.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_080.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_080.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_081.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_081.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_081.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_081.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_082.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_082.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_082.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_082.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_083.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_083.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_083.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_083.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_084.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_084.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_084.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_084.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_085.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_085.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_085.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_085.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_086.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_086.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_086.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_086.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_087.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_087.c similarity index 96% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_087.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_087.c index 5d72c4a9..8788d7fd 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_087.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_087.c @@ -57,8 +57,7 @@ static UINT32 Testcase(VOID) ret = LOS_QueueWrite(g_testQueueID01, filebuf, count, 0); ICUNIT_GOTO_EQUAL(ret, LOS_OK, ret, EXIT); - ret = memset_s(readbuf, 260, 0, 260); // 260, Read buf size. - ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT); + memset(readbuf, 0, 260); // 260, Read buf size. ret = LOS_QueueRead(g_testQueueID01, readbuf, count, 0); ICUNIT_GOTO_EQUAL(ret, LOS_OK, ret, EXIT); diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_088.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_088.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_088.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_088.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_089.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_089.c similarity index 97% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_089.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_089.c index d63cf9f3..5041323c 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_089.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_089.c @@ -66,8 +66,7 @@ static UINT32 Testcase(VOID) ICUNIT_GOTO_EQUAL(ret, LOS_ERRNO_QUEUE_ISFULL, ret, EXIT); for (i = 0; i < 1000; i++) { // 1000, The loop frequency. - ret = memset_s(readbuf, 260, 0, 260); // 260, Read buf size. - ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT); + memset(readbuf, 0, 260); // 260, Read buf size. ret = LOS_QueueRead(g_testQueueID01, readbuf, QUEUE_SHORT_BUFFER_LENGTH, 0); ICUNIT_GOTO_EQUAL(ret, LOS_OK, ret, EXIT); } diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_091.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_091.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_091.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_091.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_092.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_092.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_092.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_092.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_093.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_093.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_093.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_093.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_094.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_094.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_094.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_094.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_095.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_095.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_095.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_095.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_096.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_096.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_096.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_096.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_098.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_098.c similarity index 87% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_098.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_098.c index 1ce9ee41..5671e507 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_098.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_098.c @@ -47,16 +47,14 @@ static UINT32 Testcase(VOID) UINT32 readSize; queueID = LOSCFG_BASE_IPC_QUEUE_CONFIG + 1; - ret = memset_s(buff2, QUEUE_SHORT_BUFFER_LENGTH, 0, QUEUE_SHORT_BUFFER_LENGTH); - ICUNIT_ASSERT_EQUAL(ret, 0, ret); + memset(buff2, 0, QUEUE_SHORT_BUFFER_LENGTH); readSize = 8; // 8, Read the setting size of queue buffer. ret = LOS_QueueReadCopy(queueID, &buff2, &readSize, 0); ICUNIT_GOTO_EQUAL(ret, LOS_ERRNO_QUEUE_INVALID, ret, EXIT); ICUNIT_GOTO_EQUAL(readSize, 8, readSize, EXIT); // 8, Here, assert that g_testCount is equal to 8. queueID = LOSCFG_BASE_IPC_QUEUE_CONFIG; - ret = memset_s(buff2, QUEUE_SHORT_BUFFER_LENGTH, 0, QUEUE_SHORT_BUFFER_LENGTH); - ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT); + memset(buff2, 0, QUEUE_SHORT_BUFFER_LENGTH); readSize = 8; // 8, Read the setting size of queue buffer. ret = LOS_QueueReadCopy(queueID, &buff2, &readSize, 0); @@ -64,16 +62,14 @@ static UINT32 Testcase(VOID) ICUNIT_GOTO_EQUAL(readSize, 8, readSize, EXIT); // 8, Here, assert that g_testCount is equal to 8. queueID = LOSCFG_BASE_IPC_QUEUE_CONFIG - 1; - ret = memset_s(buff2, QUEUE_SHORT_BUFFER_LENGTH, 0, QUEUE_SHORT_BUFFER_LENGTH); - ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT); + memset(buff2, 0, QUEUE_SHORT_BUFFER_LENGTH); readSize = 8; // 8, Read the setting size of queue buffer. ret = LOS_QueueReadCopy(queueID, &buff2, &readSize, 0); ICUNIT_GOTO_EQUAL(ret, LOS_ERRNO_QUEUE_NOT_CREATE, ret, EXIT); ICUNIT_GOTO_EQUAL(readSize, 8, readSize, EXIT); // 8, Here, assert that g_testCount is equal to 8. queueID = 0; - ret = memset_s(buff2, QUEUE_SHORT_BUFFER_LENGTH, 0, QUEUE_SHORT_BUFFER_LENGTH); - ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT); + memset(buff2, 0, QUEUE_SHORT_BUFFER_LENGTH); readSize = 8; // 8, Read the setting size of queue buffer. ret = LOS_QueueReadCopy(queueID - 1, &buff2, &readSize, 0); ICUNIT_GOTO_EQUAL(ret, LOS_ERRNO_QUEUE_INVALID, ret, EXIT); diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_099.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_099.c similarity index 95% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_099.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_099.c index 72ac08df..42d14161 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_099.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_099.c @@ -55,8 +55,7 @@ static UINT32 Testcase(VOID) ret = LOS_QueueDelete(queueID); ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret); - ret = memset_s(buff2, QUEUE_SHORT_BUFFER_LENGTH, 0, QUEUE_SHORT_BUFFER_LENGTH); - ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT); + memset(buff2, 0, QUEUE_SHORT_BUFFER_LENGTH); readSize = 8; // 8, Read the setting size of queue buffer. ret = LOS_QueueReadCopy(queueID, &buff2, &readSize, 0); ICUNIT_GOTO_EQUAL(ret, LOS_ERRNO_QUEUE_NOT_CREATE, ret, EXIT); diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_101.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_101.c similarity index 92% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_101.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_101.c index 3384dda6..5b28c369 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_101.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_101.c @@ -52,14 +52,12 @@ static UINT32 Testcase(VOID) ret = LOS_QueueWrite(queueID, &buff1, 8, 0); // 8, Write the setting size of queue buffer. ICUNIT_GOTO_EQUAL(ret, LOS_OK, ret, EXIT); - ret = memset_s(buff2, QUEUE_SHORT_BUFFER_LENGTH, 0, QUEUE_SHORT_BUFFER_LENGTH); - ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT); + memset(buff2, 0, QUEUE_SHORT_BUFFER_LENGTH); readSize = sizeof(buff1); ret = LOS_QueueReadCopy(queueID, NULL, &readSize, 0); ICUNIT_GOTO_EQUAL(ret, LOS_ERRNO_QUEUE_READ_PTR_NULL, ret, EXIT); - ret = memset_s(buff2, QUEUE_SHORT_BUFFER_LENGTH, 0, QUEUE_SHORT_BUFFER_LENGTH); - ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT); + memset(buff2, 0, QUEUE_SHORT_BUFFER_LENGTH); readSize = sizeof(buff1); ret = LOS_QueueReadCopy(queueID, &buff2, &readSize, 0); ICUNIT_GOTO_EQUAL(ret, LOS_OK, ret, EXIT); diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_102.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_102.c similarity index 90% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_102.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_102.c index 7c793f84..65fb6c17 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_102.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_102.c @@ -52,8 +52,7 @@ static UINT32 Testcase(VOID) ret = LOS_QueueWrite(queueID, &buff1, 8, 0); // 8, Write the setting size of queue buffer. ICUNIT_GOTO_EQUAL(ret, LOS_OK, ret, EXIT); - ret = memset_s(buff2, QUEUE_SHORT_BUFFER_LENGTH, 0, QUEUE_SHORT_BUFFER_LENGTH); - ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT); + memset(buff2, 0, QUEUE_SHORT_BUFFER_LENGTH); readSize = sizeof(buff1); ret = LOS_QueueReadCopy(queueID, &buff2, &readSize, 0xffffffff); ICUNIT_GOTO_EQUAL(ret, LOS_OK, ret, EXIT); @@ -61,8 +60,7 @@ static UINT32 Testcase(VOID) ret = LOS_QueueWrite(queueID, &buff1, 8, 0); // 8, Write the setting size of queue buffer. ICUNIT_GOTO_EQUAL(ret, LOS_OK, ret, EXIT); - ret = memset_s(buff2, QUEUE_SHORT_BUFFER_LENGTH, 0, QUEUE_SHORT_BUFFER_LENGTH); - ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT); + memset(buff2, 0, QUEUE_SHORT_BUFFER_LENGTH); readSize = sizeof(buff1); ret = LOS_QueueReadCopy(queueID, &buff2, &readSize, 0xffffffff + 1); ICUNIT_GOTO_EQUAL(ret, LOS_OK, ret, EXIT); @@ -70,8 +68,7 @@ static UINT32 Testcase(VOID) ret = LOS_QueueWrite(queueID, &buff1, 8, 0); // 8, Write the setting size of queue buffer. ICUNIT_GOTO_EQUAL(ret, LOS_OK, ret, EXIT); - ret = memset_s(buff2, QUEUE_SHORT_BUFFER_LENGTH, 0, QUEUE_SHORT_BUFFER_LENGTH); - ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT); + memset(buff2, 0, QUEUE_SHORT_BUFFER_LENGTH); readSize = sizeof(buff1); ret = LOS_QueueReadCopy(queueID, &buff2, &readSize, 0xffffffff - 1); ICUNIT_GOTO_EQUAL(ret, LOS_OK, ret, EXIT); diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_103.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_103.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_103.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_103.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_104.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_104.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_104.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_104.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_106.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_106.c similarity index 92% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_106.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_106.c index 896d059f..5e40b98b 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_106.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_106.c @@ -51,16 +51,14 @@ static UINT32 Testcase(VOID) ret = LOS_QueueWriteCopy(queueID, NULL, QUEUE_SHORT_BUFFER_LENGTH, 0); ICUNIT_GOTO_EQUAL(ret, LOS_ERRNO_QUEUE_WRITE_PTR_NULL, ret, EXIT); - ret = memset_s(buff2, QUEUE_SHORT_BUFFER_LENGTH, 0, QUEUE_SHORT_BUFFER_LENGTH); - ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT); + memset(buff2, 0, QUEUE_SHORT_BUFFER_LENGTH); ret = LOS_QueueRead(queueID, &buff2, QUEUE_SHORT_BUFFER_LENGTH, 0); ICUNIT_GOTO_EQUAL(ret, LOS_ERRNO_QUEUE_ISEMPTY, ret, EXIT); ret = LOS_QueueWriteCopy(queueID, &buff1, QUEUE_SHORT_BUFFER_LENGTH, 0); ICUNIT_GOTO_EQUAL(ret, LOS_OK, ret, EXIT); - ret = memset_s(buff2, QUEUE_SHORT_BUFFER_LENGTH, 0, QUEUE_SHORT_BUFFER_LENGTH); - ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT); + memset(buff2, 0, QUEUE_SHORT_BUFFER_LENGTH); ret = LOS_QueueRead(queueID, &buff2, QUEUE_SHORT_BUFFER_LENGTH, 0); ICUNIT_GOTO_EQUAL(ret, LOS_OK, ret, EXIT); diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_107.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_107.c similarity index 89% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_107.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_107.c index a29dbdc5..b8a24b94 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_107.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_107.c @@ -51,24 +51,21 @@ static UINT32 Testcase(VOID) ret = LOS_QueueWriteCopy(queueID, &buff1, QUEUE_SHORT_BUFFER_LENGTH, 0xffffffff); ICUNIT_GOTO_EQUAL(ret, LOS_OK, ret, EXIT); - ret = memset_s(buff2, QUEUE_SHORT_BUFFER_LENGTH, 0, QUEUE_SHORT_BUFFER_LENGTH); - ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT); + memset(buff2, 0, QUEUE_SHORT_BUFFER_LENGTH); ret = LOS_QueueRead(queueID, &buff2, QUEUE_SHORT_BUFFER_LENGTH, 0); ICUNIT_GOTO_EQUAL(ret, LOS_OK, ret, EXIT); ret = LOS_QueueWriteCopy(queueID, &buff1, QUEUE_SHORT_BUFFER_LENGTH, 0xffffffff + 1); ICUNIT_GOTO_EQUAL(ret, LOS_OK, ret, EXIT); - ret = memset_s(buff2, QUEUE_SHORT_BUFFER_LENGTH, 0, QUEUE_SHORT_BUFFER_LENGTH); - ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT); + memset(buff2, 0, QUEUE_SHORT_BUFFER_LENGTH); ret = LOS_QueueRead(queueID, &buff2, QUEUE_SHORT_BUFFER_LENGTH, 0); ICUNIT_GOTO_EQUAL(ret, LOS_OK, ret, EXIT); ret = LOS_QueueWriteCopy(queueID, &buff1, QUEUE_SHORT_BUFFER_LENGTH, 0xffffffff - 1); ICUNIT_GOTO_EQUAL(ret, LOS_OK, ret, EXIT); - ret = memset_s(buff2, QUEUE_SHORT_BUFFER_LENGTH, 0, QUEUE_SHORT_BUFFER_LENGTH); - ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT); + memset(buff2, 0, QUEUE_SHORT_BUFFER_LENGTH); ret = LOS_QueueRead(queueID, &buff2, QUEUE_SHORT_BUFFER_LENGTH, 0); ICUNIT_GOTO_EQUAL(ret, LOS_OK, ret, EXIT); diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_108.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_108.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_108.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_108.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_109.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_109.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_109.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_109.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_110.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_110.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_110.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_110.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_111.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_111.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_111.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_111.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_112.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_112.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_112.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_112.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_113.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_113.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_113.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_113.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_114.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_114.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_114.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_114.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_116.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_116.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_116.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_116.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_003.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_003.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_003.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_003.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_004.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_004.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_004.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_004.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_005.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_005.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_005.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_005.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_006.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_006.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_006.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_006.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_007.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_007.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_007.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_007.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_008.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_008.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_008.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_008.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_009.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_009.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_009.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_009.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_010.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_010.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_010.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_010.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_011.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_011.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_011.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_011.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_012.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_012.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_012.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_012.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_013.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_013.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_013.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_013.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_014.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_014.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_014.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_014.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_015.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_015.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_015.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_015.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_016.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_016.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_016.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_016.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_017.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_017.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_017.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_017.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_018.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_018.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_018.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_018.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_019.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_019.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_019.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_019.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_020.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_020.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_020.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_020.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_021.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_021.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_021.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_021.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_022.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_022.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_022.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_022.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_023.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_023.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_023.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_023.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_024.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_024.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_024.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_024.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_025.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_025.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_025.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_025.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_026.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_026.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_026.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_026.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_027.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_027.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_027.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_027.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_028.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_028.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_028.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_028.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_029.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_029.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_029.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_029.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_030.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_030.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_030.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_030.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_031.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_031.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_031.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_031.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_032.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_032.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_032.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_032.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_038.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_038.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_038.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_038.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_039.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_039.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_039.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_039.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_040.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_040.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_040.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_040.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_041.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_041.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_041.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_041.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_042.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_042.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_042.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/full/It_los_queue_head_042.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/smoke/It_los_queue_001.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/smoke/It_los_queue_001.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/smoke/It_los_queue_001.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/smoke/It_los_queue_001.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/smoke/It_los_queue_097.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/smoke/It_los_queue_097.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/smoke/It_los_queue_097.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/smoke/It_los_queue_097.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/smoke/It_los_queue_100.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/smoke/It_los_queue_100.c similarity index 87% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/smoke/It_los_queue_100.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/smoke/It_los_queue_100.c index 5820be16..4d0290c3 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/smoke/It_los_queue_100.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/smoke/It_los_queue_100.c @@ -51,8 +51,7 @@ static UINT32 Testcase(VOID) ret = LOS_QueueWrite(queueID, &buff1, 8, 0); // 8, Write the setting size of queue buffer. ICUNIT_GOTO_EQUAL(ret, LOS_OK, ret, EXIT); - ret = memset_s(buff2, QUEUE_SHORT_BUFFER_LENGTH, 0, QUEUE_SHORT_BUFFER_LENGTH); - ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT); + memset(buff2, 0, QUEUE_SHORT_BUFFER_LENGTH); readSize = sizeof(buff1); ret = LOS_QueueReadCopy(queueID, &buff2, &readSize, 0); ICUNIT_GOTO_EQUAL(ret, LOS_OK, ret, EXIT); @@ -60,8 +59,7 @@ static UINT32 Testcase(VOID) ret = LOS_QueueWrite(queueID, &buff1, 8, 0); // 8, Write the setting size of queue buffer. ICUNIT_GOTO_EQUAL(ret, LOS_OK, ret, EXIT); - ret = memset_s(buff2, QUEUE_SHORT_BUFFER_LENGTH, 0, QUEUE_SHORT_BUFFER_LENGTH); - ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT); + memset(buff2, 0, QUEUE_SHORT_BUFFER_LENGTH); readSize = sizeof(buff1) + 1; ret = LOS_QueueReadCopy(queueID, &buff2, &readSize, 0); ICUNIT_GOTO_EQUAL(ret, LOS_OK, ret, EXIT); @@ -69,8 +67,7 @@ static UINT32 Testcase(VOID) ret = LOS_QueueWrite(queueID, &buff1, 8, 0); // 8, Write the setting size of queue buffer. ICUNIT_GOTO_EQUAL(ret, LOS_OK, ret, EXIT); - ret = memset_s(buff2, QUEUE_SHORT_BUFFER_LENGTH, 0, QUEUE_SHORT_BUFFER_LENGTH); - ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT); + memset(buff2, 0, QUEUE_SHORT_BUFFER_LENGTH); readSize = sizeof(buff1); ret = LOS_QueueReadCopy(queueID, &buff2, &readSize, 0); ICUNIT_GOTO_EQUAL(ret, LOS_OK, ret, EXIT); @@ -78,8 +75,7 @@ static UINT32 Testcase(VOID) ret = LOS_QueueWrite(queueID, &buff1, 8, 0); // 8, Write the setting size of queue buffer. ICUNIT_GOTO_EQUAL(ret, LOS_OK, ret, EXIT); - ret = memset_s(buff2, QUEUE_SHORT_BUFFER_LENGTH, 0, QUEUE_SHORT_BUFFER_LENGTH); - ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT); + memset(buff2, 0, QUEUE_SHORT_BUFFER_LENGTH); readSize = 0; ret = LOS_QueueReadCopy(queueID, &buff2, &readSize, 0); ICUNIT_GOTO_EQUAL(ret, LOS_ERRNO_QUEUE_READSIZE_IS_INVALID, ret, EXIT); diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/smoke/It_los_queue_105.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/smoke/It_los_queue_105.c similarity index 85% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/smoke/It_los_queue_105.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/smoke/It_los_queue_105.c index 9f93ff78..a7a975eb 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/smoke/It_los_queue_105.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/smoke/It_los_queue_105.c @@ -52,37 +52,32 @@ static UINT32 Testcase(VOID) ret = LOS_QueueWriteCopy(queueID, &buff1, QUEUE_SHORT_BUFFER_LENGTH, 0); ICUNIT_GOTO_EQUAL(ret, LOS_OK, ret, EXIT); - ret = memset_s(buff2, QUEUE_SHORT_BUFFER_LENGTH, 0, QUEUE_SHORT_BUFFER_LENGTH); - ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT); + memset(buff2, 0, QUEUE_SHORT_BUFFER_LENGTH); ret = LOS_QueueRead(queueID, &buff2, QUEUE_SHORT_BUFFER_LENGTH, 0); ICUNIT_GOTO_EQUAL(ret, LOS_OK, ret, EXIT); ret = LOS_QueueWriteCopy(queueID, &buff1, QUEUE_SHORT_BUFFER_LENGTH + PER_ADDED_VALUE, 0); ICUNIT_GOTO_EQUAL(ret, LOS_ERRNO_QUEUE_WRITE_SIZE_TOO_BIG, ret, EXIT); - ret = memset_s(buff2, QUEUE_SHORT_BUFFER_LENGTH, 0, QUEUE_SHORT_BUFFER_LENGTH); - ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT); + memset(buff2, 0, QUEUE_SHORT_BUFFER_LENGTH); ret = LOS_QueueRead(queueID, &buff2, QUEUE_SHORT_BUFFER_LENGTH, 0); ICUNIT_GOTO_EQUAL(ret, LOS_ERRNO_QUEUE_ISEMPTY, ret, EXIT); ret = LOS_QueueWrite(queueID, &buff1, QUEUE_SHORT_BUFFER_LENGTH - 1, 0); ICUNIT_GOTO_EQUAL(ret, LOS_OK, ret, EXIT); - ret = memset_s(buff2, QUEUE_SHORT_BUFFER_LENGTH, 0, QUEUE_SHORT_BUFFER_LENGTH); - ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT); + memset(buff2, 0, QUEUE_SHORT_BUFFER_LENGTH); ret = LOS_QueueRead(queueID, &buff2, QUEUE_SHORT_BUFFER_LENGTH, 0); ICUNIT_GOTO_EQUAL(ret, LOS_OK, ret, EXIT); - ret = memset_s(buff2, QUEUE_SHORT_BUFFER_LENGTH, 0, QUEUE_SHORT_BUFFER_LENGTH); - ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT); + memset(buff2, 0, QUEUE_SHORT_BUFFER_LENGTH); ret = LOS_QueueRead(queueID, &buff2, QUEUE_SHORT_BUFFER_LENGTH, 0); ICUNIT_GOTO_EQUAL(ret, LOS_ERRNO_QUEUE_ISEMPTY, ret, EXIT); ret = LOS_QueueWrite(queueID, &buff1, 0, 0); ICUNIT_GOTO_EQUAL(ret, LOS_OK, ret, EXIT); - ret = memset_s(buff2, QUEUE_SHORT_BUFFER_LENGTH, 0, QUEUE_SHORT_BUFFER_LENGTH); - ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT); + memset(buff2, 0, QUEUE_SHORT_BUFFER_LENGTH); readSize = 0; ret = LOS_QueueReadCopy(queueID, &buff2, &readSize, 0); ICUNIT_GOTO_EQUAL(ret, LOS_ERRNO_QUEUE_READSIZE_IS_INVALID, ret, EXIT); diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/smoke/It_los_queue_head_002.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/smoke/It_los_queue_head_002.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/smoke/It_los_queue_head_002.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/smoke/It_los_queue_head_002.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_001.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_001.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_001.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_001.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_002.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_002.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_002.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_002.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_003.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_003.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_003.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_003.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_004.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_004.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_004.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_004.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_005.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_005.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_005.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_005.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_006.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_006.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_006.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_006.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_007.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_007.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_007.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_007.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_008.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_008.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_008.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_008.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_009.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_009.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_009.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_009.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_010.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_010.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_010.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_010.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_011.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_011.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_011.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_011.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_012.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_012.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_012.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_012.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_013.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_013.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_013.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_013.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_014.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_014.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_014.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_014.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_015.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_015.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_015.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_015.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_016.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_016.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_016.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_016.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_017.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_017.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_017.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_017.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_018.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_018.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_018.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_018.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_019.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_019.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_019.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_019.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_020.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_020.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_020.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_020.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_021.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_021.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_021.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_021.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_022.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_022.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_022.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_022.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_023.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_023.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_023.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_023.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_024.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_024.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_024.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_024.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_025.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_025.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_025.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_025.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_026.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_026.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_026.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_026.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_027.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_027.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_027.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_027.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_029.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_029.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_029.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_029.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_031.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_031.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_031.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_031.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_032.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_032.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_032.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/queue/smp/It_smp_los_queue_032.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/It_los_sem.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/It_los_sem.c similarity index 98% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/It_los_sem.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/It_los_sem.c index 1c28e50c..08468c7d 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/It_los_sem.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/It_los_sem.c @@ -115,7 +115,7 @@ VOID ItSuiteLosSem(void) ItLosSem037(); ItLosSem038(); #ifndef LOSCFG_KERNEL_SMP_TASK_SYNC - // LOSCFG_KERNEL_SMP_TASK_SYNC is opened ,create task success is depend on created semaphore succeeded; + // LOSCFG_KERNEL_SMP_TASK_SYNC is opened ,create task success is depend on created semaphore successed; ItLosSem039(); ItLosSem040(); ItLosSem041(); diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/It_los_sem.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/It_los_sem.h similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/It_los_sem.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/It_los_sem.h diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/full/It_los_sem_002.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/full/It_los_sem_002.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/full/It_los_sem_002.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/full/It_los_sem_002.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/full/It_los_sem_005.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/full/It_los_sem_005.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/full/It_los_sem_005.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/full/It_los_sem_005.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/full/It_los_sem_009.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/full/It_los_sem_009.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/full/It_los_sem_009.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/full/It_los_sem_009.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/full/It_los_sem_012.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/full/It_los_sem_012.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/full/It_los_sem_012.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/full/It_los_sem_012.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/full/It_los_sem_013.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/full/It_los_sem_013.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/full/It_los_sem_013.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/full/It_los_sem_013.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/full/It_los_sem_014.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/full/It_los_sem_014.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/full/It_los_sem_014.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/full/It_los_sem_014.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/full/It_los_sem_015.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/full/It_los_sem_015.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/full/It_los_sem_015.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/full/It_los_sem_015.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/full/It_los_sem_016.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/full/It_los_sem_016.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/full/It_los_sem_016.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/full/It_los_sem_016.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/full/It_los_sem_017.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/full/It_los_sem_017.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/full/It_los_sem_017.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/full/It_los_sem_017.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/full/It_los_sem_019.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/full/It_los_sem_019.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/full/It_los_sem_019.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/full/It_los_sem_019.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/full/It_los_sem_020.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/full/It_los_sem_020.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/full/It_los_sem_020.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/full/It_los_sem_020.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/full/It_los_sem_022.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/full/It_los_sem_022.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/full/It_los_sem_022.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/full/It_los_sem_022.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/full/It_los_sem_023.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/full/It_los_sem_023.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/full/It_los_sem_023.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/full/It_los_sem_023.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/full/It_los_sem_026.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/full/It_los_sem_026.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/full/It_los_sem_026.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/full/It_los_sem_026.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/full/It_los_sem_027.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/full/It_los_sem_027.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/full/It_los_sem_027.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/full/It_los_sem_027.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/full/It_los_sem_028.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/full/It_los_sem_028.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/full/It_los_sem_028.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/full/It_los_sem_028.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/full/It_los_sem_029.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/full/It_los_sem_029.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/full/It_los_sem_029.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/full/It_los_sem_029.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/full/It_los_sem_034.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/full/It_los_sem_034.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/full/It_los_sem_034.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/full/It_los_sem_034.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/smoke/It_los_sem_001.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/smoke/It_los_sem_001.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/smoke/It_los_sem_001.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/smoke/It_los_sem_001.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/smoke/It_los_sem_003.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/smoke/It_los_sem_003.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/smoke/It_los_sem_003.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/smoke/It_los_sem_003.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/smoke/It_los_sem_006.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/smoke/It_los_sem_006.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/smoke/It_los_sem_006.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/smoke/It_los_sem_006.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_001.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_001.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_001.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_001.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_002.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_002.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_002.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_002.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_003.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_003.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_003.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_003.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_004.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_004.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_004.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_004.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_005.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_005.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_005.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_005.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_006.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_006.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_006.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_006.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_007.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_007.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_007.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_007.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_008.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_008.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_008.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_008.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_009.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_009.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_009.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_009.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_010.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_010.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_010.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_010.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_011.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_011.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_011.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_011.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_012.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_012.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_012.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_012.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_013.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_013.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_013.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_013.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_014.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_014.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_014.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_014.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_015.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_015.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_015.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_015.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_016.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_016.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_016.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_016.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_017.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_017.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_017.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_017.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_018.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_018.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_018.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_018.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_019.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_019.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_019.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_019.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_020.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_020.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_020.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_020.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_021.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_021.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_021.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_021.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_022.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_022.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_022.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_022.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_023.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_023.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_023.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_023.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_024.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_024.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_024.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_024.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_025.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_025.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_025.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_025.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_026.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_026.c similarity index 99% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_026.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_026.c index 5b530340..76c8490c 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_026.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_026.c @@ -104,9 +104,9 @@ static UINT32 Testcase(VOID) TestAssertBusyTaskDelay(100, 3); // 100, Set the timeout of runtime; 3, test running count ICUNIT_GOTO_EQUAL(g_testCount, 3, g_testCount, EXIT); // 3, Here, assert that g_testCount is equal to - if ((g_ret1 + g_ret2 == 0xff) && (TestAbs(g_ret1, g_ret2) == 0xff)) { + if ((g_ret1 + g_ret2 == 0xff) && (TestAbs(g_ret1, g_ret2) == 0xff)) ICUNIT_GOTO_EQUAL(1, 1, g_ret1, EXIT); - } else { + else { ICUNIT_GOTO_EQUAL(1, 0, g_ret1, EXIT); } PRINT_DEBUG("ret1=0x%x,ret2=0x%x\n", g_ret1, g_ret2); diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_027.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_027.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_027.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_027.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_028.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_028.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_028.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_028.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_029.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_029.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_029.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_029.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_030.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_030.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_030.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_030.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_031.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_031.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_031.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_031.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_032.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_032.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_032.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_032.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_033.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_033.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_033.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_033.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_034.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_034.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_034.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_034.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_035.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_035.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_035.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_035.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_036.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_036.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_036.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_base/ipc/sem/smp/It_smp_los_sem_036.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_extend/cpup/BUILD.gn b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_extend/cpup/BUILD.gn similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_extend/cpup/BUILD.gn rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_extend/cpup/BUILD.gn diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_extend/cpup/It_extend_cpup.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_extend/cpup/It_extend_cpup.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_extend/cpup/It_extend_cpup.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_extend/cpup/It_extend_cpup.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_extend/cpup/It_extend_cpup.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_extend/cpup/It_extend_cpup.h similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_extend/cpup/It_extend_cpup.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_extend/cpup/It_extend_cpup.h diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_extend/cpup/Makefile b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_extend/cpup/Makefile similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_extend/cpup/Makefile rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_extend/cpup/Makefile diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_extend/cpup/full/It_extend_cpup_003.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_extend/cpup/full/It_extend_cpup_003.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_extend/cpup/full/It_extend_cpup_003.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_extend/cpup/full/It_extend_cpup_003.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_extend/cpup/full/It_extend_cpup_004.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_extend/cpup/full/It_extend_cpup_004.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_extend/cpup/full/It_extend_cpup_004.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_extend/cpup/full/It_extend_cpup_004.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_extend/cpup/full/It_extend_cpup_005.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_extend/cpup/full/It_extend_cpup_005.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_extend/cpup/full/It_extend_cpup_005.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_extend/cpup/full/It_extend_cpup_005.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_extend/cpup/full/It_extend_cpup_006.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_extend/cpup/full/It_extend_cpup_006.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_extend/cpup/full/It_extend_cpup_006.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_extend/cpup/full/It_extend_cpup_006.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_extend/cpup/full/It_extend_cpup_007.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_extend/cpup/full/It_extend_cpup_007.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_extend/cpup/full/It_extend_cpup_007.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_extend/cpup/full/It_extend_cpup_007.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_extend/cpup/full/It_extend_cpup_008.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_extend/cpup/full/It_extend_cpup_008.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_extend/cpup/full/It_extend_cpup_008.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_extend/cpup/full/It_extend_cpup_008.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_extend/cpup/full/It_extend_cpup_011.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_extend/cpup/full/It_extend_cpup_011.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_extend/cpup/full/It_extend_cpup_011.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_extend/cpup/full/It_extend_cpup_011.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_extend/cpup/full/It_extend_cpup_012.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_extend/cpup/full/It_extend_cpup_012.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_extend/cpup/full/It_extend_cpup_012.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_extend/cpup/full/It_extend_cpup_012.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_extend/cpup/smoke/It_extend_cpup_001.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_extend/cpup/smoke/It_extend_cpup_001.c similarity index 98% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_extend/cpup/smoke/It_extend_cpup_001.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_extend/cpup/smoke/It_extend_cpup_001.c index 05f58667..41589d15 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_extend/cpup/smoke/It_extend_cpup_001.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_extend/cpup/smoke/It_extend_cpup_001.c @@ -39,9 +39,8 @@ extern "C" { static UINT32 TaskF02(VOID) { - UINT32 ret = OS_ERROR, cpupUse; + UINT32 ret, cpupUse; g_cpupTestCount++; - // 2, Here, assert that g_cpupTestCount is equal to the expected value. ICUNIT_GOTO_EQUAL(g_cpupTestCount, 2, g_cpupTestCount, EXIT); cpupUse = LOS_HistoryProcessCpuUsage(g_testTaskID01, CPUP_ALL_TIME); diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_extend/cpup/smoke/It_extend_cpup_002.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_extend/cpup/smoke/It_extend_cpup_002.c similarity index 99% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_extend/cpup/smoke/It_extend_cpup_002.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_extend/cpup/smoke/It_extend_cpup_002.c index 6e399ce3..1096be00 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_extend/cpup/smoke/It_extend_cpup_002.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_extend/cpup/smoke/It_extend_cpup_002.c @@ -39,10 +39,9 @@ extern "C" { static UINT32 TaskF01(VOID) { - UINT32 ret = OS_ERROR; + UINT32 ret; UINT32 cpupUse; g_cpupTestCount++; - ICUNIT_GOTO_EQUAL(g_cpupTestCount, 1, g_cpupTestCount, EXIT); cpupUse = LOS_HistoryProcessCpuUsage(LOS_GetCurrProcessID(), CPU_USE_MODE0); diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_001.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_001.c similarity index 95% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_001.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_001.c index 9832354c..5efd147e 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_001.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_001.c @@ -71,8 +71,7 @@ static UINT32 Testcase(VOID) TSK_INIT_PARAM_S taskInitParam; UINT32 ret; - ret = memset_s((void *)(&taskInitParam), sizeof(TSK_INIT_PARAM_S), 0, sizeof(TSK_INIT_PARAM_S)); - ICUNIT_ASSERT_EQUAL(ret, 0, ret); + (VOID)memset_s((void *)(&taskInitParam), sizeof(TSK_INIT_PARAM_S), 0, sizeof(TSK_INIT_PARAM_S)); taskInitParam.pfnTaskEntry = (TSK_ENTRY_FUNC)Task01; taskInitParam.uwStackSize = LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE; taskInitParam.pcName = "SmpCpup001_task01"; @@ -85,8 +84,7 @@ static UINT32 Testcase(VOID) ret = LOS_TaskCreate(&g_testSmpCpupTaskID01, &taskInitParam); ICUNIT_GOTO_EQUAL(ret, LOS_OK, ret, EXIT); - ret = memset_s((void *)(&taskInitParam), sizeof(TSK_INIT_PARAM_S), 0, sizeof(TSK_INIT_PARAM_S)); - ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT); + (VOID)memset_s((void *)(&taskInitParam), sizeof(TSK_INIT_PARAM_S), 0, sizeof(TSK_INIT_PARAM_S)); taskInitParam.pfnTaskEntry = (TSK_ENTRY_FUNC)Task02; taskInitParam.uwStackSize = LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE; taskInitParam.pcName = "SmpCpup001_task02"; diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_002.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_002.c similarity index 96% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_002.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_002.c index 51796a90..be0802cc 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_002.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_002.c @@ -63,8 +63,7 @@ static UINT32 Testcase(VOID) TSK_INIT_PARAM_S taskInitParam; UINT32 ret; - ret = memset_s((void *)(&taskInitParam), sizeof(TSK_INIT_PARAM_S), 0, sizeof(TSK_INIT_PARAM_S)); - ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT); + (VOID)memset_s((void *)(&taskInitParam), sizeof(TSK_INIT_PARAM_S), 0, sizeof(TSK_INIT_PARAM_S)); taskInitParam.pfnTaskEntry = (TSK_ENTRY_FUNC)Task01; taskInitParam.uwStackSize = LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE; taskInitParam.pcName = "SmpCpup002_task01"; diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_003.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_003.c similarity index 96% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_003.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_003.c index 5f5f4827..c3649397 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_003.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_003.c @@ -94,8 +94,7 @@ static UINT32 Testcase(VOID) TSK_INIT_PARAM_S taskInitParam; UINT32 ret; - ret = memset_s((void *)(&taskInitParam), sizeof(TSK_INIT_PARAM_S), 0, sizeof(TSK_INIT_PARAM_S)); - ICUNIT_ASSERT_EQUAL(ret, 0, ret); + (VOID)memset_s((void *)(&taskInitParam), sizeof(TSK_INIT_PARAM_S), 0, sizeof(TSK_INIT_PARAM_S)); taskInitParam.pfnTaskEntry = (TSK_ENTRY_FUNC)Task01; taskInitParam.uwStackSize = LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE; taskInitParam.pcName = "SmpCpup003_task01"; @@ -108,8 +107,7 @@ static UINT32 Testcase(VOID) ret = LOS_TaskCreate(&g_testSmpCpupTaskID01, &taskInitParam); ICUNIT_GOTO_EQUAL(ret, LOS_OK, ret, EXIT); - ret = memset_s((void *)(&taskInitParam), sizeof(TSK_INIT_PARAM_S), 0, sizeof(TSK_INIT_PARAM_S)); - ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT); + (VOID)memset_s((void *)(&taskInitParam), sizeof(TSK_INIT_PARAM_S), 0, sizeof(TSK_INIT_PARAM_S)); taskInitParam.pfnTaskEntry = (TSK_ENTRY_FUNC)Task02; taskInitParam.uwStackSize = LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE; taskInitParam.pcName = "SmpCpup003_task02"; diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_004.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_004.c similarity index 96% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_004.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_004.c index 1dddcf6d..853a0643 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_004.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_004.c @@ -114,8 +114,7 @@ static UINT32 Testcase(VOID) TSK_INIT_PARAM_S taskInitParam; UINT32 ret; - ret = memset_s((void *)(&taskInitParam), sizeof(TSK_INIT_PARAM_S), 0, sizeof(TSK_INIT_PARAM_S)); - ICUNIT_ASSERT_EQUAL(ret, 0, ret); + (VOID)memset_s((void *)(&taskInitParam), sizeof(TSK_INIT_PARAM_S), 0, sizeof(TSK_INIT_PARAM_S)); taskInitParam.pfnTaskEntry = (TSK_ENTRY_FUNC)Task01; taskInitParam.uwStackSize = LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE; taskInitParam.pcName = "SmpCpup004_task01"; @@ -128,8 +127,7 @@ static UINT32 Testcase(VOID) ret = LOS_TaskCreate(&g_testSmpCpupTaskID01, &taskInitParam); ICUNIT_GOTO_EQUAL(ret, LOS_OK, ret, EXIT); - ret = memset_s((void *)(&taskInitParam), sizeof(TSK_INIT_PARAM_S), 0, sizeof(TSK_INIT_PARAM_S)); - ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT); + (VOID)memset_s((void *)(&taskInitParam), sizeof(TSK_INIT_PARAM_S), 0, sizeof(TSK_INIT_PARAM_S)); taskInitParam.pfnTaskEntry = (TSK_ENTRY_FUNC)Task02; taskInitParam.uwStackSize = LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE; taskInitParam.pcName = "SmpCpup004_task02"; diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_005.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_005.c similarity index 94% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_005.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_005.c index 13aad806..72d12677 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_005.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_005.c @@ -63,8 +63,7 @@ static void Task01(void) TSK_INIT_PARAM_S taskInitParam; UINT32 ret; - ret = memset_s((void *)(&taskInitParam), sizeof(TSK_INIT_PARAM_S), 0, sizeof(TSK_INIT_PARAM_S)); - ICUNIT_ASSERT_EQUAL(ret, 0, ret); + (VOID)memset_s((void *)(&taskInitParam), sizeof(TSK_INIT_PARAM_S), 0, sizeof(TSK_INIT_PARAM_S)); taskInitParam.pfnTaskEntry = (TSK_ENTRY_FUNC)Task03; taskInitParam.uwStackSize = LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE; taskInitParam.pcName = "SmpCpup005_task03"; @@ -75,8 +74,7 @@ static void Task01(void) ret = LOS_TaskCreate(&g_testSmpCpupTaskID03, &taskInitParam); ICUNIT_GOTO_EQUAL(ret, LOS_OK, ret, EXIT2); - ret = memset_s((void *)(&taskInitParam), sizeof(TSK_INIT_PARAM_S), 0, sizeof(TSK_INIT_PARAM_S)); - ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT2); + (VOID)memset_s((void *)(&taskInitParam), sizeof(TSK_INIT_PARAM_S), 0, sizeof(TSK_INIT_PARAM_S)); taskInitParam.pfnTaskEntry = (TSK_ENTRY_FUNC)Task04; taskInitParam.uwStackSize = LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE; taskInitParam.pcName = "SmpCpup005_task04"; @@ -139,8 +137,7 @@ static UINT32 Testcase(VOID) TSK_INIT_PARAM_S taskInitParam; UINT32 ret; - ret = memset_s((void *)(&taskInitParam), sizeof(TSK_INIT_PARAM_S), 0, sizeof(TSK_INIT_PARAM_S)); - ICUNIT_ASSERT_EQUAL(ret, 0, ret); + (VOID)memset_s((void *)(&taskInitParam), sizeof(TSK_INIT_PARAM_S), 0, sizeof(TSK_INIT_PARAM_S)); taskInitParam.pfnTaskEntry = (TSK_ENTRY_FUNC)Task01; taskInitParam.uwStackSize = LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE; taskInitParam.pcName = "SmpCpup005_task01"; @@ -153,8 +150,7 @@ static UINT32 Testcase(VOID) ret = LOS_TaskCreate(&g_testSmpCpupTaskID01, &taskInitParam); ICUNIT_GOTO_EQUAL(ret, LOS_OK, ret, EXIT); - ret = memset_s((void *)(&taskInitParam), sizeof(TSK_INIT_PARAM_S), 0, sizeof(TSK_INIT_PARAM_S)); - ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT); + (VOID)memset_s((void *)(&taskInitParam), sizeof(TSK_INIT_PARAM_S), 0, sizeof(TSK_INIT_PARAM_S)); taskInitParam.pfnTaskEntry = (TSK_ENTRY_FUNC)Task02; taskInitParam.uwStackSize = LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE; taskInitParam.pcName = "SmpCpup005_task02"; diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_007.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_007.c similarity index 95% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_007.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_007.c index 8780fd7e..4b401738 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_007.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_007.c @@ -67,8 +67,7 @@ static UINT32 Testcase(VOID) TSK_INIT_PARAM_S taskInitParam; UINT32 ret; - ret = memset_s((void *)(&taskInitParam), sizeof(TSK_INIT_PARAM_S), 0, sizeof(TSK_INIT_PARAM_S)); - ICUNIT_ASSERT_EQUAL(ret, 0, ret); + (VOID)memset_s((void *)(&taskInitParam), sizeof(TSK_INIT_PARAM_S), 0, sizeof(TSK_INIT_PARAM_S)); taskInitParam.pfnTaskEntry = (TSK_ENTRY_FUNC)Task01; taskInitParam.uwStackSize = LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE; taskInitParam.pcName = "SmpCpup007_task01"; @@ -82,8 +81,7 @@ static UINT32 Testcase(VOID) ret = LOS_TaskCreate(&g_testSmpCpupTaskID01, &taskInitParam); ICUNIT_GOTO_EQUAL(ret, LOS_OK, ret, EXIT); - ret = memset_s((void *)(&taskInitParam), sizeof(TSK_INIT_PARAM_S), 0, sizeof(TSK_INIT_PARAM_S)); - ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT); + (VOID)memset_s((void *)(&taskInitParam), sizeof(TSK_INIT_PARAM_S), 0, sizeof(TSK_INIT_PARAM_S)); taskInitParam.pfnTaskEntry = (TSK_ENTRY_FUNC)Task02; taskInitParam.uwStackSize = LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE; taskInitParam.pcName = "SmpCpup007_task02"; diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_008.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_008.c similarity index 95% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_008.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_008.c index 6d0d34fc..3a961ac9 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_008.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_008.c @@ -67,8 +67,7 @@ static UINT32 Testcase(VOID) TSK_INIT_PARAM_S taskInitParam; UINT32 ret; - ret = memset_s((void *)(&taskInitParam), sizeof(TSK_INIT_PARAM_S), 0, sizeof(TSK_INIT_PARAM_S)); - ICUNIT_ASSERT_EQUAL(ret, 0, ret); + (VOID)memset_s((void *)(&taskInitParam), sizeof(TSK_INIT_PARAM_S), 0, sizeof(TSK_INIT_PARAM_S)); taskInitParam.pfnTaskEntry = (TSK_ENTRY_FUNC)Task01; taskInitParam.uwStackSize = LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE; taskInitParam.pcName = "SmpCpup008_task01"; @@ -81,8 +80,7 @@ static UINT32 Testcase(VOID) ret = LOS_TaskCreate(&g_testSmpCpupTaskID01, &taskInitParam); ICUNIT_GOTO_EQUAL(ret, LOS_OK, ret, EXIT); - ret = memset_s((void *)(&taskInitParam), sizeof(TSK_INIT_PARAM_S), 0, sizeof(TSK_INIT_PARAM_S)); - ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT); + (VOID)memset_s((void *)(&taskInitParam), sizeof(TSK_INIT_PARAM_S), 0, sizeof(TSK_INIT_PARAM_S)); taskInitParam.pfnTaskEntry = (TSK_ENTRY_FUNC)Task02; taskInitParam.uwStackSize = LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE; taskInitParam.pcName = "SmpCpup008_task02"; diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_009.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_009.c similarity index 94% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_009.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_009.c index 811008dd..034ad59d 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_009.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_009.c @@ -50,8 +50,7 @@ static void Task01(void) TSK_INIT_PARAM_S taskInitParam; UINT32 ret; - ret = memset_s((void *)(&taskInitParam), sizeof(TSK_INIT_PARAM_S), 0, sizeof(TSK_INIT_PARAM_S)); - ICUNIT_ASSERT_EQUAL(ret, 0, ret); + (VOID)memset_s((void *)(&taskInitParam), sizeof(TSK_INIT_PARAM_S), 0, sizeof(TSK_INIT_PARAM_S)); taskInitParam.pfnTaskEntry = (TSK_ENTRY_FUNC)Task03; taskInitParam.uwStackSize = LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE; taskInitParam.pcName = "SmpCpup009_task03"; @@ -91,8 +90,7 @@ static UINT32 Testcase(VOID) TSK_INIT_PARAM_S taskInitParam; UINT32 ret; - ret = memset_s((void *)(&taskInitParam), sizeof(TSK_INIT_PARAM_S), 0, sizeof(TSK_INIT_PARAM_S)); - ICUNIT_ASSERT_EQUAL(ret, 0, ret); + (VOID)memset_s((void *)(&taskInitParam), sizeof(TSK_INIT_PARAM_S), 0, sizeof(TSK_INIT_PARAM_S)); taskInitParam.pfnTaskEntry = (TSK_ENTRY_FUNC)Task01; taskInitParam.uwStackSize = LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE; taskInitParam.pcName = "SmpCpup009_task01"; @@ -106,8 +104,7 @@ static UINT32 Testcase(VOID) ret = LOS_TaskCreate(&g_testSmpCpupTaskID01, &taskInitParam); ICUNIT_GOTO_EQUAL(ret, LOS_OK, ret, EXIT); - ret = memset_s((void *)(&taskInitParam), sizeof(TSK_INIT_PARAM_S), 0, sizeof(TSK_INIT_PARAM_S)); - ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT); + (VOID)memset_s((void *)(&taskInitParam), sizeof(TSK_INIT_PARAM_S), 0, sizeof(TSK_INIT_PARAM_S)); taskInitParam.pfnTaskEntry = (TSK_ENTRY_FUNC)Task02; taskInitParam.uwStackSize = LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE; taskInitParam.pcName = "SmpCpup009_task02"; diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_010.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_010.c similarity index 95% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_010.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_010.c index fdace6ba..3bcbb4b5 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_010.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_010.c @@ -69,8 +69,7 @@ static UINT32 Testcase(VOID) TSK_INIT_PARAM_S taskInitParam; UINT32 ret; - ret = memset_s((void *)(&taskInitParam), sizeof(TSK_INIT_PARAM_S), 0, sizeof(TSK_INIT_PARAM_S)); - ICUNIT_ASSERT_EQUAL(ret, 0, ret); + (VOID)memset_s((void *)(&taskInitParam), sizeof(TSK_INIT_PARAM_S), 0, sizeof(TSK_INIT_PARAM_S)); taskInitParam.pfnTaskEntry = (TSK_ENTRY_FUNC)Task01; taskInitParam.uwStackSize = LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE; taskInitParam.pcName = "SmpCpup001_task01"; @@ -84,8 +83,7 @@ static UINT32 Testcase(VOID) ret = LOS_TaskCreate(&g_testSmpCpupTaskID01, &taskInitParam); ICUNIT_GOTO_EQUAL(ret, LOS_OK, ret, EXIT); - ret = memset_s((void *)(&taskInitParam), sizeof(TSK_INIT_PARAM_S), 0, sizeof(TSK_INIT_PARAM_S)); - ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT); + (VOID)memset_s((void *)(&taskInitParam), sizeof(TSK_INIT_PARAM_S), 0, sizeof(TSK_INIT_PARAM_S)); taskInitParam.pfnTaskEntry = (TSK_ENTRY_FUNC)Task02; taskInitParam.uwStackSize = LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE; taskInitParam.pcName = "SmpCpup001_task02"; diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_011.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_011.c similarity index 95% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_011.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_011.c index 1219733b..a4056e0e 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_011.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_011.c @@ -90,8 +90,7 @@ static UINT32 Testcase(VOID) TSK_INIT_PARAM_S taskInitParam; UINT32 ret; - ret = memset_s((void *)(&taskInitParam), sizeof(TSK_INIT_PARAM_S), 0, sizeof(TSK_INIT_PARAM_S)); - ICUNIT_ASSERT_EQUAL(ret, 0, ret); + (VOID)memset_s((void *)(&taskInitParam), sizeof(TSK_INIT_PARAM_S), 0, sizeof(TSK_INIT_PARAM_S)); taskInitParam.pfnTaskEntry = (TSK_ENTRY_FUNC)Task01; taskInitParam.uwStackSize = LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE; taskInitParam.pcName = "SmpCpup001_task01"; @@ -104,8 +103,7 @@ static UINT32 Testcase(VOID) ret = LOS_TaskCreate(&g_testSmpCpupTaskID01, &taskInitParam); ICUNIT_GOTO_EQUAL(ret, LOS_OK, ret, EXIT); - ret = memset_s((void *)(&taskInitParam), sizeof(TSK_INIT_PARAM_S), 0, sizeof(TSK_INIT_PARAM_S)); - ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT); + (VOID)memset_s((void *)(&taskInitParam), sizeof(TSK_INIT_PARAM_S), 0, sizeof(TSK_INIT_PARAM_S)); taskInitParam.pfnTaskEntry = (TSK_ENTRY_FUNC)Task02; taskInitParam.uwStackSize = LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE; taskInitParam.pcName = "SmpCpup001_task02"; diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_012.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_012.c similarity index 95% rename from src/kernel_liteos_a/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_012.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_012.c index 1b46c878..42206fb7 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_012.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/kernel_extend/cpup/smp/It_smp_extend_cpup_012.c @@ -73,8 +73,7 @@ static UINT32 Testcase(VOID) ret = LOS_EventInit(&g_eventCB); ICUNIT_GOTO_EQUAL(ret, LOS_OK, ret, EXIT0); - ret = memset_s((void *)(&taskInitParam), sizeof(TSK_INIT_PARAM_S), 0, sizeof(TSK_INIT_PARAM_S)); - ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT0); + (VOID)memset_s((void *)(&taskInitParam), sizeof(TSK_INIT_PARAM_S), 0, sizeof(TSK_INIT_PARAM_S)); taskInitParam.pfnTaskEntry = (TSK_ENTRY_FUNC)Task01; taskInitParam.uwStackSize = LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE; taskInitParam.pcName = "SmpCpup001_task01"; @@ -87,8 +86,7 @@ static UINT32 Testcase(VOID) ret = LOS_TaskCreate(&g_testSmpCpupTaskID01, &taskInitParam); ICUNIT_GOTO_EQUAL(ret, LOS_OK, ret, EXIT); - ret = memset_s((void *)(&taskInitParam), sizeof(TSK_INIT_PARAM_S), 0, sizeof(TSK_INIT_PARAM_S)); - ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT1); + (VOID)memset_s((void *)(&taskInitParam), sizeof(TSK_INIT_PARAM_S), 0, sizeof(TSK_INIT_PARAM_S)); taskInitParam.pfnTaskEntry = (TSK_ENTRY_FUNC)Task02; taskInitParam.uwStackSize = LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE; taskInitParam.pcName = "SmpCpup001_task02"; diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/BUILD.gn b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/BUILD.gn similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/BUILD.gn rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/BUILD.gn diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/Makefile b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/Makefile similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/Makefile rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/Makefile diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/It_posix_mutex.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/It_posix_mutex.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/It_posix_mutex.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/It_posix_mutex.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/It_posix_mutex.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/It_posix_mutex.h similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/It_posix_mutex.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/It_posix_mutex.h diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/Makefile b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/Makefile similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/Makefile rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/Makefile diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_002.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_002.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_002.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_002.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_003.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_003.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_003.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_003.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_004.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_004.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_004.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_004.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_005.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_005.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_005.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_005.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_006.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_006.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_006.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_006.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_008.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_008.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_008.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_008.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_009.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_009.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_009.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_009.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_010.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_010.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_010.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_010.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_011.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_011.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_011.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_011.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_013.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_013.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_013.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_013.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_014.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_014.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_014.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_014.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_017.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_017.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_017.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_017.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_018.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_018.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_018.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_018.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_021.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_021.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_021.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_021.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_022.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_022.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_022.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_022.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_023.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_023.c similarity index 97% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_023.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_023.c index 0f0fd335..076fc3f5 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_023.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_023.c @@ -39,7 +39,7 @@ extern "C" { /* pthread_mutex_init 4-1.c * Test that pthread_mutex_init() - * Upon successful completion, it shall return a 0 + * Upon succesful completion, it shall return a 0 * */ static UINT32 Testcase(VOID) diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_024.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_024.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_024.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_024.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_025.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_025.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_025.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_025.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_026.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_026.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_026.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_026.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_027.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_027.c similarity index 96% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_027.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_027.c index 8074cd65..655faa03 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_027.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_027.c @@ -39,7 +39,7 @@ extern "C" { /* pthread_mutex_destroy 3-1.c * Test that pthread_mutex_destroy() - * Upon successful completion, it shall return a 0 + * Upon succesful completion, it shall return a 0 * */ static UINT32 Testcase(VOID) diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_028.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_028.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_028.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_028.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_029.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_029.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_029.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_029.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_032.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_032.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_032.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_032.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_033.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_033.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_033.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_033.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_034.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_034.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_034.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_034.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_035.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_035.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_035.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_035.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_036.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_036.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_036.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_036.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_037.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_037.c similarity index 97% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_037.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_037.c index 1b9e12a7..101b34ae 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_037.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_037.c @@ -43,7 +43,7 @@ extern "C" { * source tree. * Test that pthread_mutex_lock() - * Upon successful completion, it shall return a 0 + * Upon succesful completion, it shall return a 0 * */ static UINT32 Testcase(VOID) diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_038.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_038.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_038.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_038.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_039.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_039.c similarity index 98% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_039.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_039.c index b2289552..563e16a8 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_039.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_039.c @@ -42,7 +42,7 @@ extern "C" { * shall release the mutex object 'mutex'. * Steps: - * -- initialize a mutex object + * -- Initilize a mutex object * -- Get the mutex using pthread_mutex_lock() * -- Release the mutex using pthread_mutex_unlock() * -- Try to get the mutex using pthread_mutex_trylock() diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_040.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_040.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_040.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_040.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_041.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_041.c similarity index 97% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_041.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_041.c index 89318019..ea40a1b3 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_041.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_041.c @@ -39,7 +39,7 @@ extern "C" { /* pthread_mutex_unlock 3-1.c * Test that pthread_mutex_unlock() - * Upon successful completion, it shall return zero + * Upon succesful completion, it shall return zero * */ static UINT32 Testcase(VOID) diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_042.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_042.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_042.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_042.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_043.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_043.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_043.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_043.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_044.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_044.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_044.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_044.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_045.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_045.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_045.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_045.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_046.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_046.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_046.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_046.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_047.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_047.c similarity index 97% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_047.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_047.c index 0b528fe3..a2c6d8fc 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_047.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_047.c @@ -38,7 +38,7 @@ extern "C" { /* pthread_mutex_trylock 3-1.c * Test that pthread_mutex_trylock() - * Upon successful completion, it shall return a 0 + * Upon succesful completion, it shall return a 0 * */ static UINT32 Testcase(VOID) diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_048.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_048.c similarity index 97% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_048.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_048.c index db32c4be..331c0fcb 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_048.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_048.c @@ -43,7 +43,7 @@ extern "C" { * -[EBUSY] The mutex could not be acquired because it was already locked. * Steps: - * -- initialize a mutex object + * -- Initilize a mutex object * -- Lock the mutex using pthread_mutex_lock() * -- Try to lock the mutex using pthread_mutex_trylock() and expect EBUSY * diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_049.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_049.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_049.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_049.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_050.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_050.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_050.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_050.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_054.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_054.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_054.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_054.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_055.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_055.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_055.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_055.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_056.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_056.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_056.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_056.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_057.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_057.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_057.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_057.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_058.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_058.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_058.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_058.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_059.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_059.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_059.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_059.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_060.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_060.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_060.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_060.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_061.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_061.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_061.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_061.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_062.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_062.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_062.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_062.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_063.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_063.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_063.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_063.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_064.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_064.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_064.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_064.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_065.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_065.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_065.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_065.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_066.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_066.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_066.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_066.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_067.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_067.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_067.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_067.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_068.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_068.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_068.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_068.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_069.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_069.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_069.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_069.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_070.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_070.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_070.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_070.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_071.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_071.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_071.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_071.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_072.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_072.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_072.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_072.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_073.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_073.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_073.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_073.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_074.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_074.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_074.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_074.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_075.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_075.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_075.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_075.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_076.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_076.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_076.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_076.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_077.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_077.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_077.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_077.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_078.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_078.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_078.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_078.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_079.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_079.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_079.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_079.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_080.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_080.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_080.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_080.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_081.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_081.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_081.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_081.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_082.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_082.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_082.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_082.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_084.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_084.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_084.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_084.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_085.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_085.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_085.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_085.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_086.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_086.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_086.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_086.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_087.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_087.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_087.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_087.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_089.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_089.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_089.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_089.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_090.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_090.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_090.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_090.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_091.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_091.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_091.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_091.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_092.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_092.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_092.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_092.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_093.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_093.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_093.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_093.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_094.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_094.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_094.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_094.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_095.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_095.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_095.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_095.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_097.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_097.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_097.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_097.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_098.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_098.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_098.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_098.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_099.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_099.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_099.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_099.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_101.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_101.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_101.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/full/It_posix_mutex_101.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/smoke/It_posix_mutex_001.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/smoke/It_posix_mutex_001.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/smoke/It_posix_mutex_001.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/smoke/It_posix_mutex_001.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/smoke/It_posix_mutex_007.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/smoke/It_posix_mutex_007.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/smoke/It_posix_mutex_007.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/smoke/It_posix_mutex_007.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/smoke/It_posix_mutex_012.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/smoke/It_posix_mutex_012.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/smoke/It_posix_mutex_012.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/smoke/It_posix_mutex_012.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/smoke/It_posix_mutex_015.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/smoke/It_posix_mutex_015.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/smoke/It_posix_mutex_015.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/smoke/It_posix_mutex_015.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/smoke/It_posix_mutex_016.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/smoke/It_posix_mutex_016.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/smoke/It_posix_mutex_016.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/smoke/It_posix_mutex_016.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/smoke/It_posix_mutex_019.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/smoke/It_posix_mutex_019.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/smoke/It_posix_mutex_019.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/smoke/It_posix_mutex_019.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/smoke/It_posix_mutex_020.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/smoke/It_posix_mutex_020.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/mutex/smoke/It_posix_mutex_020.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/mutex/smoke/It_posix_mutex_020.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/It_posix_pthread.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/It_posix_pthread.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/It_posix_pthread.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/It_posix_pthread.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/It_posix_pthread.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/It_posix_pthread.h similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/It_posix_pthread.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/It_posix_pthread.h diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/Makefile b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/Makefile similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/Makefile rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/Makefile diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_001.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_001.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_001.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_001.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_002.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_002.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_002.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_002.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_007.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_007.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_007.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_007.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_008.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_008.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_008.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_008.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_010.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_010.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_010.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_010.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_011.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_011.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_011.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_011.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_013.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_013.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_013.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_013.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_023.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_023.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_023.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_023.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_028.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_028.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_028.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_028.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_029.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_029.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_029.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_029.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_030.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_030.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_030.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_030.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_031.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_031.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_031.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_031.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_032.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_032.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_032.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_032.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_033.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_033.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_033.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_033.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_034.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_034.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_034.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_034.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_035.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_035.c similarity index 97% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_035.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_035.c index 2af191f0..08bad1b7 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_035.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_035.c @@ -105,9 +105,8 @@ static UINT32 Testcase(VOID) ret = pthread_create(&newTh3, NULL, PthreadF03, NULL); ICUNIT_ASSERT_EQUAL(ret, 0, ret); - while (g_testCount < 6) { // 6, wait until g_testCount is equal to 6. + while (g_testCount < 6) // 6, wait until g_testCount is equal to 6. sleep(1); - } ICUNIT_ASSERT_EQUAL(g_testCount, 6, g_testCount); // 6, here assert the result. diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_039.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_039.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_039.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_039.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_040.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_040.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_040.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_040.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_041.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_041.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_041.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_041.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_042.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_042.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_042.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_042.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_044.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_044.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_044.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_044.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_045.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_045.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_045.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_045.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_046.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_046.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_046.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_046.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_047.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_047.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_047.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_047.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_048.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_048.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_048.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_048.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_049.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_049.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_049.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_049.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_050.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_050.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_050.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_050.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_051.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_051.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_051.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_051.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_056.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_056.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_056.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_056.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_057.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_057.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_057.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_057.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_058.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_058.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_058.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_058.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_060.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_060.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_060.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_060.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_066.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_066.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_066.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_066.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_068.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_068.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_068.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_068.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_069.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_069.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_069.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_069.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_071.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_071.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_071.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_071.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_072.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_072.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_072.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_072.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_073.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_073.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_073.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_073.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_074.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_074.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_074.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_074.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_075.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_075.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_075.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_075.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_078.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_078.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_078.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_078.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_079.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_079.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_079.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_079.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_080.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_080.c similarity index 98% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_080.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_080.c index eb65ad28..1abd1b91 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_080.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_080.c @@ -75,9 +75,8 @@ static UINT32 Testcase(VOID) ICUNIT_ASSERT_EQUAL(rc, 0, rc); } - while (g_startNum < THREAD_NUM) { + while (g_startNum < THREAD_NUM) usleep(100); // 100, delay for Timing control. - } /* * Acquire the mutex to make sure that all waiters are currently diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_081.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_081.c similarity index 98% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_081.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_081.c index 70163aa3..b7ee988c 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_081.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_081.c @@ -80,9 +80,8 @@ static UINT32 Testcase(VOID) ICUNIT_ASSERT_EQUAL(rc, 0, rc); } - while (g_startNum < THREAD_NUM) { + while (g_startNum < THREAD_NUM) usleep(100); // 100, delay for Timing control. - } /* * Acquire the mutex to make sure that all waiters are currently diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_082.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_082.c similarity index 98% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_082.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_082.c index 65d71060..6a30d571 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_082.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_082.c @@ -87,9 +87,8 @@ static UINT32 Testcase(VOID) ICUNIT_ASSERT_EQUAL(rc, 0, rc); } - while (g_startNum < THREAD_NUM) { + while (g_startNum < THREAD_NUM) usleep(100); // 100, delay for Timing control. - } /* * Acquire the mutex to make sure that all waiters are currently diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_083.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_083.c similarity index 98% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_083.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_083.c index 32aacfb7..4398444a 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_083.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_083.c @@ -76,9 +76,8 @@ static UINT32 Testcase(VOID) ICUNIT_ASSERT_EQUAL(rc, 0, rc); } - while (g_startNum < THREAD_NUM) { + while (g_startNum < THREAD_NUM) usleep(100); // 100, delay for Timing control. - } /* * Acquire the mutex to make sure that all waiters are currently diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_084.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_084.c similarity index 98% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_084.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_084.c index b749f8eb..0f54d298 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_084.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_084.c @@ -79,9 +79,8 @@ static UINT32 Testcase(VOID) ICUNIT_ASSERT_EQUAL(rc, 0, rc); } - while (g_startNum < THREAD_NUM) { + while (g_startNum < THREAD_NUM) usleep(100); // 100, delay for Timing control. - } /* * Acquire the mutex to make sure that all waiters are currently diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_085.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_085.c similarity index 97% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_085.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_085.c index f55e50ff..1e2136f9 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_085.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_085.c @@ -75,9 +75,8 @@ static UINT32 Testcase(VOID) rc = pthread_create(&thread1, NULL, PthreadF01, NULL); ICUNIT_ASSERT_EQUAL(rc, 0, rc); - while (!g_t1Start) { /* wait for thread1 started */ + while (!g_t1Start) /* wait for thread1 started */ usleep(100); // 100, delay for Timing control. - } /* acquire the mutex released by pthread_cond_wait() within thread 1 */ rc = pthread_mutex_lock(&g_td.mutex); diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_087.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_087.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_087.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_087.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_088.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_088.c similarity index 98% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_088.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_088.c index 8e6a9c61..50870b06 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_088.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_088.c @@ -114,9 +114,8 @@ static void *PthreadF02(void *tmp) clock_gettime(CLOCK_REALTIME, &startTime); while (1) { clock_gettime(CLOCK_REALTIME, ¤tTime); - if (PthreadTimeF01(currentTime, startTime) > RUNTIME) { + if (PthreadTimeF01(currentTime, startTime) > RUNTIME) break; - } } g_lowDone = 1; EXIT: diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_089.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_089.c similarity index 98% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_089.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_089.c index 3fa8a48c..7b4f6460 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_089.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_089.c @@ -115,9 +115,8 @@ static void *PthreadF02(void *tmp) clock_gettime(CLOCK_REALTIME, &startTime); while (1) { clock_gettime(CLOCK_REALTIME, ¤tTime); - if (PthreadTimeF01(currentTime, startTime) > RUNTIME) { + if (PthreadTimeF01(currentTime, startTime) > RUNTIME) break; - } } g_lowDone = 1; EXIT: diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_092.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_092.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_092.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_092.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_095.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_095.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_095.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_095.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_098.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_098.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_098.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_098.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_101.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_101.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_101.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_101.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_102.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_102.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_102.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_102.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_103.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_103.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_103.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_103.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_107.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_107.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_107.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_107.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_108.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_108.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_108.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_108.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_110.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_110.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_110.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_110.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_112.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_112.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_112.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_112.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_116.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_116.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_116.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_116.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_121.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_121.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_121.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_121.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_123.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_123.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_123.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_123.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_124.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_124.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_124.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_124.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_125.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_125.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_125.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_125.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_127.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_127.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_127.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_127.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_128.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_128.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_128.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_128.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_129.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_129.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_129.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_129.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_132.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_132.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_132.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_132.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_133.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_133.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_133.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_133.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_134.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_134.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_134.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_134.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_136.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_136.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_136.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_136.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_138.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_138.c similarity index 96% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_138.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_138.c index 9ea39142..7c0009ea 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_138.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_138.c @@ -58,9 +58,8 @@ static UINT32 Testcase(VOID) ICUNIT_ASSERT_EQUAL(ret, PTHREAD_NO_ERROR, ret); /* Make sure the thread was created before we join it. */ - while (g_pthreadSem == PTHREAD_INTHREAD_TEST) { + while (g_pthreadSem == PTHREAD_INTHREAD_TEST) sleep(1); - } ret = pthread_join(newTh, &valuePtr); ICUNIT_ASSERT_EQUAL(ret, PTHREAD_NO_ERROR, ret); @@ -68,7 +67,7 @@ static UINT32 Testcase(VOID) /* * Check to make sure that 'value_ptr' that was passed to * pthread_join() and the pthread_exit() return code that - * was used in the thread function are the same. + * was used in the thread funciton are the same. */ ICUNIT_ASSERT_EQUAL(valuePtr, PTHREAD_EXIT_VALUE, errno); diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_141.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_141.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_141.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_141.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_142.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_142.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_142.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_142.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_144.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_144.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_144.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_144.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_150.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_150.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_150.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_150.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_152.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_152.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_152.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_152.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_154.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_154.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_154.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_154.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_166.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_166.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_166.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_166.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_167.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_167.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_167.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_167.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_173.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_173.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_173.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_173.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_175.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_175.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_175.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_175.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_176.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_176.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_176.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_176.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_177.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_177.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_177.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_177.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_182.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_182.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_182.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_182.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_185.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_185.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_185.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_185.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_186.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_186.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_186.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_186.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_187.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_187.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_187.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_187.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_188.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_188.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_188.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_188.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_193.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_193.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_193.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_193.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_194.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_194.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_194.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_194.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_197.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_197.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_197.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_197.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_198.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_198.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_198.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_198.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_200.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_200.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_200.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_200.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_204.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_204.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_204.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_204.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_205.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_205.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_205.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_205.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_206.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_206.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_206.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_206.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_208.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_208.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_208.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_208.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_209.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_209.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_209.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_209.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_211.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_211.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_211.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_211.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_213.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_213.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_213.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_213.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_214.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_214.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_214.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_214.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_215.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_215.c similarity index 98% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_215.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_215.c index e50a42ab..aa768427 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_215.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_215.c @@ -77,9 +77,8 @@ static UINT32 Testcase(VOID) ret = pthread_create(&newTh, NULL, PthreadF01, NULL); ICUNIT_ASSERT_EQUAL(ret, PTHREAD_NO_ERROR, ret); - while (g_testCount == 0) { + while (g_testCount == 0) sleep(1); - } ret = pthread_cancel(newTh); ICUNIT_ASSERT_EQUAL(ret, PTHREAD_NO_ERROR, ret); diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_217.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_217.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_217.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_217.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_218.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_218.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_218.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_218.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_219.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_219.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_219.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_219.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_221.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_221.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_221.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_221.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_224.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_224.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_224.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_224.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_226.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_226.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_226.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_226.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_233.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_233.c similarity index 98% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_233.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_233.c index 273e386b..fb2ea6d9 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_233.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_233.c @@ -76,9 +76,8 @@ static UINT32 Testcase(VOID) ret = pthread_create(&newTh, NULL, PthreadF01, NULL); ICUNIT_ASSERT_EQUAL(ret, PTHREAD_NO_ERROR, ret); - while (g_pthreadSem == 0) { + while (g_pthreadSem == 0) sleep(1); - } ret = pthread_cancel(newTh); ICUNIT_ASSERT_EQUAL(ret, PTHREAD_NO_ERROR, ret); diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_237.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_237.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_237.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_237.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_238.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_238.c similarity index 96% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_238.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_238.c index 5a8723c1..61bcc226 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_238.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_238.c @@ -51,9 +51,8 @@ static VOID *PthreadF01(VOID *argument) g_pthreadSem = PTHREAD_INMAIN_TEST; - while (g_pthreadSem == PTHREAD_INMAIN_TEST) { + while (g_pthreadSem == PTHREAD_INMAIN_TEST) sleep(1); - } pthread_testcancel(); @@ -74,9 +73,8 @@ static UINT32 Testcase(VOID) ret = pthread_create(&newTh, NULL, PthreadF01, NULL); ICUNIT_ASSERT_EQUAL(ret, PTHREAD_NO_ERROR, ret); - while (g_pthreadSem == PTHREAD_INTHREAD_TEST) { + while (g_pthreadSem == PTHREAD_INTHREAD_TEST) sleep(1); - } ret = pthread_cancel(newTh); ICUNIT_ASSERT_EQUAL(ret, PTHREAD_NO_ERROR, ret); diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_239.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_239.c similarity index 96% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_239.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_239.c index 0d611e8d..ecfa59f8 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_239.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_239.c @@ -48,9 +48,8 @@ static VOID *PthreadF01(VOID *argument) g_pthreadSem = PTHREAD_INMAIN_TEST; - while (g_pthreadSem == PTHREAD_INMAIN_TEST) { + while (g_pthreadSem == PTHREAD_INMAIN_TEST) sleep(1); - } pthread_testcancel(); @@ -70,9 +69,8 @@ static UINT32 Testcase(VOID) ret = pthread_create(&newTh, NULL, PthreadF01, NULL); ICUNIT_ASSERT_EQUAL(ret, PTHREAD_NO_ERROR, ret); - while (g_pthreadSem == PTHREAD_INTHREAD_TEST) { + while (g_pthreadSem == PTHREAD_INTHREAD_TEST) sleep(1); - } ret = pthread_cancel(newTh); ICUNIT_ASSERT_EQUAL(ret, PTHREAD_NO_ERROR, ret); diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_240.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_240.c similarity index 96% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_240.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_240.c index 8a288069..68314943 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_240.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_240.c @@ -48,9 +48,8 @@ static VOID *PthreadF01(VOID *argument) g_pthreadSem = PTHREAD_INMAIN_TEST; - while (g_pthreadSem == PTHREAD_INMAIN_TEST) { + while (g_pthreadSem == PTHREAD_INMAIN_TEST) sleep(1); - } pthread_testcancel(); @@ -71,9 +70,8 @@ static UINT32 Testcase(VOID) ret = pthread_create(&newTh, NULL, PthreadF01, NULL); ICUNIT_ASSERT_EQUAL(ret, PTHREAD_NO_ERROR, ret); - while (g_pthreadSem == PTHREAD_INTHREAD_TEST) { + while (g_pthreadSem == PTHREAD_INTHREAD_TEST) sleep(1); - } ret = pthread_cancel(newTh); ICUNIT_ASSERT_EQUAL(ret, PTHREAD_NO_ERROR, ret); diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_241.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_241.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_241.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_241.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_246.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_246.c similarity index 96% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_246.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_246.c index 5c341c88..abb30a2b 100644 --- a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_246.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/full/It_posix_pthread_246.c @@ -48,9 +48,8 @@ static VOID *PthreadF01(VOID *argument) g_pthreadSem = PTHREAD_INMAIN_TEST; - while (g_pthreadSem == PTHREAD_INMAIN_TEST) { + while (g_pthreadSem == PTHREAD_INMAIN_TEST) sleep(1); - } pthread_testcancel(); @@ -72,9 +71,8 @@ static UINT32 Testcase(VOID) ret = pthread_create(&newTh, NULL, PthreadF01, NULL); ICUNIT_ASSERT_EQUAL(ret, PTHREAD_NO_ERROR, ret); - while (g_pthreadSem == PTHREAD_INTHREAD_TEST) { + while (g_pthreadSem == PTHREAD_INTHREAD_TEST) sleep(1); - } ret = pthread_cancel(newTh); ICUNIT_ASSERT_EQUAL(ret, PTHREAD_NO_ERROR, ret); diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/smoke/It_posix_pthread_003.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/smoke/It_posix_pthread_003.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/smoke/It_posix_pthread_003.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/smoke/It_posix_pthread_003.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/smoke/It_posix_pthread_004.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/smoke/It_posix_pthread_004.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/smoke/It_posix_pthread_004.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/smoke/It_posix_pthread_004.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/smoke/It_posix_pthread_005.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/smoke/It_posix_pthread_005.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/smoke/It_posix_pthread_005.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/smoke/It_posix_pthread_005.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/smoke/It_posix_pthread_006.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/smoke/It_posix_pthread_006.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/smoke/It_posix_pthread_006.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/smoke/It_posix_pthread_006.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/smoke/It_posix_pthread_009.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/smoke/It_posix_pthread_009.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/smoke/It_posix_pthread_009.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/smoke/It_posix_pthread_009.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/smoke/It_posix_pthread_018.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/smoke/It_posix_pthread_018.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/smoke/It_posix_pthread_018.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/smoke/It_posix_pthread_018.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/smoke/It_posix_pthread_019.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/smoke/It_posix_pthread_019.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/smoke/It_posix_pthread_019.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/smoke/It_posix_pthread_019.c diff --git a/src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/smoke/It_posix_pthread_021.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/smoke/It_posix_pthread_021.c similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/sample/posix/pthread/smoke/It_posix_pthread_021.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/sample/posix/pthread/smoke/It_posix_pthread_021.c diff --git a/src/kernel_liteos_a/testsuites/kernel/src/iCunit.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/src/iCunit.c similarity index 95% rename from src/kernel_liteos_a/testsuites/kernel/src/iCunit.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/src/iCunit.c index ad014b19..82a00651 100644 --- a/src/kernel_liteos_a/testsuites/kernel/src/iCunit.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/src/iCunit.c @@ -194,7 +194,7 @@ iUINT32 ICunitInit(void) g_iCunitCaseCnt = 0x0000; g_iCunitCaseFailedCnt = 0; g_iCunitErrLogAddCase = 0; - (void)memset_s(g_iCunitCaseArray, sizeof(g_iCunitCaseArray), 0, sizeof(g_iCunitCaseArray)); + memset(g_iCunitCaseArray, 0, sizeof(g_iCunitCaseArray)); g_iCunitCaseRun = 1; return (iUINT32)ICUNIT_SUCCESS; @@ -202,11 +202,10 @@ iUINT32 ICunitInit(void) iUINT32 ICunitRunSingle(ICUNIT_CASE_S *psubCase) { - if ((g_isSpinorInit == FALSE) && (psubCase->testcase_module == TEST_JFFS)) { + if ((g_isSpinorInit == FALSE) && (psubCase->testcase_module == TEST_JFFS)) dprintf("****** Jffs is not support ! ****** \n"); - } else { + else ICunitRunF(psubCase); - } return (iUINT32)ICUNIT_SUCCESS; } @@ -234,12 +233,12 @@ iUINT32 ICunitRunF(ICUNIT_CASE_S *psubCase) static LosSemCB *semNode; UINT32 muxCnt[ARRAY_SIZE]; - (void)memset_s(gUwSwtNum, sizeof(gUwSwtNum), 0, sizeof(gUwSwtNum)); - (void)memset_s(gUwHwiNum, sizeof(gUwHwiNum), 0, sizeof(gUwHwiNum)); - (void)memset_s(gUwTskNum, sizeof(gUwTskNum), 0, sizeof(gUwTskNum)); - (void)memset_s(gAuwMemuse, sizeof(gAuwMemuse), 0, sizeof(gAuwMemuse)); - (void)memset_s(gUwQueueNum, sizeof(gUwQueueNum), 0, sizeof(gUwQueueNum)); - (void)memset_s(gUwSemNum, sizeof(gUwSemNum), 0, sizeof(gUwSemNum)); + memset(gUwSwtNum, 0, sizeof(gUwSwtNum)); + memset(gUwHwiNum, 0, sizeof(gUwHwiNum)); + memset(gUwTskNum, 0, sizeof(gUwTskNum)); + memset(gAuwMemuse, 0, sizeof(gAuwMemuse)); + memset(gUwQueueNum, 0, sizeof(gUwQueueNum)); + memset(gUwSemNum, 0, sizeof(gUwSemNum)); curTestTaskID = LOS_CurTaskIDGet(); @@ -578,7 +577,7 @@ iUINT32 ICunitRunTestArrayRandom(iUINT32 testcaseNum, iUINT32 testcaseLayer, iUI iUINT32 failedCount; iUINT32 successCount; - (void)memset_s(&subCaseArrayTemp, sizeof(ICUNIT_CASE_S), 0, sizeof(ICUNIT_CASE_S)); + memset(&subCaseArrayTemp, 0, sizeof(ICUNIT_CASE_S)); idx1 = g_iCunitCaseCnt; @@ -587,7 +586,7 @@ iUINT32 ICunitRunTestArrayRandom(iUINT32 testcaseNum, iUINT32 testcaseLayer, iUI successCount = g_passResult; for (idx = idx1 - 1; idx > 1; idx--) { - (void)memset_s(&subCaseArrayTemp, sizeof(ICUNIT_CASE_S), 0, sizeof(ICUNIT_CASE_S)); + memset(&subCaseArrayTemp, 0, sizeof(ICUNIT_CASE_S)); randIdx = ICunitRand() % idx; subCaseArrayTemp = g_iCunitCaseArray[randIdx]; @@ -612,12 +611,12 @@ iUINT32 ICunitRunTestOne(const char *tcId) iUINT32 idx1; ICUNIT_CASE_S subCaseArrayTemp; - (void)memset_s(&subCaseArrayTemp, sizeof(ICUNIT_CASE_S), 0, sizeof(ICUNIT_CASE_S)); + memset(&subCaseArrayTemp, 0, sizeof(ICUNIT_CASE_S)); idx1 = g_iCunitCaseCnt; for (idx = 0; idx < idx1; idx++) { - (void)memset_s(&subCaseArrayTemp, sizeof(ICUNIT_CASE_S), 0, sizeof(ICUNIT_CASE_S)); + memset(&subCaseArrayTemp, 0, sizeof(ICUNIT_CASE_S)); subCaseArrayTemp = g_iCunitCaseArray[idx]; if (strcmp(subCaseArrayTemp.pcCaseID, tcId) == 0) { diff --git a/src/kernel_liteos_a/testsuites/kernel/src/osTest.c b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/src/osTest.c similarity index 89% rename from src/kernel_liteos_a/testsuites/kernel/src/osTest.c rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/src/osTest.c index 151a1645..1e5458b5 100644 --- a/src/kernel_liteos_a/testsuites/kernel/src/osTest.c +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/src/osTest.c @@ -46,7 +46,6 @@ #include "los_mux_pri.h" #include "los_queue_pri.h" #include "los_swtmr_pri.h" -#include "los_init.h" #ifdef __cplusplus #if __cplusplus @@ -235,7 +234,6 @@ UINT32 SwtmrCountGetTest(VOID) (VOID)LOS_IntRestore(intSave); return swTmrCnt; } - #ifdef TEST1980 VOID TestHwiTrigger(unsigned int irq) { @@ -296,6 +294,7 @@ VOID TestBusyTaskDelay(UINT32 tick) if (runtime <= TestTickCountByCurrCpuid()) { break; } + WFI; } } @@ -308,6 +307,7 @@ VOID TestAssertBusyTaskDelay(UINT32 timeout, UINT32 flag) if ((runtime <= TestTickCountGet()) || (g_testCount == flag)) { break; } + WFI; } } @@ -315,9 +315,8 @@ VOID TestTestHwiDelete(unsigned int irq, VOID *devId) { HwiIrqParam stuwIrqPara; - if (OS_INT_ACTIVE) { + if (OS_INT_ACTIVE) return; - } stuwIrqPara.swIrq = irq; stuwIrqPara.pDevId = devId; @@ -373,12 +372,33 @@ NOK: } #endif -VOID TestKernelBase(VOID) + +VOID TestKernelBaseCore(VOID) { -#if defined(LOSCFG_TEST_KERNEL_BASE) +#if defined(LOSCFG_TEST_KERNEL_BASE_CORE) ItSuiteLosTask(); ItSuiteLosSwtmr(); + ItSuiteSmpHwi(); + ItSuiteHwiNesting(); +#endif +} + +VOID TestKernelBaseIpc(VOID) +{ +#if defined(LOSCFG_TEST_KERNEL_BASE_IPC) + ItSuiteLosEvent(); ItSuiteLosMux(); + ItSuiteLosSem(); + ItSuiteLosQueue(); +#endif +} + +VOID TestKernelBase(VOID) +{ + +#if defined(LOSCFG_TEST_KERNEL_BASE) + TestKernelBaseCore(); + TestKernelBaseIpc(); #endif } @@ -430,10 +450,20 @@ VOID TestReset(VOID) #endif } -VOID TestTaskEntry(VOID) +VOID TestTaskEntry(UINT32 param1, UINT32 param2, UINT32 param3, UINT32 param4) { UINT32 i; + INT32 ret = LOS_SetProcessScheduler(LOS_GetCurrProcessID(), LOS_SCHED_RR, 20); // 20, set a reasonable priority. + if (ret != LOS_OK) { + dprintf("%s set test process schedule failed! %d\n", ret); + } + + ret = LOS_SetTaskScheduler(LOS_CurTaskIDGet(), LOS_SCHED_RR, TASK_PRIO_TEST); + if (ret != LOS_OK) { + dprintf("%s set test task schedule failed! %d\n", ret); + } + g_testCircleCount = 0; dprintf("\t\n --- Test start--- \n"); @@ -444,6 +474,7 @@ VOID TestTaskEntry(VOID) LOS_MemAlloc(OS_SYS_MEM_ADDR, status.uwTotalFreeSize - memusedfirst); #endif +#if defined(LOSCFG_TEST) for (i = 0; i < 1; i++) { g_testCircleCount++; ICunitInit(); @@ -452,10 +483,10 @@ VOID TestTaskEntry(VOID) TestKernelBase(); TestPosix(); -#if (TEST_MODULE_CHECK == 1) +#if (TEST_MODULE_CHECK == 1) && defined(LOSCFG_TEST) for (int i = 0; i < g_modelNum - 1; i++) { if (g_executModelNum[i] != 0) { - dprintf("\nExecuted Model: %s, Executed Model_Num: %d ,failed_count: %d , success_count :%d", + dprintf("\nExecuted Model: %s, Executed Model_Num: %d ,failed_count: %d , sucess_count :%d", g_strModule[i], g_executModelNum[i], g_failModelResult[i], g_passModelResult[i]); } for (int j = 0; j < g_failResult && j < 50; j++) { // 50 @@ -481,27 +512,29 @@ VOID TestTaskEntry(VOID) g_passResult); } LOS_Msleep(200); // 200, delay. +#endif dprintf("\t\n --- Test End--- \n"); } -static void TestSystemInit(void) +void TestSystemInit(void) { - TSK_INIT_PARAM_S sysTask; - - (VOID)memset_s(&sysTask, sizeof(TSK_INIT_PARAM_S), 0, sizeof(TSK_INIT_PARAM_S)); - sysTask.pfnTaskEntry = (TSK_ENTRY_FUNC)TestTaskEntry; - sysTask.uwStackSize = 0x3000; /* 0x3000: stack size */ - sysTask.pcName = "TestTask"; - sysTask.usTaskPrio = TASK_PRIO_TEST_TASK; - sysTask.uwResved = LOS_TASK_ATTR_JOINABLE; + INT32 pid; + LosProcessCB *testProcess = NULL; + + InitRebootHook(); + + pid = LOS_Fork(0, "IT_TST_INI", (TSK_ENTRY_FUNC)TestTaskEntry, 0x30000); + if (pid < 0) { + return; + } + + testProcess = OS_PCB_FROM_PID(pid); + g_testTskHandle = testProcess->threadGroupID; #ifdef LOSCFG_KERNEL_SMP - sysTask.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); + ((LosTaskCB *)OS_TCB_FROM_TID(g_testTskHandle))->cpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid()); #endif - LOS_TaskCreate(&g_testTskHandle, &sysTask); } -LOS_MODULE_INIT(TestSystemInit, LOS_INIT_LEVEL_KMOD_TASK); - #ifdef __cplusplus #if __cplusplus } diff --git a/src/kernel_liteos_a/testsuites/kernel/test.mk b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/test.mk similarity index 100% rename from src/kernel_liteos_a/testsuites/kernel/test.mk rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/kernel/test.mk diff --git a/src/kernel_liteos_a/testsuites/unittest/BUILD.gn b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/BUILD.gn similarity index 67% rename from src/kernel_liteos_a/testsuites/unittest/BUILD.gn rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/BUILD.gn index b1ebb922..77ee85ac 100644 --- a/src/kernel_liteos_a/testsuites/unittest/BUILD.gn +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/BUILD.gn @@ -1,5 +1,5 @@ # Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. -# Copyright (c) 2020-2023 Huawei Device Co., Ltd. All rights reserved. +# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: @@ -67,8 +67,6 @@ config("public_config_for_pressure") { group("unittest") { deps = [] if (ohos_build_type == "debug") { - deps += [ "tools:liteos_unittest_run" ] - # basic test if (LOSCFG_USER_TEST_BASIC == true) { if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_LOW) { @@ -115,24 +113,10 @@ group("unittest") { # libc test if (LOSCFG_USER_TEST_LIBC == true) { if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_LOW) { - deps += [ - "libc/io:liteos_a_libc_io_unittest_door", - "libc/misc:liteos_a_libc_misc_unittest_door", - "libc/posix:liteos_a_libc_posix_unittest_door", - "libc/sys:liteos_a_libc_sys_unittest_door", - "libc/time:liteos_a_libc_time_unittest_door", - "libc/util:liteos_a_libc_util_unittest_door", - ] + deps += [ "libc:liteos_a_libc_unittest_door" ] } if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_MIDDLE) { - deps += [ - "libc/io:liteos_a_libc_io_unittest", - "libc/misc:liteos_a_libc_misc_unittest", - "libc/posix:liteos_a_libc_posix_unittest", - "libc/sys:liteos_a_libc_sys_unittest", - "libc/time:liteos_a_libc_time_unittest", - "libc/util:liteos_a_libc_util_unittest", - ] + deps += [ "libc:liteos_a_libc_unittest" ] } } @@ -149,30 +133,12 @@ group("unittest") { # process test if (LOSCFG_USER_TEST_PROCESS_THREAD == true) { if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_LOW) { - deps += [ - "process/basic/process:liteos_a_process_basic_process_unittest_door", - "process/basic/pthread:liteos_a_process_basic_pthread_unittest_door", - "process/lock:liteos_a_process_lock_unittest_door", - ] - if (LOSCFG_USER_TEST_PROCESS_FS == true) { - deps += [ "process/fs:liteos_a_process_fs_unittest_door" ] - } - if (LOSCFG_USER_TEST_PROCESS_PLIMITS == true) { - deps += [ "process/plimits:liteos_a_process_plimits_unittest_door" ] - } + deps += [ "process/basic:liteos_a_process_basic_unittest_door" ] + deps += [ "process/lock:liteos_a_process_lock_unittest_door" ] } if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_MIDDLE) { - deps += [ - "process/basic/process:liteos_a_process_basic_process_unittest", - "process/basic/pthread:liteos_a_process_basic_pthread_unittest", - "process/lock:liteos_a_process_lock_unittest", - ] - if (LOSCFG_USER_TEST_PROCESS_FS == true) { - deps += [ "process/fs:liteos_a_process_fs_unittest" ] - } - if (LOSCFG_USER_TEST_PROCESS_PLIMITS == true) { - deps += [ "process/plimits:liteos_a_process_plimits_unittest" ] - } + deps += [ "process/basic:liteos_a_process_basic_unittest" ] + deps += [ "process/lock:liteos_a_process_lock_unittest" ] } } @@ -185,20 +151,5 @@ group("unittest") { deps += [ "security:liteos_a_security_unittest" ] } } - - # container test - if (LOSCFG_USER_TEST_CONTAINER == true) { - if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_LOW) { - deps += [ "container:liteos_a_container_unittest_door" ] - } - if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_MIDDLE) { - deps += [ "container:liteos_a_container_unittest" ] - } - } - - # fuzz test - if (LOSCFG_USER_FUZZ_TEST == true) { - deps += [ "fuzz:liteos_a_fuzztest" ] - } } } diff --git a/src/kernel_liteos_a/testsuites/unittest/basic/BUILD.gn b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/BUILD.gn similarity index 90% rename from src/kernel_liteos_a/testsuites/unittest/basic/BUILD.gn rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/BUILD.gn index bf8ff3e5..19b381fd 100644 --- a/src/kernel_liteos_a/testsuites/unittest/basic/BUILD.gn +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/BUILD.gn @@ -26,6 +26,8 @@ # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +import("//build/lite/config/test.gni") +import("//kernel/liteos_a/testsuites/unittest/config.gni") import("./config.gni") if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_LOW) { @@ -38,7 +40,7 @@ if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_LOW) { sources_full = [] sources += sources_full configs = [ "..:public_config_for_door" ] - deps = [ "$THIRDPARTY_BOUNDS_CHECKING_FUNCTION_DIR:libsec_shared" ] + deps = [ "//third_party/bounds_checking_function:libsec_shared" ] } } @@ -51,6 +53,6 @@ if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_MIDDLE) { sources += sources_smoke sources += sources_full configs = [ "..:public_config_for_all" ] - deps = [ "$THIRDPARTY_BOUNDS_CHECKING_FUNCTION_DIR:libsec_shared" ] + deps = [ "//third_party/bounds_checking_function:libsec_shared" ] } } diff --git a/src/kernel_liteos_a/testsuites/unittest/basic/config.gni b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/config.gni similarity index 96% rename from src/kernel_liteos_a/testsuites/unittest/basic/config.gni rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/config.gni index 8f372411..4b18bbde 100644 --- a/src/kernel_liteos_a/testsuites/unittest/basic/config.gni +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/config.gni @@ -27,11 +27,10 @@ # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. import("//build/lite/config/test.gni") -import("//kernel/liteos_a/liteos.gni") import("//kernel/liteos_a/testsuites/unittest/config.gni") common_include_dirs = [ - "$THIRDPARTY_GOOGLETEST_DIR/googletest/include", + "//third_party/googletest/googletest/include", "../common/include", ] diff --git a/src/kernel_liteos_a/testsuites/unittest/basic/dynload/config.gni b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/dynload/config.gni similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/basic/dynload/config.gni rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/dynload/config.gni diff --git a/src/kernel_liteos_a/testsuites/unittest/basic/dynload/dynload_test.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/dynload/dynload_test.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/basic/dynload/dynload_test.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/dynload/dynload_test.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/basic/dynload/it_test_dynload.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/dynload/it_test_dynload.h similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/basic/dynload/it_test_dynload.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/dynload/it_test_dynload.h diff --git a/src/kernel_liteos_a/testsuites/unittest/basic/dynload/smoke/dynload_test_002.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/dynload/smoke/dynload_test_002.cpp similarity index 76% rename from src/kernel_liteos_a/testsuites/unittest/basic/dynload/smoke/dynload_test_002.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/dynload/smoke/dynload_test_002.cpp index 717ca316..7a175f77 100644 --- a/src/kernel_liteos_a/testsuites/unittest/basic/dynload/smoke/dynload_test_002.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/dynload/smoke/dynload_test_002.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2023 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -42,52 +42,40 @@ static int Testcase(void) char *workingPath = "/usr/bin"; void *handle = nullptr; int (*func)(int); - char curPath[1024] = { 0 }; /* 1024, buffer size */ - - handle = getcwd(curPath, sizeof(curPath)); - ICUNIT_ASSERT_NOT_EQUAL(handle, NULL, handle); ret = chdir(workingPath); ICUNIT_ASSERT_EQUAL(ret, 0, ret); handle = dlopen(NULL, RTLD_NOW | RTLD_LOCAL); - ICUNIT_GOTO_NOT_EQUAL(handle, NULL, 1, EXIT1); /* 1, return value */ + ICUNIT_ASSERT_NOT_EQUAL(handle, NULL, handle); ret = dlclose(handle); - ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT); + ICUNIT_ASSERT_EQUAL(ret, 0, ret); handle = dlopen(LIBCSO_REAL_PATH, RTLD_NOW); - ICUNIT_GOTO_NOT_EQUAL(handle, NULL, 1, EXIT1); /* 1, return value */ + ICUNIT_ASSERT_NOT_EQUAL(handle, NULL, handle); - func = reinterpret_cast(dlsym(handle, SYMBOL_TO_FIND)); + func = (int (*)(int))dlsym(handle, SYMBOL_TO_FIND); ICUNIT_GOTO_NOT_EQUAL(func, NULL, func, EXIT); ICUNIT_GOTO_EQUAL(func, SYMBOL_TO_MATCH, func, EXIT); ret = dlclose(handle); - ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT); + ICUNIT_ASSERT_EQUAL(ret, 0, ret); handle = dlopen(LIBCSO_RELATIVE_PATH, RTLD_NOW); - ICUNIT_GOTO_NOT_EQUAL(handle, NULL, 1, EXIT1); /* 1, return value */ + ICUNIT_ASSERT_NOT_EQUAL(handle, NULL, handle); - func = reinterpret_cast(dlsym(handle, SYMBOL_TO_FIND)); + func = (int (*)(int))dlsym(handle, SYMBOL_TO_FIND); ICUNIT_GOTO_NOT_EQUAL(func, NULL, func, EXIT); ret = dlclose(handle); - ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT); - - ret = chdir(curPath); - ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT1); + ICUNIT_ASSERT_EQUAL(ret, 0, ret); return 0; EXIT: dlclose(handle); - -EXIT1: - ret = chdir(curPath); - ICUNIT_ASSERT_EQUAL(ret, 0, ret); - - return 1; /* 1, return value */ + return 0; } void ItTestDynload002(void) diff --git a/src/kernel_liteos_a/testsuites/unittest/basic/dynload/smoke/dynload_test_004.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/dynload/smoke/dynload_test_004.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/basic/dynload/smoke/dynload_test_004.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/dynload/smoke/dynload_test_004.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/basic/exc/config.gni b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/exc/config.gni similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/basic/exc/config.gni rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/exc/config.gni diff --git a/src/kernel_liteos_a/testsuites/unittest/basic/exc/exc_test.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/exc/exc_test.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/basic/exc/exc_test.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/exc/exc_test.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/basic/exc/full/it_test_fexecve_001.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/exc/full/it_test_fexecve_001.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/basic/exc/full/it_test_fexecve_001.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/exc/full/it_test_fexecve_001.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/basic/exc/it_test_exc.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/exc/it_test_exc.h similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/basic/exc/it_test_exc.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/exc/it_test_exc.h diff --git a/src/kernel_liteos_a/testsuites/unittest/basic/exc/smoke/it_test_exc_001.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/exc/smoke/it_test_exc_001.cpp similarity index 92% rename from src/kernel_liteos_a/testsuites/unittest/basic/exc/smoke/it_test_exc_001.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/exc/smoke/it_test_exc_001.cpp index 1d88aa34..b7330789 100644 --- a/src/kernel_liteos_a/testsuites/unittest/basic/exc/smoke/it_test_exc_001.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/exc/smoke/it_test_exc_001.cpp @@ -30,15 +30,15 @@ */ #include "it_test_exc.h" -__attribute__((optnone)) static int TestCase(void) +static int TestCase(void) { int ret; + int *test = NULL; int status = 0; - int *test = NULL; // for trggering an exception pid_t pid = fork(); ICUNIT_ASSERT_WITHIN_EQUAL(pid, 0, INVALID_PROCESS_ID, pid); if (pid == 0) { - *test = 0x1; // Deliberately trigger an exceptioin + *test = 0x1; exit(0); } @@ -54,7 +54,7 @@ __attribute__((optnone)) static int TestCase(void) pid = fork(); ICUNIT_ASSERT_WITHIN_EQUAL(pid, 0, INVALID_PROCESS_ID, pid); if (pid == 0) { - *test = 0x1; // Deliberately trigger an exceptioin + *test = 0x1; exit(0); } diff --git a/src/kernel_liteos_a/testsuites/unittest/basic/exc/smoke/it_test_exc_002.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/exc/smoke/it_test_exc_002.cpp similarity index 94% rename from src/kernel_liteos_a/testsuites/unittest/basic/exc/smoke/it_test_exc_002.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/exc/smoke/it_test_exc_002.cpp index 80b9fe06..45b941f1 100644 --- a/src/kernel_liteos_a/testsuites/unittest/basic/exc/smoke/it_test_exc_002.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/exc/smoke/it_test_exc_002.cpp @@ -31,7 +31,7 @@ #include "it_test_exc.h" #include "pthread.h" -__attribute__((optnone)) static void *ThreadFunc2(void *arg) +static void *ThreadFunc2(void *arg) { while (1) { } @@ -39,7 +39,7 @@ __attribute__((optnone)) static void *ThreadFunc2(void *arg) return nullptr; } -__attribute__((optnone)) static void *ThreadFunc1(void *arg) +static void *ThreadFunc1(void *arg) { int *test = nullptr; *test = 0x1; @@ -77,8 +77,7 @@ static int TestThread(void) return 0; } - -__attribute__((optnone)) static int TestCase(void) +static int TestCase(void) { int *test = nullptr; int count = 5; diff --git a/src/kernel_liteos_a/testsuites/unittest/basic/exc/smoke/it_test_exc_003.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/exc/smoke/it_test_exc_003.cpp similarity index 95% rename from src/kernel_liteos_a/testsuites/unittest/basic/exc/smoke/it_test_exc_003.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/exc/smoke/it_test_exc_003.cpp index cef01003..c275cd65 100644 --- a/src/kernel_liteos_a/testsuites/unittest/basic/exc/smoke/it_test_exc_003.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/exc/smoke/it_test_exc_003.cpp @@ -34,15 +34,14 @@ #define TEST_THREAD_COUNT 5 static volatile int g_testCondFlag; static int g_count[TEST_THREAD_COUNT]; - -__attribute__((optnone)) static void *ThreadFunc2(void *arg) +static void *ThreadFunc2(void *arg) { int count = *(int *)arg; int *test = nullptr; g_testCondFlag++; - while (g_testCondFlag < 2) { /* 2, no special meaning */ + while (g_testCondFlag < 2) { } *test = 0x1; @@ -84,7 +83,7 @@ static int TestThread(void) return 0; } -__attribute__((optnone)) static int TestCase(void) +static int TestCase(void) { int *test = nullptr; int count = 5; diff --git a/src/kernel_liteos_a/testsuites/unittest/basic/exc/smoke/it_test_exc_004.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/exc/smoke/it_test_exc_004.cpp similarity index 90% rename from src/kernel_liteos_a/testsuites/unittest/basic/exc/smoke/it_test_exc_004.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/exc/smoke/it_test_exc_004.cpp index 90bd76d0..6ad1462a 100644 --- a/src/kernel_liteos_a/testsuites/unittest/basic/exc/smoke/it_test_exc_004.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/exc/smoke/it_test_exc_004.cpp @@ -33,19 +33,20 @@ #define TEST_THREAD_COUNT 5 -__attribute__((optnone)) static int TestThread(void) +static int TestThread(void) { + int *test = nullptr; int ret; - int *test = nullptr; // For triggering an exceptioin pid_t pid = fork(); ICUNIT_ASSERT_WITHIN_EQUAL(pid, 0, INVALID_PROCESS_ID, pid); if (pid == 0) { - *test = 0x1; // Deliberately trigger an exceptioin + *test = 0x1; while (1) { } } - *test = 0x1; // Deliberately trigger an exceptioin + + *test = 0x1; ret = waitpid(pid, NULL, 0); ICUNIT_ASSERT_EQUAL(ret, pid, ret); @@ -53,8 +54,9 @@ __attribute__((optnone)) static int TestThread(void) return 0; } -__attribute__((optnone)) static int TestCase(void) +static int TestCase(void) { + int *test = nullptr; int count = 5; int status = 0; int ret; diff --git a/src/kernel_liteos_a/testsuites/unittest/basic/exc/smoke/it_test_exc_005.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/exc/smoke/it_test_exc_005.cpp similarity index 96% rename from src/kernel_liteos_a/testsuites/unittest/basic/exc/smoke/it_test_exc_005.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/exc/smoke/it_test_exc_005.cpp index 8e00525c..64c66472 100644 --- a/src/kernel_liteos_a/testsuites/unittest/basic/exc/smoke/it_test_exc_005.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/exc/smoke/it_test_exc_005.cpp @@ -30,7 +30,7 @@ */ #include "it_test_exc.h" -__attribute__((optnone)) static void Child(void) +static void Child(void) { while (1) { printf("@@@@@@@@@@@@@ pid : %d getppid : %d @@@@@@@@@@@@@@@@\n", getpid(), getppid()); @@ -41,7 +41,7 @@ static void TestKill(int sig) exit(0); } -__attribute__((optnone)) static int TestCase(void) +static int TestCase(void) { int ret; void (*retptr)(int) = NULL; diff --git a/src/kernel_liteos_a/testsuites/unittest/basic/mem/shm/config.gni b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/mem/shm/config.gni similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/basic/mem/shm/config.gni rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/mem/shm/config.gni diff --git a/src/kernel_liteos_a/testsuites/unittest/basic/mem/shm/full/it_test_mem_100.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/mem/shm/full/it_test_mem_100.cpp similarity index 96% rename from src/kernel_liteos_a/testsuites/unittest/basic/mem/shm/full/it_test_mem_100.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/mem/shm/full/it_test_mem_100.cpp index 918a6aeb..addcc3d6 100644 --- a/src/kernel_liteos_a/testsuites/unittest/basic/mem/shm/full/it_test_mem_100.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/mem/shm/full/it_test_mem_100.cpp @@ -41,7 +41,7 @@ static int TestCase(void) wchar_t res2[] = L"abcdmngh"; wchar_t *p, *pnew; - pnew = static_cast(malloc(sizeof(wchar_t) * (wcslen(res) + wcslen(res1)))); + pnew = (wchar_t*)malloc(sizeof(wchar_t) * (wcslen(res) + wcslen(res1))); ICUNIT_ASSERT_NOT_EQUAL(pnew, NULL, pnew); p = wmempcpy(pnew, res, wcslen(res)); diff --git a/src/kernel_liteos_a/testsuites/unittest/basic/mem/shm/full/shm_test_001.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/mem/shm/full/shm_test_001.cpp similarity index 99% rename from src/kernel_liteos_a/testsuites/unittest/basic/mem/shm/full/shm_test_001.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/mem/shm/full/shm_test_001.cpp index 7582e132..6cb107d3 100644 --- a/src/kernel_liteos_a/testsuites/unittest/basic/mem/shm/full/shm_test_001.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/mem/shm/full/shm_test_001.cpp @@ -91,7 +91,7 @@ VOID *ShmWriteFunc(VOID *ptr) shmid = shmget((key_t)1234, sizeof(struct shared_use_st), 0666 | IPC_CREAT); ICUNIT_ASSERT_NOT_EQUAL_NULL_VOID(shmid, -1, shmid); - shm = shmat(shmid, nullptr, 0); + shm = shmat(shmid, (void *)0, 0); ICUNIT_ASSERT_NOT_EQUAL_NULL_VOID(shm, INVALID_PTR, shm); printf("Memory attached at %p\n", shm); diff --git a/src/kernel_liteos_a/testsuites/unittest/basic/mem/shm/full/shm_test_002.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/mem/shm/full/shm_test_002.cpp similarity index 74% rename from src/kernel_liteos_a/testsuites/unittest/basic/mem/shm/full/shm_test_002.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/mem/shm/full/shm_test_002.cpp index d605e033..c624257f 100644 --- a/src/kernel_liteos_a/testsuites/unittest/basic/mem/shm/full/shm_test_002.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/mem/shm/full/shm_test_002.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2022 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -31,46 +31,39 @@ #include "it_test_shm.h" #define SHMID_MAX 192 -#define SHM_FLAG 0777 static int Testcase(VOID) { int shmid[SHMID_MAX + 1] = {-1}; int ret; int i; - struct shm_info shmInfo; - int leftShmIds; - ret = shmctl(0, SHM_INFO, reinterpret_cast(&shmInfo)); - ICUNIT_ASSERT_EQUAL(ret, SHMID_MAX, ret); - leftShmIds = SHMID_MAX - shmInfo.used_ids; - - shmid[0] = shmget((key_t)0x1234, PAGE_SIZE, SHM_FLAG | IPC_CREAT); // 0x1234: a key used to create shared memory + shmid[0] = shmget((key_t)0x1234, PAGE_SIZE, 0777 | IPC_CREAT); ICUNIT_ASSERT_NOT_EQUAL(shmid[0], -1, shmid[0]); ret = shmctl(shmid[0], IPC_RMID, NULL); ICUNIT_ASSERT_EQUAL(ret, 0, ret); - shmid[0] = shmget(IPC_PRIVATE, PAGE_SIZE, SHM_FLAG | IPC_CREAT); + shmid[0] = shmget(IPC_PRIVATE, PAGE_SIZE, 0777 | IPC_CREAT); ICUNIT_ASSERT_NOT_EQUAL(shmid[0], -1, shmid[0]); ret = shmctl(shmid[0], IPC_RMID, NULL); ICUNIT_ASSERT_EQUAL(ret, 0, ret); - for (i = 0; i < leftShmIds; i++) { - shmid[i] = shmget(IPC_PRIVATE, PAGE_SIZE, SHM_FLAG | IPC_CREAT); + for (i = 0; i < SHMID_MAX; i++) { + shmid[i] = shmget(IPC_PRIVATE, PAGE_SIZE, 0777 | IPC_CREAT); ICUNIT_ASSERT_NOT_EQUAL(shmid[i], -1, shmid[i]); } - shmid[leftShmIds] = shmget(IPC_PRIVATE, PAGE_SIZE, SHM_FLAG | IPC_CREAT); - ICUNIT_ASSERT_EQUAL(shmid[leftShmIds], -1, shmid[leftShmIds]); + shmid[SHMID_MAX] = shmget(IPC_PRIVATE, PAGE_SIZE, 0777 | IPC_CREAT); + ICUNIT_ASSERT_EQUAL(shmid[SHMID_MAX], -1, shmid[SHMID_MAX]); - for (i = 0; i < leftShmIds; i++) { + for (i = 0; i < SHMID_MAX; i++) { ret = shmctl(shmid[i], IPC_RMID, NULL); ICUNIT_ASSERT_EQUAL(ret, 0, ret); } - for (i = 0; i < leftShmIds; i++) { + for (i = 0; i < SHMID_MAX; i++) { ret = shmctl(shmid[i], IPC_RMID, NULL); ICUNIT_ASSERT_EQUAL(ret, -1, ret); } diff --git a/src/kernel_liteos_a/testsuites/unittest/basic/mem/shm/full/shm_test_003.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/mem/shm/full/shm_test_003.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/basic/mem/shm/full/shm_test_003.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/mem/shm/full/shm_test_003.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/basic/mem/shm/full/shm_test_004.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/mem/shm/full/shm_test_004.cpp similarity index 98% rename from src/kernel_liteos_a/testsuites/unittest/basic/mem/shm/full/shm_test_004.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/mem/shm/full/shm_test_004.cpp index 4a2d914c..3348ea39 100644 --- a/src/kernel_liteos_a/testsuites/unittest/basic/mem/shm/full/shm_test_004.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/mem/shm/full/shm_test_004.cpp @@ -55,6 +55,7 @@ static int Testcase(VOID) ICUNIT_GOTO_EQUAL(ds.shm_perm.uid, getuid(), ds.shm_perm.uid, ERROR_OUT); ret = shmctl(shmid, SHM_STAT, &ds); + // ICUNIT_GOTO_EQUAL(ret, 0x10000, ret, ERROR_OUT); ICUNIT_GOTO_NOT_EQUAL(ret, -1, ret, ERROR_OUT); ICUNIT_GOTO_NOT_EQUAL(ret, 0, ret, ERROR_OUT); @@ -69,7 +70,7 @@ static int Testcase(VOID) ICUNIT_GOTO_EQUAL(info.shmmax, 0x1000000, info.shmmax, ERROR_OUT); ICUNIT_GOTO_EQUAL(info.shmmin, 1, info.shmmin, ERROR_OUT); ICUNIT_GOTO_EQUAL(info.shmmni, 192, info.shmmni, ERROR_OUT); - ICUNIT_GOTO_EQUAL(info.shmseg, 128, info.shmseg, ERROR_OUT); // 128: expected value of shmseg + ICUNIT_GOTO_EQUAL(info.shmseg, 128, info.shmseg, ERROR_OUT); ICUNIT_GOTO_EQUAL(info.shmall, 0x1000, info.shmall, ERROR_OUT); ret = shmdt(shm); diff --git a/src/kernel_liteos_a/testsuites/unittest/basic/mem/shm/full/shm_test_005.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/mem/shm/full/shm_test_005.cpp similarity index 93% rename from src/kernel_liteos_a/testsuites/unittest/basic/mem/shm/full/shm_test_005.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/mem/shm/full/shm_test_005.cpp index b4d6ba61..2e0da0ce 100644 --- a/src/kernel_liteos_a/testsuites/unittest/basic/mem/shm/full/shm_test_005.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/mem/shm/full/shm_test_005.cpp @@ -49,13 +49,13 @@ static int Testcase(VOID) shm = shmat(shmid, NULL, SHM_REMAP); ICUNIT_ASSERT_EQUAL(errno, EINVAL, errno); - shm = shmat(shmid, reinterpret_cast(0x100), 0); + shm = shmat(shmid, (const void *)0x100, 0); ICUNIT_ASSERT_EQUAL(errno, EINVAL, errno); shm = shmat(shmid, NULL, 0); - ICUNIT_ASSERT_NOT_EQUAL(shm, reinterpret_cast(-1), shm); + ICUNIT_ASSERT_NOT_EQUAL(shm, (void *)-1, shm); - ret = shmdt(reinterpret_cast(0x100)); + ret = shmdt((const void *)0x100); ICUNIT_ASSERT_EQUAL(ret, -1, shmid); ICUNIT_ASSERT_EQUAL(errno, EINVAL, errno); diff --git a/src/kernel_liteos_a/testsuites/unittest/basic/mem/shm/full/shm_test_006.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/mem/shm/full/shm_test_006.cpp similarity index 94% rename from src/kernel_liteos_a/testsuites/unittest/basic/mem/shm/full/shm_test_006.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/mem/shm/full/shm_test_006.cpp index 46f52a4d..4b78d6f4 100644 --- a/src/kernel_liteos_a/testsuites/unittest/basic/mem/shm/full/shm_test_006.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/mem/shm/full/shm_test_006.cpp @@ -42,14 +42,14 @@ static int Testcase(VOID) ICUNIT_ASSERT_NOT_EQUAL(shmid, -1, shmid); shared = shmat(shmid, 0, 0); - ICUNIT_ASSERT_NOT_EQUAL(shared, reinterpret_cast(-1), shared); + ICUNIT_ASSERT_NOT_EQUAL(shared, (void *)-1, shared); ret = shmdt(shared); ICUNIT_ASSERT_NOT_EQUAL(ret, -1, ret); remap = shared; shared = shmat(shmid, remap, SHM_REMAP); - ICUNIT_ASSERT_NOT_EQUAL(shared, reinterpret_cast(-1), shared); + ICUNIT_ASSERT_NOT_EQUAL(shared, (void *)-1, shared); ret = shmdt(shared); ICUNIT_ASSERT_NOT_EQUAL(ret, -1, ret); diff --git a/src/kernel_liteos_a/testsuites/unittest/basic/mem/shm/full/shm_test_007.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/mem/shm/full/shm_test_007.cpp similarity index 93% rename from src/kernel_liteos_a/testsuites/unittest/basic/mem/shm/full/shm_test_007.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/mem/shm/full/shm_test_007.cpp index 1f0e16d4..83e38df7 100644 --- a/src/kernel_liteos_a/testsuites/unittest/basic/mem/shm/full/shm_test_007.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/mem/shm/full/shm_test_007.cpp @@ -47,7 +47,7 @@ static int Testcase(void) ret = fork(); if (ret == 0) { usleep(100000); - if ((shared = static_cast(shmat(shmid, 0, 0))) == reinterpret_cast(-1)) { + if ((shared = (char *)shmat(shmid, 0, 0)) == (void *)-1) { printf("child : error: shmat()\n"); exit(1); } @@ -72,8 +72,8 @@ static int Testcase(void) pid = ret; usleep(50000); - shared = static_cast(shmat(shmid, 0, 0)); - ICUNIT_ASSERT_NOT_EQUAL(shared, reinterpret_cast(-1), shared); + shared = (char *)shmat(shmid, 0, 0); + ICUNIT_ASSERT_NOT_EQUAL(shared, (void *)-1, shared); ret = strncpy_s(shared, memSize, testStr, sizeof(testStr)); ICUNIT_ASSERT_EQUAL(ret, 0, ret); diff --git a/src/kernel_liteos_a/testsuites/unittest/basic/mem/shm/full/shm_test_008.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/mem/shm/full/shm_test_008.cpp similarity index 94% rename from src/kernel_liteos_a/testsuites/unittest/basic/mem/shm/full/shm_test_008.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/mem/shm/full/shm_test_008.cpp index 7c8fb5f0..00bb3759 100644 --- a/src/kernel_liteos_a/testsuites/unittest/basic/mem/shm/full/shm_test_008.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/mem/shm/full/shm_test_008.cpp @@ -42,11 +42,11 @@ static int Testcase(void) ICUNIT_ASSERT_NOT_EQUAL(shmid, -1, shmid); shared = shmat(shmid, 0, 0); - ICUNIT_ASSERT_EQUAL(shared, reinterpret_cast(-1), shared); + ICUNIT_ASSERT_EQUAL(shared, (void *)-1, shared); ICUNIT_ASSERT_EQUAL(errno, EACCES, errno); shared = shmat(shmid, 0, SHM_RDONLY); - ICUNIT_ASSERT_NOT_EQUAL(shared, reinterpret_cast(-1), shared); + ICUNIT_ASSERT_NOT_EQUAL(shared, (void *)-1, shared); ret = shmdt(shared); ICUNIT_ASSERT_NOT_EQUAL(ret, -1, ret); diff --git a/src/kernel_liteos_a/testsuites/unittest/basic/mem/shm/full/shm_test_009.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/mem/shm/full/shm_test_009.cpp similarity index 96% rename from src/kernel_liteos_a/testsuites/unittest/basic/mem/shm/full/shm_test_009.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/mem/shm/full/shm_test_009.cpp index 2fbb0854..a8aeb1d0 100644 --- a/src/kernel_liteos_a/testsuites/unittest/basic/mem/shm/full/shm_test_009.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/mem/shm/full/shm_test_009.cpp @@ -88,14 +88,14 @@ static int Testcase(void) int ret; int pid; - void *ptr = reinterpret_cast(signal(SIGTERM, ExitChildren)); + void *ptr = (void *)signal(SIGTERM, ExitChildren); ICUNIT_ASSERT_NOT_EQUAL(ptr, NULL, ptr); shmid = shmget(IPC_PRIVATE, sizeof(int), IPC_CREAT | 0600); ICUNIT_ASSERT_NOT_EQUAL(shmid, -1, shmid); g_shmptr = (int *)shmat(shmid, 0, 0); - ICUNIT_ASSERT_NOT_EQUAL(g_shmptr, reinterpret_cast(-1), g_shmptr); + ICUNIT_ASSERT_NOT_EQUAL(g_shmptr, (int *)-1, g_shmptr); *g_shmptr = 0; diff --git a/src/kernel_liteos_a/testsuites/unittest/basic/mem/shm/full/shm_test_010.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/mem/shm/full/shm_test_010.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/basic/mem/shm/full/shm_test_010.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/mem/shm/full/shm_test_010.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/basic/mem/shm/full/shm_test_012.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/mem/shm/full/shm_test_012.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/basic/mem/shm/full/shm_test_012.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/mem/shm/full/shm_test_012.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/basic/mem/shm/full/shm_test_013.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/mem/shm/full/shm_test_013.cpp similarity index 96% rename from src/kernel_liteos_a/testsuites/unittest/basic/mem/shm/full/shm_test_013.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/mem/shm/full/shm_test_013.cpp index 773402aa..ba98058f 100644 --- a/src/kernel_liteos_a/testsuites/unittest/basic/mem/shm/full/shm_test_013.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/mem/shm/full/shm_test_013.cpp @@ -43,9 +43,9 @@ static int testcase(void) shmfd = shm_open("test_1", O_RDWR | O_CREAT | O_EXCL, 0644); ICUNIT_ASSERT_NOT_EQUAL(shmfd, -1, shmfd); - writebuf = static_cast(malloc(pageSize)); + writebuf = (char*)malloc(pageSize); ICUNIT_ASSERT_NOT_EQUAL(writebuf, NULL, writebuf); - readbuf = static_cast(malloc(pageSize)); + readbuf = (char*)malloc(pageSize); ICUNIT_GOTO_NOT_EQUAL(readbuf, NULL, readbuf, EXIT); (void)memset_s(writebuf, pageSize, 0xf, pageSize); diff --git a/src/kernel_liteos_a/testsuites/unittest/basic/mem/shm/full/shm_test_014.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/mem/shm/full/shm_test_014.cpp similarity index 96% rename from src/kernel_liteos_a/testsuites/unittest/basic/mem/shm/full/shm_test_014.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/mem/shm/full/shm_test_014.cpp index 7acd2b76..aee68784 100644 --- a/src/kernel_liteos_a/testsuites/unittest/basic/mem/shm/full/shm_test_014.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/mem/shm/full/shm_test_014.cpp @@ -49,9 +49,9 @@ static int testcase(void) shmfd = shm_open("test_2", O_RDONLY | O_CREAT, 00664); ICUNIT_ASSERT_NOT_EQUAL(shmfd, -1, shmfd); - writebuf = static_cast(malloc(pageSize)); + writebuf = (char*)malloc(pageSize); ICUNIT_ASSERT_NOT_EQUAL(writebuf, NULL, writebuf); - readbuf = static_cast(malloc(pageSize)); + readbuf = (char*)malloc(pageSize); ICUNIT_ASSERT_NOT_EQUAL(readbuf, NULL, readbuf); (void)memset_s(writebuf, pageSize, 0xf, pageSize); diff --git a/src/kernel_liteos_a/testsuites/unittest/basic/mem/shm/it_test_shm.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/mem/shm/it_test_shm.h similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/basic/mem/shm/it_test_shm.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/mem/shm/it_test_shm.h diff --git a/src/kernel_liteos_a/testsuites/unittest/basic/mem/shm/mem_shm_test.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/mem/shm/mem_shm_test.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/basic/mem/shm/mem_shm_test.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/mem/shm/mem_shm_test.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/basic/mem/shm/smoke/shm_test_011.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/mem/shm/smoke/shm_test_011.cpp similarity index 95% rename from src/kernel_liteos_a/testsuites/unittest/basic/mem/shm/smoke/shm_test_011.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/mem/shm/smoke/shm_test_011.cpp index 3a35156b..9f8e4865 100644 --- a/src/kernel_liteos_a/testsuites/unittest/basic/mem/shm/smoke/shm_test_011.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/mem/shm/smoke/shm_test_011.cpp @@ -45,7 +45,7 @@ static int Testcase(void) ret = fork(); if (ret == 0) { shared = (int *)shmat(shmid, NULL, 0); - if (shared == reinterpret_cast(-1)) { + if (shared == (int *)-1) { exit(1); } *shared = 2; @@ -55,7 +55,7 @@ static int Testcase(void) } else { usleep(20000); shared = (int *)shmat(shmid, NULL, 0); - ICUNIT_ASSERT_NOT_EQUAL(shared, reinterpret_cast(-1), shared); + ICUNIT_ASSERT_NOT_EQUAL(shared, (int *)-1, shared); ICUNIT_ASSERT_EQUAL(*shared, 2, *shared); diff --git a/src/kernel_liteos_a/testsuites/unittest/basic/mem/vm/config.gni b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/mem/vm/config.gni similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/basic/mem/vm/config.gni rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/mem/vm/config.gni diff --git a/src/kernel_liteos_a/testsuites/unittest/basic/mem/vm/it_test_vm.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/mem/vm/it_test_vm.h similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/basic/mem/vm/it_test_vm.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/mem/vm/it_test_vm.h diff --git a/src/kernel_liteos_a/testsuites/unittest/basic/mem/vm/mem_vm_test.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/mem/vm/mem_vm_test.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/basic/mem/vm/mem_vm_test.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/mem/vm/mem_vm_test.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/basic/mem/vm/smoke/mmap_test_001.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/mem/vm/smoke/mmap_test_001.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/basic/mem/vm/smoke/mmap_test_001.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/mem/vm/smoke/mmap_test_001.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/basic/mem/vm/smoke/mmap_test_002.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/mem/vm/smoke/mmap_test_002.cpp similarity index 98% rename from src/kernel_liteos_a/testsuites/unittest/basic/mem/vm/smoke/mmap_test_002.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/mem/vm/smoke/mmap_test_002.cpp index 85f44eed..8731e27e 100644 --- a/src/kernel_liteos_a/testsuites/unittest/basic/mem/vm/smoke/mmap_test_002.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/mem/vm/smoke/mmap_test_002.cpp @@ -71,7 +71,7 @@ static int Testcase(void) printf("err: malloc size invalid\n"); return -1; } - buf = static_cast(malloc(pageSize)); + buf = (char *)malloc(pageSize); ICUNIT_ASSERT_NOT_EQUAL(buf, NULL, buf); (void)memset_s(buf, pageSize, 0xf, pageSize); diff --git a/src/kernel_liteos_a/testsuites/unittest/basic/mem/vm/smoke/mmap_test_003.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/mem/vm/smoke/mmap_test_003.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/basic/mem/vm/smoke/mmap_test_003.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/mem/vm/smoke/mmap_test_003.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/basic/mem/vm/smoke/mmap_test_004.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/mem/vm/smoke/mmap_test_004.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/basic/mem/vm/smoke/mmap_test_004.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/mem/vm/smoke/mmap_test_004.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/basic/mem/vm/smoke/mmap_test_005.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/mem/vm/smoke/mmap_test_005.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/basic/mem/vm/smoke/mmap_test_005.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/mem/vm/smoke/mmap_test_005.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/basic/mem/vm/smoke/mmap_test_006.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/mem/vm/smoke/mmap_test_006.cpp similarity index 98% rename from src/kernel_liteos_a/testsuites/unittest/basic/mem/vm/smoke/mmap_test_006.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/mem/vm/smoke/mmap_test_006.cpp index 6f45c878..4908d614 100644 --- a/src/kernel_liteos_a/testsuites/unittest/basic/mem/vm/smoke/mmap_test_006.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/mem/vm/smoke/mmap_test_006.cpp @@ -49,7 +49,7 @@ static int Testcase(void) fd = open(file, O_CREAT | O_RDWR, S_IRWXU | S_IRWXG | S_IRWXO); ICUNIT_ASSERT_NOT_EQUAL(fd, -1, fd); - invalueAddr = reinterpret_cast(VALIDE_ADDR | ADDR_OFFSET); + invalueAddr = (void *)(VALIDE_ADDR | ADDR_OFFSET); mem = mmap(invalueAddr, len, PROT_READ | PROT_WRITE, MAP_SHARED | MAP_FIXED, fd, 0); ICUNIT_GOTO_EQUAL(mem, MAP_FAILED, mem, EXIT); ICUNIT_GOTO_EQUAL(errno, EINVAL, errno, EXIT); diff --git a/src/kernel_liteos_a/testsuites/unittest/basic/mem/vm/smoke/mmap_test_007.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/mem/vm/smoke/mmap_test_007.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/basic/mem/vm/smoke/mmap_test_007.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/mem/vm/smoke/mmap_test_007.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/basic/mem/vm/smoke/mmap_test_008.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/mem/vm/smoke/mmap_test_008.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/basic/mem/vm/smoke/mmap_test_008.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/mem/vm/smoke/mmap_test_008.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/basic/mem/vm/smoke/mmap_test_009.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/mem/vm/smoke/mmap_test_009.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/basic/mem/vm/smoke/mmap_test_009.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/mem/vm/smoke/mmap_test_009.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/basic/mem/vm/smoke/mmap_test_010.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/mem/vm/smoke/mmap_test_010.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/basic/mem/vm/smoke/mmap_test_010.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/mem/vm/smoke/mmap_test_010.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/basic/mem/vm/smoke/mprotect_test_001.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/mem/vm/smoke/mprotect_test_001.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/basic/mem/vm/smoke/mprotect_test_001.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/mem/vm/smoke/mprotect_test_001.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/basic/mem/vm/smoke/mremap_test_001.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/mem/vm/smoke/mremap_test_001.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/basic/mem/vm/smoke/mremap_test_001.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/mem/vm/smoke/mremap_test_001.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/basic/mem/vm/smoke/oom_test_001.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/mem/vm/smoke/oom_test_001.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/basic/mem/vm/smoke/oom_test_001.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/mem/vm/smoke/oom_test_001.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/basic/mem/vm/smoke/open_wmemstream_test_001.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/mem/vm/smoke/open_wmemstream_test_001.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/basic/mem/vm/smoke/open_wmemstream_test_001.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/mem/vm/smoke/open_wmemstream_test_001.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/basic/mem/vm/smoke/user_copy_test_001.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/mem/vm/smoke/user_copy_test_001.cpp similarity index 81% rename from src/kernel_liteos_a/testsuites/unittest/basic/mem/vm/smoke/user_copy_test_001.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/mem/vm/smoke/user_copy_test_001.cpp index 33c20f4c..f506db0b 100644 --- a/src/kernel_liteos_a/testsuites/unittest/basic/mem/vm/smoke/user_copy_test_001.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/basic/mem/vm/smoke/user_copy_test_001.cpp @@ -40,26 +40,24 @@ static int Testcase(void) const char *str = "Hi, OHOS."; /* sigprocmask 内核系统调用接口通过arch_copy_from_user拷贝用户参数 */ - ret = sigprocmask(SIG_BLOCK, reinterpret_cast(1), &oldset); + ret = sigprocmask(SIG_BLOCK, (sigset_t *)1, &oldset); ICUNIT_ASSERT_EQUAL(ret, -1, ret); ICUNIT_ASSERT_EQUAL(errno, EFAULT, errno); - ret = sigprocmask(SIG_BLOCK, reinterpret_cast(INVALID_USER_VADDR), &oldset); + ret = sigprocmask(SIG_BLOCK, (sigset_t *)INVALID_USER_VADDR, &oldset); ICUNIT_ASSERT_EQUAL(ret, -1, ret); ICUNIT_ASSERT_EQUAL(errno, EFAULT, errno); /* sigprocmask 内核系统调用接口通过arch_copy_to_user将内核参数拷贝至用户 */ - ret = sigprocmask(SIG_BLOCK, reinterpret_cast(INVALID_USER_VADDR), reinterpret_cast(1)); + ret = sigprocmask(SIG_BLOCK, (sigset_t *)INVALID_USER_VADDR, (sigset_t *)1); ICUNIT_ASSERT_EQUAL(ret, -1, ret); ICUNIT_ASSERT_EQUAL(errno, EFAULT, errno); - ret = sigprocmask(SIG_BLOCK, reinterpret_cast(INVALID_USER_VADDR), - reinterpret_cast(INVALID_USER_VADDR)); + ret = sigprocmask(SIG_BLOCK, (sigset_t *)INVALID_USER_VADDR, (sigset_t *)INVALID_USER_VADDR); ICUNIT_ASSERT_EQUAL(ret, -1, ret); ICUNIT_ASSERT_EQUAL(errno, EFAULT, errno); - ret = sigprocmask(SIG_BLOCK, reinterpret_cast(INVALID_USER_VADDR), - reinterpret_cast(const_cast(str))); + ret = sigprocmask(SIG_BLOCK, (sigset_t *)INVALID_USER_VADDR, (sigset_t *)str); ICUNIT_ASSERT_EQUAL(ret, -1, ret); ICUNIT_ASSERT_EQUAL(errno, EFAULT, errno); diff --git a/src/kernel_liteos_a/testsuites/unittest/common/include/iCunit.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/common/include/iCunit.h similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/common/include/iCunit.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/common/include/iCunit.h diff --git a/src/kernel_liteos_a/testsuites/unittest/common/include/los_typedef.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/common/include/los_typedef.h similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/common/include/los_typedef.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/common/include/los_typedef.h diff --git a/src/kernel_liteos_a/testsuites/unittest/common/include/osTest.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/common/include/osTest.h similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/common/include/osTest.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/common/include/osTest.h diff --git a/src/kernel_liteos_a/testsuites/unittest/common/osTest.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/common/osTest.cpp similarity index 99% rename from src/kernel_liteos_a/testsuites/unittest/common/osTest.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/common/osTest.cpp index e96863ed..f2d45da7 100644 --- a/src/kernel_liteos_a/testsuites/unittest/common/osTest.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/common/osTest.cpp @@ -366,7 +366,7 @@ VOID TestInitUartDev(VOID) {} /* **************************************** Function:Test_PartInit -Description: create a partition for testing,partition num is 0,mount point is jffs0 +Description: creat a partition for testing,partition num is 0,mount point is jffs0 Input: [1]type: "spinor" [2]start_addr: the partition start address diff --git a/src/kernel_liteos_a/testsuites/unittest/config.gni b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/config.gni similarity index 60% rename from src/kernel_liteos_a/testsuites/unittest/config.gni rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/config.gni index b7e6bf85..f429e251 100644 --- a/src/kernel_liteos_a/testsuites/unittest/config.gni +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/config.gni @@ -1,5 +1,5 @@ # Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. -# Copyright (c) 2020-2023 Huawei Device Co., Ltd. All rights reserved. +# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: @@ -27,12 +27,7 @@ # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -import("$root_out_dir/config.gni") TEST_UNITTEST_DIR = rebase_path(".") -declare_args() { - liteos_container_test_enable = false - liteos_fuzz_test_enable = false -} TEST_LEVEL_LOW = 1 TEST_LEVEL_MIDDLE = 3 @@ -64,11 +59,11 @@ LOSCFG_USER_TEST_MEM_VM = true LOSCFG_USER_TEST_PROCESS_THREAD = true # Module list -LOSCFG_USER_TEST_PROCESS_BASIC_PROCESS = true -LOSCFG_USER_TEST_PROCESS_BASIC_PTHREAD = true -LOSCFG_USER_TEST_PROCESS_LOCK_MUTEX = true -LOSCFG_USER_TEST_PROCESS_LOCK_RWLOCK = true -LOSCFG_USER_TEST_PROCESS_LOCK_SPINLOCK = true +LOSCFG_USER_TEST_MUTEX = true +LOSCFG_USER_TEST_PROCESS = true +LOSCFG_USER_TEST_PTHREAD = true +LOSCFG_USER_TEST_RWLOCK = true +LOSCFG_USER_TEST_SPINLOCK = true ########## extended test ########## # Control switch for extended function test @@ -102,15 +97,15 @@ LOSCFG_USER_TEST_FS_VFAT = false LOSCFG_USER_TEST_LIBC = true # Module list -LOSCFG_USER_TEST_LIBC_IO = true -LOSCFG_USER_TEST_LIBC_MISC = true -LOSCFG_USER_TEST_LIBC_POSIX_MEM = true -LOSCFG_USER_TEST_LIBC_POSIX_MQUEUE = true -LOSCFG_USER_TEST_LIBC_POSIX_PTHREAD = false -LOSCFG_USER_TEST_LIBC_SYS = true -LOSCFG_USER_TEST_LIBC_TIME_CLOCK = true -LOSCFG_USER_TEST_LIBC_TIME_TIMER = true -LOSCFG_USER_TEST_LIBC_UTIL = true +LOSCFG_USER_TEST_IO = true +LOSCFG_USER_TEST_MISC = true +LOSCFG_USER_TEST_POSIX_MEM = true +LOSCFG_USER_TEST_POSIX_MQUEUE = true +LOSCFG_USER_TEST_POSIX_PTHREAD = false +LOSCFG_USER_TEST_SYS = true +LOSCFG_USER_TEST_TIME_CLOCK = true +LOSCFG_USER_TEST_TIME_TIMER = true +LOSCFG_USER_TEST_UTIL = true ########## net test ########## # Control switch for network function test @@ -129,53 +124,3 @@ LOSCFG_USER_TEST_SECURITY = true LOSCFG_USER_TEST_SECURITY_CAPABILITY = true LOSCFG_USER_TEST_SECURITY_REUGID = true LOSCFG_USER_TEST_SECURITY_VID = true - -LOSCFG_USER_TEST_PROCESS_FS = false -if (defined(LOSCFG_PROC_PROCESS_DIR) || liteos_container_test_enable == true) { - LOSCFG_USER_TEST_PROCESS_FS = true -} - -########## container test ########## -LOSCFG_USER_TEST_CONTAINER = false -LOSCFG_USER_TEST_PID_CONTAINER = false -LOSCFG_USER_TEST_UTS_CONTAINER = false -LOSCFG_USER_TEST_MNT_CONTAINER = false -LOSCFG_USER_TEST_IPC_CONTAINER = false -LOSCFG_USER_TEST_TIME_CONTAINER = false -LOSCFG_USER_TEST_USER_CONTAINER = false -LOSCFG_USER_TEST_NET_CONTAINER = false -if (defined(LOSCFG_KERNEL_CONTAINER) || liteos_container_test_enable == true) { - LOSCFG_USER_TEST_CONTAINER = true - if (defined(LOSCFG_PID_CONTAINER) || liteos_container_test_enable == true) { - LOSCFG_USER_TEST_PID_CONTAINER = true - } - if (defined(LOSCFG_UTS_CONTAINER) || liteos_container_test_enable == true) { - LOSCFG_USER_TEST_UTS_CONTAINER = true - } - if (defined(LOSCFG_MNT_CONTAINER) || liteos_container_test_enable == true) { - LOSCFG_USER_TEST_MNT_CONTAINER = true - } - if (defined(LOSCFG_IPC_CONTAINER) || liteos_container_test_enable == true) { - LOSCFG_USER_TEST_IPC_CONTAINER = true - } - if (defined(LOSCFG_TIME_CONTAINER) || liteos_container_test_enable == true) { - LOSCFG_USER_TEST_TIME_CONTAINER = true - } - if (defined(LOSCFG_USER_CONTAINER) || liteos_container_test_enable == true) { - LOSCFG_USER_TEST_USER_CONTAINER = true - } - if (defined(LOSCFG_NET_CONTAINER) || liteos_container_test_enable == true) { - LOSCFG_USER_TEST_NET_CONTAINER = true - } -} - -LOSCFG_USER_TEST_PROCESS_PLIMITS = false -if (defined(LOSCFG_KERNEL_PLIMITS) || liteos_container_test_enable == true) { - LOSCFG_USER_TEST_PROCESS_PLIMITS = true -} - -########## fuzz test ########## -LOSCFG_USER_FUZZ_TEST = false -if (liteos_fuzz_test_enable == true) { - LOSCFG_USER_FUZZ_TEST = true -} diff --git a/src/kernel_liteos_a/testsuites/unittest/drivers/BUILD.gn b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/drivers/BUILD.gn similarity index 90% rename from src/kernel_liteos_a/testsuites/unittest/drivers/BUILD.gn rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/drivers/BUILD.gn index eb3d7c4f..bcd19c53 100644 --- a/src/kernel_liteos_a/testsuites/unittest/drivers/BUILD.gn +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/drivers/BUILD.gn @@ -26,6 +26,8 @@ # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +import("//build/lite/config/test.gni") +import("//kernel/liteos_a/testsuites/unittest/config.gni") import("./config.gni") if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_LOW) { @@ -38,7 +40,7 @@ if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_LOW) { sources_full = [] sources += sources_full configs = [ "..:public_config_for_door" ] - deps = [ "$THIRDPARTY_BOUNDS_CHECKING_FUNCTION_DIR:libsec_shared" ] + deps = [ "//third_party/bounds_checking_function:libsec_shared" ] } } @@ -51,6 +53,6 @@ if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_MIDDLE) { sources += sources_smoke sources += sources_full configs = [ "..:public_config_for_all" ] - deps = [ "$THIRDPARTY_BOUNDS_CHECKING_FUNCTION_DIR:libsec_shared" ] + deps = [ "//third_party/bounds_checking_function:libsec_shared" ] } } diff --git a/src/kernel_liteos_a/testsuites/unittest/drivers/config.gni b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/drivers/config.gni similarity index 96% rename from src/kernel_liteos_a/testsuites/unittest/drivers/config.gni rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/drivers/config.gni index 161d42fe..53a75c75 100644 --- a/src/kernel_liteos_a/testsuites/unittest/drivers/config.gni +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/drivers/config.gni @@ -27,11 +27,10 @@ # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. import("//build/lite/config/test.gni") -import("//kernel/liteos_a/liteos.gni") import("//kernel/liteos_a/testsuites/unittest/config.gni") common_include_dirs = [ - "$THIRDPARTY_GOOGLETEST_DIR/googletest/include", + "//third_party/googletest/googletest/include", "../common/include", ] diff --git a/src/kernel_liteos_a/testsuites/unittest/drivers/hid/config.gni b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/drivers/hid/config.gni similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/drivers/hid/config.gni rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/drivers/hid/config.gni diff --git a/src/kernel_liteos_a/testsuites/unittest/drivers/hid/drivers_hid_test.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/drivers/hid/drivers_hid_test.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/drivers/hid/drivers_hid_test.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/drivers/hid/drivers_hid_test.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/drivers/hid/it_test_hid.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/drivers/hid/it_test_hid.h similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/drivers/hid/it_test_hid.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/drivers/hid/it_test_hid.h diff --git a/src/kernel_liteos_a/testsuites/unittest/drivers/hid/smoke/hid_test_001.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/drivers/hid/smoke/hid_test_001.cpp similarity index 95% rename from src/kernel_liteos_a/testsuites/unittest/drivers/hid/smoke/hid_test_001.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/drivers/hid/smoke/hid_test_001.cpp index 8ddeb4f7..d7884710 100644 --- a/src/kernel_liteos_a/testsuites/unittest/drivers/hid/smoke/hid_test_001.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/drivers/hid/smoke/hid_test_001.cpp @@ -53,10 +53,9 @@ static int Testcase(VOID) fd = open(MOUSE_DEV_PATH, O_RDWR, 0666); ICUNIT_ASSERT_NOT_EQUAL(fd, -1, fd); - buf = static_cast(malloc(MOUSE_DATA_LEN)); + buf = (char *)malloc(MOUSE_DATA_LEN); ICUNIT_ASSERT_NOT_EQUAL(buf, NULL, buf); - ret = memset_s(buf, MOUSE_DATA_LEN, 0, MOUSE_DATA_LEN); - ICUNIT_ASSERT_EQUAL(ret, 0, ret); + (void)memset_s(buf, MOUSE_DATA_LEN, 0, MOUSE_DATA_LEN); ret = ioctl(fd, USB_GET_REPORT_ID, &id); ICUNIT_ASSERT_NOT_EQUAL(ret, -1, ret); diff --git a/src/kernel_liteos_a/testsuites/unittest/drivers/storage/config.gni b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/drivers/storage/config.gni similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/drivers/storage/config.gni rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/drivers/storage/config.gni diff --git a/src/kernel_liteos_a/testsuites/unittest/drivers/storage/drivers_storage_test.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/drivers/storage/drivers_storage_test.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/drivers/storage/drivers_storage_test.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/drivers/storage/drivers_storage_test.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/drivers/storage/it_test_storage.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/drivers/storage/it_test_storage.h similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/drivers/storage/it_test_storage.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/drivers/storage/it_test_storage.h diff --git a/src/kernel_liteos_a/testsuites/unittest/drivers/storage/smoke/storage_test_001.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/drivers/storage/smoke/storage_test_001.cpp similarity index 94% rename from src/kernel_liteos_a/testsuites/unittest/drivers/storage/smoke/storage_test_001.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/drivers/storage/smoke/storage_test_001.cpp index 62e48e1e..9e35c78f 100644 --- a/src/kernel_liteos_a/testsuites/unittest/drivers/storage/smoke/storage_test_001.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/drivers/storage/smoke/storage_test_001.cpp @@ -51,10 +51,9 @@ static int Testcase(VOID) fd = open(STORAGE_DEV_PATH, O_RDWR, 0666); ICUNIT_ASSERT_NOT_EQUAL(fd, -1, fd); - buf = static_cast(malloc(STORAGE_DATA_LEN)); + buf = (char *)malloc(STORAGE_DATA_LEN); ICUNIT_ASSERT_NOT_EQUAL(buf, NULL, buf); - ret = memset_s(buf, STORAGE_DATA_LEN, 0, STORAGE_DATA_LEN); - ICUNIT_ASSERT_EQUAL(ret, 0, ret); + (void)memset_s(buf, STORAGE_DATA_LEN, 0, STORAGE_DATA_LEN); ret = ioctl(fd, DIOC_GETPRIV, &bch); printf("bch = %#x, &bch = %#x, errno = %d\n", bch, &bch, errno); diff --git a/src/kernel_liteos_a/testsuites/unittest/extended/BUILD.gn b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/BUILD.gn similarity index 90% rename from src/kernel_liteos_a/testsuites/unittest/extended/BUILD.gn rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/BUILD.gn index f57067ae..a218fdea 100644 --- a/src/kernel_liteos_a/testsuites/unittest/extended/BUILD.gn +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/BUILD.gn @@ -26,6 +26,8 @@ # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +import("//build/lite/config/test.gni") +import("//kernel/liteos_a/testsuites/unittest/config.gni") import("./config.gni") if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_LOW) { @@ -38,7 +40,7 @@ if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_LOW) { sources_full = [] sources += sources_full configs = [ "..:public_config_for_door" ] - deps = [ "$THIRDPARTY_BOUNDS_CHECKING_FUNCTION_DIR:libsec_shared" ] + deps = [ "//third_party/bounds_checking_function:libsec_shared" ] } } @@ -51,6 +53,6 @@ if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_MIDDLE) { sources += sources_smoke sources += sources_full configs = [ "..:public_config_for_all" ] - deps = [ "$THIRDPARTY_BOUNDS_CHECKING_FUNCTION_DIR:libsec_shared" ] + deps = [ "//third_party/bounds_checking_function:libsec_shared" ] } } diff --git a/src/kernel_liteos_a/testsuites/unittest/extended/config.gni b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/config.gni similarity index 96% rename from src/kernel_liteos_a/testsuites/unittest/extended/config.gni rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/config.gni index 3a341b62..710c975f 100644 --- a/src/kernel_liteos_a/testsuites/unittest/extended/config.gni +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/config.gni @@ -27,11 +27,10 @@ # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. import("//build/lite/config/test.gni") -import("//kernel/liteos_a/liteos.gni") import("//kernel/liteos_a/testsuites/unittest/config.gni") common_include_dirs = [ - "$THIRDPARTY_GOOGLETEST_DIR/googletest/include", + "//third_party/googletest/googletest/include", "../common/include", ] diff --git a/src/kernel_liteos_a/testsuites/unittest/extended/ipc/It_test_IPC.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/ipc/It_test_IPC.h similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/extended/ipc/It_test_IPC.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/ipc/It_test_IPC.h diff --git a/src/kernel_liteos_a/testsuites/unittest/extended/ipc/config.gni b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/ipc/config.gni similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/extended/ipc/config.gni rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/ipc/config.gni diff --git a/src/kernel_liteos_a/testsuites/unittest/extended/ipc/full/ipc_test_mkfifoat_001.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/ipc/full/ipc_test_mkfifoat_001.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/extended/ipc/full/ipc_test_mkfifoat_001.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/ipc/full/ipc_test_mkfifoat_001.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/extended/ipc/full/ipc_test_mkfifoat_002.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/ipc/full/ipc_test_mkfifoat_002.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/extended/ipc/full/ipc_test_mkfifoat_002.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/ipc/full/ipc_test_mkfifoat_002.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/extended/ipc/ipc_test.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/ipc/ipc_test.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/extended/ipc/ipc_test.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/ipc/ipc_test.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/extended/liteipc/config.gni b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/liteipc/config.gni similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/extended/liteipc/config.gni rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/liteipc/config.gni diff --git a/src/kernel_liteos_a/testsuites/unittest/extended/liteipc/it_test_liteipc.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/liteipc/it_test_liteipc.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/extended/liteipc/it_test_liteipc.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/liteipc/it_test_liteipc.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/extended/liteipc/it_test_liteipc.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/liteipc/it_test_liteipc.h similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/extended/liteipc/it_test_liteipc.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/liteipc/it_test_liteipc.h diff --git a/src/kernel_liteos_a/testsuites/unittest/extended/liteipc/liteipc.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/liteipc/liteipc.h similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/extended/liteipc/liteipc.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/liteipc/liteipc.h diff --git a/src/kernel_liteos_a/testsuites/unittest/extended/liteipc/smgr_demo.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/liteipc/smgr_demo.cpp similarity index 92% rename from src/kernel_liteos_a/testsuites/unittest/extended/liteipc/smgr_demo.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/liteipc/smgr_demo.cpp index 9c49d25c..624f2883 100644 --- a/src/kernel_liteos_a/testsuites/unittest/extended/liteipc/smgr_demo.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/liteipc/smgr_demo.cpp @@ -48,7 +48,7 @@ BOOL g_cmsRunningFlag = FALSE; static void InitCms() { - (void)memset_s(g_serviceNameMap, sizeof(g_serviceNameMap), 0, sizeof(g_serviceNameMap)); + memset(g_serviceNameMap, 0, sizeof(g_serviceNameMap)); } uint32_t SetCms(int fd) @@ -66,7 +66,7 @@ void SendReply(int fd, IpcMsg *dataIn, uint32_t result, uint32_t serviceHandle) data1.flag = SEND | BUFF_FREE; data1.buffToFree = dataIn; data1.outMsg = &dataOut; - (void)memset_s(data1.outMsg, sizeof(IpcMsg), 0, sizeof(IpcMsg)); + memset(data1.outMsg, 0, sizeof(IpcMsg)); data1.outMsg->type = MT_REPLY; data1.outMsg->target.handle = dataIn->taskID; data1.outMsg->target.token = dataIn->target.token; @@ -118,12 +118,12 @@ uint32_t RegService(int fd, char *serviceName, uint32_t nameLen, uint32_t *servi if (nameLen > NAME_LEN_MAX) { return -1; } - (void)memcpy_s(name.serviceName, nameLen, serviceName, nameLen); + memcpy(name.serviceName, serviceName, nameLen); name.nameLen = nameLen; data1.flag = SEND | RECV; data1.outMsg = &dataOut; - (void)memset_s(data1.outMsg, sizeof(IpcMsg), 0, sizeof(IpcMsg)); + memset(data1.outMsg, 0, sizeof(IpcMsg)); data1.outMsg->type = MT_REQUEST; data1.outMsg->target.handle = 0; data1.outMsg->code = REG_CODE; @@ -153,12 +153,12 @@ uint32_t GetService(int fd, char *serviceName, uint32_t nameLen, uint32_t *servi if (nameLen > NAME_LEN_MAX) { return -1; } - (void)memcpy_s(name.serviceName, nameLen, serviceName, nameLen); + memcpy(name.serviceName, serviceName, nameLen); name.nameLen = nameLen; data1.flag = SEND | RECV; data1.outMsg = &dataOut; - (void)memset_s(data1.outMsg, sizeof(IpcMsg), 0, sizeof(IpcMsg)); + memset(data1.outMsg, 0, sizeof(IpcMsg)); data1.outMsg->type = MT_REQUEST; data1.outMsg->target.handle = 0; data1.outMsg->code = GET_CODE; @@ -196,7 +196,7 @@ static void HandleServiceRegAndGet(int fd, IpcMsg *data) } } } - printf("receive service request, code:%d, service name:%s\n", data->code, info->serviceName); + printf("recieve service request, code:%d, service name:%s\n", data->code, info->serviceName); switch (data->code) { case REG_CODE: if (i == MAX_SREVICE_NUM) { @@ -210,8 +210,7 @@ static void HandleServiceRegAndGet(int fd, IpcMsg *data) printf("the task has already a service named:%s\n", g_serviceNameMap[content.serviceHandle].serviceName); goto ERROR_REG; } else { - (void)memcpy_s(g_serviceNameMap[content.serviceHandle].serviceName, info->nameLen, - info->serviceName, info->nameLen); + (void)memcpy_s(g_serviceNameMap[content.serviceHandle].serviceName, info->nameLen, info->serviceName, info->nameLen); g_serviceNameMap[content.serviceHandle].nameLen = info->nameLen; SendReply(fd, data, 0, content.serviceHandle); } @@ -282,7 +281,7 @@ void StopCms(int fd) data1.flag = SEND; data1.outMsg = &dataOut; - (void)memset_s(data1.outMsg, sizeof(IpcMsg), 0, sizeof(IpcMsg)); + memset(data1.outMsg, 0, sizeof(IpcMsg)); data1.outMsg->type = MT_REQUEST; data1.outMsg->target.handle = 0; data1.outMsg->code = STOP_CODE; diff --git a/src/kernel_liteos_a/testsuites/unittest/extended/liteipc/smgr_demo.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/liteipc/smgr_demo.h similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/extended/liteipc/smgr_demo.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/liteipc/smgr_demo.h diff --git a/src/kernel_liteos_a/testsuites/unittest/extended/liteipc/smoke/liteipc_test_001.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/liteipc/smoke/liteipc_test_001.cpp similarity index 84% rename from src/kernel_liteos_a/testsuites/unittest/extended/liteipc/smoke/liteipc_test_001.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/liteipc/smoke/liteipc_test_001.cpp index 62cb49a0..658e68e9 100644 --- a/src/kernel_liteos_a/testsuites/unittest/extended/liteipc/smoke/liteipc_test_001.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/liteipc/smoke/liteipc_test_001.cpp @@ -62,24 +62,26 @@ static int LiteIpcTest(void) /* testing mmap liteipc mem pool with different size and flag */ retptr = mmap(nullptr, 1024 * 4096, PROT_READ, MAP_PRIVATE, fd, 0); - ICUNIT_ASSERT_EQUAL(static_cast(static_cast(retptr)), -1, retptr); + ICUNIT_ASSERT_EQUAL((int)(intptr_t)retptr, -1, retptr); + //retptr = mmap(nullptr, 0, PROT_READ, MAP_PRIVATE, fd, 0); + //ICUNIT_ASSERT_EQUAL((int)(intptr_t)retptr, -1, retptr); retptr = mmap(nullptr, -1, PROT_READ, MAP_PRIVATE, fd, 0); - ICUNIT_ASSERT_EQUAL(static_cast(static_cast(retptr)), -1, retptr); + ICUNIT_ASSERT_EQUAL((int)(intptr_t)retptr, -1, retptr); retptr = mmap(nullptr, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0); - ICUNIT_ASSERT_EQUAL(static_cast(static_cast(retptr)), -1, retptr); - retptr = mmap(nullptr, 4096, PROT_READ, MAP_SHARED, fd, 0); // 4096: length of mapped memory - ICUNIT_ASSERT_EQUAL(static_cast(static_cast(retptr)), -1, retptr); + ICUNIT_ASSERT_EQUAL((int)(intptr_t)retptr, -1, retptr); + retptr = mmap(nullptr, 4096, PROT_READ, MAP_SHARED, fd, 0); + ICUNIT_ASSERT_EQUAL((int)(intptr_t)retptr, -1, retptr); retptr = mmap(nullptr, 1, PROT_READ, MAP_PRIVATE, fd, 0); - ICUNIT_ASSERT_NOT_EQUAL(static_cast(static_cast(retptr)), -1, retptr); + ICUNIT_ASSERT_NOT_EQUAL((int)(intptr_t)retptr, -1, retptr); retptr = mmap(nullptr, 4095, PROT_READ, MAP_PRIVATE, fd, 0); - ICUNIT_ASSERT_EQUAL(static_cast(static_cast(retptr)), -1, retptr); + ICUNIT_ASSERT_EQUAL((int)(intptr_t)retptr, -1, retptr); /* testing read/write api */ char buf[10] = {0}; ret = read(fd, buf, 10); ICUNIT_ASSERT_EQUAL(ret, -1, ret); - ret = write(fd, buf, 10); // 10: size of buf + ret = write(fd, buf, 10); ICUNIT_ASSERT_EQUAL(ret, -1, ret); /* before set cms, testing ioctl cmd */ @@ -94,7 +96,7 @@ static int LiteIpcTest(void) sleep(2); /* after set cms, testing set cms cmd */ - ret = ioctl(fd, IPC_SET_CMS, 200); // 200: use 200 for set cms cmd testing + ret = ioctl(fd, IPC_SET_CMS, 200); ICUNIT_ASSERT_NOT_EQUAL(ret, 0, ret); exit(0); @@ -119,7 +121,7 @@ static int TestCase(void) ICUNIT_ASSERT_NOT_EQUAL(fd, -1, fd); retptr = mmap(nullptr, 16 * 4096, PROT_READ, MAP_PRIVATE, fd, 0); - ICUNIT_ASSERT_NOT_EQUAL(static_cast(static_cast(retptr)), -1, retptr); + ICUNIT_ASSERT_NOT_EQUAL((int)(intptr_t)retptr, -1, retptr); ret = ioctl(fd, IPC_SET_CMS, 0); ICUNIT_ASSERT_NOT_EQUAL(ret, 0, ret); ret = ioctl(fd, IPC_SET_CMS, 200); diff --git a/src/kernel_liteos_a/testsuites/unittest/extended/liteipc/smoke/liteipc_test_002.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/liteipc/smoke/liteipc_test_002.cpp similarity index 96% rename from src/kernel_liteos_a/testsuites/unittest/extended/liteipc/smoke/liteipc_test_002.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/liteipc/smoke/liteipc_test_002.cpp index 0adbbe06..4c397ba5 100644 --- a/src/kernel_liteos_a/testsuites/unittest/extended/liteipc/smoke/liteipc_test_002.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/liteipc/smoke/liteipc_test_002.cpp @@ -65,7 +65,7 @@ static int CallTestServiceLoop(uint32_t id) ret = GetService(g_ipcFd, g_serviceName, sizeof(g_serviceName), &serviceHandle); ICUNIT_ASSERT_NOT_EQUAL(ret, 0, ret); retptr = mmap(NULL, 4096, PROT_READ, MAP_PRIVATE, g_ipcFd, 0); - ICUNIT_ASSERT_NOT_EQUAL(static_cast(static_cast(retptr)), -1, retptr); + ICUNIT_ASSERT_NOT_EQUAL((int)(intptr_t)retptr, -1, retptr); ret = GetService(g_ipcFd, g_serviceName, sizeof(g_serviceName), &serviceHandle); ICUNIT_ASSERT_EQUAL(ret, 0, ret); @@ -78,7 +78,7 @@ static int CallTestServiceLoop(uint32_t id) #endif data1.flag = SEND | RECV; data1.outMsg = &dataOut; - (void)memset_s(data1.outMsg, sizeof(IpcMsg), 0, sizeof(IpcMsg)); + memset(data1.outMsg, 0, sizeof(IpcMsg)); data1.outMsg->type = MT_REQUEST; data1.outMsg->target.handle = serviceHandle; data1.outMsg->dataSz = 4; @@ -98,7 +98,7 @@ static int CallTestServiceLoop(uint32_t id) char tmpBuff[2048]; data1.flag = SEND | RECV; data1.outMsg = &dataOut; - (void)memset_s(data1.outMsg, sizeof(IpcMsg), 0, sizeof(IpcMsg)); + memset(data1.outMsg, 0, sizeof(IpcMsg)); data1.outMsg->type = MT_REQUEST; data1.outMsg->target.handle = serviceHandle; data1.outMsg->dataSz = 1024; @@ -141,7 +141,7 @@ static int TestServiceLoop(void) ret = RegService(g_ipcFd, g_serviceName, sizeof(g_serviceName), &serviceHandle); ICUNIT_ASSERT_NOT_EQUAL(ret, 0, ret); retptr = mmap(NULL, 4096, PROT_READ, MAP_PRIVATE, g_ipcFd, 0); - ICUNIT_ASSERT_NOT_EQUAL(static_cast(static_cast(retptr)), -1, retptr); + ICUNIT_ASSERT_NOT_EQUAL((int)(intptr_t)retptr, -1, retptr); ret = RegService(g_ipcFd, g_serviceName, sizeof(g_serviceName), &serviceHandle); ICUNIT_ASSERT_EQUAL(ret, 0, ret); diff --git a/src/kernel_liteos_a/testsuites/unittest/extended/signal/config.gni b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/config.gni similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/extended/signal/config.gni rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/config.gni diff --git a/src/kernel_liteos_a/testsuites/unittest/extended/signal/full/It_ipc_fdclr_001.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/full/It_ipc_fdclr_001.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/extended/signal/full/It_ipc_fdclr_001.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/full/It_ipc_fdclr_001.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/extended/signal/full/It_ipc_fdset_001.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/full/It_ipc_fdset_001.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/extended/signal/full/It_ipc_fdset_001.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/full/It_ipc_fdset_001.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/extended/signal/full/It_ipc_fdzero_001.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/full/It_ipc_fdzero_001.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/extended/signal/full/It_ipc_fdzero_001.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/full/It_ipc_fdzero_001.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/extended/signal/full/It_ipc_pipe_002.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/full/It_ipc_pipe_002.cpp similarity index 95% rename from src/kernel_liteos_a/testsuites/unittest/extended/signal/full/It_ipc_pipe_002.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/full/It_ipc_pipe_002.cpp index bb91fb3e..be0e2578 100644 --- a/src/kernel_liteos_a/testsuites/unittest/extended/signal/full/It_ipc_pipe_002.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/full/It_ipc_pipe_002.cpp @@ -37,10 +37,10 @@ static UINT32 Testcase(VOID) char buffer[20]; // 20, target buffer size int *sharedflag = NULL; int shmid; - + ret = pipe(pipeFd); ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT1); - shmid = shmget(static_cast(IPC_PRIVATE), sizeof(int), 0666 | IPC_CREAT); // 0666 the authority of the shm + shmid = shmget((key_t)IPC_PRIVATE, sizeof(int), 0666 | IPC_CREAT); // 0666 the authority of the shm ICUNIT_ASSERT_NOT_EQUAL(shmid, -1, shmid); sharedflag = (int *)shmat(shmid, NULL, 0); *sharedflag = 0; @@ -53,7 +53,7 @@ static UINT32 Testcase(VOID) ret = write(pipeFd[1], "hello world", 12); // 12, "hello world" length and '\0' printf("write first status: %d\n", ret); if (ret != 12) { // 12, "hello world" length and '\0' - exit(11); // 11, the value of son process unexpected exit, convenient to debug + exit(11); // 11, the value of son process unexpect exit, convenient to debug } *sharedflag = 1; close(pipeFd[1]); diff --git a/src/kernel_liteos_a/testsuites/unittest/extended/signal/full/It_ipc_pipe_003.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/full/It_ipc_pipe_003.cpp similarity index 94% rename from src/kernel_liteos_a/testsuites/unittest/extended/signal/full/It_ipc_pipe_003.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/full/It_ipc_pipe_003.cpp index f3b3b8f3..e19417f8 100644 --- a/src/kernel_liteos_a/testsuites/unittest/extended/signal/full/It_ipc_pipe_003.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/full/It_ipc_pipe_003.cpp @@ -42,7 +42,7 @@ static UINT32 Testcase(VOID) ret = pipe(pipeFd); ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT1); - shmid = shmget(static_cast(IPC_PRIVATE), sizeof(int), 0666 | IPC_CREAT); // 0666 the authority of the shm + shmid = shmget((key_t)IPC_PRIVATE, sizeof(int), 0666 | IPC_CREAT); // 0666 the authority of the shm ICUNIT_ASSERT_NOT_EQUAL(shmid, -1, shmid); sharedflag = (int *)shmat(shmid, NULL, 0); *sharedflag = 0; @@ -55,7 +55,7 @@ static UINT32 Testcase(VOID) ret = write(pipeFd[1], "Hello world", TAR_STR_LEN); printf("write first status: %d\n", ret); if (ret != TAR_STR_LEN) { - exit(11); // 11, the value of son process unexpected exit, convenient to debug + exit(11); // 11, the value of son process unexpect exit, convenient to debug } *sharedflag = 1; close(pipeFd[1]); diff --git a/src/kernel_liteos_a/testsuites/unittest/extended/signal/full/It_ipc_sigaction_001.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/full/It_ipc_sigaction_001.cpp similarity index 97% rename from src/kernel_liteos_a/testsuites/unittest/extended/signal/full/It_ipc_sigaction_001.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/full/It_ipc_sigaction_001.cpp index 06870d8a..14f33ef6 100644 --- a/src/kernel_liteos_a/testsuites/unittest/extended/signal/full/It_ipc_sigaction_001.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/full/It_ipc_sigaction_001.cpp @@ -69,7 +69,7 @@ static UINT32 Testcase(VOID) ret = sigaction(SIGCHLD, &oldact, NULL); if (ret == -1) { - exit(6); // 6, the value of son process unexpected exit, convenient to debug + exit(6); // 6, the value of son process unexpect exit, convenient to debug } sleep(1); printf("---son--cnt check----%d--------\n", g_actionCnt1); diff --git a/src/kernel_liteos_a/testsuites/unittest/extended/signal/full/It_ipc_sigpause_001.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/full/It_ipc_sigpause_001.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/extended/signal/full/It_ipc_sigpause_001.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/full/It_ipc_sigpause_001.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/extended/signal/full/It_ipc_sigprocmask_001.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/full/It_ipc_sigprocmask_001.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/extended/signal/full/It_ipc_sigprocmask_001.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/full/It_ipc_sigprocmask_001.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/extended/signal/full/pipe_test_001.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/full/pipe_test_001.cpp similarity index 96% rename from src/kernel_liteos_a/testsuites/unittest/extended/signal/full/pipe_test_001.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/full/pipe_test_001.cpp index 8e24b370..fe13fd1d 100644 --- a/src/kernel_liteos_a/testsuites/unittest/extended/signal/full/pipe_test_001.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/full/pipe_test_001.cpp @@ -59,12 +59,12 @@ int TestPipeSingleProcess() char sentence1[15] = "Hello World"; char a[4] = {0}; (void)sprintf_s(a, sizeof(a), "%d", i); - (void)strcat_s(sentence1, 15, a); // 15, sizeof sentence1 + strcat(sentence1, a); int ret = write(*writeFd, sentence1, strlen(sentence1) + 1); usleep(100000); // 100000, Used to calculate the delay time. printf("read\n"); - (void)memset_s(readbuffer, sizeof(readbuffer), 0, sizeof(readbuffer)); + memset(readbuffer, 0, sizeof(readbuffer)); retValue = read(*readFd, readbuffer, sizeof(readbuffer)); printf("Receive %d bytes data : %s,%d\n", retValue, readbuffer, errno); if (strncmp((readbuffer), (readbuffer), (strlen(sentence1))) != 0) { diff --git a/src/kernel_liteos_a/testsuites/unittest/extended/signal/full/pipe_test_003.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/full/pipe_test_003.cpp similarity index 95% rename from src/kernel_liteos_a/testsuites/unittest/extended/signal/full/pipe_test_003.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/full/pipe_test_003.cpp index 03d5eafd..6c76e23b 100644 --- a/src/kernel_liteos_a/testsuites/unittest/extended/signal/full/pipe_test_003.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/full/pipe_test_003.cpp @@ -59,7 +59,7 @@ int TestPipeSingleProcessFcntl() char sentence1[15] = "Hello World"; char a[4] = {0}; (void)sprintf_s(a, sizeof(a), "%d", i); - (void)strcat_s(sentence1, 15, a); // 15, sizeof sentence1 + strcat(sentence1, a); int ret = write(*writeFd, sentence1, strlen(sentence1) + 1); usleep(100000); // 100000, Used to calculate the delay time. } @@ -67,7 +67,7 @@ int TestPipeSingleProcessFcntl() char a[4] = {0}; usleep(10000); // 10000, Used to calculate the delay time. printf("read\n"); - (void)memset_s(readbuffer, sizeof(readbuffer), 0, sizeof(readbuffer)); + memset(readbuffer, 0, sizeof(readbuffer)); retValue = read(*readFd, readbuffer, sizeof(readbuffer)); printf("Receive %d bytes data : %s,%d\n", retValue, readbuffer, errno); printf("Receive %d bytes data : %s,%d\n", retValue, readbuffer + 13, errno); // 13, readbuffer offset. @@ -78,7 +78,7 @@ int TestPipeSingleProcessFcntl() usleep(100000); // 100000, Used to calculate the delay time. printf("read\n"); - (void)memset_s(readbuffer, sizeof(readbuffer), 0, sizeof(readbuffer)); + memset(readbuffer, 0, sizeof(readbuffer)); fcntl(*readFd, F_SETFL, O_NONBLOCK); ret = fcntl(*readFd, F_GETFL, O_NONBLOCK); printf("fctrl ret=%d,O_NONBLOCK=%d\n", ret, O_NONBLOCK); diff --git a/src/kernel_liteos_a/testsuites/unittest/extended/signal/full/pipe_test_005.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/full/pipe_test_005.cpp similarity index 96% rename from src/kernel_liteos_a/testsuites/unittest/extended/signal/full/pipe_test_005.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/full/pipe_test_005.cpp index 720f9b6f..9b490529 100644 --- a/src/kernel_liteos_a/testsuites/unittest/extended/signal/full/pipe_test_005.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/full/pipe_test_005.cpp @@ -56,7 +56,7 @@ static int PipecommonWrite() printf("signal error\n"); } - shmid = shmget(static_cast(IPC_PRIVATE), sizeof(int), 0666 | IPC_CREAT); // 0666 the authority of the shm + shmid = shmget((key_t)IPC_PRIVATE, sizeof(int), 0666 | IPC_CREAT); // 0666 the authority of the shm ICUNIT_ASSERT_NOT_EQUAL(shmid, -1, shmid); sharedflag = (int *)shmat(shmid, NULL, 0); *sharedflag = 0; diff --git a/src/kernel_liteos_a/testsuites/unittest/extended/signal/full/pipe_test_006.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/full/pipe_test_006.cpp similarity index 94% rename from src/kernel_liteos_a/testsuites/unittest/extended/signal/full/pipe_test_006.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/full/pipe_test_006.cpp index 3bd8e54a..c0da9ea7 100644 --- a/src/kernel_liteos_a/testsuites/unittest/extended/signal/full/pipe_test_006.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/full/pipe_test_006.cpp @@ -31,8 +31,6 @@ #include "it_test_signal.h" #include "signal.h" -static const int NAME_LEN = 60; - static const int MAX_PIPES = 32; static int PipeUnlinkTest() @@ -43,7 +41,7 @@ static int PipeUnlinkTest() int retValue = -1; int status, ret; - char devName[NAME_LEN]; // 60, array subscript + char devName[60]; // 60, array subscript pid = fork(); if (pid == -1) { printf("Fork Error!\n"); @@ -56,7 +54,7 @@ static int PipeUnlinkTest() retValue = pipe(tmpFd); ICUNIT_ASSERT_EQUAL_EXIT(retValue, -1, __LINE__); for (int i = 0; i < MAX_PIPES; i++) { - (void)snprintf_s(devName, NAME_LEN, NAME_LEN - 1, "/dev/pipe%d", i); // 60, len of max size + snprintf(devName, 60, "/dev/pipe%d", i); // 60, len of max size retValue = unlink(devName); ICUNIT_ASSERT_EQUAL_EXIT(retValue, -1, __LINE__); retValue = close(pipefd[i][0]); diff --git a/src/kernel_liteos_a/testsuites/unittest/extended/signal/full/signal_test_001.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/full/signal_test_001.cpp similarity index 90% rename from src/kernel_liteos_a/testsuites/unittest/extended/signal/full/signal_test_001.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/full/signal_test_001.cpp index 05914887..cc7d2510 100644 --- a/src/kernel_liteos_a/testsuites/unittest/extended/signal/full/signal_test_001.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/full/signal_test_001.cpp @@ -90,31 +90,31 @@ static int TestCase(void) printf("errline = %d\n", __LINE__); exit(-1); } - ret = kill(10, 31); // 10, kill process pid; 31, signal. + ret = kill(10, 31); // 10, kill process pid; 31, sigal. if (retValue != -1 || errno != EINVAL) { printf("errline = %d\n", __LINE__); exit(-1); } - ret = kill(10, 32); // 10, kill process pid; 32, signal. + ret = kill(10, 32); // 10, kill process pid; 32, sigal. if (retValue != -1 || errno != EINVAL) { printf("errline = %d\n", __LINE__); exit(-1); } - ret = kill(2, 32); // 2, kill process pid; 32, signal. + ret = kill(2, 32); // 2, kill process pid; 32, sigal. if (retValue != -1 || errno != EINVAL) { printf("errline = %d\n", __LINE__); exit(-1); } printf("test EPERM begin\n"); - ret = kill(2, 5); // 2, kill process pid; 5, signal. + ret = kill(2, 5); // 2, kill process pid; 5, sigal. if (retValue != -1 || errno != EPERM) { printf("errline = %d\n", __LINE__); exit(-1); } - ret = kill(3, 5); // 3, kill process pid; 5, signal. + ret = kill(3, 5); // 3, kill process pid; 5, sigal. if (retValue != -1 || errno != EPERM) { printf("errline = %d\n", __LINE__); exit(-1); @@ -126,7 +126,7 @@ static int TestCase(void) exit(-1); } - ret = kill(1, 5); // 5, kill signal num . + ret = kill(1, 5); // 5, kill sigal num . if (retValue != -1 || errno != EPERM) { printf("errline = %d\n", __LINE__); exit(-1); @@ -162,8 +162,8 @@ static int TestCase(void) exit(-1); } - printf("1 pending=%lu\n", pending.__bits[0]); - printf("1 oldmask=%lu\n", oldmask.__bits[0]); + printf("1 pending=%d\n", pending.__bits[0]); + printf("1 oldmask=%d\n", oldmask.__bits[0]); printf("before raise\n"); raise(SIGALRM); printf("after raise\n"); @@ -172,7 +172,7 @@ static int TestCase(void) printf("errline = %d\n", __LINE__); exit(-1); } - printf("pending=%d,sigismem = %lu\n", pending.__bits[0], sigismember(&pending, SIGALRM)); + printf("pending=%d,sigismem = %d\n", pending.__bits[0], sigismember(&pending, SIGALRM)); exit(0); } sleep(1); diff --git a/src/kernel_liteos_a/testsuites/unittest/extended/signal/full/signal_test_003.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/full/signal_test_003.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/extended/signal/full/signal_test_003.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/full/signal_test_003.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/extended/signal/full/signal_test_004.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/full/signal_test_004.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/extended/signal/full/signal_test_004.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/full/signal_test_004.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/extended/signal/full/signal_test_005.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/full/signal_test_005.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/extended/signal/full/signal_test_005.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/full/signal_test_005.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/extended/signal/full/signal_test_006.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/full/signal_test_006.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/extended/signal/full/signal_test_006.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/full/signal_test_006.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/extended/signal/full/signal_test_007.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/full/signal_test_007.cpp similarity index 97% rename from src/kernel_liteos_a/testsuites/unittest/extended/signal/full/signal_test_007.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/full/signal_test_007.cpp index 906582bf..1fcb74ee 100644 --- a/src/kernel_liteos_a/testsuites/unittest/extended/signal/full/signal_test_007.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/full/signal_test_007.cpp @@ -40,7 +40,7 @@ static void SigChildResponse(int signo) wait(nullptr); } -/* Register SIGCHLD, through signal to restore the child memory */ +/* Register SIGCHLD, through signal to restore the child memery */ static int TestSigKillResp() { void (*ret)(int) = nullptr; diff --git a/src/kernel_liteos_a/testsuites/unittest/extended/signal/full/signal_test_008.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/full/signal_test_008.cpp similarity index 97% rename from src/kernel_liteos_a/testsuites/unittest/extended/signal/full/signal_test_008.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/full/signal_test_008.cpp index acbc6d3f..dfac5669 100644 --- a/src/kernel_liteos_a/testsuites/unittest/extended/signal/full/signal_test_008.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/full/signal_test_008.cpp @@ -38,7 +38,7 @@ void SigChildResponse(int signo) wait(nullptr); } -/* Register SIGCHLD, through signal to restore the child memory */ +/* Register SIGCHLD, through signal to restore the child memery */ static int TestSigKillWaitFromSigChild() { void (*ret)(int); diff --git a/src/kernel_liteos_a/testsuites/unittest/extended/signal/full/signal_test_010.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/full/signal_test_010.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/extended/signal/full/signal_test_010.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/full/signal_test_010.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/extended/signal/full/signal_test_011.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/full/signal_test_011.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/extended/signal/full/signal_test_011.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/full/signal_test_011.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/extended/signal/full/signal_test_012.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/full/signal_test_012.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/extended/signal/full/signal_test_012.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/full/signal_test_012.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/extended/signal/full/signal_test_015.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/full/signal_test_015.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/extended/signal/full/signal_test_015.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/full/signal_test_015.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/extended/signal/full/signal_test_016.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/full/signal_test_016.cpp similarity index 98% rename from src/kernel_liteos_a/testsuites/unittest/extended/signal/full/signal_test_016.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/full/signal_test_016.cpp index 01e276fc..1e6eebc4 100644 --- a/src/kernel_liteos_a/testsuites/unittest/extended/signal/full/signal_test_016.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/full/signal_test_016.cpp @@ -49,10 +49,10 @@ static void *ThreadSetFunc2(void *arg) ICUNIT_ASSERT_EQUAL_NULL(retValue, 0, retValue); retValue = sigaddset(&set, SIGUSR1); ICUNIT_ASSERT_EQUAL_NULL(retValue, 0, retValue); + int count; retValue = sigwait(&set, &sig); ICUNIT_ASSERT_EQUAL_NULL(retValue, 0, retValue); - return NULL; } static void *ThreadSetDfl(void *arg) @@ -67,15 +67,14 @@ static void *ThreadSetDfl(void *arg) ICUNIT_ASSERT_EQUAL_NULL(retValue, 0, retValue); retValue = sigaddset(&set, SIGUSR1); ICUNIT_ASSERT_EQUAL_NULL(retValue, 0, retValue); + int count; retValue = sigwait(&set, &sig); ICUNIT_ASSERT_EQUAL_NULL(retValue, 0, retValue); - return NULL; } static void *ThreadKill(void *arg) { - (void)arg; while (1) { sleep(1); } @@ -119,6 +118,7 @@ static int TestMultiPthreadKillPendNormal() if (retValue != 0) { exit(retValue); } + int count; retValue = sigwait(&set, &sig); if (retValue != 0) { diff --git a/src/kernel_liteos_a/testsuites/unittest/extended/signal/full/signal_test_017.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/full/signal_test_017.cpp similarity index 97% rename from src/kernel_liteos_a/testsuites/unittest/extended/signal/full/signal_test_017.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/full/signal_test_017.cpp index 675e8569..d1d4ec54 100644 --- a/src/kernel_liteos_a/testsuites/unittest/extended/signal/full/signal_test_017.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/full/signal_test_017.cpp @@ -49,11 +49,10 @@ static void *ThreadSetFunc2(void *arg) ICUNIT_ASSERT_EQUAL_NULL(retValue, 0, retValue); retValue = sigaddset(&set, SIGUSR1); ICUNIT_ASSERT_EQUAL_NULL(retValue, 0, retValue); + int count; retValue = sigwait(&set, &sig); ICUNIT_ASSERT_EQUAL_NULL(retValue, 0, retValue); - - return NULL; } static void *ThreadSetDfl(void *arg) @@ -68,11 +67,10 @@ static void *ThreadSetDfl(void *arg) ICUNIT_ASSERT_EQUAL_NULL(retValue, 0, retValue); retValue = sigaddset(&set, SIGUSR1); ICUNIT_ASSERT_EQUAL_NULL(retValue, 0, retValue); + int count; retValue = sigwait(&set, &sig); ICUNIT_ASSERT_EQUAL_NULL(retValue, 0, retValue); - - return NULL; } static void *ThreadKill(void *arg) @@ -87,11 +85,10 @@ static void *ThreadKill(void *arg) ICUNIT_ASSERT_EQUAL_NULL(retValue, 0, retValue); retValue = sigaddset(&set, SIGUSR1); ICUNIT_ASSERT_EQUAL_NULL(retValue, 0, retValue); + int count; retValue = sigwait(&set, &sig); ICUNIT_ASSERT_EQUAL_NULL(retValue, 0, retValue); - - return NULL; } static int TestMultiPthreadFatherProcessExit() @@ -134,7 +131,7 @@ static int TestMultiPthreadFatherProcessExit() sleep(1); retValue = waitpid(fpids, &status, 0); // grandchild process kill father process, so child process is recovered by init process - // child process doesn't receive termination signal from grandchild process + // child process doesn't receive termination singal from grandchild process // so waitpid() returns -1 ICUNIT_ASSERT_EQUAL(retValue, -1, retValue); exit(1); diff --git a/src/kernel_liteos_a/testsuites/unittest/extended/signal/full/signal_test_018.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/full/signal_test_018.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/extended/signal/full/signal_test_018.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/full/signal_test_018.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/extended/signal/full/signal_test_019.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/full/signal_test_019.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/extended/signal/full/signal_test_019.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/full/signal_test_019.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/extended/signal/full/signal_test_020.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/full/signal_test_020.cpp similarity index 89% rename from src/kernel_liteos_a/testsuites/unittest/extended/signal/full/signal_test_020.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/full/signal_test_020.cpp index 1821b792..e65179a1 100644 --- a/src/kernel_liteos_a/testsuites/unittest/extended/signal/full/signal_test_020.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/full/signal_test_020.cpp @@ -31,7 +31,7 @@ #include "it_test_signal.h" #include "signal.h" -static void SigHandler(int sig) // źŴ +static void SigHandler(int sig) // źŴ { if (sig == SIGINT) { printf("SIGINT sig\n"); @@ -74,8 +74,8 @@ static int TestSigSuspend() if (retValue != 0) { exit(retValue); } - printf("newset 1 = %lx\n", newset.__bits[0]); - printf("old 1 = %lx\n", old.__bits[0]); + printf("newset 1 = %x\n", newset.__bits[0]); + printf("old 1 = %x\n", old.__bits[0]); retValue = sigemptyset(&newset); if (retValue != 0) { @@ -89,8 +89,8 @@ static int TestSigSuspend() if (retValue != 0) { exit(retValue); } - printf("newset 2 = %lx\n", newset.__bits[0]); - printf("old 2 = %lx\n", old.__bits[0]); + printf("newset 2 = %x\n", newset.__bits[0]); + printf("old 2 = %x\n", old.__bits[0]); retValue = sigemptyset(&newset); if (retValue != 0) { @@ -105,8 +105,8 @@ static int TestSigSuspend() if (retValue != 0) { exit(retValue); } - printf("newset 1 = %lx\n", newset.__bits[0]); - printf("old 1 = %lx\n", old.__bits[0]); + printf("newset 1 = %x\n", newset.__bits[0]); + printf("old 1 = %x\n", old.__bits[0]); retValue = sigemptyset(&wait); if (retValue != 0) { @@ -116,7 +116,7 @@ static int TestSigSuspend() if (retValue != 0) { exit(retValue); } - printf("wait = %lx\n", wait.__bits[0]); + printf("wait = %x\n", wait.__bits[0]); if (sigsuspend(&wait) != -1) { printf("sigsuspend error\n"); @@ -126,14 +126,14 @@ static int TestSigSuspend() if (retValue != 0) { exit(retValue); } - printf("old 2= %lx\n", old.__bits[0]); + printf("old 2= %x\n", old.__bits[0]); sigset_t pending; retValue = sigemptyset(&pending); if (retValue != 0) { exit(retValue); } - printf("pending 1= %lx\n", pending.__bits[0]); + printf("pending 1= %x\n", pending.__bits[0]); retValue = raise(SIGINT); if (retValue != 0) { exit(retValue); @@ -142,7 +142,7 @@ static int TestSigSuspend() if (retValue != 0) { exit(retValue); } - printf("pending 2= %lx\n", pending.__bits[0]); + printf("pending 2= %x\n", pending.__bits[0]); retValue = raise(SIGALRM); if (retValue != 0) { @@ -152,7 +152,7 @@ static int TestSigSuspend() if (retValue != 0) { exit(retValue); } - printf("pending 3= %lx\n", pending.__bits[0]); + printf("pending 3= %x\n", pending.__bits[0]); exit(0); } @@ -192,8 +192,8 @@ static int TestSigSuspend() if (retValue != 0) { exit(retValue); } - printf("new 1 = %lx\n", new1.__bits[0]); - printf("old 1 = %lx\n", old1.__bits[0]); + printf("new 1 = %x\n", new1.__bits[0]); + printf("old 1 = %x\n", old1.__bits[0]); retValue = kill(getpid(), SIGINT); if (retValue != 0) { @@ -203,7 +203,7 @@ static int TestSigSuspend() if (retValue != 0) { exit(retValue); } - printf("raise 1 = %lx\n", new1.__bits[0]); + printf("raise 1 = %x\n", new1.__bits[0]); exit(0); } diff --git a/src/kernel_liteos_a/testsuites/unittest/extended/signal/full/signal_test_025.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/full/signal_test_025.cpp similarity index 98% rename from src/kernel_liteos_a/testsuites/unittest/extended/signal/full/signal_test_025.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/full/signal_test_025.cpp index 52e71e59..aef9dd8f 100644 --- a/src/kernel_liteos_a/testsuites/unittest/extended/signal/full/signal_test_025.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/full/signal_test_025.cpp @@ -88,7 +88,7 @@ static int TestBlock() printf("\n\n"); printf("Signal Pause(2)\n"); - printf("To test whether pause can release the signal\n"); + printf("To test whether pause can relese the signal\n"); alarm(clock); retValue = sighold(sig); if (retValue != 0) { diff --git a/src/kernel_liteos_a/testsuites/unittest/extended/signal/full/signal_test_026.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/full/signal_test_026.cpp similarity index 97% rename from src/kernel_liteos_a/testsuites/unittest/extended/signal/full/signal_test_026.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/full/signal_test_026.cpp index 63293c6a..f555f2fd 100644 --- a/src/kernel_liteos_a/testsuites/unittest/extended/signal/full/signal_test_026.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/full/signal_test_026.cpp @@ -80,7 +80,7 @@ static UINT32 TestCase(VOID) sigaddset(&newset, SIGCHLD); timeout.tv_nsec = 1; timeout.tv_sec = 3; // 3, set the sec of timeout. - ret = sigtimedwait(&newset, reinterpret_cast(2), &timeout); // 2, wait for signal num + ret = sigtimedwait(&newset, (siginfo_t *)2, &timeout); // 2, wait for signal num printf("ret = %d errno = %d EFAULT = %d\n", ret, errno, EFAULT); if (ret != -1) { exit(ret); diff --git a/src/kernel_liteos_a/testsuites/unittest/extended/signal/full/signal_test_028.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/full/signal_test_028.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/extended/signal/full/signal_test_028.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/full/signal_test_028.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/extended/signal/full/signal_test_029.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/full/signal_test_029.cpp similarity index 93% rename from src/kernel_liteos_a/testsuites/unittest/extended/signal/full/signal_test_029.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/full/signal_test_029.cpp index c06e84bf..22379f75 100644 --- a/src/kernel_liteos_a/testsuites/unittest/extended/signal/full/signal_test_029.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/full/signal_test_029.cpp @@ -35,7 +35,7 @@ static int g_sigCount = 0; static void SigPrint(int signum) { g_sigCount++; - printf("signal receive success\n"); + printf("signal receive sucess\n"); } static UINT32 TestCase(VOID) @@ -73,7 +73,7 @@ static UINT32 TestCase(VOID) exit(errno); } - ret = sigsuspend(reinterpret_cast(2)); // 2, suspend signal num. + ret = sigsuspend((sigset_t *)2); // 2, suspend signal num. if (ret != -1) { exit(ret); } @@ -89,7 +89,7 @@ static UINT32 TestCase(VOID) exit(errno); } - ret = sigpending(reinterpret_cast(2)); // 2, pending signal num. + ret = sigpending((sigset_t *)2); // 2, pending signal num. if (ret != -1) { exit(ret); } @@ -101,7 +101,7 @@ static UINT32 TestCase(VOID) sleep(1); ret = kill(pid, SIGUSR1); ICUNIT_ASSERT_EQUAL(ret, 0, ret); - printf("kill success\n"); + printf("kill sucess\n"); ret = waitpid(pid, &status, 0); ICUNIT_ASSERT_EQUAL(ret, pid, ret); ICUNIT_ASSERT_EQUAL(WEXITSTATUS(status), LOS_OK, WEXITSTATUS(status)); diff --git a/src/kernel_liteos_a/testsuites/unittest/extended/signal/full/signal_test_030.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/full/signal_test_030.cpp similarity index 97% rename from src/kernel_liteos_a/testsuites/unittest/extended/signal/full/signal_test_030.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/full/signal_test_030.cpp index 563f1273..05fe5691 100644 --- a/src/kernel_liteos_a/testsuites/unittest/extended/signal/full/signal_test_030.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/full/signal_test_030.cpp @@ -35,7 +35,7 @@ static int g_sigCount = 0; static void SigPrint(int sig) { g_sigCount++; - printf("signal receive success\n"); + printf("signal receive sucess\n"); } static UINT32 TestCase(VOID) @@ -68,7 +68,7 @@ static UINT32 TestCase(VOID) sleep(1); ret = kill(pid, SIGUSR1); ICUNIT_ASSERT_EQUAL(ret, 0, ret); - printf("kill success\n"); + printf("kill sucess\n"); wait(&ret); ICUNIT_ASSERT_EQUAL(WEXITSTATUS(ret), LOS_OK, WEXITSTATUS(ret)); return LOS_OK; diff --git a/src/kernel_liteos_a/testsuites/unittest/extended/signal/full/signal_test_033.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/full/signal_test_033.cpp similarity index 98% rename from src/kernel_liteos_a/testsuites/unittest/extended/signal/full/signal_test_033.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/full/signal_test_033.cpp index 11d725d4..dc290704 100644 --- a/src/kernel_liteos_a/testsuites/unittest/extended/signal/full/signal_test_033.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/full/signal_test_033.cpp @@ -36,13 +36,13 @@ static int g_sigCount1 = 0; static void SigPrint(int sig) { g_sigCount++; - printf("signal receive success\n"); + printf("signal receive sucess\n"); } static void SigPrint1(int sig) { g_sigCount1++; - printf("signal receive success\n"); + printf("signal receive sucess\n"); } static UINT32 TestCase(VOID) diff --git a/src/kernel_liteos_a/testsuites/unittest/extended/signal/full/signal_test_038.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/full/signal_test_038.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/extended/signal/full/signal_test_038.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/full/signal_test_038.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/extended/signal/full/signal_test_040.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/full/signal_test_040.cpp similarity index 98% rename from src/kernel_liteos_a/testsuites/unittest/extended/signal/full/signal_test_040.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/full/signal_test_040.cpp index 76654c6a..3750d403 100644 --- a/src/kernel_liteos_a/testsuites/unittest/extended/signal/full/signal_test_040.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/full/signal_test_040.cpp @@ -37,7 +37,7 @@ static void SigPrint(int sig) { (void)sig; g_sigCount++; - printf("signal receive success\cn"); + printf("signal receive sucess\n"); } static UINT32 TestCase(VOID) diff --git a/src/kernel_liteos_a/testsuites/unittest/extended/signal/full/signal_test_041.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/full/signal_test_041.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/extended/signal/full/signal_test_041.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/full/signal_test_041.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/extended/signal/it_test_signal.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/it_test_signal.h similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/extended/signal/it_test_signal.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/it_test_signal.h diff --git a/src/kernel_liteos_a/testsuites/unittest/extended/signal/signal_test.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/signal_test.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/extended/signal/signal_test.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/signal_test.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/extended/signal/smoke/It_ipc_fdisset_001.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/smoke/It_ipc_fdisset_001.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/extended/signal/smoke/It_ipc_fdisset_001.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/smoke/It_ipc_fdisset_001.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/extended/signal/smoke/It_ipc_mkfifo_002.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/smoke/It_ipc_mkfifo_002.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/extended/signal/smoke/It_ipc_mkfifo_002.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/smoke/It_ipc_mkfifo_002.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/extended/signal/smoke/It_ipc_mkfifo_003.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/smoke/It_ipc_mkfifo_003.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/extended/signal/smoke/It_ipc_mkfifo_003.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/smoke/It_ipc_mkfifo_003.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/extended/signal/smoke/It_ipc_pipe_004.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/smoke/It_ipc_pipe_004.cpp similarity index 98% rename from src/kernel_liteos_a/testsuites/unittest/extended/signal/smoke/It_ipc_pipe_004.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/smoke/It_ipc_pipe_004.cpp index 32305026..7dd997cb 100644 --- a/src/kernel_liteos_a/testsuites/unittest/extended/signal/smoke/It_ipc_pipe_004.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/smoke/It_ipc_pipe_004.cpp @@ -53,7 +53,7 @@ static UINT32 TestCase(VOID) char sentence1[15] = "Hello World"; char a[4] = {0}; retValue = sprintf_s(a, sizeof(a), "%d", i); - ICUNIT_ASSERT_NOT_EQUAL(retValue, 0, retValue); + ICUNIT_ASSERT_NOT_EQUAL(retValue, NULL, retValue); retValue = strcat_s(sentence1, sizeof(sentence1), a); ICUNIT_ASSERT_EQUAL(retValue, 0, retValue); ret = write(*writeFd, sentence1, strlen(sentence1) + 1); diff --git a/src/kernel_liteos_a/testsuites/unittest/extended/signal/smoke/It_ipc_pipe_005.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/smoke/It_ipc_pipe_005.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/extended/signal/smoke/It_ipc_pipe_005.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/smoke/It_ipc_pipe_005.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/extended/signal/smoke/mkfifo_test_001.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/smoke/mkfifo_test_001.cpp similarity index 98% rename from src/kernel_liteos_a/testsuites/unittest/extended/signal/smoke/mkfifo_test_001.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/smoke/mkfifo_test_001.cpp index 017bb106..fb4c3d83 100644 --- a/src/kernel_liteos_a/testsuites/unittest/extended/signal/smoke/mkfifo_test_001.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/smoke/mkfifo_test_001.cpp @@ -59,7 +59,7 @@ static int TestMkfifo() if (fd < 0) { return -1; } - write(fd, sentence, sizeof(sentence)); + write(fd, sentence, sizeof(sentence) + 1); close(fd); exit(0); } else { diff --git a/src/kernel_liteos_a/testsuites/unittest/extended/signal/smoke/mkfifo_test_002.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/smoke/mkfifo_test_002.cpp similarity index 97% rename from src/kernel_liteos_a/testsuites/unittest/extended/signal/smoke/mkfifo_test_002.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/smoke/mkfifo_test_002.cpp index 495a7330..ffbf9fff 100644 --- a/src/kernel_liteos_a/testsuites/unittest/extended/signal/smoke/mkfifo_test_002.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/smoke/mkfifo_test_002.cpp @@ -45,6 +45,7 @@ static int TestMkfifoReturn() int retValue, i; int status = 0; pid_t pid; + char pathname[NAME_BUF_SIZE]; retValue = mkfifo("/dev/fifo0", 0777); // 0777, mkfifo config. ICUNIT_ASSERT_EQUAL(retValue, 0, retValue); @@ -56,6 +57,7 @@ static int TestMkfifoReturn() unlink("/dev/fifo0/fifo1"); unlink("/dev/usr/fifo0"); rmdir("/dev/usr"); + unlink(pathname); unlink("/dev/fifo0"); return LOS_OK; @@ -64,6 +66,7 @@ EXIT: unlink("/dev/fifo0/fifo1"); unlink("/dev/usr/fifo0"); rmdir("/dev/usr"); + unlink(pathname); unlink("/dev/fifo0"); return LOS_NOK; } diff --git a/src/kernel_liteos_a/testsuites/unittest/extended/signal/smoke/pipe_test_002.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/smoke/pipe_test_002.cpp similarity index 92% rename from src/kernel_liteos_a/testsuites/unittest/extended/signal/smoke/pipe_test_002.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/smoke/pipe_test_002.cpp index 4a705182..f25af5e5 100644 --- a/src/kernel_liteos_a/testsuites/unittest/extended/signal/smoke/pipe_test_002.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/smoke/pipe_test_002.cpp @@ -51,7 +51,7 @@ static int TestPipeMultiProcess() int flag = fcntl(*readFd, F_GETFL); fcntl(*readFd, F_SETFL, flag | O_NONBLOCK); - shmid = shmget(static_cast(IPC_PRIVATE), sizeof(int), 0666 | IPC_CREAT); // 0666 the authority of the shm + shmid = shmget((key_t)IPC_PRIVATE, sizeof(int), 0666 | IPC_CREAT); // 0666 the authority of the shm ICUNIT_ASSERT_NOT_EQUAL(shmid, -1, shmid); sharedflag = (int *)shmat(shmid, NULL, 0); *sharedflag = 0; @@ -68,7 +68,7 @@ static int TestPipeMultiProcess() char sentence1[15] = "Hello World"; char a[2] = {0}; (void)sprintf_s(a, sizeof(a), "%d", i); - (void)strcat_s(sentence1, 15, a); // 15, sizeof sentence1 + strcat(sentence1, a); int ret = write(*writeFd, sentence1, strlen(sentence1) + 1); ICUNIT_ASSERT_EQUAL(ret, strlen(sentence1) + 1, ret); usleep(10000); // 10000, Used to calculate the delay time. @@ -88,8 +88,8 @@ static int TestPipeMultiProcess() char sentence1[15] = "Hello World"; char a[2] = {0}; (void)sprintf_s(a, sizeof(a), "%d", i); - (void)strcat_s(sentence1, 15, a); // 15, sizeof sentence1 - (void)memset_s(readbuffer, sizeof(readbuffer), 0, sizeof(readbuffer)); + strcat(sentence1, a); + memset(readbuffer, 0, sizeof(readbuffer)); retValue = read(*readFd, readbuffer, strlen(sentence1) + 1); printf("Receive %d bytes data : %s, errno : %d\n", retValue, readbuffer, errno); ICUNIT_ASSERT_SIZE_STRING_EQUAL(readbuffer, sentence1, strlen(sentence1), errno); diff --git a/src/kernel_liteos_a/testsuites/unittest/extended/signal/smoke/pipe_test_004.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/smoke/pipe_test_004.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/extended/signal/smoke/pipe_test_004.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/smoke/pipe_test_004.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/extended/signal/smoke/signal_test_002.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/smoke/signal_test_002.cpp similarity index 94% rename from src/kernel_liteos_a/testsuites/unittest/extended/signal/smoke/signal_test_002.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/smoke/signal_test_002.cpp index 540b02a6..43018ae5 100644 --- a/src/kernel_liteos_a/testsuites/unittest/extended/signal/smoke/signal_test_002.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/smoke/signal_test_002.cpp @@ -47,7 +47,7 @@ static int TestRaiseIgnore(void) g_sigCount = 0; // trigger one - ret = reinterpret_cast(signal(sig, SigPrint)); + ret = (void *)signal(sig, SigPrint); ICUNIT_ASSERT_NOT_EQUAL(ret, NULL, ret); retValue = raise(sig); @@ -55,13 +55,13 @@ static int TestRaiseIgnore(void) usleep(1000); // 1000, Used to calculate the delay time. // trigger ignore - ret = reinterpret_cast(signal(sig, SIG_IGN)); + ret = (void *)signal(sig, SIG_IGN); ICUNIT_ASSERT_NOT_EQUAL(ret, NULL, ret); retValue = raise(sig); ICUNIT_ASSERT_EQUAL(retValue, 0, retValue); // trigger one - ret = reinterpret_cast(signal(sig, SigPrint)); + ret = (void *)signal(sig, SigPrint); ICUNIT_ASSERT_NOT_EQUAL(ret, NULL, ret); retValue = raise(sig); ICUNIT_ASSERT_EQUAL(retValue, 0, retValue); diff --git a/src/kernel_liteos_a/testsuites/unittest/extended/signal/smoke/signal_test_009.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/smoke/signal_test_009.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/extended/signal/smoke/signal_test_009.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/smoke/signal_test_009.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/extended/signal/smoke/signal_test_013.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/smoke/signal_test_013.cpp similarity index 89% rename from src/kernel_liteos_a/testsuites/unittest/extended/signal/smoke/signal_test_013.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/smoke/signal_test_013.cpp index 040fcfff..6ccd3802 100644 --- a/src/kernel_liteos_a/testsuites/unittest/extended/signal/smoke/signal_test_013.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/smoke/signal_test_013.cpp @@ -63,8 +63,8 @@ static void *ThreadSetFunc2(void *arg) pthread_exit((void *)NULL); return NULL; EXIT: - pthread_exit(reinterpret_cast(-1)); - return reinterpret_cast(-1); + pthread_exit((void *)-1); + return (void *)-1; } static void *ThreadSetDfl(void *arg) @@ -76,8 +76,8 @@ static void *ThreadSetDfl(void *arg) pthread_exit((void *)NULL); return NULL; EXIT: - pthread_exit(reinterpret_cast(-1)); - return reinterpret_cast(-1); + pthread_exit((void *)-1); + return (void *)-1; } static void *ThreadKill(void *arg) @@ -90,8 +90,8 @@ static void *ThreadKill(void *arg) pthread_exit((void *)NULL); return NULL; EXIT: - pthread_exit(reinterpret_cast(-1)); - return reinterpret_cast(-1); + pthread_exit((void *)-1); + return (void *)-1; } static int TestSigMultiPthread(void) @@ -119,15 +119,15 @@ static int TestSigMultiPthread(void) exit(ret); } - pthread_join(thread, reinterpret_cast(&status1)); + pthread_join(thread, (void **)&status1); if ((int)(intptr_t)status1 != 0) { exit(-1); } - pthread_join(thread1, reinterpret_cast(&status1)); + pthread_join(thread1, (void **)&status1); if ((int)(intptr_t)status1 != 0) { exit(-1); } - pthread_join(thread2, reinterpret_cast(&status1)); + pthread_join(thread2, (void **)&status1); if ((int)(intptr_t)status1 != 0) { exit(-1); } diff --git a/src/kernel_liteos_a/testsuites/unittest/extended/signal/smoke/signal_test_014.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/smoke/signal_test_014.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/extended/signal/smoke/signal_test_014.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/smoke/signal_test_014.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/extended/signal/smoke/signal_test_021.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/smoke/signal_test_021.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/extended/signal/smoke/signal_test_021.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/smoke/signal_test_021.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/extended/signal/smoke/signal_test_022.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/smoke/signal_test_022.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/extended/signal/smoke/signal_test_022.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/smoke/signal_test_022.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/extended/signal/smoke/signal_test_023.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/smoke/signal_test_023.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/extended/signal/smoke/signal_test_023.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/smoke/signal_test_023.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/extended/signal/smoke/signal_test_024.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/smoke/signal_test_024.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/extended/signal/smoke/signal_test_024.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/smoke/signal_test_024.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/extended/signal/smoke/signal_test_031.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/smoke/signal_test_031.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/extended/signal/smoke/signal_test_031.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/smoke/signal_test_031.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/extended/signal/smoke/signal_test_032.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/smoke/signal_test_032.cpp similarity index 98% rename from src/kernel_liteos_a/testsuites/unittest/extended/signal/smoke/signal_test_032.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/smoke/signal_test_032.cpp index 9c0416a8..d43add02 100644 --- a/src/kernel_liteos_a/testsuites/unittest/extended/signal/smoke/signal_test_032.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/smoke/signal_test_032.cpp @@ -36,7 +36,7 @@ static void SigPrint(int sig) { (void)sig; g_sigCount++; - printf("signal receive success\n"); + printf("signal receive sucess\n"); } static UINT32 TestCase(VOID) diff --git a/src/kernel_liteos_a/testsuites/unittest/extended/signal/smoke/signal_test_035.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/smoke/signal_test_035.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/extended/signal/smoke/signal_test_035.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/smoke/signal_test_035.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/extended/signal/smoke/signal_test_036.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/smoke/signal_test_036.cpp similarity index 87% rename from src/kernel_liteos_a/testsuites/unittest/extended/signal/smoke/signal_test_036.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/smoke/signal_test_036.cpp index 35aaed0b..8cb97a67 100644 --- a/src/kernel_liteos_a/testsuites/unittest/extended/signal/smoke/signal_test_036.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/smoke/signal_test_036.cpp @@ -60,6 +60,17 @@ static int TestCase() exit(0); } + /* sig = SIGTERM; + ret = sigaction(sig, (struct sigaction *)1, &oldAct); + printf("ret == %d\n", ret); + ICUNIT_ASSERT_EQUAL(ret, -1, ret); + ICUNIT_ASSERT_EQUAL(errno, EFAULT, errno); + + ret = sigaction(sig, &sigAct, (struct sigaction *)1); + printf("ret === %d\n", ret); + ICUNIT_ASSERT_EQUAL(ret, -1, ret); + ICUNIT_ASSERT_EQUAL(errno, EFAULT, errno); */ + ret = waitpid(fpid, &status, 0); ICUNIT_ASSERT_EQUAL(ret, fpid, ret); ICUNIT_ASSERT_EQUAL(WEXITSTATUS(status), 0, WEXITSTATUS(status)); diff --git a/src/kernel_liteos_a/testsuites/unittest/extended/signal/smoke/signal_test_037.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/smoke/signal_test_037.cpp similarity index 97% rename from src/kernel_liteos_a/testsuites/unittest/extended/signal/smoke/signal_test_037.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/smoke/signal_test_037.cpp index 75f8c4bd..e2605476 100644 --- a/src/kernel_liteos_a/testsuites/unittest/extended/signal/smoke/signal_test_037.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/smoke/signal_test_037.cpp @@ -49,7 +49,7 @@ static UINT32 TestCase(VOID) ICUNIT_ASSERT_EQUAL(retval, -1, retval); ICUNIT_ASSERT_EQUAL(errno, EINVAL, errno); printf("----------------------------------\n"); - retval = sigprocmask(SIG_BLOCK, reinterpret_cast(1), &oldset); + retval = sigprocmask(SIG_BLOCK, (sigset_t *)1, &oldset); ICUNIT_ASSERT_EQUAL(retval, -1, retval); ICUNIT_ASSERT_EQUAL(errno, EFAULT, errno); printf("----------------------------------\n"); diff --git a/src/kernel_liteos_a/testsuites/unittest/extended/signal/smoke/signal_test_039.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/smoke/signal_test_039.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/extended/signal/smoke/signal_test_039.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/smoke/signal_test_039.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/extended/signal/smoke/signal_test_042.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/smoke/signal_test_042.cpp similarity index 94% rename from src/kernel_liteos_a/testsuites/unittest/extended/signal/smoke/signal_test_042.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/smoke/signal_test_042.cpp index b8d7c21a..408900d3 100644 --- a/src/kernel_liteos_a/testsuites/unittest/extended/signal/smoke/signal_test_042.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/smoke/signal_test_042.cpp @@ -67,7 +67,7 @@ static UINT32 TestCase() sigemptyset(&set); sigprocmask(SIG_SETMASK, &set, NULL); - printf("check invalid sigset ...\n"); + printf("check invlid sigset ...\n"); int rt = sigaddset(&set, 0); ICUNIT_ASSERT_EQUAL(rt, -1, rt); ICUNIT_ASSERT_EQUAL(errno, EINVAL, errno); @@ -79,19 +79,19 @@ static UINT32 TestCase() siginfo_t si; time1.tv_sec = -1; - printf("check invalid timespec: tv_sec=-1 ...\n"); + printf("check invlid timespec: tv_sec=-1 ...\n"); ret = SigtimedwaitFailTest(&set, &si, &time1, EINVAL); ICUNIT_ASSERT_EQUAL(ret, 0, ret); time1.tv_sec = 1; time1.tv_nsec = -1; - printf("check invalid timespec: tv_nsec=-1 ...\n"); + printf("check invlid timespec: tv_nsec=-1 ...\n"); ret = SigtimedwaitFailTest(&set, &si, &time1, EINVAL); ICUNIT_ASSERT_EQUAL(ret, 0, ret); time1.tv_sec = 1; time1.tv_nsec = 1000 * 1000 * 1000 + 1; // 1000, set the nsec of time. - printf("check invalid timespec: tv_nsec overflow ...\n"); + printf("check invlid timespec: tv_nsec overflow ...\n"); ret = SigtimedwaitFailTest(&set, &si, &time1, EINVAL); ICUNIT_ASSERT_EQUAL(ret, 0, ret); diff --git a/src/kernel_liteos_a/testsuites/unittest/extended/signal/smoke/sigset_test_001.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/smoke/sigset_test_001.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/extended/signal/smoke/sigset_test_001.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/smoke/sigset_test_001.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/extended/signal/smoke/sigset_test_002.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/smoke/sigset_test_002.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/extended/signal/smoke/sigset_test_002.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/signal/smoke/sigset_test_002.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/extended/trace/It_test_trace.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/trace/It_test_trace.h similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/extended/trace/It_test_trace.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/trace/It_test_trace.h diff --git a/src/kernel_liteos_a/testsuites/unittest/extended/trace/config.gni b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/trace/config.gni similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/extended/trace/config.gni rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/trace/config.gni diff --git a/src/kernel_liteos_a/testsuites/unittest/extended/trace/smoke/trace_test_001.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/trace/smoke/trace_test_001.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/extended/trace/smoke/trace_test_001.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/trace/smoke/trace_test_001.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/extended/trace/smoke/trace_test_002.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/trace/smoke/trace_test_002.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/extended/trace/smoke/trace_test_002.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/trace/smoke/trace_test_002.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/extended/trace/smoke/trace_test_003.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/trace/smoke/trace_test_003.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/extended/trace/smoke/trace_test_003.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/trace/smoke/trace_test_003.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/extended/trace/smoke/trace_test_004.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/trace/smoke/trace_test_004.cpp similarity index 97% rename from src/kernel_liteos_a/testsuites/unittest/extended/trace/smoke/trace_test_004.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/trace/smoke/trace_test_004.cpp index 8429ed36..2ec18090 100644 --- a/src/kernel_liteos_a/testsuites/unittest/extended/trace/smoke/trace_test_004.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/trace/smoke/trace_test_004.cpp @@ -43,7 +43,7 @@ static UINT32 TestCase(VOID) ioctl(fd, TRACE_STOP, NULL); - buffer = static_cast(malloc(size)); + buffer= (char *)malloc(size); if (buffer == NULL) { printf("Read buffer malloc failed!\n"); goto EXIT; diff --git a/src/kernel_liteos_a/testsuites/unittest/extended/trace/trace_unit_test.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/trace/trace_unit_test.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/extended/trace/trace_unit_test.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/extended/trace/trace_unit_test.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/fs/BUILD.gn b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/fs/BUILD.gn similarity index 90% rename from src/kernel_liteos_a/testsuites/unittest/fs/BUILD.gn rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/fs/BUILD.gn index 1b108871..43934be5 100644 --- a/src/kernel_liteos_a/testsuites/unittest/fs/BUILD.gn +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/fs/BUILD.gn @@ -27,6 +27,8 @@ # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +import("//build/lite/config/test.gni") +import("//kernel/liteos_a/testsuites/unittest/config.gni") import("./config.gni") if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_LOW) { @@ -41,7 +43,7 @@ if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_LOW) { sources_pressure = [] sources += sources_pressure configs = [ "..:public_config_for_door" ] - deps = [ "$THIRDPARTY_BOUNDS_CHECKING_FUNCTION_DIR:libsec_shared" ] + deps = [ "//third_party/bounds_checking_function:libsec_shared" ] } } @@ -56,7 +58,7 @@ if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_MIDDLE) { sources_pressure = [] sources += sources_pressure configs = [ "..:public_config_for_all" ] - deps = [ "$THIRDPARTY_BOUNDS_CHECKING_FUNCTION_DIR:libsec_shared" ] + deps = [ "//third_party/bounds_checking_function:libsec_shared" ] } } @@ -72,6 +74,6 @@ if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_HIGH) { sources += sources_full sources += sources_pressure configs = [ "..:public_config_for_pressure" ] - deps = [ "$THIRDPARTY_BOUNDS_CHECKING_FUNCTION_DIR:libsec_shared" ] + deps = [ "//third_party/bounds_checking_function:libsec_shared" ] } } diff --git a/src/kernel_liteos_a/testsuites/unittest/fs/config.gni b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/fs/config.gni similarity index 95% rename from src/kernel_liteos_a/testsuites/unittest/fs/config.gni rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/fs/config.gni index f2f1e802..a4b70375 100644 --- a/src/kernel_liteos_a/testsuites/unittest/fs/config.gni +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/fs/config.gni @@ -27,11 +27,10 @@ # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. import("//build/lite/config/test.gni") -import("//kernel/liteos_a/liteos.gni") import("//kernel/liteos_a/testsuites/unittest/config.gni") common_include_dirs = [ - "$THIRDPARTY_GOOGLETEST_DIR/googletest/include", + "//third_party/googletest/googletest/include", "../common/include", ] diff --git a/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/BUILD.gn b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/BUILD.gn new file mode 100644 index 00000000..bfb916e1 --- /dev/null +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/BUILD.gn @@ -0,0 +1,68 @@ +# Copyright (c) 2022-2022 Huawei Device Co., Ltd. All rights reserved. +# +# 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. + +import("//build/lite/config/test.gni") +import("//kernel/liteos_a/testsuites/unittest/config.gni") +import("./config.gni") + +config("libc_config") { + if (LOSCFG_USER_TEST_POSIX_MQUEUE == true || + LOSCFG_USER_TEST_POSIX_PTHREAD == true) { + cflags = [ "-O1" ] + cflags_cc = cflags + } +} + +if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_LOW) { + unittest("liteos_a_libc_unittest_door") { + output_extension = "bin" + output_dir = "$root_out_dir/test/unittest/kernel" + include_dirs = common_include_dirs + sources = sources_entry + sources += sources_smoke + sources_full = [] + sources += sources_full + configs = [ "..:public_config_for_door" ] + configs += [ ":libc_config" ] + deps = [ "//third_party/bounds_checking_function:libsec_shared" ] + } +} + +if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_MIDDLE) { + unittest("liteos_a_libc_unittest") { + output_extension = "bin" + output_dir = "$root_out_dir/test/unittest/kernel" + include_dirs = common_include_dirs + sources = sources_entry + sources += sources_smoke + sources += sources_full + configs = [ "..:public_config_for_all" ] + configs += [ ":libc_config" ] + deps = [ "//third_party/bounds_checking_function:libsec_shared" ] + } +} diff --git a/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/config.gni b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/config.gni new file mode 100644 index 00000000..f9cef838 --- /dev/null +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/config.gni @@ -0,0 +1,121 @@ +# Copyright (c) 2022-2022 Huawei Device Co., Ltd. All rights reserved. +# +# 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. + +import("//build/lite/config/test.gni") +import("//kernel/liteos_a/testsuites/unittest/config.gni") + +common_include_dirs = [ + "//third_party/googletest/googletest/include", + "../common/include", +] + +sources_entry = [ "../common/osTest.cpp" ] + +sources_smoke = [] + +sources_full = [] + +# io module +if (LOSCFG_USER_TEST_IO == true) { + import("./io/config.gni") + common_include_dirs += io_include_dirs + sources_entry += io_sources_entry + sources_smoke += io_sources_smoke + sources_full += io_sources_full +} + +# misc module +if (LOSCFG_USER_TEST_MISC == true) { + import("./misc/config.gni") + common_include_dirs += misc_include_dirs + sources_entry += misc_sources_entry + sources_smoke += misc_sources_smoke + sources_full += misc_sources_full +} + +# posix mem module +if (LOSCFG_USER_TEST_POSIX_MEM == true) { + import("./posix/mem/config.gni") + common_include_dirs += posix_mem_include_dirs + sources_entry += posix_mem_sources_entry + sources_smoke += posix_mem_sources_smoke + sources_full += posix_mem_sources_full +} + +# posix mqueue module +if (LOSCFG_USER_TEST_POSIX_MQUEUE == true) { + import("./posix/mqueue/config.gni") + common_include_dirs += posix_mqueue_include_dirs + sources_entry += posix_mqueue_sources_entry + sources_smoke += posix_mqueue_sources_smoke + sources_full += posix_mqueue_sources_full +} + +# posix pthread module +if (LOSCFG_USER_TEST_POSIX_PTHREAD == true) { + import("./posix/pthread/config.gni") + common_include_dirs += posix_pthread_include_dirs + sources_entry += posix_pthread_sources_entry + sources_smoke += posix_pthread_sources_smoke + sources_full += posix_pthread_sources_full +} + +# sys module +if (LOSCFG_USER_TEST_SYS == true) { + import("./sys/config.gni") + common_include_dirs += sys_include_dirs + sources_entry += sys_sources_entry + sources_smoke += sys_sources_smoke + sources_full += sys_sources_full +} + +# time module +if (LOSCFG_USER_TEST_TIME_CLOCK == true) { + import("./time/clock/config.gni") + common_include_dirs += time_clock_include_dirs + sources_entry += time_clock_sources_entry + sources_smoke += time_clock_sources_smoke + sources_full += time_clock_sources_full +} + +if (LOSCFG_USER_TEST_TIME_TIMER == true) { + import("./time/timer/config.gni") + common_include_dirs += time_timer_include_dirs + sources_entry += time_timer_sources_entry + sources_smoke += time_timer_sources_smoke + sources_full += time_timer_sources_full +} + +# util module +if (LOSCFG_USER_TEST_UTIL == true) { + import("./util/config.gni") + common_include_dirs += util_include_dirs + sources_entry += util_sources_entry + sources_smoke += util_sources_smoke + sources_full += util_sources_full +} diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/io/It_test_IO.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/It_test_IO.h similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/io/It_test_IO.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/It_test_IO.h diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/io/config.gni b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/config.gni similarity index 85% rename from src/kernel_liteos_a/testsuites/unittest/libc/io/config.gni rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/config.gni index 9d072a92..54dacde1 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/io/config.gni +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/config.gni @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023 Huawei Device Co., Ltd. All rights reserved. +# Copyright (c) 2022-2022 Huawei Device Co., Ltd. All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: @@ -26,33 +26,20 @@ # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -import("//build/lite/config/test.gni") -import("//kernel/liteos_a/liteos.gni") import("//kernel/liteos_a/testsuites/unittest/config.gni") -common_include_dirs = [ - "$THIRDPARTY_GOOGLETEST_DIR/googletest/include", - "../../common/include", -] - -sources_entry = [ "../../common/osTest.cpp" ] - -sources_smoke = [] +io_include_dirs = [ "$TEST_UNITTEST_DIR/libc/io" ] -sources_full = [] +io_sources_entry = [ "$TEST_UNITTEST_DIR/libc/io/io_test.cpp" ] -libc_io_include_dirs = [ "$TEST_UNITTEST_DIR/libc/io" ] - -libc_io_sources_entry = [ "$TEST_UNITTEST_DIR/libc/io/io_test.cpp" ] - -libc_io_sources_smoke = [ +io_sources_smoke = [ "$TEST_UNITTEST_DIR/libc/io/smoke/IO_test_005.cpp", "$TEST_UNITTEST_DIR/libc/io/smoke/IO_test_008.cpp", "$TEST_UNITTEST_DIR/libc/io/smoke/IO_test_010.cpp", "$TEST_UNITTEST_DIR/libc/io/smoke/IO_test_013.cpp", ] -libc_io_sources_full = [ +io_sources_full = [ "$TEST_UNITTEST_DIR/libc/io/full/IO_test_confstr_001.cpp", "$TEST_UNITTEST_DIR/libc/io/full/IO_test_dcgettext_001.cpp", "$TEST_UNITTEST_DIR/libc/io/full/IO_test_dcgettext_002.cpp", @@ -95,11 +82,3 @@ libc_io_sources_full = [ "$TEST_UNITTEST_DIR/libc/io/full/IO_test_epoll_001.cpp", "$TEST_UNITTEST_DIR/libc/io/full/IO_test_epoll_002.cpp", ] - -# libc io module -if (LOSCFG_USER_TEST_LIBC_IO == true) { - common_include_dirs += libc_io_include_dirs - sources_entry += libc_io_sources_entry - sources_smoke += libc_io_sources_smoke - sources_full += libc_io_sources_full -} diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/io/full/IO_test_confstr_001.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/full/IO_test_confstr_001.cpp similarity index 94% rename from src/kernel_liteos_a/testsuites/unittest/libc/io/full/IO_test_confstr_001.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/full/IO_test_confstr_001.cpp index b63c3ba3..ee364b4c 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/io/full/IO_test_confstr_001.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/full/IO_test_confstr_001.cpp @@ -44,7 +44,7 @@ static UINT32 testcase(VOID) return LOS_NOK; } confstr(_CS_PATH, pathbuf, n); - ICUNIT_ASSERT_NOT_EQUAL(pathbuf, NULL, -1); + ICUNIT_ASSERT_NOT_EQUAL_NULL(pathbuf, NULL, -1); free(pathbuf); pathbuf = NULL; @@ -57,7 +57,7 @@ static UINT32 testcase(VOID) return LOS_NOK; } confstr(_CS_GNU_LIBPTHREAD_VERSION, gun_libpthread_version_buf, n); - ICUNIT_ASSERT_NOT_EQUAL(gun_libpthread_version_buf, NULL, -1); + ICUNIT_ASSERT_NOT_EQUAL_NULL(gun_libpthread_version_buf, NULL, -1); free(gun_libpthread_version_buf); gun_libpthread_version_buf = NULL; @@ -70,7 +70,7 @@ static UINT32 testcase(VOID) return LOS_NOK; } confstr(_CS_GNU_LIBC_VERSION, gun_libc_version_buf, n); - ICUNIT_ASSERT_NOT_EQUAL(gun_libc_version_buf, NULL, -1); + ICUNIT_ASSERT_NOT_EQUAL_NULL(gun_libc_version_buf, NULL, -1); free(gun_libc_version_buf); gun_libc_version_buf = NULL; diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/io/full/IO_test_dcgettext_001.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/full/IO_test_dcgettext_001.cpp similarity index 77% rename from src/kernel_liteos_a/testsuites/unittest/libc/io/full/IO_test_dcgettext_001.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/full/IO_test_dcgettext_001.cpp index c5ea39da..57367c17 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/io/full/IO_test_dcgettext_001.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/full/IO_test_dcgettext_001.cpp @@ -32,36 +32,18 @@ #include #include -const int domain_name_length = 10; -const int buffer_size = 50; - static UINT32 testcase(VOID) { char *s = ""; - char domain[buffer_size], tmp[domain_name_length]; - srand(time(NULL)); - for (int i = 0, r = 0; i < domain_name_length; i++) { - r = rand() % 36; // 36: 0-9 and a-z - if (r < 10) { // 10: 0-9 - tmp[i] = '0' + r; - } else { - tmp[i] = 'a' + r; - } - } - int ret = sprintf_s(domain, sizeof(domain), "www.%s.com", tmp); - if (ret == 0) { - printf("sprinf_s failed\n"); - return LOS_NOK; - } setlocale(LC_ALL, ""); textdomain("gettext_demo"); bindtextdomain("gettext_demo", "."); bind_textdomain_codeset("gettext_demo", "UTF-8"); - printf(dcgettext(domain, "TestString1\n", LC_MESSAGES)); + printf(dcgettext("www.huawei.com", "TestString1\n", LC_MESSAGES)); - s = dcgettext(domain, "TestString1\n", LC_MESSAGES); + s = dcgettext("www.huawei.com", "TestString1\n", LC_MESSAGES); printf("[INFO]%s:%d,%s,s=%s\n", __FILE__, __LINE__, __func__, s); ICUNIT_ASSERT_STRING_EQUAL(s, "TestString1\n", s); setlocale(LC_ALL, "C"); diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/io/full/IO_test_dcgettext_002.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/full/IO_test_dcgettext_002.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/io/full/IO_test_dcgettext_002.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/full/IO_test_dcgettext_002.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/io/full/IO_test_dcngettext_001.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/full/IO_test_dcngettext_001.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/io/full/IO_test_dcngettext_001.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/full/IO_test_dcngettext_001.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/io/full/IO_test_dcngettext_002.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/full/IO_test_dcngettext_002.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/io/full/IO_test_dcngettext_002.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/full/IO_test_dcngettext_002.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/io/full/IO_test_dngettext_001.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/full/IO_test_dngettext_001.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/io/full/IO_test_dngettext_001.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/full/IO_test_dngettext_001.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/io/full/IO_test_dngettext_002.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/full/IO_test_dngettext_002.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/io/full/IO_test_dngettext_002.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/full/IO_test_dngettext_002.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/io/full/IO_test_duplocale_001.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/full/IO_test_duplocale_001.cpp similarity index 98% rename from src/kernel_liteos_a/testsuites/unittest/libc/io/full/IO_test_duplocale_001.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/full/IO_test_duplocale_001.cpp index 442cf09c..a75d39e4 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/io/full/IO_test_duplocale_001.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/full/IO_test_duplocale_001.cpp @@ -118,7 +118,7 @@ static UINT32 testcase(VOID) locale_t newloc = nullptr; char *pathList[] = {"/storage/zh_CN.UTF-8"}; - char *streamList[] = {reinterpret_cast(fileWords)}; + char *streamList[] = {(char *)fileWords}; int streamLen[] = {sizeof(fileWords) - 2}; newloc = duplocale(oldloc); diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/io/full/IO_test_epoll_001.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/full/IO_test_epoll_001.cpp similarity index 85% rename from src/kernel_liteos_a/testsuites/unittest/libc/io/full/IO_test_epoll_001.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/full/IO_test_epoll_001.cpp index 9e5f45a5..ecdca93a 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/io/full/IO_test_epoll_001.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/full/IO_test_epoll_001.cpp @@ -51,10 +51,9 @@ static UINT32 testcase(VOID) sigset_t mask; struct epoll_event ev; struct epoll_event evWait[2]; /* 2, evs num */ - UINT32 ret; retval = pipe(pipeFd); - ICUNIT_GOTO_EQUAL(retval, 0, retval, OUT4); + ICUNIT_GOTO_EQUAL(retval, 0, retval, OUT); /* Watch fd to see when it has input. */ FD_ZERO(&rfds); @@ -62,18 +61,17 @@ static UINT32 testcase(VOID) /* Wait up to three seconds. */ epFd = epoll_create1(100); /* 100, cretae input, */ - ICUNIT_GOTO_NOT_EQUAL(epFd, -1, epFd, OUT2); + ICUNIT_GOTO_NOT_EQUAL(epFd, -1, epFd, OUT); ev.events = EPOLLIN | EPOLLOUT | EPOLLRDNORM | EPOLLWRNORM; retval = epoll_ctl(epFd, EPOLL_CTL_ADD, pipeFd[0], &ev); - ICUNIT_GOTO_NOT_EQUAL(retval, -1, retval, OUT1); + ICUNIT_GOTO_NOT_EQUAL(retval, -1, retval, OUT); pid = fork(); if (pid == 0) { close(pipeFd[1]); - ret = memset_s(evWait, sizeof(struct epoll_event) * 2, 0, sizeof(struct epoll_event) * 2); /* 2, evs num */ - ICUNIT_ASSERT_EQUAL(ret, 0, ret); + memset(evWait, 0, sizeof(struct epoll_event) * 2); /* 2, evs num */ retval = epoll_wait(epFd, evWait, 2, 3000); /* 2, num of wait fd. 3000, wait time */ close(pipeFd[0]); @@ -86,7 +84,7 @@ static UINT32 testcase(VOID) sleep(1); close(pipeFd[0]); retval = write(pipeFd[1], "0123456789012345678901234567890123456789", 40); /* write 40 bytes to stdin(fd 0) */ - ICUNIT_GOTO_EQUAL(retval, 40, retval, OUT3); + ICUNIT_GOTO_EQUAL(retval, 40, retval, OUT); close(pipeFd[1]); wait(&status); @@ -95,20 +93,10 @@ static UINT32 testcase(VOID) } return LOS_OK; -OUT1: - close(epFd); - close(pipeFd[0]); - close(pipeFd[1]); - return LOS_NOK; -OUT2: +OUT: close(pipeFd[0]); close(pipeFd[1]); - return LOS_NOK; -OUT3: close(epFd); - close(pipeFd[1]); - return LOS_NOK; -OUT4: return LOS_NOK; } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/io/full/IO_test_epoll_002.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/full/IO_test_epoll_002.cpp similarity index 92% rename from src/kernel_liteos_a/testsuites/unittest/libc/io/full/IO_test_epoll_002.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/full/IO_test_epoll_002.cpp index 1d46e936..8b54bdcd 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/io/full/IO_test_epoll_002.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/full/IO_test_epoll_002.cpp @@ -53,7 +53,7 @@ static UINT32 testcase(VOID) int i = 0; int status; - int epFd = 0; + int epFd; sigset_t mask; void (*retSig)(int); struct epoll_event ev; @@ -75,7 +75,7 @@ static UINT32 testcase(VOID) ICUNIT_ASSERT_EQUAL(retval, 0, retval); retval = pipe(pipeFd); - ICUNIT_GOTO_EQUAL(retval, 0, retval, OUT3); + ICUNIT_GOTO_EQUAL(retval, 0, retval, OUT); /* Watch fd to see when it has input. */ FD_ZERO(&rfds); @@ -86,18 +86,18 @@ static UINT32 testcase(VOID) tv.tv_nsec = 5; /* 5, wait timer, nano second */ epFd = epoll_create1(100); /* 100, cretae input, */ - ICUNIT_GOTO_NOT_EQUAL(epFd, -1, epFd, OUT2); + ICUNIT_GOTO_NOT_EQUAL(epFd, -1, epFd, OUT); ev.events = EPOLLRDNORM; retval = epoll_ctl(epFd, EPOLL_CTL_ADD, pipeFd[0], &ev); - ICUNIT_GOTO_NOT_EQUAL(retval, -1, retval, OUT1); + ICUNIT_GOTO_NOT_EQUAL(retval, -1, retval, OUT); pid = fork(); if (pid == 0) { close(pipeFd[1]); - (void)memset_s(evWait, sizeof(struct epoll_event) * 2, 0, sizeof(struct epoll_event) * 2); /* 2, evs num */ + memset(evWait, 0, sizeof(struct epoll_event) * 2); /* 2, evs num */ evWait[0].data.fd = pipeFd[0]; retval = epoll_pwait(epFd, evWait, 2, 3000, &mask); /* 2, num of wait fd. 3000, wait time */ @@ -125,12 +125,10 @@ static UINT32 testcase(VOID) } return LOS_OK; -OUT1: - close(epFd); -OUT2: +OUT: close(pipeFd[0]); close(pipeFd[1]); -OUT3: + close(epFd); return LOS_NOK; } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/io/full/IO_test_gettext_001.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/full/IO_test_gettext_001.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/io/full/IO_test_gettext_001.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/full/IO_test_gettext_001.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/io/full/IO_test_locale_001.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/full/IO_test_locale_001.cpp similarity index 94% rename from src/kernel_liteos_a/testsuites/unittest/libc/io/full/IO_test_locale_001.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/full/IO_test_locale_001.cpp index a6d5b825..f2bbf1c6 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/io/full/IO_test_locale_001.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/full/IO_test_locale_001.cpp @@ -47,17 +47,17 @@ static UINT32 testcase(VOID) printf("Locale is: %s\n", setlocale(LC_TIME, "en_US.UTF-8")); strftime(buffer, 80, "%c", timer); printf("Date is: %s\n", buffer); - ICUNIT_ASSERT_NOT_EQUAL(buffer, NULL, -1); + ICUNIT_ASSERT_NOT_EQUAL_NULL(buffer, NULL, -1); printf("Locale is: %s\n", setlocale(LC_TIME, "zh_CN.UTF-8")); strftime(buffer, 80, "%c", timer); printf("Date is: %s\n", buffer); - ICUNIT_ASSERT_NOT_EQUAL(buffer, NULL, -1); + ICUNIT_ASSERT_NOT_EQUAL_NULL(buffer, NULL, -1); printf("Locale is: %s\n", setlocale(LC_TIME, "")); strftime(buffer, 80, "%c", timer); printf("Date is: %s\n", buffer); - ICUNIT_ASSERT_NOT_EQUAL(buffer, NULL, -1); + ICUNIT_ASSERT_NOT_EQUAL_NULL(buffer, NULL, -1); setlocale(LC_ALL, "C"); return LOS_OK; diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/io/full/IO_test_locale_002.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/full/IO_test_locale_002.cpp similarity index 88% rename from src/kernel_liteos_a/testsuites/unittest/libc/io/full/IO_test_locale_002.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/full/IO_test_locale_002.cpp index a7e1fd6b..6e22bc86 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/io/full/IO_test_locale_002.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/full/IO_test_locale_002.cpp @@ -37,6 +37,7 @@ static UINT32 testcase(VOID) time_t currtime; struct tm *timer = {nullptr}; char buffer[80]; + //locale_t loc = malloc(sizeof(locale_t); time(&currtime); timer = localtime(&currtime); @@ -45,19 +46,19 @@ static UINT32 testcase(VOID) printf("getenv MUSL_LOCPATH=%s\n", getenv("MUSL_LOCPATH")); printf("Locale is: %s\n", setlocale(LC_TIME, "en_US.UTF-8")); - (void)strftime(buffer, sizeof(buffer), "%c", timer); + strftime(buffer, 80, "%c", timer); printf("Date is: %s\n", buffer); - ICUNIT_ASSERT_NOT_EQUAL(buffer, NULL, -1); + ICUNIT_ASSERT_NOT_EQUAL_NULL(buffer, NULL, -1); printf("Locale is: %s\n", setlocale(LC_TIME, "zh_CN.UTF-8")); - (void)strftime(buffer, sizeof(buffer), "%c", timer); + strftime(buffer, 80, "%c", timer); printf("Date is: %s\n", buffer); - ICUNIT_ASSERT_NOT_EQUAL(buffer, NULL, -1); + ICUNIT_ASSERT_NOT_EQUAL_NULL(buffer, NULL, -1); printf("Locale is: %s\n", setlocale(LC_TIME, "")); - (void)strftime(buffer, sizeof(buffer), "%c", timer); + strftime(buffer, 80, "%c", timer); printf("Date is: %s\n", buffer); - ICUNIT_ASSERT_NOT_EQUAL(buffer, NULL, -1); + ICUNIT_ASSERT_NOT_EQUAL_NULL(buffer, NULL, -1); setlocale(LC_ALL, "C"); return LOS_OK; diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/io/full/IO_test_ngettext_001.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/full/IO_test_ngettext_001.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/io/full/IO_test_ngettext_001.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/full/IO_test_ngettext_001.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/io/full/IO_test_nl_langinfo_001.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/full/IO_test_nl_langinfo_001.cpp similarity index 98% rename from src/kernel_liteos_a/testsuites/unittest/libc/io/full/IO_test_nl_langinfo_001.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/full/IO_test_nl_langinfo_001.cpp index f843a728..b33fb2ff 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/io/full/IO_test_nl_langinfo_001.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/full/IO_test_nl_langinfo_001.cpp @@ -89,7 +89,7 @@ static UINT32 testcase(VOID) printf("%s\n", nl_langinfo(CRNCYSTR)); char *string = nl_langinfo(CRNCYSTR); - ICUNIT_ASSERT_NOT_EQUAL(string, NULL, string); + ICUNIT_ASSERT_NOT_EQUAL_NULL(string, NULL, string); setlocale(LC_ALL, "C"); return LOS_OK; diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/io/full/IO_test_nl_langinfo_l_001.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/full/IO_test_nl_langinfo_l_001.cpp similarity index 81% rename from src/kernel_liteos_a/testsuites/unittest/libc/io/full/IO_test_nl_langinfo_l_001.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/full/IO_test_nl_langinfo_l_001.cpp index f954de3c..922e0c18 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/io/full/IO_test_nl_langinfo_l_001.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/full/IO_test_nl_langinfo_l_001.cpp @@ -41,8 +41,8 @@ static UINT32 testcase(VOID) { setlocale(LC_NUMERIC, ""); /* echo the nl_langinfo_l */ - printf("%s\n", nl_langinfo_l(CODESET, reinterpret_cast(const_cast("en_US.UTF-8")))); - printf("%s\n", nl_langinfo_l(RADIXCHAR, reinterpret_cast(const_cast("en_US.UTF-8")))); + printf("%s\n", nl_langinfo_l(CODESET, (locale_t)"en_US.UTF-8")); + printf("%s\n", nl_langinfo_l(RADIXCHAR, (locale_t)"en_US.UTF-8")); /* set the locale info */ setenv("MUSL_LOCPATH", "/storage", 1); @@ -53,11 +53,11 @@ static UINT32 testcase(VOID) { setlocale(LC_NUMERIC, ""); /* echo the nl_langinfo */ - printf("%s\n", nl_langinfo_l(CODESET, reinterpret_cast(const_cast("zh_CN.UTF-8")))); - printf("%s\n", nl_langinfo_l(RADIXCHAR, reinterpret_cast(const_cast("zh_CN.UTF-8")))); + printf("%s\n", nl_langinfo_l(CODESET, (locale_t)"zh_CN.UTF-8")); + printf("%s\n", nl_langinfo_l(RADIXCHAR, (locale_t)"zh_CN.UTF-8")); - char *string = nl_langinfo_l(CRNCYSTR, reinterpret_cast(const_cast("zh_CN.UTF-8"))); - ICUNIT_ASSERT_NOT_EQUAL(string, NULL, string); + char *string = nl_langinfo_l(CRNCYSTR, (locale_t)"zh_CN.UTF-8"); + ICUNIT_ASSERT_NOT_EQUAL_NULL(string, NULL, string); setlocale(LC_ALL, "C"); return LOS_OK; diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/io/full/IO_test_ppoll_001.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/full/IO_test_ppoll_001.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/io/full/IO_test_ppoll_001.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/full/IO_test_ppoll_001.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/io/full/IO_test_ppoll_002.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/full/IO_test_ppoll_002.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/io/full/IO_test_ppoll_002.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/full/IO_test_ppoll_002.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/io/full/IO_test_ppoll_003.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/full/IO_test_ppoll_003.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/io/full/IO_test_ppoll_003.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/full/IO_test_ppoll_003.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/io/full/IO_test_pselect_001.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/full/IO_test_pselect_001.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/io/full/IO_test_pselect_001.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/full/IO_test_pselect_001.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/io/full/IO_test_pselect_002.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/full/IO_test_pselect_002.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/io/full/IO_test_pselect_002.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/full/IO_test_pselect_002.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/io/full/IO_test_strcasecmp_l_001.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/full/IO_test_strcasecmp_l_001.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/io/full/IO_test_strcasecmp_l_001.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/full/IO_test_strcasecmp_l_001.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/io/full/IO_test_strcasecmp_l_002.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/full/IO_test_strcasecmp_l_002.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/io/full/IO_test_strcasecmp_l_002.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/full/IO_test_strcasecmp_l_002.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/io/full/IO_test_strfmon_l_001.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/full/IO_test_strfmon_l_001.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/io/full/IO_test_strfmon_l_001.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/full/IO_test_strfmon_l_001.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/io/full/IO_test_strfmon_l_002.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/full/IO_test_strfmon_l_002.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/io/full/IO_test_strfmon_l_002.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/full/IO_test_strfmon_l_002.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/io/full/IO_test_strncasecmp_l_001.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/full/IO_test_strncasecmp_l_001.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/io/full/IO_test_strncasecmp_l_001.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/full/IO_test_strncasecmp_l_001.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/io/full/IO_test_strncasecmp_l_002.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/full/IO_test_strncasecmp_l_002.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/io/full/IO_test_strncasecmp_l_002.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/full/IO_test_strncasecmp_l_002.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/io/full/It_locale_localeconv_001.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/full/It_locale_localeconv_001.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/io/full/It_locale_localeconv_001.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/full/It_locale_localeconv_001.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/io/full/It_stdio_fputws_001.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/full/It_stdio_fputws_001.cpp similarity index 93% rename from src/kernel_liteos_a/testsuites/unittest/libc/io/full/It_stdio_fputws_001.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/full/It_stdio_fputws_001.cpp index 1ada98da..58011cd1 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/io/full/It_stdio_fputws_001.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/full/It_stdio_fputws_001.cpp @@ -40,13 +40,9 @@ static UINT32 Testcase(VOID) int nType; char pathname[50]; // 50, path name buffer size FILE *testFile; - int ret; - - ret = strncpy_s(pathname, 50, g_ioTestPath, 50); // 50, path name buffer size - ICUNIT_ASSERT_EQUAL(ret, 0, ret); + (void)strncpy_s(pathname, 50, g_ioTestPath, 50); // 50, path name buffer size char *filename = "/crtfputwstest1"; - ret = strcat_s(pathname, 50, filename); // 50, path name buffer size - ICUNIT_ASSERT_EQUAL(ret, EOK, ret); + strcat(pathname, filename); for (nType = 0; nType < 6; nType++) { // 6, test loop num testFile = fopen(pathname, "a"); diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/io/full/It_stdio_fwprintf_001.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/full/It_stdio_fwprintf_001.cpp similarity index 89% rename from src/kernel_liteos_a/testsuites/unittest/libc/io/full/It_stdio_fwprintf_001.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/full/It_stdio_fwprintf_001.cpp index fbafa1bd..1bf57114 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/io/full/It_stdio_fwprintf_001.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/full/It_stdio_fwprintf_001.cpp @@ -38,14 +38,12 @@ static UINT32 Testcase(VOID) int nRet; unsigned int nPos; int nType; - char pathname[50]; // 50, path name buffer size - (void)strncpy_s(pathname, 50, g_ioTestPath, 50); // 50, path name buffer size + char pathname[50]; // 50, path name buffer size + strncpy(pathname, g_ioTestPath, 50); // 50, path name buffer size char *filename = "/crtfwprintftest1"; FILE *testFile = NULL; - int ret; - ret = strcat_s(pathname, 50, filename); // 50, path name buffer size - ICUNIT_ASSERT_EQUAL(ret, EOK, ret); + strcat(pathname, filename); for (nType = 0; nType < 6; nType++) { // 6, loop test num testFile = fopen(pathname, "w+"); @@ -54,7 +52,7 @@ static UINT32 Testcase(VOID) nPos = (unsigned int)ftell(testFile); nRet = fwprintf(testFile, L"hello world %d", 666); // 666, for test, print to testFile - ICUNIT_GOTO_EQUAL(nRet, 15, nRet, EXIT); // 15, total write size + ICUNIT_GOTO_EQUAL(nRet, 15, nRet, EXIT); // 15, total write size if ((nPos + 15) != (unsigned int)ftell(testFile)) { // 15, total write size ICUNIT_GOTO_EQUAL(1, 0, 1, EXIT); diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/io/full/It_stdio_getc_unlocked_001.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/full/It_stdio_getc_unlocked_001.cpp similarity index 92% rename from src/kernel_liteos_a/testsuites/unittest/libc/io/full/It_stdio_getc_unlocked_001.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/full/It_stdio_getc_unlocked_001.cpp index 86b87578..cd10d71e 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/io/full/It_stdio_getc_unlocked_001.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/full/It_stdio_getc_unlocked_001.cpp @@ -37,15 +37,11 @@ static UINT32 Testcase(VOID) unsigned int nPos; int ret; char pathname[50]; // 50, enough space. + (void)strncpy_s(pathname, sizeof(pathname), g_ioTestPath, sizeof(pathname)); char *filename = "/crt_getc_unlocked_test1"; FILE *testFile = NULL; - ret = strncpy_s(pathname, sizeof(pathname), g_ioTestPath, sizeof(pathname)); - ICUNIT_ASSERT_EQUAL(ret, 0, ret); - - ret = strcat_s(pathname, 50, filename); // 50, path name buffer size - ICUNIT_ASSERT_EQUAL(ret, EOK, ret); - + strcat(pathname, filename); testFile = fopen(pathname, "w+"); ICUNIT_ASSERT_NOT_EQUAL(testFile, NULL, LOS_NOK); ret = fputs("0123456789abcdefghijklmnopqrstuvwxyz", testFile); diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/io/full/It_stdio_hasmntopt_001.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/full/It_stdio_hasmntopt_001.cpp similarity index 97% rename from src/kernel_liteos_a/testsuites/unittest/libc/io/full/It_stdio_hasmntopt_001.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/full/It_stdio_hasmntopt_001.cpp index a0d605b6..151a7b4b 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/io/full/It_stdio_hasmntopt_001.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/full/It_stdio_hasmntopt_001.cpp @@ -44,7 +44,7 @@ static UINT32 testcase(VOID) char fileWords[] = "/dev/disk/by-uuid/c4992556-a86e-45e8-ba5f-190b16a9073x /usr1 ext3 errors=remount-ro,nofail 0 1"; char *pathList[] = {"/etc/fstab"}; - char *streamList[] = {static_cast(fileWords)}; + char *streamList[] = {(char *)fileWords}; int streamLen[] = {sizeof(fileWords)}; int flag = PrepareFileEnv(pathList, streamList, streamLen, 1); @@ -77,7 +77,7 @@ static UINT32 testcase(VOID) if (mnt && !(feof(fp) || ferror(fp))) { ret = hasmntopt(mnt, opt); printf("hasmntopt=%s\n", ret); - ICUNIT_ASSERT_NOT_EQUAL(ret, NULL, -1); + ICUNIT_ASSERT_NOT_EQUAL_NULL(ret, NULL, -1); mnt = getmntent(fp); } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/io/full/It_stdio_mblen_001.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/full/It_stdio_mblen_001.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/io/full/It_stdio_mblen_001.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/full/It_stdio_mblen_001.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/io/full/It_stdio_mbrlen_001.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/full/It_stdio_mbrlen_001.cpp similarity index 95% rename from src/kernel_liteos_a/testsuites/unittest/libc/io/full/It_stdio_mbrlen_001.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/full/It_stdio_mbrlen_001.cpp index ed59e2ce..da1c3fd0 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/io/full/It_stdio_mbrlen_001.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/full/It_stdio_mbrlen_001.cpp @@ -38,11 +38,9 @@ static UINT32 Testcase(VOID) const char *str = "水"; size_t sz = strlen(str); int len1, len2, len3; - UINT32 ret; mbstate_t mb; - ret = memset_s(&mb, sizeof(mb), 0, sizeof(mb)); - ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT); + memset(&mb, 0, sizeof(mb)); len1 = mbrlen(str, 1, &mb); ICUNIT_GOTO_EQUAL(len1, -2, len1, EXIT); // -2, except return value diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/io/full/It_stdio_putwc_001.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/full/It_stdio_putwc_001.cpp similarity index 90% rename from src/kernel_liteos_a/testsuites/unittest/libc/io/full/It_stdio_putwc_001.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/full/It_stdio_putwc_001.cpp index 7767447b..a3667385 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/io/full/It_stdio_putwc_001.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/full/It_stdio_putwc_001.cpp @@ -38,15 +38,11 @@ static UINT32 Testcase(VOID) long nPos; int nType, i; FILE *putwcFile = NULL; - char pathname[50]; // 50, pathname size + char pathname[50]; // 50, pathname size + strncpy(pathname, g_ioTestPath, 50); // 50, pathname size char *filename = "/crtputwctest1"; - int ret; - ret = strncpy_s(pathname, 50, g_ioTestPath, 50); // 50, pathname size - ICUNIT_ASSERT_EQUAL(ret, 0, ret); - - ret = strcat_s(pathname, 50, filename); // 50, path name buffer size - ICUNIT_ASSERT_EQUAL(ret, EOK, ret); + strcat(pathname, filename); for (nType = 0; nType < 6; nType++) { // 6, loop test num putwcFile = fopen(pathname, "w+"); diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/io/full/It_stdio_readv_001.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/full/It_stdio_readv_001.cpp similarity index 93% rename from src/kernel_liteos_a/testsuites/unittest/libc/io/full/It_stdio_readv_001.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/full/It_stdio_readv_001.cpp index 6af0103b..78eebb91 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/io/full/It_stdio_readv_001.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/full/It_stdio_readv_001.cpp @@ -41,16 +41,14 @@ static UINT32 Testcase(VOID) struct iovec iov[2]; // 2, read 2 block ssize_t nread; const int testStrLen = 10; - UINT32 ret; iov[0].iov_base = buf1; iov[0].iov_len = sizeof(buf1) - 1; iov[1].iov_base = buf2; iov[1].iov_len = sizeof(buf2) - 1; - (void)strncpy_s(pathname, 50, g_ioTestPath, 50); // 50, path name size - ret = strcat_s(pathname, 50, filename); // 50, path name buffer size - ICUNIT_ASSERT_EQUAL(ret, EOK, ret); + strncpy(pathname, g_ioTestPath, 50); // 50, path name size + strcat(pathname, filename); fd = open(pathname, O_CREAT | O_RDWR | O_TRUNC, 0666); // 0666, file authority if (fd < 0) { printf("error: can`t open file\n"); diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/io/full/It_stdio_rindex_001.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/full/It_stdio_rindex_001.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/io/full/It_stdio_rindex_001.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/full/It_stdio_rindex_001.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/io/full/It_stdio_setlogmask_001.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/full/It_stdio_setlogmask_001.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/io/full/It_stdio_setlogmask_001.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/full/It_stdio_setlogmask_001.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/io/full/It_stdlib_gcvt_001.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/full/It_stdlib_gcvt_001.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/io/full/It_stdlib_gcvt_001.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/full/It_stdlib_gcvt_001.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/io/full/It_stdlib_poll_002.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/full/It_stdlib_poll_002.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/io/full/It_stdlib_poll_002.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/full/It_stdlib_poll_002.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/io/full/It_stdlib_poll_003.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/full/It_stdlib_poll_003.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/io/full/It_stdlib_poll_003.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/full/It_stdlib_poll_003.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/io/io_test.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/io_test.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/io/io_test.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/io_test.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/io/smoke/IO_test_005.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/smoke/IO_test_005.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/io/smoke/IO_test_005.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/smoke/IO_test_005.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/io/smoke/IO_test_008.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/smoke/IO_test_008.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/io/smoke/IO_test_008.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/smoke/IO_test_008.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/io/smoke/IO_test_010.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/smoke/IO_test_010.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/io/smoke/IO_test_010.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/smoke/IO_test_010.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/io/smoke/IO_test_013.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/smoke/IO_test_013.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/io/smoke/IO_test_013.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/io/smoke/IO_test_013.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/misc/It_test_misc.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/misc/It_test_misc.h similarity index 99% rename from src/kernel_liteos_a/testsuites/unittest/libc/misc/It_test_misc.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/misc/It_test_misc.h index a89fbc81..909c1c6d 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/misc/It_test_misc.h +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/misc/It_test_misc.h @@ -38,7 +38,7 @@ #include "unistd.h" #include "search.h" #define MISC_OK 0 -#define MISC_NOK (-1) +#define MISC_NOK -1 extern VOID ItTestMisc001(VOID); extern VOID ItTestMisc002(VOID); diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/misc/config.gni b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/misc/config.gni similarity index 75% rename from src/kernel_liteos_a/testsuites/unittest/libc/misc/config.gni rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/misc/config.gni index 0d34c95f..78785969 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/misc/config.gni +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/misc/config.gni @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023 Huawei Device Co., Ltd. All rights reserved. +# Copyright (c) 2022-2022 Huawei Device Co., Ltd. All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: @@ -26,26 +26,13 @@ # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -import("//build/lite/config/test.gni") -import("//kernel/liteos_a/liteos.gni") import("//kernel/liteos_a/testsuites/unittest/config.gni") -common_include_dirs = [ - "$THIRDPARTY_GOOGLETEST_DIR/googletest/include", - "../../common/include", -] - -sources_entry = [ "../../common/osTest.cpp" ] - -sources_smoke = [] +misc_include_dirs = [ "$TEST_UNITTEST_DIR/libc/misc" ] -sources_full = [] +misc_sources_entry = [ "$TEST_UNITTEST_DIR/libc/misc/misc_test.cpp" ] -libc_misc_include_dirs = [ "$TEST_UNITTEST_DIR/libc/misc" ] - -libc_misc_sources_entry = [ "$TEST_UNITTEST_DIR/libc/misc/misc_test.cpp" ] - -libc_misc_sources_smoke = [ +misc_sources_smoke = [ "$TEST_UNITTEST_DIR/libc/misc/smoke/misc_test_001.cpp", "$TEST_UNITTEST_DIR/libc/misc/smoke/misc_test_002.cpp", "$TEST_UNITTEST_DIR/libc/misc/smoke/misc_test_003.cpp", @@ -54,7 +41,7 @@ libc_misc_sources_smoke = [ "$TEST_UNITTEST_DIR/libc/misc/smoke/misc_test_014.cpp", ] -libc_misc_sources_full = [ +misc_sources_full = [ "$TEST_UNITTEST_DIR/libc/misc/full/misc_test_006.cpp", "$TEST_UNITTEST_DIR/libc/misc/full/misc_test_007.cpp", "$TEST_UNITTEST_DIR/libc/misc/full/misc_test_008.cpp", @@ -64,11 +51,3 @@ libc_misc_sources_full = [ "$TEST_UNITTEST_DIR/libc/misc/full/misc_test_012.cpp", "$TEST_UNITTEST_DIR/libc/misc/full/misc_test_013.cpp", ] - -# libc misc module -if (LOSCFG_USER_TEST_LIBC_MISC == true) { - common_include_dirs += libc_misc_include_dirs - sources_entry += libc_misc_sources_entry - sources_smoke += libc_misc_sources_smoke - sources_full += libc_misc_sources_full -} diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/misc/full/misc_test_006.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/misc/full/misc_test_006.cpp similarity index 90% rename from src/kernel_liteos_a/testsuites/unittest/libc/misc/full/misc_test_006.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/misc/full/misc_test_006.cpp index 12241e4f..616edf51 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/misc/full/misc_test_006.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/misc/full/misc_test_006.cpp @@ -31,9 +31,9 @@ #include "It_test_misc.h" #include "sys/utsname.h" -#define INVALID_ADDR_FIRST_PAGE (reinterpret_cast(0x1200000)) -#define INVALID_ADDR_USER_ADDR (reinterpret_cast(0x1000000)) -#define INVALID_ADDR_KERNEL_READONLY_ADDR (reinterpret_cast(0x4016c75c)) +#define INVALID_ADDR_FIRST_PAGE ((struct utsname *)0x1200000) +#define INVALID_ADDR_USER_ADDR ((struct utsname *)0x1000000) +#define INVALID_ADDR_KERNEL_READONLY_ADDR ((struct utsname *)0x4016c75c) static UINT32 TestCase(VOID) { diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/misc/full/misc_test_007.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/misc/full/misc_test_007.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/misc/full/misc_test_007.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/misc/full/misc_test_007.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/misc/full/misc_test_008.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/misc/full/misc_test_008.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/misc/full/misc_test_008.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/misc/full/misc_test_008.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/misc/full/misc_test_009.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/misc/full/misc_test_009.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/misc/full/misc_test_009.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/misc/full/misc_test_009.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/misc/full/misc_test_010.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/misc/full/misc_test_010.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/misc/full/misc_test_010.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/misc/full/misc_test_010.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/misc/full/misc_test_011.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/misc/full/misc_test_011.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/misc/full/misc_test_011.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/misc/full/misc_test_011.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/misc/full/misc_test_012.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/misc/full/misc_test_012.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/misc/full/misc_test_012.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/misc/full/misc_test_012.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/misc/full/misc_test_013.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/misc/full/misc_test_013.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/misc/full/misc_test_013.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/misc/full/misc_test_013.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/misc/misc_test.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/misc/misc_test.cpp similarity index 88% rename from src/kernel_liteos_a/testsuites/unittest/libc/misc/misc_test.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/misc/misc_test.cpp index 0f34b621..319e5658 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/misc/misc_test.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/misc/misc_test.cpp @@ -145,6 +145,26 @@ HWTEST_F(MiscTest, ItTestMisc009, TestSize.Level0) ItTestMisc009(); } +/* * + * @tc.name: IT_TEST_MISC_010 + * @tc.desc: function for MiscTest + * @tc.type: FUNC + */ +/*HWTEST_F(MiscTest, ItTestMisc010, TestSize.Level0) +{ + ItTestMisc010(); +}*/ + +/* * + * @tc.name: IT_TEST_MISC_011 + * @tc.desc: function for MiscTest + * @tc.type: FUNC + */ +/*HWTEST_F(MiscTest, ItTestMisc011, TestSize.Level0) +{ + ItTestMisc011(); +}*/ + /* * * @tc.name: IT_TEST_MISC_012 * @tc.desc: function for MiscTest @@ -154,6 +174,16 @@ HWTEST_F(MiscTest, ItTestMisc012, TestSize.Level0) { ItTestMisc012(); } + +/* * + * @tc.name: IT_TEST_MISC_013 + * @tc.desc: function for MiscTest + * @tc.type: FUNC + */ +/*HWTEST_F(MiscTest, ItTestMisc013, TestSize.Level0) +{ + ItTestMisc013(); +}*/ #endif } // namespace OHOS diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/misc/smoke/misc_test_001.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/misc/smoke/misc_test_001.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/misc/smoke/misc_test_001.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/misc/smoke/misc_test_001.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/misc/smoke/misc_test_002.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/misc/smoke/misc_test_002.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/misc/smoke/misc_test_002.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/misc/smoke/misc_test_002.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/misc/smoke/misc_test_003.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/misc/smoke/misc_test_003.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/misc/smoke/misc_test_003.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/misc/smoke/misc_test_003.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/misc/smoke/misc_test_004.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/misc/smoke/misc_test_004.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/misc/smoke/misc_test_004.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/misc/smoke/misc_test_004.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/misc/smoke/misc_test_005.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/misc/smoke/misc_test_005.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/misc/smoke/misc_test_005.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/misc/smoke/misc_test_005.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/misc/smoke/misc_test_014.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/misc/smoke/misc_test_014.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/misc/smoke/misc_test_014.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/misc/smoke/misc_test_014.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mem/It_posix_mem.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mem/It_posix_mem.h similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mem/It_posix_mem.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mem/It_posix_mem.h diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mem/config.gni b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mem/config.gni similarity index 86% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mem/config.gni rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mem/config.gni index 04322d7e..4b23f089 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mem/config.gni +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mem/config.gni @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023 Huawei Device Co., Ltd. All rights reserved. +# Copyright (c) 2022-2022 Huawei Device Co., Ltd. All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: @@ -26,17 +26,16 @@ # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -import("//build/lite/config/test.gni") import("//kernel/liteos_a/testsuites/unittest/config.gni") -libc_posix_mem_include_dirs = [ "$TEST_UNITTEST_DIR/libc/posix/mem" ] +posix_mem_include_dirs = [ "$TEST_UNITTEST_DIR/libc/posix/mem" ] -libc_posix_mem_sources_entry = +posix_mem_sources_entry = [ "$TEST_UNITTEST_DIR/libc/posix/mem/posix_mem_test.cpp" ] -libc_posix_mem_sources_smoke = [ +posix_mem_sources_smoke = [ "$TEST_UNITTEST_DIR/libc/posix/mem/smoke/It_posix_mem_001.cpp", "$TEST_UNITTEST_DIR/libc/posix/mem/smoke/It_posix_mem_003.cpp", ] -libc_posix_mem_sources_full = [] +posix_mem_sources_full = [] diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mem/posix_mem_test.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mem/posix_mem_test.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mem/posix_mem_test.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mem/posix_mem_test.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mem/smoke/It_posix_mem_001.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mem/smoke/It_posix_mem_001.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mem/smoke/It_posix_mem_001.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mem/smoke/It_posix_mem_001.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mem/smoke/It_posix_mem_003.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mem/smoke/It_posix_mem_003.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mem/smoke/It_posix_mem_003.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mem/smoke/It_posix_mem_003.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/It_posix_queue.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/It_posix_queue.h similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/It_posix_queue.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/It_posix_queue.h diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/config.gni b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/config.gni similarity index 97% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/config.gni rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/config.gni index b272dd43..caa41ff5 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/config.gni +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/config.gni @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023 Huawei Device Co., Ltd. All rights reserved. +# Copyright (c) 2022-2022 Huawei Device Co., Ltd. All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: @@ -26,15 +26,14 @@ # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -import("//build/lite/config/test.gni") import("//kernel/liteos_a/testsuites/unittest/config.gni") -libc_posix_mqueue_include_dirs = [ "$TEST_UNITTEST_DIR/libc/posix/mqueue" ] +posix_mqueue_include_dirs = [ "$TEST_UNITTEST_DIR/libc/posix/mqueue" ] -libc_posix_mqueue_sources_entry = +posix_mqueue_sources_entry = [ "$TEST_UNITTEST_DIR/libc/posix/mqueue/posix_mqueue_test.cpp" ] -libc_posix_mqueue_sources_smoke = [ +posix_mqueue_sources_smoke = [ "$TEST_UNITTEST_DIR/libc/posix/mqueue/smoke/It_posix_queue_001.cpp", "$TEST_UNITTEST_DIR/libc/posix/mqueue/smoke/It_posix_queue_003.cpp", "$TEST_UNITTEST_DIR/libc/posix/mqueue/smoke/It_posix_queue_028.cpp", @@ -42,7 +41,7 @@ libc_posix_mqueue_sources_smoke = [ "$TEST_UNITTEST_DIR/libc/posix/mqueue/smoke/It_posix_queue_062.cpp", ] -libc_posix_mqueue_sources_full = [ +posix_mqueue_sources_full = [ "$TEST_UNITTEST_DIR/libc/posix/mqueue/full/It_posix_queue_002.cpp", "$TEST_UNITTEST_DIR/libc/posix/mqueue/full/It_posix_queue_005.cpp", "$TEST_UNITTEST_DIR/libc/posix/mqueue/full/It_posix_queue_008.cpp", diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_002.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_002.cpp similarity index 84% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_002.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_002.cpp index 55109fe7..d7507a1b 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_002.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_002.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2023 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -36,18 +36,16 @@ static UINT32 Testcase(VOID) CHAR msgrcd[MQUEUE_STANDARD_NAME_LENGTH] = {0}; CHAR mqname[MQUEUE_STANDARD_NAME_LENGTH] = ""; const CHAR *msgptr = MQUEUE_SEND_STRING_TEST; - struct mq_attr attr = {0}; + struct mq_attr attr = { 0 }; mqd_t mqueue; attr.mq_msgsize = MQUEUE_STANDARD_NAME_LENGTH; attr.mq_maxmsg = 1; - ret = snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, - "/mq002_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT2); + snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq002_%d", LosCurTaskIDGet()); mqueue = mq_open(mqname, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, &attr); - ICUNIT_GOTO_NOT_EQUAL(mqueue, (mqd_t)-1, mqueue, EXIT2); + ICUNIT_GOTO_NOT_EQUAL(mqueue, (mqd_t)-1, mqueue, EXIT1); ret = mq_send(mqueue, msgptr, strlen(msgptr), 0); ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT1); @@ -57,10 +55,10 @@ static UINT32 Testcase(VOID) ICUNIT_GOTO_STRING_EQUAL(msgrcd, MQUEUE_SEND_STRING_TEST, msgrcd, EXIT1); ret = mq_close(mqueue); - ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT); + ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT1); ret = mq_unlink(mqname); - ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT2); + ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT); return MQUEUE_NO_ERROR; @@ -68,11 +66,10 @@ EXIT1: mq_close(mqueue); EXIT: mq_unlink(mqname); -EXIT2: - return MQUEUE_IS_ERROR; + return MQUEUE_NO_ERROR; } -VOID ItPosixQueue002(VOID) +VOID ItPosixQueue002(VOID) // IT_Layer_ModuleORFeature_No { TEST_ADD_CASE("IT_POSIX_QUEUE_002", Testcase, TEST_POSIX, TEST_QUE, TEST_LEVEL2, TEST_FUNCTION); } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_005.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_005.cpp similarity index 85% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_005.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_005.cpp index 93c2dfb3..eace9af2 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_005.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_005.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2023 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -32,13 +32,10 @@ static UINT32 Testcase(VOID) { - INT32 ret; CHAR mqname[MQUEUE_STANDARD_NAME_LENGTH] = ""; mqd_t mqueue; - ret = snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, - "/mq005_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT1); + snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq005_%d", LosCurTaskIDGet()); mqueue = mq_open(mqname, O_RDWR, S_IRUSR | S_IWUSR, NULL); ICUNIT_GOTO_EQUAL(mqueue, (mqd_t)-1, mqueue, EXIT); ICUNIT_ASSERT_EQUAL(errno, ENOENT, errno); @@ -48,11 +45,10 @@ static UINT32 Testcase(VOID) EXIT: mq_close(mqueue); mq_unlink(mqname); -EXIT1: - return MQUEUE_IS_ERROR; + return MQUEUE_NO_ERROR; } -VOID ItPosixQueue005(VOID) +VOID ItPosixQueue005(VOID) // IT_Layer_ModuleORFeature_No { TEST_ADD_CASE("IT_POSIX_QUEUE_005", Testcase, TEST_POSIX, TEST_QUE, TEST_LEVEL2, TEST_FUNCTION); } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_008.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_008.cpp similarity index 79% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_008.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_008.cpp index 6e7ca3cb..aa888e9c 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_008.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_008.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2023 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -36,37 +36,33 @@ static UINT32 Testcase(VOID) CHAR mqname[MQUEUE_STANDARD_NAME_LENGTH] = ""; mqd_t roqueue, roqueue2; - ret = snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, - "/mq008_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT2); - + snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq008_%d", LosCurTaskIDGet()); + roqueue = mq_open(mqname, O_CREAT | O_RDONLY, S_IRUSR | S_IWUSR, NULL); - ICUNIT_GOTO_NOT_EQUAL(roqueue, (mqd_t)-1, roqueue, EXIT2); + ICUNIT_GOTO_NOT_EQUAL(roqueue, (mqd_t)-1, roqueue, EXIT); roqueue2 = mq_open(mqname, O_RDONLY, S_IRUSR | S_IWUSR, NULL); - ICUNIT_GOTO_NOT_EQUAL(roqueue2, (mqd_t)-1, roqueue2, EXIT); - - ret = mq_close(roqueue2); - ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT); + ICUNIT_GOTO_NOT_EQUAL(roqueue2, (mqd_t)-1, roqueue2, EXIT1); ret = mq_close(roqueue); - ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT3); + ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT1); + + ret = mq_close(roqueue2); + ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT1); ret = mq_unlink(mqname); - ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT2); + ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT); return MQUEUE_NO_ERROR; EXIT1: mq_close(roqueue2); EXIT: mq_close(roqueue); -EXIT3: mq_unlink(mqname); -EXIT2: - return MQUEUE_IS_ERROR; + return MQUEUE_NO_ERROR; } -VOID ItPosixQueue008(VOID) +VOID ItPosixQueue008(VOID) // IT_Layer_ModuleORFeature_No { TEST_ADD_CASE("IT_POSIX_QUEUE_008", Testcase, TEST_POSIX, TEST_QUE, TEST_LEVEL2, TEST_FUNCTION); } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_011.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_011.cpp similarity index 85% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_011.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_011.cpp index b6c6c7bf..53f8df27 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_011.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_011.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2023 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -38,16 +38,14 @@ static UINT32 Testcase(VOID) CHAR msgrcd2[MQUEUE_STANDARD_NAME_LENGTH] = {0}; const CHAR *msgptr = MQUEUE_SEND_STRING_TEST; mqd_t rdwrqueue, rdwrqueue2; - struct mq_attr attr = {0}; + struct mq_attr attr = { 0 }; + + snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq011_%d", LosCurTaskIDGet()); - ret = snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, - "/mq011_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT2); - attr.mq_msgsize = MQUEUE_STANDARD_NAME_LENGTH; attr.mq_maxmsg = MQUEUE_STANDARD_NAME_LENGTH; rdwrqueue = mq_open(mqname, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, &attr); - ICUNIT_GOTO_NOT_EQUAL(rdwrqueue, (mqd_t)-1, rdwrqueue, EXIT2); + ICUNIT_GOTO_NOT_EQUAL(rdwrqueue, (mqd_t)-1, rdwrqueue, EXIT); ret = mq_send(rdwrqueue, msgptr, strlen(msgptr), 0); ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT); @@ -56,7 +54,7 @@ static UINT32 Testcase(VOID) ICUNIT_GOTO_EQUAL(ret, strlen(msgptr), ret, EXIT); rdwrqueue2 = mq_open(mqname, O_RDWR, S_IRUSR | S_IWUSR, &attr); - ICUNIT_GOTO_NOT_EQUAL(rdwrqueue2, (mqd_t)-1, rdwrqueue2, EXIT); + ICUNIT_GOTO_NOT_EQUAL(rdwrqueue2, (mqd_t)-1, rdwrqueue2, EXIT1); ret = mq_send(rdwrqueue2, msgptr, strlen(msgptr), 0); ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT1); @@ -65,26 +63,24 @@ static UINT32 Testcase(VOID) ICUNIT_GOTO_EQUAL(ret, strlen(msgptr), ret, EXIT1); ret = mq_close(rdwrqueue2); - ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT); + ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT1); ret = mq_close(rdwrqueue); - ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT3); + ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT); ret = mq_unlink(mqname); - ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT2); + ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT); return MQUEUE_NO_ERROR; EXIT1: mq_close(rdwrqueue2); EXIT: mq_close(rdwrqueue); -EXIT3: mq_unlink(mqname); -EXIT2: - return MQUEUE_IS_ERROR; + return MQUEUE_NO_ERROR; } -VOID ItPosixQueue011(VOID) +VOID ItPosixQueue011(VOID) // IT_Layer_ModuleORFeature_No { TEST_ADD_CASE("IT_POSIX_QUEUE_011", Testcase, TEST_POSIX, TEST_QUE, TEST_LEVEL2, TEST_FUNCTION); } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_013.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_013.cpp similarity index 83% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_013.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_013.cpp index 8c856b0c..f5b8698e 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_013.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_013.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2023 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -37,30 +37,28 @@ static UINT32 Testcase(VOID) const CHAR *msgptr = MQUEUE_SEND_STRING_TEST; mqd_t mqueue1, mqueue2; - ret = snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, - "/mq013_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT3); - + snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq013_%d", LosCurTaskIDGet()); + mqueue1 = mq_open(mqname, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, NULL); - ICUNIT_GOTO_NOT_EQUAL(mqueue1, (mqd_t)-1, mqueue1, EXIT3); + ICUNIT_GOTO_NOT_EQUAL(mqueue1, (mqd_t)-1, mqueue1, EXIT1); ret = mq_send(mqueue1, msgptr, strlen(msgptr), 0); ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT1); mqueue2 = mq_open(mqname, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, NULL); - ICUNIT_GOTO_NOT_EQUAL(mqueue2, (mqd_t)-1, mqueue2, EXIT1); + ICUNIT_GOTO_NOT_EQUAL(mqueue2, (mqd_t)-1, mqueue2, EXIT2); ret = mq_send(mqueue2, msgptr, strlen(msgptr), 0); ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT2); + ret = mq_close(mqueue1); + ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT2); + ret = mq_close(mqueue2); ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT1); - ret = mq_close(mqueue1); - ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT); - ret = mq_unlink(mqname); - ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT3); + ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT); return MQUEUE_NO_ERROR; EXIT2: @@ -69,11 +67,10 @@ EXIT1: mq_close(mqueue1); EXIT: mq_unlink(mqname); -EXIT3: - return MQUEUE_IS_ERROR; + return MQUEUE_NO_ERROR; } -VOID ItPosixQueue013(VOID) +VOID ItPosixQueue013(VOID) // IT_Layer_ModuleORFeature_No { TEST_ADD_CASE("IT_POSIX_QUEUE_013", Testcase, TEST_POSIX, TEST_QUE, TEST_LEVEL2, TEST_FUNCTION); } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_014.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_014.cpp similarity index 83% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_014.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_014.cpp index 204f6e83..b124f181 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_014.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_014.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2023 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -35,14 +35,12 @@ static UINT32 Testcase(VOID) INT32 ret; CHAR mqname[MQUEUE_STANDARD_NAME_LENGTH] = ""; mqd_t mqueue; - struct mq_attr attr = {0}; + struct mq_attr attr = { 0 }; - ret = snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, - "/mq014_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT2); + snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq014_%d", LosCurTaskIDGet()); mqueue = mq_open(mqname, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, NULL); - ICUNIT_GOTO_NOT_EQUAL(mqueue, (mqd_t)-1, mqueue, EXIT2); + ICUNIT_GOTO_NOT_EQUAL(mqueue, (mqd_t)-1, mqueue, EXIT1); ret = mq_getattr(mqueue, &attr); ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT1); @@ -52,21 +50,20 @@ static UINT32 Testcase(VOID) ICUNIT_GOTO_EQUAL(attr.mq_msgsize, MQ_MAX_MSG_LEN, attr.mq_msgsize, EXIT1); ret = mq_close(mqueue); - ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT); + ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT1); ret = mq_unlink(mqname); - ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT2); + ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT); return MQUEUE_NO_ERROR; EXIT1: mq_close(mqueue); EXIT: mq_unlink(mqname); -EXIT2: - return MQUEUE_IS_ERROR; + return MQUEUE_NO_ERROR; } -VOID ItPosixQueue014(VOID) +VOID ItPosixQueue014(VOID) // IT_Layer_ModuleORFeature_No { TEST_ADD_CASE("IT_POSIX_QUEUE_014", Testcase, TEST_POSIX, TEST_QUE, TEST_LEVEL2, TEST_FUNCTION); } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_015.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_015.cpp similarity index 82% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_015.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_015.cpp index 6a1bec47..5bc45d9c 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_015.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_015.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2023 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -35,17 +35,15 @@ static UINT32 Testcase(VOID) INT32 ret; CHAR mqname[MQUEUE_STANDARD_NAME_LENGTH] = ""; mqd_t mqueue; - struct mq_attr attr = {0}; + struct mq_attr attr = { 0 }; struct mq_attr attrget; - ret = snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, - "/mq015_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT2); + snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq015_%d", LosCurTaskIDGet()); attr.mq_maxmsg = MQUEUE_SHORT_ARRAY_LENGTH; attr.mq_msgsize = 5; // 5, queue message size. mqueue = mq_open(mqname, O_CREAT | O_RDWR | O_NONBLOCK, S_IRUSR | S_IWUSR, &attr); - ICUNIT_GOTO_NOT_EQUAL(mqueue, (mqd_t)-1, mqueue, EXIT2); + ICUNIT_GOTO_NOT_EQUAL(mqueue, (mqd_t)-1, mqueue, EXIT1); ret = mq_getattr(mqueue, &attrget); ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT1); @@ -54,24 +52,25 @@ static UINT32 Testcase(VOID) ICUNIT_GOTO_EQUAL(attrget.mq_maxmsg, attr.mq_maxmsg, attrget.mq_maxmsg, EXIT1); ICUNIT_GOTO_EQUAL(attrget.mq_msgsize, attr.mq_msgsize, attrget.mq_msgsize, EXIT1); - ICUNIT_GOTO_NOT_EQUAL(attrget.mq_flags & O_NONBLOCK, 0, MQUEUE_IS_ERROR, EXIT1); + if (!(attrget.mq_flags & O_NONBLOCK)) { + goto EXIT1; + } ret = mq_close(mqueue); - ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT); + ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT1); ret = mq_unlink(mqname); - ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT2); + ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT); return MQUEUE_NO_ERROR; EXIT1: mq_close(mqueue); EXIT: mq_unlink(mqname); -EXIT2: - return MQUEUE_IS_ERROR; + return MQUEUE_NO_ERROR; } -VOID ItPosixQueue015(VOID) +VOID ItPosixQueue015(VOID) // IT_Layer_ModuleORFeature_No { TEST_ADD_CASE("IT_POSIX_QUEUE_015", Testcase, TEST_POSIX, TEST_QUE, TEST_LEVEL2, TEST_FUNCTION); } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_016.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_016.cpp similarity index 81% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_016.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_016.cpp index 51704024..2a464695 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_016.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_016.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2023 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -36,21 +36,19 @@ static UINT32 Testcase(VOID) CHAR mqname[MQUEUE_STANDARD_NAME_LENGTH] = ""; mqd_t mqueue1, mqueue2; - ret = snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, - "/mq016_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT3); - + snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq016_%d", LosCurTaskIDGet()); + mqueue1 = mq_open(mqname, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, NULL); - ICUNIT_GOTO_NOT_EQUAL(mqueue1, (mqd_t)-1, mqueue1, EXIT3); + ICUNIT_GOTO_NOT_EQUAL(mqueue1, (mqd_t)-1, mqueue1, EXIT1); mqueue2 = mq_open(mqname, O_CREAT | O_EXCL | O_RDWR, S_IRUSR | S_IWUSR, NULL); - ICUNIT_GOTO_EQUAL(mqueue2, (mqd_t)-1, mqueue2, EXIT1); + ICUNIT_GOTO_EQUAL(mqueue2, (mqd_t)-1, mqueue2, EXIT2); ret = mq_close(mqueue1); - ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT); + ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT1); ret = mq_unlink(mqname); - ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT3); + ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT); return MQUEUE_NO_ERROR; EXIT2: @@ -59,11 +57,10 @@ EXIT1: mq_close(mqueue1); EXIT: mq_unlink(mqname); -EXIT3: - return MQUEUE_IS_ERROR; + return MQUEUE_NO_ERROR; } -VOID ItPosixQueue016(VOID) +VOID ItPosixQueue016(VOID) // IT_Layer_ModuleORFeature_No { TEST_ADD_CASE("IT_POSIX_QUEUE_016", Testcase, TEST_POSIX, TEST_QUE, TEST_LEVEL2, TEST_FUNCTION); } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_018.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_018.cpp similarity index 83% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_018.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_018.cpp index 0b852457..924bf87c 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_018.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_018.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2023 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -37,32 +37,29 @@ static UINT32 Testcase(VOID) const CHAR *msgptr = MQUEUE_SEND_STRING_TEST; mqd_t mqueue; - ret = snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, - "/mq018_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT2); + snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq018_%d", LosCurTaskIDGet()); mqueue = mq_open(mqname, O_CREAT | O_RDWR | O_NONBLOCK, S_IRUSR | S_IWUSR, NULL); - ICUNIT_GOTO_NOT_EQUAL(mqueue, (mqd_t)-1, mqueue, EXIT2); + ICUNIT_GOTO_NOT_EQUAL(mqueue, (mqd_t)-1, mqueue, EXIT1); ret = mq_send(mqueue, msgptr, strlen(msgptr), 0); ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT1); ret = mq_close(mqueue); - ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT); + ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT1); ret = mq_unlink(mqname); - ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT2); + ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT); return MQUEUE_NO_ERROR; EXIT1: mq_close(mqueue); EXIT: mq_unlink(mqname); -EXIT2: - return MQUEUE_IS_ERROR; + return MQUEUE_NO_ERROR; } -VOID ItPosixQueue018(VOID) +VOID ItPosixQueue018(VOID) // IT_Layer_ModuleORFeature_No { TEST_ADD_CASE("IT_POSIX_QUEUE_018", Testcase, TEST_POSIX, TEST_QUE, TEST_LEVEL2, TEST_FUNCTION); } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_019.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_019.cpp similarity index 87% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_019.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_019.cpp index 85f36f04..a6a4b253 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_019.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_019.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2023 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -37,17 +37,15 @@ static UINT32 Testcase(VOID) CHAR msgrcd[MQUEUE_STANDARD_NAME_LENGTH] = {0}; const CHAR *msgptr = MQUEUE_SEND_STRING_TEST; mqd_t mqueue1, mqueue2; - struct mq_attr attr = {0}; + struct mq_attr attr = { 0 }; - ret = snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, - "/mq019_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT3); + snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq019_%d", LosCurTaskIDGet()); attr.mq_msgsize = MQUEUE_STANDARD_NAME_LENGTH; attr.mq_maxmsg = MQUEUE_STANDARD_NAME_LENGTH; mqueue1 = mq_open(mqname, O_CREAT | O_RDWR | O_NONBLOCK, S_IRUSR | S_IWUSR, &attr); - ICUNIT_GOTO_NOT_EQUAL(mqueue1, (mqd_t)-1, mqueue1, EXIT3); + ICUNIT_GOTO_NOT_EQUAL(mqueue1, (mqd_t)-1, mqueue1, EXIT1); ret = mq_receive(mqueue1, msgrcd, MQUEUE_STANDARD_NAME_LENGTH, NULL); ICUNIT_GOTO_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT1); @@ -56,7 +54,7 @@ static UINT32 Testcase(VOID) ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT1); mqueue2 = mq_open(mqname, O_RDWR | O_NONBLOCK, S_IRUSR | S_IWUSR, NULL); - ICUNIT_GOTO_NOT_EQUAL(mqueue1, (mqd_t)-1, mqueue1, EXIT1); + ICUNIT_GOTO_NOT_EQUAL(mqueue1, (mqd_t)-1, mqueue1, EXIT2); ret = mq_receive(mqueue1, msgrcd, MQUEUE_STANDARD_NAME_LENGTH, NULL); ICUNIT_GOTO_EQUAL(ret, strlen(msgptr), ret, EXIT2); @@ -78,11 +76,10 @@ EXIT1: mq_close(mqueue1); EXIT: mq_unlink(mqname); -EXIT3: - return MQUEUE_IS_ERROR; + return MQUEUE_NO_ERROR; } -VOID ItPosixQueue019(VOID) +VOID ItPosixQueue019(VOID) // IT_Layer_ModuleORFeature_No { TEST_ADD_CASE("IT_POSIX_QUEUE_019", Testcase, TEST_POSIX, TEST_QUE, TEST_LEVEL2, TEST_FUNCTION); } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_020.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_020.cpp similarity index 82% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_020.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_020.cpp index 7b2d9aa6..e24f1a8d 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_020.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_020.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2023 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -38,29 +38,26 @@ static UINT32 Testcase(VOID) struct sigevent ev; struct sigaction act; - ret = snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, - "/mq020_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT2); + snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq020_%d", LosCurTaskIDGet()); mqueue = mq_open(mqname, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, NULL); - ICUNIT_GOTO_NOT_EQUAL(mqueue, (mqd_t)-1, mqueue, EXIT2); + ICUNIT_GOTO_NOT_EQUAL(mqueue, (mqd_t)-1, mqueue, EXIT1); ret = mq_close(mqueue); - ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT); + ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT1); ret = mq_unlink(mqname); - ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT2); + ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT); return MQUEUE_NO_ERROR; EXIT1: mq_close(mqueue); EXIT: mq_unlink(mqname); -EXIT2: - return MQUEUE_IS_ERROR; + return MQUEUE_NO_ERROR; } -VOID ItPosixQueue020(VOID) +VOID ItPosixQueue020(VOID) // IT_Layer_ModuleORFeature_No { TEST_ADD_CASE("IT_POSIX_QUEUE_020", Testcase, TEST_POSIX, TEST_QUE, TEST_LEVEL2, TEST_FUNCTION); } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_021.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_021.cpp similarity index 85% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_021.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_021.cpp index 2a48378a..24eed50c 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_021.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_021.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2023 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -32,13 +32,10 @@ static UINT32 Testcase(VOID) { - INT32 ret; CHAR mqname[MQUEUE_STANDARD_NAME_LENGTH] = ""; mqd_t mqueue; - ret = snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, - "/mq021_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT1); + snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq021_%d", LosCurTaskIDGet()); mqueue = mq_open(mqname, O_RDWR, S_IRUSR | S_IWUSR, NULL); ICUNIT_GOTO_EQUAL(mqueue, (mqd_t)-1, mqueue, EXIT); @@ -48,11 +45,10 @@ static UINT32 Testcase(VOID) EXIT: mq_close(mqueue); mq_unlink(mqname); -EXIT1: - return MQUEUE_IS_ERROR; + return MQUEUE_NO_ERROR; } -VOID ItPosixQueue021(VOID) +VOID ItPosixQueue021(VOID) // IT_Layer_ModuleORFeature_No { TEST_ADD_CASE("IT_POSIX_QUEUE_021", Testcase, TEST_POSIX, TEST_QUE, TEST_LEVEL2, TEST_FUNCTION); } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_025.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_025.cpp similarity index 77% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_025.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_025.cpp index 40f6dfea..34df3292 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_025.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_025.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2023 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -30,23 +30,16 @@ */ #include "It_posix_queue.h" -#define QUEUE_NAME_MAX_LEN (MQUEUE_NAME_MAX_TEST * 2) - static UINT32 Testcase(VOID) { - CHAR mqname[QUEUE_NAME_MAX_LEN]; + CHAR mqname[MQUEUE_NAME_MAX_TEST * 2]; mqd_t mqueue; - UINT32 ret; INT32 i; - ret = snprintf_s(mqname, QUEUE_NAME_MAX_LEN, QUEUE_NAME_MAX_LEN - 1, \ - "/mq025_%d", LosCurTaskIDGet()); // 2, mqname length. - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT1); + snprintf(mqname, MQUEUE_NAME_MAX_TEST * 2, "/mq025_%d", LosCurTaskIDGet()); // 2, mqname length. - for (i = 0; i < MQUEUE_NAME_MAX_TEST; i++) { - ret = strcat_s(mqname, QUEUE_NAME_MAX_LEN, "0"); - ICUNIT_ASSERT_EQUAL(ret, EOK, ret); - } + for (i = 0; i < MQUEUE_NAME_MAX_TEST; i++) + strcat(mqname, "0"); mqueue = mq_open(mqname, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, NULL); ICUNIT_GOTO_EQUAL(mqueue, (mqd_t)-1, mqueue, EXIT); @@ -56,11 +49,10 @@ static UINT32 Testcase(VOID) EXIT: mq_close(mqueue); mq_unlink(mqname); -EXIT1: - return MQUEUE_IS_ERROR; + return MQUEUE_NO_ERROR; } -VOID ItPosixQueue025(VOID) +VOID ItPosixQueue025(VOID) // IT_Layer_ModuleORFeature_No { TEST_ADD_CASE("IT_POSIX_QUEUE_025", Testcase, TEST_POSIX, TEST_QUE, TEST_LEVEL2, TEST_FUNCTION); } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_026.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_026.cpp similarity index 85% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_026.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_026.cpp index 7f268459..85a62c36 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_026.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_026.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2023 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -32,13 +32,10 @@ static UINT32 Testcase(VOID) { - INT32 ret; CHAR qname[MQUEUE_STANDARD_NAME_LENGTH] = ""; mqd_t queue; - ret = snprintf_s(qname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq026-1_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT1); + snprintf(qname, MQUEUE_STANDARD_NAME_LENGTH, "/mq026-1_%d", LosCurTaskIDGet()); queue = mq_open(qname, O_RDWR, S_IRUSR | S_IWUSR, NULL); ICUNIT_GOTO_EQUAL(queue, (mqd_t)-1, queue, EXIT); @@ -48,11 +45,10 @@ static UINT32 Testcase(VOID) EXIT: mq_close(queue); mq_unlink(qname); -EXIT1: - return MQUEUE_IS_ERROR; + return MQUEUE_NO_ERROR; } -VOID ItPosixQueue026(VOID) +VOID ItPosixQueue026(VOID) // IT_Layer_ModuleORFeature_No { TEST_ADD_CASE("IT_POSIX_QUEUE_026", Testcase, TEST_POSIX, TEST_QUE, TEST_LEVEL2, TEST_FUNCTION); } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_027.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_027.cpp similarity index 78% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_027.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_027.cpp index ecaa52a2..7bf876e1 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_027.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_027.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2023 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -32,33 +32,31 @@ static UINT32 Testcase(VOID) { - CHAR qname[MQUEUE_STANDARD_NAME_LENGTH]; + CHAR qname[50]; INT32 ret; mqd_t queue; - ret = snprintf_s(qname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq027-1_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT1); + snprintf(qname, MQUEUE_STANDARD_NAME_LENGTH, "/mq027-1_%d", LosCurTaskIDGet()); queue = mq_open(qname, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, NULL); - ICUNIT_ASSERT_NOT_EQUAL(queue, (mqd_t)-1, queue); + if (queue == (mqd_t)-1) { + ICUNIT_ASSERT_NOT_EQUAL(queue, (mqd_t)-1, queue); + } ret = mq_close(queue); - ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT2); + ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT); ret = mq_unlink(qname); - ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT1); + ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT); return MQUEUE_NO_ERROR; EXIT: mq_close(queue); -EXIT2: mq_unlink(qname); -EXIT1: - return MQUEUE_IS_ERROR; + return MQUEUE_NO_ERROR; } -VOID ItPosixQueue027(VOID) +VOID ItPosixQueue027(VOID) // IT_Layer_ModuleORFeature_No { TEST_ADD_CASE("IT_POSIX_QUEUE_027", Testcase, TEST_POSIX, TEST_QUE, TEST_LEVEL2, TEST_FUNCTION); } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_030.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_030.cpp similarity index 90% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_030.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_030.cpp index f867ddfa..4d856c19 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_030.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_030.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2023 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -33,17 +33,18 @@ static UINT32 Testcase(VOID) { INT32 ret; - ret = mq_close((mqd_t)-1); // -1: an invalid argument + ret = mq_close((mqd_t)-1); ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT); ICUNIT_ASSERT_EQUAL(errno, EBADF, errno); return MQUEUE_NO_ERROR; EXIT: - return MQUEUE_IS_ERROR; + mq_close((mqd_t)-1); + return MQUEUE_NO_ERROR; } -VOID ItPosixQueue030(VOID) +VOID ItPosixQueue030(VOID) // IT_Layer_ModuleORFeature_No { TEST_ADD_CASE("IT_POSIX_QUEUE_030", Testcase, TEST_POSIX, TEST_QUE, TEST_LEVEL2, TEST_FUNCTION); } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_031.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_031.cpp similarity index 84% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_031.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_031.cpp index 532481b5..68263166 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_031.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_031.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2023 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -32,22 +32,20 @@ static UINT32 Testcase(VOID) { - INT32 ret; + INT32 ret = 0; CHAR mqname[MQUEUE_STANDARD_NAME_LENGTH] = {0}; CHAR msgrcd[MQUEUE_STANDARD_NAME_LENGTH] = {0}; const CHAR *msgptr = MQUEUE_SEND_STRING_TEST; struct timespec ts; mqd_t mqueue; - struct mq_attr attr = {0}; + struct mq_attr attr = { 0 }; - ret = snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq031_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT2); + snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq031_%d", LosCurTaskIDGet()); attr.mq_msgsize = MQUEUE_STANDARD_NAME_LENGTH; attr.mq_maxmsg = MQUEUE_SHORT_ARRAY_LENGTH; mqueue = mq_open(mqname, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, &attr); - ICUNIT_GOTO_NOT_EQUAL(mqueue, (mqd_t)-1, mqueue, EXIT2); + ICUNIT_GOTO_NOT_EQUAL(mqueue, (mqd_t)-1, mqueue, EXIT1); ts.tv_sec = 1; ts.tv_nsec = 0; @@ -61,21 +59,20 @@ static UINT32 Testcase(VOID) ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT1); ret = mq_close(mqueue); - ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT); + ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT1); ret = mq_unlink(mqname); - ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT2); + ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT); return MQUEUE_NO_ERROR; EXIT1: mq_close(mqueue); EXIT: mq_unlink(mqname); -EXIT2: - return MQUEUE_IS_ERROR; + return MQUEUE_NO_ERROR; } -VOID ItPosixQueue031(VOID) +VOID ItPosixQueue031(VOID) // IT_Layer_ModuleORFeature_No { TEST_ADD_CASE("IT_POSIX_QUEUE_031", Testcase, TEST_POSIX, TEST_QUE, TEST_LEVEL2, TEST_FUNCTION); } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_032.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_032.cpp similarity index 82% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_032.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_032.cpp index c6fc107e..9feb1399 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_032.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_032.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2023 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -37,29 +37,26 @@ static UINT32 Testcase(VOID) mqd_t mqueue; struct sigevent se; - ret = snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, - "/mq032_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT2); + snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq032_%d", LosCurTaskIDGet()); mqueue = mq_open(mqname, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, NULL); - ICUNIT_GOTO_NOT_EQUAL(mqueue, (mqd_t)-1, mqueue, EXIT2); + ICUNIT_GOTO_NOT_EQUAL(mqueue, (mqd_t)-1, mqueue, EXIT1); ret = mq_close(mqueue); - ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT); + ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT1); ret = mq_unlink(mqname); - ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT2); + ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT); return MQUEUE_NO_ERROR; EXIT1: mq_close(mqueue); EXIT: mq_unlink(mqname); -EXIT2: - return MQUEUE_IS_ERROR; + return MQUEUE_NO_ERROR; } -VOID ItPosixQueue032(VOID) +VOID ItPosixQueue032(VOID) // IT_Layer_ModuleORFeature_No { TEST_ADD_CASE("IT_POSIX_QUEUE_032", Testcase, TEST_POSIX, TEST_QUE, TEST_LEVEL2, TEST_FUNCTION); } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_033.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_033.cpp similarity index 84% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_033.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_033.cpp index 71d7327e..6c426821 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_033.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_033.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2023 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -37,16 +37,14 @@ static UINT32 Testcase(VOID) CHAR msgrcd[MQUEUE_STANDARD_NAME_LENGTH] = {0}; const CHAR *msgptr = MQUEUE_SEND_STRING_TEST; mqd_t mqueue; - struct mq_attr attr = {0}; + struct mq_attr attr = { 0 }; - ret = snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq033_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT2); + snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq033_%d", LosCurTaskIDGet()); attr.mq_msgsize = MQUEUE_STANDARD_NAME_LENGTH; attr.mq_maxmsg = MQUEUE_SHORT_ARRAY_LENGTH; mqueue = mq_open(mqname, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, &attr); - ICUNIT_GOTO_NOT_EQUAL(mqueue, (mqd_t)-1, mqueue, EXIT2); + ICUNIT_GOTO_NOT_EQUAL(mqueue, (mqd_t)-1, mqueue, EXIT1); ret = mq_send(mqueue, msgptr, strlen(msgptr), 0); ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT1); @@ -58,21 +56,20 @@ static UINT32 Testcase(VOID) ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT1); ret = mq_close(mqueue); - ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT); + ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT1); ret = mq_unlink(mqname); - ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT2); + ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT); return MQUEUE_NO_ERROR; EXIT1: mq_close(mqueue); EXIT: mq_unlink(mqname); -EXIT2: - return MQUEUE_IS_ERROR; + return MQUEUE_NO_ERROR; } -VOID ItPosixQueue033(VOID) +VOID ItPosixQueue033(VOID) // IT_Layer_ModuleORFeature_No { TEST_ADD_CASE("IT_POSIX_QUEUE_033", Testcase, TEST_POSIX, TEST_QUE, TEST_LEVEL2, TEST_FUNCTION); } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_036.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_036.cpp similarity index 83% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_036.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_036.cpp index 789e29a0..991352a2 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_036.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_036.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2023 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -32,18 +32,16 @@ static UINT32 Testcase(VOID) { - INT32 ret; + INT32 ret = 0; CHAR mqname[MQUEUE_STANDARD_NAME_LENGTH] = ""; const CHAR *msgptr = MQUEUE_SEND_STRING_TEST; struct timespec ts; mqd_t mqueue; - ret = snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq036_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT2); + snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq036_%d", LosCurTaskIDGet()); mqueue = mq_open(mqname, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, NULL); - ICUNIT_GOTO_NOT_EQUAL(mqueue, (mqd_t)-1, mqueue, EXIT2); + ICUNIT_GOTO_NOT_EQUAL(mqueue, (mqd_t)-1, mqueue, EXIT1); ts.tv_sec = 1; ts.tv_nsec = 0; @@ -52,21 +50,20 @@ static UINT32 Testcase(VOID) ICUNIT_GOTO_EQUAL(errno, EINVAL, errno, EXIT1); ret = mq_close(mqueue); - ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT); + ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT1); ret = mq_unlink(mqname); - ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT2); + ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT); return MQUEUE_NO_ERROR; EXIT1: mq_close(mqueue); EXIT: mq_unlink(mqname); -EXIT2: - return MQUEUE_IS_ERROR; + return MQUEUE_NO_ERROR; } -VOID ItPosixQueue036(VOID) +VOID ItPosixQueue036(VOID) // IT_Layer_ModuleORFeature_No { TEST_ADD_CASE("IT_POSIX_QUEUE_036", Testcase, TEST_POSIX, TEST_QUE, TEST_LEVEL2, TEST_FUNCTION); } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_038.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_038.cpp similarity index 83% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_038.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_038.cpp index cb56bbb0..1a0eadb3 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_038.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_038.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2023 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -37,33 +37,30 @@ static UINT32 Testcase(VOID) const CHAR *msgptr = MQUEUE_SEND_STRING_TEST; mqd_t mqueue; - ret = snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq038_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT2); - + snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq038_%d", LosCurTaskIDGet()); + mqueue = mq_open(mqname, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, NULL); - ICUNIT_GOTO_NOT_EQUAL(mqueue, (mqd_t)-1, mqueue, EXIT2); + ICUNIT_GOTO_NOT_EQUAL(mqueue, (mqd_t)-1, mqueue, EXIT1); ret = mq_send(mqueue, msgptr, strlen(msgptr), MQ_PRIO_MAX); ICUNIT_GOTO_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT1); ICUNIT_GOTO_EQUAL(errno, EINVAL, errno, EXIT1); ret = mq_close(mqueue); - ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT); + ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT1); ret = mq_unlink(mqname); - ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT2); + ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT); return MQUEUE_NO_ERROR; EXIT1: mq_close(mqueue); EXIT: mq_unlink(mqname); -EXIT2: - return MQUEUE_IS_ERROR; + return MQUEUE_NO_ERROR; } -VOID ItPosixQueue038(VOID) +VOID ItPosixQueue038(VOID) // IT_Layer_ModuleORFeature_No { TEST_ADD_CASE("IT_POSIX_QUEUE_038", Testcase, TEST_POSIX, TEST_QUE, TEST_LEVEL2, TEST_FUNCTION); } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_040.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_040.cpp similarity index 86% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_040.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_040.cpp index b857eb0c..4442ff61 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_040.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_040.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2023 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -30,7 +30,7 @@ */ #include "It_posix_queue.h" -__attribute__((optnone)) static VOID *PthreadF01(VOID *argument) +static VOID *PthreadF01(VOID *argument) { INT32 i; INT32 ret; @@ -54,7 +54,7 @@ EXIT: return NULL; } -__attribute__((optnone)) static VOID *PthreadF02(VOID *argument) +static VOID *PthreadF02(VOID *argument) { INT32 j, ret; @@ -79,18 +79,16 @@ EXIT: return NULL; } -__attribute__((optnone)) static UINT32 Testcase(VOID) +static UINT32 Testcase(VOID) { pthread_t newTh1, newTh2; UINT32 ret; CHAR msgrcd[MQUEUE_STANDARD_NAME_LENGTH] = ""; const CHAR *msgptr = MQUEUE_SEND_STRING_TEST; - struct mq_attr attr = {0}; + struct mq_attr attr = { 0 }; pthread_attr_t attr1; - ret = snprintf_s(g_gqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq040_%d", getpid()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT3); + snprintf(g_gqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq040_%d", getpid()); attr.mq_msgsize = MQUEUE_STANDARD_NAME_LENGTH; attr.mq_maxmsg = 5; // 5, queue max message size. @@ -98,7 +96,7 @@ __attribute__((optnone)) static UINT32 Testcase(VOID) g_testCount = 0; g_gqueue = mq_open(g_gqname, O_CREAT | O_RDWR | O_EXCL, S_IRUSR | S_IWUSR, &attr); - ICUNIT_GOTO_NOT_EQUAL(g_gqueue, (mqd_t)-1, g_gqueue, EXIT3); + ICUNIT_GOTO_NOT_EQUAL(g_gqueue, (mqd_t)-1, g_gqueue, EXIT); ret = PosixPthreadInit(&attr1, MQUEUE_PTHREAD_PRIORITY_TEST1); ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT1); @@ -121,10 +119,10 @@ __attribute__((optnone)) static UINT32 Testcase(VOID) ICUNIT_GOTO_EQUAL(g_testCount, 4, g_testCount, EXIT2); // 4, Here, assert the g_testCount. ret = PosixPthreadDestroy(&attr1, newTh2); - ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT1); + ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT2); ret = PosixPthreadDestroy(&attr1, newTh1); - ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT); + ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT1); return MQUEUE_NO_ERROR; @@ -135,11 +133,10 @@ EXIT1: EXIT: mq_close(g_gqueue); mq_unlink(g_gqname); -EXIT3: - return MQUEUE_IS_ERROR; + return MQUEUE_NO_ERROR; } -VOID ItPosixQueue040(VOID) +VOID ItPosixQueue040(VOID) // IT_Layer_ModuleORFeature_No { TEST_ADD_CASE("IT_POSIX_QUEUE_040", Testcase, TEST_POSIX, TEST_QUE, TEST_LEVEL2, TEST_FUNCTION); } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_041.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_041.cpp similarity index 90% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_041.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_041.cpp index 388c461b..7acdcafa 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_041.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_041.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2023 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -68,10 +68,10 @@ static VOID *PthreadF02(VOID *argument) TestExtraTaskDelay(2); // 2, Set delay time. ret = mq_close(g_gqueue); - ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT); + ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT1); ret = mq_unlink(g_gqname); - ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT2); + ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT); g_testCount = 4; // 4, Init test count value. @@ -80,7 +80,6 @@ EXIT1: mq_close(g_gqueue); EXIT: mq_unlink(g_gqname); -EXIT2: g_testCount = 0; return NULL; } @@ -88,18 +87,16 @@ EXIT2: static UINT32 Testcase(VOID) { UINT32 ret; - struct mq_attr attr = {0}; + struct mq_attr attr = { 0 }; pthread_attr_t attr1; pthread_t newTh1, newTh2; - ret = snprintf_s(g_gqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq041_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT3); + snprintf(g_gqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq041_%d", LosCurTaskIDGet()); attr.mq_msgsize = MQUEUE_STANDARD_NAME_LENGTH; attr.mq_maxmsg = 5; // 5, queue max message size. g_gqueue = mq_open(g_gqname, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, &attr); - ICUNIT_GOTO_NOT_EQUAL(g_gqueue, (mqd_t)-1, g_gqueue, EXIT3); + ICUNIT_GOTO_NOT_EQUAL(g_gqueue, (mqd_t)-1, g_gqueue, EXIT); g_testCount = 0; @@ -124,10 +121,10 @@ static UINT32 Testcase(VOID) ICUNIT_GOTO_EQUAL(g_testCount, 4, g_testCount, EXIT2); // 4, Here, assert the g_testCount. ret = PosixPthreadDestroy(&attr1, newTh2); - ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT1); + ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT2); ret = PosixPthreadDestroy(&attr1, newTh1); - ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT); + ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT1); return MQUEUE_NO_ERROR; @@ -138,11 +135,10 @@ EXIT1: EXIT: mq_close(g_gqueue); mq_unlink(g_gqname); -EXIT3: - return MQUEUE_IS_ERROR; + return MQUEUE_NO_ERROR; } -VOID ItPosixQueue041(VOID) +VOID ItPosixQueue041(VOID) // IT_Layer_ModuleORFeature_No { TEST_ADD_CASE("IT_POSIX_QUEUE_041", Testcase, TEST_POSIX, TEST_QUE, TEST_LEVEL2, TEST_FUNCTION); } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_042.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_042.cpp similarity index 76% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_042.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_042.cpp index 240dc7f3..926d6ce2 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_042.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_042.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2023 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -32,27 +32,23 @@ static UINT32 Testcase(VOID) { - INT32 ret; - INT32 i = 0; + INT32 ret, i = 0; CHAR mqname[MQUEUE_STANDARD_NAME_LENGTH] = {0}; CHAR msgrcd[MQUEUE_STANDARD_NAME_LENGTH] = {0}; CHAR msgptr[MQUEUE_STANDARD_NAME_LENGTH] = {0}; mqd_t mqueue; - struct mq_attr attr = {0}; + struct mq_attr attr = { 0 }; - ret = snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, - "/mq042_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT2); + snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq042_%d", LosCurTaskIDGet()); attr.mq_msgsize = MQUEUE_STANDARD_NAME_LENGTH; attr.mq_maxmsg = MQUEUE_SHORT_ARRAY_LENGTH; mqueue = mq_open(mqname, O_CREAT | O_RDWR | O_NONBLOCK, S_IRUSR | S_IWUSR, &attr); - ICUNIT_GOTO_NOT_EQUAL(mqueue, (mqd_t)-1, mqueue, EXIT2); + ICUNIT_GOTO_NOT_EQUAL(mqueue, (mqd_t)-1, mqueue, EXIT1); while (1) { - ret = snprintf_s(msgptr, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, "message %d", i); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT1); + snprintf(msgptr, MQUEUE_STANDARD_NAME_LENGTH, "message %d", i); ret = mq_send(mqueue, msgptr, strlen(msgptr), 0); if (ret == -1) { ICUNIT_GOTO_EQUAL(errno, EAGAIN, errno, EXIT1); @@ -63,8 +59,7 @@ static UINT32 Testcase(VOID) ICUNIT_GOTO_EQUAL(i, MQUEUE_SHORT_ARRAY_LENGTH, i, EXIT1); i = 0; - ret = snprintf_s(msgptr, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, "message %d", i); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT1); + snprintf(msgptr, MQUEUE_STANDARD_NAME_LENGTH, "message %d", i); ret = mq_receive(mqueue, msgrcd, MQUEUE_STANDARD_NAME_LENGTH, NULL); ICUNIT_GOTO_EQUAL(ret, strlen(msgptr), ret, EXIT1); @@ -72,21 +67,20 @@ static UINT32 Testcase(VOID) ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT1); ret = mq_close(mqueue); - ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT); + ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT1); ret = mq_unlink(mqname); - ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT2); + ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT); return MQUEUE_NO_ERROR; EXIT1: mq_close(mqueue); EXIT: mq_unlink(mqname); -EXIT2: - return MQUEUE_IS_ERROR; + return MQUEUE_NO_ERROR; } -VOID ItPosixQueue042(VOID) +VOID ItPosixQueue042(VOID) // IT_Layer_ModuleORFeature_No { TEST_ADD_CASE("IT_POSIX_QUEUE_042", Testcase, TEST_POSIX, TEST_QUE, TEST_LEVEL2, TEST_FUNCTION); } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_043.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_043.cpp similarity index 86% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_043.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_043.cpp index d4fdd79b..37aa3c04 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_043.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_043.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2023 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -37,11 +37,9 @@ static UINT32 Testcase(VOID) CHAR msgrcd[MQUEUE_STANDARD_NAME_LENGTH] = {0}; const CHAR *msgptr = MQUEUE_SEND_STRING_TEST; mqd_t mqueue; - struct mq_attr attr = {0}; + struct mq_attr attr = { 0 }; - ret = snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, - "/mq043_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT2); + snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq043_%d", LosCurTaskIDGet()); attr.mq_msgsize = MQUEUE_STANDARD_NAME_LENGTH; attr.mq_maxmsg = MQUEUE_SHORT_ARRAY_LENGTH; @@ -59,18 +57,17 @@ static UINT32 Testcase(VOID) ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT1); ret = mq_close(mqueue); - ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT); + ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT1); ret = mq_unlink(mqname); - ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT2); + ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT); return MQUEUE_NO_ERROR; EXIT1: mq_close(mqueue); EXIT: mq_unlink(mqname); -EXIT2: - return MQUEUE_IS_ERROR; + return MQUEUE_NO_ERROR; } /* * @@ -85,16 +82,16 @@ EXIT2: 4. use the mq_close to close the mqueue; 5. use the mq_unlink to delete the mqueue. *-@texpect -1. Return succeeded -2. Return succeeded -3. Return succeeded -4. Return succeeded +1. Return successed +2. Return successed +3. Return successed +4. Return successed 5. Successful operation *-@tprior 1 *-@tauto TRUE *-@tremark */ -VOID ItPosixQueue043(VOID) +VOID ItPosixQueue043(VOID) // IT_Layer_ModuleORFeature_No { TEST_ADD_CASE("IT_POSIX_QUEUE_043", Testcase, TEST_POSIX, TEST_QUE, TEST_LEVEL2, TEST_FUNCTION); } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_044.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_044.cpp similarity index 84% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_044.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_044.cpp index 93cb5d07..801e114d 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_044.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_044.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2023 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -32,21 +32,19 @@ static UINT32 Testcase(VOID) { - INT32 ret; + INT32 ret = 0; CHAR mqname[MQUEUE_STANDARD_NAME_LENGTH] = {0}; CHAR msgrcd[MQUEUE_STANDARD_NAME_LENGTH] = {0}; const CHAR *msgptr = MQUEUE_SEND_STRING_TEST; mqd_t mqueue; - struct mq_attr attr = {0}; + struct mq_attr attr = { 0 }; - ret = snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, - "/mq044_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT2); + snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq044_%d", LosCurTaskIDGet()); attr.mq_msgsize = MQUEUE_STANDARD_NAME_LENGTH; attr.mq_maxmsg = MQUEUE_SHORT_ARRAY_LENGTH; mqueue = mq_open(mqname, O_CREAT | O_RDWR | O_NONBLOCK, S_IRUSR | S_IWUSR, &attr); - ICUNIT_GOTO_NOT_EQUAL(mqueue, (mqd_t)-1, mqueue, EXIT2); + ICUNIT_GOTO_NOT_EQUAL(mqueue, (mqd_t)-1, mqueue, EXIT1); ret = mq_send((mqd_t)(&mqueue + 1), msgptr, strlen(msgptr), 0); ICUNIT_GOTO_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT1); @@ -60,21 +58,20 @@ static UINT32 Testcase(VOID) ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT1); ret = mq_close(mqueue); - ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT); + ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT1); ret = mq_unlink(mqname); - ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT2); + ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT); return MQUEUE_NO_ERROR; EXIT1: mq_close(mqueue); EXIT: mq_unlink(mqname); -EXIT2: - return MQUEUE_IS_ERROR; + return MQUEUE_NO_ERROR; } -VOID ItPosixQueue044(VOID) +VOID ItPosixQueue044(VOID) // IT_Layer_ModuleORFeature_No { TEST_ADD_CASE("IT_POSIX_QUEUE_044", Testcase, TEST_POSIX, TEST_QUE, TEST_LEVEL2, TEST_FUNCTION); } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_046.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_046.cpp similarity index 86% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_046.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_046.cpp index 4800f597..90aacd21 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_046.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_046.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2023 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -35,11 +35,9 @@ static UINT32 Testcase(VOID) CHAR qname[MQUEUE_STANDARD_NAME_LENGTH] = ""; const CHAR *msgptr = MQUEUE_SEND_STRING_TEST; mqd_t queue; - INT32 ret; + INT32 unresolved = 0, failure = 0, ret = 0; - ret = snprintf_s(qname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq046-1_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT); + snprintf(qname, MQUEUE_STANDARD_NAME_LENGTH, "/mq046-1_%d", LosCurTaskIDGet()); queue = mq_open(qname, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, NULL); ICUNIT_GOTO_NOT_EQUAL(queue, (mqd_t)-1, queue, EXIT); @@ -49,10 +47,10 @@ static UINT32 Testcase(VOID) ICUNIT_GOTO_EQUAL(errno, EBADF, errno, EXIT2); ret = mq_close(queue); - ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT1); + ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT2); ret = mq_unlink(qname); - ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT); + ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT1); return MQUEUE_NO_ERROR; EXIT2: @@ -60,10 +58,10 @@ EXIT2: EXIT1: mq_unlink(qname); EXIT: - return MQUEUE_IS_ERROR; + return MQUEUE_NO_ERROR; } -VOID ItPosixQueue046(VOID) +VOID ItPosixQueue046(VOID) // IT_Layer_ModuleORFeature_No { TEST_ADD_CASE("IT_POSIX_QUEUE_046", Testcase, TEST_POSIX, TEST_QUE, TEST_LEVEL2, TEST_FUNCTION); } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_047.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_047.cpp similarity index 83% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_047.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_047.cpp index 02909fac..97b1a704 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_047.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_047.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2023 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -32,18 +32,16 @@ static UINT32 Testcase(VOID) { - INT32 ret; + INT32 ret = 0; CHAR mqname[MQUEUE_STANDARD_NAME_LENGTH] = ""; - CHAR msgrcd[MQUEUE_STANDARD_NAME_LENGTH * 2]; // 2: mqueue message length + CHAR msgrcd[MQUEUE_STANDARD_NAME_LENGTH * 2]; const CHAR *msgptr = MQUEUE_SEND_STRING_TEST; mqd_t mqueue; - ret = snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, - "/mq047_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT2); + snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq047_%d", LosCurTaskIDGet()); mqueue = mq_open(mqname, O_CREAT | O_RDONLY | O_NONBLOCK, S_IRUSR | S_IWUSR, NULL); - ICUNIT_GOTO_NOT_EQUAL(mqueue, (mqd_t)-1, mqueue, EXIT2); + ICUNIT_GOTO_NOT_EQUAL(mqueue, (mqd_t)-1, mqueue, EXIT1); ret = mq_send(mqueue, msgptr, strlen(msgptr), 0); ICUNIT_GOTO_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT1); @@ -58,21 +56,20 @@ static UINT32 Testcase(VOID) ICUNIT_GOTO_EQUAL(errno, EAGAIN, errno, EXIT1); ret = mq_close(mqueue); - ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT); + ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT1); ret = mq_unlink(mqname); - ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT2); + ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT); return MQUEUE_NO_ERROR; EXIT1: mq_close(mqueue); EXIT: mq_unlink(mqname); -EXIT2: - return MQUEUE_IS_ERROR; + return MQUEUE_NO_ERROR; } -VOID ItPosixQueue047(VOID) +VOID ItPosixQueue047(VOID) // IT_Layer_ModuleORFeature_No { TEST_ADD_CASE("IT_POSIX_QUEUE_047", Testcase, TEST_POSIX, TEST_QUE, TEST_LEVEL2, TEST_FUNCTION); } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_048.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_048.cpp similarity index 84% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_048.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_048.cpp index fdc6e5aa..254437ee 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_048.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_048.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2023 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -32,22 +32,20 @@ static UINT32 Testcase(VOID) { - INT32 ret; + INT32 ret = 0; CHAR mqname[MQUEUE_STANDARD_NAME_LENGTH] = {0}; CHAR msgrv[MQUEUE_STANDARD_NAME_LENGTH] = {0}; const CHAR *msgptr = "test message"; mqd_t mqueue; struct timespec ts; - struct mq_attr attr = {0}; + struct mq_attr attr = { 0 }; - ret = snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq048_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT2); + snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq048_%d", LosCurTaskIDGet()); attr.mq_msgsize = MQUEUE_STANDARD_NAME_LENGTH; attr.mq_maxmsg = MQUEUE_STANDARD_NAME_LENGTH; mqueue = mq_open(mqname, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, &attr); - ICUNIT_GOTO_NOT_EQUAL(mqueue, (mqd_t)-1, mqueue, EXIT2); + ICUNIT_GOTO_NOT_EQUAL(mqueue, (mqd_t)-1, mqueue, EXIT1); ret = mq_send(mqueue, msgptr, strlen(msgptr), 0); ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT1); @@ -59,21 +57,20 @@ static UINT32 Testcase(VOID) ICUNIT_GOTO_EQUAL(errno, EINVAL, errno, EXIT1); ret = mq_close(mqueue); - ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT); + ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT1); ret = mq_unlink(mqname); - ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT2); + ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT); return MQUEUE_NO_ERROR; EXIT1: mq_close(mqueue); EXIT: mq_unlink(mqname); -EXIT2: - return MQUEUE_IS_ERROR; + return MQUEUE_NO_ERROR; } -VOID ItPosixQueue048(VOID) +VOID ItPosixQueue048(VOID) // IT_Layer_ModuleORFeature_No { TEST_ADD_CASE("IT_POSIX_QUEUE_048", Testcase, TEST_POSIX, TEST_QUE, TEST_LEVEL2, TEST_FUNCTION); } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_049.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_049.cpp similarity index 92% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_049.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_049.cpp index 4f113bf4..061bd055 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_049.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_049.cpp @@ -38,9 +38,7 @@ static UINT32 Testcase(VOID) const CHAR *msgptr = MQUEUE_SEND_STRING_TEST; mqd_t mqueue; - ret = snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq049_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT2); + snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq049_%d", LosCurTaskIDGet()); mqueue = mq_open(mqname, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, NULL); ICUNIT_GOTO_NOT_EQUAL(mqueue, (mqd_t)-1, mqueue, EXIT1); @@ -62,7 +60,6 @@ EXIT1: mq_close(mqueue); EXIT: mq_unlink(mqname); -EXIT2: return MQUEUE_NO_ERROR; } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_050.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_050.cpp similarity index 92% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_050.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_050.cpp index 3563fa53..09c75e2d 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_050.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_050.cpp @@ -40,10 +40,8 @@ static UINT32 Testcase(VOID) struct mq_attr attr = { 0 }; - ret = snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, - "/mq050_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT2); - + snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq050_%d", LosCurTaskIDGet()); + for (i = 0; i < MQUEUE_PRIORITY_NUM_TEST; i++) { attr.mq_msgsize = messagesize[i]; attr.mq_maxmsg = messagesize[i]; @@ -67,7 +65,6 @@ EXIT1: mq_close(mqueue); EXIT: mq_unlink(mqname); -EXIT2: return MQUEUE_NO_ERROR; } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_052.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_052.cpp similarity index 93% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_052.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_052.cpp index cbcc4c40..552963f0 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_052.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_052.cpp @@ -39,9 +39,7 @@ static UINT32 Testcase(VOID) mqd_t mqueue; struct mq_attr attr; - ret = snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, - "/mq052_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT2); + snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq052_%d", LosCurTaskIDGet()); attr.mq_msgsize = MQUEUE_STANDARD_NAME_LENGTH + 1; attr.mq_maxmsg = MQUEUE_STANDARD_NAME_LENGTH + 1; @@ -67,7 +65,6 @@ EXIT1: mq_close(mqueue); EXIT: mq_unlink(mqname); -EXIT2: return MQUEUE_NO_ERROR; } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_054.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_054.cpp similarity index 92% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_054.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_054.cpp index e81bd409..56d26440 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_054.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_054.cpp @@ -38,9 +38,7 @@ static UINT32 Testcase(VOID) mqd_t mqueue; struct mq_attr attr = { 0 }; - ret = snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq054_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT2); + snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq054_%d", LosCurTaskIDGet()); attr.mq_msgsize = MQUEUE_STANDARD_NAME_LENGTH; attr.mq_maxmsg = MQUEUE_STANDARD_NAME_LENGTH; @@ -62,7 +60,6 @@ EXIT1: mq_close(mqueue); EXIT: mq_unlink(mqname); -EXIT2: return MQUEUE_NO_ERROR; } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_055.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_055.cpp similarity index 94% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_055.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_055.cpp index e963e8bb..866fb2cf 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_055.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_055.cpp @@ -41,9 +41,7 @@ static UINT32 Testcase(VOID) mqd_t mqueue; struct mq_attr attr = { 0 }; - ret = snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq055_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT2); + snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq055_%d", LosCurTaskIDGet()); attr.mq_msgsize = MQUEUE_STANDARD_NAME_LENGTH; attr.mq_maxmsg = MQUEUE_STANDARD_NAME_LENGTH; @@ -82,7 +80,6 @@ EXIT1: mq_close(mqueue); EXIT: mq_unlink(mqname); -EXIT2: return MQUEUE_NO_ERROR; } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_056.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_056.cpp similarity index 92% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_056.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_056.cpp index b1f0d423..0d8eaf1d 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_056.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_056.cpp @@ -37,9 +37,7 @@ static UINT32 Testcase(VOID) struct mq_attr attr = { 0 }; INT32 unresolved = 0, failure = 0, ret = 0; - ret = snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq056-1-%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT1); + snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq056-1-%d", LosCurTaskIDGet()); attr.mq_msgsize = MQUEUE_STANDARD_NAME_LENGTH; attr.mq_maxmsg = MQUEUE_STANDARD_NAME_LENGTH; @@ -65,7 +63,6 @@ static UINT32 Testcase(VOID) EXIT: mq_close(mqdes); mq_unlink(mqname); -EXIT1: return MQUEUE_NO_ERROR; } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_057.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_057.cpp similarity index 92% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_057.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_057.cpp index d266c857..6e081c1e 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_057.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_057.cpp @@ -38,9 +38,7 @@ static UINT32 Testcase(VOID) CHAR msgrv[MQUEUE_STANDARD_NAME_LENGTH] = {0}; struct mq_attr attr = { 0 }; - ret = snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq057_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT2); + snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq057_%d", LosCurTaskIDGet()); attr.mq_msgsize = MQUEUE_STANDARD_NAME_LENGTH; attr.mq_maxmsg = MQUEUE_STANDARD_NAME_LENGTH; @@ -63,7 +61,6 @@ EXIT1: mq_close(mqueue); EXIT: mq_unlink(mqname); -EXIT2: return MQUEUE_NO_ERROR; } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_058.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_058.cpp similarity index 92% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_058.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_058.cpp index 2af7b114..cd0bb9ae 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_058.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_058.cpp @@ -38,9 +38,7 @@ static UINT32 Testcase(VOID) struct mq_attr attr = { 0 }; INT32 unresolved = 0, failure = 0, ret = 0; - ret = snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq058-2-%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT1); + snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq058-2-%d", LosCurTaskIDGet()); attr.mq_msgsize = MQUEUE_STANDARD_NAME_LENGTH; attr.mq_maxmsg = MQUEUE_STANDARD_NAME_LENGTH; @@ -61,7 +59,6 @@ static UINT32 Testcase(VOID) EXIT: mq_close(mqdes); mq_unlink(mqname); -EXIT1: return MQUEUE_NO_ERROR; } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_060.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_060.cpp similarity index 91% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_060.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_060.cpp index 02ed05a6..d74b1702 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_060.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_060.cpp @@ -35,10 +35,8 @@ static UINT32 Testcase(VOID) INT32 ret; CHAR mqname[MQUEUE_STANDARD_NAME_LENGTH] = ""; - ret = snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq060_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT); - + snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq060_%d", LosCurTaskIDGet()); + ret = mq_unlink(mqname); ICUNIT_GOTO_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT1); ICUNIT_GOTO_EQUAL(errno, ENOENT, errno, EXIT); diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_061.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_061.cpp similarity index 88% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_061.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_061.cpp index e41a4150..1fe6064d 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_061.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_061.cpp @@ -38,15 +38,12 @@ static UINT32 Testcase(VOID) INT32 unresolved = 0; INT32 failure = 0, ret = 0; - ret = snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq061-1_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT1); - + snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq061-1_%d", LosCurTaskIDGet()); + mqdes = mq_open(mqname, O_CREAT | O_RDWR | O_NONBLOCK, S_IRUSR | S_IWUSR, NULL); ICUNIT_GOTO_NOT_EQUAL(mqdes, (mqd_t)-1, mqdes, EXIT); - ret = memset_s(&mqstat, sizeof(mqstat), 0, sizeof(mqstat)); - ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT); + memset(&mqstat, 0, sizeof(mqstat)); ret = mq_getattr(mqdes, &mqstat); ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT); @@ -66,7 +63,6 @@ static UINT32 Testcase(VOID) EXIT: mq_close(mqdes); mq_unlink(mqname); -EXIT1: return MQUEUE_NO_ERROR; } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_063.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_063.cpp similarity index 86% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_063.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_063.cpp index c734057b..57f77d7b 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_063.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_063.cpp @@ -38,19 +38,15 @@ static UINT32 Testcase(VOID) INT32 unresolved = 0; INT32 failure = 0, ret = 0; - ret = snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq063-1_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT1); + snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq063-1_%d", LosCurTaskIDGet()); - ret = memset_s(&mqstat, sizeof(mqstat), 0, sizeof(mqstat)); - ICUNIT_ASSERT_EQUAL(ret, 0, ret); + memset(&mqstat, 0, sizeof(mqstat)); mqstat.mq_msgsize = MQUEUE_STANDARD_NAME_LENGTH; mqstat.mq_maxmsg = 40; // 40, queue max message size. mqdes = mq_open(mqname, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, &mqstat); ICUNIT_GOTO_NOT_EQUAL(mqdes, (mqd_t)-1, mqdes, EXIT); - ret = memset_s(&nmqstat, sizeof(nmqstat), 0, sizeof(nmqstat)); - ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT); + memset(&nmqstat, 0, sizeof(nmqstat)); ret = mq_getattr(mqdes, &nmqstat); ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT); @@ -70,7 +66,6 @@ static UINT32 Testcase(VOID) EXIT: mq_close(mqdes); mq_unlink(mqname); -EXIT1: return MQUEUE_NO_ERROR; } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_064.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_064.cpp similarity index 87% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_064.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_064.cpp index b602f424..d0f6ca48 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_064.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_064.cpp @@ -38,12 +38,9 @@ static UINT32 Testcase(VOID) mqd_t mqueue; struct mq_attr mqstat; - ret = snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq064_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT2); + snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq064_%d", LosCurTaskIDGet()); - ret = memset_s(&mqstat, sizeof(mqstat), 0, sizeof(mqstat)); - ICUNIT_ASSERT_EQUAL(ret, 0, ret); + memset(&mqstat, 0, sizeof(mqstat)); mqstat.mq_msgsize = MQUEUE_STANDARD_NAME_LENGTH; mqstat.mq_maxmsg = MQUEUE_STANDARD_NAME_LENGTH; mqueue = mq_open(mqname, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, &mqstat); @@ -53,8 +50,7 @@ static UINT32 Testcase(VOID) ret = mq_send(mqueue, msgptr, strlen(msgptr), 0); ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT1); } - ret = memset_s(&mqstat, sizeof(mqstat), 0, sizeof(mqstat)); - ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT1); + memset(&mqstat, 0, sizeof(mqstat)); ret = mq_getattr(mqueue, &mqstat); ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT1); ICUNIT_GOTO_EQUAL(mqstat.mq_curmsgs, 5, mqstat.mq_curmsgs, EXIT1); // 5, assert the curmsgs. @@ -70,7 +66,6 @@ EXIT1: mq_close(mqueue); EXIT: mq_unlink(mqname); -EXIT2: return MQUEUE_NO_ERROR; } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_065.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_065.cpp similarity index 89% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_065.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_065.cpp index 041a008a..4760d6cb 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_065.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_065.cpp @@ -37,16 +37,13 @@ static UINT32 Testcase(VOID) mqd_t mqueue, mqdesInvalid; struct mq_attr mqstat; - ret = snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq065_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT2); + snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq065_%d", LosCurTaskIDGet()); mqueue = mq_open(mqname, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, 0); ICUNIT_GOTO_NOT_EQUAL(mqueue, (mqd_t)-1, mqueue, EXIT1); mqdesInvalid = (mqd_t)((UINTPTR)mqueue + PER_ADDED_VALUE); - ret = memset_s(&mqstat, sizeof(mqstat), 0, sizeof(mqstat)); - ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT1); + memset(&mqstat, 0, sizeof(mqstat)); ret = mq_getattr(mqdesInvalid, &mqstat); ICUNIT_GOTO_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT1); @@ -63,7 +60,6 @@ EXIT1: mq_close(mqueue); EXIT: mq_unlink(mqname); -EXIT2: return MQUEUE_NO_ERROR; } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_066.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_066.cpp similarity index 86% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_066.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_066.cpp index b3e63e77..03b127e9 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_066.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_066.cpp @@ -39,17 +39,13 @@ static UINT32 Testcase(VOID) INT32 unresolved = 0; INT32 failure = 0, ret = 0; - ret = snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq066-1_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT1); - + snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq066-1_%d", LosCurTaskIDGet()); + mqdes = mq_open(mqname, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, 0); ICUNIT_GOTO_NOT_EQUAL(mqdes, (mqd_t)-1, mqdes, EXIT); - ret = memset_s(&mqstat, sizeof(mqstat), 0, sizeof(mqstat)); - ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT); - ret = memset_s(&nmqstat, sizeof(nmqstat), 0, sizeof(nmqstat)); - ICUNIT_ASSERT_EQUAL(ret, 0, ret); + memset(&mqstat, 0, sizeof(mqstat)); + memset(&nmqstat, 0, sizeof(nmqstat)); ret = mq_getattr(mqdes, &mqstat); ICUNIT_GOTO_NOT_EQUAL(ret, -1, ret, EXIT); @@ -77,7 +73,6 @@ static UINT32 Testcase(VOID) EXIT: mq_close(mqdes); mq_unlink(mqname); -EXIT1: return MQUEUE_NO_ERROR; } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_067.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_067.cpp similarity index 88% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_067.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_067.cpp index 3742e40f..637794b0 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_067.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_067.cpp @@ -38,17 +38,13 @@ static UINT32 Testcase(VOID) struct mq_attr mqstat1 = { 0 }; struct mq_attr mqstat2 = { 0 }; - ret = snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq067_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT2); + snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq067_%d", LosCurTaskIDGet()); mqueue = mq_open(mqname, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, 0); ICUNIT_GOTO_NOT_EQUAL(mqueue, (mqd_t)-1, mqueue, EXIT1); - ret = memset_s(&mqstat1, sizeof(mqstat1), 0, sizeof(mqstat1)); - ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT); - ret = memset_s(&mqstat2, sizeof(mqstat2), 0, sizeof(mqstat1)); - ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT); + memset(&mqstat1, 0, sizeof(mqstat1)); + memset(&mqstat2, 0, sizeof(mqstat1)); ret = mq_getattr(mqueue, &mqstat1); ICUNIT_GOTO_NOT_EQUAL(ret, -1, ret, EXIT1); @@ -77,7 +73,6 @@ EXIT1: mq_close(mqueue); EXIT: mq_unlink(mqname); -EXIT2: return MQUEUE_NO_ERROR; } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_069.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_069.cpp similarity index 86% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_069.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_069.cpp index d10ec589..57b2a789 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_069.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_069.cpp @@ -38,20 +38,16 @@ static UINT32 Testcase(VOID) struct mq_attr mqstat1; struct mq_attr mqstat2; - ret = snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq069_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT3); - + snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq069_%d", LosCurTaskIDGet()); + mqueue1 = mq_open(mqname, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, 0); ICUNIT_GOTO_NOT_EQUAL(mqueue1, (mqd_t)-1, mqueue1, EXIT1); mqueue2 = mqueue1; mqueue1 = (mqd_t)((UINTPTR)mqueue1 + PER_ADDED_VALUE); - ret = memset_s(&mqstat1, sizeof(mqstat1), 0, sizeof(mqstat1)); - ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT); - ret = memset_s(&mqstat2, sizeof(mqstat2), 0, sizeof(mqstat2)); - ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT); + memset(&mqstat1, 0, sizeof(mqstat1)); + memset(&mqstat2, 0, sizeof(mqstat2)); mqstat2.mq_flags = 1; ret = mq_setattr(mqueue1, &mqstat1, NULL); @@ -77,7 +73,6 @@ EXIT1: mq_close(mqueue1); EXIT: mq_unlink(mqname); -EXIT3: return MQUEUE_NO_ERROR; } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_070.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_070.cpp similarity index 94% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_070.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_070.cpp index b1421a7e..6b80f610 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_070.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_070.cpp @@ -44,10 +44,8 @@ static UINT32 Testcase(VOID) attr.mq_msgsize = MQUEUE_STANDARD_NAME_LENGTH; attr.mq_maxmsg = MQUEUE_STANDARD_NAME_LENGTH; - ret = snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq070_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT2); - + snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq070_%d", LosCurTaskIDGet()); + mqueue = mq_open(mqname, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, &attr); ICUNIT_GOTO_NOT_EQUAL(mqueue, (mqd_t)-1, mqueue, EXIT1); @@ -87,7 +85,6 @@ EXIT1: mq_close(mqueue); EXIT: mq_unlink(mqname); -EXIT2: return MQUEUE_NO_ERROR; } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_071.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_071.cpp similarity index 93% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_071.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_071.cpp index 5a195c7a..e2d4c17c 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_071.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_071.cpp @@ -42,9 +42,7 @@ static UINT32 Testcase(VOID) attr.mq_msgsize = MQUEUE_STANDARD_NAME_LENGTH; attr.mq_maxmsg = MQUEUE_STANDARD_NAME_LENGTH; - ret = snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq071_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT2); + snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq071_%d", LosCurTaskIDGet()); mqueue = mq_open(mqname, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, &attr); ICUNIT_GOTO_NOT_EQUAL(mqueue, (mqd_t)-1, mqueue, EXIT1); @@ -67,7 +65,6 @@ EXIT1: mq_close(mqueue); EXIT: mq_unlink(mqname); -EXIT2: return MQUEUE_NO_ERROR; } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_072.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_072.cpp similarity index 93% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_072.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_072.cpp index 161ad55e..209f95c1 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_072.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_072.cpp @@ -43,9 +43,7 @@ static UINT32 Testcase(VOID) msgAttr.mq_msgsize = MQUEUE_STANDARD_NAME_LENGTH; msgAttr.mq_maxmsg = MQUEUE_STANDARD_NAME_LENGTH; - ret = snprintf_s(qName, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq072_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT); + snprintf(qName, MQUEUE_STANDARD_NAME_LENGTH, "/mq072_%d", LosCurTaskIDGet()); msgQId = mq_open(qName, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, &msgAttr); ICUNIT_GOTO_NOT_EQUAL(msgQId, (mqd_t)-1, msgQId, EXIT); diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_073.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_073.cpp similarity index 88% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_073.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_073.cpp index 0c90161b..84da59ce 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_073.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_073.cpp @@ -43,13 +43,9 @@ static UINT32 Testcase(VOID) attr.mq_msgsize = MQUEUE_STANDARD_NAME_LENGTH; attr.mq_maxmsg = MQUEUE_STANDARD_NAME_LENGTH; - ret = snprintf_s(mqname1, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq073_1_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT2); - ret = snprintf_s(mqname2, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq073_2_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT2); - + snprintf(mqname1, MQUEUE_STANDARD_NAME_LENGTH, "/mq073_1_%d", LosCurTaskIDGet()); + snprintf(mqname2, MQUEUE_STANDARD_NAME_LENGTH, "/mq073_2_%d", LosCurTaskIDGet()); + mqueue1 = mq_open(mqname1, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, &attr); ICUNIT_GOTO_NOT_EQUAL(mqueue1, (mqd_t)-1, mqueue1, EXIT); @@ -81,7 +77,6 @@ EXIT1: EXIT: mq_close(mqueue1); mq_unlink(mqname1); -EXIT2: return MQUEUE_NO_ERROR; } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_074.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_074.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_074.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_074.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_075.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_075.cpp similarity index 95% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_075.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_075.cpp index 94985091..2fea2090 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_075.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_075.cpp @@ -65,9 +65,8 @@ static UINT32 Testcase(VOID) g_testFlag = 1; // 1 initialize the flag LOS_TaskLock(); - ret = snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq075_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT2); + snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq075_%d", LosCurTaskIDGet()); + g_gqueue = mq_open(mqname, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, &attr); ICUNIT_GOTO_NOT_EQUAL(g_gqueue, (mqd_t)-1, g_gqueue, EXIT1); ret = pthread_attr_init(&attr1); @@ -111,7 +110,6 @@ EXIT1: mq_unlink(mqname); EXIT: PosixPthreadDestroy(&attr1, pthread1); -EXIT2: return MQUEUE_NO_ERROR; } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_076.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_076.cpp similarity index 95% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_076.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_076.cpp index aab026ac..f34f5c23 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_076.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_076.cpp @@ -63,9 +63,7 @@ static VOID *PthreadF02(VOID *arg) attr.mq_msgsize = MQUEUE_STANDARD_NAME_LENGTH; attr.mq_maxmsg = 2; // 2, queue max message size. - ret = snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq076_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT2); + snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq076_%d", LosCurTaskIDGet()); g_gqueue = mq_open(mqname, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, &attr); ICUNIT_GOTO_NOT_EQUAL(g_gqueue, (mqd_t)-1, g_gqueue, EXIT1); @@ -105,7 +103,6 @@ EXIT1: EXIT: PosixPthreadDestroy(&attr1, thread1); g_testCount = 0; -EXIT2: return NULL; } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_077.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_077.cpp similarity index 94% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_077.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_077.cpp index 8721c8c7..d3f4be8e 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_077.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_077.cpp @@ -64,9 +64,8 @@ static UINT32 Testcase(VOID) g_testCount = 0; - ret = snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq077_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT2); + snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq077_%d", LosCurTaskIDGet()); + g_gqueue = mq_open(mqname, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, &attr); ICUNIT_GOTO_NOT_EQUAL(g_gqueue, (mqd_t)-1, g_gqueue, EXIT1); @@ -105,7 +104,6 @@ EXIT1: EXIT: mq_close(g_gqueue); mq_unlink(mqname); -EXIT2: return MQUEUE_NO_ERROR; } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_078.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_078.cpp similarity index 95% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_078.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_078.cpp index 1c9860d4..8ee1ff07 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_078.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_078.cpp @@ -65,9 +65,7 @@ static UINT32 Testcase(VOID) g_testCount = 0; - ret = snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq078_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT2); + snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq078_%d", LosCurTaskIDGet()); g_gqueue = mq_open(mqname, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, &attr); ICUNIT_ASSERT_NOT_EQUAL(g_gqueue, (mqd_t)-1, g_gqueue); @@ -109,7 +107,6 @@ EXIT1: EXIT: mq_close(g_gqueue); mq_unlink(mqname); -EXIT2: return MQUEUE_NO_ERROR; } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_079.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_079.cpp similarity index 94% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_079.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_079.cpp index b657845e..0599283b 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_079.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_079.cpp @@ -91,10 +91,8 @@ static UINT32 Testcase(VOID) pthread_attr_t attr1; struct sched_param schedparam; - ret = memset_s(g_gqname, MQUEUE_STANDARD_NAME_LENGTH, 0, MQUEUE_STANDARD_NAME_LENGTH); - ICUNIT_ASSERT_EQUAL(ret, 0, ret); - (void)snprintf_s(g_gqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq079_%d", LosCurTaskIDGet()); + memset(g_gqname, 0, MQUEUE_STANDARD_NAME_LENGTH); + snprintf(g_gqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq079_%d", LosCurTaskIDGet()); g_testCount = 0; diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_080.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_080.cpp similarity index 88% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_080.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_080.cpp index c68b06e3..74e72515 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_080.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_080.cpp @@ -40,10 +40,8 @@ static UINT32 Testcase(VOID) INT32 unresolved = 0, failure = 0, i, maxreached = 0, ret = 0; unsigned pri; - ret = snprintf_s(qname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq080-1_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT2); - + snprintf(qname, MQUEUE_STANDARD_NAME_LENGTH, "/mq080-1_%d", LosCurTaskIDGet()); + attr.mq_msgsize = MQUEUE_STANDARD_NAME_LENGTH; attr.mq_maxmsg = MAXMSG5; queue = mq_open(qname, O_CREAT | O_RDWR | O_NONBLOCK, S_IRUSR | S_IWUSR, &attr); @@ -52,8 +50,7 @@ static UINT32 Testcase(VOID) ts.tv_sec = 0; ts.tv_nsec = 0; for (i = 0; i < MAXMSG5 + 1; i++) { - ret = snprintf_s(msgptr, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, "message %d", i); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT); + snprintf(msgptr, MQUEUE_STANDARD_NAME_LENGTH, "message %d", i); ts.tv_sec++; if (mq_timedsend(queue, msgptr, strlen(msgptr), 0, &ts) == -1) { maxreached = 1; @@ -80,7 +77,6 @@ static UINT32 Testcase(VOID) EXIT: mq_close(queue); mq_unlink(qname); -EXIT2: return MQUEUE_NO_ERROR; } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_081.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_081.cpp similarity index 93% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_081.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_081.cpp index 9af005ad..3ac51ae4 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_081.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_081.cpp @@ -40,9 +40,7 @@ static UINT32 Testcase(VOID) INT32 unresolved = 0, ret; unsigned pri; - ret = snprintf_s(qname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq081-1_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT1); + snprintf(qname, MQUEUE_STANDARD_NAME_LENGTH, "/mq081-1_%d", LosCurTaskIDGet()); attr.mq_msgsize = MQUEUE_STANDARD_NAME_LENGTH; attr.mq_maxmsg = MAXMSG5; @@ -70,7 +68,6 @@ static UINT32 Testcase(VOID) EXIT: mq_close(queue); mq_unlink(qname); -EXIT1: return MQUEUE_NO_ERROR; } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_082.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_082.cpp similarity index 93% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_082.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_082.cpp index d39bd4b9..ee23a2bc 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_082.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_082.cpp @@ -40,9 +40,7 @@ static UINT32 Testcase(VOID) mqd_t mqueue; struct mq_attr attr = { 0 }; - ret = snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq082_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT2); + snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq082_%d", LosCurTaskIDGet()); attr.mq_msgsize = MQUEUE_STANDARD_NAME_LENGTH; attr.mq_maxmsg = MQUEUE_STANDARD_NAME_LENGTH; @@ -69,7 +67,6 @@ EXIT1: mq_close(mqueue); EXIT: mq_unlink(mqname); -EXIT2: return MQUEUE_NO_ERROR; } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_083.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_083.cpp similarity index 84% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_083.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_083.cpp index bdb9305e..55b26c13 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_083.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_083.cpp @@ -39,9 +39,8 @@ static UINT32 Testcase(VOID) mqd_t queue; INT32 unresolved = 0, failure = 0, i, maxreached = 0, ret = 0; - ret = snprintf_s(qname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq083-1_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT1); + snprintf(qname, MQUEUE_STANDARD_NAME_LENGTH, "/mq083-1_%d", LosCurTaskIDGet()); + attr.mq_msgsize = 100; // 100, queue message size. attr.mq_maxmsg = MAXMSG5; queue = mq_open(qname, O_CREAT | O_RDWR | O_NONBLOCK, S_IRUSR | S_IWUSR, &attr); @@ -50,14 +49,12 @@ static UINT32 Testcase(VOID) ts.tv_sec = 1; ts.tv_nsec = 0; for (i = 0; i < MAXMSG5; i++) { - ret = snprintf_s(msgptr, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, "message %d", i); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT); + snprintf(msgptr, MQUEUE_STANDARD_NAME_LENGTH, "message %d", i); ret = mq_timedsend(queue, msgptr, strlen(msgptr), 0, &ts); ICUNIT_GOTO_NOT_EQUAL(ret, -1, ret, EXIT); } - ret = snprintf_s(msgptr, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, "message %d", i); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT1); + snprintf(msgptr, MQUEUE_STANDARD_NAME_LENGTH, "message %d", i); ret = mq_timedsend(queue, msgptr, strlen(msgptr), 0, &ts); ICUNIT_GOTO_EQUAL(ret, -1, ret, EXIT); ICUNIT_GOTO_EQUAL(errno, EAGAIN, errno, EXIT); @@ -72,7 +69,6 @@ static UINT32 Testcase(VOID) EXIT: mq_close(queue); mq_unlink(qname); -EXIT1: return MQUEUE_NO_ERROR; } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_084.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_084.cpp similarity index 92% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_084.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_084.cpp index 07410d79..02b6fc18 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_084.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_084.cpp @@ -38,9 +38,8 @@ static UINT32 Testcase(VOID) mqd_t queue; INT32 unresolved = 0, failure = 0, ret = 0; - ret = snprintf_s(qname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq084-1_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT1); + snprintf(qname, MQUEUE_STANDARD_NAME_LENGTH, "/mq084-1_%d", LosCurTaskIDGet()); + queue = mq_open(qname, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, NULL); ICUNIT_GOTO_NOT_EQUAL(queue, (mqd_t)-1, queue, EXIT); @@ -60,7 +59,6 @@ static UINT32 Testcase(VOID) EXIT: mq_close(queue); mq_unlink(qname); -EXIT1: return MQUEUE_NO_ERROR; } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_085.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_085.cpp similarity index 92% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_085.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_085.cpp index 9017ad4c..750ee14b 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_085.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_085.cpp @@ -38,9 +38,8 @@ static UINT32 Testcase(VOID) struct timespec ts; mqd_t mqueue; - ret = snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq085_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT2); + snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq085_%d", LosCurTaskIDGet()); + mqueue = mq_open(mqname, O_CREAT | O_RDONLY, S_IRUSR | S_IWUSR, NULL); ICUNIT_GOTO_NOT_EQUAL(mqueue, (mqd_t)-1, mqueue, EXIT1); @@ -61,7 +60,6 @@ EXIT1: mq_close(mqueue); EXIT: mq_unlink(mqname); -EXIT2: return MQUEUE_NO_ERROR; } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_086.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_086.cpp similarity index 92% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_086.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_086.cpp index 61c5cc1d..6771dbaf 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_086.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_086.cpp @@ -38,9 +38,7 @@ static UINT32 Testcase(VOID) struct timespec ts; mqd_t mqueue; - ret = snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "mq086_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT2); + snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "mq086_%d", LosCurTaskIDGet()); mqueue = mq_open(mqname, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, NULL); ICUNIT_GOTO_NOT_EQUAL(mqueue, (mqd_t)-1, mqueue, EXIT1); @@ -61,7 +59,6 @@ EXIT1: mq_close(mqueue); EXIT: mq_unlink(mqname); -EXIT2: return MQUEUE_NO_ERROR; } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_087.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_087.cpp similarity index 93% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_087.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_087.cpp index 09b44a7f..92ab2b4c 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_087.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_087.cpp @@ -39,9 +39,8 @@ static UINT32 Testcase(VOID) struct timespec ts; mqd_t mqueue; - ret = snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq087_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT2); + snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq087_%d", LosCurTaskIDGet()); + mqueue = mq_open(mqname, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, NULL); ICUNIT_GOTO_NOT_EQUAL(mqueue, (mqd_t)-1, mqueue, EXIT1); @@ -64,7 +63,6 @@ EXIT1: mq_close(mqueue); EXIT: mq_unlink(mqname); -EXIT2: return MQUEUE_NO_ERROR; } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_088.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_088.cpp similarity index 93% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_088.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_088.cpp index 4f83427b..b6c4caf8 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_088.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_088.cpp @@ -40,9 +40,8 @@ static UINT32 Testcase(VOID) mqd_t mqueue; struct mq_attr attr = { 0 }; - ret = snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq088_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT2); + snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq088_%d", LosCurTaskIDGet()); + ts.tv_sec = 0; ts.tv_nsec = 0; for (i = 0; i < MQUEUE_PRIORITY_NUM_TEST; i++) { @@ -69,7 +68,6 @@ EXIT1: mq_close(mqueue); EXIT: mq_unlink(mqname); -EXIT2: return MQUEUE_NO_ERROR; } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_089.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_089.cpp similarity index 92% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_089.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_089.cpp index e2ddaa92..5da1abcf 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_089.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_089.cpp @@ -38,9 +38,8 @@ static UINT32 Testcase(VOID) struct timespec ts; mqd_t mqueue; - ret = snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/tm/mq089_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT2); + snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/tm/mq089_%d", LosCurTaskIDGet()); + mqueue = mq_open(mqname, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, NULL); ICUNIT_GOTO_NOT_EQUAL(mqueue, (mqd_t)-1, mqueue, EXIT1); @@ -60,7 +59,6 @@ EXIT1: mq_close(mqueue); EXIT: mq_unlink(mqname); -EXIT2: return MQUEUE_NO_ERROR; } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_090.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_090.cpp similarity index 86% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_090.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_090.cpp index 6cdb9b2e..028c9a31 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_090.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_090.cpp @@ -37,8 +37,7 @@ static UINT32 Testcase(VOID) INT32 i, unresolved = 0, failure = 0, numqueues = 0, ret; for (i = 0; (i < _POSIX_OPEN_MAX) && (i < _POSIX_MQ_OPEN_MAX); i++, numqueues++) { - (void)snprintf_s(qname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq090%d_%d", i, LosCurTaskIDGet()); + snprintf(qname, MQUEUE_STANDARD_NAME_LENGTH, "/mq090%d_%d", i, LosCurTaskIDGet()); queue[i] = mq_open(qname, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, NULL); if (queue[i] == (mqd_t)-1) { @@ -60,14 +59,12 @@ static UINT32 Testcase(VOID) ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT); } for (i = 0; i < numqueues; i++) { - (void)snprintf_s(qname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq090%d_%d", i, LosCurTaskIDGet()); + snprintf(qname, MQUEUE_STANDARD_NAME_LENGTH, "/mq090%d_%d", i, LosCurTaskIDGet()); ret = mq_unlink(qname); ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT); } - (void)snprintf_s(qname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq090%d_%d", numqueues, LosCurTaskIDGet()); + snprintf(qname, MQUEUE_STANDARD_NAME_LENGTH, "/mq090%d_%d", numqueues, LosCurTaskIDGet()); ret = mq_unlink(qname); ICUNIT_GOTO_EQUAL(ret, -1, ret, EXIT); diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_091.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_091.cpp similarity index 92% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_091.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_091.cpp index a1303c79..614e9c9d 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_091.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_091.cpp @@ -38,9 +38,8 @@ static UINT32 Testcase(VOID) struct timespec ts; mqd_t mqueue; - ret = snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq091_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT2); + snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq091_%d", LosCurTaskIDGet()); + mqueue = mq_open(mqname, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, NULL); ICUNIT_GOTO_NOT_EQUAL(mqueue, (mqd_t)-1, mqueue, EXIT1); @@ -61,7 +60,6 @@ EXIT1: mq_close(mqueue); EXIT: mq_unlink(mqname); -EXIT2: return MQUEUE_NO_ERROR; } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_093.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_093.cpp similarity index 93% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_093.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_093.cpp index a94324c8..4e8596f4 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_093.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_093.cpp @@ -40,9 +40,8 @@ static UINT32 Testcase(VOID) struct sigaction act; time_t currsec; - ret = snprintf_s(g_gqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq093_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT2); + snprintf(g_gqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq093_%d", LosCurTaskIDGet()); + attr.mq_maxmsg = MQUEUE_SHORT_ARRAY_LENGTH; attr.mq_msgsize = MQUEUE_STANDARD_NAME_LENGTH; @@ -72,7 +71,6 @@ EXIT1: mq_close(g_gqueue); EXIT: mq_unlink(g_gqname); -EXIT2: return MQUEUE_NO_ERROR; } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_094.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_094.cpp similarity index 92% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_094.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_094.cpp index 817cebf4..b9a9a0bf 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_094.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_094.cpp @@ -38,10 +38,8 @@ static UINT32 Testcase(VOID) struct timespec ts; mqd_t mqueue; - ret = snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq094_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT2); - + snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq094_%d", LosCurTaskIDGet()); + mqueue = mq_open(mqname, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, NULL); ICUNIT_GOTO_NOT_EQUAL(mqueue, (mqd_t)-1, mqueue, EXIT); @@ -63,7 +61,6 @@ EXIT1: mq_close(mqueue); EXIT: mq_unlink(mqname); -EXIT2: return MQUEUE_NO_ERROR; } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_095.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_095.cpp similarity index 94% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_095.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_095.cpp index 992e376f..61c5d9ff 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_095.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_095.cpp @@ -42,9 +42,7 @@ static UINT32 Testcase(VOID) struct timespec ts; struct mq_attr attr = { 0 }; - ret = snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq095_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT2); + snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq095_%d", LosCurTaskIDGet()); attr.mq_maxmsg = MQUEUE_STANDARD_NAME_LENGTH; attr.mq_msgsize = MQUEUE_STANDARD_NAME_LENGTH; @@ -85,7 +83,6 @@ EXIT1: mq_close(mqueue); EXIT: mq_unlink(mqname); -EXIT2: return MQUEUE_NO_ERROR; } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_096.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_096.cpp similarity index 90% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_096.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_096.cpp index 1a75d554..5556a8e1 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_096.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_096.cpp @@ -40,12 +40,9 @@ static UINT32 Testcase(VOID) struct mq_attr attr; struct timespec ts; - ret = snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq096_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT2); + snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq096_%d", LosCurTaskIDGet()); - ret = memset_s(&attr, sizeof(attr), 0, sizeof(attr)); - ICUNIT_ASSERT_EQUAL(ret, 0, ret); + memset(&attr, 0, sizeof(attr)); attr.mq_msgsize = 20 + 1; // 20, queue message size. attr.mq_maxmsg = 20 + 1; // 20, queue max message size. @@ -72,7 +69,6 @@ EXIT1: mq_close(mqueue); EXIT: mq_unlink(mqname); -EXIT2: return MQUEUE_NO_ERROR; } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_097.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_097.cpp similarity index 95% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_097.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_097.cpp index 09e7effd..00fad7b1 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_097.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_097.cpp @@ -92,9 +92,7 @@ static UINT32 Testcase(VOID) pthread_attr_t attr1; pthread_t newTh, newTh2; - ret = snprintf_s(g_gqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq097_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT3); + snprintf(g_gqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq097_%d", LosCurTaskIDGet()); attr.mq_msgsize = MQUEUE_STANDARD_NAME_LENGTH; attr.mq_maxmsg = MQUEUE_STANDARD_NAME_LENGTH; @@ -135,7 +133,6 @@ EXIT1: EXIT: mq_close(g_gqueue); mq_unlink(g_gqname); -EXIT3: return MQUEUE_NO_ERROR; } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_098.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_098.cpp similarity index 91% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_098.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_098.cpp index 3a3fe30d..8071f727 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_098.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_098.cpp @@ -36,9 +36,7 @@ static UINT32 Testcase(VOID) INT32 ret = 0; mqd_t queue; - ret = snprintf_s(qname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq098_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT1); + snprintf(qname, MQUEUE_STANDARD_NAME_LENGTH, "/mq098_%d", LosCurTaskIDGet()); queue = mq_open(qname, O_CREAT | O_RDWR | O_WRONLY, S_IRUSR | S_IWUSR, NULL); ICUNIT_GOTO_NOT_EQUAL(queue, (mqd_t)-1, queue, EXIT); @@ -53,7 +51,6 @@ static UINT32 Testcase(VOID) EXIT: mq_close(queue); mq_unlink(qname); -EXIT1: return MQUEUE_NO_ERROR; } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_100.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_100.cpp similarity index 92% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_100.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_100.cpp index 02637c82..954d2787 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_100.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_100.cpp @@ -39,9 +39,7 @@ static UINT32 Testcase(VOID) struct timespec ts; struct mq_attr attr = { 0 }; - ret = snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq100_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT2); + snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq100_%d", LosCurTaskIDGet()); attr.mq_msgsize = MQUEUE_STANDARD_NAME_LENGTH; attr.mq_maxmsg = MQUEUE_STANDARD_NAME_LENGTH; @@ -66,7 +64,6 @@ EXIT1: mq_close(mqueue); EXIT: mq_unlink(mqname); -EXIT2: return MQUEUE_NO_ERROR; } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_101.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_101.cpp similarity index 93% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_101.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_101.cpp index ef149c08..aee4950a 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_101.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_101.cpp @@ -42,9 +42,7 @@ static UINT32 Testcase(VOID) attr.mq_msgsize = MQUEUE_STANDARD_NAME_LENGTH; attr.mq_maxmsg = MQUEUE_STANDARD_NAME_LENGTH; - ret = snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq101_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT2); + snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq101_%d", LosCurTaskIDGet()); mqueue = mq_open(mqname, O_CREAT | O_RDWR | O_NONBLOCK, S_IRUSR | S_IWUSR, &attr); ICUNIT_GOTO_NOT_EQUAL(mqueue, (mqd_t)-1, mqueue, EXIT1); @@ -75,7 +73,6 @@ EXIT1: mq_close(mqueue); EXIT: mq_unlink(mqname); -EXIT2: return MQUEUE_NO_ERROR; } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_102.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_102.cpp similarity index 93% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_102.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_102.cpp index 6fe9769e..b5e93be3 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_102.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_102.cpp @@ -40,9 +40,7 @@ static UINT32 Testcase(VOID) struct timespec ts; struct mq_attr attr = { 0 }; - ret = snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq102_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT2); + snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq102_%d", LosCurTaskIDGet()); attr.mq_msgsize = MQUEUE_STANDARD_NAME_LENGTH; attr.mq_maxmsg = MQUEUE_STANDARD_NAME_LENGTH; @@ -70,7 +68,6 @@ EXIT1: mq_close(mqueue); EXIT: mq_unlink(mqname); -EXIT2: return MQUEUE_NO_ERROR; } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_103.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_103.cpp similarity index 93% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_103.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_103.cpp index 20891887..e235b46b 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_103.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_103.cpp @@ -40,9 +40,7 @@ static UINT32 Testcase(VOID) struct timespec ts; struct mq_attr attr = { 0 }; - ret = snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq103_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT2); + snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq103_%d", LosCurTaskIDGet()); attr.mq_msgsize = MQUEUE_STANDARD_NAME_LENGTH; attr.mq_maxmsg = MQUEUE_STANDARD_NAME_LENGTH; @@ -70,7 +68,6 @@ EXIT1: mq_close(mqueue); EXIT: mq_unlink(mqname); -EXIT2: return MQUEUE_NO_ERROR; } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_104.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_104.cpp similarity index 94% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_104.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_104.cpp index 109b9257..14c49acf 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_104.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_104.cpp @@ -42,9 +42,7 @@ static UINT32 Testcase(VOID) struct timespec ts; struct mq_attr attr = { 0 }; - ret = snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq104_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT2); + snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq104_%d", LosCurTaskIDGet()); attr.mq_msgsize = MQUEUE_STANDARD_NAME_LENGTH; attr.mq_maxmsg = MQUEUE_STANDARD_NAME_LENGTH; @@ -85,7 +83,6 @@ EXIT1: mq_close(mqueue); EXIT: mq_unlink(mqname); -EXIT2: return MQUEUE_NO_ERROR; } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_106.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_106.cpp similarity index 93% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_106.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_106.cpp index fa6b9de8..0470c8b8 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_106.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_106.cpp @@ -39,9 +39,7 @@ static UINT32 Testcase(VOID) struct timespec ts; struct mq_attr attr = { 0 }; - ret = snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq106_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT2); + snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq106_%d", LosCurTaskIDGet()); attr.mq_msgsize = MQUEUE_STANDARD_NAME_LENGTH; attr.mq_maxmsg = MQUEUE_STANDARD_NAME_LENGTH; @@ -66,7 +64,6 @@ EXIT1: mq_close(mqueue); EXIT: mq_unlink(mqname); -EXIT2: return MQUEUE_NO_ERROR; } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_108.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_108.cpp similarity index 92% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_108.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_108.cpp index 5c0afa2c..898c252c 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_108.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_108.cpp @@ -38,9 +38,7 @@ static UINT32 Testcase(VOID) struct mq_attr attr = { 0 }; INT32 unresolved = 0, failure = 0, ret = 0; - ret = snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq108-1_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT1); + snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq108-1_%d", LosCurTaskIDGet()); attr.mq_msgsize = MQUEUE_STANDARD_NAME_LENGTH; attr.mq_maxmsg = MQUEUE_STANDARD_NAME_LENGTH; @@ -63,7 +61,6 @@ static UINT32 Testcase(VOID) EXIT: mq_close(mqdes); mq_unlink(mqname); -EXIT1: return MQUEUE_NO_ERROR; } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_109.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_109.cpp similarity index 93% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_109.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_109.cpp index 91c160f0..558d7cc5 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_109.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_109.cpp @@ -39,9 +39,7 @@ static UINT32 Testcase(VOID) struct timespec ts; struct mq_attr attr = { 0 }; - ret = snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq109_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT2); + snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq109_%d", LosCurTaskIDGet()); attr.mq_msgsize = MQUEUE_STANDARD_NAME_LENGTH; attr.mq_maxmsg = MQUEUE_STANDARD_NAME_LENGTH; @@ -65,7 +63,6 @@ EXIT1: mq_close(mqueue); EXIT: mq_unlink(mqname); -EXIT2: return MQUEUE_NO_ERROR; } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_110.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_110.cpp similarity index 93% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_110.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_110.cpp index f107efe9..1cac5c01 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_110.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_110.cpp @@ -39,9 +39,7 @@ static UINT32 Testcase(VOID) struct timespec ts; struct mq_attr attr = { 0 }; - ret = snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq110_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT2); + snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq110_%d", LosCurTaskIDGet()); attr.mq_msgsize = MQUEUE_STANDARD_NAME_LENGTH; attr.mq_maxmsg = MQUEUE_STANDARD_NAME_LENGTH; @@ -65,7 +63,6 @@ EXIT1: mq_close(mqueue); EXIT: mq_unlink(mqname); -EXIT2: return MQUEUE_NO_ERROR; } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_111.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_111.cpp similarity index 95% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_111.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_111.cpp index 2e13de2b..fdd8ff00 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_111.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_111.cpp @@ -59,9 +59,7 @@ static VOID *PthreadF02(VOID *arg) attr.mq_msgsize = MQUEUE_STANDARD_NAME_LENGTH; attr.mq_maxmsg = MQUEUE_STANDARD_NAME_LENGTH; - ret = snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq111_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT3); + snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq111_%d", LosCurTaskIDGet()); g_gqueue = mq_open(mqname, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, &attr); ICUNIT_GOTO_NOT_EQUAL(g_gqueue, (mqd_t)-1, g_gqueue, EXIT2); @@ -97,7 +95,6 @@ EXIT1: mq_unlink(mqname); EXIT: pthread_join(pthread1, NULL); -EXIT3: return NULL; } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_112.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_112.cpp similarity index 95% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_112.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_112.cpp index 0c2af96a..40fcdb8b 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_112.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_112.cpp @@ -61,9 +61,7 @@ static UINT32 Testcase(VOID) g_testCount = 0; - ret = snprintf_s(qName, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq112_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT); + snprintf(qName, MQUEUE_STANDARD_NAME_LENGTH, "/mq112_%d", LosCurTaskIDGet()); g_messageQId = mq_open(qName, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, &msgAttr); ICUNIT_GOTO_NOT_EQUAL(g_messageQId, (mqd_t)-1, g_messageQId, EXIT); diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_113.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_113.cpp similarity index 95% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_113.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_113.cpp index 106d6fba..8a041343 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_113.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_113.cpp @@ -53,6 +53,7 @@ EXIT: static UINT32 Testcase(VOID) { INT32 ret; + UINT32 uret; CHAR mqname[MQUEUE_STANDARD_NAME_LENGTH] = ""; const CHAR *msgptr = MQUEUE_SEND_STRING_TEST; pthread_t pthread1; @@ -65,9 +66,7 @@ static UINT32 Testcase(VOID) g_testCount = 0; - ret = snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq113_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT3); + snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq113_%d", LosCurTaskIDGet()); g_gqueue = mq_open(mqname, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, &attr); ICUNIT_GOTO_NOT_EQUAL(g_gqueue, (mqd_t)-1, g_gqueue, EXIT2); @@ -91,6 +90,7 @@ static UINT32 Testcase(VOID) ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT2); usleep(0); + ICUNIT_GOTO_EQUAL(uret, MQUEUE_NO_ERROR, uret, EXIT2); ret = pthread_join(pthread1, NULL); ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT2); @@ -115,7 +115,6 @@ EXIT1: pthread_join(pthread1, NULL); EXIT: pthread_attr_destroy(&attr1); -EXIT3: return MQUEUE_NO_ERROR; } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_114.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_114.cpp similarity index 95% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_114.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_114.cpp index cf3c050b..01ff7d7a 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_114.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_114.cpp @@ -65,9 +65,7 @@ static UINT32 Testcase(VOID) g_testCount = 0; LOS_TaskLock(); - ret = snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq114_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT3); + snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq114_%d", LosCurTaskIDGet()); g_gqueue = mq_open(mqname, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, &attr); ICUNIT_GOTO_NOT_EQUAL(g_gqueue, (mqd_t)-1, g_gqueue, EXIT2); @@ -116,7 +114,6 @@ EXIT1: pthread_join(pthread1, NULL); EXIT: pthread_attr_destroy(&attr1); -EXIT3: return MQUEUE_NO_ERROR; } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_115.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_115.cpp similarity index 95% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_115.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_115.cpp index eedbc942..8ce095ba 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_115.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_115.cpp @@ -67,9 +67,7 @@ static UINT32 Testcase(VOID) LOS_TaskLock(); - ret = snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq115_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT3); + snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq115_%d", LosCurTaskIDGet()); g_gqueue = mq_open(mqname, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, &attr); ICUNIT_GOTO_NOT_EQUAL(g_gqueue, (mqd_t)-1, g_gqueue, EXIT2); @@ -115,7 +113,6 @@ EXIT1: pthread_join(pthread1, NULL); EXIT: pthread_attr_destroy(&attr1); -EXIT3: return MQUEUE_NO_ERROR; } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_116.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_116.cpp similarity index 94% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_116.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_116.cpp index 9e0fa7e2..d4b3c190 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_116.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_116.cpp @@ -43,9 +43,7 @@ static VOID *PthreadF01(VOID *arg) LOS_AtomicInc(&g_testCount); - ret = snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq116_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT2); + snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq116_%d", LosCurTaskIDGet()); g_gqueue = mq_open(mqname, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, &attr); ICUNIT_GOTO_NOT_EQUAL(g_gqueue, (mqd_t)-1, g_gqueue, EXIT1); @@ -69,7 +67,6 @@ EXIT1: EXIT: mq_unlink(mqname); g_testCount = 0; -EXIT2: return NULL; } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_117.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_117.cpp similarity index 95% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_117.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_117.cpp index c1dbcfdb..d063374b 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_117.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_117.cpp @@ -63,9 +63,7 @@ static UINT32 Testcase(VOID) g_testCount = 0; LOS_TaskLock(); - ret = snprintf_s(qName, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq117_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT); + snprintf(qName, MQUEUE_STANDARD_NAME_LENGTH, "/mq117_%d", LosCurTaskIDGet()); g_messageQId = mq_open(qName, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, &msgAttr); ICUNIT_GOTO_NOT_EQUAL(g_messageQId, (mqd_t)-1, g_messageQId, EXIT2); diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_118.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_118.cpp similarity index 97% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_118.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_118.cpp index 91af0c1a..f330480b 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_118.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_118.cpp @@ -99,8 +99,7 @@ static UINT32 Testcase(VOID) LOS_TaskLock(); - (void)snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, - "/mq118_%d", LosCurTaskIDGet()); + snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq118_%d", LosCurTaskIDGet()); g_gqueue = mq_open(mqname, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, &attr); ICUNIT_GOTO_NOT_EQUAL(g_gqueue, (mqd_t)-1, g_gqueue, EXIT); diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_119.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_119.cpp similarity index 95% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_119.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_119.cpp index 9e23add7..d93f11d7 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_119.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_119.cpp @@ -77,9 +77,7 @@ static VOID *PthreadF02(VOID *arg) LOS_AtomicInc(&g_testCount); - ret = snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq119_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT3); + snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq119_%d", LosCurTaskIDGet()); g_gqueue = mq_open(mqname, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, &attr); ICUNIT_GOTO_NOT_EQUAL(g_gqueue, (mqd_t)-1, g_gqueue, EXIT); @@ -119,7 +117,6 @@ EXIT1: EXIT: mq_close(g_gqueue); mq_unlink(mqname); -EXIT3: return MQUEUE_NO_ERROR; } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_120.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_120.cpp similarity index 97% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_120.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_120.cpp index 1def3053..3205a0de 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_120.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_120.cpp @@ -89,8 +89,7 @@ static UINT32 Testcase(VOID) g_testCount = 0; - (void)snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, - "/mq120_%d", LosCurTaskIDGet()); + snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq120_%d", LosCurTaskIDGet()); g_gqueue = mq_open(mqname, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, &attr); ICUNIT_GOTO_NOT_EQUAL(g_gqueue, (mqd_t)-1, g_gqueue, EXIT1); diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_121.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_121.cpp similarity index 98% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_121.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_121.cpp index 0f40cff8..66574cce 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_121.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_121.cpp @@ -141,8 +141,7 @@ static UINT32 Testcase(VOID) g_testCount = 0; - (void)snprintf_s(qName, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq121_%d", LosCurTaskIDGet()); + snprintf(qName, MQUEUE_STANDARD_NAME_LENGTH, "/mq121_%d", LosCurTaskIDGet()); g_messageQId = mq_open(qName, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, &msgAttr); ICUNIT_GOTO_NOT_EQUAL(g_messageQId, (mqd_t)-1, g_messageQId, EXIT); diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_122.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_122.cpp similarity index 94% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_122.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_122.cpp index de3753fc..60a483c6 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_122.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_122.cpp @@ -68,9 +68,7 @@ static UINT32 Testcase(VOID) g_testCount = 0; - ret = snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq122_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT3); + snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq122_%d", LosCurTaskIDGet()); g_gqueue = mq_open(mqname, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, &attr); ICUNIT_GOTO_NOT_EQUAL(g_gqueue, (mqd_t)-1, g_gqueue, EXIT1); @@ -103,7 +101,6 @@ EXIT1: mq_close(g_gqueue); EXIT: mq_unlink(mqname); -EXIT3: return MQUEUE_NO_ERROR; } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_123.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_123.cpp similarity index 94% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_123.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_123.cpp index 7d34a05f..c1847935 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_123.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_123.cpp @@ -47,9 +47,7 @@ static VOID HwiF01(VOID *arg) LOS_AtomicInc(&g_testCount); - ret = snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq123_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT1); + snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq123_%d", LosCurTaskIDGet()); g_gqueue = mq_open(mqname, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, &attr); ICUNIT_GOTO_NOT_EQUAL(g_gqueue, (mqd_t)-1, g_gqueue, EXIT); @@ -71,7 +69,6 @@ EXIT: mq_close(g_gqueue); mq_unlink(mqname); g_testCount = 0; -EXIT1: return; } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_124.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_124.cpp similarity index 95% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_124.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_124.cpp index 3cf6adaf..774c8dd1 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_124.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_124.cpp @@ -98,13 +98,10 @@ EXIT: static UINT32 Testcase(VOID) { UINT32 uret; - INT32 ret; g_testCount = 0; - ret = snprintf_s(g_gqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq124_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT); + snprintf(g_gqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq124_%d", LosCurTaskIDGet()); uret = LOS_HwiCreate(HWI_NUM_TEST1, 1, 0, (HWI_PROC_FUNC)HwiF02, 0); ICUNIT_GOTO_EQUAL(uret, MQUEUE_NO_ERROR, uret, EXIT); diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_125.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_125.cpp similarity index 95% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_125.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_125.cpp index 60f323a3..f6372190 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_125.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_125.cpp @@ -103,9 +103,7 @@ static UINT32 Testcase(VOID) g_testCount = 0; - ret = snprintf_s(g_gqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq125_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT3); + snprintf(g_gqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq125_%d", LosCurTaskIDGet()); ret = pthread_attr_init(&attr1); ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT); @@ -147,7 +145,6 @@ EXIT1: pthread_join(pthread1, NULL); EXIT: pthread_attr_destroy(&attr1); -EXIT3: return MQUEUE_NO_ERROR; } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_126.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_126.cpp similarity index 95% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_126.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_126.cpp index ac45f4a9..022b0001 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_126.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_126.cpp @@ -100,9 +100,7 @@ static UINT32 Testcase(VOID) g_testCount = 0; - ret = snprintf_s(g_gqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq126_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT3); + snprintf(g_gqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq126_%d", LosCurTaskIDGet()); uret = LOS_HwiCreate(HWI_NUM_TEST, 0, 0, (HWI_PROC_FUNC)HwiF01, 0); ICUNIT_GOTO_EQUAL(uret, MQUEUE_NO_ERROR, uret, EXIT); @@ -144,7 +142,6 @@ EXIT1: pthread_attr_destroy(&attr1); EXIT: TEST_HwiDelete(HWI_NUM_TEST); -EXIT3: return MQUEUE_NO_ERROR; } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_127.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_127.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_127.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_127.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_128.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_128.cpp similarity index 92% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_128.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_128.cpp index b05e6aa5..b2060b62 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_128.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_128.cpp @@ -37,9 +37,7 @@ static UINT32 Testcase(VOID) mqd_t mqueue; struct mq_attr attr = { 0 }; - ret = snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq128_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT2); + snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq128_%d", LosCurTaskIDGet()); attr.mq_msgsize = MQUEUE_STANDARD_NAME_LENGTH; attr.mq_maxmsg = MQUEUE_STANDARD_NAME_LENGTH; @@ -62,7 +60,6 @@ EXIT1: mq_close(mqueue); EXIT: mq_unlink(mqname); -EXIT2: return MQUEUE_NO_ERROR; } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_129.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_129.cpp similarity index 93% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_129.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_129.cpp index ff8dd622..b78aa4fb 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_129.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_129.cpp @@ -42,9 +42,7 @@ static UINT32 Testcase(VOID) attr.mq_msgsize = MQUEUE_STANDARD_NAME_LENGTH; attr.mq_maxmsg = MQUEUE_SHORT_ARRAY_LENGTH; - ret = snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq129_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT2); + snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq129_%d", LosCurTaskIDGet()); mqueue = mq_open(mqname, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, &attr); ICUNIT_GOTO_NOT_EQUAL(mqueue, (mqd_t)-1, mqueue, EXIT1); @@ -70,7 +68,6 @@ EXIT1: mq_close(mqueue); EXIT: mq_unlink(mqname); -EXIT2: return MQUEUE_NO_ERROR; } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_130.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_130.cpp similarity index 92% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_130.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_130.cpp index d4cfa92b..8ee6607c 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_130.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_130.cpp @@ -41,9 +41,7 @@ static UINT32 Testcase(VOID) attr.mq_msgsize = 0; attr.mq_maxmsg = MQUEUE_STANDARD_NAME_LENGTH; - ret = snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq130_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT1); + snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq130_%d", LosCurTaskIDGet()); g_gqueue = mq_open(mqname, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, &attr); ICUNIT_GOTO_EQUAL(g_gqueue, (mqd_t)-1, g_gqueue, EXIT); @@ -60,7 +58,6 @@ static UINT32 Testcase(VOID) EXIT: mq_close(g_gqueue); mq_unlink(mqname); -EXIT1: return MQUEUE_NO_ERROR; } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_133.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_133.cpp similarity index 97% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_133.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_133.cpp index a47adcbc..f980ccf7 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_133.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_133.cpp @@ -88,8 +88,7 @@ static UINT32 Testcase(VOID) g_testCount = 0; - (void)snprintf_s(qName, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq170_%d", LosCurTaskIDGet()); + snprintf(qName, MQUEUE_STANDARD_NAME_LENGTH, "/mq170_%d", LosCurTaskIDGet()); g_messageQId = mq_open(qName, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, &msgAttr); ICUNIT_GOTO_NOT_EQUAL(g_messageQId, (mqd_t)-1, g_messageQId, EXIT1); @@ -149,6 +148,7 @@ EXIT2: EXIT1: mq_close(g_messageQId); mq_unlink(qName); +EXIT: return MQUEUE_NO_ERROR; } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_134.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_134.cpp similarity index 91% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_134.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_134.cpp index 27f5a041..1293dce1 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_134.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_134.cpp @@ -37,9 +37,7 @@ static UINT32 Testcase(VOID) CHAR mqname[MQUEUE_STANDARD_NAME_LENGTH] = ""; mqd_t mqueue; - ret = snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq134_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT2); + snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq134_%d", LosCurTaskIDGet()); mqueue = mq_open(mqname, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, 0); ICUNIT_GOTO_NOT_EQUAL(mqueue, (mqd_t)-1, mqueue, EXIT1); @@ -57,7 +55,6 @@ EXIT1: mq_close(mqueue); EXIT: mq_unlink(mqname); -EXIT2: return MQUEUE_NO_ERROR; } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_136.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_136.cpp similarity index 94% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_136.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_136.cpp index 71df4fcd..83f0f82f 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_136.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_136.cpp @@ -46,8 +46,7 @@ static UINT32 Testcase(VOID) msgAttr.mq_maxmsg = 20; // 20, mqueue message size. for (index = 0; index < (LOSCFG_BASE_IPC_QUEUE_CONFIG - QUEUE_EXISTED_NUM); index++) { - (void)snprintf_s(qName[index], MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq136_%d", index); + snprintf(qName[index], MQUEUE_STANDARD_NAME_LENGTH, "/mq136_%d", index); queueID[index] = mq_open(qName[index], O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, &msgAttr); ICUNIT_GOTO_NOT_EQUAL(queueID[index], (mqd_t)-1, queueID[index], EXIT); } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_143.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_143.cpp similarity index 94% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_143.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_143.cpp index c4301752..246d34cb 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_143.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_143.cpp @@ -61,9 +61,7 @@ static UINT32 Testcase(VOID) attr.mq_maxmsg = size; attr.mq_flags = O_NONBLOCK; - ret = snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq143_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT2); + snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq143_%d", LosCurTaskIDGet()); g_gqueue = mq_open(mqname, O_CREAT | O_RDWR | O_EXCL, S_IRUSR | S_IWUSR, &attr); ICUNIT_ASSERT_NOT_EQUAL(g_gqueue, (mqd_t)-1, g_gqueue); @@ -103,7 +101,6 @@ EXIT1: EXIT: mq_close(g_gqueue); mq_unlink(mqname); -EXIT2: return MQUEUE_NO_ERROR; } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_144.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_144.cpp similarity index 94% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_144.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_144.cpp index ebed1beb..c9d07ef4 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_144.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_144.cpp @@ -92,15 +92,12 @@ static UINT32 Testcase(VOID) pthread_attr_t attr1; pthread_t newTh, newTh2; - ret = memset_s(&mqstat, sizeof(mqstat), 0, sizeof(mqstat)); - ICUNIT_ASSERT_EQUAL(ret, 0, ret); + memset(&mqstat, 0, sizeof(mqstat)); mqstat.mq_maxmsg = MQUEUE_SHORT_ARRAY_LENGTH; mqstat.mq_msgsize = MQUEUE_SHORT_ARRAY_LENGTH * 2; // 2, mqueue message size. mqstat.mq_flags = 0; - ret = snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq144_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT3); + snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq144_%d", LosCurTaskIDGet()); g_gqueue = mq_open(mqname, O_CREAT | O_RDWR, S_IRWXU | S_IRWXG | S_IRWXO, &mqstat); ICUNIT_GOTO_NOT_EQUAL(g_gqueue, (mqd_t)-1, g_gqueue, EXIT); @@ -147,7 +144,6 @@ EXIT1: EXIT: mq_close(g_gqueue); mq_unlink(mqname); -EXIT3: return MQUEUE_NO_ERROR; } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_145.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_145.cpp similarity index 91% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_145.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_145.cpp index 704fd347..76ce0c07 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_145.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_145.cpp @@ -43,11 +43,11 @@ static VOID *PthreadF01(VOID *mq) LOS_AtomicInc(&g_testCount); - pthread_exit(nullptr); + pthread_exit((void *)0); return NULL; EXIT: - pthread_exit(nullptr); + pthread_exit((void *)0); g_testCount = 0; return NULL; } @@ -64,11 +64,11 @@ static VOID *PthreadF02(VOID *mq) } LOS_AtomicInc(&g_testCount); - pthread_exit(nullptr); + pthread_exit((void *)0); return NULL; EXIT: - pthread_exit(nullptr); + pthread_exit((void *)0); g_testCount = 0; return NULL; } @@ -85,11 +85,11 @@ static VOID *PthreadF03(VOID *mq) } LOS_AtomicInc(&g_testCount); - pthread_exit(nullptr); + pthread_exit((void *)0); return NULL; EXIT: - pthread_exit(nullptr); + pthread_exit((void *)0); g_testCount = 0; return NULL; } @@ -107,11 +107,11 @@ static VOID *PthreadF04(VOID *mq) LOS_AtomicInc(&g_testCount); - pthread_exit(nullptr); + pthread_exit((void *)0); return NULL; EXIT: - pthread_exit(nullptr); + pthread_exit((void *)0); g_testCount = 0; return NULL; } @@ -125,14 +125,12 @@ static UINT32 Testcase(VOID) struct mq_attr mqstat; pthread_t pthreadSend1, pthreadSend2, pthreadRecev1, pthreadRecev2; - (void)snprintf_s(mqname1, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mqueue145_1_%d", LosCurTaskIDGet()); - (void)snprintf_s(mqname2, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mqueue145_2_%d", LosCurTaskIDGet()); + snprintf(mqname1, MQUEUE_STANDARD_NAME_LENGTH, "/mqueue145_1_%d", LosCurTaskIDGet()); + snprintf(mqname2, MQUEUE_STANDARD_NAME_LENGTH, "/mqueue145_2_%d", LosCurTaskIDGet()); g_testCount = 0; - (void)memset_s(&mqstat, sizeof(mqstat), 0, sizeof(mqstat)); + memset(&mqstat, 0, sizeof(mqstat)); mqstat.mq_maxmsg = MQUEUE_SHORT_ARRAY_LENGTH; mqstat.mq_msgsize = MQUEUE_STANDARD_NAME_LENGTH; mqstat.mq_flags = 0; diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_146.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_146.cpp similarity index 96% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_146.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_146.cpp index e075f335..256ed91f 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_146.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_146.cpp @@ -50,11 +50,11 @@ static VOID *PthreadF01(VOID *info) LOS_AtomicInc(&g_testCount); - pthread_exit(nullptr); + pthread_exit((void *)0); return NULL; EXIT: - pthread_exit(nullptr); + pthread_exit((void *)0); g_testCount = 0; return NULL; } @@ -74,11 +74,11 @@ static VOID *PthreadF02(VOID *info) LOS_AtomicInc(&g_testCount); - pthread_exit(nullptr); + pthread_exit((void *)0); return NULL; EXIT: - pthread_exit(nullptr); + pthread_exit((void *)0); g_testCount = 0; return NULL; } @@ -98,8 +98,7 @@ static UINT32 Testcase(VOID) oflag = O_CREAT | O_NONBLOCK | O_RDWR; - ret = memset_s(&mqstat, sizeof(mqstat), 0, sizeof(mqstat)); - ICUNIT_ASSERT_EQUAL(ret, 0, ret); + memset(&mqstat, 0, sizeof(mqstat)); mqstat.mq_maxmsg = MQUEUE_SHORT_ARRAY_LENGTH; mqstat.mq_msgsize = MQUEUE_STANDARD_NAME_LENGTH; mqstat.mq_flags = 0; diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_147.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_147.cpp similarity index 93% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_147.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_147.cpp index 1955c0ee..972b09cc 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_147.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_147.cpp @@ -42,9 +42,7 @@ static UINT32 Testcase(VOID) attr.mq_msgsize = 1; attr.mq_maxmsg = MQUEUE_STANDARD_NAME_LENGTH; - ret = snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq147_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT2); + snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq147_%d", LosCurTaskIDGet()); mqueue = mq_open(mqname, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, &attr); ICUNIT_GOTO_NOT_EQUAL(mqueue, (mqd_t)-1, mqueue, EXIT1); @@ -67,7 +65,6 @@ EXIT1: mq_close(mqueue); EXIT: mq_unlink(mqname); -EXIT2: return MQUEUE_NO_ERROR; } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_148.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_148.cpp similarity index 92% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_148.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_148.cpp index afe8bbc2..bfad43ea 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_148.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_148.cpp @@ -42,9 +42,7 @@ static UINT32 Testcase(VOID) msgAttr.mq_msgsize = 0xFFF0; msgAttr.mq_maxmsg = 0xFFF0; - ret = snprintf_s(qName, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq148_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT1); + snprintf(qName, MQUEUE_STANDARD_NAME_LENGTH, "/mq148_%d", LosCurTaskIDGet()); g_messageQId = mq_open(qName, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, &msgAttr); ICUNIT_GOTO_EQUAL(g_messageQId, (mqd_t)-1, g_messageQId, EXIT); @@ -59,7 +57,6 @@ static UINT32 Testcase(VOID) EXIT: mq_close(g_messageQId); mq_unlink(qName); -EXIT1: return MQUEUE_NO_ERROR; } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_149.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_149.cpp similarity index 93% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_149.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_149.cpp index 82a01595..61143620 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_149.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_149.cpp @@ -41,9 +41,7 @@ static UINT32 Testcase(VOID) attr.mq_msgsize = MQUEUE_STANDARD_NAME_LENGTH; attr.mq_maxmsg = MQUEUE_STANDARD_NAME_LENGTH; - ret = snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq149_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT2); + snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq149_%d", LosCurTaskIDGet()); mqueue = mq_open(mqname, O_CREAT | O_RDWR | O_NONBLOCK, S_IRUSR | S_IWUSR, &attr); ICUNIT_GOTO_NOT_EQUAL(mqueue, (mqd_t)-1, mqueue, EXIT1); @@ -67,7 +65,6 @@ EXIT1: mq_close(mqueue); EXIT: mq_unlink(mqname); -EXIT2: return MQUEUE_NO_ERROR; } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_150.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_150.cpp similarity index 93% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_150.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_150.cpp index 130ed558..6852a595 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_150.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_150.cpp @@ -42,9 +42,7 @@ static UINT32 Testcase(VOID) attr.mq_msgsize = MQUEUE_STANDARD_NAME_LENGTH; attr.mq_maxmsg = MQUEUE_STANDARD_NAME_LENGTH; - ret = snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq150_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT2); + snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq150_%d", LosCurTaskIDGet()); mqueue = mq_open(mqname, O_CREAT | O_RDWR | O_NONBLOCK, S_IRUSR | S_IWUSR, &attr); ICUNIT_GOTO_NOT_EQUAL(mqueue, (mqd_t)-1, mqueue, EXIT1); @@ -68,7 +66,6 @@ EXIT1: mq_close(mqueue); EXIT: mq_unlink(mqname); -EXIT2: return MQUEUE_NO_ERROR; } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_151.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_151.cpp similarity index 92% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_151.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_151.cpp index d3ccfeee..4874cdf8 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_151.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_151.cpp @@ -42,9 +42,7 @@ static UINT32 Testcase(VOID) attr.mq_msgsize = MQUEUE_STANDARD_NAME_LENGTH; attr.mq_maxmsg = MQUEUE_STANDARD_NAME_LENGTH; - ret = snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq151_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT2); + snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq151_%d", LosCurTaskIDGet()); mqueue = mq_open(mqname, O_CREAT | O_RDWR | O_NONBLOCK, S_IRUSR | S_IWUSR, &attr); ICUNIT_GOTO_NOT_EQUAL(mqueue, (mqd_t)-1, mqueue, EXIT1); @@ -64,7 +62,6 @@ EXIT1: mq_close(mqueue); EXIT: mq_unlink(mqname); -EXIT2: return MQUEUE_NO_ERROR; } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_152.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_152.cpp similarity index 93% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_152.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_152.cpp index 773bc1ee..82221297 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_152.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_152.cpp @@ -42,9 +42,7 @@ static UINT32 Testcase(VOID) attr.mq_msgsize = MQUEUE_STANDARD_NAME_LENGTH; attr.mq_maxmsg = MQUEUE_STANDARD_NAME_LENGTH; - ret = snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq152_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT2); + snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq152_%d", LosCurTaskIDGet()); mqueue = mq_open(mqname, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, &attr); ICUNIT_GOTO_NOT_EQUAL(mqueue, (mqd_t)-1, mqueue, EXIT); @@ -67,7 +65,6 @@ EXIT1: mq_close(mqueue); EXIT: mq_unlink(mqname); -EXIT2: return MQUEUE_NO_ERROR; } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_153.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_153.cpp similarity index 93% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_153.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_153.cpp index 1e0e72bb..77241880 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_153.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_153.cpp @@ -42,9 +42,7 @@ static UINT32 Testcase(VOID) attr.mq_msgsize = MQUEUE_STANDARD_NAME_LENGTH; attr.mq_maxmsg = MQUEUE_STANDARD_NAME_LENGTH; - ret = snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq153_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT2); + snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq153_%d", LosCurTaskIDGet()); mqueue = mq_open(mqname, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, &attr); ICUNIT_GOTO_NOT_EQUAL(mqueue, (mqd_t)-1, mqueue, EXIT1); @@ -67,7 +65,6 @@ EXIT1: mq_close(mqueue); EXIT: mq_unlink(mqname); -EXIT2: return MQUEUE_NO_ERROR; } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_154.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_154.cpp similarity index 93% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_154.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_154.cpp index 628595e1..66a6d6d8 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_154.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_154.cpp @@ -42,9 +42,7 @@ static UINT32 Testcase(VOID) attr.mq_msgsize = MQUEUE_STANDARD_NAME_LENGTH; attr.mq_maxmsg = MQUEUE_STANDARD_NAME_LENGTH; - ret = snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq154_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT2); + snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq154_%d", LosCurTaskIDGet()); mqueue = mq_open(mqname, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, &attr); ICUNIT_GOTO_NOT_EQUAL(mqueue, (mqd_t)-1, mqueue, EXIT1); @@ -67,7 +65,6 @@ EXIT1: mq_close(mqueue); EXIT: mq_unlink(mqname); -EXIT2: return MQUEUE_NO_ERROR; } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_155.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_155.cpp similarity index 93% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_155.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_155.cpp index 53be9f33..e916a045 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_155.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_155.cpp @@ -43,9 +43,7 @@ static UINT32 Testcase(VOID) attr.mq_msgsize = MQUEUE_STANDARD_NAME_LENGTH; attr.mq_maxmsg = MQUEUE_STANDARD_NAME_LENGTH; - ret = snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq155_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT2); + snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq155_%d", LosCurTaskIDGet()); mqueue = mq_open(mqname, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, &attr); ICUNIT_GOTO_NOT_EQUAL(mqueue, (mqd_t)-1, mqueue, EXIT1); @@ -73,7 +71,6 @@ EXIT1: mq_close(mqueue); EXIT: mq_unlink(mqname); -EXIT2: return MQUEUE_NO_ERROR; } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_156.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_156.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_156.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_156.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_157.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_157.cpp similarity index 91% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_157.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_157.cpp index 672603e6..c369ff84 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_157.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_157.cpp @@ -44,16 +44,14 @@ static UINT32 Testcase(VOID) attr.mq_maxmsg = MQUEUE_SHORT_ARRAY_LENGTH; for (i = 0; i < count; i++) { - (void)snprintf_s(mqname[i], MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "mq157_%d_%d", LosCurTaskIDGet(), i); + snprintf(mqname[i], MQUEUE_STANDARD_NAME_LENGTH, "mq157_%d_%d", LosCurTaskIDGet(), i); mqueue[i] = mq_open(mqname[i], O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, &attr); ICUNIT_GOTO_NOT_EQUAL(mqueue[i], (mqd_t)-1, mqueue[i], EXIT); } #ifndef LOSCFG_DEBUG_QUEUE - (void)snprintf_s(mqname[i], MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "mq157_%d_%d", LosCurTaskIDGet(), i); + snprintf(mqname[i], MQUEUE_STANDARD_NAME_LENGTH, "mq157_%d_%d", LosCurTaskIDGet(), i); mqueue[i] = mq_open(mqname[i], O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, &attr); ICUNIT_GOTO_EQUAL(mqueue[i], (mqd_t)-1, mqueue[i], EXIT); #endif diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_159.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_159.cpp similarity index 92% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_159.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_159.cpp index ddb5c292..033dc349 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_159.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_159.cpp @@ -44,16 +44,14 @@ static UINT32 Testcase(VOID) attr.mq_maxmsg = 20; for (i = 0; i < count; i++) { - (void)snprintf_s(mqname[i], MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "mq158_%d_%d", LosCurTaskIDGet(), i); + snprintf(mqname[i], MQUEUE_STANDARD_NAME_LENGTH, "mq158_%d_%d", LosCurTaskIDGet(), i); mqueue[i] = mq_open(mqname[i], O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, &attr); ICUNIT_GOTO_NOT_EQUAL(mqueue[i], (mqd_t)-1, mqueue[i], EXIT); } #ifndef LOSCFG_DEBUG_QUEUE - (void)snprintf_s(mqname[i], MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq158_%d", i); + snprintf(mqname[i], MQUEUE_STANDARD_NAME_LENGTH, "/mq158_%d", i); mqueue[i] = mq_open(mqname[i], O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, &attr); ICUNIT_GOTO_EQUAL(mqueue[i], (mqd_t)(-1), mqueue[i], EXIT); #else diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_160.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_160.cpp similarity index 94% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_160.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_160.cpp index 74418345..c451568b 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_160.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_160.cpp @@ -42,15 +42,13 @@ static VOID *PthreadF01(VOID *arg) attr.mq_maxmsg = 5; // 5, queue max message size. for (i = 0; i < count; i++, g_testCount++) { - (void)snprintf_s(g_mqueueName[i], MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq160_%d_%d", LosCurTaskIDGet(), i); + snprintf(g_mqueueName[i], MQUEUE_STANDARD_NAME_LENGTH, "/mq160_%d_%d", LosCurTaskIDGet(), i); g_mqueueId[i] = mq_open(g_mqueueName[i], O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, &attr); ICUNIT_GOTO_NOT_EQUAL(g_mqueueId[i], (mqd_t)-1, g_mqueueId[i], EXIT); } #ifndef LOSCFG_DEBUG_QUEUE - (void)snprintf_s(g_mqueueName[i], MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq160_%d_%d", LosCurTaskIDGet(), i); + snprintf(g_mqueueName[i], MQUEUE_STANDARD_NAME_LENGTH, "/mq160_%d_%d", LosCurTaskIDGet(), i); g_mqueueId[i] = mq_open(g_mqueueName[i], O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, &attr); ICUNIT_GOTO_EQUAL(g_mqueueId[i], (mqd_t)-1, g_mqueueId[i], EXIT); #endif diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_161.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_161.cpp similarity index 97% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_161.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_161.cpp index abaa5b9f..ca6949a7 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_161.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_161.cpp @@ -44,8 +44,7 @@ static VOID *PthreadF01(VOID *arg) uret = g_index % count; - (void)snprintf_s(g_mqueueName[uret], MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mqueue_161_%d_%d", LosCurTaskIDGet(), (uret)); + snprintf(g_mqueueName[uret], MQUEUE_STANDARD_NAME_LENGTH, "/mqueue_161_%d_%d", LosCurTaskIDGet(), (uret)); g_mqueueId[uret] = mq_open(g_mqueueName[uret], O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, &attr); ICUNIT_GOTO_NOT_EQUAL(g_mqueueId[uret], (mqd_t)-1, g_mqueueId[uret], EXIT); diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_162.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_162.cpp similarity index 93% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_162.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_162.cpp index 74a5128d..379cf12b 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_162.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_162.cpp @@ -41,11 +41,11 @@ static VOID *PthreadF01(VOID *arg) } LOS_AtomicInc(&g_testCount); - pthread_exit(nullptr); + pthread_exit((void *)0); return NULL; EXIT: - pthread_exit(nullptr); + pthread_exit((void *)0); g_testCount = 0; return NULL; } @@ -63,12 +63,12 @@ static VOID *PthreadF02(VOID *arg) LOS_AtomicInc(&g_testCount); - pthread_exit(nullptr); + pthread_exit((void *)0); return NULL; EXIT: g_testCount = 0; - pthread_exit(nullptr); + pthread_exit((void *)0); return NULL; } @@ -76,6 +76,7 @@ static UINT32 Testcase(VOID) { INT32 oflag, i, ret = 0; INT32 pthreadCount[MQUEUE_PTHREAD_NUM_TEST]; + CHAR mqname[MQUEUE_STANDARD_NAME_LENGTH] = ""; pthread_t pthreadSend[MQUEUE_PTHREAD_NUM_TEST]; pthread_t pthreadRecev[MQUEUE_PTHREAD_NUM_TEST]; @@ -87,16 +88,18 @@ static UINT32 Testcase(VOID) g_testCount = 0; - (void)snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, - "/mq162_%d", LosCurTaskIDGet()); - (void)memset_s(&mqstat, sizeof(mqstat), 0, sizeof(mqstat)); + snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq162_%d", LosCurTaskIDGet()); + + memset(&mqstat, 0, sizeof(mqstat)); mqstat.mq_maxmsg = MQUEUE_PTHREAD_NUM_TEST; mqstat.mq_msgsize = MQUEUE_STANDARD_NAME_LENGTH; mqstat.mq_flags = 0; oflag = O_CREAT | O_NONBLOCK | O_RDWR; + g_gqueue = mq_open(mqname, oflag, S_IRWXU | S_IRWXG | S_IRWXO, &mqstat); ICUNIT_GOTO_NOT_EQUAL(g_gqueue, (mqd_t)-1, g_gqueue, EXIT1); + for (i = 0; i < MQUEUE_PTHREAD_NUM_TEST; i++) { pthreadCount[i] = i; ret = pthread_create(&pthreadSend[i], &attr1, PthreadF01, NULL); diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_163.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_163.cpp similarity index 91% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_163.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_163.cpp index 0a28b4a9..d2113b18 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_163.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_163.cpp @@ -42,15 +42,13 @@ static UINT32 Testcase(VOID) attr.mq_msgsize = MQUEUE_STANDARD_NAME_LENGTH; attr.mq_maxmsg = MQUEUE_STANDARD_NAME_LENGTH; for (i = 0; i < (count); i++) { - (void)snprintf_s(mqname[i], MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq163_%d_%d", LosCurTaskIDGet(), i); + snprintf(mqname[i], MQUEUE_STANDARD_NAME_LENGTH, "/mq163_%d_%d", LosCurTaskIDGet(), i); mqueue[i] = mq_open(mqname[i], O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, &attr); ICUNIT_GOTO_NOT_EQUAL(mqueue[i], (mqd_t)-1, mqueue[i], EXIT); } #ifndef LOSCFG_DEBUG_QUEUE - (void)snprintf_s(mqname[i], MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq163_%d_%d", LosCurTaskIDGet(), i); + snprintf(mqname[i], MQUEUE_STANDARD_NAME_LENGTH, "/mq163_%d_%d", LosCurTaskIDGet(), i); mqueue[i] = mq_open(mqname[i], O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, &attr); ICUNIT_GOTO_EQUAL(mqueue[i], (mqd_t)-1, mqueue[i], EXIT1); ICUNIT_GOTO_EQUAL(errno, ENFILE, errno, EXIT1); diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_164.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_164.cpp similarity index 94% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_164.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_164.cpp index dd04ab0d..6c26ffc4 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_164.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_164.cpp @@ -43,9 +43,7 @@ static UINT32 Testcase(VOID) attr.mq_msgsize = MQUEUE_STANDARD_NAME_LENGTH; attr.mq_maxmsg = 3; // 3, queue max message size. - ret = snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq164_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT2); + snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq164_%d", LosCurTaskIDGet()); mqueue = mq_open(mqname, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, &attr); ICUNIT_GOTO_NOT_EQUAL(mqueue, (mqd_t)-1, mqueue, EXIT1); @@ -77,7 +75,6 @@ EXIT1: mq_close(mqueue); EXIT: mq_unlink(mqname); -EXIT2: return MQUEUE_NO_ERROR; } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_165.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_165.cpp similarity index 93% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_165.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_165.cpp index 3897ffed..a4408bfa 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_165.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_165.cpp @@ -41,9 +41,7 @@ static UINT32 Testcase(VOID) attr.mq_msgsize = MQUEUE_STANDARD_NAME_LENGTH; attr.mq_maxmsg = 3; // 3, queue max message size. - ret = snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, - "/mq165_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT2); + snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq165_%d", LosCurTaskIDGet()); mqueue = mq_open(mqname, O_CREAT | O_RDWR | O_NONBLOCK, S_IRUSR | S_IWUSR, &attr); ICUNIT_GOTO_NOT_EQUAL(mqueue, (mqd_t)-1, mqueue, EXIT1); @@ -68,7 +66,6 @@ EXIT1: mq_close(mqueue); EXIT: mq_unlink(mqname); -EXIT2: return MQUEUE_NO_ERROR; } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_166.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_166.cpp similarity index 94% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_166.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_166.cpp index 52c8c22b..a5cbb49b 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_166.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_166.cpp @@ -46,9 +46,7 @@ static UINT32 Testcase(VOID) msgAttr.mq_msgsize = MQUEUE_STANDARD_NAME_LENGTH; msgAttr.mq_maxmsg = MQUEUE_STANDARD_NAME_LENGTH; - ret = snprintf_s(qName, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq166_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT1); + snprintf(qName, MQUEUE_STANDARD_NAME_LENGTH, "/mq166_%d", LosCurTaskIDGet()); msgQId = mq_open(qName, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, &msgAttr); ICUNIT_GOTO_NOT_EQUAL(msgQId, (mqd_t)-1, msgQId, EXIT); @@ -84,7 +82,6 @@ static UINT32 Testcase(VOID) EXIT: mq_close(msgQId); mq_unlink(qName); -EXIT1: return MQUEUE_NO_ERROR; } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_168.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_168.cpp similarity index 94% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_168.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_168.cpp index 8c6dfc19..48f215f3 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_168.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_168.cpp @@ -41,9 +41,7 @@ static UINT32 Testcase(VOID) mqd_t mqueue; struct mq_attr attr = { 0 }; - ret = snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq168_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT2); + snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq168_%d", LosCurTaskIDGet()); attr.mq_msgsize = MQUEUE_STANDARD_NAME_LENGTH; attr.mq_maxmsg = MQUEUE_SHORT_ARRAY_LENGTH; @@ -86,7 +84,6 @@ EXIT1: mq_close(mqueue); EXIT: mq_unlink(mqname); -EXIT2: return MQUEUE_NO_ERROR; } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_169.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_169.cpp similarity index 94% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_169.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_169.cpp index 3ca47efb..d161ab4f 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_169.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_169.cpp @@ -41,9 +41,7 @@ static UINT32 Testcase(VOID) struct mq_attr attr = { 0 }; struct timespec ts; - ret = snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq169_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT2); + snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq169_%d", LosCurTaskIDGet()); attr.mq_msgsize = MQUEUE_STANDARD_NAME_LENGTH; attr.mq_maxmsg = MQUEUE_SHORT_ARRAY_LENGTH; @@ -82,7 +80,6 @@ EXIT1: mq_close(mqueue); EXIT: mq_unlink(mqname); -EXIT2: return MQUEUE_NO_ERROR; } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_173.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_173.cpp similarity index 93% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_173.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_173.cpp index 0db1dfce..d87588d4 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_173.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_173.cpp @@ -42,9 +42,7 @@ static UINT32 Testcase(VOID) mqd_t mqueue; struct mq_attr attr = { 0 }; - ret = snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq173_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT2); + snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq173_%d", LosCurTaskIDGet()); attr.mq_msgsize = MQUEUE_STANDARD_NAME_LENGTH; attr.mq_maxmsg = MQUEUE_STANDARD_NAME_LENGTH; @@ -71,7 +69,6 @@ EXIT1: mq_close(mqueue); EXIT: mq_unlink(mqname); -EXIT2: return MQUEUE_NO_ERROR; } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_175.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_175.cpp similarity index 94% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_175.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_175.cpp index a3c7512c..0fa63e43 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_175.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_175.cpp @@ -40,9 +40,7 @@ static UINT32 Testcase(VOID) struct mq_attr attr = { 0 }; mqd_t mqueue; - ret = snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq175_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT2); + snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq175_%d", LosCurTaskIDGet()); attr.mq_msgsize = MQUEUE_STANDARD_NAME_LENGTH; attr.mq_maxmsg = MQUEUE_SHORT_ARRAY_LENGTH; @@ -87,7 +85,6 @@ EXIT1: mq_close(mqueue); EXIT: mq_unlink(mqname); -EXIT2: return MQUEUE_NO_ERROR; } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_176.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_176.cpp similarity index 93% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_176.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_176.cpp index cd7ea7da..fda61054 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_176.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_176.cpp @@ -41,9 +41,7 @@ static UINT32 Testcase(VOID) mqd_t mqueue; struct mq_attr attr = { 0 }; - ret = snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq176_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT2); + snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq176_%d", LosCurTaskIDGet()); attr.mq_msgsize = MQUEUE_STANDARD_NAME_LENGTH; attr.mq_maxmsg = MQUEUE_STANDARD_NAME_LENGTH; @@ -77,7 +75,6 @@ EXIT1: mq_close(mqueue); EXIT: mq_unlink(mqname); -EXIT2: return MQUEUE_NO_ERROR; } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_177.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_177.cpp similarity index 93% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_177.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_177.cpp index 839c2099..574c1bc1 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_177.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_177.cpp @@ -41,9 +41,7 @@ static UINT32 Testcase(VOID) mqd_t mqueue; struct mq_attr attr = { 0 }; - ret = snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq177_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT2); + snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq177_%d", LosCurTaskIDGet()); attr.mq_msgsize = MQUEUE_STANDARD_NAME_LENGTH; attr.mq_maxmsg = MQUEUE_SHORT_ARRAY_LENGTH; @@ -73,7 +71,6 @@ EXIT1: mq_close(mqueue); EXIT: mq_unlink(mqname); -EXIT2: return MQUEUE_NO_ERROR; } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_187.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_187.cpp similarity index 92% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_187.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_187.cpp index 1cd1ad3e..1a08094b 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_187.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_187.cpp @@ -36,9 +36,7 @@ static UINT32 Testcase(VOID) CHAR mqname[MQUEUE_STANDARD_NAME_LENGTH] = ""; mqd_t mqueue; - ret = snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq187_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT2); + snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq187_%d", LosCurTaskIDGet()); mqueue = mq_open(mqname, O_CREAT | O_NONBLOCK, S_IRUSR | S_IWUSR, 0); ICUNIT_GOTO_NOT_EQUAL(mqueue, (mqd_t)-1, mqueue, EXIT1); @@ -63,7 +61,6 @@ EXIT1: mq_close(mqueue); EXIT: mq_unlink(mqname); -EXIT2: return MQUEUE_NO_ERROR; } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_200.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_200.cpp similarity index 93% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_200.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_200.cpp index cf4bd076..c521771d 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_200.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_200.cpp @@ -40,9 +40,7 @@ static UINT32 Testcase(VOID) struct timespec ts; struct mq_attr attr = { 0 }; - ret = snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq200_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT2); + snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq200_%d", LosCurTaskIDGet()); attr.mq_msgsize = MQUEUE_STANDARD_NAME_LENGTH; attr.mq_maxmsg = MQUEUE_STANDARD_NAME_LENGTH; @@ -70,7 +68,6 @@ EXIT1: mq_close(mqueue); EXIT: mq_unlink(mqname); -EXIT2: return MQUEUE_NO_ERROR; } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_201.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_201.cpp similarity index 93% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_201.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_201.cpp index e37726b4..2ecd5038 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_201.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_201.cpp @@ -44,9 +44,7 @@ static UINT32 Testcase(VOID) attr.mq_msgsize = 20; // 20, queue message size. attr.mq_maxmsg = 20; // 20, queue max message size. - ret = snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq201_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT2); + snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq201_%d", LosCurTaskIDGet()); mqueue = mq_open(mqname, O_CREAT | O_RDWR | O_EXCL, S_IRUSR | S_IWUSR, &attr); ICUNIT_ASSERT_NOT_EQUAL(mqueue, (mqd_t)-1, mqueue); @@ -73,7 +71,6 @@ EXIT1: mq_close(mqueue); EXIT: mq_unlink(mqname); -EXIT2: return MQUEUE_NO_ERROR; } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_202.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_202.cpp similarity index 93% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_202.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_202.cpp index bd5561ee..71e24309 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_202.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_202.cpp @@ -39,9 +39,7 @@ static UINT32 Testcase(VOID) struct timespec ts; struct mq_attr attr = { 0 }; - ret = snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq202_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT2); + snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq202_%d", LosCurTaskIDGet()); attr.mq_msgsize = MQUEUE_STANDARD_NAME_LENGTH; attr.mq_maxmsg = MQUEUE_STANDARD_NAME_LENGTH; @@ -68,7 +66,6 @@ EXIT1: mq_close(mqueue); EXIT: mq_unlink(mqname); -EXIT2: return MQUEUE_NO_ERROR; } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_203.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_203.cpp similarity index 92% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_203.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_203.cpp index 49fdf3c4..09e36c39 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_203.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_203.cpp @@ -40,9 +40,7 @@ static UINT32 Testcase(VOID) mqd_t mqueue1, mqueue2; struct timespec ts; - ret = snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, \ - "/mq203_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT1); + snprintf(mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq203_%d", LosCurTaskIDGet()); attr.mq_msgsize = MQUEUE_STANDARD_NAME_LENGTH; attr.mq_maxmsg = MQUEUE_STANDARD_NAME_LENGTH; @@ -61,7 +59,6 @@ EXIT: mq_close(mqueue1); mq_close(mqueue2); mq_unlink(mqname); -EXIT1: return LOS_OK; } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_204.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_204.cpp similarity index 94% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_204.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_204.cpp index eac0f683..1f24ce2c 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_204.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_204.cpp @@ -74,9 +74,7 @@ STATIC UINT32 Testcase(VOID) pthread_t pthread1, pthread2; pthread_attr_t attr1, attr2; - ret = snprintf_s(g_mqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH, - "/mq204_%d", LosCurTaskIDGet()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT1); + snprintf(g_mqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq204_%d", LosCurTaskIDGet()); g_attr.mq_msgsize = MQUEUE_STANDARD_NAME_LENGTH; g_attr.mq_maxmsg = MQUEUE_STANDARD_NAME_LENGTH; @@ -95,7 +93,6 @@ STATIC UINT32 Testcase(VOID) EXIT: (VOID)pthread_join(pthread1, NULL); (VOID)pthread_join(pthread2, NULL); -EXIT1: return LOS_OK; } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_205.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_205.cpp similarity index 96% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_205.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_205.cpp index 1d9cd9df..aee98dce 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_205.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_205.cpp @@ -58,8 +58,7 @@ static void Child(void) attr.mq_msgsize = MQUEUE_STANDARD_NAME_LENGTH; attr.mq_maxmsg = 1; - ret = snprintf_s(g_mqname, MQUEUE_STANDARD_NAME_LENGTH - 1, MQUEUE_STANDARD_NAME_LENGTH, "/mq205_%d", getpid()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT1); + (void)snprintf_s(g_mqname, MQUEUE_STANDARD_NAME_LENGTH - 1, MQUEUE_STANDARD_NAME_LENGTH, "/mq205_%d", getpid()); g_mqueue = mq_open(g_mqname, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, &attr); ICUNIT_GOTO_NOT_EQUAL(g_mqueue, (mqd_t)-1, g_mqueue, EXIT); @@ -89,7 +88,6 @@ static void Child(void) EXIT: mq_close(g_mqueue); mq_unlink(g_mqname); -EXIT1: return; } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_206.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_206.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_206.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_206.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_207.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_207.cpp similarity index 96% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_207.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_207.cpp index 8823d793..64c59158 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_207.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_207.cpp @@ -59,8 +59,7 @@ static void Child(void) attr.mq_msgsize = MQUEUE_STANDARD_NAME_LENGTH; attr.mq_maxmsg = 1; - ret = snprintf_s(g_mqname, MQUEUE_STANDARD_NAME_LENGTH - 1, MQUEUE_STANDARD_NAME_LENGTH, "/mq207_%d", getpid()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT1); + (void)snprintf_s(g_mqname, MQUEUE_STANDARD_NAME_LENGTH - 1, MQUEUE_STANDARD_NAME_LENGTH, "/mq207_%d", getpid()); g_mqueue = mq_open(g_mqname, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, &attr); ICUNIT_GOTO_NOT_EQUAL(g_mqueue, (mqd_t)-1, g_mqueue, EXIT); @@ -87,7 +86,6 @@ static void Child(void) EXIT: mq_close(g_mqueue); mq_unlink(g_mqname); -EXIT1: return; } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_208.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_208.cpp similarity index 97% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_208.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_208.cpp index fd3ff84d..33282ed2 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_208.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_208.cpp @@ -59,8 +59,7 @@ static void Child(void) attr.mq_msgsize = MQUEUE_STANDARD_NAME_LENGTH; attr.mq_maxmsg = 3; // 3, queue max message size. - ret = snprintf_s(g_mqname, MQUEUE_STANDARD_NAME_LENGTH - 1, MQUEUE_STANDARD_NAME_LENGTH, "/mq208_%d", getpid()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT1); + (void)snprintf_s(g_mqname, MQUEUE_STANDARD_NAME_LENGTH - 1, MQUEUE_STANDARD_NAME_LENGTH, "/mq208_%d", getpid()); g_mqueue = mq_open(g_mqname, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, &attr); ICUNIT_GOTO_NOT_EQUAL(g_mqueue, (mqd_t)-1, g_mqueue, EXIT); @@ -114,7 +113,6 @@ static void Child(void) EXIT: mq_close(g_mqueue); mq_unlink(g_mqname); -EXIT1: return; } static UINT32 Testcase(VOID) diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_209.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_209.cpp similarity index 97% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_209.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_209.cpp index 4a8e53fc..8bfe3909 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_209.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/full/It_posix_queue_209.cpp @@ -41,7 +41,7 @@ static VOID *Pthread(VOID *temp) CHAR msgrcd[MQUEUE_STANDARD_NAME_LENGTH] = {0}; g_cnt = 1; - (void)(temp); + (void *)(temp); ret = mq_receive(g_mqueue, msgrcd, MQUEUE_STANDARD_NAME_LENGTH, nullptr); ICUNIT_GOTO_EQUAL(ret, MQUEUE_SHORT_ARRAY_LENGTH, ret, EXIT); ICUNIT_GOTO_STRING_EQUAL(msgrcd, MQUEUE_SEND_STRING_TEST, msgrcd, EXIT); @@ -78,8 +78,7 @@ static void Child(void) attr.mq_msgsize = MQUEUE_STANDARD_NAME_LENGTH; attr.mq_maxmsg = 3; // 3, queue max message size. - ret = snprintf_s(g_mqname, MQUEUE_STANDARD_NAME_LENGTH - 1, MQUEUE_STANDARD_NAME_LENGTH, "/mq209_%d", getpid()); - ICUNIT_GOTO_NOT_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT1); + (void)snprintf_s(g_mqname, MQUEUE_STANDARD_NAME_LENGTH - 1, MQUEUE_STANDARD_NAME_LENGTH, "/mq209_%d", getpid()); g_mqueue = mq_open(g_mqname, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, &attr); ICUNIT_GOTO_NOT_EQUAL(g_mqueue, (mqd_t)-1, g_mqueue, EXIT); @@ -123,7 +122,6 @@ static void Child(void) EXIT: mq_close(g_mqueue); mq_unlink(g_mqname); -EXIT1: return; } static UINT32 Testcase(VOID) diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/posix_mqueue_test.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/posix_mqueue_test.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/posix_mqueue_test.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/posix_mqueue_test.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/smoke/It_posix_queue_001.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/smoke/It_posix_queue_001.cpp similarity index 92% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/smoke/It_posix_queue_001.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/smoke/It_posix_queue_001.cpp index 73d7e9ff..aea27701 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/smoke/It_posix_queue_001.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/smoke/It_posix_queue_001.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2023 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -37,14 +37,14 @@ static UINT32 Testcase(VOID) CHAR mqname[MQUEUE_STANDARD_NAME_LENGTH] = ""; CHAR msgrcd[MQUEUE_STANDARD_NAME_LENGTH] = {0}; const CHAR *msgptr = MQUEUE_SEND_STRING_TEST; - struct mq_attr attr = {0}; + struct mq_attr attr = { 0 }; mqd_t mqueue; attr.mq_msgsize = MQUEUE_STANDARD_NAME_LENGTH; attr.mq_maxmsg = 0; (void)snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH - 1, MQUEUE_STANDARD_NAME_LENGTH, "/mq001_%d", - LosCurTaskIDGet()); + LosCurTaskIDGet()); mqueue = mq_open(mqname, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, &attr); ICUNIT_GOTO_EQUAL(mqueue, (mqd_t)-1, mqueue, EXIT1); @@ -60,10 +60,10 @@ EXIT1: mq_close(mqueue); EXIT: mq_unlink(mqname); - return MQUEUE_IS_ERROR; + return MQUEUE_NO_ERROR; } -VOID ItPosixQueue001(VOID) +VOID ItPosixQueue001(VOID) // IT_Layer_ModuleORFeature_No { TEST_ADD_CASE("IT_POSIX_QUEUE_001", Testcase, TEST_POSIX, TEST_QUE, TEST_LEVEL0, TEST_FUNCTION); } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/smoke/It_posix_queue_003.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/smoke/It_posix_queue_003.cpp similarity index 87% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/smoke/It_posix_queue_003.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/smoke/It_posix_queue_003.cpp index 36ea7b5f..ec612d75 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/smoke/It_posix_queue_003.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/smoke/It_posix_queue_003.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2023 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -37,16 +37,16 @@ static UINT32 Testcase(VOID) CHAR msgrcd[MQUEUE_STANDARD_NAME_LENGTH] = {0}; const CHAR *msgptr = MQUEUE_SEND_STRING_TEST; mqd_t mqueue; - struct mq_attr attr = {0}; + struct mq_attr attr = { 0 }; attr.mq_msgsize = MQUEUE_STANDARD_NAME_LENGTH; attr.mq_maxmsg = 1; (void)snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH - 1, MQUEUE_STANDARD_NAME_LENGTH, "/mq003_%d", - LosCurTaskIDGet()); + LosCurTaskIDGet()); mqueue = mq_open(mqname, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, &attr); - ICUNIT_GOTO_NOT_EQUAL(mqueue, (mqd_t)-1, mqueue, EXIT2); + ICUNIT_GOTO_NOT_EQUAL(mqueue, (mqd_t)-1, mqueue, EXIT); ret = mq_send(mqueue, msgptr, strlen(msgptr), 0); ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT); @@ -59,21 +59,19 @@ static UINT32 Testcase(VOID) ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT); ret = mq_close(mqueue); - ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT1); + ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT); ret = mq_unlink(mqname); - ICUNIT_GOTO_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT2); + ICUNIT_GOTO_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT); return MQUEUE_NO_ERROR; EXIT: mq_close(mqueue); -EXIT1: mq_unlink(mqname); -EXIT2: - return MQUEUE_IS_ERROR; + return MQUEUE_NO_ERROR; } -VOID ItPosixQueue003(VOID) +VOID ItPosixQueue003(VOID) // IT_Layer_ModuleORFeature_No { TEST_ADD_CASE("IT_POSIX_QUEUE_003", Testcase, TEST_POSIX, TEST_QUE, TEST_LEVEL0, TEST_FUNCTION); } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/smoke/It_posix_queue_028.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/smoke/It_posix_queue_028.cpp similarity index 74% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/smoke/It_posix_queue_028.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/smoke/It_posix_queue_028.cpp index 2fe36711..ba554fed 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/smoke/It_posix_queue_028.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/smoke/It_posix_queue_028.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2023 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -30,58 +30,54 @@ */ #include "It_posix_queue.h" -const int queue_msg_size = 20; -const int queue_max_msg_size = 20; - static UINT32 Testcase(VOID) { INT32 ret; CHAR mqname[MQUEUE_STANDARD_NAME_LENGTH] = ""; - CHAR msgrcd[queue_max_msg_size] = {0}; - struct mq_attr attr = {0}; - struct timespec absTimeout = {0}; + CHAR msgrcd[20] = {0}; + struct mq_attr attr = { 0 }; + struct timespec absTimeout = { 0 }; mqd_t mqueue; (void)snprintf_s(mqname, MQUEUE_STANDARD_NAME_LENGTH - 1, MQUEUE_STANDARD_NAME_LENGTH, "/mq028_%d", LosCurTaskIDGet()); - attr.mq_msgsize = queue_msg_size; - attr.mq_maxmsg = queue_max_msg_size; + attr.mq_msgsize = 20; // 20, queue message size. + attr.mq_maxmsg = 20; // 20, queue max message size. mqueue = mq_open(mqname, O_CREAT | O_RDWR | O_EXCL, S_IRUSR | S_IWUSR, &attr); ICUNIT_ASSERT_NOT_EQUAL(mqueue, (mqd_t)-1, mqueue); - ret = mq_timedsend(mqueue, "1234567890123456789", queue_msg_size, 0, &absTimeout); + ret = mq_timedsend(mqueue, "1234567890123456789", 20, 0, &absTimeout); // 20, mqueue message length. ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT1); - ret = mq_receive(mqueue, msgrcd, queue_msg_size, NULL); - ICUNIT_GOTO_EQUAL(ret, queue_msg_size, ret, EXIT1); + ret = mq_receive(mqueue, msgrcd, 20, NULL); // 20, mqueue message length. + ICUNIT_GOTO_EQUAL(ret, 20, ret, EXIT1); // 20, Here, assert the ret. ret = mq_close(mqueue); - ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT); + ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT1); mqueue = mq_open(mqname, O_RDWR | O_NONBLOCK, S_IRUSR | S_IWUSR, &attr); - ICUNIT_GOTO_NOT_EQUAL(mqueue, (mqd_t)-1, mqueue, EXIT2); + ICUNIT_GOTO_NOT_EQUAL(mqueue, (mqd_t)-1, mqueue, EXIT1); - ret = mq_receive(mqueue, msgrcd, queue_msg_size, NULL); + ret = mq_receive(mqueue, msgrcd, 20, NULL); // 20, mqueue message length. ICUNIT_GOTO_EQUAL(ret, MQUEUE_IS_ERROR, ret, EXIT1); ret = mq_close(mqueue); - ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT); + ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT1); ret = mq_unlink(mqname); - ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT2); + ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT); return MQUEUE_NO_ERROR; EXIT1: mq_close(mqueue); EXIT: mq_unlink(mqname); -EXIT2: - return MQUEUE_IS_ERROR; + return MQUEUE_NO_ERROR; } -VOID ItPosixQueue028(VOID) +VOID ItPosixQueue028(VOID) // IT_Layer_ModuleORFeature_No { TEST_ADD_CASE("IT_POSIX_QUEUE_028", Testcase, TEST_POSIX, TEST_QUE, TEST_LEVEL0, TEST_FUNCTION); } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/smoke/It_posix_queue_053.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/smoke/It_posix_queue_053.cpp similarity index 96% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/smoke/It_posix_queue_053.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/smoke/It_posix_queue_053.cpp index 7197681e..01dd6aa2 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/smoke/It_posix_queue_053.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/smoke/It_posix_queue_053.cpp @@ -87,8 +87,7 @@ static UINT32 Testcase(VOID) pthread_attr_t attr1; pthread_t newTh1, newTh2; - (void)snprintf_s(g_gqname, MQUEUE_STANDARD_NAME_LENGTH, MQUEUE_STANDARD_NAME_LENGTH - 1, - "/mq053_%d", LosCurTaskIDGet()); + snprintf(g_gqname, MQUEUE_STANDARD_NAME_LENGTH, "/mq053_%d", LosCurTaskIDGet()); attr.mq_msgsize = MQUEUE_STANDARD_NAME_LENGTH; attr.mq_maxmsg = MQUEUE_STANDARD_NAME_LENGTH; diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/smoke/It_posix_queue_062.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/smoke/It_posix_queue_062.cpp similarity index 94% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/smoke/It_posix_queue_062.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/smoke/It_posix_queue_062.cpp index 1b9cbd65..d1ecd7b2 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/mqueue/smoke/It_posix_queue_062.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/mqueue/smoke/It_posix_queue_062.cpp @@ -44,10 +44,8 @@ static UINT32 Testcase(VOID) mqueue = mq_open(mqname, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, NULL); ICUNIT_GOTO_NOT_EQUAL(mqueue, (mqd_t)-1, mqueue, EXIT1); - ret = memset_s(&mqstat1, sizeof(mqstat1), 0, sizeof(mqstat1)); - ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT); - ret = memset_s(&mqstat2, sizeof(mqstat2), 0, sizeof(mqstat2)); - ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT); + (void)memset_s(&mqstat1, sizeof(mqstat1), 0, sizeof(mqstat1)); + (void)memset_s(&mqstat2, sizeof(mqstat2), 0, sizeof(mqstat2)); ret = mq_getattr(mqueue, &mqstat1); ICUNIT_GOTO_EQUAL(ret, MQUEUE_NO_ERROR, ret, EXIT1); diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/It_posix_pthread.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/It_posix_pthread.h similarity index 98% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/It_posix_pthread.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/It_posix_pthread.h index 5639b799..e38f09e8 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/It_posix_pthread.h +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/It_posix_pthread.h @@ -56,7 +56,7 @@ #define TEST_HwiTrigger(HWI_NUM_TEST) #define LOS_TaskLock() #define LOS_TaskUnlock() -#define LOS_MS2Tick(ms) ((ms) / 10) +#define LOS_MS2Tick(ms) (ms / 10) #define OS_TASK_PRIORITY_HIGHEST 0 #define OS_TASK_PRIORITY_LOWEST 31 @@ -228,7 +228,12 @@ struct testdata { }; extern struct testdata g_td; + +extern unsigned int sleep(unsigned int seconds); +extern unsigned int alarm(unsigned int seconds); + extern int map_errno(UINT32 err); +extern long sysconf(int name); extern void posix_signal_start(void); VOID ScenarInit(VOID); diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/config.gni b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/config.gni similarity index 97% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/config.gni rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/config.gni index d09b57ad..c88062a5 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/config.gni +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/config.gni @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023 Huawei Device Co., Ltd. All rights reserved. +# Copyright (c) 2022-2022 Huawei Device Co., Ltd. All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: @@ -26,15 +26,14 @@ # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -import("//build/lite/config/test.gni") import("//kernel/liteos_a/testsuites/unittest/config.gni") -libc_posix_pthread_include_dirs = [ "$TEST_UNITTEST_DIR/libc/posix/pthread" ] +posix_pthread_include_dirs = [ "$TEST_UNITTEST_DIR/libc/posix/pthread" ] -libc_posix_pthread_sources_entry = +posix_pthread_sources_entry = [ "$TEST_UNITTEST_DIR/libc/posix/pthread/posix_pthread_test.cpp" ] -libc_posix_pthread_sources_smoke = [ +posix_pthread_sources_smoke = [ "$TEST_UNITTEST_DIR/libc/posix/pthread/smoke/It_posix_pthread_003.cpp", "$TEST_UNITTEST_DIR/libc/posix/pthread/smoke/It_posix_pthread_004.cpp", "$TEST_UNITTEST_DIR/libc/posix/pthread/smoke/It_posix_pthread_005.cpp", @@ -46,7 +45,7 @@ libc_posix_pthread_sources_smoke = [ "$TEST_UNITTEST_DIR/libc/posix/pthread/smoke/It_posix_pthread_022.cpp", ] -libc_posix_pthread_sources_full = [ +posix_pthread_sources_full = [ "$TEST_UNITTEST_DIR/libc/posix/pthread/full/It_posix_pthread_001.cpp", "$TEST_UNITTEST_DIR/libc/posix/pthread/full/It_posix_pthread_002.cpp", "$TEST_UNITTEST_DIR/libc/posix/pthread/full/It_posix_pthread_007.cpp", diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_001.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_001.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_001.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_001.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_002.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_002.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_002.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_002.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_007.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_007.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_007.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_007.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_010.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_010.cpp similarity index 95% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_010.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_010.cpp index bad03247..3811c72e 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_010.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_010.cpp @@ -34,9 +34,9 @@ static VOID *pthread_f01(void *argument) { g_testCount = pthread_self(); - pthread_exit(static_cast(8)); // 8: exit value for testing + pthread_exit((void *)8); - return static_cast(9); // 9: return value for testing + return (void *)9; } static UINT32 Testcase(VOID) { diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_011.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_011.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_011.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_011.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_013.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_013.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_013.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_013.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_023.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_023.cpp similarity index 89% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_023.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_023.cpp index b511ab00..3e70982d 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_023.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_023.cpp @@ -42,13 +42,12 @@ static VOID *pthread_f01(void *argument) { g_testCount++; - pthread_cleanup_push(PthreadCleanF01, static_cast(8)); // 8:arg that routine is called with - if (argument) { - return static_cast(8); // 8: return value for testing if argument is not NULL - } + pthread_cleanup_push(PthreadCleanF01, (void *)8); + if (argument) + return (void *)8; pthread_cleanup_pop(0); - return static_cast(9); // 9: return value for testing + return (void *)9; } static UINT32 Testcase(VOID) diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_025.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_025.cpp similarity index 91% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_025.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_025.cpp index d95411ec..64e0a318 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_025.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_025.cpp @@ -42,11 +42,11 @@ static VOID *pthread_f01(void *argument) { g_testCount++; - pthread_cleanup_push(PthreadCleanF01, static_cast(8)); // 8: arg that routine is called with - pthread_exit(static_cast(8)); // 8: exit value for testing + pthread_cleanup_push(PthreadCleanF01, (void *)8); + pthread_exit((void *)8); pthread_cleanup_pop(1); - return static_cast(9); // 9: return value for testing + return (void *)9; } static UINT32 Testcase(VOID) diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_026.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_026.cpp similarity index 94% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_026.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_026.cpp index d697f00e..82e204db 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_026.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_026.cpp @@ -43,11 +43,11 @@ static VOID *pthread_f01(void *argument) g_testCount++; LosTaskDelay(5); - pthread_cleanup_push(PthreadCleanF01, static_cast(8)); // 8: arg that routine is called with + pthread_cleanup_push(PthreadCleanF01, (void *)8); pthread_testcancel(); pthread_cleanup_pop(1); - return static_cast(9); // 9: return value for testing + return (void *)9; } static UINT32 Testcase(VOID) diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_027.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_027.cpp similarity index 88% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_027.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_027.cpp index 672af915..45c12c16 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_027.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_027.cpp @@ -46,13 +46,13 @@ static VOID *pthread_f01(void *argument) { g_testCount++; - pthread_cleanup_push(PthreadCleanF01, static_cast(9)); // 9: arg that routine is called with - pthread_cleanup_push(PthreadCleanF01, static_cast(8)); // 8: arg that routine is called with - pthread_exit(static_cast(8)); // 8: exit value for testing + pthread_cleanup_push(PthreadCleanF01, (void *)9); + pthread_cleanup_push(PthreadCleanF01, (void *)8); + pthread_exit((void *)8); pthread_cleanup_pop(1); pthread_cleanup_pop(1); - return static_cast(9); // 9: return value for testing + return (void *)9; } static UINT32 Testcase(VOID) diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_028.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_028.cpp similarity index 97% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_028.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_028.cpp index ec9d9b20..5a7a5363 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_028.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_028.cpp @@ -34,7 +34,7 @@ static VOID *pthread_f01(void *argument) { g_testCount++; - return static_cast(9); // 9: return value for testing + return (void *)9; } static UINT32 Testcase(VOID) diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_029.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_029.cpp similarity index 94% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_029.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_029.cpp index fa868f16..bfebb8df 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_029.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_029.cpp @@ -34,8 +34,8 @@ static VOID *pthread_f01(void *argument) { g_testCount++; - pthread_exit(static_cast(8)); // 8: exit value for testing - return static_cast(9); // 9: return value for testing + pthread_exit((void *)8); + return (void *)9; } static UINT32 Testcase(VOID) { diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_030.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_030.cpp similarity index 97% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_030.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_030.cpp index e068b11a..6d7e9153 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_030.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_030.cpp @@ -37,7 +37,7 @@ static VOID *pthread_f01(void *argument) pthread_testcancel(); g_testCount++; - return static_cast(9); // 9: return value for testing + return (void *)9; } static UINT32 Testcase(VOID) { diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_031.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_031.cpp similarity index 97% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_031.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_031.cpp index bed89e0c..45523f26 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_031.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_031.cpp @@ -39,7 +39,7 @@ static VOID *pthread_f01(void *argument) ret = pthread_join(g_newTh, NULL); ICUNIT_GOTO_NOT_EQUAL(ret, 0, ret, EXIT); EXIT: - return static_cast(9); // 9: return value for testing + return (void *)9; } static UINT32 Testcase(VOID) diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_034.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_034.cpp similarity index 94% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_034.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_034.cpp index 4715817d..c3596f47 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_034.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_034.cpp @@ -43,7 +43,7 @@ static VOID *pthread_f01(void *argument) g_testCount++; ICUNIT_GOTO_EQUAL(g_testCount, 1, g_testCount, EXIT); EXIT: - return static_cast(9); // 9: return value for testing + return (void *)9; } static VOID *pthread_f02(void *argument) @@ -59,7 +59,7 @@ static VOID *pthread_f02(void *argument) g_testCount++; ICUNIT_GOTO_EQUAL(g_testCount, 2, g_testCount, EXIT); EXIT: - return static_cast(8); // 8: return value for testing + return (void *)8; } static VOID *PthreadF03(void *argument) @@ -76,7 +76,7 @@ static VOID *PthreadF03(void *argument) ICUNIT_GOTO_EQUAL(g_testCount, 3, g_testCount, EXIT); EXIT: - return static_cast(7); // 7: return value for testing + return (void *)7; } static UINT32 Testcase(VOID) diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_035.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_035.cpp similarity index 93% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_035.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_035.cpp index 0269a7a6..8f7c8b62 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_035.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_035.cpp @@ -47,7 +47,7 @@ static VOID *pthread_f01(void *argument) g_testCnt1++; ICUNIT_GOTO_EQUAL(g_testCnt1, 4, g_testCnt1, EXIT); EXIT: - return reinterpret_cast(9); // 9: return value for testing + return (void *)9; } static VOID *pthread_f02(void *argument) @@ -67,7 +67,7 @@ static VOID *pthread_f02(void *argument) g_testCnt1++; ICUNIT_GOTO_EQUAL(g_testCnt1, 5, g_testCnt1, EXIT); EXIT: - return reinterpret_cast(8); // 8:return value for testing + return (void *)8; } static VOID *PthreadF03(void *argument) @@ -88,7 +88,7 @@ static VOID *PthreadF03(void *argument) ICUNIT_GOTO_EQUAL(g_testCnt1, 6, g_testCnt1, EXIT); EXIT: - return reinterpret_cast(7); // 7: return value for testing + return (void *)7; } static UINT32 Testcase(VOID) { @@ -108,9 +108,8 @@ static UINT32 Testcase(VOID) ret = pthread_create(&newTh3, NULL, PthreadF03, NULL); ICUNIT_ASSERT_EQUAL(ret, 0, ret); - while (g_testCnt1 < 6) { // 6: threshold for calling sleep + while (g_testCnt1 < 6) sleep(1); - } ICUNIT_ASSERT_EQUAL(g_testCnt1, 6, g_testCnt1); diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_039.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_039.cpp similarity index 97% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_039.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_039.cpp index 82b9d593..1acba6f0 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_039.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_039.cpp @@ -36,7 +36,7 @@ static VOID *PthreadF01(void *argument) LosTaskDelay(2); pthread_testcancel(); g_testCount++; - return static_cast(9); // 9: return value for testing + return (void *)9; } static UINT32 Testcase(VOID) diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_040.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_040.cpp similarity index 97% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_040.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_040.cpp index 55ee8bc0..1da332ef 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_040.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_040.cpp @@ -36,7 +36,7 @@ static VOID *pthread_f01(void *argument) LosTaskDelay(2); g_testCount++; - return static_cast(9); // 9: return value for testing + return (void *)9; } static UINT32 Testcase(VOID) { diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_042.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_042.cpp similarity index 98% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_042.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_042.cpp index 08aa7c36..1191d6d5 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_042.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_042.cpp @@ -36,7 +36,7 @@ static VOID *pthread_f01(void *argument) LosTaskDelay(2); g_testCount++; - return static_cast(9); // 9: return value for testing + return (void *)9; } static UINT32 Testcase(VOID) { diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_044.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_044.cpp similarity index 97% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_044.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_044.cpp index 420b723d..35e76fe0 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_044.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_044.cpp @@ -47,7 +47,7 @@ static VOID *pthread_f02(void *argument) ICUNIT_GOTO_EQUAL(param.sched_priority, 3, param.sched_priority, EXIT); EXIT: - return static_cast(9); // 9: return value for testing + return (void *)9; } static VOID *pthread_f01(void *argument) @@ -89,7 +89,7 @@ static VOID *pthread_f01(void *argument) ret = pthread_attr_destroy(&attr); ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT); EXIT: - return static_cast(9); // 9: return value for testing + return (void *)9; } static UINT32 Testcase(VOID) { diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_045.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_045.cpp similarity index 97% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_045.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_045.cpp index f6a32df4..beed4406 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_045.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_045.cpp @@ -39,7 +39,7 @@ static VOID *pthread_f01(void *argument) g_testCount++; EXIT: - return static_cast(9); // 9: return value for testing + return (void *)9; } static UINT32 Testcase(VOID) diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_046.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_046.cpp similarity index 97% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_046.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_046.cpp index 06998e72..775c3061 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_046.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_046.cpp @@ -37,7 +37,7 @@ static VOID *pthread_f01(void *argument) g_testCount++; EXIT: - return static_cast(9); // 9: return value for testing + return (void *)9; } static UINT32 Testcase(VOID) diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_051.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_051.cpp similarity index 97% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_051.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_051.cpp index 97a9c0c3..106beb18 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_051.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_051.cpp @@ -49,7 +49,7 @@ static VOID *pthread_f01(void *argument) ICUNIT_GOTO_EQUAL(g_testCount, 2, g_testCount, EXIT); // not reachable EXIT: - return static_cast(9); // 9: return value for testing + return (void *)9; } static UINT32 Testcase(VOID) { diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_052.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_052.cpp similarity index 95% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_052.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_052.cpp index 580564f7..29edfdc8 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_052.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_052.cpp @@ -53,7 +53,7 @@ static VOID *pthread_f01(void *argument) g_testCount++; ICUNIT_GOTO_EQUAL(g_testCount, 4, g_testCount, EXIT); EXIT: - return static_cast(9); // 9: return value for testing + return (void *)9; } static VOID *pthread_f02(void *argument) @@ -79,7 +79,7 @@ static VOID *pthread_f02(void *argument) g_testCount++; ICUNIT_GOTO_EQUAL(g_testCount, 6, g_testCount, EXIT); EXIT: - return static_cast(8); // 8: return value for testing + return (void *)8; } static VOID *PthreadF03(void *argument) @@ -107,7 +107,7 @@ static VOID *PthreadF03(void *argument) ICUNIT_GOTO_EQUAL(g_testCount, 8, g_testCount, EXIT); EXIT: - return static_cast(7); // 7: return value for testing + return (void *)7; } static void PthreadKeyF01(void *threadLog) diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_053.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_053.cpp similarity index 97% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_053.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_053.cpp index deef9174..4ab4aed4 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_053.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_053.cpp @@ -71,7 +71,7 @@ static VOID *pthread_f01(void *argument) g_testCount++; ICUNIT_GOTO_EQUAL(g_testCount, 2, g_testCount, EXIT); EXIT: - return static_cast(9); // 9: return value for testing + return (void *)9; } static VOID *pthread_f02(void *argument) @@ -115,7 +115,7 @@ static VOID *pthread_f02(void *argument) g_testCount++; ICUNIT_GOTO_EQUAL(g_testCount, 7, g_testCount, EXIT); EXIT: - return static_cast(8); // 8: return value for testing + return (void *)8; } static void PthreadKeyF01(void *threadLog) { diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_054.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_054.cpp similarity index 95% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_054.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_054.cpp index 0c202abe..7d3a39e9 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_054.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_054.cpp @@ -49,9 +49,9 @@ static VOID *pthread_f01(void *argument) g_testCount++; ICUNIT_GOTO_EQUAL(g_testCount, 2, g_testCount, EXIT); - pthread_exit(static_cast(7)); // 7: exit value for testing + pthread_exit((void *)7); EXIT: - return static_cast(9); // 9: return value for testing + return (void *)9; } static void PthreadKeyF01(void *threadLog) diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_055.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_055.cpp similarity index 97% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_055.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_055.cpp index a0c9e68b..2302bb08 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_055.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_055.cpp @@ -51,7 +51,7 @@ static VOID *pthread_f01(void *argument) pthread_testcancel(); EXIT: - return static_cast(9); // 9: return value for testing + return (void *)9; } static void PthreadKeyF01(void *threadLog) diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_057.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_057.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_057.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_057.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_059.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_059.cpp similarity index 97% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_059.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_059.cpp index 354be5ad..925c3f10 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_059.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_059.cpp @@ -41,7 +41,7 @@ static VOID *pthread_f01(void *argument) ICUNIT_GOTO_EQUAL(g_testCount, 1, g_testCount, EXIT); // failed, =2 EXIT: - return static_cast(9); // 9: return value for testing + return (void *)9; } static UINT32 Testcase(VOID) diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_060.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_060.cpp similarity index 95% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_060.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_060.cpp index d55ad834..4a4e8f6e 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_060.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_060.cpp @@ -33,7 +33,7 @@ static VOID *pthread_f02(void *argument) { g_testCount++; - return static_cast(8); // 8: return value for testing + return (void *)8; } static VOID *pthread_f01(void *argument) { @@ -54,7 +54,7 @@ static VOID *pthread_f01(void *argument) ICUNIT_GOTO_EQUAL(g_testCount, 1, g_testCount, EXIT); EXIT: - return static_cast(9); // 9: return value for testing + return (void *)9; } static UINT32 Testcase(VOID) diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_061.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_061.cpp similarity index 97% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_061.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_061.cpp index 9d4d3626..2a3aa5d8 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_061.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_061.cpp @@ -50,7 +50,7 @@ static VOID *pthread_f01(void *argument) ICUNIT_GOTO_EQUAL(g_testCount, 1, g_testCount, EXIT); EXIT: - return static_cast(9); // 9: return value for testing + return (void *)9; } static UINT32 Testcase(VOID) { diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_062.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_062.cpp similarity index 97% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_062.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_062.cpp index db359dff..af3e0f6a 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_062.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_062.cpp @@ -45,7 +45,7 @@ static VOID *pthread_f01(void *argument) ICUNIT_GOTO_EQUAL(g_testCount, 1, g_testCount, EXIT); EXIT: - return static_cast(9); // 9: return value for testing + return (void *)9; } static UINT32 Testcase(VOID) diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_063.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_063.cpp similarity index 97% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_063.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_063.cpp index 25126319..75be1055 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_063.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_063.cpp @@ -51,7 +51,7 @@ static VOID *pthread_f01(void *argument) ICUNIT_GOTO_EQUAL(g_testCount, 0, g_testCount, EXIT); EXIT: - return static_cast(9); // 9: return value for testing + return (void *)9; } static UINT32 Testcase(VOID) { diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_064.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_064.cpp similarity index 97% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_064.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_064.cpp index b9a7154c..881e3380 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_064.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_064.cpp @@ -52,7 +52,7 @@ static VOID *pthread_f01(void *argument) ICUNIT_GOTO_EQUAL(g_testCount, 3, g_testCount, EXIT); EXIT: - return reinterpret_cast(9); // 9: return value for testing + return (void *)9; } static UINT32 Testcase(VOID) { diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_066.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_066.cpp similarity index 96% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_066.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_066.cpp index 3682f508..193faba3 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_066.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_066.cpp @@ -44,7 +44,7 @@ static VOID *pthread_f02(void *argument) ICUNIT_GOTO_EQUAL(g_testCount, 2, g_testCount, EXIT); EXIT: - return static_cast(9); // 9: return value for testing + return (void *)9; } static VOID *pthread_f01(void *argument) @@ -86,7 +86,7 @@ static VOID *pthread_f01(void *argument) ICUNIT_GOTO_EQUAL(g_testCount, 4, g_testCount, EXIT); #endif EXIT: - return static_cast(9); // 9: return value for testing + return (void *)9; } static UINT32 Testcase(VOID) diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_069.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_069.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_069.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_069.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_070.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_070.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_070.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_070.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_071.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_071.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_071.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_071.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_072.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_072.cpp similarity index 94% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_072.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_072.cpp index 9d8141be..b6e5efd8 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_072.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_072.cpp @@ -34,6 +34,7 @@ static void *pthread_f01(void *tmp) { int rc = 0; g_testCount++; + // printf("www\n"); /* acquire the mutex */ rc = pthread_mutex_lock(&g_pthreadMutexTest1); @@ -68,7 +69,7 @@ static UINT32 Testcase(VOID) /* Let the other thread run */ LosTaskDelay(2); - ICUNIT_ASSERT_EQUAL(g_testCount, 2, g_testCount); // 2: expected value of g_testCount + ICUNIT_ASSERT_EQUAL(g_testCount, 2, g_testCount); /* Try to destroy the cond var. This should return an error */ rc = pthread_cond_destroy(&g_pthreadCondTest1); @@ -78,7 +79,7 @@ static UINT32 Testcase(VOID) ICUNIT_ASSERT_EQUAL(rc, 0, rc); LosTaskDelay(2); - ICUNIT_ASSERT_EQUAL(g_testCount, 4, g_testCount); // 4: expected value of g_testCount + ICUNIT_ASSERT_EQUAL(g_testCount, 4, g_testCount); rc = pthread_cond_destroy(&g_pthreadCondTest1); ICUNIT_ASSERT_EQUAL(rc, 0, rc); diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_073.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_073.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_073.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_073.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_074.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_074.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_074.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_074.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_078.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_078.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_078.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_078.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_079.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_079.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_079.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_079.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_080.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_080.cpp similarity index 98% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_080.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_080.cpp index 89e876c3..e350881d 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_080.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_080.cpp @@ -69,9 +69,8 @@ static UINT32 Testcase(VOID) ICUNIT_ASSERT_EQUAL(rc, 0, rc); } - while (g_startNum < THREAD_NUM) { + while (g_startNum < THREAD_NUM) usleep(1000 * 10 * 2); - } /* * Acquire the mutex to make sure that all waiters are currently diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_081.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_081.cpp similarity index 98% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_081.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_081.cpp index e25b699f..eda2a34f 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_081.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_081.cpp @@ -74,9 +74,8 @@ static UINT32 Testcase(VOID) ICUNIT_ASSERT_EQUAL(rc, 0, rc); } - while (g_startNum < THREAD_NUM) { + while (g_startNum < THREAD_NUM) usleep(1000 * 10 * 2); - } /* * Acquire the mutex to make sure that all waiters are currently * blocked on pthread_cond_wait diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_082.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_082.cpp similarity index 98% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_082.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_082.cpp index 80d08c51..9cd04309 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_082.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_082.cpp @@ -81,9 +81,8 @@ static UINT32 Testcase(VOID) ICUNIT_ASSERT_EQUAL(rc, 0, rc); } - while (g_startNum < THREAD_NUM) { + while (g_startNum < THREAD_NUM) usleep(1000 * 10 * 2); - } /* * Acquire the mutex to make sure that all waiters are currently diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_083.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_083.cpp similarity index 98% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_083.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_083.cpp index f1fba762..6e5fd3c6 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_083.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_083.cpp @@ -70,9 +70,8 @@ static UINT32 Testcase(VOID) ICUNIT_ASSERT_EQUAL(rc, 0, rc); } - while (g_startNum < THREAD_NUM) { + while (g_startNum < THREAD_NUM) usleep(1000 * 10 * 2); - } /* * Acquire the mutex to make sure that all waiters are currently diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_084.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_084.cpp similarity index 98% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_084.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_084.cpp index 2fdb5a98..b8058e23 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_084.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_084.cpp @@ -73,9 +73,8 @@ static UINT32 Testcase(VOID) ICUNIT_ASSERT_EQUAL(rc, 0, rc); } - while (g_startNum < THREAD_NUM) { + while (g_startNum < THREAD_NUM) usleep(1000 * 10 * 2); - } /* * Acquire the mutex to make sure that all waiters are currently diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_085.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_085.cpp similarity index 98% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_085.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_085.cpp index 9ea91457..83962c15 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_085.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_085.cpp @@ -68,9 +68,8 @@ static UINT32 Testcase(VOID) rc = pthread_create(&thread1, NULL, pthread_f01, NULL); ICUNIT_ASSERT_EQUAL(rc, 0, rc); - while (!g_t1Start) { /* wait for thread1 started */ + while (!g_t1Start) /* wait for thread1 started */ usleep(1000 * 10 * 2); - } /* acquire the mutex released by pthread_cond_wait() within thread 1 */ rc = pthread_mutex_lock(&g_td.mutex); diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_087.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_087.cpp similarity index 93% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_087.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_087.cpp index 40c0e390..0cf58da4 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_087.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_087.cpp @@ -57,7 +57,7 @@ static void *pthread_f01(void *arg) rc = pthread_mutex_unlock(&g_td.mutex); ICUNIT_GOTO_EQUAL(rc, 0, rc, EXIT); EXIT: - pthread_exit(static_cast(5)); // 5: return value for testing + pthread_exit((void *)5); } static UINT32 Testcase(VOID) @@ -78,9 +78,9 @@ static UINT32 Testcase(VOID) rc = pthread_create(&thread1, NULL, pthread_f01, NULL); ICUNIT_ASSERT_EQUAL(rc, 0, rc); - while (!g_t1Start) { /* wait for thread1 started */ + while (!g_t1Start) /* wait for thread1 started */ usleep(1000 * 10 * 2); - } + /* acquire the mutex released by pthread_cond_wait() within thread 1 */ rc = pthread_mutex_lock(&g_td.mutex); @@ -92,7 +92,7 @@ static UINT32 Testcase(VOID) g_signaled = 1; rc = pthread_join(thread1, &thRet); ICUNIT_ASSERT_EQUAL(rc, 0, rc); - ICUNIT_ASSERT_EQUAL(static_cast(thRet), 5, static_cast(thRet)); // 5: return value for testing + ICUNIT_ASSERT_EQUAL((long)thRet, 5, (long)thRet); g_signaled = 0; rc = pthread_cond_destroy(&g_td.cond); diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_088.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_088.cpp similarity index 98% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_088.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_088.cpp index 875f7a64..7b04f642 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_088.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_088.cpp @@ -108,9 +108,8 @@ static void *pthread_f02(void *tmp) clock_gettime(CLOCK_REALTIME, &startTime); while (1) { clock_gettime(CLOCK_REALTIME, ¤tTime); - if (PthreadTimeF01(currentTime, startTime) > RUNTIME) { + if (PthreadTimeF01(currentTime, startTime) > RUNTIME) break; - } } g_lowDone = 1; EXIT: diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_089.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_089.cpp similarity index 98% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_089.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_089.cpp index f0714dc9..ef7cf044 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_089.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_089.cpp @@ -111,9 +111,8 @@ static void *pthread_f02(void *tmp) clock_gettime(CLOCK_REALTIME, &startTime); while (1) { clock_gettime(CLOCK_REALTIME, ¤tTime); - if (PthreadTimeF01(currentTime, startTime) > RUNTIME) { + if (PthreadTimeF01(currentTime, startTime) > RUNTIME) break; - } } g_lowDone = 1; EXIT: diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_090.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_090.cpp similarity index 98% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_090.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_090.cpp index 645d4e32..e65fa951 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_090.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_090.cpp @@ -40,9 +40,8 @@ static void *pthread_f01(void *arg) ICUNIT_GOTO_EQUAL(rc, 0, rc, EXIT); g_startNum++; - if (g_startNum > 5) { // 5: threshold for calling usleep + if (g_startNum > 5) usleep(1000 * 10 * 2); - } printf("pthread start_num: %d \n", g_startNum); rc = pthread_cond_wait(&g_td.cond, &g_td.mutex); diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_091.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_091.cpp similarity index 96% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_091.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_091.cpp index 477509bc..c648c05f 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_091.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_091.cpp @@ -48,7 +48,7 @@ static VOID *pthread_f01(void *argument) ICUNIT_GOTO_EQUAL(g_testCount, 1, g_testCount, EXIT); EXIT: - return reinterpret_cast(9); // 9: return value for testing + return (void *)9; } static VOID *pthread_f02(void *argument) @@ -72,7 +72,7 @@ static VOID *pthread_f02(void *argument) printf("11\n"); ICUNIT_GOTO_EQUAL(g_testCount, 2, g_testCount, EXIT); // failed , =3 EXIT: - return static_cast(9); // 9: return value for testing + return (void *)9; } static UINT32 Testcase(VOID) { diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_092.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_092.cpp similarity index 98% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_092.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_092.cpp index 5f22c11d..b1e0f69b 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_092.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_092.cpp @@ -42,9 +42,8 @@ static void *pthread_f01(void *arg) ICUNIT_GOTO_EQUAL(rc, 0, rc, EXIT); g_startNum++; - if (g_startNum > 5) { // 5: threshold for calling usleep + if (g_startNum > 5) usleep(1000 * 10 * 2); - } printf("pthread start_num: %d \n", g_startNum); rc = pthread_cond_wait(&g_td.cond, &g_td.mutex); diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_094.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_094.cpp similarity index 96% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_094.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_094.cpp index a6a18431..b49d3870 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_094.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_094.cpp @@ -45,7 +45,7 @@ static VOID *pthread_f02(void *argument) ICUNIT_GOTO_EQUAL(g_testCount, 3, g_testCount, EXIT); g_testCount++; EXIT: - return static_cast(9); // 9: return value for testing + return (void *)9; } static VOID *pthread_f01(void *argument) @@ -75,7 +75,7 @@ static VOID *pthread_f01(void *argument) g_testCount++; EXIT: - return static_cast(9); // 9: return value for testing + return (void *)9; } static UINT32 Testcase(VOID) diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_095.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_095.cpp similarity index 96% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_095.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_095.cpp index b1bcff37..9a67603b 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_095.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_095.cpp @@ -50,7 +50,7 @@ static VOID *pthread_f02(void *argument) g_testCnt1++; EXIT: - return reinterpret_cast(9); // 9: return value for testing + return (void *)9; } static VOID *pthread_f01(void *argument) @@ -83,7 +83,7 @@ static VOID *pthread_f01(void *argument) g_testCnt1++; EXIT: - return static_cast(9); // 9: return value for testing + return (void *)9; } static UINT32 Testcase(VOID) diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_106.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_106.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_106.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_106.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_107.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_107.cpp similarity index 88% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_107.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_107.cpp index 0f57cf6a..9578c6c4 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_107.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_107.cpp @@ -32,7 +32,7 @@ static VOID *pthread_f01(void *t) { - long myId = static_cast(t); + long myId = (long)t; int rc; rc = pthread_mutex_lock(&g_pthreadMutexTest1); @@ -58,7 +58,7 @@ EXIT: static VOID *pthread_f02(void *t) { int i; - long myId = static_cast(t); + long myId = (long)t; int rc; ICUNIT_GOTO_EQUAL(g_testCount, 1, g_testCount, EXIT); @@ -74,7 +74,7 @@ static VOID *pthread_f02(void *t) ICUNIT_GOTO_EQUAL(g_testCount, 4, g_testCount, EXIT); g_testCount++; - rc = pthread_mutex_unlock(&g_pthreadMutexTest1); /* Ϊ�߳���ѯ������������ʱ */ + rc = pthread_mutex_unlock(&g_pthreadMutexTest1); /* Ϊ߳ѯʱ */ ICUNIT_GOTO_EQUAL(rc, 0, rc, EXIT); LosTaskDelay(2); @@ -87,11 +87,11 @@ static UINT32 Testcase(VOID) long t1 = 1, t2 = 2, t3 = 3; int rc; pthread_t threads[3]; - pthread_attr_t attr; /* ��ʼ���������������������� */ + pthread_attr_t attr; /* ʼ */ g_testCount = 0; pthread_mutex_init(&g_pthreadMutexTest1, NULL); - pthread_cond_init(&g_pthreadCondTest1, NULL); /* �����߳�ʱ��Ϊ������״̬��������ֲ */ + pthread_cond_init(&g_pthreadCondTest1, NULL); /* ߳ʱΪ״ֲ̬ */ pthread_attr_init(&attr); rc = pthread_create(&threads[0], &attr, pthread_f01, (void *)t1); @@ -101,13 +101,13 @@ static UINT32 Testcase(VOID) ICUNIT_ASSERT_EQUAL(rc, 0, rc); - /* �ȴ������߳���� */ + /* ȴ߳ */ for (i = 0; i < 2; i++) { rc = pthread_join(threads[i], NULL); ICUNIT_ASSERT_EQUAL(rc, 0, rc); } - /* ������˳� */ + /* ˳ */ rc = pthread_attr_destroy(&attr); ICUNIT_ASSERT_EQUAL(rc, 0, rc); diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_116.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_116.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_116.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_116.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_123.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_123.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_123.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_123.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_124.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_124.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_124.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_124.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_125.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_125.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_125.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_125.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_127.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_127.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_127.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_127.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_129.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_129.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_129.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_129.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_132.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_132.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_132.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_132.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_133.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_133.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_133.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_133.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_134.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_134.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_134.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_134.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_136.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_136.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_136.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_136.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_138.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_138.cpp similarity index 95% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_138.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_138.cpp index 322c6ae4..b41056a3 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_138.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_138.cpp @@ -51,9 +51,8 @@ static UINT32 Testcase(VOID) ICUNIT_ASSERT_EQUAL(ret, PTHREAD_NO_ERROR, ret); /* Make sure the thread was created before we join it. */ - while (g_pthreadSem == PTHREAD_INTHREAD_TEST) { + while (g_pthreadSem == PTHREAD_INTHREAD_TEST) sleep(1); - } ret = pthread_join(newTh, &valuePtr); ICUNIT_ASSERT_EQUAL(ret, PTHREAD_NO_ERROR, ret); @@ -61,7 +60,7 @@ static UINT32 Testcase(VOID) /* * Check to make sure that 'value_ptr' that was passed to * pthread_join() and the pthread_exit() return code that - * was used in the thread function are the same. + * was used in the thread funciton are the same. */ ICUNIT_ASSERT_EQUAL(valuePtr, PTHREAD_EXIT_VALUE, errno); diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_141.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_141.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_141.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_141.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_142.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_142.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_142.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_142.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_144.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_144.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_144.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_144.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_152.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_152.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_152.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_152.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_154.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_154.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_154.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_154.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_166.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_166.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_166.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_166.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_167.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_167.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_167.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_167.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_173.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_173.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_173.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_173.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_175.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_175.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_175.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_175.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_176.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_176.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_176.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_176.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_177.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_177.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_177.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_177.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_182.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_182.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_182.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_182.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_185.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_185.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_185.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_185.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_186.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_186.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_186.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_186.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_187.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_187.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_187.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_187.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_188.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_188.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_188.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_188.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_193.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_193.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_193.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_193.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_194.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_194.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_194.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_194.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_200.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_200.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_200.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_200.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_203.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_203.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_203.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_203.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_204.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_204.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_204.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_204.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_205.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_205.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_205.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_205.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_206.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_206.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_206.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_206.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_209.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_209.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_209.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_209.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_213.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_213.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_213.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_213.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_217.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_217.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_217.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_217.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_218.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_218.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_218.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_218.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_219.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_219.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_219.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_219.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_221.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_221.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_221.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_221.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_224.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_224.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_224.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_224.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_226.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_226.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_226.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_226.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_233.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_233.cpp similarity index 98% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_233.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_233.cpp index 09619dfc..b552fdb1 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_233.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_233.cpp @@ -52,9 +52,8 @@ static VOID *pthread_f01(VOID *tmp) g_pthreadSem = 1; - while (1) { + while (1) sleep(5); - } return NULL; } @@ -70,9 +69,8 @@ static UINT32 Testcase(VOID) ret = pthread_create(&newTh, NULL, pthread_f01, NULL); ICUNIT_ASSERT_EQUAL(ret, PTHREAD_NO_ERROR, ret); - while (g_pthreadSem == 0) { + while (g_pthreadSem == 0) sleep(1); - } ret = pthread_cancel(newTh); ICUNIT_ASSERT_EQUAL(ret, PTHREAD_NO_ERROR, ret); diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_238.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_238.cpp similarity index 96% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_238.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_238.cpp index d07bb99e..1de43f21 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_238.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_238.cpp @@ -44,9 +44,8 @@ static VOID *pthread_f01(VOID *argument) g_pthreadSem = PTHREAD_INMAIN_TEST; - while (g_pthreadSem == PTHREAD_INMAIN_TEST) { + while (g_pthreadSem == PTHREAD_INMAIN_TEST) sleep(1); - } pthread_testcancel(); @@ -67,9 +66,8 @@ static UINT32 Testcase(VOID) ret = pthread_create(&newTh, NULL, pthread_f01, NULL); ICUNIT_ASSERT_EQUAL(ret, PTHREAD_NO_ERROR, ret); - while (g_pthreadSem == PTHREAD_INTHREAD_TEST) { + while (g_pthreadSem == PTHREAD_INTHREAD_TEST) sleep(1); - } ret = pthread_cancel(newTh); ICUNIT_ASSERT_EQUAL(ret, PTHREAD_NO_ERROR, ret); diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_239.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_239.cpp similarity index 96% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_239.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_239.cpp index a40642ca..db32e99f 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_239.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_239.cpp @@ -41,9 +41,8 @@ static VOID *pthread_f01(VOID *argument) g_pthreadSem = PTHREAD_INMAIN_TEST; - while (g_pthreadSem == PTHREAD_INMAIN_TEST) { + while (g_pthreadSem == PTHREAD_INMAIN_TEST) sleep(1); - } pthread_testcancel(); @@ -63,9 +62,8 @@ static UINT32 Testcase(VOID) ret = pthread_create(&newTh, NULL, pthread_f01, NULL); ICUNIT_ASSERT_EQUAL(ret, PTHREAD_NO_ERROR, ret); - while (g_pthreadSem == PTHREAD_INTHREAD_TEST) { + while (g_pthreadSem == PTHREAD_INTHREAD_TEST) sleep(1); - } ret = pthread_cancel(newTh); ICUNIT_ASSERT_EQUAL(ret, PTHREAD_NO_ERROR, ret); diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_240.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_240.cpp similarity index 96% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_240.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_240.cpp index 77ea3fdc..b35e1677 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_240.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_240.cpp @@ -41,9 +41,8 @@ static VOID *pthread_f01(VOID *argument) g_pthreadSem = PTHREAD_INMAIN_TEST; - while (g_pthreadSem == PTHREAD_INMAIN_TEST) { + while (g_pthreadSem == PTHREAD_INMAIN_TEST) sleep(1); - } pthread_testcancel(); @@ -64,9 +63,8 @@ static UINT32 Testcase(VOID) ret = pthread_create(&newTh, NULL, pthread_f01, NULL); ICUNIT_ASSERT_EQUAL(ret, PTHREAD_NO_ERROR, ret); - while (g_pthreadSem == PTHREAD_INTHREAD_TEST) { + while (g_pthreadSem == PTHREAD_INTHREAD_TEST) sleep(1); - } ret = pthread_cancel(newTh); ICUNIT_ASSERT_EQUAL(ret, PTHREAD_NO_ERROR, ret); diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_241.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_241.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_241.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/full/It_posix_pthread_241.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/posix_pthread_test.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/posix_pthread_test.cpp similarity index 95% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/posix_pthread_test.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/posix_pthread_test.cpp index b9bc707b..53562068 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/posix_pthread_test.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/posix_pthread_test.cpp @@ -62,24 +62,24 @@ sem_t g_pthreadSem1; sem_t g_pthreadSem2; __scenario g_scenarii[] = { - CASE_POS(0, 0, 0, 0, 0, 0, 0, 0, const_cast("default")), - CASE_POS(1, 0, 0, 0, 0, 0, 0, 0, const_cast("detached")), - CASE_POS(0, 1, 0, 0, 0, 0, 0, 0, const_cast("Explicit sched")), - CASE_UNK(0, 0, 1, 0, 0, 0, 0, 0, const_cast("FIFO Policy")), - CASE_UNK(0, 0, 2, 0, 0, 0, 0, 0, const_cast("RR Policy")), - CASE_UNK(0, 0, 0, 1, 0, 0, 0, 0, const_cast("Max sched param")), - CASE_UNK(0, 0, 0, -1, 0, 0, 0, 0, const_cast("Min sched param")), - CASE_POS(0, 0, 0, 0, 1, 0, 0, 0, const_cast("Alternative contension scope")), - CASE_POS(0, 0, 0, 0, 0, 1, 0, 0, const_cast("Alternative stack")), - CASE_POS(0, 0, 0, 0, 0, 0, 1, 0, const_cast("No guard size")), - CASE_UNK(0, 0, 0, 0, 0, 0, 2, 0, const_cast("1p guard size")), - CASE_POS(0, 0, 0, 0, 0, 0, 0, 1, const_cast("Min stack size")), + CASE_POS(0, 0, 0, 0, 0, 0, 0, 0, (char *)"default"), + CASE_POS(1, 0, 0, 0, 0, 0, 0, 0, (char *)"detached"), + CASE_POS(0, 1, 0, 0, 0, 0, 0, 0, (char *)"Explicit sched"), + CASE_UNK(0, 0, 1, 0, 0, 0, 0, 0, (char *)"FIFO Policy"), + CASE_UNK(0, 0, 2, 0, 0, 0, 0, 0, (char *)"RR Policy"), + CASE_UNK(0, 0, 0, 1, 0, 0, 0, 0, (char *)"Max sched param"), + CASE_UNK(0, 0, 0, -1, 0, 0, 0, 0, (char *)"Min sched param"), + CASE_POS(0, 0, 0, 0, 1, 0, 0, 0, (char *)"Alternative contension scope"), + CASE_POS(0, 0, 0, 0, 0, 1, 0, 0, (char *)"Alternative stack"), + CASE_POS(0, 0, 0, 0, 0, 0, 1, 0, (char *)"No guard size"), + CASE_UNK(0, 0, 0, 0, 0, 0, 2, 0, (char *)"1p guard size"), + CASE_POS(0, 0, 0, 0, 0, 0, 0, 1, (char *)"Min stack size"), /* Stack play */ - CASE_POS(0, 0, 0, 0, 0, 0, 1, 1, const_cast("Min stack size, no guard")), - CASE_UNK(0, 0, 0, 0, 0, 0, 2, 1, const_cast("Min stack size, 1p guard")), - CASE_POS(1, 0, 0, 0, 0, 1, 0, 0, const_cast("Detached, Alternative stack")), - CASE_POS(1, 0, 0, 0, 0, 0, 1, 1, const_cast("Detached, Min stack size, no guard")), - CASE_UNK(1, 0, 0, 0, 0, 0, 2, 1, const_cast("Detached, Min stack size, 1p guard")), + CASE_POS(0, 0, 0, 0, 0, 0, 1, 1, (char *)"Min stack size, no guard"), + CASE_UNK(0, 0, 0, 0, 0, 0, 2, 1, (char *)"Min stack size, 1p guard"), + CASE_POS(1, 0, 0, 0, 0, 1, 0, 0, (char *)"Detached, Alternative stack"), + CASE_POS(1, 0, 0, 0, 0, 0, 1, 1, (char *)"Detached, Min stack size, no guard"), + CASE_UNK(1, 0, 0, 0, 0, 0, 2, 1, (char *)"Detached, Min stack size, 1p guard"), }; pthread_t g_pthreadTestTh; diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/smoke/It_posix_pthread_003.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/smoke/It_posix_pthread_003.cpp similarity index 89% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/smoke/It_posix_pthread_003.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/smoke/It_posix_pthread_003.cpp index 9cd44b50..001d1c6b 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/smoke/It_posix_pthread_003.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/smoke/It_posix_pthread_003.cpp @@ -51,6 +51,10 @@ static UINT32 Testcase(VOID) tmp = pthread_equal(a, b); + // pthread_join(a, NULL); + + // pthread_detach(a); + pthread_attr_init(&aa); pthread_attr_getdetachstate(&aa, &detachstate); @@ -59,6 +63,19 @@ static UINT32 Testcase(VOID) pthread_attr_destroy(&aa); + // pthread_mutex_init(&c, NULL); + + // pthread_mutex_destroy(&c); + + // pthread_mutex_lock(&c); + + // pthread_mutex_trylock(&c); + + // pthread_mutex_unlock(&c); + + // pthread_mutexattr_init(&c); + + // pthread_mutexattr_destroy(&c); ret = pthread_join(aThread, NULL); ICUNIT_ASSERT_EQUAL(ret, 0, ret); diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/smoke/It_posix_pthread_004.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/smoke/It_posix_pthread_004.cpp similarity index 97% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/smoke/It_posix_pthread_004.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/smoke/It_posix_pthread_004.cpp index 24e5b84a..b1436e51 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/smoke/It_posix_pthread_004.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/smoke/It_posix_pthread_004.cpp @@ -32,7 +32,7 @@ static void *ThreadF01(void *arg) { - pthread_exit(static_cast(2)); // 2: return value for testing + pthread_exit((void *)2); return NULL; } static UINT32 Testcase(VOID) diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/smoke/It_posix_pthread_005.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/smoke/It_posix_pthread_005.cpp similarity index 92% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/smoke/It_posix_pthread_005.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/smoke/It_posix_pthread_005.cpp index 5beb285c..67729f02 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/smoke/It_posix_pthread_005.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/smoke/It_posix_pthread_005.cpp @@ -36,7 +36,9 @@ static void *ThreadF01(void *arg) /* Shouldn't reach here. If we do, then the pthread_cancel() * function did not succeed. */ - pthread_exit(nullptr); + // uart_printf_func("Could not send cancel request correctly\n"); + // ICUNIT_TRACK_EQUAL(1, 0, errno); + pthread_exit((void *)0); return NULL; } static UINT32 Testcase(VOID) @@ -60,6 +62,7 @@ static UINT32 Testcase(VOID) ret = pthread_join(newTh, (void **)&temp); ICUNIT_ASSERT_EQUAL(ret, 0, ret); + // ICUNIT_ASSERT_EQUAL(temp, (UINTPTR)PTHREAD_CANCELED, temp); return PTHREAD_NO_ERROR; } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/smoke/It_posix_pthread_006.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/smoke/It_posix_pthread_006.cpp similarity index 95% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/smoke/It_posix_pthread_006.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/smoke/It_posix_pthread_006.cpp index 80d397a3..61342e52 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/smoke/It_posix_pthread_006.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/smoke/It_posix_pthread_006.cpp @@ -34,9 +34,10 @@ static void *ThreadF01(void *arg) { pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL); + // while (1) sleep(1); - pthread_exit(nullptr); + pthread_exit((void *)0); return NULL; } @@ -47,6 +48,7 @@ static UINT32 Testcase(VOID) pthread_t a; /* SIGALRM will be sent in 5 seconds. */ + // alarm(5);//alarm NOT SUPPORT /* Create a new thread. */ if (pthread_create(&a, NULL, ThreadF01, NULL) != 0) { @@ -59,6 +61,7 @@ static UINT32 Testcase(VOID) /* If 'main' has reached here, then the test passed because it means * that the thread is truly asynchronise, and main isn't waiting for * it to return in order to move on. */ + // printf("Test PASSED\n"); ret = pthread_join(a, &temp); ICUNIT_ASSERT_EQUAL(ret, 0, ret); diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/smoke/It_posix_pthread_018.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/smoke/It_posix_pthread_018.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/smoke/It_posix_pthread_018.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/smoke/It_posix_pthread_018.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/smoke/It_posix_pthread_019.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/smoke/It_posix_pthread_019.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/smoke/It_posix_pthread_019.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/smoke/It_posix_pthread_019.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/smoke/It_posix_pthread_020.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/smoke/It_posix_pthread_020.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/smoke/It_posix_pthread_020.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/smoke/It_posix_pthread_020.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/smoke/It_posix_pthread_021.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/smoke/It_posix_pthread_021.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/smoke/It_posix_pthread_021.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/smoke/It_posix_pthread_021.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/smoke/It_posix_pthread_022.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/smoke/It_posix_pthread_022.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/posix/pthread/smoke/It_posix_pthread_022.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/posix/pthread/smoke/It_posix_pthread_022.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/sys/It_test_sys.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/sys/It_test_sys.h similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/sys/It_test_sys.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/sys/It_test_sys.h diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/sys/config.gni b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/sys/config.gni similarity index 80% rename from src/kernel_liteos_a/testsuites/unittest/libc/sys/config.gni rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/sys/config.gni index 7dd898cc..e0a4bb7f 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/sys/config.gni +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/sys/config.gni @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023 Huawei Device Co., Ltd. All rights reserved. +# Copyright (c) 2022-2022 Huawei Device Co., Ltd. All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: @@ -26,26 +26,13 @@ # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -import("//build/lite/config/test.gni") -import("//kernel/liteos_a/liteos.gni") import("//kernel/liteos_a/testsuites/unittest/config.gni") -common_include_dirs = [ - "$THIRDPARTY_GOOGLETEST_DIR/googletest/include", - "../../common/include", -] - -sources_entry = [ "../../common/osTest.cpp" ] - -sources_smoke = [] +sys_include_dirs = [ "$TEST_UNITTEST_DIR/libc/sys" ] -sources_full = [] +sys_sources_entry = [ "$TEST_UNITTEST_DIR/libc/sys/sys_unit_test.cpp" ] -libc_sys_include_dirs = [ "$TEST_UNITTEST_DIR/libc/sys" ] - -libc_sys_sources_entry = [ "$TEST_UNITTEST_DIR/libc/sys/sys_unit_test.cpp" ] - -libc_sys_sources_smoke = [ +sys_sources_smoke = [ "$TEST_UNITTEST_DIR/libc/sys/smoke/sys_test_004.cpp", "$TEST_UNITTEST_DIR/libc/sys/smoke/sys_test_005.cpp", "$TEST_UNITTEST_DIR/libc/sys/smoke/sys_test_006.cpp", @@ -64,7 +51,7 @@ libc_sys_sources_smoke = [ "$TEST_UNITTEST_DIR/libc/sys/smoke/sys_test_031.cpp", ] -libc_sys_sources_full = [ +sys_sources_full = [ "$TEST_UNITTEST_DIR/libc/sys/full/sys_test_001.cpp", "$TEST_UNITTEST_DIR/libc/sys/full/sys_test_018.cpp", "$TEST_UNITTEST_DIR/libc/sys/full/sys_test_019.cpp", @@ -78,11 +65,3 @@ libc_sys_sources_full = [ "$TEST_UNITTEST_DIR/libc/sys/full/sys_test_027.cpp", "$TEST_UNITTEST_DIR/libc/sys/full/sys_test_028.cpp", ] - -# libc sys module -if (LOSCFG_USER_TEST_LIBC_SYS == true) { - common_include_dirs += libc_sys_include_dirs - sources_entry += libc_sys_sources_entry - sources_smoke += libc_sys_sources_smoke - sources_full += libc_sys_sources_full -} diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/sys/full/sys_test_001.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/sys/full/sys_test_001.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/sys/full/sys_test_001.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/sys/full/sys_test_001.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/sys/full/sys_test_018.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/sys/full/sys_test_018.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/sys/full/sys_test_018.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/sys/full/sys_test_018.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/sys/full/sys_test_019.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/sys/full/sys_test_019.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/sys/full/sys_test_019.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/sys/full/sys_test_019.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/sys/full/sys_test_020.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/sys/full/sys_test_020.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/sys/full/sys_test_020.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/sys/full/sys_test_020.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/sys/full/sys_test_021.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/sys/full/sys_test_021.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/sys/full/sys_test_021.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/sys/full/sys_test_021.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/sys/full/sys_test_022.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/sys/full/sys_test_022.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/sys/full/sys_test_022.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/sys/full/sys_test_022.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/sys/full/sys_test_023.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/sys/full/sys_test_023.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/sys/full/sys_test_023.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/sys/full/sys_test_023.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/sys/full/sys_test_024.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/sys/full/sys_test_024.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/sys/full/sys_test_024.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/sys/full/sys_test_024.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/sys/full/sys_test_025.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/sys/full/sys_test_025.cpp similarity index 95% rename from src/kernel_liteos_a/testsuites/unittest/libc/sys/full/sys_test_025.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/sys/full/sys_test_025.cpp index db6d678b..95ea0554 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/sys/full/sys_test_025.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/sys/full/sys_test_025.cpp @@ -85,22 +85,22 @@ STATIC INT32 TestCase1(void) INT32 ret = getgrgid_r(-1, &getNam1, buf, len, &getNam2); ICUNIT_ASSERT_NOT_EQUAL(ret, 0, ret); - ICUNIT_ASSERT_EQUAL(errno, ENOENT, errno); + ICUNIT_ASSERT_EQUAL(errno, EAFNOSUPPORT, errno); errno = 0; groupRet = getgrgid(-1); ICUNIT_ASSERT_EQUAL(groupRet, 0, groupRet); - ICUNIT_ASSERT_EQUAL(errno, ENOENT, errno); + ICUNIT_ASSERT_EQUAL(errno, EAFNOSUPPORT, errno); errno = 0; groupRet = getgrnam("null"); ICUNIT_ASSERT_EQUAL(groupRet, nullptr, groupRet); - ICUNIT_ASSERT_EQUAL(errno, ENOENT, errno); + ICUNIT_ASSERT_EQUAL(errno, EAFNOSUPPORT, errno); errno = 0; ret = getgrnam_r("null", &getData1, buf, len, &getData2); ICUNIT_ASSERT_NOT_EQUAL(ret, 0, ret); - ICUNIT_ASSERT_EQUAL(errno, ENOENT, errno); + ICUNIT_ASSERT_EQUAL(errno, EAFNOSUPPORT, errno); errno = 0; return 0; diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/sys/full/sys_test_026.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/sys/full/sys_test_026.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/sys/full/sys_test_026.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/sys/full/sys_test_026.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/sys/full/sys_test_027.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/sys/full/sys_test_027.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/sys/full/sys_test_027.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/sys/full/sys_test_027.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/sys/full/sys_test_028.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/sys/full/sys_test_028.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/sys/full/sys_test_028.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/sys/full/sys_test_028.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/sys/smoke/sys_test_004.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/sys/smoke/sys_test_004.cpp similarity index 96% rename from src/kernel_liteos_a/testsuites/unittest/libc/sys/smoke/sys_test_004.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/sys/smoke/sys_test_004.cpp index cd13455d..a3586444 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/sys/smoke/sys_test_004.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/sys/smoke/sys_test_004.cpp @@ -39,7 +39,7 @@ static UINT32 TestCase(VOID) x = nrand48(seed); if ((x < 0) || (x > MAX_NRAND48)) { - printf("[IN %s][line %d] x = %ld\n", __FUNCTION__, __LINE__, x); + printf("[IN %s][line %d] x = %d\n", __FUNCTION__, __LINE__, x); goto EXIT; } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/sys/smoke/sys_test_005.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/sys/smoke/sys_test_005.cpp similarity index 94% rename from src/kernel_liteos_a/testsuites/unittest/libc/sys/smoke/sys_test_005.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/sys/smoke/sys_test_005.cpp index 0db849af..ae47e8b4 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/sys/smoke/sys_test_005.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/sys/smoke/sys_test_005.cpp @@ -37,8 +37,8 @@ static UINT32 TestCase(VOID) long x; x = random(); - if (x > static_cast(MAX_RANDOM - 1)) { - printf("[IN %s][line %d] x = %ld\n", __FUNCTION__, __LINE__, x); + if (x > labs(MAX_RANDOM - 1)) { + printf("[IN %s][line %d] x = %d\n", __FUNCTION__, __LINE__, x); goto EXIT; } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/sys/smoke/sys_test_006.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/sys/smoke/sys_test_006.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/sys/smoke/sys_test_006.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/sys/smoke/sys_test_006.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/sys/smoke/sys_test_007.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/sys/smoke/sys_test_007.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/sys/smoke/sys_test_007.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/sys/smoke/sys_test_007.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/sys/smoke/sys_test_008.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/sys/smoke/sys_test_008.cpp similarity index 94% rename from src/kernel_liteos_a/testsuites/unittest/libc/sys/smoke/sys_test_008.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/sys/smoke/sys_test_008.cpp index a3265976..a3ec1724 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/sys/smoke/sys_test_008.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/sys/smoke/sys_test_008.cpp @@ -39,9 +39,9 @@ static UINT32 TestCase(VOID) int cflags; regex_t reg; char *a = NULL; - char *b = const_cast("No error"); - char *testStr = const_cast("Hello World"); - char *regStr = const_cast("H.*"); + char *b = (char *)"No error"; + char *testStr = (char *)"Hello World"; + char *regStr = (char *)"H.*"; cflags = REG_EXTENDED | REG_ICASE | REG_NOSUB; diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/sys/smoke/sys_test_009.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/sys/smoke/sys_test_009.cpp similarity index 96% rename from src/kernel_liteos_a/testsuites/unittest/libc/sys/smoke/sys_test_009.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/sys/smoke/sys_test_009.cpp index d851f558..b19f3f23 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/sys/smoke/sys_test_009.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/sys/smoke/sys_test_009.cpp @@ -33,8 +33,8 @@ static UINT32 TestCase(VOID) { char *val = NULL; - const char *name = "ABC"; - char *env = const_cast("test-test"); + const char *name = (char *)"ABC"; + char *env = (char *)"test-test"; int ret; val = getenv(name); diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/sys/smoke/sys_test_010.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/sys/smoke/sys_test_010.cpp similarity index 97% rename from src/kernel_liteos_a/testsuites/unittest/libc/sys/smoke/sys_test_010.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/sys/smoke/sys_test_010.cpp index 903bb979..60415c50 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/sys/smoke/sys_test_010.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/sys/smoke/sys_test_010.cpp @@ -33,7 +33,7 @@ static UINT32 TestCase(VOID) { char *plocale = NULL; - char *buffer = const_cast("C"); + char *buffer = (char *)"C"; int ret; plocale = setlocale(LC_ALL, NULL); diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/sys/smoke/sys_test_012.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/sys/smoke/sys_test_012.cpp similarity index 96% rename from src/kernel_liteos_a/testsuites/unittest/libc/sys/smoke/sys_test_012.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/sys/smoke/sys_test_012.cpp index 130013e2..352839a8 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/sys/smoke/sys_test_012.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/sys/smoke/sys_test_012.cpp @@ -34,8 +34,8 @@ static UINT32 TestCase(VOID) { char *val = NULL; char *val2 = NULL; - const char *name = "ABC"; - char *env = "test-test"; + const char *name = (char *)"ABC"; + char *env = (char *)"test-test"; int ret; val = getenv(name); diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/sys/smoke/sys_test_013.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/sys/smoke/sys_test_013.cpp similarity index 97% rename from src/kernel_liteos_a/testsuites/unittest/libc/sys/smoke/sys_test_013.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/sys/smoke/sys_test_013.cpp index 08c63743..97f9b074 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/sys/smoke/sys_test_013.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/sys/smoke/sys_test_013.cpp @@ -38,7 +38,7 @@ struct q { static struct q *New(int i) { - struct q *q = static_cast(malloc(sizeof *q)); + struct q *q = (struct q *)malloc(sizeof *q); if (q != NULL) { q->i = i; } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/sys/smoke/sys_test_014.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/sys/smoke/sys_test_014.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/sys/smoke/sys_test_014.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/sys/smoke/sys_test_014.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/sys/smoke/sys_test_015.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/sys/smoke/sys_test_015.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/sys/smoke/sys_test_015.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/sys/smoke/sys_test_015.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/sys/smoke/sys_test_016.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/sys/smoke/sys_test_016.cpp similarity index 98% rename from src/kernel_liteos_a/testsuites/unittest/libc/sys/smoke/sys_test_016.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/sys/smoke/sys_test_016.cpp index ce5df778..c53c9dda 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/sys/smoke/sys_test_016.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/sys/smoke/sys_test_016.cpp @@ -35,7 +35,7 @@ static UINT32 TestCase(VOID) char *ptr = NULL; int ret; - ptr = basename(const_cast(".")); + ptr = basename((char *)"."); ret = strcmp(ptr, "."); ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT); diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/sys/smoke/sys_test_017.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/sys/smoke/sys_test_017.cpp similarity index 85% rename from src/kernel_liteos_a/testsuites/unittest/libc/sys/smoke/sys_test_017.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/sys/smoke/sys_test_017.cpp index 224c4531..28c0d173 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/sys/smoke/sys_test_017.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/sys/smoke/sys_test_017.cpp @@ -30,7 +30,7 @@ */ #include "It_test_sys.h" -const int password_length = 10; +#define TEST_PASSWORD (char *)"test1234" static UINT32 TestCase(VOID) { @@ -39,24 +39,14 @@ static UINT32 TestCase(VOID) char *key = NULL; char slat[2]; int ret; - char test_password[password_length]; - srand(time(NULL)); - for (int i = 0, r = 0; i < password_length; i++) { - r = rand() % 36; // 36: 0-9 and a-z - if (r < 10) { // 10: 0-9 - test_password[i] = '0' + r; - } else { - test_password[i] = 'a' + r; - } - } - key = test_password; + key = TEST_PASSWORD; slat[0] = key[0]; slat[1] = key[1]; passwd1 = crypt(key, slat); ICUNIT_GOTO_NOT_EQUAL(passwd1, NULL, passwd1, EXIT); - key = test_password; + key = TEST_PASSWORD; slat[0] = passwd1[0]; slat[1] = passwd1[1]; passwd2 = crypt(key, slat); diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/sys/smoke/sys_test_029.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/sys/smoke/sys_test_029.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/sys/smoke/sys_test_029.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/sys/smoke/sys_test_029.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/sys/smoke/sys_test_030.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/sys/smoke/sys_test_030.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/sys/smoke/sys_test_030.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/sys/smoke/sys_test_030.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/sys/smoke/sys_test_031.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/sys/smoke/sys_test_031.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/sys/smoke/sys_test_031.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/sys/smoke/sys_test_031.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/sys/sys_unit_test.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/sys/sys_unit_test.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/sys/sys_unit_test.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/sys/sys_unit_test.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/time/clock/config.gni b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/time/clock/config.gni similarity index 89% rename from src/kernel_liteos_a/testsuites/unittest/libc/time/clock/config.gni rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/time/clock/config.gni index bfca2c94..de954e95 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/time/clock/config.gni +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/time/clock/config.gni @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023 Huawei Device Co., Ltd. All rights reserved. +# Copyright (c) 2022-2022 Huawei Device Co., Ltd. All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: @@ -26,18 +26,17 @@ # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -import("//build/lite/config/test.gni") import("//kernel/liteos_a/testsuites/unittest/config.gni") -libc_time_clock_include_dirs = [ "$TEST_UNITTEST_DIR/libc/time/clock" ] +time_clock_include_dirs = [ "$TEST_UNITTEST_DIR/libc/time/clock" ] -libc_time_clock_sources_entry = +time_clock_sources_entry = [ "$TEST_UNITTEST_DIR/libc/time/clock/time_clock_test.cpp" ] -libc_time_clock_sources_smoke = +time_clock_sources_smoke = [ "$TEST_UNITTEST_DIR/libc/time/clock/smoke/clock_test_smoke.cpp" ] -libc_time_clock_sources_full = [ +time_clock_sources_full = [ "$TEST_UNITTEST_DIR/libc/time/clock/full/clock_test_001.cpp", "$TEST_UNITTEST_DIR/libc/time/clock/full/clock_test_002.cpp", "$TEST_UNITTEST_DIR/libc/time/clock/full/clock_test_003.cpp", diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/time/clock/full/clock_test_001.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/time/clock/full/clock_test_001.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/time/clock/full/clock_test_001.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/time/clock/full/clock_test_001.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/time/clock/full/clock_test_002.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/time/clock/full/clock_test_002.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/time/clock/full/clock_test_002.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/time/clock/full/clock_test_002.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/time/clock/full/clock_test_003.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/time/clock/full/clock_test_003.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/time/clock/full/clock_test_003.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/time/clock/full/clock_test_003.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/time/clock/full/clock_test_004.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/time/clock/full/clock_test_004.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/time/clock/full/clock_test_004.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/time/clock/full/clock_test_004.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/time/clock/full/clock_test_005.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/time/clock/full/clock_test_005.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/time/clock/full/clock_test_005.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/time/clock/full/clock_test_005.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/time/clock/full/clock_test_006.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/time/clock/full/clock_test_006.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/time/clock/full/clock_test_006.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/time/clock/full/clock_test_006.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/time/clock/full/clock_test_007.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/time/clock/full/clock_test_007.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/time/clock/full/clock_test_007.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/time/clock/full/clock_test_007.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/time/clock/full/clock_test_008.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/time/clock/full/clock_test_008.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/time/clock/full/clock_test_008.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/time/clock/full/clock_test_008.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/time/clock/full/clock_test_009.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/time/clock/full/clock_test_009.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/time/clock/full/clock_test_009.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/time/clock/full/clock_test_009.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/time/clock/full/clock_test_010.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/time/clock/full/clock_test_010.cpp similarity index 94% rename from src/kernel_liteos_a/testsuites/unittest/libc/time/clock/full/clock_test_010.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/time/clock/full/clock_test_010.cpp index e57dc25a..2b14879b 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/time/clock/full/clock_test_010.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/time/clock/full/clock_test_010.cpp @@ -51,8 +51,8 @@ static int SleepTest(int64_t expectTime) ret = clock_gettime(clk, &oldtp); ICUNIT_ASSERT_EQUAL(ret, 0, ret); - tp.tv_sec = expectTime / static_cast(1e9); - tp.tv_nsec = expectTime % static_cast(1e9); + tp.tv_sec = expectTime / (long)1e9; + tp.tv_nsec = expectTime % (long)1e9; ret = clock_nanosleep(clk, 0, &tp, nullptr); ICUNIT_ASSERT_EQUAL(ret, 0, ret); @@ -60,7 +60,7 @@ static int SleepTest(int64_t expectTime) ret = clock_gettime(clk, &tp); ICUNIT_ASSERT_EQUAL(ret, 0, ret); - escapeTime = (tp.tv_sec - oldtp.tv_sec) * static_cast(1e9) + (tp.tv_nsec - oldtp.tv_nsec); + escapeTime = (tp.tv_sec - oldtp.tv_sec) * (int64_t)1e9 + (tp.tv_nsec - oldtp.tv_nsec); LogPrintln("slept time (expected --> actual): %" PRId64 "ns --> %" PRId64 "ns, delta: %" PRId64 "ns\n", expectTime, escapeTime, escapeTime - expectTime); diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/time/clock/lt_clock_test.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/time/clock/lt_clock_test.h similarity index 94% rename from src/kernel_liteos_a/testsuites/unittest/libc/time/clock/lt_clock_test.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/time/clock/lt_clock_test.h index 9819361c..ac34a0dd 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/time/clock/lt_clock_test.h +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/time/clock/lt_clock_test.h @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2022 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -41,7 +41,7 @@ #define CLOCK_RES_NSEC 1000 #define CLOCK_COARSE_RES_SEC 0 #define CLOCK_COARSE_RES_NSEC 1000000 -#define CLOCK_GET_CPU_CLOCKID(pid) ((-(pid) - 1) * 8U + 2) +#define CLOCK_GET_CPU_CLOCKID(pid) ((-pid - 1) * 8U + 2) void ClockTestSmoke(void); void ClockTest001(void); diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/time/clock/smoke/clock_test_smoke.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/time/clock/smoke/clock_test_smoke.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/time/clock/smoke/clock_test_smoke.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/time/clock/smoke/clock_test_smoke.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/time/clock/time_clock_test.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/time/clock/time_clock_test.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/time/clock/time_clock_test.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/time/clock/time_clock_test.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/time/timer/config.gni b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/time/timer/config.gni similarity index 88% rename from src/kernel_liteos_a/testsuites/unittest/libc/time/timer/config.gni rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/time/timer/config.gni index 319427fa..59b7d7c6 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/time/timer/config.gni +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/time/timer/config.gni @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023 Huawei Device Co., Ltd. All rights reserved. +# Copyright (c) 2022-2022 Huawei Device Co., Ltd. All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: @@ -26,15 +26,14 @@ # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -import("//build/lite/config/test.gni") import("//kernel/liteos_a/testsuites/unittest/config.gni") -libc_time_timer_include_dirs = [ "$TEST_UNITTEST_DIR/libc/time/timer" ] +time_timer_include_dirs = [ "$TEST_UNITTEST_DIR/libc/time/timer" ] -libc_time_timer_sources_entry = +time_timer_sources_entry = [ "$TEST_UNITTEST_DIR/libc/time/timer/time_timer_test.cpp" ] -libc_time_timer_sources_smoke = [ +time_timer_sources_smoke = [ "$TEST_UNITTEST_DIR/libc/time/timer/smoke/timer_test_001.cpp", "$TEST_UNITTEST_DIR/libc/time/timer/smoke/timer_test_002.cpp", "$TEST_UNITTEST_DIR/libc/time/timer/smoke/timer_test_003.cpp", @@ -44,4 +43,4 @@ libc_time_timer_sources_smoke = [ "$TEST_UNITTEST_DIR/libc/time/timer/smoke/timer_test_tzset_002.cpp", ] -libc_time_timer_sources_full = [] +time_timer_sources_full = [] diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/time/timer/lt_timer_test.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/time/timer/lt_timer_test.h similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/time/timer/lt_timer_test.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/time/timer/lt_timer_test.h diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/time/timer/smoke/timer_test_001.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/time/timer/smoke/timer_test_001.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/time/timer/smoke/timer_test_001.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/time/timer/smoke/timer_test_001.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/time/timer/smoke/timer_test_002.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/time/timer/smoke/timer_test_002.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/time/timer/smoke/timer_test_002.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/time/timer/smoke/timer_test_002.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/time/timer/smoke/timer_test_003.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/time/timer/smoke/timer_test_003.cpp similarity index 93% rename from src/kernel_liteos_a/testsuites/unittest/libc/time/timer/smoke/timer_test_003.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/time/timer/smoke/timer_test_003.cpp index ae454def..f6cfab91 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/time/timer/smoke/timer_test_003.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/time/timer/smoke/timer_test_003.cpp @@ -94,9 +94,8 @@ static int SetTimerTest(void) ret = clock_gettime(CLOCKID, &end); ICUNIT_ASSERT_EQUAL(ret, 0, ret); - expected = its.it_value.tv_sec * static_cast(1e9) + its.it_value.tv_nsec; - escaped = end.tv_sec * static_cast(1e9) + end.tv_nsec - start.tv_sec * static_cast(1e9) - - start.tv_nsec; + expected = its.it_value.tv_sec * (int64_t)1e9 + its.it_value.tv_nsec; + escaped = end.tv_sec * (int64_t)1e9 + end.tv_nsec - start.tv_sec * (int64_t)1e9 - start.tv_nsec; failed += (escaped < expected || (escaped - expected) >= 20000000); // 20000000, 2 ticks. } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/time/timer/smoke/timer_test_004.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/time/timer/smoke/timer_test_004.cpp similarity index 98% rename from src/kernel_liteos_a/testsuites/unittest/libc/time/timer/smoke/timer_test_004.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/time/timer/smoke/timer_test_004.cpp index 059f7b85..e28ec8d4 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/time/timer/smoke/timer_test_004.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/time/timer/smoke/timer_test_004.cpp @@ -52,7 +52,7 @@ static void SigHandler(int sig, siginfo_t *si, void *uc) #ifdef TEST_ON_LINUX timer_t timerid = *(timer_t *)si->si_value.sival_ptr; #else // SA_SIGINFO not compatible with POSIX on HMOS - timer_t timerid = *reinterpret_cast(si); + timer_t timerid = *(timer_t *)si; #endif g_tmrOverrun += timer_getoverrun(timerid); diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/time/timer/smoke/timer_test_005.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/time/timer/smoke/timer_test_005.cpp similarity index 93% rename from src/kernel_liteos_a/testsuites/unittest/libc/time/timer/smoke/timer_test_005.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/time/timer/smoke/timer_test_005.cpp index 9ef06c12..4c739f74 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/time/timer/smoke/timer_test_005.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/time/timer/smoke/timer_test_005.cpp @@ -65,11 +65,10 @@ static int TimerTest(void) int ret; int i; - ret = memset_s(&sev, sizeof(struct sigevent), 0, sizeof(struct sigevent)); - ICUNIT_ASSERT_EQUAL(ret, 0, ret); + (void)memset(&sev, 0, sizeof(struct sigevent)); sev.sigev_notify = SIGEV_THREAD; sev.sigev_notify_function = TempSigHandler; - sev.sigev_value.sival_ptr = reinterpret_cast(TempSigHandler01); + sev.sigev_value.sival_ptr = (void *)TempSigHandler01; /* Start the timer */ its.it_value.tv_sec = 3; // 3, timer time 3 seconds. @@ -89,7 +88,7 @@ static int TimerTest(void) its.it_interval.tv_sec = its.it_value.tv_sec; its.it_interval.tv_nsec = its.it_value.tv_nsec; - sev.sigev_value.sival_ptr = reinterpret_cast(TempSigHandler02); + sev.sigev_value.sival_ptr = (void *)TempSigHandler02; ret = timer_create(CLOCK_REALTIME, &sev, &timerid02); LogPrintln("timer_settime %p: %d", timerid02, ret); ICUNIT_ASSERT_EQUAL(ret, 0, ret); diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/time/timer/smoke/timer_test_tzset_001.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/time/timer/smoke/timer_test_tzset_001.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/time/timer/smoke/timer_test_tzset_001.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/time/timer/smoke/timer_test_tzset_001.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/time/timer/smoke/timer_test_tzset_002.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/time/timer/smoke/timer_test_tzset_002.cpp similarity index 97% rename from src/kernel_liteos_a/testsuites/unittest/libc/time/timer/smoke/timer_test_tzset_002.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/time/timer/smoke/timer_test_tzset_002.cpp index 9834c6b5..311def89 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/time/timer/smoke/timer_test_tzset_002.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/time/timer/smoke/timer_test_tzset_002.cpp @@ -42,7 +42,7 @@ static UINT32 testcase(VOID) int ret = 0; errno = 0; - ret = putenv(const_cast("TZ=GMT-100")); + ret = putenv((char *) "TZ=GMT-100"); ICUNIT_ASSERT_EQUAL(ret, 0, ret); tzset(); diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/time/timer/time_timer_test.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/time/timer/time_timer_test.cpp similarity index 88% rename from src/kernel_liteos_a/testsuites/unittest/libc/time/timer/time_timer_test.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/time/timer/time_timer_test.cpp index d859b046..4371de0a 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/time/timer/time_timer_test.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/time/timer/time_timer_test.cpp @@ -53,6 +53,26 @@ HWTEST_F(TimeTimerTest, TimerTest001, TestSize.Level0) TimerTest001(); } +/* * + * @tc.name: TimerTest002 + * @tc.desc: function for TimeTimerTest + * @tc.type: FUNC + */ +HWTEST_F(TimeTimerTest, TimerTest002, TestSize.Level0) +{ + TimerTest002(); +} + +/* * + * @tc.name: TimerTest003 + * @tc.desc: function for TimeTimerTest + * @tc.type: FUNC + */ +HWTEST_F(TimeTimerTest, TimerTest003, TestSize.Level0) +{ + TimerTest003(); +} + /* * * @tc.name: TimerTest005 * @tc.desc: function for timer_create SIGEV_THREAD. diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/util/It_test_util.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/util/It_test_util.h similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/util/It_test_util.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/util/It_test_util.h diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/util/config.gni b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/util/config.gni similarity index 74% rename from src/kernel_liteos_a/testsuites/unittest/libc/util/config.gni rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/util/config.gni index 488c8079..5bdec23e 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/util/config.gni +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/util/config.gni @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023 Huawei Device Co., Ltd. All rights reserved. +# Copyright (c) 2022-2022 Huawei Device Co., Ltd. All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: @@ -26,29 +26,16 @@ # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -import("//build/lite/config/test.gni") -import("//kernel/liteos_a/liteos.gni") import("//kernel/liteos_a/testsuites/unittest/config.gni") -common_include_dirs = [ - "$THIRDPARTY_GOOGLETEST_DIR/googletest/include", - "../../common/include", -] - -sources_entry = [ "../../common/osTest.cpp" ] - -sources_smoke = [] - -sources_full = [] - -libc_util_include_dirs = [ +util_include_dirs = [ "$TEST_UNITTEST_DIR/libc/util", "$TEST_UNITTEST_DIR/libc/misc", ] -libc_util_sources_entry = [ "$TEST_UNITTEST_DIR/libc/util/util_test.cpp" ] +util_sources_entry = [ "$TEST_UNITTEST_DIR/libc/util/util_test.cpp" ] -libc_util_sources_smoke = [ +util_sources_smoke = [ "$TEST_UNITTEST_DIR/libc/util/smoke/it_test_util_100.cpp", "$TEST_UNITTEST_DIR/libc/util/smoke/it_test_util_101.cpp", "$TEST_UNITTEST_DIR/libc/util/smoke/util_test_001.cpp", @@ -60,12 +47,4 @@ libc_util_sources_smoke = [ "$TEST_UNITTEST_DIR/libc/util/smoke/util_test_007.cpp", ] -libc_util_sources_full = [] - -# libc util module -if (LOSCFG_USER_TEST_LIBC_UTIL == true) { - common_include_dirs += libc_util_include_dirs - sources_entry += libc_util_sources_entry - sources_smoke += libc_util_sources_smoke - sources_full += libc_util_sources_full -} +util_sources_full = [] diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/util/smoke/it_test_util_100.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/util/smoke/it_test_util_100.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/util/smoke/it_test_util_100.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/util/smoke/it_test_util_100.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/util/smoke/it_test_util_101.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/util/smoke/it_test_util_101.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/util/smoke/it_test_util_101.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/util/smoke/it_test_util_101.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/util/smoke/util_test_001.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/util/smoke/util_test_001.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/util/smoke/util_test_001.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/util/smoke/util_test_001.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/util/smoke/util_test_002.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/util/smoke/util_test_002.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/util/smoke/util_test_002.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/util/smoke/util_test_002.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/util/smoke/util_test_003.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/util/smoke/util_test_003.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/util/smoke/util_test_003.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/util/smoke/util_test_003.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/util/smoke/util_test_004.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/util/smoke/util_test_004.cpp similarity index 96% rename from src/kernel_liteos_a/testsuites/unittest/libc/util/smoke/util_test_004.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/util/smoke/util_test_004.cpp index 9bb0b38c..b9874ee3 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/util/smoke/util_test_004.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/util/smoke/util_test_004.cpp @@ -39,7 +39,7 @@ static UINT32 TestCase(VOID) x = jrand48(seed); if ((x < -JRAND48_NUM) || (x > JRAND48_NUM)) { - printf("[IN %s][line %d] x = %ld\n", __FUNCTION__, __LINE__, x); + printf("[IN %s][line %d] x = %d\n", __FUNCTION__, __LINE__, x); goto EXIT; } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/util/smoke/util_test_005.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/util/smoke/util_test_005.cpp similarity index 96% rename from src/kernel_liteos_a/testsuites/unittest/libc/util/smoke/util_test_005.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/util/smoke/util_test_005.cpp index 5b2ee32b..332f6251 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/util/smoke/util_test_005.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/util/smoke/util_test_005.cpp @@ -40,7 +40,7 @@ static UINT32 TestCase(VOID) lcong48(seed); x = mrand48(); if ((x < -MRAND48_NUM) || (x > MRAND48_NUM)) { - printf("[IN %s][line %d] x = %ld\n", __FUNCTION__, __LINE__, x); + printf("[IN %s][line %d] x = %d\n", __FUNCTION__, __LINE__, x); goto EXIT; } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/util/smoke/util_test_006.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/util/smoke/util_test_006.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/util/smoke/util_test_006.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/util/smoke/util_test_006.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/util/smoke/util_test_007.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/util/smoke/util_test_007.cpp similarity index 86% rename from src/kernel_liteos_a/testsuites/unittest/libc/util/smoke/util_test_007.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/util/smoke/util_test_007.cpp index ecc3dd3f..80dc8212 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/util/smoke/util_test_007.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/util/smoke/util_test_007.cpp @@ -49,10 +49,10 @@ static void *Xmalloc(unsigned n) static int Compare(const void *pa, const void *pb) { - if (*static_cast(const_cast(pa)) < *static_cast(const_cast(pb))) { + if (*(int *)pa < *(int *)pb) { return -1; } - if (*static_cast(const_cast(pa)) > *static_cast(const_cast(pb))) { + if (*(int *)pa > *(int *)pb) { return 1; } return 0; @@ -66,14 +66,12 @@ static void Action(const void *nodep, VISIT which, int depth) case preorder: break; case postorder: - datap = *static_cast(const_cast(nodep)); + datap = *(int **)nodep; break; case endorder: break; case leaf: - datap = *static_cast(const_cast(nodep)); - break; - default: + datap = *(int **)nodep; break; } } @@ -88,7 +86,7 @@ static UINT32 TestCase(VOID) for (i = 0; i < 12; i++) { ptr = (int *)Xmalloc(sizeof(int)); *ptr = rand() & 0xff; - val = tsearch(static_cast(ptr), &g_root, Compare); + val = tsearch((void *)ptr, &g_root, Compare); if (val == NULL) { exit(EXIT_FAILURE); } else if ((*(int **)val) != ptr) { diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/util/util_test.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/util/util_test.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/libc/util/util_test.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/libc/util/util_test.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/net/BUILD.gn b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/BUILD.gn similarity index 91% rename from src/kernel_liteos_a/testsuites/unittest/net/BUILD.gn rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/BUILD.gn index b10c06f5..d70558c0 100644 --- a/src/kernel_liteos_a/testsuites/unittest/net/BUILD.gn +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/BUILD.gn @@ -26,6 +26,8 @@ # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +import("//build/lite/config/test.gni") +import("//kernel/liteos_a/testsuites/unittest/config.gni") import("./config.gni") config("net_config") { @@ -53,7 +55,7 @@ if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_LOW) { sources += sources_full configs = [ "..:public_config_for_door" ] configs += [ ":net_config" ] - deps = [ "$THIRDPARTY_BOUNDS_CHECKING_FUNCTION_DIR:libsec_shared" ] + deps = [ "//third_party/bounds_checking_function:libsec_shared" ] } } @@ -67,6 +69,6 @@ if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_MIDDLE) { sources += sources_full configs = [ "..:public_config_for_all" ] configs += [ ":net_config" ] - deps = [ "$THIRDPARTY_BOUNDS_CHECKING_FUNCTION_DIR:libsec_shared" ] + deps = [ "//third_party/bounds_checking_function:libsec_shared" ] } } diff --git a/src/kernel_liteos_a/testsuites/unittest/net/config.gni b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/config.gni similarity index 96% rename from src/kernel_liteos_a/testsuites/unittest/net/config.gni rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/config.gni index aaeafe7e..bf56719e 100644 --- a/src/kernel_liteos_a/testsuites/unittest/net/config.gni +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/config.gni @@ -27,11 +27,10 @@ # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. import("//build/lite/config/test.gni") -import("//kernel/liteos_a/liteos.gni") import("//kernel/liteos_a/testsuites/unittest/config.gni") common_include_dirs = [ - "$THIRDPARTY_GOOGLETEST_DIR/googletest/include", + "//third_party/googletest/googletest/include", "../common/include", ] diff --git a/src/kernel_liteos_a/testsuites/unittest/net/netdb/config.gni b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/netdb/config.gni similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/net/netdb/config.gni rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/netdb/config.gni diff --git a/src/kernel_liteos_a/testsuites/unittest/net/netdb/full/net_netdb_test_002.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/netdb/full/net_netdb_test_002.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/net/netdb/full/net_netdb_test_002.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/netdb/full/net_netdb_test_002.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/net/netdb/full/net_netdb_test_003.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/netdb/full/net_netdb_test_003.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/net/netdb/full/net_netdb_test_003.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/netdb/full/net_netdb_test_003.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/net/netdb/full/net_netdb_test_004.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/netdb/full/net_netdb_test_004.cpp similarity index 97% rename from src/kernel_liteos_a/testsuites/unittest/net/netdb/full/net_netdb_test_004.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/netdb/full/net_netdb_test_004.cpp index c05a6fb7..95787450 100644 --- a/src/kernel_liteos_a/testsuites/unittest/net/netdb/full/net_netdb_test_004.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/netdb/full/net_netdb_test_004.cpp @@ -63,9 +63,9 @@ static int GetHostByAddrTest(void) errno = 0; ia.s_addr = inet_addr("127.0.0.0"); addr = gethostbyaddr(&ia, sizeof ia, AF_INET); - ICUNIT_ASSERT_EQUAL(errno, ENOENT, errno); + ICUNIT_ASSERT_EQUAL(errno, EINVAL, errno); - RecoveryFileEnv(pathList, file_number); +    RecoveryFileEnv(pathList, file_number); return ICUNIT_SUCCESS; } diff --git a/src/kernel_liteos_a/testsuites/unittest/net/netdb/full/net_netdb_test_005.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/netdb/full/net_netdb_test_005.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/net/netdb/full/net_netdb_test_005.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/netdb/full/net_netdb_test_005.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/net/netdb/full/net_netdb_test_006.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/netdb/full/net_netdb_test_006.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/net/netdb/full/net_netdb_test_006.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/netdb/full/net_netdb_test_006.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/net/netdb/full/net_netdb_test_007.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/netdb/full/net_netdb_test_007.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/net/netdb/full/net_netdb_test_007.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/netdb/full/net_netdb_test_007.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/net/netdb/full/net_netdb_test_008.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/netdb/full/net_netdb_test_008.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/net/netdb/full/net_netdb_test_008.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/netdb/full/net_netdb_test_008.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/net/netdb/full/net_netdb_test_009.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/netdb/full/net_netdb_test_009.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/net/netdb/full/net_netdb_test_009.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/netdb/full/net_netdb_test_009.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/net/netdb/full/net_netdb_test_010.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/netdb/full/net_netdb_test_010.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/net/netdb/full/net_netdb_test_010.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/netdb/full/net_netdb_test_010.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/net/netdb/full/net_netdb_test_011.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/netdb/full/net_netdb_test_011.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/net/netdb/full/net_netdb_test_011.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/netdb/full/net_netdb_test_011.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/net/netdb/full/net_netdb_test_012.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/netdb/full/net_netdb_test_012.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/net/netdb/full/net_netdb_test_012.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/netdb/full/net_netdb_test_012.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/net/netdb/full/net_netdb_test_015.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/netdb/full/net_netdb_test_015.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/net/netdb/full/net_netdb_test_015.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/netdb/full/net_netdb_test_015.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/net/netdb/full/net_netdb_test_016.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/netdb/full/net_netdb_test_016.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/net/netdb/full/net_netdb_test_016.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/netdb/full/net_netdb_test_016.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/net/netdb/full/net_netdb_test_017.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/netdb/full/net_netdb_test_017.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/net/netdb/full/net_netdb_test_017.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/netdb/full/net_netdb_test_017.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/net/netdb/full/net_netdb_test_018.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/netdb/full/net_netdb_test_018.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/net/netdb/full/net_netdb_test_018.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/netdb/full/net_netdb_test_018.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/net/netdb/full/net_netdb_test_019.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/netdb/full/net_netdb_test_019.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/net/netdb/full/net_netdb_test_019.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/netdb/full/net_netdb_test_019.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/net/netdb/full/net_netdb_test_020.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/netdb/full/net_netdb_test_020.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/net/netdb/full/net_netdb_test_020.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/netdb/full/net_netdb_test_020.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/net/netdb/full/net_netdb_test_021.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/netdb/full/net_netdb_test_021.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/net/netdb/full/net_netdb_test_021.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/netdb/full/net_netdb_test_021.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/net/netdb/full/net_netdb_test_022.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/netdb/full/net_netdb_test_022.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/net/netdb/full/net_netdb_test_022.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/netdb/full/net_netdb_test_022.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/net/netdb/lt_net_netdb.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/netdb/lt_net_netdb.h similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/net/netdb/lt_net_netdb.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/netdb/lt_net_netdb.h diff --git a/src/kernel_liteos_a/testsuites/unittest/net/netdb/net_netdb_test.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/netdb/net_netdb_test.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/net/netdb/net_netdb_test.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/netdb/net_netdb_test.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/net/netdb/smoke/net_netdb_test_001.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/netdb/smoke/net_netdb_test_001.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/net/netdb/smoke/net_netdb_test_001.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/netdb/smoke/net_netdb_test_001.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/net/netdb/smoke/net_netdb_test_013.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/netdb/smoke/net_netdb_test_013.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/net/netdb/smoke/net_netdb_test_013.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/netdb/smoke/net_netdb_test_013.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/net/resolv/config.gni b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/resolv/config.gni similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/net/resolv/config.gni rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/resolv/config.gni diff --git a/src/kernel_liteos_a/testsuites/unittest/net/resolv/full/net_resolv_test_004.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/resolv/full/net_resolv_test_004.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/net/resolv/full/net_resolv_test_004.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/resolv/full/net_resolv_test_004.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/net/resolv/full/net_resolv_test_005.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/resolv/full/net_resolv_test_005.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/net/resolv/full/net_resolv_test_005.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/resolv/full/net_resolv_test_005.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/net/resolv/full/net_resolv_test_008.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/resolv/full/net_resolv_test_008.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/net/resolv/full/net_resolv_test_008.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/resolv/full/net_resolv_test_008.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/net/resolv/lt_net_resolv.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/resolv/lt_net_resolv.h similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/net/resolv/lt_net_resolv.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/resolv/lt_net_resolv.h diff --git a/src/kernel_liteos_a/testsuites/unittest/net/resolv/net_resolv_test.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/resolv/net_resolv_test.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/net/resolv/net_resolv_test.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/resolv/net_resolv_test.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/net/resolv/smoke/net_resolv_test_001.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/resolv/smoke/net_resolv_test_001.cpp similarity index 75% rename from src/kernel_liteos_a/testsuites/unittest/net/resolv/smoke/net_resolv_test_001.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/resolv/smoke/net_resolv_test_001.cpp index 821c82eb..3a41448d 100644 --- a/src/kernel_liteos_a/testsuites/unittest/net/resolv/smoke/net_resolv_test_001.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/resolv/smoke/net_resolv_test_001.cpp @@ -47,32 +47,32 @@ static int DnCompTest(void) unsigned char **lastdnptr = &dnptrs[6]; int offset, ret; - offset = strlen(reinterpret_cast(dnptrs[0])) + 1; - ret = dn_comp("x.y.z.example.com", comp_dn + offset, sizeof(comp_dn) - offset, dnptrs, lastdnptr); - dump(comp_dn + offset, ret); + offset = strlen((const char *)dnptrs[0])+1; + ret = dn_comp("x.y.z.example.com", comp_dn+offset, sizeof(comp_dn)-offset, dnptrs, lastdnptr); + dump(comp_dn+offset, ret); ICUNIT_ASSERT_EQUAL(ret, 19, ret); - ICUNIT_ASSERT_EQUAL(dnptrs[1], comp_dn + offset, dnptrs[1]); + ICUNIT_ASSERT_EQUAL(dnptrs[1], comp_dn+offset, dnptrs[1]); offset += ret+1; - ret = dn_comp("zz.example.com", comp_dn + offset, sizeof(comp_dn) - offset, dnptrs, lastdnptr); + ret = dn_comp("zz.example.com", comp_dn+offset, sizeof(comp_dn)-offset, dnptrs, lastdnptr); dump(comp_dn+offset, ret); ICUNIT_ASSERT_EQUAL(ret, 5, ret); - ICUNIT_ASSERT_EQUAL(dnptrs[2], comp_dn + offset, dnptrs[2]); + ICUNIT_ASSERT_EQUAL(dnptrs[2], comp_dn+offset, dnptrs[2]); offset += ret+1; - ret = dn_comp("a.example.com", comp_dn + offset, sizeof(comp_dn) - offset, dnptrs, lastdnptr); + ret = dn_comp("a.example.com", comp_dn+offset, sizeof(comp_dn)-offset, dnptrs, lastdnptr); dump(comp_dn+offset, ret); ICUNIT_ASSERT_EQUAL(ret, 4, ret); - ICUNIT_ASSERT_EQUAL(dnptrs[3], comp_dn + offset, dnptrs[3]); + ICUNIT_ASSERT_EQUAL(dnptrs[3], comp_dn+offset, dnptrs[3]); offset += ret+1; - ret = dn_comp("example.com.cn", comp_dn + offset, sizeof(comp_dn) - offset, dnptrs, lastdnptr); + ret = dn_comp("example.com.cn", comp_dn+offset, sizeof(comp_dn)-offset, dnptrs, lastdnptr); dump(comp_dn+offset, ret); ICUNIT_ASSERT_EQUAL(ret, 16, ret); - ICUNIT_ASSERT_EQUAL(dnptrs[4], comp_dn + offset, dnptrs[4]); + ICUNIT_ASSERT_EQUAL(dnptrs[4], comp_dn+offset, dnptrs[4]); offset += ret+1; - ret = dn_comp("2example.com", comp_dn + offset, sizeof(comp_dn) - offset, dnptrs, lastdnptr); + ret = dn_comp("2example.com", comp_dn+offset, sizeof(comp_dn)-offset, dnptrs, lastdnptr); dump(comp_dn+offset, ret); ICUNIT_ASSERT_EQUAL(ret, 11, ret); ICUNIT_ASSERT_EQUAL(dnptrs[5], /*comp_dn+offset*/ NULL, dnptrs[5]); //last one is always NULL @@ -80,7 +80,7 @@ static int DnCompTest(void) for (int i = 0; i < 6; ++i) { printf("%p: %s\n", dnptrs[i], dnptrs[i]); } - ICUNIT_ASSERT_EQUAL(offset + ret < 100, 1, ret); + ICUNIT_ASSERT_EQUAL(offset+ret<100, 1, ret); return ICUNIT_SUCCESS; } diff --git a/src/kernel_liteos_a/testsuites/unittest/net/resolv/smoke/net_resolv_test_002.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/resolv/smoke/net_resolv_test_002.cpp similarity index 67% rename from src/kernel_liteos_a/testsuites/unittest/net/resolv/smoke/net_resolv_test_002.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/resolv/smoke/net_resolv_test_002.cpp index 4e570199..0419b615 100644 --- a/src/kernel_liteos_a/testsuites/unittest/net/resolv/smoke/net_resolv_test_002.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/resolv/smoke/net_resolv_test_002.cpp @@ -32,31 +32,21 @@ #include -const int buffer_size = 20; - static int EtherAtonTest(void) { struct ether_addr *eaddr = ether_aton("01::EF"); ICUNIT_ASSERT_EQUAL(eaddr, NULL, -1); - char mac_addr[buffer_size], *tmp = mac_addr; - int r[ETH_ALEN]; - srand(time(NULL)); - for (int i = 0; i < ETH_ALEN; i++) { - r[i] = rand() % 0xff; - } - // 0, 1, 2, 3, 4, 5: 6 elements of mac address. - (void)sprintf_s(mac_addr, sizeof(mac_addr), "%.2x:%.2x:%.2x:%.2x:%.2x:%.2x", r[0], r[1], r[2], r[3], r[4], r[5]); - eaddr = ether_aton(mac_addr); + eaddr = ether_aton("2C:9D:1E:4A:41:55"); ICUNIT_ASSERT_NOT_EQUAL(eaddr, NULL, -1); - ICUNIT_ASSERT_EQUAL(eaddr->ether_addr_octet[0], r[0], eaddr->ether_addr_octet[0]); - ICUNIT_ASSERT_EQUAL(eaddr->ether_addr_octet[1], r[1], eaddr->ether_addr_octet[1]); - ICUNIT_ASSERT_EQUAL(eaddr->ether_addr_octet[2], r[2], eaddr->ether_addr_octet[2]); // 2: compare r[2] with eaddr - ICUNIT_ASSERT_EQUAL(eaddr->ether_addr_octet[3], r[3], eaddr->ether_addr_octet[3]); // 3: compare r[3] with eaddr - ICUNIT_ASSERT_EQUAL(eaddr->ether_addr_octet[4], r[4], eaddr->ether_addr_octet[4]); // 4: compare r[4] with eaddr - ICUNIT_ASSERT_EQUAL(eaddr->ether_addr_octet[5], r[5], eaddr->ether_addr_octet[5]); // 5: compare r[5] with eaddr + ICUNIT_ASSERT_EQUAL(eaddr->ether_addr_octet[0], 0x2C, eaddr->ether_addr_octet[0]); + ICUNIT_ASSERT_EQUAL(eaddr->ether_addr_octet[1], 0x9D, eaddr->ether_addr_octet[1]); + ICUNIT_ASSERT_EQUAL(eaddr->ether_addr_octet[2], 0x1E, eaddr->ether_addr_octet[2]); + ICUNIT_ASSERT_EQUAL(eaddr->ether_addr_octet[3], 0x4A, eaddr->ether_addr_octet[3]); + ICUNIT_ASSERT_EQUAL(eaddr->ether_addr_octet[4], 0x41, eaddr->ether_addr_octet[4]); + ICUNIT_ASSERT_EQUAL(eaddr->ether_addr_octet[5], 0x55, eaddr->ether_addr_octet[5]); return ICUNIT_SUCCESS; } diff --git a/src/kernel_liteos_a/testsuites/unittest/net/resolv/smoke/net_resolv_test_003.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/resolv/smoke/net_resolv_test_003.cpp similarity index 67% rename from src/kernel_liteos_a/testsuites/unittest/net/resolv/smoke/net_resolv_test_003.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/resolv/smoke/net_resolv_test_003.cpp index 85929a8b..eeb8eeb9 100644 --- a/src/kernel_liteos_a/testsuites/unittest/net/resolv/smoke/net_resolv_test_003.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/resolv/smoke/net_resolv_test_003.cpp @@ -32,8 +32,6 @@ #include -const int buffer_size = 20; - static int EtherAtonrTest(void) { struct ether_addr addr; @@ -41,23 +39,15 @@ static int EtherAtonrTest(void) ICUNIT_ASSERT_EQUAL(eaddr, NULL, -1); - char mac_addr[buffer_size], *tmp = mac_addr; - int r[ETH_ALEN]; - srand(time(NULL)); - for (int i = 0; i < ETH_ALEN; i++) { - r[i] = rand() % 0xff; - } - // 0, 1, 2, 3, 4, 5: 6 elements of mac address. - (void)sprintf_s(mac_addr, sizeof(mac_addr), "%.2x:%.2x:%.2x:%.2x:%.2x:%.2x", r[0], r[1], r[2], r[3], r[4], r[5]); - eaddr = ether_aton_r(mac_addr, &addr); + eaddr = ether_aton_r("2c:9d:1e:4A:41:55", &addr); ICUNIT_ASSERT_EQUAL(eaddr, &addr, -1); - ICUNIT_ASSERT_EQUAL(eaddr->ether_addr_octet[0], r[0], eaddr->ether_addr_octet[0]); - ICUNIT_ASSERT_EQUAL(eaddr->ether_addr_octet[1], r[1], eaddr->ether_addr_octet[1]); - ICUNIT_ASSERT_EQUAL(eaddr->ether_addr_octet[2], r[2], eaddr->ether_addr_octet[2]); // 2: compare r[2] with eaddr - ICUNIT_ASSERT_EQUAL(eaddr->ether_addr_octet[3], r[3], eaddr->ether_addr_octet[3]); // 3: compare r[3] with eaddr - ICUNIT_ASSERT_EQUAL(eaddr->ether_addr_octet[4], r[4], eaddr->ether_addr_octet[4]); // 4: compare r[4] with eaddr - ICUNIT_ASSERT_EQUAL(eaddr->ether_addr_octet[5], r[5], eaddr->ether_addr_octet[5]); // 5: compare r[5] with eaddr + ICUNIT_ASSERT_EQUAL(eaddr->ether_addr_octet[0], 0x2c, eaddr->ether_addr_octet[0]); + ICUNIT_ASSERT_EQUAL(eaddr->ether_addr_octet[1], 0x9d, eaddr->ether_addr_octet[1]); + ICUNIT_ASSERT_EQUAL(eaddr->ether_addr_octet[2], 0x1e, eaddr->ether_addr_octet[2]); + ICUNIT_ASSERT_EQUAL(eaddr->ether_addr_octet[3], 0x4a, eaddr->ether_addr_octet[3]); + ICUNIT_ASSERT_EQUAL(eaddr->ether_addr_octet[4], 0x41, eaddr->ether_addr_octet[4]); + ICUNIT_ASSERT_EQUAL(eaddr->ether_addr_octet[5], 0x55, eaddr->ether_addr_octet[5]); return ICUNIT_SUCCESS; } diff --git a/src/kernel_liteos_a/testsuites/unittest/process/plimits/smoke/It_process_plimits_sched_002.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/resolv/smoke/net_resolv_test_006.cpp similarity index 73% rename from src/kernel_liteos_a/testsuites/unittest/process/plimits/smoke/It_process_plimits_sched_002.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/resolv/smoke/net_resolv_test_006.cpp index a46fb3ca..d60d950a 100644 --- a/src/kernel_liteos_a/testsuites/unittest/process/plimits/smoke/It_process_plimits_sched_002.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/resolv/smoke/net_resolv_test_006.cpp @@ -1,4 +1,5 @@ /* + * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, @@ -27,16 +28,22 @@ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "It_process_plimits.h" -using namespace std; -VOID ItProcessPlimitsSched002(void) +#include + +static int EtherNtoaTest(void) { - const int childAmount = 1; - double errorRate = TestCpupInPlimit(childAmount, "testcpup102", PERIOD_10_SEC_IN_US, - QUOTA_6_SEC_IN_US, QUOTA_PERCENT_60); - ASSERT_GE(errorRate, 0); - ASSERT_LE(errorRate, TOLERANCE_ERROR); + struct ether_addr addr = {{11,12,13,14,15,16}}, *eaddr = &addr; + char *buf = ether_ntoa(eaddr); + + ICUNIT_ASSERT_NOT_EQUAL(buf, 0, -1); + ICUNIT_ASSERT_EQUAL((stricmp("b:c:d:e:f:10", buf) == 0 || stricmp("0b:0c:0d:0e:0f:10", buf) == 0), 1, printf("%s\n", buf)); + + return ICUNIT_SUCCESS; } +void NetResolvTest006(void) +{ + TEST_ADD_CASE(__FUNCTION__, EtherNtoaTest, TEST_POSIX, TEST_TCP, TEST_LEVEL0, TEST_FUNCTION); +} diff --git a/src/kernel_liteos_a/testsuites/unittest/net/resolv/smoke/net_resolv_test_007.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/resolv/smoke/net_resolv_test_007.cpp similarity index 73% rename from src/kernel_liteos_a/testsuites/unittest/net/resolv/smoke/net_resolv_test_007.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/resolv/smoke/net_resolv_test_007.cpp index d6508c21..a509c97a 100644 --- a/src/kernel_liteos_a/testsuites/unittest/net/resolv/smoke/net_resolv_test_007.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/resolv/smoke/net_resolv_test_007.cpp @@ -31,27 +31,13 @@ #include -const int buffer_size = 20; - static int EtherNtoarTest(void) { - struct ether_addr addr, *eaddr = &addr; - srand(time(NULL)); - int r[ETH_ALEN]; - for (int i = 0; i < ETH_ALEN; i++) { - r[i] = rand() % 16; // 16: 0x0-0xf - eaddr->ether_addr_octet[i] = r[i]; - } + struct ether_addr addr = {{11,12,13,4,15,16}}, *eaddr = &addr; char buf[100], *p = ether_ntoa_r(eaddr, buf); - char str1[buffer_size], str2[buffer_size]; - // 0, 1, 2, 3, 4, 5: 6 elements of mac address. - (void)sprintf_s(str1, sizeof(str1), "%x:%x:%x:%x:%x:%x", r[0], r[1], r[2], r[3], r[4], r[5]); - // 0, 1, 2, 3, 4, 5: 6 elements of mac address. - (void)sprintf_s(str2, sizeof(str2), "%.2x:%.2x:%.2x:%.2x:%.2x:%.2x", r[0], r[1], r[2], r[3], r[4], r[5]); - ICUNIT_ASSERT_EQUAL(p, buf, (intptr_t)p); - ICUNIT_ASSERT_EQUAL((stricmp(str1, buf) == 0 || stricmp(str2, buf) == 0), 1, printf("%s\n", p)); + ICUNIT_ASSERT_EQUAL((stricmp("b:c:d:4:f:10", buf) == 0 || stricmp("0b:0c:0d:04:0f:10", buf) == 0), 1, printf("%s\n", p)); return ICUNIT_SUCCESS; } diff --git a/src/kernel_liteos_a/testsuites/unittest/net/socket/config.gni b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/socket/config.gni similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/net/socket/config.gni rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/socket/config.gni diff --git a/src/kernel_liteos_a/testsuites/unittest/net/socket/lt_net_socket.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/socket/lt_net_socket.h similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/net/socket/lt_net_socket.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/socket/lt_net_socket.h diff --git a/src/kernel_liteos_a/testsuites/unittest/net/socket/net_socket_test.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/socket/net_socket_test.cpp similarity index 95% rename from src/kernel_liteos_a/testsuites/unittest/net/socket/net_socket_test.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/socket/net_socket_test.cpp index bf71bf33..01fff55c 100644 --- a/src/kernel_liteos_a/testsuites/unittest/net/socket/net_socket_test.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/socket/net_socket_test.cpp @@ -176,5 +176,16 @@ HWTEST_F(NetSocketTest, NetSocketTest012, TestSize.Level0) NetSocketTest012(); } +/* * + * @tc.name: NetSocketTest013 + * @tc.desc: function for NetSocketTest + * @tc.type: FUNC + */ +/* +HWTEST_F(NetSocketTest, NetSocketTest013, TestSize.Level0) +{ + //NetSocketTest013(); // broadcast to self to be supported. +} +*/ #endif } diff --git a/src/kernel_liteos_a/testsuites/unittest/net/socket/smoke/net_socket_test_001.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/socket/smoke/net_socket_test_001.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/net/socket/smoke/net_socket_test_001.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/socket/smoke/net_socket_test_001.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/net/socket/smoke/net_socket_test_002.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/socket/smoke/net_socket_test_002.cpp similarity index 93% rename from src/kernel_liteos_a/testsuites/unittest/net/socket/smoke/net_socket_test_002.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/socket/smoke/net_socket_test_002.cpp index d0a4ce68..20d2193c 100644 --- a/src/kernel_liteos_a/testsuites/unittest/net/socket/smoke/net_socket_test_002.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/socket/smoke/net_socket_test_002.cpp @@ -64,7 +64,7 @@ static int UdpTest(void) srvAddr.sin_family = AF_INET; srvAddr.sin_addr.s_addr = inet_addr(STACK_IP); srvAddr.sin_port = htons(STACK_PORT); - ret = bind(sfd, reinterpret_cast(&srvAddr), sizeof(srvAddr)); + ret = bind(sfd, (struct sockaddr*)&srvAddr, sizeof(srvAddr)); ICUNIT_ASSERT_EQUAL(ret, 0, ret); /* send */ @@ -75,14 +75,14 @@ static int UdpTest(void) ICUNIT_ASSERT_EQUAL(ret, 0, ret); ret = strcpy_s(g_buf, BUF_SIZE, MSG); ICUNIT_ASSERT_EQUAL(ret, 0, ret); - ret = sendto(sfd, g_buf, strlen(MSG), 0, reinterpret_cast(&clnAddr), - static_cast(sizeof(clnAddr))); + ret = sendto(sfd, g_buf, strlen(MSG), 0, (struct sockaddr*)&clnAddr, + (socklen_t)sizeof(clnAddr)); ICUNIT_ASSERT_NOT_EQUAL(ret, -1, ret); /* recv */ ret = memset_s(g_buf, BUF_SIZE, 0, BUF_SIZE); ICUNIT_ASSERT_EQUAL(ret, 0, ret); - ret = recvfrom(sfd, g_buf, sizeof(g_buf), 0, reinterpret_cast(&clnAddr), + ret = recvfrom(sfd, g_buf, sizeof(g_buf), 0, (struct sockaddr*)&clnAddr, &clnAddrLen); ICUNIT_ASSERT_EQUAL(ret, strlen(MSG), ret); diff --git a/src/kernel_liteos_a/testsuites/unittest/net/socket/smoke/net_socket_test_003.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/socket/smoke/net_socket_test_003.cpp similarity index 89% rename from src/kernel_liteos_a/testsuites/unittest/net/socket/smoke/net_socket_test_003.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/socket/smoke/net_socket_test_003.cpp index d180968f..92500214 100644 --- a/src/kernel_liteos_a/testsuites/unittest/net/socket/smoke/net_socket_test_003.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/socket/smoke/net_socket_test_003.cpp @@ -68,7 +68,7 @@ static int SampleTcpServer() srvAddr.sin_family = AF_INET; srvAddr.sin_addr.s_addr = inet_addr(STACK_IP); srvAddr.sin_port = htons(STACK_PORT); - ret = bind(lsfd, reinterpret_cast(&srvAddr), sizeof(srvAddr)); + ret = bind(lsfd, (struct sockaddr*)&srvAddr, sizeof(srvAddr)); LogPrintln("bind socket %d to %s:%d: %d", lsfd, inet_ntoa(srvAddr.sin_addr), ntohs(srvAddr.sin_port), ret); ICUNIT_ASSERT_EQUAL(ret, 0, Wait() + ret); @@ -78,7 +78,7 @@ static int SampleTcpServer() Wait(); - sfd = accept(lsfd, reinterpret_cast(&clnAddr), &clnAddrLen); + sfd = accept(lsfd, (struct sockaddr*)&clnAddr, &clnAddrLen); LogPrintln("accept socket %d: %d <%s:%d>", lsfd, sfd, inet_ntoa(clnAddr.sin_addr), ntohs(clnAddr.sin_port)); ICUNIT_ASSERT_NOT_EQUAL(sfd, -1, sfd); @@ -175,27 +175,25 @@ static int SampleTcpClient() srvAddr.sin_family = AF_INET; srvAddr.sin_addr.s_addr = inet_addr(PEER_IP); srvAddr.sin_port = htons(PEER_PORT); - ret = connect(sfd, reinterpret_cast(&srvAddr), sizeof(srvAddr)); + ret = connect(sfd, (struct sockaddr*)&srvAddr, sizeof(srvAddr)); LogPrintln("connect socket %d to %s:%d: %d", sfd, inet_ntoa(srvAddr.sin_addr), ntohs(srvAddr.sin_port), ret); ICUNIT_ASSERT_EQUAL(ret, 0, ret); /* test getpeername */ ret = getpeername(sfd, &addr, &addrLen); - LogPrintln("getpeername %d %s:%d: %d", sfd, inet_ntoa((reinterpret_cast(&addr))->sin_addr), - ntohs((reinterpret_cast(&addr))->sin_port), ret); + LogPrintln("getpeername %d %s:%d: %d", sfd, inet_ntoa(((struct sockaddr_in*)&addr)->sin_addr), ntohs(((struct sockaddr_in*)&addr)->sin_port), ret); ICUNIT_ASSERT_EQUAL(ret, 0, ret); ICUNIT_ASSERT_EQUAL(addrLen, sizeof(struct sockaddr_in), addrLen); - ICUNIT_ASSERT_EQUAL((reinterpret_cast(&addr))->sin_addr.s_addr, - inet_addr(PEER_IP), (static_cast(&addr))->sin_addr.s_addr); + ICUNIT_ASSERT_EQUAL(((struct sockaddr_in*)&addr)->sin_addr.s_addr, + inet_addr(PEER_IP), ((struct sockaddr_in*)&addr)->sin_addr.s_addr); /* test getsockname */ ret = getsockname(sfd, &addr, &addrLen); - LogPrintln("getsockname %d %s:%d: %d", sfd, inet_ntoa((reinterpret_cast(&addr))->sin_addr), - ntohs((reinterpret_cast(&addr))->sin_port), ret); + LogPrintln("getsockname %d %s:%d: %d", sfd, inet_ntoa(((struct sockaddr_in*)&addr)->sin_addr), ntohs(((struct sockaddr_in*)&addr)->sin_port), ret); ICUNIT_ASSERT_EQUAL(ret, 0, ret); ICUNIT_ASSERT_EQUAL(addrLen, sizeof(struct sockaddr_in), addrLen); - ICUNIT_ASSERT_EQUAL((reinterpret_cast(&addr))->sin_addr.s_addr, - inet_addr(STACK_IP), (static_cast(&addr))->sin_addr.s_addr); + ICUNIT_ASSERT_EQUAL(((struct sockaddr_in*)&addr)->sin_addr.s_addr, + inet_addr(STACK_IP), ((struct sockaddr_in*)&addr)->sin_addr.s_addr); /* send */ ret = memset_s(gBuf, BUF_SIZE + 1, 0, BUF_SIZE + 1); @@ -269,13 +267,13 @@ static int SampleTcpClient() static void* TcpServerRoutine(void *p) { int ret = SampleTcpServer(); - return reinterpret_cast(ret); + return (void*)(intptr_t)ret; } static void* TcpClientRoutine(void *p) { int ret = SampleTcpClient(); - return reinterpret_cast(ret); + return (void*)(intptr_t)ret; } static int TcpTest() @@ -314,7 +312,7 @@ static int TcpTest() ret = pthread_barrier_destroy(&gBarrier); ICUNIT_ASSERT_EQUAL(ret, 0, ret); - return static_cast(reinterpret_cast(sret)) + static_cast(reinterpret_cast(cret)); + return (int)(intptr_t)(sret) + (int)(intptr_t)(cret); } void NetSocketTest003(void) diff --git a/src/kernel_liteos_a/testsuites/unittest/net/socket/smoke/net_socket_test_004.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/socket/smoke/net_socket_test_004.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/net/socket/smoke/net_socket_test_004.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/socket/smoke/net_socket_test_004.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/net/socket/smoke/net_socket_test_005.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/socket/smoke/net_socket_test_005.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/net/socket/smoke/net_socket_test_005.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/socket/smoke/net_socket_test_005.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/net/socket/smoke/net_socket_test_006.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/socket/smoke/net_socket_test_006.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/net/socket/smoke/net_socket_test_006.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/socket/smoke/net_socket_test_006.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/net/socket/smoke/net_socket_test_007.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/socket/smoke/net_socket_test_007.cpp similarity index 50% rename from src/kernel_liteos_a/testsuites/unittest/net/socket/smoke/net_socket_test_007.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/socket/smoke/net_socket_test_007.cpp index 1ceece68..94bc166b 100644 --- a/src/kernel_liteos_a/testsuites/unittest/net/socket/smoke/net_socket_test_007.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/socket/smoke/net_socket_test_007.cpp @@ -45,100 +45,90 @@ static int TcpTest() lsfd = socket(AF_INET, SOCK_STREAM, 0); ICUNIT_ASSERT_NOT_EQUAL(lsfd, -1, lsfd); - ret = bind(lsfd, reinterpret_cast(INVALID_USER_ADDR), sizeof(struct sockaddr_in)); + ret = bind(lsfd, (const struct sockaddr *)INVALID_USER_ADDR, sizeof(struct sockaddr_in)); ICUNIT_ASSERT_EQUAL(ret, -1, ret); - ret = bind(lsfd, reinterpret_cast(INVALID_KERNEL_ADDR), sizeof(struct sockaddr_in)); + ret = bind(lsfd, (const struct sockaddr *)INVALID_KERNEL_ADDR, sizeof(struct sockaddr_in)); ICUNIT_ASSERT_EQUAL(ret, -1, ret); - ret = connect(lsfd, reinterpret_cast(INVALID_USER_ADDR), sizeof(struct sockaddr_in)); + ret = connect(lsfd, (struct sockaddr*)INVALID_USER_ADDR, sizeof(struct sockaddr_in)); ICUNIT_ASSERT_EQUAL(ret, -1, ret); - ret = connect(lsfd, reinterpret_cast(INVALID_KERNEL_ADDR), sizeof(struct sockaddr_in)); + ret = connect(lsfd, (struct sockaddr*)INVALID_KERNEL_ADDR, sizeof(struct sockaddr_in)); ICUNIT_ASSERT_EQUAL(ret, -1, ret); - ret = accept(lsfd, reinterpret_cast(INVALID_USER_ADDR), - reinterpret_cast(INVALID_USER_ADDR)); + ret = accept(lsfd, (struct sockaddr*)INVALID_USER_ADDR, (socklen_t *)INVALID_USER_ADDR); ICUNIT_ASSERT_EQUAL(ret, -1, ret); - ret = accept(lsfd, reinterpret_cast(INVALID_KERNEL_ADDR), - reinterpret_cast(INVALID_KERNEL_ADDR)); + ret = accept(lsfd, (struct sockaddr*)INVALID_KERNEL_ADDR, (socklen_t *)INVALID_KERNEL_ADDR); ICUNIT_ASSERT_EQUAL(ret, -1, ret); - ret = getsockname(lsfd, reinterpret_cast(INVALID_USER_ADDR), - reinterpret_cast(INVALID_USER_ADDR)); + ret = getsockname(lsfd, (struct sockaddr*)INVALID_USER_ADDR, (socklen_t *)INVALID_USER_ADDR); ICUNIT_ASSERT_EQUAL(ret, -1, ret); - ret = getsockname(lsfd, reinterpret_cast(INVALID_KERNEL_ADDR), - reinterpret_cast(INVALID_KERNEL_ADDR)); + ret = getsockname(lsfd, (struct sockaddr*)INVALID_KERNEL_ADDR, (socklen_t *)INVALID_KERNEL_ADDR); ICUNIT_ASSERT_EQUAL(ret, -1, ret); - ret = getpeername(lsfd, reinterpret_cast(INVALID_USER_ADDR), - reinterpret_cast(INVALID_USER_ADDR)); + ret = getpeername(lsfd, (struct sockaddr*)INVALID_USER_ADDR, (socklen_t *)INVALID_USER_ADDR); ICUNIT_ASSERT_EQUAL(ret, -1, ret); - ret = getpeername(lsfd, reinterpret_cast(INVALID_KERNEL_ADDR), - reinterpret_cast(INVALID_KERNEL_ADDR)); + ret = getpeername(lsfd, (struct sockaddr*)INVALID_KERNEL_ADDR, (socklen_t *)INVALID_KERNEL_ADDR); ICUNIT_ASSERT_EQUAL(ret, -1, ret); - ret = send(lsfd, reinterpret_cast(INVALID_USER_ADDR), strlen(SRV_MSG), 0); + ret = send(lsfd, (char *)INVALID_USER_ADDR, strlen(SRV_MSG), 0); ICUNIT_ASSERT_EQUAL(ret, -1, ret); - ret = send(lsfd, reinterpret_cast(INVALID_KERNEL_ADDR), strlen(SRV_MSG), 0); + ret = send(lsfd, (char *)INVALID_KERNEL_ADDR, strlen(SRV_MSG), 0); ICUNIT_ASSERT_EQUAL(ret, -1, ret); - ret = sendto(lsfd, reinterpret_cast(INVALID_USER_ADDR), strlen(SRV_MSG), 0, - reinterpret_cast(INVALID_USER_ADDR), static_cast(sizeof(struct sockaddr_in))); + ret = sendto(lsfd, (char *)INVALID_USER_ADDR, strlen(SRV_MSG), 0, (struct sockaddr*)INVALID_USER_ADDR, + (socklen_t)sizeof(struct sockaddr_in)); ICUNIT_ASSERT_EQUAL(ret, -1, ret); - ret = sendto(lsfd, reinterpret_cast(INVALID_KERNEL_ADDR), strlen(SRV_MSG), 0, - reinterpret_cast(INVALID_KERNEL_ADDR), static_cast(sizeof(struct sockaddr_in))); + ret = sendto(lsfd, (char *)INVALID_KERNEL_ADDR, strlen(SRV_MSG), 0, (struct sockaddr*)INVALID_KERNEL_ADDR, + (socklen_t)sizeof(struct sockaddr_in)); ICUNIT_ASSERT_EQUAL(ret, -1, ret); - ret = recv(lsfd, reinterpret_cast(INVALID_USER_ADDR), sizeof(SRV_MSG), 0); + ret = recv(lsfd, (char *)INVALID_USER_ADDR, sizeof(SRV_MSG), 0); ICUNIT_ASSERT_EQUAL(ret, -1, ret); - ret = recv(lsfd, reinterpret_cast(INVALID_KERNEL_ADDR), sizeof(SRV_MSG), 0); + ret = recv(lsfd, (char *)INVALID_KERNEL_ADDR, sizeof(SRV_MSG), 0); ICUNIT_ASSERT_EQUAL(ret, -1, ret); - ret = recvfrom(lsfd, reinterpret_cast(INVALID_USER_ADDR), sizeof(SRV_MSG), 0, - reinterpret_cast(INVALID_USER_ADDR), reinterpret_cast(INVALID_USER_ADDR)); + ret = recvfrom(lsfd, (char *)INVALID_USER_ADDR, sizeof(SRV_MSG), 0, (struct sockaddr*)INVALID_USER_ADDR, + (socklen_t *)INVALID_USER_ADDR); ICUNIT_ASSERT_EQUAL(ret, -1, ret); - ret = recvfrom(lsfd, reinterpret_cast(INVALID_KERNEL_ADDR), sizeof(SRV_MSG), 0, - reinterpret_cast(INVALID_KERNEL_ADDR), reinterpret_cast(INVALID_KERNEL_ADDR)); + ret = recvfrom(lsfd, (char *)INVALID_KERNEL_ADDR, sizeof(SRV_MSG), 0, (struct sockaddr*)INVALID_KERNEL_ADDR, + (socklen_t *)INVALID_KERNEL_ADDR); ICUNIT_ASSERT_EQUAL(ret, -1, ret); - ret = setsockopt(lsfd, SOL_SOCKET, SO_RCVTIMEO, reinterpret_cast(INVALID_USER_ADDR), - static_cast(sizeof(struct timeval))); + ret = setsockopt(lsfd, SOL_SOCKET, SO_RCVTIMEO, (struct timeval *)INVALID_USER_ADDR, (socklen_t)sizeof(struct timeval)); ICUNIT_ASSERT_EQUAL(ret, -1, ret); - ret = setsockopt(lsfd, SOL_SOCKET, SO_RCVTIMEO, reinterpret_cast(INVALID_KERNEL_ADDR), - static_cast(sizeof(struct timeval))); + ret = setsockopt(lsfd, SOL_SOCKET, SO_RCVTIMEO, (struct timeval *)INVALID_KERNEL_ADDR, (socklen_t)sizeof(struct timeval)); ICUNIT_ASSERT_EQUAL(ret, -1, ret); - ret = getsockopt(lsfd, SOL_SOCKET, SO_RCVTIMEO, reinterpret_cast(INVALID_USER_ADDR), - reinterpret_cast(sizeof(struct timeval))); + ret = getsockopt(lsfd, SOL_SOCKET, SO_RCVTIMEO, (struct timeval *)INVALID_USER_ADDR, (socklen_t*)sizeof(struct timeval)); ICUNIT_ASSERT_EQUAL(ret, -1, ret); - ret = getsockopt(lsfd, SOL_SOCKET, SO_RCVTIMEO, reinterpret_cast(INVALID_KERNEL_ADDR), - reinterpret_cast(sizeof(struct timeval))); + ret = getsockopt(lsfd, SOL_SOCKET, SO_RCVTIMEO, (struct timeval *)INVALID_KERNEL_ADDR, (socklen_t*)sizeof(struct timeval)); ICUNIT_ASSERT_EQUAL(ret, -1, ret); - ret = sendmsg(lsfd, reinterpret_cast(INVALID_USER_ADDR), 0); + ret = sendmsg(lsfd, (struct msghdr *)INVALID_USER_ADDR, 0); ICUNIT_ASSERT_EQUAL(ret, -1, ret); - ret = sendmsg(lsfd, reinterpret_cast(INVALID_KERNEL_ADDR), 0); + ret = sendmsg(lsfd, (struct msghdr *)INVALID_KERNEL_ADDR, 0); ICUNIT_ASSERT_EQUAL(ret, -1, ret); - msg.msg_name = reinterpret_cast(INVALID_USER_ADDR); + msg.msg_name = (char *)INVALID_USER_ADDR; msg.msg_namelen = sizeof(struct sockaddr_in); - msg.msg_iov = reinterpret_cast(INVALID_KERNEL_ADDR); + msg.msg_iov = (struct iovec *)INVALID_KERNEL_ADDR; msg.msg_iovlen = 2; - ret = recvmsg(lsfd, static_cast(&msg), 0); + ret = recvmsg(lsfd, (struct msghdr *)&msg, 0); ICUNIT_ASSERT_EQUAL(ret, -1, ret); - ret = recvmsg(lsfd, static_cast(&msg), 0); + ret = recvmsg(lsfd, (struct msghdr *)&msg, 0); ICUNIT_ASSERT_EQUAL(ret, -1, ret); #ifdef TEST_BIG_MEM diff --git a/src/kernel_liteos_a/testsuites/unittest/net/socket/smoke/net_socket_test_008.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/socket/smoke/net_socket_test_008.cpp similarity index 96% rename from src/kernel_liteos_a/testsuites/unittest/net/socket/smoke/net_socket_test_008.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/socket/smoke/net_socket_test_008.cpp index 49e642b5..dd76e80b 100644 --- a/src/kernel_liteos_a/testsuites/unittest/net/socket/smoke/net_socket_test_008.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/socket/smoke/net_socket_test_008.cpp @@ -121,7 +121,7 @@ static int HandleAccept(int lsfd) { struct sockaddr_in sa; int saLen = sizeof(sa); - int fd = accept(lsfd, reinterpret_cast(&sa), reinterpret_cast(&saLen)); + int fd = accept(lsfd, (struct sockaddr *)&sa, (socklen_t *)&saLen); if (fd == INVALID_SOCKET) { perror("accept"); return -1; @@ -168,7 +168,7 @@ static void *ClientsThread(void *param) sa.sin_family = AF_INET; sa.sin_addr.s_addr = htonl(INADDR_LOOPBACK); sa.sin_port = htons(SERVER_PORT); - if (connect(fd, reinterpret_cast(&sa), sizeof(sa)) == -1) { + if (connect(fd, (struct sockaddr *)&sa, sizeof(sa)) == -1) { perror("connect"); return NULL; } @@ -224,7 +224,7 @@ static int SelectTest(void) sa.sin_family = AF_INET; sa.sin_addr.s_addr = htonl(INADDR_ANY); sa.sin_port = htons(SERVER_PORT); - ret = bind(lsfd, reinterpret_cast(&sa), sizeof(sa)); + ret = bind(lsfd, (struct sockaddr *)&sa, sizeof(sa)); ICUNIT_ASSERT_NOT_EQUAL(ret, -1, errno + CloseAllFd()); ret = listen(lsfd, BACKLOG); diff --git a/src/kernel_liteos_a/testsuites/unittest/net/socket/smoke/net_socket_test_009.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/socket/smoke/net_socket_test_009.cpp similarity index 96% rename from src/kernel_liteos_a/testsuites/unittest/net/socket/smoke/net_socket_test_009.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/socket/smoke/net_socket_test_009.cpp index 9d76513c..f864727e 100644 --- a/src/kernel_liteos_a/testsuites/unittest/net/socket/smoke/net_socket_test_009.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/socket/smoke/net_socket_test_009.cpp @@ -120,7 +120,7 @@ static int HandleAccept(int lsfd) { struct sockaddr_in sa; int saLen = sizeof(sa); - int fd = accept(lsfd, reinterpret_cast(&sa), reinterpret_cast(&saLen)); + int fd = accept(lsfd, (struct sockaddr *)&sa, (socklen_t *)&saLen); if (fd == INVALID_SOCKET) { perror("accept"); return -1; @@ -168,7 +168,7 @@ static void *ClientsThread(void *param) sa.sin_family = AF_INET; sa.sin_addr.s_addr = htonl(INADDR_LOOPBACK); sa.sin_port = htons(SERVER_PORT); - if (connect(fd, reinterpret_cast(&sa), sizeof(sa)) == -1) { + if (connect(fd, (struct sockaddr *)&sa, sizeof(sa)) == -1) { perror("connect"); return NULL; } @@ -224,7 +224,7 @@ static int PollTest(void) sa.sin_family = AF_INET; sa.sin_addr.s_addr = htonl(INADDR_ANY); sa.sin_port = htons(SERVER_PORT); - ret = bind(lsfd, reinterpret_cast(&sa), sizeof(sa)); + ret = bind(lsfd, (struct sockaddr *)&sa, sizeof(sa)); ICUNIT_ASSERT_NOT_EQUAL(ret, -1, errno + CloseAllFd()); ret = listen(lsfd, BACKLOG); diff --git a/src/kernel_liteos_a/testsuites/unittest/net/socket/smoke/net_socket_test_010.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/socket/smoke/net_socket_test_010.cpp similarity index 96% rename from src/kernel_liteos_a/testsuites/unittest/net/socket/smoke/net_socket_test_010.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/socket/smoke/net_socket_test_010.cpp index f4478be1..5638d094 100644 --- a/src/kernel_liteos_a/testsuites/unittest/net/socket/smoke/net_socket_test_010.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/socket/smoke/net_socket_test_010.cpp @@ -77,8 +77,7 @@ static unsigned IfName2Index(int fd, const char *name) struct ifreq ifr; int ret; - ret = strncpy_s(ifr.ifr_name, sizeof(ifr.ifr_name) - 1, name, sizeof(ifr.ifr_name) - 1); - ICUNIT_ASSERT_EQUAL(ret, 0, ret); + (void)strncpy_s(ifr.ifr_name, sizeof(ifr.ifr_name) - 1, name, sizeof(ifr.ifr_name) - 1); ifr.ifr_name[sizeof(ifr.ifr_name) - 1] = '\0'; ret = ioctl(fd, SIOCGIFINDEX, &ifr); return ret < 0 ? 0 : ifr.ifr_ifindex; @@ -117,11 +116,11 @@ static int IoctlTestInternal(int sfd) LogPrintln("ifindex %u: %s", lanIndex, p); ICUNIT_ASSERT_NOT_EQUAL(p, NULL, errno); - ret = strncpy_s(gDefaultNetif, sizeof(gDefaultNetif) - 1, p, sizeof(gDefaultNetif) - 1); + ret = strncpy_s(gDefaultNetif, sizeof(gDefaultNetif) -1, p, sizeof(gDefaultNetif) - 1); ICUNIT_ASSERT_EQUAL(ret, 0, ret); gDefaultNetif[sizeof(gDefaultNetif) - 1] = '\0'; - ret = static_cast(IfName2Index(sfd, p)); + ret = (int)IfName2Index(sfd, p); LogPrintln("index of %s: %d", p, ret); ICUNIT_ASSERT_NOT_EQUAL(ret, 0, errno); diff --git a/src/kernel_liteos_a/testsuites/unittest/net/socket/smoke/net_socket_test_011.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/socket/smoke/net_socket_test_011.cpp similarity index 96% rename from src/kernel_liteos_a/testsuites/unittest/net/socket/smoke/net_socket_test_011.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/socket/smoke/net_socket_test_011.cpp index 0cceb863..e71a30c7 100644 --- a/src/kernel_liteos_a/testsuites/unittest/net/socket/smoke/net_socket_test_011.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/socket/smoke/net_socket_test_011.cpp @@ -143,7 +143,7 @@ static void *ClientsThread(void *param) sa.sin_family = AF_INET; sa.sin_addr.s_addr = htonl(INADDR_LOOPBACK); sa.sin_port = htons(SERVER_PORT); - if (connect(fd, reinterpret_cast(&sa), sizeof(sa)) == -1) { + if (connect(fd, (struct sockaddr *)&sa, sizeof(sa)) == -1) { perror("connect"); return NULL; } @@ -181,9 +181,6 @@ static int StartClients(pthread_t *cli, int cliNum) for (int i = 0; i < cliNum; ++i) { ret = pthread_attr_init(&attr); param.sched_priority = param.sched_priority + 1; - if (param.sched_priority > 31) { /* 31: prio */ - param.sched_priority = 31; /* 31: prio */ - } pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED); pthread_attr_setschedparam(&attr, ¶m); @@ -207,7 +204,7 @@ static int UdpSelectTest(void) sa.sin_family = AF_INET; sa.sin_addr.s_addr = htonl(INADDR_ANY); sa.sin_port = htons(SERVER_PORT); - ret = bind(lsfd, reinterpret_cast(&sa), sizeof(sa)); + ret = bind(lsfd, (struct sockaddr *)&sa, sizeof(sa)); ICUNIT_ASSERT_NOT_EQUAL(ret, -1, errno + CloseAllFd()); InitFds(); diff --git a/src/kernel_liteos_a/testsuites/unittest/net/socket/smoke/net_socket_test_012.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/socket/smoke/net_socket_test_012.cpp similarity index 95% rename from src/kernel_liteos_a/testsuites/unittest/net/socket/smoke/net_socket_test_012.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/socket/smoke/net_socket_test_012.cpp index f2f0a034..f7d684c2 100644 --- a/src/kernel_liteos_a/testsuites/unittest/net/socket/smoke/net_socket_test_012.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/socket/smoke/net_socket_test_012.cpp @@ -43,11 +43,11 @@ static int SocketNullTestInternal(int sfd) { int ret; struct sockaddr addr = {0}; - struct sockaddr *bad = reinterpret_cast(0xbad); + struct sockaddr *bad = (struct sockaddr *)0xbad; socklen_t addrlen = sizeof(addr); socklen_t zero = 0; struct msghdr message = {0}; - void *badUserAddr = reinterpret_cast(0x3effffff); + void *badUserAddr = (void*)0x3effffff; /** * accept @@ -216,13 +216,13 @@ static int SocketNullTestInternal(int sfd) LogPrintln("recvmsg: %d, errno=%d", ret, errno); ICUNIT_ASSERT_EQUAL(ret, -1, errno); - message.msg_iov = reinterpret_cast(0xbad); + message.msg_iov = (struct iovec *)((void *)0xbad); message.msg_iovlen = 1; ret = recvmsg(sfd, &message, MSG_DONTWAIT); LogPrintln("recvmsg: %d, errno=%d", ret, errno); ICUNIT_ASSERT_EQUAL(ret, -1, errno); - message.msg_iov = reinterpret_cast(0xbad); + message.msg_iov = (struct iovec *)((void *)0xbad); message.msg_iovlen = 0; ret = recvmsg(sfd, &message, MSG_DONTWAIT); LogPrintln("recvmsg: %d, errno=%d", ret, errno); @@ -264,13 +264,13 @@ static int SocketNullTestInternal(int sfd) LogPrintln("sendmsg: %d, errno=%d", ret, errno); ICUNIT_ASSERT_EQUAL(ret, -1, errno); - message.msg_iov = reinterpret_cast(0xbad); + message.msg_iov = (struct iovec *)0xbad; message.msg_iovlen = 1; ret = sendmsg(sfd, &message, MSG_NOSIGNAL); LogPrintln("sendmsg: %d, errno=%d", ret, errno); ICUNIT_ASSERT_EQUAL(ret, -1, errno); - message.msg_iov = reinterpret_cast(0xbad); + message.msg_iov = (struct iovec *)0xbad; message.msg_iovlen = 0; ret = sendmsg(sfd, &message, MSG_NOSIGNAL); LogPrintln("sendmsg: %d, errno=%d", ret, errno); @@ -326,11 +326,11 @@ static int SocketNullTestInternal(int sfd) LogPrintln("read: %d, errno=%d", ret, errno); ICUNIT_ASSERT_EQUAL((ret == 0 || ret == -1), 1, errno); - ret = readv(sfd, reinterpret_cast(bad), 0); + ret = readv(sfd, (struct iovec *)bad, 0); LogPrintln("readv: %d, errno=%d", ret, errno); ICUNIT_ASSERT_EQUAL((ret == 0 || ret == -1), 1, errno); - ret = readv(sfd, reinterpret_cast(bad), 1); + ret = readv(sfd, (struct iovec *)bad, 1); LogPrintln("readv: %d, errno=%d", ret, errno); ICUNIT_ASSERT_EQUAL(ret, -1, errno); @@ -377,11 +377,11 @@ static int SocketNullTestInternal(int sfd) LogPrintln("write: %d, errno=%d", ret, errno); ICUNIT_ASSERT_EQUAL((ret == 0 || ret == -1), 1, errno); - ret = writev(sfd, reinterpret_cast(bad), 0); + ret = writev(sfd, (struct iovec *)bad, 0); LogPrintln("writev: %d, errno=%d", ret, errno); ICUNIT_ASSERT_EQUAL((ret == 0 || ret == -1), 1, errno); - ret = writev(sfd, reinterpret_cast(bad), 1); + ret = writev(sfd, (struct iovec *)bad, 1); LogPrintln("writev: %d, errno=%d", ret, errno); ICUNIT_ASSERT_EQUAL(ret, -1, errno); diff --git a/src/kernel_liteos_a/testsuites/unittest/net/socket/smoke/net_socket_test_013.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/socket/smoke/net_socket_test_013.cpp similarity index 96% rename from src/kernel_liteos_a/testsuites/unittest/net/socket/smoke/net_socket_test_013.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/socket/smoke/net_socket_test_013.cpp index 6c129f18..1f435686 100644 --- a/src/kernel_liteos_a/testsuites/unittest/net/socket/smoke/net_socket_test_013.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/net/socket/smoke/net_socket_test_013.cpp @@ -140,7 +140,7 @@ static unsigned int GetIp(int sfd, const char *ifname) ifr.ifr_name[sizeof(ifr.ifr_name) - 1] = '\0'; ret = ioctl(sfd, SIOCGIFADDR, &ifr); if (ret == 0) { - ip = (reinterpret_cast(&(ifr.ifr_addr)))->sin_addr.s_addr; + ip = ((struct sockaddr_in *)&(ifr.ifr_addr))->sin_addr.s_addr; } return ip; } @@ -156,7 +156,7 @@ static unsigned int GetNetmask(int sfd, const char *ifname) ifr.ifr_name[sizeof(ifr.ifr_name) - 1] = '\0'; ret = ioctl(sfd, SIOCGIFNETMASK, &ifr); if (ret == 0) { - msk = (reinterpret_cast(&(ifr.ifr_addr)))->sin_addr.s_addr; + msk = ((struct sockaddr_in *)&(ifr.ifr_addr))->sin_addr.s_addr; } return msk; } @@ -207,7 +207,7 @@ static void *ClientsThread(void *param) sa.sin_family = AF_INET; sa.sin_addr.s_addr = brdcast; sa.sin_port = htons(SERVER_PORT); - if (connect(fd, reinterpret_cast(&sa), sizeof(sa)) == -1) { + if (connect(fd, (struct sockaddr *)&sa, sizeof(sa)) == -1) { perror("connect"); return NULL; } @@ -263,7 +263,7 @@ static int UdpBrdcastSelectTest(void) sa.sin_family = AF_INET; sa.sin_addr.s_addr = htonl(INADDR_ANY); sa.sin_port = htons(SERVER_PORT); - ret = bind(lsfd, reinterpret_cast(&sa), sizeof(sa)); + ret = bind(lsfd, (struct sockaddr *)&sa, sizeof(sa)); ICUNIT_ASSERT_NOT_EQUAL(ret, -1, errno + CloseAllFd()); int broadcast = 1; diff --git a/src/kernel_liteos_a/testsuites/unittest/process/fs/BUILD.gn b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/BUILD.gn similarity index 84% rename from src/kernel_liteos_a/testsuites/unittest/process/fs/BUILD.gn rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/BUILD.gn index 2308401a..e6a8ac2f 100644 --- a/src/kernel_liteos_a/testsuites/unittest/process/fs/BUILD.gn +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2023-2023 Huawei Device Co., Ltd. All rights reserved. +# Copyright (c) 2022-2022 Huawei Device Co., Ltd. All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: @@ -26,10 +26,12 @@ # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +import("//build/lite/config/test.gni") +import("//kernel/liteos_a/testsuites/unittest/config.gni") import("./config.gni") if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_LOW) { - unittest("liteos_a_process_fs_unittest_door") { + unittest("liteos_a_process_basic_unittest_door") { output_extension = "bin" output_dir = "$root_out_dir/test/unittest/kernel" include_dirs = common_include_dirs @@ -38,12 +40,12 @@ if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_LOW) { sources_full = [] sources += sources_full configs = [ "../..:public_config_for_door" ] - deps = [ "$THIRDPARTY_BOUNDS_CHECKING_FUNCTION_DIR:libsec_shared" ] + deps = [ "//third_party/bounds_checking_function:libsec_shared" ] } } if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_MIDDLE) { - unittest("liteos_a_process_fs_unittest") { + unittest("liteos_a_process_basic_unittest") { output_extension = "bin" output_dir = "$root_out_dir/test/unittest/kernel" include_dirs = common_include_dirs @@ -51,6 +53,6 @@ if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_MIDDLE) { sources += sources_smoke sources += sources_full configs = [ "../..:public_config_for_all" ] - deps = [ "$THIRDPARTY_BOUNDS_CHECKING_FUNCTION_DIR:libsec_shared" ] + deps = [ "//third_party/bounds_checking_function:libsec_shared" ] } } diff --git a/src/kernel_liteos_a/testsuites/unittest/libc/time/config.gni b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/config.gni similarity index 69% rename from src/kernel_liteos_a/testsuites/unittest/libc/time/config.gni rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/config.gni index b413e23a..b27261db 100644 --- a/src/kernel_liteos_a/testsuites/unittest/libc/time/config.gni +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/config.gni @@ -1,4 +1,4 @@ -# Copyright (c) 2023 Huawei Device Co., Ltd. All rights reserved. +# Copyright (c) 2022-2022 Huawei Device Co., Ltd. All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: @@ -27,11 +27,10 @@ # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. import("//build/lite/config/test.gni") -import("//kernel/liteos_a/liteos.gni") import("//kernel/liteos_a/testsuites/unittest/config.gni") common_include_dirs = [ - "$THIRDPARTY_GOOGLETEST_DIR/googletest/include", + "//third_party/googletest/googletest/include", "../../common/include", ] @@ -41,20 +40,19 @@ sources_smoke = [] sources_full = [] -# libc time clock module -if (LOSCFG_USER_TEST_LIBC_TIME_CLOCK == true) { - import("./clock/config.gni") - common_include_dirs += libc_time_clock_include_dirs - sources_entry += libc_time_clock_sources_entry - sources_smoke += libc_time_clock_sources_smoke - sources_full += libc_time_clock_sources_full +# basic module +if (LOSCFG_USER_TEST_PROCESS == true) { + import("./process/config.gni") + common_include_dirs += process_include_dirs + sources_entry += process_sources_entry + sources_smoke += process_sources_smoke + sources_full += process_sources_full } -# libc time timer module -if (LOSCFG_USER_TEST_LIBC_TIME_TIMER == true) { - import("./timer/config.gni") - common_include_dirs += libc_time_timer_include_dirs - sources_entry += libc_time_timer_sources_entry - sources_smoke += libc_time_timer_sources_smoke - sources_full += libc_time_timer_sources_full +if (LOSCFG_USER_TEST_PTHREAD == true) { + import("./pthread/config.gni") + common_include_dirs += pthread_include_dirs + sources_entry += pthread_sources_entry + sources_smoke += pthread_sources_smoke + sources_full += pthread_sources_full } diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/process/config.gni b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/config.gni similarity index 89% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/process/config.gni rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/config.gni index f33462b0..a39668b7 100644 --- a/src/kernel_liteos_a/testsuites/unittest/process/basic/process/config.gni +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/config.gni @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023 Huawei Device Co., Ltd. All rights reserved. +# Copyright (c) 2022-2022 Huawei Device Co., Ltd. All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: @@ -26,28 +26,14 @@ # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -import("//build/lite/config/test.gni") -import("//kernel/liteos_a/liteos.gni") import("//kernel/liteos_a/testsuites/unittest/config.gni") -common_include_dirs = [ - "$THIRDPARTY_GOOGLETEST_DIR/googletest/include", - "../../../common/include", -] - -sources_entry = [ "../../../common/osTest.cpp" ] - -sources_smoke = [] +process_include_dirs = [ "$TEST_UNITTEST_DIR/process/basic/process" ] -sources_full = [] - -process_basic_process_include_dirs = - [ "$TEST_UNITTEST_DIR/process/basic/process" ] - -process_basic_process_sources_entry = +process_sources_entry = [ "$TEST_UNITTEST_DIR/process/basic/process/process_process_test.cpp" ] -process_basic_process_sources_smoke = [ +process_sources_smoke = [ "$TEST_UNITTEST_DIR/process/basic/process/smoke/process_test_001.cpp", "$TEST_UNITTEST_DIR/process/basic/process/smoke/process_test_002.cpp", "$TEST_UNITTEST_DIR/process/basic/process/smoke/process_test_004.cpp", @@ -95,7 +81,7 @@ process_basic_process_sources_smoke = [ "$TEST_UNITTEST_DIR/process/basic/process/smp/process_test_smp_008.cpp", ] -process_basic_process_sources_full = [ +process_sources_full = [ "$TEST_UNITTEST_DIR/process/basic/process/full/process_test_007.cpp", "$TEST_UNITTEST_DIR/process/basic/process/full/process_test_031.cpp", "$TEST_UNITTEST_DIR/process/basic/process/full/process_test_032.cpp", @@ -126,11 +112,3 @@ process_basic_process_sources_full = [ "$TEST_UNITTEST_DIR/process/basic/process/full/process_test_053.cpp", "$TEST_UNITTEST_DIR/process/basic/process/full/process_test_062.cpp", ] - -# process basic process module -if (LOSCFG_USER_TEST_PROCESS_BASIC_PROCESS == true) { - common_include_dirs += process_basic_process_include_dirs - sources_entry += process_basic_process_sources_entry - sources_smoke += process_basic_process_sources_smoke - sources_full += process_basic_process_sources_full -} diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/process/full/process_test_007.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/full/process_test_007.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/process/full/process_test_007.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/full/process_test_007.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/process/full/process_test_031.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/full/process_test_031.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/process/full/process_test_031.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/full/process_test_031.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/process/full/process_test_032.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/full/process_test_032.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/process/full/process_test_032.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/full/process_test_032.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/process/full/process_test_033.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/full/process_test_033.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/process/full/process_test_033.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/full/process_test_033.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/process/full/process_test_034.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/full/process_test_034.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/process/full/process_test_034.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/full/process_test_034.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/process/full/process_test_035.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/full/process_test_035.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/process/full/process_test_035.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/full/process_test_035.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/process/full/process_test_036.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/full/process_test_036.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/process/full/process_test_036.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/full/process_test_036.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/process/full/process_test_037.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/full/process_test_037.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/process/full/process_test_037.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/full/process_test_037.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/process/full/process_test_040.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/full/process_test_040.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/process/full/process_test_040.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/full/process_test_040.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/process/full/process_test_041.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/full/process_test_041.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/process/full/process_test_041.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/full/process_test_041.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/process/full/process_test_042.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/full/process_test_042.cpp similarity index 93% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/process/full/process_test_042.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/full/process_test_042.cpp index bade0abe..188cdf79 100644 --- a/src/kernel_liteos_a/testsuites/unittest/process/basic/process/full/process_test_042.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/full/process_test_042.cpp @@ -38,7 +38,7 @@ static void Child2(int shmid) { int count = 2; // 2, Set the calculation number to determine the cycle status. int *shared = (int *)shmat(shmid, nullptr, 0); - ICUNIT_ASSERT_NOT_EQUAL_VOID(shared, reinterpret_cast(-1), shared); + ICUNIT_ASSERT_NOT_EQUAL_VOID(shared, (void *)-1, shared); while ((*shared) < (TEST_LOOP + 2)) { // 2, Set the cycle number. ICUNIT_ASSERT_EQUAL_VOID(*shared, count, *shared); @@ -55,7 +55,7 @@ static void Child1(int shmid) { int count = 1; int *shared = (int *)shmat(shmid, nullptr, 0); - ICUNIT_ASSERT_NOT_EQUAL_VOID(shared, reinterpret_cast(-1), shared); + ICUNIT_ASSERT_NOT_EQUAL_VOID(shared, (void *)-1, shared); while ((*shared) < (TEST_LOOP + 1)) { ICUNIT_ASSERT_EQUAL_VOID(*shared, count, *shared); @@ -92,8 +92,7 @@ static int GroupProcess(void) ret = pthread_setschedparam(pthread_self(), SCHED_FIFO, ¶m); ICUNIT_ASSERT_EQUAL(ret, 0, ret); - /* 1234, Sets the shmget key; 0666 config of shmget */ - shmid = shmget(static_cast(1234), memSize, 0666 | IPC_CREAT); + shmid = shmget((key_t)1234, memSize, 0666 | IPC_CREAT); // 1234, Sets the shmget key; 0666 config of shmget ICUNIT_ASSERT_NOT_EQUAL(shmid, -1, shmid); pid = fork(); @@ -113,7 +112,7 @@ static int GroupProcess(void) } shared = (int *)shmat(shmid, nullptr, 0); - ICUNIT_ASSERT_NOT_EQUAL(shared, reinterpret_cast(-1), shared); + ICUNIT_ASSERT_NOT_EQUAL(shared, (void *)-1, shared); (*shared) = 0; diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/process/full/process_test_049.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/full/process_test_049.cpp similarity index 88% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/process/full/process_test_049.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/full/process_test_049.cpp index 70d38ea3..ff3f5832 100644 --- a/src/kernel_liteos_a/testsuites/unittest/process/basic/process/full/process_test_049.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/full/process_test_049.cpp @@ -45,11 +45,11 @@ static int TestThread(void *arg) int ret = 0; pthread_t gTh; ret = pthread_create(&gTh, NULL, PthreadTest115, NULL); - ICUNIT_ASSERT_EQUAL(ret, 0, ret); + ICUNIT_ASSERT_EQUAL_NULL(ret, 0, ret); ret = pthread_join(gTh, NULL); - ICUNIT_ASSERT_EQUAL(ret, 0, ret); - ICUNIT_ASSERT_EQUAL(g_usetTestCount, 1, g_usetTestCount); + ICUNIT_ASSERT_EQUAL_NULL(ret, 0, ret); + ICUNIT_ASSERT_EQUAL_NULL(g_usetTestCount, 1, g_usetTestCount); *g_shmptr = 100; // 100, set shared num. @@ -66,11 +66,11 @@ static int TestThread(void *arg) ret = waitpid(pid, NULL, 0); printf("waitpid ret : %d errno : %d pid : %d getpid : %d\n", ret, errno, pid, getpid()); - ICUNIT_ASSERT_EQUAL(ret, pid, ret); + ICUNIT_ASSERT_EQUAL_NULL(ret, pid, ret); *g_shmptr = data; EXIT: - return 0; + return NULL; } // This testcase us used for undefination of LOSCFG_USER_TEST_SMP @@ -88,19 +88,19 @@ static int Testcase(void) ICUNIT_ASSERT_NOT_EQUAL(shmid, -1, shmid); g_shmptr = (int *)shmat(shmid, nullptr, 0); - ICUNIT_ASSERT_NOT_EQUAL(g_shmptr, reinterpret_cast(-1), g_shmptr); + ICUNIT_ASSERT_NOT_EQUAL(g_shmptr, (int *)-1, g_shmptr); *g_shmptr = 0; - stack = static_cast(malloc(arg)); + stack = (char *)malloc(arg); ICUNIT_GOTO_NOT_EQUAL(stack, NULL, stack, EXIT1); - stackTop = reinterpret_cast(reinterpret_cast(stack) + arg); + stackTop = (char *)((unsigned long)stack + arg); pid = clone(TestThread, (void *)stackTop, CLONE_VFORK, &arg); ICUNIT_GOTO_EQUAL(*g_shmptr, arg, *g_shmptr, EXIT2); - ret = waitpid(pid, &status, 0); + ret = waitpid(pid, &status, NULL); ICUNIT_GOTO_EQUAL(ret, pid, ret, EXIT2); EXIT2: diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/process/full/process_test_050.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/full/process_test_050.cpp similarity index 92% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/process/full/process_test_050.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/full/process_test_050.cpp index 51da4d6e..839cb151 100644 --- a/src/kernel_liteos_a/testsuites/unittest/process/basic/process/full/process_test_050.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/full/process_test_050.cpp @@ -39,10 +39,10 @@ static int TestThread(void *arg) printf("TestThread ppid : %d g_ppid : %d\n", ppid, g_ppid); - ICUNIT_ASSERT_EQUAL(ppid, g_ppid, g_ppid); + ICUNIT_ASSERT_EQUAL_NULL(ppid, g_ppid, g_ppid); *g_shmptr = 100; // 100, set shared num. - return 0; + return NULL; } // This testcase us used for undefination of LOSCFG_USER_TEST_SMP @@ -55,12 +55,12 @@ static int Testcase(void) int ret; int count; pid_t pid; - + int shmid = shmget(IPC_PRIVATE, sizeof(int), IPC_CREAT | 0600); // 0600 config of shmget ICUNIT_ASSERT_NOT_EQUAL(shmid, -1, shmid); g_shmptr = (int *)shmat(shmid, nullptr, 0); - ICUNIT_ASSERT_NOT_EQUAL(g_shmptr, reinterpret_cast(-1), g_shmptr); + ICUNIT_ASSERT_NOT_EQUAL(g_shmptr, (int *)-1, g_shmptr); *g_shmptr = 0; @@ -70,10 +70,10 @@ static int Testcase(void) stack = malloc(arg); ICUNIT_GOTO_NOT_EQUAL(stack, NULL, stack, EXIT1); - stackTop = reinterpret_cast(reinterpret_cast(stack) + arg); + stackTop = (char *)((unsigned long)stack + arg); pid = clone(TestThread, (void *)stackTop, CLONE_PARENT, &arg); - ret = waitpid(pid, &status, 0); + ret = waitpid(pid, &status, NULL); ICUNIT_GOTO_EQUAL(ret, -1, ret, EXIT2); count = 0; diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/process/full/process_test_051.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/full/process_test_051.cpp similarity index 91% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/process/full/process_test_051.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/full/process_test_051.cpp index e46eacf6..4eed4367 100644 --- a/src/kernel_liteos_a/testsuites/unittest/process/basic/process/full/process_test_051.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/full/process_test_051.cpp @@ -41,7 +41,7 @@ static int TestThread(void *arg) printf("TestThread ppid : %d g_ppid : %d\n", ppid, g_ppid); - ICUNIT_ASSERT_EQUAL(ppid, g_ppid, g_ppid); + ICUNIT_ASSERT_EQUAL_NULL(ppid, g_ppid, g_ppid); *g_shmptr = 1000; // 1000, set shared num. @@ -54,11 +54,11 @@ static int TestThread(void *arg) } ret = waitpid(pid, NULL, 0); - ICUNIT_ASSERT_EQUAL(ret, pid, ret); + ICUNIT_ASSERT_EQUAL_NULL(ret, pid, ret); *g_shmptr = 100; // 100, set shared num. EXIT: - return 0; + return NULL; } // This testcase us used for undefination of LOSCFG_USER_TEST_SMP @@ -70,12 +70,12 @@ static int Testcase(void) void *stack; char *stackTop; int ret; - + int shmid = shmget(IPC_PRIVATE, sizeof(int), IPC_CREAT | 0600); // 0600 config of shmget ICUNIT_ASSERT_NOT_EQUAL(shmid, -1, shmid); g_shmptr = (int *)shmat(shmid, nullptr, 0); - ICUNIT_ASSERT_NOT_EQUAL(g_shmptr, reinterpret_cast(-1), g_shmptr); + ICUNIT_ASSERT_NOT_EQUAL(g_shmptr, (int *)-1, g_shmptr); *g_shmptr = 0; @@ -85,12 +85,12 @@ static int Testcase(void) stack = malloc(arg); ICUNIT_GOTO_NOT_EQUAL(stack, NULL, stack, EXIT1); - stackTop = reinterpret_cast(reinterpret_cast(stack) + arg); + stackTop = (char *)((unsigned long)stack + arg); pid = clone(TestThread, (void *)stackTop, CLONE_PARENT | CLONE_VFORK, &arg); ICUNIT_GOTO_EQUAL(*g_shmptr, 100, *g_shmptr, EXIT2); // 100, assert g_shmptr equal to this. - ret = waitpid(pid, &status, 0); + ret = waitpid(pid, &status, NULL); ICUNIT_GOTO_EQUAL(ret, -1, ret, EXIT2); EXIT2: diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/process/full/process_test_052.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/full/process_test_052.cpp similarity index 94% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/process/full/process_test_052.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/full/process_test_052.cpp index f4f13a43..9b88ddb6 100644 --- a/src/kernel_liteos_a/testsuites/unittest/process/basic/process/full/process_test_052.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/full/process_test_052.cpp @@ -58,17 +58,17 @@ static int Testcase(void) ICUNIT_ASSERT_NOT_EQUAL(shmid, -1, shmid); g_shmptr = (int *)shmat(shmid, nullptr, 0); - ICUNIT_ASSERT_NOT_EQUAL(g_shmptr, static_cast(-1), g_shmptr); + ICUNIT_ASSERT_NOT_EQUAL(g_shmptr, (int *)-1, g_shmptr); *g_shmptr = 0; g_ppid = getppid(); printf("testcase ppid : %d\n", g_ppid); - void *stack = malloc(arg); + void *stack = (void *)malloc(arg); ICUNIT_GOTO_NOT_EQUAL(stack, NULL, stack, EXIT1); - char *stackTop = static_cast(static_cast(stack) + arg); + char *stackTop = (char *)((unsigned long)stack + arg); pid_t pid = clone(TestThread, (char *)stackTop, CLONE_PARENT | CLONE_VFORK | CLONE_FILES, &arg); ICUNIT_GOTO_EQUAL(*g_shmptr, 100, *g_shmptr, EXIT2); // 100, assert g_shmptr equal to this. diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/process/full/process_test_053.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/full/process_test_053.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/process/full/process_test_053.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/full/process_test_053.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/process/full/process_test_055.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/full/process_test_055.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/process/full/process_test_055.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/full/process_test_055.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/process/full/process_test_056.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/full/process_test_056.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/process/full/process_test_056.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/full/process_test_056.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/process/full/process_test_057.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/full/process_test_057.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/process/full/process_test_057.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/full/process_test_057.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/process/full/process_test_058.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/full/process_test_058.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/process/full/process_test_058.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/full/process_test_058.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/process/full/process_test_059.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/full/process_test_059.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/process/full/process_test_059.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/full/process_test_059.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/process/full/process_test_060.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/full/process_test_060.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/process/full/process_test_060.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/full/process_test_060.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/process/full/process_test_062.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/full/process_test_062.cpp similarity index 96% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/process/full/process_test_062.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/full/process_test_062.cpp index ad4128b1..3f2398a5 100644 --- a/src/kernel_liteos_a/testsuites/unittest/process/basic/process/full/process_test_062.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/full/process_test_062.cpp @@ -95,12 +95,12 @@ static int TestCase(void) status = WEXITSTATUS(status); ICUNIT_GOTO_EQUAL(status, 10, status, EXIT); // 10, assert that function Result is equal to this. - shmdt(static_cast(const_cast(g_shmptr))); + shmdt((void *)g_shmptr); shmctl(shmid, IPC_RMID, NULL); return 0; EXIT: - shmdt(static_cast(const_cast(g_shmptr))); + shmdt((void *)g_shmptr); shmctl(shmid, IPC_RMID, NULL); return 1; } diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/process/full/process_test_063.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/full/process_test_063.cpp similarity index 88% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/process/full/process_test_063.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/full/process_test_063.cpp index 86353e0a..d6895653 100644 --- a/src/kernel_liteos_a/testsuites/unittest/process/basic/process/full/process_test_063.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/full/process_test_063.cpp @@ -52,12 +52,12 @@ static void GetRandomData(char **buf, int bufSize) char *p = *buf; int i; - srand(static_cast(time(0))); + srand((unsigned)time(0)); for (i = 0; i < bufSize - 1; ++i) { int r = GetRandomNumber(RANDOM_MAX); - *(p + i) = static_cast(r); + *(p + i) = (char)r; } - *(p + i) = static_cast(0); + *(p + i) = (char)0; } static int TestCase(VOID) @@ -73,36 +73,36 @@ static int TestCase(VOID) ret = posix_spawn(&pid, NULL, NULL, NULL, NULL, NULL); ICUNIT_ASSERT_EQUAL(ret, EINVAL, ret); - childFileName = reinterpret_cast(1); + childFileName = (char *)1; ret = posix_spawn(&pid, childFileName, NULL, NULL, NULL, NULL); ICUNIT_ASSERT_EQUAL(ret, EINVAL, ret); - childArgv = reinterpret_cast(1); + childArgv = (char **)1; ret = posix_spawn(&pid, "/usr/bin/testsuits_app", NULL, NULL, childArgv, NULL); ICUNIT_ASSERT_EQUAL(ret, EINVAL, ret); - childEnvp = reinterpret_cast(1); + childEnvp = (char **)1; ret = posix_spawn(&pid, "/usr/bin/testsuits_app", NULL, NULL, NULL, childEnvp); ICUNIT_ASSERT_EQUAL(ret, EINVAL, ret); ret = posix_spawn(&pid, "/bin", NULL, NULL, NULL, NULL); ICUNIT_ASSERT_EQUAL(ret, ENOENT, ret); - fileName = static_cast(malloc(FILE_NAME_BYTES)); + fileName = (char *)malloc(FILE_NAME_BYTES); ICUNIT_ASSERT_NOT_EQUAL(fileName, NULL, fileName); GetRandomData(&fileName, FILE_NAME_BYTES); ret = posix_spawn(&pid, fileName, NULL, NULL, NULL, NULL); free(fileName); ICUNIT_ASSERT_EQUAL(ret, ENOENT, ret); - fileName = static_cast(malloc(LONG_FILE_NAME_BYTES)); + fileName = (char *)malloc(LONG_FILE_NAME_BYTES); ICUNIT_ASSERT_NOT_EQUAL(fileName, NULL, fileName); GetRandomData(&fileName, LONG_FILE_NAME_BYTES); ret = posix_spawn(&pid, fileName, NULL, NULL, NULL, NULL); free(fileName); ICUNIT_ASSERT_EQUAL(ret, ENAMETOOLONG, ret); - ret = posix_spawn(&pid, reinterpret_cast(INVALID_USER_VADDR), nullptr, nullptr, nullptr, nullptr); + ret = posix_spawn(&pid, (char *)INVALID_USER_VADDR, NULL, NULL, NULL, NULL); ICUNIT_ASSERT_EQUAL(ret, EFAULT, ret); return 0; diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/process/full/process_test_064.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/full/process_test_064.cpp similarity index 91% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/process/full/process_test_064.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/full/process_test_064.cpp index ace31384..3b84cbbb 100644 --- a/src/kernel_liteos_a/testsuites/unittest/process/basic/process/full/process_test_064.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/full/process_test_064.cpp @@ -52,12 +52,12 @@ static void GetRandomData(char **buf, int bufSize) char *p = *buf; int i; - srand(static_cast(time(0))); + srand((unsigned)time(0)); for (i = 0; i < bufSize - 1; ++i) { int r = GetRandomNumber(RANDOM_MAX); - *(p + i) = static_cast(r); + *(p + i) = (char)r; } - *(p + i) = static_cast(0); + *(p + i) = (char)0; } static int TestCase(VOID) @@ -70,25 +70,25 @@ static int TestCase(VOID) char **childArgv = NULL; char **childEnvp = NULL; - childArgv = reinterpret_cast(1); + childArgv = (char **)1; ret = posix_spawnp(&pid, "/usr/bin/testsuits_app", NULL, NULL, childArgv, NULL); ICUNIT_ASSERT_EQUAL(ret, EINVAL, ret); - childEnvp = reinterpret_cast(1); + childEnvp = (char **)1; ret = posix_spawnp(&pid, "/usr/bin/testsuits_app", NULL, NULL, NULL, childEnvp); ICUNIT_ASSERT_EQUAL(ret, EINVAL, ret); ret = posix_spawnp(&pid, "/bin", NULL, NULL, NULL, NULL); ICUNIT_ASSERT_EQUAL(ret, ENOENT, ret); - fileName = static_cast(malloc(FILE_NAME_BYTES)); + fileName = (char *)malloc(FILE_NAME_BYTES); ICUNIT_ASSERT_NOT_EQUAL(fileName, NULL, fileName); GetRandomData(&fileName, FILE_NAME_BYTES); ret = posix_spawnp(&pid, fileName, NULL, NULL, NULL, NULL); free(fileName); ICUNIT_ASSERT_EQUAL(ret, ENOENT, ret); - fileName = static_cast(malloc(LONG_FILE_NAME_BYTES)); + fileName = (char *)malloc(LONG_FILE_NAME_BYTES); ICUNIT_ASSERT_NOT_EQUAL(fileName, NULL, fileName); GetRandomData(&fileName, LONG_FILE_NAME_BYTES); ret = posix_spawnp(&pid, fileName, NULL, NULL, NULL, NULL); diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/process/full/process_test_065.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/full/process_test_065.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/process/full/process_test_065.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/full/process_test_065.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/process/full/process_test_066.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/full/process_test_066.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/process/full/process_test_066.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/full/process_test_066.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/process/full/process_test_067.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/full/process_test_067.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/process/full/process_test_067.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/full/process_test_067.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/process/full/process_test_068.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/full/process_test_068.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/process/full/process_test_068.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/full/process_test_068.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/process/full/process_test_069.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/full/process_test_069.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/process/full/process_test_069.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/full/process_test_069.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/process/it_test_process.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/it_test_process.h similarity index 95% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/process/it_test_process.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/it_test_process.h index ac487958..19803d4a 100644 --- a/src/kernel_liteos_a/testsuites/unittest/process/basic/process/it_test_process.h +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/it_test_process.h @@ -40,11 +40,11 @@ static inline int Syscall(int nbr, int parm1, int parm2, int parm3, int parm4) { - register int reg7 __asm__("r7") = nbr; - register int reg3 __asm__("r3") = parm4; - register int reg2 __asm__("r2") = parm3; - register int reg1 __asm__("r1") = parm2; - register int reg0 __asm__("r0") = parm1; + register int reg7 __asm__("r7") = (int)(nbr); + register int reg3 __asm__("r3") = (int)(parm4); + register int reg2 __asm__("r2") = (int)(parm3); + register int reg1 __asm__("r1") = (int)(parm2); + register int reg0 __asm__("r0") = (int)(parm1); __asm__ __volatile__("svc 0" : "=r"(reg0) : "r"(reg7), "r"(reg0), "r"(reg1), "r"(reg2), "r"(reg3) : "memory"); diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/process/process_process_test.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/process_process_test.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/process/process_process_test.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/process_process_test.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/process/smoke/process_test_001.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/smoke/process_test_001.cpp similarity index 99% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/process/smoke/process_test_001.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/smoke/process_test_001.cpp index 10425707..2900a1e1 100644 --- a/src/kernel_liteos_a/testsuites/unittest/process/basic/process/smoke/process_test_001.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/smoke/process_test_001.cpp @@ -30,7 +30,7 @@ */ #include "it_test_process.h" - + static const int PROCESS_PRIORITY_MAX = 10; static const int PROCESS_PRIORITY_MIN = 31; static const int PROCESS_SCHED_RR_INTERVAL = 20000000; diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/process/smoke/process_test_002.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/smoke/process_test_002.cpp similarity index 99% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/process/smoke/process_test_002.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/smoke/process_test_002.cpp index 5badaa3a..59a157ed 100644 --- a/src/kernel_liteos_a/testsuites/unittest/process/basic/process/smoke/process_test_002.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/smoke/process_test_002.cpp @@ -36,7 +36,7 @@ static int Testcase() #define CURRENT_PROCESS_POLICY SCHED_RR struct sched_param param = { 0 }; - int ret = OS_ERROR; + int ret; int currProcessPri = getpriority(PRIO_PROCESS, getpid()); ICUNIT_GOTO_WITHIN_EQUAL(currProcessPri, 0, 31, currProcessPri, ERROR_OUT); // 31, assert function Result equal to this. diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/process/smoke/process_test_004.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/smoke/process_test_004.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/process/smoke/process_test_004.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/smoke/process_test_004.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/process/smoke/process_test_005.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/smoke/process_test_005.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/process/smoke/process_test_005.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/smoke/process_test_005.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/process/smoke/process_test_006.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/smoke/process_test_006.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/process/smoke/process_test_006.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/smoke/process_test_006.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/process/smoke/process_test_008.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/smoke/process_test_008.cpp similarity index 91% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/process/smoke/process_test_008.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/smoke/process_test_008.cpp index aba4a9aa..c7245658 100644 --- a/src/kernel_liteos_a/testsuites/unittest/process/basic/process/smoke/process_test_008.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/smoke/process_test_008.cpp @@ -32,19 +32,18 @@ static const int TEST_COUNT = 10; -__attribute__((optnone)) static void *ThreadFunc2(void *arg) +static void *ThreadFunc2(void *arg) { - printf("111111111111111: exit\n"); exit(254); // 254, exit args } -__attribute__((optnone)) static void *ThreadFunc3(void *arg) +static void *ThreadFunc3(void *arg) { while (1) { } } -__attribute__((optnone)) static int ProcessTest001(void) +static int ProcessTest001(void) { int ret; int status; @@ -66,7 +65,7 @@ __attribute__((optnone)) static int ProcessTest001(void) ICUNIT_ASSERT_EQUAL(ret, 0, ret); ret = pthread_attr_init(&a); - param.sched_priority = 26; /* 26: prio */ + param.sched_priority += 1; pthread_attr_setschedparam(&a, ¶m); pthread_attr_setinheritsched(&a, PTHREAD_EXPLICIT_SCHED); ret = pthread_create(&newPthread, &a, ThreadFunc3, &data); @@ -76,12 +75,11 @@ __attribute__((optnone)) static int ProcessTest001(void) ret = pthread_create(&newPthread, NULL, ThreadFunc2, &data); ICUNIT_ASSERT_EQUAL(ret, 0, ret); - printf("222222222222222: exit\n"); exit(255); // 255, exit args return 0; } -__attribute__((optnone)) static int Testcase(void) +static int Testcase(void) { int ret; int status; diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/process/smoke/process_test_009.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/smoke/process_test_009.cpp similarity index 97% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/process/smoke/process_test_009.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/smoke/process_test_009.cpp index e31d590a..ac38c08f 100644 --- a/src/kernel_liteos_a/testsuites/unittest/process/basic/process/smoke/process_test_009.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/smoke/process_test_009.cpp @@ -95,7 +95,7 @@ static int Testcase(void) ret = wait(&status); status = WEXITSTATUS(status); ICUNIT_ASSERT_EQUAL(ret, pid, ret); - // ICUNIT_ASSERT_EQUAL(status, 255, status); // 255, assert that function Result is equal to this. + ICUNIT_ASSERT_EQUAL(status, 255, status); // 255, assert that function Result is equal to this. } ICUNIT_ASSERT_WITHIN_EQUAL(pid, 0, 100000, pid); // 100000, assert that function Result is equal to this. diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/process/smoke/process_test_010.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/smoke/process_test_010.cpp similarity index 98% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/process/smoke/process_test_010.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/smoke/process_test_010.cpp index 7c5c4843..d8fc46e5 100644 --- a/src/kernel_liteos_a/testsuites/unittest/process/basic/process/smoke/process_test_010.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/smoke/process_test_010.cpp @@ -105,7 +105,7 @@ static int Testcase(void) exit(Child()); } else if (ret > 0) { pid = ret; - ret = waitpid(pid, &status, 0); + ret = waitpid(pid, &status, NULL); status = WEXITSTATUS(status); ICUNIT_ASSERT_EQUAL(ret, pid, ret); ICUNIT_ASSERT_EQUAL(status, 0, status); diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/process/smoke/process_test_011.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/smoke/process_test_011.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/process/smoke/process_test_011.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/smoke/process_test_011.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/process/smoke/process_test_012.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/smoke/process_test_012.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/process/smoke/process_test_012.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/smoke/process_test_012.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/process/smoke/process_test_013.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/smoke/process_test_013.cpp similarity index 99% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/process/smoke/process_test_013.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/smoke/process_test_013.cpp index 613d0912..76a58d53 100644 --- a/src/kernel_liteos_a/testsuites/unittest/process/basic/process/smoke/process_test_013.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/smoke/process_test_013.cpp @@ -35,7 +35,7 @@ static int TestCase() { #define PROCESS_TEST_PRI1 (currProcessPri + 1) struct sched_param param = { 0 }; - int ret = OS_ERROR; + int ret; int val, currPolicy; int currProcessPri = getpriority(PRIO_PROCESS, getpid()); ICUNIT_GOTO_WITHIN_EQUAL(currProcessPri, 0, 31, currProcessPri, ERROR_OUT); // 31, assert currProcessPri equal to this. diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/process/smoke/process_test_014.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/smoke/process_test_014.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/process/smoke/process_test_014.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/smoke/process_test_014.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/process/smoke/process_test_015.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/smoke/process_test_015.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/process/smoke/process_test_015.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/smoke/process_test_015.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/process/smoke/process_test_016.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/smoke/process_test_016.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/process/smoke/process_test_016.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/smoke/process_test_016.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/process/smoke/process_test_017.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/smoke/process_test_017.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/process/smoke/process_test_017.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/smoke/process_test_017.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/process/smoke/process_test_018.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/smoke/process_test_018.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/process/smoke/process_test_018.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/smoke/process_test_018.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/process/smoke/process_test_019.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/smoke/process_test_019.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/process/smoke/process_test_019.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/smoke/process_test_019.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/process/smoke/process_test_020.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/smoke/process_test_020.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/process/smoke/process_test_020.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/smoke/process_test_020.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/process/smoke/process_test_021.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/smoke/process_test_021.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/process/smoke/process_test_021.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/smoke/process_test_021.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/process/smoke/process_test_022.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/smoke/process_test_022.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/process/smoke/process_test_022.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/smoke/process_test_022.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/process/smoke/process_test_023.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/smoke/process_test_023.cpp similarity index 97% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/process/smoke/process_test_023.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/smoke/process_test_023.cpp index 7e05574a..578b9f18 100644 --- a/src/kernel_liteos_a/testsuites/unittest/process/basic/process/smoke/process_test_023.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/smoke/process_test_023.cpp @@ -46,7 +46,7 @@ static void *ThreadFunc(void *arg) ICUNIT_ASSERT_NOT_EQUAL_NULL(g_thread002, 0, g_thread002); g_thread001++; - return reinterpret_cast(9); // 9, set thread return value. + return (void *)9; // 9, set thread return value. EXIT: return NULL; } @@ -61,7 +61,7 @@ static void *ThreadFunc2(void *arg) ICUNIT_ASSERT_NOT_EQUAL_NULL(ret, -1, ret); ICUNIT_ASSERT_NOT_EQUAL_NULL(g_thread001, 0, g_thread001); - return reinterpret_cast(9); // 9, set thread return value. + return (void *)9; // 9, set thread return value. EXIT: return NULL; } diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/process/smoke/process_test_024.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/smoke/process_test_024.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/process/smoke/process_test_024.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/smoke/process_test_024.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/process/smoke/process_test_025.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/smoke/process_test_025.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/process/smoke/process_test_025.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/smoke/process_test_025.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/process/smoke/process_test_026.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/smoke/process_test_026.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/process/smoke/process_test_026.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/smoke/process_test_026.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/process/smoke/process_test_027.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/smoke/process_test_027.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/process/smoke/process_test_027.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/smoke/process_test_027.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/process/smoke/process_test_029.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/smoke/process_test_029.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/process/smoke/process_test_029.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/smoke/process_test_029.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/process/smoke/process_test_030.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/smoke/process_test_030.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/process/smoke/process_test_030.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/smoke/process_test_030.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/process/smoke/process_test_038.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/smoke/process_test_038.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/process/smoke/process_test_038.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/smoke/process_test_038.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/process/smoke/process_test_039.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/smoke/process_test_039.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/process/smoke/process_test_039.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/smoke/process_test_039.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/process/smoke/process_test_043.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/smoke/process_test_043.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/process/smoke/process_test_043.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/smoke/process_test_043.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/process/smoke/process_test_044.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/smoke/process_test_044.cpp similarity index 92% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/process/smoke/process_test_044.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/smoke/process_test_044.cpp index 08995680..dd790bc5 100644 --- a/src/kernel_liteos_a/testsuites/unittest/process/basic/process/smoke/process_test_044.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/smoke/process_test_044.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2022 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -51,7 +51,7 @@ static int GroupProcess(void) ret = sched_rr_get_interval(getpid(), &ts); ICUNIT_ASSERT_EQUAL(ret, 0, ret); ICUNIT_ASSERT_EQUAL(ts.tv_sec, 0, ts.tv_sec); - if (ts.tv_nsec < 5000000 || ts.tv_nsec > 20000000) { // 5000000, 20000000, expected range of tv_nsec. + if (ts.tv_nsec <= 5000000 || ts.tv_nsec > 20000000) { // 5000000, 20000000, expected range of tv_nsec. ICUNIT_ASSERT_EQUAL(ts.tv_nsec, -1, ts.tv_nsec); } @@ -61,7 +61,7 @@ static int GroupProcess(void) ret = sched_rr_get_interval(getpid(), &ts); ICUNIT_ASSERT_EQUAL(ret, 0, ret); ICUNIT_ASSERT_EQUAL(ts.tv_sec, 0, ts.tv_sec); - if (ts.tv_nsec < 10000000 || ts.tv_nsec > 40000000) { // 10000000, 40000000, expected range of tv_nsec. + if (ts.tv_nsec <= 10000000 || ts.tv_nsec > 40000000) { // 10000000, 40000000, expected range of tv_nsec. ICUNIT_ASSERT_EQUAL(ts.tv_nsec, -1, ts.tv_nsec); } diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/process/smoke/process_test_045.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/smoke/process_test_045.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/process/smoke/process_test_045.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/smoke/process_test_045.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/process/smoke/process_test_046.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/smoke/process_test_046.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/process/smoke/process_test_046.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/smoke/process_test_046.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/process/smoke/process_test_047.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/smoke/process_test_047.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/process/smoke/process_test_047.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/smoke/process_test_047.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/process/smoke/process_test_048.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/smoke/process_test_048.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/process/smoke/process_test_048.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/smoke/process_test_048.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/process/smoke/process_test_054.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/smoke/process_test_054.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/process/smoke/process_test_054.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/smoke/process_test_054.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/process/smoke/process_test_061.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/smoke/process_test_061.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/process/smoke/process_test_061.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/smoke/process_test_061.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/process/smp/process_test_smp_001.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/smp/process_test_smp_001.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/process/smp/process_test_smp_001.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/smp/process_test_smp_001.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/process/smp/process_test_smp_002.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/smp/process_test_smp_002.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/process/smp/process_test_smp_002.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/smp/process_test_smp_002.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/process/smp/process_test_smp_003.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/smp/process_test_smp_003.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/process/smp/process_test_smp_003.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/smp/process_test_smp_003.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/process/smp/process_test_smp_004.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/smp/process_test_smp_004.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/process/smp/process_test_smp_004.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/smp/process_test_smp_004.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/process/smp/process_test_smp_005.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/smp/process_test_smp_005.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/process/smp/process_test_smp_005.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/smp/process_test_smp_005.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/process/smp/process_test_smp_006.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/smp/process_test_smp_006.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/process/smp/process_test_smp_006.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/smp/process_test_smp_006.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/process/smp/process_test_smp_007.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/smp/process_test_smp_007.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/process/smp/process_test_smp_007.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/smp/process_test_smp_007.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/process/smp/process_test_smp_008.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/smp/process_test_smp_008.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/process/smp/process_test_smp_008.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/process/smp/process_test_smp_008.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/pthread/config.gni b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/pthread/config.gni similarity index 71% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/pthread/config.gni rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/pthread/config.gni index fb15d289..1dbba3eb 100644 --- a/src/kernel_liteos_a/testsuites/unittest/process/basic/pthread/config.gni +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/pthread/config.gni @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023 Huawei Device Co., Ltd. All rights reserved. +# Copyright (c) 2022-2022 Huawei Device Co., Ltd. All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: @@ -26,28 +26,14 @@ # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -import("//build/lite/config/test.gni") -import("//kernel/liteos_a/liteos.gni") import("//kernel/liteos_a/testsuites/unittest/config.gni") -common_include_dirs = [ - "$THIRDPARTY_GOOGLETEST_DIR/googletest/include", - "../../../common/include", -] - -sources_entry = [ "../../../common/osTest.cpp" ] - -sources_smoke = [] +pthread_include_dirs = [ "$TEST_UNITTEST_DIR/process/basic/pthread" ] -sources_full = [] - -process_basic_pthread_include_dirs = - [ "$TEST_UNITTEST_DIR/process/basic/pthread" ] - -process_basic_pthread_sources_entry = +pthread_sources_entry = [ "$TEST_UNITTEST_DIR/process/basic/pthread/process_pthread_test.cpp" ] -process_basic_pthread_sources_smoke = [ +pthread_sources_smoke = [ "$TEST_UNITTEST_DIR/process/basic/pthread/smoke/pthread_atfork_test_001.cpp", "$TEST_UNITTEST_DIR/process/basic/pthread/smoke/pthread_atfork_test_002.cpp", "$TEST_UNITTEST_DIR/process/basic/pthread/smoke/pthread_cond_test_001.cpp", @@ -69,28 +55,12 @@ process_basic_pthread_sources_smoke = [ "$TEST_UNITTEST_DIR/process/basic/pthread/smoke/pthread_test_017.cpp", "$TEST_UNITTEST_DIR/process/basic/pthread/smoke/pthread_test_018.cpp", "$TEST_UNITTEST_DIR/process/basic/pthread/smoke/pthread_test_019.cpp", - "$TEST_UNITTEST_DIR/process/basic/pthread/smoke/pthread_test_020.cpp", - "$TEST_UNITTEST_DIR/process/basic/pthread/smoke/pthread_test_021.cpp", - "$TEST_UNITTEST_DIR/process/basic/pthread/smoke/pthread_test_022.cpp", - "$TEST_UNITTEST_DIR/process/basic/pthread/smoke/pthread_test_023.cpp", - "$TEST_UNITTEST_DIR/process/basic/pthread/smoke/pthread_test_024.cpp", - "$TEST_UNITTEST_DIR/process/basic/pthread/smoke/pthread_test_025.cpp", - "$TEST_UNITTEST_DIR/process/basic/pthread/smoke/pthread_test_026.cpp", - "$TEST_UNITTEST_DIR/process/basic/pthread/smoke/pthread_test_027.cpp", ] -process_basic_pthread_sources_full = [ +pthread_sources_full = [ "$TEST_UNITTEST_DIR/process/basic/pthread/full/pthread_test_001.cpp", "$TEST_UNITTEST_DIR/process/basic/pthread/full/pthread_test_002.cpp", "$TEST_UNITTEST_DIR/process/basic/pthread/full/pthread_test_004.cpp", "$TEST_UNITTEST_DIR/process/basic/pthread/full/pthread_test_005.cpp", "$TEST_UNITTEST_DIR/process/basic/pthread/full/pthread_test_014.cpp", ] - -# process basic pthread module -if (LOSCFG_USER_TEST_PROCESS_BASIC_PTHREAD == true) { - common_include_dirs += process_basic_pthread_include_dirs - sources_entry += process_basic_pthread_sources_entry - sources_smoke += process_basic_pthread_sources_smoke - sources_full += process_basic_pthread_sources_full -} diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/pthread/full/pthread_test_001.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/pthread/full/pthread_test_001.cpp similarity index 98% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/pthread/full/pthread_test_001.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/pthread/full/pthread_test_001.cpp index b43e9ab3..8c95f11f 100644 --- a/src/kernel_liteos_a/testsuites/unittest/process/basic/pthread/full/pthread_test_001.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/pthread/full/pthread_test_001.cpp @@ -71,7 +71,7 @@ static void *ThreadFunc4(void *arg) ret = pthread_cancel(pthread); } } - return reinterpret_cast(i); + return (void *)i; EXIT: return NULL; @@ -100,7 +100,7 @@ static void *ThreadFunc3(void *arg) } ICUNIT_GOTO_EQUAL(i, 10, i, EXIT); // 10, here assert the result. - return reinterpret_cast(i); + return (void *)i; EXIT: return NULL; } @@ -132,7 +132,7 @@ static void *ThreadFunc6(void *arg) ICUNIT_GOTO_EQUAL(g_pthreadTestCount, 12, g_pthreadTestCount, EXIT); // 12, here assert the result. g_pthreadTestCount++; // 13 - return reinterpret_cast(pthread_self()); + return (void *)pthread_self(); EXIT: return NULL; diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/pthread/full/pthread_test_002.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/pthread/full/pthread_test_002.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/pthread/full/pthread_test_002.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/pthread/full/pthread_test_002.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/pthread/full/pthread_test_004.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/pthread/full/pthread_test_004.cpp similarity index 99% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/pthread/full/pthread_test_004.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/pthread/full/pthread_test_004.cpp index 21613f9b..18bc242e 100644 --- a/src/kernel_liteos_a/testsuites/unittest/process/basic/pthread/full/pthread_test_004.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/pthread/full/pthread_test_004.cpp @@ -163,7 +163,7 @@ static void *ThreadFunc4(void *arg) ret = pthread_cancel(pthread); } } - return reinterpret_cast(i); + return (void *)i; EXIT: return NULL; @@ -196,7 +196,7 @@ static void *ThreadFunc3(void *arg) } ICUNIT_GOTO_EQUAL(i, 10, i, EXIT); // 10, here assert the result. - return reinterpret_cast(i); + return (void *)i; EXIT: return NULL; diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/pthread/full/pthread_test_005.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/pthread/full/pthread_test_005.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/pthread/full/pthread_test_005.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/pthread/full/pthread_test_005.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/pthread/full/pthread_test_014.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/pthread/full/pthread_test_014.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/pthread/full/pthread_test_014.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/pthread/full/pthread_test_014.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/pthread/it_pthread_test.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/pthread/it_pthread_test.h similarity index 85% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/pthread/it_pthread_test.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/pthread/it_pthread_test.h index afcef819..5b148e01 100644 --- a/src/kernel_liteos_a/testsuites/unittest/process/basic/pthread/it_pthread_test.h +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/pthread/it_pthread_test.h @@ -42,11 +42,11 @@ static inline int Syscall(int nbr, int parm1, int parm2, int parm3, int parm4) { - register int reg7 __asm__("r7") = nbr; - register int reg3 __asm__("r3") = parm4; - register int reg2 __asm__("r2") = parm3; - register int reg1 __asm__("r1") = parm2; - register int reg0 __asm__("r0") = parm1; + register int reg7 __asm__("r7") = (int)(nbr); + register int reg3 __asm__("r3") = (int)(parm4); + register int reg2 __asm__("r2") = (int)(parm3); + register int reg1 __asm__("r1") = (int)(parm2); + register int reg0 __asm__("r0") = (int)(parm1); __asm__ __volatile__("svc 0" : "=r"(reg0) : "r"(reg7), "r"(reg0), "r"(reg1), "r"(reg2), "r"(reg3) : "memory"); @@ -74,14 +74,6 @@ extern void ItTestPthread016(void); extern void ItTestPthread017(void); extern void ItTestPthread018(void); extern void ItTestPthread019(void); -extern void ItTestPthread020(void); -extern void ItTestPthread021(void); -extern void ItTestPthread022(void); -extern void ItTestPthread023(void); -extern void ItTestPthread024(void); -extern void ItTestPthread025(void); -extern void ItTestPthread026(void); -extern void ItTestPthread027(void); extern void ItTestPthreadAtfork001(void); extern void ItTestPthreadAtfork002(void); extern void ItTestPthreadOnce001(void); diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/pthread/process_pthread_test.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/pthread/process_pthread_test.cpp similarity index 80% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/pthread/process_pthread_test.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/pthread/process_pthread_test.cpp index 3c2187c3..700bcbac 100644 --- a/src/kernel_liteos_a/testsuites/unittest/process/basic/pthread/process_pthread_test.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/pthread/process_pthread_test.cpp @@ -186,104 +186,6 @@ HWTEST_F(ProcessPthreadTest, ItTestPthread019, TestSize.Level0) ItTestPthread019(); } -/* * - * @tc.name: it_test_pthread_020 - * @tc.desc: function for ProcessPthreadTest - * @tc.type: FUNC - * @tc.require: issueI6T3P3 - * @tc.author: - */ -HWTEST_F(ProcessPthreadTest, ItTestPthread020, TestSize.Level0) -{ - ItTestPthread020(); -} - -/* * - * @tc.name: it_test_pthread_021 - * @tc.desc: function for ProcessPthreadTest - * @tc.type: FUNC - * @tc.require: issueI6T3P3 - * @tc.author: - */ -HWTEST_F(ProcessPthreadTest, ItTestPthread021, TestSize.Level0) -{ - ItTestPthread021(); -} - -/* * - * @tc.name: it_test_pthread_022 - * @tc.desc: function for ProcessPthreadTest - * @tc.type: FUNC - * @tc.require: issueI6T3P3 - * @tc.author: - */ -HWTEST_F(ProcessPthreadTest, ItTestPthread022, TestSize.Level0) -{ - ItTestPthread022(); -} - -/* * - * @tc.name: it_test_pthread_024 - * @tc.desc: function for ProcessPthreadTest - * @tc.type: FUNC - * @tc.require: issueI6T3P3 - * @tc.author: - */ -HWTEST_F(ProcessPthreadTest, ItTestPthread024, TestSize.Level0) -{ - ItTestPthread024(); -} - -/* * - * @tc.name: it_test_pthread_026 - * @tc.desc: function for ProcessPthreadTest - * @tc.type: FUNC - * @tc.require: issueI6T3P3 - * @tc.author: - */ -HWTEST_F(ProcessPthreadTest, ItTestPthread026, TestSize.Level0) -{ - ItTestPthread026(); -} - -/* * - * @tc.name: it_test_pthread_027 - * @tc.desc: function for ProcessPthreadTest - * @tc.type: FUNC - * @tc.require: issueI6T3P3 - * @tc.author: - */ -HWTEST_F(ProcessPthreadTest, ItTestPthread027, TestSize.Level0) -{ - ItTestPthread027(); -} - - -/* * - * @tc.name: it_test_pthread_023 - * @tc.desc: function for ProcessPthreadTest - * @tc.type: FUNC - * @tc.require: issueI6T3P3 - * @tc.author: - */ -HWTEST_F(ProcessPthreadTest, ItTestPthread023, TestSize.Level0) -{ - ItTestPthread023(); -} - - -/* * - * @tc.name: it_test_pthread_025 - * @tc.desc: function for ProcessPthreadTest - * @tc.type: FUNC - * @tc.require: issueI6T3P3 - * @tc.author: - */ -HWTEST_F(ProcessPthreadTest, ItTestPthread025, TestSize.Level0) -{ - ItTestPthread025(); -} - /* * * @tc.name: it_test_pthread_017 * @tc.desc: function for ProcessPthreadTest diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/pthread/smoke/pthread_atfork_test_001.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/pthread/smoke/pthread_atfork_test_001.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/pthread/smoke/pthread_atfork_test_001.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/pthread/smoke/pthread_atfork_test_001.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/pthread/smoke/pthread_atfork_test_002.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/pthread/smoke/pthread_atfork_test_002.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/pthread/smoke/pthread_atfork_test_002.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/pthread/smoke/pthread_atfork_test_002.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/pthread/smoke/pthread_cond_test_001.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/pthread/smoke/pthread_cond_test_001.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/pthread/smoke/pthread_cond_test_001.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/pthread/smoke/pthread_cond_test_001.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/pthread/smoke/pthread_cond_test_002.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/pthread/smoke/pthread_cond_test_002.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/pthread/smoke/pthread_cond_test_002.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/pthread/smoke/pthread_cond_test_002.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/pthread/smoke/pthread_cond_test_003.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/pthread/smoke/pthread_cond_test_003.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/pthread/smoke/pthread_cond_test_003.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/pthread/smoke/pthread_cond_test_003.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/pthread/smoke/pthread_cond_test_004.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/pthread/smoke/pthread_cond_test_004.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/pthread/smoke/pthread_cond_test_004.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/pthread/smoke/pthread_cond_test_004.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/pthread/smoke/pthread_once_test_001.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/pthread/smoke/pthread_once_test_001.cpp similarity index 98% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/pthread/smoke/pthread_once_test_001.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/pthread/smoke/pthread_once_test_001.cpp index a779ba33..a39d99cd 100644 --- a/src/kernel_liteos_a/testsuites/unittest/process/basic/pthread/smoke/pthread_once_test_001.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/pthread/smoke/pthread_once_test_001.cpp @@ -44,7 +44,7 @@ static void *Threadfunc(void *parm) int err; err = pthread_once(&g_onceCtrl, InitRoutine); ICUNIT_GOTO_EQUAL(err, 0, err, EXIT); - return reinterpret_cast(g_okStatus); + return (void *)g_okStatus; EXIT: return NULL; } diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/pthread/smoke/pthread_test_003.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/pthread/smoke/pthread_test_003.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/pthread/smoke/pthread_test_003.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/pthread/smoke/pthread_test_003.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/pthread/smoke/pthread_test_006.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/pthread/smoke/pthread_test_006.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/pthread/smoke/pthread_test_006.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/pthread/smoke/pthread_test_006.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/pthread/smoke/pthread_test_007.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/pthread/smoke/pthread_test_007.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/pthread/smoke/pthread_test_007.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/pthread/smoke/pthread_test_007.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/pthread/smoke/pthread_test_008.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/pthread/smoke/pthread_test_008.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/pthread/smoke/pthread_test_008.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/pthread/smoke/pthread_test_008.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/pthread/smoke/pthread_test_009.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/pthread/smoke/pthread_test_009.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/pthread/smoke/pthread_test_009.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/pthread/smoke/pthread_test_009.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/pthread/smoke/pthread_test_010.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/pthread/smoke/pthread_test_010.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/pthread/smoke/pthread_test_010.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/pthread/smoke/pthread_test_010.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/pthread/smoke/pthread_test_011.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/pthread/smoke/pthread_test_011.cpp similarity index 98% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/pthread/smoke/pthread_test_011.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/pthread/smoke/pthread_test_011.cpp index 932398c0..34bc604e 100644 --- a/src/kernel_liteos_a/testsuites/unittest/process/basic/pthread/smoke/pthread_test_011.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/pthread/smoke/pthread_test_011.cpp @@ -46,7 +46,7 @@ void child1(void) while (1) { ret = pthread_getschedparam(pthread, &newPolicy, ¶m); if (ret != 0) { - printf("pthread_getschedparam failed ! %d error: %d\n", __LINE__, errno); + printf("pthread_getschedparam failed ! %d erro: %d\n", __LINE__, errno); exit(255); // 255, set a special exit code. } diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/pthread/smoke/pthread_test_012.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/pthread/smoke/pthread_test_012.cpp similarity index 97% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/pthread/smoke/pthread_test_012.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/pthread/smoke/pthread_test_012.cpp index f33e7672..f89b31d4 100644 --- a/src/kernel_liteos_a/testsuites/unittest/process/basic/pthread/smoke/pthread_test_012.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/pthread/smoke/pthread_test_012.cpp @@ -33,7 +33,7 @@ static int Testcase(void) { int ret; - ret = Syscall(SYS_set_thread_area, 0x0, 0, 0, 0); + ret = Syscall(SYS_set_thread_area, NULL, 0, 0, 0); ICUNIT_ASSERT_EQUAL(ret, EINVAL, ret); ret = Syscall(SYS_set_thread_area, 0x100, 0, 0, 0); diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/pthread/smoke/pthread_test_013.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/pthread/smoke/pthread_test_013.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/pthread/smoke/pthread_test_013.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/pthread/smoke/pthread_test_013.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/pthread/smoke/pthread_test_015.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/pthread/smoke/pthread_test_015.cpp similarity index 98% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/pthread/smoke/pthread_test_015.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/pthread/smoke/pthread_test_015.cpp index 4eb42af5..84992367 100644 --- a/src/kernel_liteos_a/testsuites/unittest/process/basic/pthread/smoke/pthread_test_015.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/pthread/smoke/pthread_test_015.cpp @@ -30,10 +30,7 @@ */ #include "it_pthread_test.h" -static VOID *PthreadTest115(VOID *arg) -{ - return NULL; -} +static VOID *PthreadTest115(VOID *arg) {} static int GroupProcess(void) { diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/pthread/smoke/pthread_test_016.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/pthread/smoke/pthread_test_016.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/pthread/smoke/pthread_test_016.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/pthread/smoke/pthread_test_016.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/pthread/smoke/pthread_test_017.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/pthread/smoke/pthread_test_017.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/pthread/smoke/pthread_test_017.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/pthread/smoke/pthread_test_017.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/pthread/smoke/pthread_test_018.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/pthread/smoke/pthread_test_018.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/pthread/smoke/pthread_test_018.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/pthread/smoke/pthread_test_018.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/process/basic/pthread/smoke/pthread_test_019.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/pthread/smoke/pthread_test_019.cpp similarity index 98% rename from src/kernel_liteos_a/testsuites/unittest/process/basic/pthread/smoke/pthread_test_019.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/pthread/smoke/pthread_test_019.cpp index 8746c78e..e219eed4 100644 --- a/src/kernel_liteos_a/testsuites/unittest/process/basic/pthread/smoke/pthread_test_019.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/basic/pthread/smoke/pthread_test_019.cpp @@ -77,7 +77,7 @@ static int GroupProcess(void) stackSize = 3000; // 3000, change stackSize, test again. pthread_attr_init(&attr); - stack = reinterpret_cast(0x1000); + stack = (void *)0x1000; ret = pthread_attr_setstack(&attr, stack, stackSize); ICUNIT_ASSERT_EQUAL(ret, 0, ret); diff --git a/src/kernel_liteos_a/testsuites/unittest/process/lock/BUILD.gn b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/lock/BUILD.gn similarity index 88% rename from src/kernel_liteos_a/testsuites/unittest/process/lock/BUILD.gn rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/lock/BUILD.gn index e1d1fd24..18ada1f3 100644 --- a/src/kernel_liteos_a/testsuites/unittest/process/lock/BUILD.gn +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/lock/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023 Huawei Device Co., Ltd. All rights reserved. +# Copyright (c) 2022-2022 Huawei Device Co., Ltd. All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: @@ -26,6 +26,8 @@ # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +import("//build/lite/config/test.gni") +import("//kernel/liteos_a/testsuites/unittest/config.gni") import("./config.gni") if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_LOW) { @@ -38,7 +40,7 @@ if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_LOW) { sources_full = [] sources += sources_full configs = [ "../..:public_config_for_door" ] - deps = [ "$THIRDPARTY_BOUNDS_CHECKING_FUNCTION_DIR:libsec_shared" ] + deps = [ "//third_party/bounds_checking_function:libsec_shared" ] } } @@ -51,6 +53,6 @@ if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_MIDDLE) { sources += sources_smoke sources += sources_full configs = [ "../..:public_config_for_all" ] - deps = [ "$THIRDPARTY_BOUNDS_CHECKING_FUNCTION_DIR:libsec_shared" ] + deps = [ "//third_party/bounds_checking_function:libsec_shared" ] } } diff --git a/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/lock/config.gni b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/lock/config.gni new file mode 100644 index 00000000..e44ac92f --- /dev/null +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/lock/config.gni @@ -0,0 +1,66 @@ +# Copyright (c) 2022-2022 Huawei Device Co., Ltd. All rights reserved. +# +# 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. + +import("//build/lite/config/test.gni") +import("//kernel/liteos_a/testsuites/unittest/config.gni") + +common_include_dirs = [ + "//third_party/googletest/googletest/include", + "../../common/include", +] + +sources_entry = [ "../../common/osTest.cpp" ] + +sources_smoke = [] + +sources_full = [] + +# lock module +if (LOSCFG_USER_TEST_MUTEX == true) { + import("./mutex/config.gni") + common_include_dirs += mutex_include_dirs + sources_entry += mutex_sources_entry + sources_smoke += mutex_sources_smoke + sources_full += mutex_sources_full +} + +if (LOSCFG_USER_TEST_RWLOCK == true) { + import("./rwlock/config.gni") + common_include_dirs += rwlock_include_dirs + sources_entry += rwlock_sources_entry + sources_smoke += rwlock_sources_smoke + sources_full += rwlock_sources_full +} + +if (LOSCFG_USER_TEST_SPINLOCK == true) { + import("./spinlock/config.gni") + common_include_dirs += spinlock_include_dirs + sources_entry += spinlock_sources_entry + sources_smoke += spinlock_sources_smoke + sources_full += spinlock_sources_full +} diff --git a/src/kernel_liteos_a/testsuites/unittest/process/lock/mutex/config.gni b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/lock/mutex/config.gni similarity index 92% rename from src/kernel_liteos_a/testsuites/unittest/process/lock/mutex/config.gni rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/lock/mutex/config.gni index 6ff147dd..641d0399 100644 --- a/src/kernel_liteos_a/testsuites/unittest/process/lock/mutex/config.gni +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/lock/mutex/config.gni @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023 Huawei Device Co., Ltd. All rights reserved. +# Copyright (c) 2022-2022 Huawei Device Co., Ltd. All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: @@ -26,15 +26,14 @@ # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -import("//build/lite/config/test.gni") import("//kernel/liteos_a/testsuites/unittest/config.gni") -process_lock_mutex_include_dirs = [ "$TEST_UNITTEST_DIR/process/lock/mutex" ] +mutex_include_dirs = [ "$TEST_UNITTEST_DIR/process/lock/mutex" ] -process_lock_mutex_sources_entry = +mutex_sources_entry = [ "$TEST_UNITTEST_DIR/process/lock/mutex/process_mutex_test.cpp" ] -process_lock_mutex_sources_smoke = [ +mutex_sources_smoke = [ "$TEST_UNITTEST_DIR/process/lock/mutex/smoke/pthread_mutex_test_001.cpp", "$TEST_UNITTEST_DIR/process/lock/mutex/smoke/pthread_mutex_test_002.cpp", "$TEST_UNITTEST_DIR/process/lock/mutex/smoke/pthread_mutex_test_003.cpp", @@ -58,7 +57,7 @@ process_lock_mutex_sources_smoke = [ "$TEST_UNITTEST_DIR/process/lock/mutex/smoke/pthread_mutex_test_022.cpp", ] -process_lock_mutex_sources_full = [ +mutex_sources_full = [ "$TEST_UNITTEST_DIR/process/lock/mutex/full/pthread_mutex_test_018.cpp", "$TEST_UNITTEST_DIR/process/lock/mutex/full/pthread_mutex_test_023.cpp", "$TEST_UNITTEST_DIR/process/lock/mutex/full/pthread_mutex_test_024.cpp", diff --git a/src/kernel_liteos_a/testsuites/unittest/process/lock/mutex/full/pthread_mutex_test_018.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/lock/mutex/full/pthread_mutex_test_018.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/process/lock/mutex/full/pthread_mutex_test_018.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/lock/mutex/full/pthread_mutex_test_018.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/process/lock/mutex/full/pthread_mutex_test_023.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/lock/mutex/full/pthread_mutex_test_023.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/process/lock/mutex/full/pthread_mutex_test_023.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/lock/mutex/full/pthread_mutex_test_023.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/process/lock/mutex/full/pthread_mutex_test_024.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/lock/mutex/full/pthread_mutex_test_024.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/process/lock/mutex/full/pthread_mutex_test_024.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/lock/mutex/full/pthread_mutex_test_024.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/process/lock/mutex/full/pthread_mutex_test_025.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/lock/mutex/full/pthread_mutex_test_025.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/process/lock/mutex/full/pthread_mutex_test_025.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/lock/mutex/full/pthread_mutex_test_025.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/process/lock/mutex/it_mutex_test.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/lock/mutex/it_mutex_test.h similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/process/lock/mutex/it_mutex_test.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/lock/mutex/it_mutex_test.h diff --git a/src/kernel_liteos_a/testsuites/unittest/process/lock/mutex/process_mutex_test.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/lock/mutex/process_mutex_test.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/process/lock/mutex/process_mutex_test.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/lock/mutex/process_mutex_test.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_001.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_001.cpp similarity index 95% rename from src/kernel_liteos_a/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_001.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_001.cpp index e0e6ff7b..cd5249d6 100644 --- a/src/kernel_liteos_a/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_001.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_001.cpp @@ -64,8 +64,12 @@ EXIT: static int Testcase(void) { + struct sched_param param = { 0 }; int ret; - pthread_t newPthread; + void *res = nullptr; + pthread_attr_t a = { 0 }; + pthread_t thread = pthread_self(); + pthread_t newPthread, newPthread1; pthread_mutexattr_t mutex; int index = 0; pthread_mutexattr_settype(&mutex, PTHREAD_MUTEX_NORMAL); diff --git a/src/kernel_liteos_a/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_002.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_002.cpp similarity index 97% rename from src/kernel_liteos_a/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_002.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_002.cpp index 14eb9611..55dda966 100644 --- a/src/kernel_liteos_a/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_002.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_002.cpp @@ -65,8 +65,10 @@ static int Testcase(void) { struct sched_param param = { 0 }; int ret; + void *res = nullptr; pthread_attr_t a = { 0 }; - pthread_t newPthread; + pthread_t thread = pthread_self(); + pthread_t newPthread, newPthread1; pthread_mutexattr_t mutex; int index = 0; int currThreadPri, currThreadPolicy; diff --git a/src/kernel_liteos_a/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_003.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_003.cpp similarity index 97% rename from src/kernel_liteos_a/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_003.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_003.cpp index 092ea25c..ff3bca70 100644 --- a/src/kernel_liteos_a/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_003.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_003.cpp @@ -74,9 +74,12 @@ static int Testcase(void) { struct sched_param param = { 0 }; int ret; + void *res = nullptr; pthread_attr_t a = { 0 }; - pthread_t newPthread; + pthread_t thread = pthread_self(); + pthread_t newPthread, newPthread1; pthread_mutexattr_t mutex; + int count = 0; int currThreadPri, currThreadPolicy; g_preTaskPri = 0xffffffff; diff --git a/src/kernel_liteos_a/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_004.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_004.cpp similarity index 95% rename from src/kernel_liteos_a/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_004.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_004.cpp index a22b7020..f5affe14 100644 --- a/src/kernel_liteos_a/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_004.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_004.cpp @@ -49,6 +49,8 @@ static void *ThreadFuncTest3(void *a) int ret; int tid = Gettid(); pthread_t thread = pthread_self(); + int currThreadPri, currThreadPolicy; + struct sched_param param = { 0 }; ret = pthread_detach(thread); ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT); @@ -122,10 +124,14 @@ EXIT: static int Testcase(void) { + struct sched_param param = { 0 }; int ret; - pthread_t newPthread; + void *res = nullptr; + pthread_attr_t a = { 0 }; + pthread_t thread = pthread_self(); + pthread_t newPthread, newPthread1; pthread_mutexattr_t mutex; - + int index = 0; pthread_mutexattr_settype(&mutex, PTHREAD_MUTEX_NORMAL); pthread_mutex_init(&g_muxLock001, &mutex); pthread_mutex_init(&g_muxLock002, &mutex); diff --git a/src/kernel_liteos_a/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_005.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_005.cpp similarity index 95% rename from src/kernel_liteos_a/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_005.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_005.cpp index b7f06350..9d86a82c 100644 --- a/src/kernel_liteos_a/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_005.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_005.cpp @@ -49,6 +49,8 @@ static void *ThreadFuncTest3(void *a) int ret; int tid; pthread_t thread = pthread_self(); + int currThreadPri, currThreadPolicy; + struct sched_param param = { 0 }; ret = pthread_detach(thread); ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT); @@ -124,10 +126,14 @@ EXIT: static int Testcase(void) { + struct sched_param param = { 0 }; int ret; - pthread_t newPthread; + void *res = nullptr; + pthread_attr_t a = { 0 }; + pthread_t thread = pthread_self(); + pthread_t newPthread, newPthread1; pthread_mutexattr_t mutex; - + int index = 0; pthread_mutexattr_settype(&mutex, PTHREAD_MUTEX_NORMAL); pthread_mutex_init(&g_muxLock001, &mutex); pthread_mutex_init(&g_muxLock002, &mutex); diff --git a/src/kernel_liteos_a/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_006.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_006.cpp similarity index 95% rename from src/kernel_liteos_a/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_006.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_006.cpp index 79c47faa..ee263599 100644 --- a/src/kernel_liteos_a/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_006.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_006.cpp @@ -48,6 +48,8 @@ static void *ThreadFuncTest3(void *a) { int ret; int tid = Gettid(); + int currThreadPri, currThreadPolicy; + struct sched_param param = { 0 }; pthread_t thread = pthread_self(); ret = pthread_detach(thread); @@ -116,14 +118,18 @@ static void *ThreadFuncTest1(void *a) ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT); EXIT: -return nullptr; + return nullptr; } static int Testcase(void) { + struct sched_param param = { 0 }; int ret; - pthread_t newPthread; + void *res = nullptr; + pthread_attr_t a = { 0 }; + pthread_t newPthread, newPthread1; pthread_mutexattr_t mutex; + int index = 0; pthread_mutexattr_settype(&mutex, PTHREAD_MUTEX_NORMAL); pthread_mutex_init(&g_mutexLock001, &mutex); pthread_mutex_init(&g_mutexLock002, &mutex); diff --git a/src/kernel_liteos_a/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_007.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_007.cpp similarity index 95% rename from src/kernel_liteos_a/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_007.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_007.cpp index b3129b80..e8bda9c5 100644 --- a/src/kernel_liteos_a/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_007.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_007.cpp @@ -43,6 +43,7 @@ static void *ThreadFuncTest3(void *a) { int ret; pthread_t thread = pthread_self(); + int currThreadPri, currThreadPolicy; struct sched_param param = { 0 }; struct timespec time; struct timeval timeVal = { 0 }; @@ -61,7 +62,7 @@ static void *ThreadFuncTest3(void *a) g_testToCount003++; while (g_testToCount002 == 0) { - SLEEP_AND_YIELD(2); // 2, delay enough time + SLEEP_AND_YIELD(2); // 2, delay enouge time } ret = pthread_mutex_unlock(&g_muxLock003); @@ -95,7 +96,7 @@ static void *ThreadFuncTest2(void *a) g_testToCount002++; while (g_testToCount001 == 0) { - SLEEP_AND_YIELD(2); // 2, delay enough time + SLEEP_AND_YIELD(2); // 2, delay enouge time } ret = pthread_mutex_unlock(&g_muxLock002); @@ -140,8 +141,12 @@ EXIT: static int Testcase(void) { + struct sched_param param = { 0 }; int ret; - pthread_t newPthread; + void *res = nullptr; + pthread_attr_t a = { 0 }; + pthread_t thread = pthread_self(); + pthread_t newPthread, newPthread1; pthread_mutexattr_t mutex = { 0 }; int index = TEST_COUNT; diff --git a/src/kernel_liteos_a/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_008.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_008.cpp similarity index 95% rename from src/kernel_liteos_a/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_008.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_008.cpp index c827e21f..347b3941 100644 --- a/src/kernel_liteos_a/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_008.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_008.cpp @@ -41,6 +41,8 @@ static void *ThreadFuncTest3(void *a) { int ret; pthread_t thread = pthread_self(); + int currThreadPri, currThreadPolicy; + struct sched_param param = { 0 }; struct timespec time; struct timeval timeVal = { 0 }; @@ -118,8 +120,12 @@ EXIT: static int Testcase(void) { + struct sched_param param = { 0 }; int ret; - pthread_t newPthread; + void *res = nullptr; + pthread_attr_t a = { 0 }; + pthread_t thread = pthread_self(); + pthread_t newPthread, newPthread1; pthread_mutexattr_t mutex; int index = TEST_COUNT; diff --git a/src/kernel_liteos_a/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_009.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_009.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_009.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_009.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_010.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_010.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_010.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_010.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_011.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_011.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_011.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_011.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_012.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_012.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_012.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_012.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_013.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_013.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_013.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_013.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_014.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_014.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_014.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_014.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_015.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_015.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_015.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_015.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_016.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_016.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_016.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_016.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_017.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_017.cpp similarity index 96% rename from src/kernel_liteos_a/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_017.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_017.cpp index def2bfa2..5d7ef7d7 100644 --- a/src/kernel_liteos_a/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_017.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_017.cpp @@ -38,6 +38,7 @@ static int g_testBackCount = 0; static void *ThreadFuncTest3(void *a) { int ret; + int tid = Gettid(); pthread_t thread = pthread_self(); ret = pthread_detach(thread); @@ -58,6 +59,8 @@ EXIT: static void *ThreadFuncTest2(void *a) { int ret; + int tid = Gettid(); + pthread_t thread = pthread_self(); g_testBackCount++; ret = pthread_mutex_lock(&g_mutexLock); @@ -75,8 +78,10 @@ static int TestCase(void) { struct sched_param param = { 0 }; int ret; + void *res = nullptr; int currThreadPri, currThreadPolicy; pthread_attr_t a = { 0 }; + pthread_t thread = pthread_self(); pthread_t newPthread; pthread_mutexattr_t mutex; pthread_mutexattr_settype(&mutex, PTHREAD_MUTEX_NORMAL); diff --git a/src/kernel_liteos_a/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_019.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_019.cpp similarity index 97% rename from src/kernel_liteos_a/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_019.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_019.cpp index 05fdb6fa..a82af29a 100644 --- a/src/kernel_liteos_a/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_019.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_019.cpp @@ -45,6 +45,8 @@ static void *ThreadFuncTest2(void *a) { int ret; pthread_t thread = pthread_self(); + struct timespec time; + struct timeval timeVal = { 0 }; ret = pthread_detach(thread); ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT); @@ -67,6 +69,7 @@ EXIT: static void *ThreadFuncTest1(void *a) { int ret; + pthread_t thread = pthread_self(); struct timespec time; struct timeval timeVal = { 0 }; @@ -103,7 +106,9 @@ static int Testcase(void) struct sched_param param = { 0 }; int ret; int threadCount; + void *res = nullptr; pthread_attr_t a = { 0 }; + pthread_t thread = pthread_self(); pthread_t newPthread[10], newPthread1; pthread_mutexattr_t mutex; int index = TEST_COUNT; diff --git a/src/kernel_liteos_a/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_020.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_020.cpp similarity index 96% rename from src/kernel_liteos_a/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_020.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_020.cpp index 0c1f334e..34d7fa91 100644 --- a/src/kernel_liteos_a/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_020.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_020.cpp @@ -45,6 +45,8 @@ static void *ThreadFuncTest2(void *a) { int ret; pthread_t thread = pthread_self(); + struct timespec time; + struct timeval timeVal = { 0 }; ret = pthread_detach(thread); ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT); @@ -67,6 +69,9 @@ EXIT: static void *ThreadFuncTest1(void *a) { int ret; + pthread_t thread = pthread_self(); + struct timespec time; + struct timeval timeVal = { 0 }; ret = pthread_mutex_lock(&g_muxLock001); ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT); @@ -91,6 +96,7 @@ EXIT: static void *ThreadFuncTest0(void *a) { int ret; + pthread_t thread = pthread_self(); struct timespec time; struct timeval timeVal = { 0 }; @@ -130,7 +136,9 @@ static int Testcase(void) struct sched_param param = { 0 }; int ret; int threadCount; + void *res = nullptr; pthread_attr_t a = { 0 }; + pthread_t thread = pthread_self(); pthread_t newPthread[10], newPthread1; pthread_mutexattr_t mutex; int index = TEST_COUNT; diff --git a/src/kernel_liteos_a/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_021.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_021.cpp similarity index 96% rename from src/kernel_liteos_a/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_021.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_021.cpp index 4a515861..11b41103 100644 --- a/src/kernel_liteos_a/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_021.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_021.cpp @@ -45,6 +45,8 @@ static void *ThreadFuncTest2(void *a) { int ret; pthread_t thread = pthread_self(); + struct timespec time; + struct timeval timeVal = { 0 }; ret = pthread_detach(thread); ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT); @@ -67,6 +69,9 @@ EXIT: static void *ThreadFuncTest1(void *a) { int ret; + pthread_t thread = pthread_self(); + struct timespec time; + struct timeval timeVal = { 0 }; ret = pthread_mutex_lock(&g_muxLock001); ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT); @@ -91,6 +96,7 @@ EXIT: static void *ThreadFuncTest0(void *a) { int ret; + pthread_t thread = pthread_self(); struct timespec time; struct timeval timeVal = { 0 }; @@ -130,7 +136,9 @@ static int Testcase(void) struct sched_param param = { 0 }; int ret; int threadCount; + void *res = nullptr; pthread_attr_t a = { 0 }; + pthread_t thread = pthread_self(); pthread_t newPthread[10], newPthread1; pthread_mutexattr_t mutex; int index = TEST_COUNT; diff --git a/src/kernel_liteos_a/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_022.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_022.cpp similarity index 96% rename from src/kernel_liteos_a/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_022.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_022.cpp index 0ed49774..5ff82980 100644 --- a/src/kernel_liteos_a/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_022.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/lock/mutex/smoke/pthread_mutex_test_022.cpp @@ -45,6 +45,8 @@ static void *ThreadFuncTest2(void *a) { int ret; pthread_t thread = pthread_self(); + struct timespec time; + struct timeval timeVal = { 0 }; ret = pthread_detach(thread); ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT); @@ -67,6 +69,9 @@ EXIT: static void *ThreadFuncTest1(void *a) { int ret; + pthread_t thread = pthread_self(); + struct timespec time; + struct timeval timeVal = { 0 }; ret = pthread_mutex_lock(&g_muxLock001); ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT); @@ -91,6 +96,7 @@ EXIT: static void *ThreadFuncTest0(void *a) { int ret; + pthread_t thread = pthread_self(); struct timespec time; struct timeval timeVal = { 0 }; @@ -130,7 +136,9 @@ static int Testcase(void) struct sched_param param = { 0 }; int ret; int threadCount; + void *res = nullptr; pthread_attr_t a = { 0 }; + pthread_t thread = pthread_self(); pthread_t newPthread[10], newPthread1; pthread_mutexattr_t mutex; int index = TEST_COUNT; diff --git a/src/kernel_liteos_a/testsuites/unittest/process/lock/rwlock/config.gni b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/lock/rwlock/config.gni similarity index 85% rename from src/kernel_liteos_a/testsuites/unittest/process/lock/rwlock/config.gni rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/lock/rwlock/config.gni index 33b1e506..b34a6053 100644 --- a/src/kernel_liteos_a/testsuites/unittest/process/lock/rwlock/config.gni +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/lock/rwlock/config.gni @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023 Huawei Device Co., Ltd. All rights reserved. +# Copyright (c) 2022-2022 Huawei Device Co., Ltd. All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: @@ -26,18 +26,17 @@ # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -import("//build/lite/config/test.gni") import("//kernel/liteos_a/testsuites/unittest/config.gni") -process_lock_rwlock_include_dirs = [ "$TEST_UNITTEST_DIR/process/lock/rwlock" ] +rwlock_include_dirs = [ "$TEST_UNITTEST_DIR/process/lock/rwlock" ] -process_lock_rwlock_sources_entry = +rwlock_sources_entry = [ "$TEST_UNITTEST_DIR/process/lock/rwlock/process_rwlock_test.cpp" ] -process_lock_rwlock_sources_smoke = [ +rwlock_sources_smoke = [ "$TEST_UNITTEST_DIR/process/lock/rwlock/smoke/pthread_rwlock_test_001.cpp", ] -process_lock_rwlock_sources_full = [ +rwlock_sources_full = [ "$TEST_UNITTEST_DIR/process/lock/rwlock/full/pthread_rwlock_test_002.cpp", ] diff --git a/src/kernel_liteos_a/testsuites/unittest/process/lock/rwlock/full/pthread_rwlock_test_002.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/lock/rwlock/full/pthread_rwlock_test_002.cpp similarity index 98% rename from src/kernel_liteos_a/testsuites/unittest/process/lock/rwlock/full/pthread_rwlock_test_002.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/lock/rwlock/full/pthread_rwlock_test_002.cpp index efff5610..075c2aa8 100644 --- a/src/kernel_liteos_a/testsuites/unittest/process/lock/rwlock/full/pthread_rwlock_test_002.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/lock/rwlock/full/pthread_rwlock_test_002.cpp @@ -227,8 +227,7 @@ static int PthreadRwlockTest(void) int index = 0; int curThreadPri, curThreadPolicy; - ret = memset_s(static_cast(g_rwlockData), sizeof(int) * TEST_DATA_SIZE, 0, sizeof(int) * TEST_DATA_SIZE); - ICUNIT_ASSERT_EQUAL(ret, 0, ret); + (void)memset_s((void *)g_rwlockData, sizeof(int) * TEST_DATA_SIZE, 0, sizeof(int) * TEST_DATA_SIZE); g_rwlockMask = 0; pthread_rwlock_init(&g_rwlockLock, NULL); diff --git a/src/kernel_liteos_a/testsuites/unittest/process/lock/rwlock/it_rwlock_test.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/lock/rwlock/it_rwlock_test.h similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/process/lock/rwlock/it_rwlock_test.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/lock/rwlock/it_rwlock_test.h diff --git a/src/kernel_liteos_a/testsuites/unittest/process/lock/rwlock/process_rwlock_test.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/lock/rwlock/process_rwlock_test.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/process/lock/rwlock/process_rwlock_test.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/lock/rwlock/process_rwlock_test.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/process/lock/rwlock/smoke/pthread_rwlock_test_001.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/lock/rwlock/smoke/pthread_rwlock_test_001.cpp similarity index 98% rename from src/kernel_liteos_a/testsuites/unittest/process/lock/rwlock/smoke/pthread_rwlock_test_001.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/lock/rwlock/smoke/pthread_rwlock_test_001.cpp index a4a19d75..c50dda80 100644 --- a/src/kernel_liteos_a/testsuites/unittest/process/lock/rwlock/smoke/pthread_rwlock_test_001.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/lock/rwlock/smoke/pthread_rwlock_test_001.cpp @@ -227,8 +227,7 @@ static int Testcase(void) int index = 0; int curThreadPri, curThreadPolicy; - ret = memset_s(static_cast(g_rwlockData), sizeof(int) * TEST_DATA_SIZE, 0, sizeof(int) * TEST_DATA_SIZE); - ICUNIT_ASSERT_EQUAL(ret, 0, ret); + (void)memset_s((void *)g_rwlockData, sizeof(int) * TEST_DATA_SIZE, 0, sizeof(int) * TEST_DATA_SIZE); g_rwlockMask = 0; pthread_rwlock_init(&g_rwlockLock, NULL); diff --git a/src/kernel_liteos_a/testsuites/unittest/process/lock/spinlock/config.gni b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/lock/spinlock/config.gni similarity index 80% rename from src/kernel_liteos_a/testsuites/unittest/process/lock/spinlock/config.gni rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/lock/spinlock/config.gni index 8798d873..457673be 100644 --- a/src/kernel_liteos_a/testsuites/unittest/process/lock/spinlock/config.gni +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/lock/spinlock/config.gni @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023 Huawei Device Co., Ltd. All rights reserved. +# Copyright (c) 2022-2022 Huawei Device Co., Ltd. All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: @@ -26,15 +26,13 @@ # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -import("//build/lite/config/test.gni") import("//kernel/liteos_a/testsuites/unittest/config.gni") -process_lock_spinlock_include_dirs = - [ "$TEST_UNITTEST_DIR/process/lock/spinlock" ] +spinlock_include_dirs = [ "$TEST_UNITTEST_DIR/process/lock/spinlock" ] -process_lock_spinlock_sources_entry = +spinlock_sources_entry = [ "$TEST_UNITTEST_DIR/process/lock/spinlock/process_spinlock_test.cpp" ] -process_lock_spinlock_sources_smoke = [ "$TEST_UNITTEST_DIR/process/lock/spinlock/smoke/pthread_spinlock_test_001.cpp" ] +spinlock_sources_smoke = [ "$TEST_UNITTEST_DIR/process/lock/spinlock/smoke/pthread_spinlock_test_001.cpp" ] -process_lock_spinlock_sources_full = [] +spinlock_sources_full = [] diff --git a/src/kernel_liteos_a/testsuites/unittest/process/lock/spinlock/it_spinlock_test.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/lock/spinlock/it_spinlock_test.h similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/process/lock/spinlock/it_spinlock_test.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/lock/spinlock/it_spinlock_test.h diff --git a/src/kernel_liteos_a/testsuites/unittest/process/lock/spinlock/process_spinlock_test.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/lock/spinlock/process_spinlock_test.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/process/lock/spinlock/process_spinlock_test.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/lock/spinlock/process_spinlock_test.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/process/lock/spinlock/smoke/pthread_spinlock_test_001.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/lock/spinlock/smoke/pthread_spinlock_test_001.cpp similarity index 97% rename from src/kernel_liteos_a/testsuites/unittest/process/lock/spinlock/smoke/pthread_spinlock_test_001.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/lock/spinlock/smoke/pthread_spinlock_test_001.cpp index 8e73e83d..96c48729 100644 --- a/src/kernel_liteos_a/testsuites/unittest/process/lock/spinlock/smoke/pthread_spinlock_test_001.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/process/lock/spinlock/smoke/pthread_spinlock_test_001.cpp @@ -134,8 +134,7 @@ static int Testcase(void) int index = 0; int curThreadPri, curThreadPolicy; - ret = memset_s(static_cast(g_spinlockData), sizeof(int) * TEST_DATA_SIZE, 0, sizeof(int) * TEST_DATA_SIZE); - ICUNIT_ASSERT_EQUAL(ret, 0, ret); + (void)memset_s((void *)g_spinlockData, sizeof(int) * TEST_DATA_SIZE, 0, sizeof(int) * TEST_DATA_SIZE); g_spinlockMask = 0; pthread_spin_init(&g_spinlockLock, 0); diff --git a/src/kernel_liteos_a/testsuites/unittest/security/BUILD.gn b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/security/BUILD.gn similarity index 90% rename from src/kernel_liteos_a/testsuites/unittest/security/BUILD.gn rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/security/BUILD.gn index 348066ee..0032da79 100644 --- a/src/kernel_liteos_a/testsuites/unittest/security/BUILD.gn +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/security/BUILD.gn @@ -26,6 +26,8 @@ # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +import("//build/lite/config/test.gni") +import("//kernel/liteos_a/testsuites/unittest/config.gni") import("./config.gni") if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_LOW) { @@ -38,7 +40,7 @@ if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_LOW) { sources_full = [] sources += sources_full configs = [ "..:public_config_for_door" ] - deps = [ "$THIRDPARTY_BOUNDS_CHECKING_FUNCTION_DIR:libsec_shared" ] + deps = [ "//third_party/bounds_checking_function:libsec_shared" ] } } @@ -51,6 +53,6 @@ if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_MIDDLE) { sources += sources_smoke sources += sources_full configs = [ "..:public_config_for_all" ] - deps = [ "$THIRDPARTY_BOUNDS_CHECKING_FUNCTION_DIR:libsec_shared" ] + deps = [ "//third_party/bounds_checking_function:libsec_shared" ] } } diff --git a/src/kernel_liteos_a/testsuites/unittest/security/capability/config.gni b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/security/capability/config.gni similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/security/capability/config.gni rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/security/capability/config.gni diff --git a/src/kernel_liteos_a/testsuites/unittest/security/capability/it_test_capability.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/security/capability/it_test_capability.h similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/security/capability/it_test_capability.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/security/capability/it_test_capability.h diff --git a/src/kernel_liteos_a/testsuites/unittest/security/capability/security_capability_test.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/security/capability/security_capability_test.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/security/capability/security_capability_test.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/security/capability/security_capability_test.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/security/capability/smoke/cap_test_001.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/security/capability/smoke/cap_test_001.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/security/capability/smoke/cap_test_001.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/security/capability/smoke/cap_test_001.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/security/config.gni b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/security/config.gni similarity index 96% rename from src/kernel_liteos_a/testsuites/unittest/security/config.gni rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/security/config.gni index 2f82731e..75e411d9 100644 --- a/src/kernel_liteos_a/testsuites/unittest/security/config.gni +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/security/config.gni @@ -27,11 +27,10 @@ # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. import("//build/lite/config/test.gni") -import("//kernel/liteos_a/liteos.gni") import("//kernel/liteos_a/testsuites/unittest/config.gni") common_include_dirs = [ - "$THIRDPARTY_GOOGLETEST_DIR/googletest/include", + "//third_party/googletest/googletest/include", "../common/include", ] diff --git a/src/kernel_liteos_a/testsuites/unittest/security/reugid/config.gni b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/security/reugid/config.gni similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/security/reugid/config.gni rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/security/reugid/config.gni diff --git a/src/kernel_liteos_a/testsuites/unittest/security/reugid/it_test_reugid.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/security/reugid/it_test_reugid.h similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/security/reugid/it_test_reugid.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/security/reugid/it_test_reugid.h diff --git a/src/kernel_liteos_a/testsuites/unittest/security/reugid/security_reugid_test.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/security/reugid/security_reugid_test.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/security/reugid/security_reugid_test.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/security/reugid/security_reugid_test.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/security/reugid/smoke/reugid_test_001.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/security/reugid/smoke/reugid_test_001.cpp similarity index 67% rename from src/kernel_liteos_a/testsuites/unittest/security/reugid/smoke/reugid_test_001.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/security/reugid/smoke/reugid_test_001.cpp index bc558a95..4dfa6141 100644 --- a/src/kernel_liteos_a/testsuites/unittest/security/reugid/smoke/reugid_test_001.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/security/reugid/smoke/reugid_test_001.cpp @@ -51,11 +51,10 @@ static int Child1(int *list, int listSize) egid = getegid(); ICUNIT_ASSERT_EQUAL(egid, 300, egid); - ret = getresgid(reinterpret_cast(&ruid), reinterpret_cast(&euid), - reinterpret_cast(&suid)); + ret = getresgid((gid_t *)&ruid, (gid_t *)&euid, (gid_t *)&suid); ICUNIT_ASSERT_EQUAL(ret, 0, ret); - ICUNIT_ASSERT_EQUAL(ruid, 300, ruid); // 300: expected ruid - ICUNIT_ASSERT_EQUAL(euid, 300, euid); // 300: expected euid + ICUNIT_ASSERT_EQUAL(ruid, 300, ruid); + ICUNIT_ASSERT_EQUAL(euid, 300, euid); ICUNIT_ASSERT_EQUAL(suid, 300, suid); ruid = getuid(); @@ -63,30 +62,29 @@ static int Child1(int *list, int listSize) euid = geteuid(); ICUNIT_ASSERT_EQUAL(euid, 300, euid); - ret = getresuid(reinterpret_cast(&ruid), reinterpret_cast(&euid), - reinterpret_cast(&suid)); + ret = getresuid((gid_t *)&ruid, (gid_t *)&euid, (gid_t *)&suid); ICUNIT_ASSERT_EQUAL(ret, 0, ret); - ICUNIT_ASSERT_EQUAL(ruid, 300, ruid); // 300: expected ruid + ICUNIT_ASSERT_EQUAL(ruid, 300, ruid); ICUNIT_ASSERT_EQUAL(euid, 300, euid); ICUNIT_ASSERT_EQUAL(suid, 300, suid); - int size = getgroups(0, reinterpret_cast(getList)); + int size = getgroups(0, (gid_t *)getList); ICUNIT_ASSERT_EQUAL(size, listSize, size); - size = getgroups(size, reinterpret_cast(getList)); + size = getgroups(size, (gid_t *)getList); ICUNIT_ASSERT_EQUAL(size, listSize, size); for (int i = 0; i < size - 1; i++) { ICUNIT_ASSERT_EQUAL(getList[i], list[i], getList[i]); } getList[size - 1] = 500; - ret = setgroups(0, reinterpret_cast(getList)); + ret = setgroups(0, (gid_t *)getList); ICUNIT_ASSERT_EQUAL(ret, 0, ret); ret = getgroups(0, NULL); ICUNIT_ASSERT_EQUAL(ret, 1, ret); - ret = getgroups(ret, reinterpret_cast(getList)); + ret = getgroups(ret, (gid_t *)getList); ICUNIT_ASSERT_EQUAL(ret, 1, ret); ICUNIT_ASSERT_EQUAL(getList[0], getgid(), getList[0]); @@ -111,7 +109,7 @@ static int Child(void) ret = getgid(); ICUNIT_ASSERT_EQUAL(ret, 3000, ret); ret = getegid(); - ICUNIT_ASSERT_EQUAL(ret, 3000, ret); // 3000: expected egid + ICUNIT_ASSERT_EQUAL(ret, 3000, ret); ret = setegid(3000); ICUNIT_ASSERT_EQUAL(ret, 0, ret); @@ -127,50 +125,50 @@ static int Child(void) ICUNIT_ASSERT_EQUAL(ret, -1, ret); ICUNIT_ASSERT_EQUAL(EINVAL, errno, errno); - list[0] = 1000; // 1000: preset value of list[0] - list[1] = 2000; // 2000: preset value of list[1] - list[2] = 3000; // 3000: preset value of list[2] - list[3] = 4000; // 4000: preset value of list[3] - list[4] = 5000; // 5000: preset value of list[4] - ret = setgroups(5, reinterpret_cast(list)); // 5: set groupid for testing + list[0] = 1000; + list[1] = 2000; + list[2] = 3000; + list[3] = 4000; + list[4] = 5000; + ret = setgroups(5, (gid_t *)list); ICUNIT_ASSERT_EQUAL(ret, 0, ret); - size = getgroups(0, reinterpret_cast(getList)); + size = getgroups(0, (gid_t *)getList); ICUNIT_ASSERT_EQUAL(size, 5, size); - size = getgroups(size, reinterpret_cast(getList)); + size = getgroups(size, (gid_t *)getList); ICUNIT_ASSERT_EQUAL(size, 5, size); for (int i = 0; i < size; i++) { ICUNIT_ASSERT_EQUAL(getList[i], list[i], getList[i]); } - list[0] = 1000; // 1000: preset value of list[0] - list[1] = 2000; // 2000: preset value of list[1] - list[2] = 6000; // 6000: preset value of list[2] - list[3] = 4000; // 4000: preset value of list[3] - list[4] = 5000; // 5000: preset value of list[4] + list[0] = 1000; + list[1] = 2000; + list[2] = 6000; + list[3] = 4000; + list[4] = 5000; list[5] = -1; - ret = setgroups(6, reinterpret_cast(list)); // 6: set groupid for testing + ret = setgroups(6, (gid_t *)list); ICUNIT_ASSERT_EQUAL(ret, -1, ret); ICUNIT_ASSERT_EQUAL(EINVAL, errno, errno); - list[0] = 1000; // 1000: preset value of list[0] - list[1] = 2000; // 2000: preset value of list[1] - list[2] = 6000; // 6000: preset value of list[2] - list[3] = 4000; // 4000: preset value of list[3] - list[4] = 5000; // 5000: preset value of list[4] + list[0] = 1000; + list[1] = 2000; + list[2] = 6000; + list[3] = 4000; + list[4] = 5000; list[5] = 7000; - ret = setgroups(6, reinterpret_cast(list)); // 6: set groupid for testing + ret = setgroups(6, (gid_t *)list); ICUNIT_ASSERT_EQUAL(ret, 0, ret); - size = getgroups(0, reinterpret_cast(getList)); + size = getgroups(0, (gid_t *)getList); ICUNIT_ASSERT_EQUAL(size, 7, size); size = getgroups(0, NULL); ICUNIT_ASSERT_EQUAL(size, 7, size); - size = getgroups(size, reinterpret_cast(getList)); + size = getgroups(size, (gid_t *)getList); ICUNIT_ASSERT_EQUAL(size, 7, size); for (int i = 0; i < size - 1; i++) { ICUNIT_ASSERT_EQUAL(getList[i], list[i], getList[i]); @@ -182,7 +180,7 @@ static int Child(void) ICUNIT_ASSERT_EQUAL(ret, 0, ret); ret = geteuid(); - ICUNIT_ASSERT_EQUAL(ret, 8000, ret); // 8000: expected value of euid + ICUNIT_ASSERT_EQUAL(ret, 8000, ret); ret = setuid(2000); ICUNIT_ASSERT_EQUAL(ret, 0, ret); @@ -205,16 +203,16 @@ static int Child(void) ret = setregid(5000, 5000); ICUNIT_ASSERT_EQUAL(ret, 0, ret); ret = getgid(); - ICUNIT_ASSERT_EQUAL(ret, 5000, ret); // 5000: expected value of gid + ICUNIT_ASSERT_EQUAL(ret, 5000, ret); egid = getegid(); - ICUNIT_ASSERT_EQUAL(egid, 5000, egid); // 5000: expected value of egid + ICUNIT_ASSERT_EQUAL(egid, 5000, egid); ret = setregid(5000, -1); ICUNIT_ASSERT_EQUAL(ret, 0, ret); ret = getgid(); - ICUNIT_ASSERT_EQUAL(ret, 5000, ret); // 5000: expected value of gid + ICUNIT_ASSERT_EQUAL(ret, 5000, ret); egid = getegid(); - ICUNIT_ASSERT_EQUAL(egid, 5000, egid); // 5000: expected value of egid + ICUNIT_ASSERT_EQUAL(egid, 5000, egid); ret = setregid(3000, -2); ICUNIT_ASSERT_EQUAL(ret, -1, ret); @@ -227,9 +225,9 @@ static int Child(void) ret = setregid(3000, -1); ICUNIT_ASSERT_EQUAL(ret, 0, ret); ret = getgid(); - ICUNIT_ASSERT_EQUAL(ret, 3000, ret); // 3000: expected value of gid + ICUNIT_ASSERT_EQUAL(ret, 3000, ret); egid = getegid(); - ICUNIT_ASSERT_EQUAL(egid, 3000, egid); // 3000: expected value of egid + ICUNIT_ASSERT_EQUAL(egid, 3000, egid); ret = setreuid(1000, 3000); ICUNIT_ASSERT_EQUAL(ret, -1, ret); @@ -246,24 +244,23 @@ static int Child(void) ret = setreuid(-1, 3000); ICUNIT_ASSERT_EQUAL(ret, 0, ret); ruid = getuid(); - ICUNIT_ASSERT_EQUAL(ruid, 3000, ruid); // 3000: expected value of ruid + ICUNIT_ASSERT_EQUAL(ruid, 3000, ruid); euid = geteuid(); - ICUNIT_ASSERT_EQUAL(euid, 3000, euid); // 3000: expected value of euid + ICUNIT_ASSERT_EQUAL(euid, 3000, euid); ret = setreuid(1000, -1); ICUNIT_ASSERT_EQUAL(ret, 0, ret); ruid = getuid(); - ICUNIT_ASSERT_EQUAL(ruid, 1000, ruid); // 1000: expected value of ruid + ICUNIT_ASSERT_EQUAL(ruid, 1000, ruid); euid = geteuid(); - ICUNIT_ASSERT_EQUAL(euid, 1000, euid); // 1000: expected value of euid + ICUNIT_ASSERT_EQUAL(euid, 1000, euid); ret = setresuid(100, 100, 100); ICUNIT_ASSERT_EQUAL(ret, 0, ret); - ret = getresuid(reinterpret_cast(&ruid), reinterpret_cast(&euid), - reinterpret_cast(&suid)); + ret = getresuid((uid_t *)&ruid, (uid_t *)&euid, (uid_t *)&suid); ICUNIT_ASSERT_EQUAL(ret, 0, ret); ICUNIT_ASSERT_EQUAL(ruid, 100, ruid); - ICUNIT_ASSERT_EQUAL(euid, 100, euid); // 100: expected value of euid + ICUNIT_ASSERT_EQUAL(euid, 100, euid); ICUNIT_ASSERT_EQUAL(suid, 100, suid); ret = setresuid(200, 100, 100); @@ -280,20 +277,18 @@ static int Child(void) ret = setresuid(-1, 200, 200); ICUNIT_ASSERT_EQUAL(ret, 0, ret); - ret = getresuid(reinterpret_cast(&ruid), reinterpret_cast(&euid), - reinterpret_cast(&suid)); + ret = getresuid((uid_t *)&ruid, (uid_t *)&euid, (uid_t *)&suid); ICUNIT_ASSERT_EQUAL(ret, 0, ret); - ICUNIT_ASSERT_EQUAL(ruid, 200, ruid); // 200: expected value of ruid + ICUNIT_ASSERT_EQUAL(ruid, 200, ruid); ICUNIT_ASSERT_EQUAL(euid, 200, euid); ICUNIT_ASSERT_EQUAL(suid, 200, suid); - ret = setresuid(-1, -1, 300); // set saved-set user id to 300 + ret = setresuid(-1, -1, 300); ICUNIT_ASSERT_EQUAL(ret, 0, ret); - ret = getresuid(reinterpret_cast(&ruid), reinterpret_cast(&euid), - reinterpret_cast(&suid)); + ret = getresuid((uid_t *)&ruid, (uid_t *)&euid, (uid_t *)&suid); ICUNIT_ASSERT_EQUAL(ret, 0, ret); ICUNIT_ASSERT_EQUAL(ruid, 300, ruid); - ICUNIT_ASSERT_EQUAL(euid, 300, euid); // 300: expected value of euid + ICUNIT_ASSERT_EQUAL(euid, 300, euid); ICUNIT_ASSERT_EQUAL(suid, 300, suid); ret = setresuid(-1, 200, 300); @@ -314,14 +309,13 @@ static int Child(void) ICUNIT_ASSERT_EQUAL(ret, -1, ret); ICUNIT_ASSERT_EQUAL(EINVAL, errno, errno); - ret = setresgid(100, 100, 100); // 100: value of rgid, egid and sgid + ret = setresgid(100, 100, 100); ICUNIT_ASSERT_EQUAL(ret, 0, ret); - ret = getresgid(reinterpret_cast(&rgid), reinterpret_cast(&egid), - reinterpret_cast(&sgid)); + ret = getresgid((gid_t *)&rgid, (gid_t *)&egid, (gid_t *)&sgid); ICUNIT_ASSERT_EQUAL(ret, 0, ret); ICUNIT_ASSERT_EQUAL(rgid, 100, rgid); ICUNIT_ASSERT_EQUAL(egid, 100, egid); - ICUNIT_ASSERT_EQUAL(sgid, 100, sgid); // 100: expected value of sgid + ICUNIT_ASSERT_EQUAL(sgid, 100, sgid); ret = setresgid(200, 100, 100); ICUNIT_ASSERT_EQUAL(ret, -1, ret); @@ -335,31 +329,29 @@ static int Child(void) ICUNIT_ASSERT_EQUAL(ret, -1, ret); ICUNIT_ASSERT_EQUAL(EPERM, errno, errno); - ret = setresgid(-2, 100, 200); // set rgid to -2, egid to 100, sgid to 200 + ret = setresgid(-2, 100, 200); ICUNIT_ASSERT_EQUAL(ret, -1, ret); ICUNIT_ASSERT_EQUAL(EINVAL, errno, errno); - ret = setresgid(100, -2, 200); // set rgid to 100, egid to -2, sgid to 200 + ret = setresgid(100, -2, 200); ICUNIT_ASSERT_EQUAL(ret, -1, ret); ICUNIT_ASSERT_EQUAL(EINVAL, errno, errno); - ret = setresgid(100, 100, -2); // set rgid and egid to 100, rgid to -2 + ret = setresgid(100, 100, -2); ICUNIT_ASSERT_EQUAL(ret, -1, ret); ICUNIT_ASSERT_EQUAL(EINVAL, errno, errno); ret = setresgid(100, -1, -2); ICUNIT_ASSERT_EQUAL(ret, -1, ret); ICUNIT_ASSERT_EQUAL(EINVAL, errno, errno); - ret = setresgid(-1, 200, 200); // 200: value of egid and sgid + ret = setresgid(-1, 200, 200); ICUNIT_ASSERT_EQUAL(ret, 0, ret); - ret = getresgid(reinterpret_cast(&rgid), reinterpret_cast(&egid), - reinterpret_cast(&sgid)); + ret = getresgid((gid_t *)&rgid, (gid_t *)&egid, (gid_t *)&sgid); ICUNIT_ASSERT_EQUAL(ret, 0, ret); - ICUNIT_ASSERT_EQUAL(rgid, 200, rgid); // 200: expected value of rgid - ICUNIT_ASSERT_EQUAL(egid, 200, egid); // 200: expected value of egid - ICUNIT_ASSERT_EQUAL(sgid, 200, sgid); // 200: expected value of sgid + ICUNIT_ASSERT_EQUAL(rgid, 200, rgid); + ICUNIT_ASSERT_EQUAL(egid, 200, egid); + ICUNIT_ASSERT_EQUAL(sgid, 200, sgid); - ret = setresgid(-1, -1, 300); // set sgid to 300 + ret = setresgid(-1, -1, 300); ICUNIT_ASSERT_EQUAL(ret, 0, ret); - ret = getresgid(reinterpret_cast(&rgid), reinterpret_cast(&egid), - reinterpret_cast(&sgid)); + ret = getresgid((gid_t *)&rgid, (gid_t *)&egid, (gid_t *)&sgid); ICUNIT_ASSERT_EQUAL(ret, 0, ret); ICUNIT_ASSERT_EQUAL(rgid, 300, rgid); ICUNIT_ASSERT_EQUAL(egid, 300, egid); @@ -369,8 +361,8 @@ static int Child(void) ICUNIT_ASSERT_EQUAL(ret, -1, ret); ICUNIT_ASSERT_EQUAL(EPERM, errno, errno); - size = getgroups(0, reinterpret_cast(getList)); - size = getgroups(size, reinterpret_cast(getList)); + size = getgroups(0, (gid_t *)getList); + size = getgroups(size, (gid_t *)getList); pid_t pid = fork(); if (pid == 0) { Child1(getList, size); @@ -386,10 +378,10 @@ static int Child(void) ret = setgroups(0, NULL); ICUNIT_ASSERT_EQUAL(ret, 0, ret); - ret = getgroups(0, reinterpret_cast(getList)); + ret = getgroups(0, (gid_t *)getList); ICUNIT_ASSERT_EQUAL(ret, 1, ret); - ret = getgroups(1, reinterpret_cast(getList)); + ret = getgroups(1, (gid_t *)getList); ICUNIT_ASSERT_EQUAL(ret, 1, ret); ICUNIT_ASSERT_EQUAL(getList[0], getgid(), getList[0]); @@ -419,7 +411,7 @@ static int TestCase(VOID) int ret; int status = 0; pid_t pid = fork(); - ICUNIT_GOTO_WITHIN_EQUAL(pid, 0, 100000, pid, EXIT); // assume pid is between 0 and 100000 + ICUNIT_GOTO_WITHIN_EQUAL(pid, 0, 100000, pid, EXIT); if (pid == 0) { ret = Child(); exit(__LINE__); diff --git a/src/kernel_liteos_a/testsuites/unittest/security/vid/config.gni b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/security/vid/config.gni similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/security/vid/config.gni rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/security/vid/config.gni diff --git a/src/kernel_liteos_a/testsuites/unittest/security/vid/it_test_vid.h b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/security/vid/it_test_vid.h similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/security/vid/it_test_vid.h rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/security/vid/it_test_vid.h diff --git a/src/kernel_liteos_a/testsuites/unittest/security/vid/security_vid_test.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/security/vid/security_vid_test.cpp similarity index 100% rename from src/kernel_liteos_a/testsuites/unittest/security/vid/security_vid_test.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/security/vid/security_vid_test.cpp diff --git a/src/kernel_liteos_a/testsuites/unittest/security/vid/smoke/vid_test_001.cpp b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/security/vid/smoke/vid_test_001.cpp similarity index 98% rename from src/kernel_liteos_a/testsuites/unittest/security/vid/smoke/vid_test_001.cpp rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/security/vid/smoke/vid_test_001.cpp index 8c099414..631dcf28 100644 --- a/src/kernel_liteos_a/testsuites/unittest/security/vid/smoke/vid_test_001.cpp +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/testsuites/unittest/security/vid/smoke/vid_test_001.cpp @@ -122,7 +122,7 @@ static void ChildFunc() ret1 = (INT32 *)timer_delete(tid); ICUNIT_ASSERT_EQUAL_VOID(ret1, 0, ret1); - exit(static_cast(reinterpret_cast(tid))); + exit((int)(intptr_t)tid); } static UINT32 TestCase(VOID) diff --git a/src/kernel_liteos_a/tools/.gitignore b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/tools/.gitignore similarity index 100% rename from src/kernel_liteos_a/tools/.gitignore rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/tools/.gitignore diff --git a/src/kernel_liteos_a/tools/build/liteos.ld b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/tools/build/liteos.ld similarity index 98% rename from src/kernel_liteos_a/tools/build/liteos.ld rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/tools/build/liteos.ld index 40d55102..4d74355c 100644 --- a/src/kernel_liteos_a/tools/build/liteos.ld +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/tools/build/liteos.ld @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-2022 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -139,7 +139,7 @@ SECTIONS .ctors : ALIGN(0x4) { __ctor_list__ = .; - KEEP (*(.ctors .init_array.* .init_array)) + KEEP (*(.ctors .init_array)) __ctor_end__ = .; } > ram .dtors : ALIGN(0x4) { diff --git a/src/kernel_liteos_a/tools/build/liteos_llvm.ld b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/tools/build/liteos_llvm.ld similarity index 98% rename from src/kernel_liteos_a/tools/build/liteos_llvm.ld rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/tools/build/liteos_llvm.ld index a158d778..31cc94bd 100644 --- a/src/kernel_liteos_a/tools/build/liteos_llvm.ld +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/tools/build/liteos_llvm.ld @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-2022 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -45,7 +45,7 @@ SECTIONS .ctors : ALIGN(0x4) { __ctor_list__ = .; - KEEP (*(.ctors .init_array.* .init_array)) + KEEP (*(.ctors .init_array)) __ctor_end__ = .; } > ram .dtors : ALIGN(0x4) { diff --git a/src/kernel_liteos_a/tools/build/mk/liteos_tables_ldflags.mk b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/tools/build/mk/liteos_tables_ldflags.mk similarity index 100% rename from src/kernel_liteos_a/tools/build/mk/liteos_tables_ldflags.mk rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/tools/build/mk/liteos_tables_ldflags.mk diff --git a/src/kernel_liteos_a/tools/build/mk/los_config.mk b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/tools/build/mk/los_config.mk similarity index 97% rename from src/kernel_liteos_a/tools/build/mk/los_config.mk rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/tools/build/mk/los_config.mk index 2627bcc9..6b0c689f 100644 --- a/src/kernel_liteos_a/tools/build/mk/los_config.mk +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/tools/build/mk/los_config.mk @@ -194,13 +194,6 @@ ifeq ($(LOSCFG_KERNEL_SYSCALL), y) LITEOS_BASELIB += -lsyscall LIB_SUBDIRS += syscall endif - -ifeq ($(LOSCFG_KERNEL_PLIMITS), y) - LITEOS_BASELIB += -lplimit - LIB_SUBDIRS += kernel/extended/plimit - LITEOS_PLIMITS_INCLUDE = -I $(LITEOSTOPDIR)/kernel/extended/plimit -endif - LIB_SUBDIRS += kernel/user ################################### Kernel Option End ################################ @@ -211,7 +204,7 @@ LIB_SUBDIRS += lib/libscrew LITEOS_LIBSCREW_INCLUDE += -I $(LITEOSTOPDIR)/lib/libscrew/include ifeq ($(LOSCFG_LIB_LIBC), y) - LIB_SUBDIRS += lib/libc/musl + LIB_SUBDIRS += lib/libc LITEOS_BASELIB += -lc LITEOS_LIBC_INCLUDE += \ -isystem $(LITEOSTHIRDPARTY)/musl/porting/liteos_a/kernel/include @@ -362,7 +355,7 @@ endif LITEOS_DRIVERS_BASE_PATH := $(LITEOSTOPDIR)/../../drivers/liteos ################################## Driver Option Begin ################################# ifeq ($(LOSCFG_DRIVERS_HDF), y) -include $(LITEOSTOPDIR)/../../drivers/hdf_core/adapter/khdf/liteos/hdf_lite.mk +include $(LITEOSTOPDIR)/../../drivers/adapter/khdf/liteos/hdf_lite.mk endif ifeq ($(LOSCFG_DRIVERS_HIEVENT), y) @@ -524,7 +517,7 @@ LITEOS_EXTKERNEL_INCLUDE := $(LITEOS_CPPSUPPORT_INCLUDE) $(LITEOS_DYNLOAD_INCL $(LITEOS_VDSO_INCLUDE) $(LITEOS_LITEIPC_INCLUDE) \ $(LITEOS_PIPE_INCLUDE) $(LITEOS_CPUP_INCLUDE) \ $(LITEOS_PERF_INCLUDE) $(LITEOS_LMS_INCLUDE) \ - $(LITEOS_PM_INCLUDE) $(LITEOS_PLIMITS_INCLUDE) + $(LITEOS_PM_INCLUDE) LITEOS_COMPAT_INCLUDE := $(LITEOS_POSIX_INCLUDE) $(LITEOS_LINUX_INCLUDE) \ $(LITEOS_BSD_INCLUDE) LITEOS_FS_INCLUDE := $(LITEOS_VFS_INCLUDE) $(LITEOS_FAT_CACHE_INCLUDE) \ @@ -565,8 +558,6 @@ LITEOS_COPTS_BASE += -fno-aggressive-loop-optimizations endif LITEOS_COPTS_EXTRA += -std=c99 -Wpointer-arith -Wstrict-prototypes -ffunction-sections -fdata-sections -fno-exceptions -fno-short-enums -LITEOS_COPTS_EXTRA += -Wno-strict-prototypes -Wno-deprecated-non-prototype -Wno-unused-but-set-variable - ifeq ($(LOSCFG_ARCH_ARM_AARCH32), y) ifneq ($(LOSCFG_COMPILER_CLANG_LLVM), y) LITEOS_COPTS_EXTRA += -mthumb-interwork diff --git a/src/kernel_liteos_a/tools/build/mk/module.mk b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/tools/build/mk/module.mk similarity index 100% rename from src/kernel_liteos_a/tools/build/mk/module.mk rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/tools/build/mk/module.mk diff --git a/src/kernel_liteos_a/tools/scripts/make_rootfs/releaseinfo.sh b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/tools/scripts/make_rootfs/releaseinfo.sh similarity index 100% rename from src/kernel_liteos_a/tools/scripts/make_rootfs/releaseinfo.sh rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/tools/scripts/make_rootfs/releaseinfo.sh diff --git a/src/kernel_liteos_a/tools/scripts/make_rootfs/rootfsdir.sh b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/tools/scripts/make_rootfs/rootfsdir.sh similarity index 98% rename from src/kernel_liteos_a/tools/scripts/make_rootfs/rootfsdir.sh rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/tools/scripts/make_rootfs/rootfsdir.sh index e00cffdf..eea8604d 100644 --- a/src/kernel_liteos_a/tools/scripts/make_rootfs/rootfsdir.sh +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/tools/scripts/make_rootfs/rootfsdir.sh @@ -44,6 +44,6 @@ if [ -d "${BIN_DIR}" ] && [ "$(ls -A "${BIN_DIR}")" != "" ]; then fi cp -f ${LIB_DIR}/* ${ROOTFS_DIR}/lib -if [ -e "${ETC_DIR}"/.mkshrc ]; then +if [ -e ${ETC_DIR}/.mkshrc ]; then cp -f ${ETC_DIR}/.mkshrc ${ROOTFS_DIR}/etc fi diff --git a/src/kernel_liteos_a/tools/scripts/make_rootfs/rootfsimg.sh b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/tools/scripts/make_rootfs/rootfsimg.sh similarity index 100% rename from src/kernel_liteos_a/tools/scripts/make_rootfs/rootfsimg.sh rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/tools/scripts/make_rootfs/rootfsimg.sh diff --git a/src/kernel_liteos_a/tools/scripts/parse_exc/parse_excinfo.py b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/tools/scripts/parse_exc/parse_excinfo.py similarity index 61% rename from src/kernel_liteos_a/tools/scripts/parse_exc/parse_excinfo.py rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/tools/scripts/parse_exc/parse_excinfo.py index a1ba92d4..91cfb5c2 100644 --- a/src/kernel_liteos_a/tools/scripts/parse_exc/parse_excinfo.py +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/tools/scripts/parse_exc/parse_excinfo.py @@ -1,8 +1,8 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 # -*- coding: utf-8 -*- # Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. -# Copyright (c) 2020-2022 Huawei Device Co., Ltd. All rights reserved. +# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: @@ -33,8 +33,8 @@ import sys import os import argparse -import io import commands +import io def find_string(excinfo_file, string): res = '' @@ -66,43 +66,47 @@ def parse_string_line(excinfo_file, string): def parse_kernel_pc_klr(excinfo_file, ohos_image_file, string, addr2line_cmd, objdump_cmd): #parse pc - with open(excinfo_file, 'r+') as f: - start = 0 - for lines in f.readlines(): - if 'excFrom: kernel' in lines: - if start == 1: - break - start = 1 - if start and string in lines: - lines = lines[lines.find(string):] - strlist = lines.split() - cmd = "%s%s | grep %s: -B 10 -A 5 -w" % (objdump_cmd, ohos_image_file, strlist[2][2:]) - ret = commands.getoutput(cmd) - print(ret) - cmd = "%s%s %s" % (addr2line_cmd, ohos_image_file, strlist[2]) - ret = commands.getoutput(cmd) - ret = ret.split('\n') - print("<%s>%s<%s>\n") % (string, ret[0], strlist[2]) - return 0 + f = open(excinfo_file, 'r+') + start = 0 + for lines in f.readlines(): + if 'excFrom: kernel' in lines: + if start == 1: + break + start = 1 + if start and string in lines: + lines = lines[lines.find(string):] + strlist = lines.split() + cmd = objdump_cmd + ohos_image_file + ' | grep ' + strlist[2][2:] + ': -B 10 -A 5 -w' + ret = commands.getoutput(cmd) + print(ret) + cmd = addr2line_cmd + ohos_image_file + ' ' + strlist[2] + ret = commands.getoutput(cmd) + ret = ret.split('\n') + print('<' + string + '>' + ret[0] + ' <' + strlist[2] + '>\n') + f.close() + return 0 + f.close() return -1 def parse_kernel_lr(excinfo_file, ohos_image_file, addr2line_cmd): - with open(excinfo_file, 'r+') as f: - start = 0 - index = 1 - for lines in f.readlines(): - if 'excFrom: kernel' in lines: - if start == 1: - break - start = 1 - if start and 'lr =' in lines: - lines = lines[lines.find('lr ='):] - strlist = lines.split() - cmd = "%s%s %s" % (addr2line_cmd, ohos_image_file, strlist[2]) - ret = commands.getoutput(cmd) - ret = ret.split('\n') - print("<%.2d>%s<%s>" % (index, ret[0], strlist[2])) - index = index + 1 + f = open(excinfo_file, 'r+') + start = 0 + index = 1 + for lines in f.readlines(): + if 'excFrom: kernel' in lines: + if start == 1: + break + start = 1 + if start and 'lr =' in lines: + lines = lines[lines.find('lr ='):] + strlist = lines.split() + cmd = addr2line_cmd + ohos_image_file + ' ' + strlist[2] + ret = commands.getoutput(cmd) + ret = ret.split('\n') + print('<%.2d'%index + '>' + ret[0] + ' <' + strlist[2] + '>') + index = index + 1 + + f.close() def parse_kernel_exc(excinfo_file, ohos_image_file, addr2line_cmd, objdump_cmd): #parse pc, klr @@ -114,49 +118,56 @@ def parse_kernel_exc(excinfo_file, ohos_image_file, addr2line_cmd, objdump_cmd): def parse_user_pc_ulr(excinfo_file, rootfs_dir, string, addr2line_cmd, objdump_cmd): #parse pc - with open(excinfo_file, 'r+') as f: - start = 0 - for lines in f.readlines(): - if 'excFrom: User' in lines: - if start == 1: - break - start = 1 - if start and string in lines: - lines = lines[lines.find(string):] - strlist = lines.split() - if len(strlist) < 7: - print('%s is error'%string) - return 0 - cmd = "%s%s%s | grep %s: -B 10 -A 5 -w" % (objdump_cmd, rootfs_dir, strlist[4], strlist[6][2:]) - ret = commands.getoutput(cmd) - print(ret) - cmd = "%s%s%s %s" % (addr2line_cmd, rootfs_dir, strlist[4], strlist[6]) - ret = commands.getoutput(cmd) - ret = ret.split('\n') - print("<%s>%s<%s><%s>\n" % (string, ret[0], strlist[6], strlist[4])) + f = open(excinfo_file, 'r+') + start = 0 + for lines in f.readlines(): + if 'excFrom: User' in lines: + if start == 1: + break + start = 1 + if start and string in lines: + lines = lines[lines.find(string):] + strlist = lines.split() + if len(strlist) < 7: + print('%s is error'%string) + f.close() return 0 + cmd = objdump_cmd + rootfs_dir + strlist[4] + ' | grep ' + strlist[6][2:] + ': -B 10 -A 5 -w' + ret = commands.getoutput(cmd) + print(ret) + cmd = addr2line_cmd + rootfs_dir + strlist[4] + ' ' + strlist[6] + #print(cmd) + ret = commands.getoutput(cmd) + ret = ret.split('\n') + print('<' + string + '>' + ret[0] + ' <' + strlist[6] + '>' + '<' + strlist[4] + '>\n') + f.close() + return 0 + f.close() return -1 def parse_user_lr(excinfo_file, rootfs_dir, addr2line_cmd): - with open(excinfo_file, 'r+') as f: - start = 0 - index = 1 - for lines in f.readlines(): - if 'excFrom: User' in lines: - if start == 1: - break - start = 1 - if start and 'lr =' in lines: - lines = lines[lines.find('lr ='):] - strlist = lines.split() - if len(strlist) < 11: - print('%s is error' % strlist) - return - cmd = "%s%s%s %s" % (addr2line_cmd, rootfs_dir, strlist[8], strlist[10]) - res = commands.getoutput(cmd) - res = res.split('\n') - print("<%.2d>%s<%s><%s>" % (index, res[0], strlist[10], strlist[8])) - index = index + 1 + f = open(excinfo_file, 'r+') + start = 0 + index = 1 + for lines in f.readlines(): + if 'excFrom: User' in lines: + if start == 1: + break + start = 1 + if start and 'lr =' in lines: + lines = lines[lines.find('lr ='):] + strlist = lines.split() + if len(strlist) < 11: + print('%s is error'%strlist) + f.close() + return + cmd = addr2line_cmd + rootfs_dir + strlist[8] + ' ' + strlist[10] + res = commands.getoutput(cmd) + res = res.split('\n') + print('<%.2d>'%index + res[0] + ' <' + strlist[10] + '>' + '<' + strlist[8] + '>') + index = index + 1 + + f.close() def parse_user_exc(excinfo_file, rootfs_dir, addr2line_cmd, objdump_cmd): #parse pc ulr @@ -167,29 +178,30 @@ def parse_user_exc(excinfo_file, rootfs_dir, addr2line_cmd, objdump_cmd): return ret1 and ret2 def parse_backtrace(backtrace_file, ohos_image_file, addr2line_cmd): - with open(backtrace_file, 'r+') as f: - find = -1 - start = 0 - index = 1 - for lines in f.readlines(): - if 'backtrace begin' in lines: - if start == 1: - break - start = 1 - if start and 'lr =' in lines: - lines = lines[lines.find('lr ='):] - strlist = lines.split() - cmd = "%s%s %s" % (addr2line_cmd, ohos_image_file, strlist[2]) - ret = commands.getoutput(cmd) - ret = ret.split('\n') - print("\n<%.2d>%s<%s>" % (index, ret[0], strlist[2])) - index = index + 1 - find = 0 + f = open(backtrace_file, 'r+') + find = -1 + start = 0 + index = 1 + for lines in f.readlines(): + if 'backtrace begin' in lines: + if start == 1: + break + start = 1 + if start and 'lr =' in lines: + lines = lines[lines.find('lr ='):] + strlist = lines.split() + cmd = addr2line_cmd + ohos_image_file + ' ' + strlist[2] + ret = commands.getoutput(cmd) + ret = ret.split('\n') + print('\n<%.2d'%index + '>' + ret[0] + ' <' + strlist[2] + '>') + index = index + 1 + find = 0 + f.close() return find def parse_excinfo(excinfo_file, ohos_image_file, rootfs_dir, addr2line_cmd, objdump_cmd): - cmd = "dos2unix %s" % (excinfo_file) + cmd = 'dos2unix ' + excinfo_file commands.getoutput(cmd) kernel_exc = is_kernel_exc(excinfo_file) user_exc = is_user_exc(excinfo_file) @@ -213,7 +225,7 @@ def parse_compiler(compiler): addr2line_cmd = '' objdump = '' objdump_cmd = '' - cmd = "which %s" % (compiler) + cmd = 'which ' + compiler ret = commands.getoutput(cmd) if ret == '': print('%s is not exist'%compiler) diff --git a/src/kernel_liteos_a/tools/scripts/parse_memory/parse_mem_info.sh b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/tools/scripts/parse_memory/parse_mem_info.sh similarity index 87% rename from src/kernel_liteos_a/tools/scripts/parse_memory/parse_mem_info.sh rename to src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/tools/scripts/parse_memory/parse_mem_info.sh index 746ae614..38d56859 100644 --- a/src/kernel_liteos_a/tools/scripts/parse_memory/parse_mem_info.sh +++ b/src/kernel_liteos_a-OpenHarmony-v3.1.7-Release/tools/scripts/parse_memory/parse_mem_info.sh @@ -1,7 +1,7 @@ #!/bin/bash # Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. -# Copyright (c) 2020-2022 Huawei Device Co., Ltd. All rights reserved. +# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: @@ -28,7 +28,6 @@ # 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. -set -e LOAD_BASE="0x2000000" LLVM_ADDR2LINE=llvm-addr2line @@ -37,12 +36,12 @@ GCC_ADDR2LINE=addr2line get_line() { SYM_ADDR=$(echo $1 | awk '{print $2}') - ELF_OFFSET=$(echo ${SYM_ADDR} | cut -d '[' -f2 | cut -d ']' -f1) - FILE_LINE=$(${ADDR2LINE} -f -e $2 ${ELF_OFFSET} | awk 'NR==2') + ELF_OFFSET=`echo ${SYM_ADDR} | cut -d '[' -f2 | cut -d ']' -f1` + FILE_LINE=`${ADDR2LINE} -f -e $2 ${ELF_OFFSET} | awk 'NR==2'` if [[ "${FILE_LINE}" == *"?"* ]]; then typeset ELF_OFFSET=$((ELF_OFFSET+LOAD_BASE)) ELF_OFFSET=$(echo "obase=16;${ELF_OFFSET}" | bc) - FILE_LINE=$(${ADDR2LINE} -f -e $2 ${ELF_OFFSET} | awk 'NR==2') + FILE_LINE=`${ADDR2LINE} -f -e $2 ${ELF_OFFSET} | awk 'NR==2'` fi echo ${FILE_LINE} } @@ -59,14 +58,14 @@ parse_line() echo "Error: no such file: $i" exit 1 fi - ELF_FILE_LINE=$(get_line "$1" $i) - if [[ "${ELF_FILE_LINE}" == *"?"* ]] || [ -z "${ELF_FILE_LINE}" ]; then + FILE_LINE=`get_line "$1" $i` + if [[ "${FILE_LINE}" == *"?"* ]] || [ -z "${FILE_LINE}" ]; then echo " * Error: you need ensure whether file: "$i" was compiled with -g or not! *" exit 1 fi - LINE=$(echo $1 | tr -d '\r') + LINE=`echo $1 | tr -d '\r'` LINE=$(echo ${LINE} | awk '{print $1,$2}') - echo " "${LINE}" at "${ELF_FILE_LINE} + echo " "${LINE}" at "${FILE_LINE} FLAG=true break fi @@ -82,7 +81,7 @@ if [ $# -le 1 ]; then fi read -n5 -p "Compiler is [gcc/llvm]: " ANSWER -case "${ANSWER}" in +case ${ANSWER} in (gcc | GCC) which ${GCC_ADDR2LINE} >/dev/null 2>&1 if [ $? -eq 0 ]; then diff --git a/src/kernel_liteos_a/CHANGELOG.md b/src/kernel_liteos_a/CHANGELOG.md deleted file mode 100644 index eaa49a85..00000000 --- a/src/kernel_liteos_a/CHANGELOG.md +++ /dev/null @@ -1,338 +0,0 @@ -# (2022-03-30) - - -### Bug Fixes - - -* **arm-virt:** HW_RANDOM_ENABLE配置支持arm virt平台 ([68f9f49](https://gitee.com/openharmony/kernel_liteos_a/commits/68f9f49c2a62d3271db14ccb896c9f9fc78a60e4)) -* A核代码静态告警定期清理 ([9ba725c](https://gitee.com/openharmony/kernel_liteos_a/commits/9ba725c3d486dd28fe9b2489b0f95a65354d7d86)), closes [#I4I0O8](https://gitee.com/openharmony/kernel_liteos_a/issues/I4I0O8) -* change default permission of procfs to 0550 ([a776c04](https://gitee.com/openharmony/kernel_liteos_a/commits/a776c04a3da414f73ef7136a543c029cc6dd75be)), closes [#I4NY49](https://gitee.com/openharmony/kernel_liteos_a/issues/I4NY49) -* change the execFile field in TCB to execVnode ([e4a0662](https://gitee.com/openharmony/kernel_liteos_a/commits/e4a06623ceb49b5bead60d45c0534db88b9c666f)), closes [#I4CLL9](https://gitee.com/openharmony/kernel_liteos_a/issues/I4CLL9) -* close file when process interpretor failed ([a375bf5](https://gitee.com/openharmony/kernel_liteos_a/commits/a375bf5668a5e86e082d0e124b538e423023a259)), closes [#I4ATQX](https://gitee.com/openharmony/kernel_liteos_a/issues/I4ATQX) -* codex 清理 ([9ab3e35](https://gitee.com/openharmony/kernel_liteos_a/commits/9ab3e351d38cdae2ec083048a50a253bc2a3b604)), closes [#I4BL3S](https://gitee.com/openharmony/kernel_liteos_a/issues/I4BL3S) -* dyload open close failed ([5e87d8c](https://gitee.com/openharmony/kernel_liteos_a/commits/5e87d8c183471166294e2caa041ab4da8570c6a1)), closes [#I452Z7](https://gitee.com/openharmony/kernel_liteos_a/issues/I452Z7) -* fix ppoll ([a55f68f](https://gitee.com/openharmony/kernel_liteos_a/commits/a55f68f957e9f8ad74bd9e0c1b3d27775e0f8c75)) -* fix some function declarations ([63fd8bc](https://gitee.com/openharmony/kernel_liteos_a/commits/63fd8bc39b21fffb6990f74e879eefecafad6c88)) -* implicit declaration of function 'syscall' in apps/shell ([bd0c083](https://gitee.com/openharmony/kernel_liteos_a/commits/bd0c0835fc58ed5f941dbbc9adfac74253eeb874)) -* LOS_Panic和魔法键功能中的使用PRINTK打印,依赖任务调度,特殊情况下存在打印不出来的问题 ([53addea](https://gitee.com/openharmony/kernel_liteos_a/commits/53addea304de09e0df457b690403ac652bbcea72)), closes [#I4NOC7](https://gitee.com/openharmony/kernel_liteos_a/issues/I4NOC7) -* los_stat_pri.h中缺少依赖的头文件 ([2cd03c5](https://gitee.com/openharmony/kernel_liteos_a/commits/2cd03c55b7a614c648adc965ebfe494d491fe20f)), closes [#I4KEZ1](https://gitee.com/openharmony/kernel_liteos_a/issues/I4KEZ1) -* los_trace.h接口注释错误修正 ([6d24961](https://gitee.com/openharmony/kernel_liteos_a/commits/6d249618aecc216388f9b1a2b48fe0ac6dd19ff2)), closes [#I4CYPZ](https://gitee.com/openharmony/kernel_liteos_a/issues/I4CYPZ) -* MMU竞态问题修复 ([748e0d8](https://gitee.com/openharmony/kernel_liteos_a/commits/748e0d8ffb6ee9c8757ed056f575e3abc6c10702)), closes [#I2WARC](https://gitee.com/openharmony/kernel_liteos_a/issues/I2WARC) -* **mtd:** 去除mtd对hisilicon驱动的依赖 ([f7d010d](https://gitee.com/openharmony/kernel_liteos_a/commits/f7d010dfa4cb825096267528e131a9e2735d7505)), closes [#I49FKL](https://gitee.com/openharmony/kernel_liteos_a/issues/I49FKL) -* OsFutexWaitParamCheck函数中absTime为0时,直接返回,不需要打印 ([3f71be7](https://gitee.com/openharmony/kernel_liteos_a/commits/3f71be75355f11037d9de80cc4d7da0f01905003)), closes [#I4D67E](https://gitee.com/openharmony/kernel_liteos_a/issues/I4D67E) -* OsLockDepCheckIn异常处理中存在g_lockdepAvailable锁嵌套调用, ([bf030b6](https://gitee.com/openharmony/kernel_liteos_a/commits/bf030b6bb5843151a5b8b8736246a1376a5fb9d0)), closes [#I457ZZ](https://gitee.com/openharmony/kernel_liteos_a/issues/I457ZZ) -* pr模板补充说明 ([e3cd485](https://gitee.com/openharmony/kernel_liteos_a/commits/e3cd485db528490a16a8932d734faab263b44bc9)) -* same file mode for procfs files ([c79bcd0](https://gitee.com/openharmony/kernel_liteos_a/commits/c79bcd028e1be34b45cba000077230fa2ef95e68)), closes [#I4ACTC](https://gitee.com/openharmony/kernel_liteos_a/issues/I4ACTC) -* shell支持exit退出,完善帮助信息,特殊处理不可见字符 ([cc6e112](https://gitee.com/openharmony/kernel_liteos_a/commits/cc6e11281e63b6bdc9be8e5d3c39f1258eb2ceaa)) -* smp初始化中副核冗余的启动框架调用 ([5ce70a5](https://gitee.com/openharmony/kernel_liteos_a/commits/5ce70a50c3733b6ec8cc4b444837e366ec837f69)), closes [#I4F8A5](https://gitee.com/openharmony/kernel_liteos_a/issues/I4F8A5) -* solve SIGCHLD ignored in sigsuspend() ([5a80d4e](https://gitee.com/openharmony/kernel_liteos_a/commits/5a80d4e1a34c94204a0bb01443bf25a4fdb12750)), closes [#I47CKK](https://gitee.com/openharmony/kernel_liteos_a/issues/I47CKK) -* syscall review bugfix ([214f44e](https://gitee.com/openharmony/kernel_liteos_a/commits/214f44e935277c29d347c50b553a31ea7df36448)), closes [#149](https://gitee.com/openharmony/kernel_liteos_a/issues/149) -* **test:** misc09用例因依赖hosts文件而失败 ([f2f5c5f](https://gitee.com/openharmony/kernel_liteos_a/commits/f2f5c5fdc3202610de173e7046adab4df5e59142)), closes [#I48IZ0](https://gitee.com/openharmony/kernel_liteos_a/issues/I48IZ0) -* **test:** 修复sys部分用例因依赖passwd、group文件而失败 ([614cdcc](https://gitee.com/openharmony/kernel_liteos_a/commits/614cdccf91bd2d220c4c76418b53400ce714c6cb)), closes [#I48IUC](https://gitee.com/openharmony/kernel_liteos_a/issues/I48IUC) -* 中断中调用PRINTK概率卡死,导致系统不能正常响应中断 ([9726ba1](https://gitee.com/openharmony/kernel_liteos_a/commits/9726ba11a79f3d2d1e616e12ef0bb44e4fc5cd20)), closes [#I4C9GC](https://gitee.com/openharmony/kernel_liteos_a/issues/I4C9GC) -* 临终遗言重定向内容缺失task相关信息,对应的shell命令中申请的内存需要cacheline对齐 ([48ca854](https://gitee.com/openharmony/kernel_liteos_a/commits/48ca854bf07f8dcda9657f950601043a485a1b33)), closes [#I482S5](https://gitee.com/openharmony/kernel_liteos_a/issues/I482S5) -* 优化liteipc任务状态,删除功能重复字段 ([5004ef4](https://gitee.com/openharmony/kernel_liteos_a/commits/5004ef4d87b54fb6d7f748ca8212ae155bcefac5)), closes [#I4FVHK](https://gitee.com/openharmony/kernel_liteos_a/issues/I4FVHK) -* 优化trace buffer初始化,删除swtmr 桩中的无效参数 ([b551270](https://gitee.com/openharmony/kernel_liteos_a/commits/b551270ef50cb206360e2eee3dd20ace5cecccb7)), closes [#I4DQ1X](https://gitee.com/openharmony/kernel_liteos_a/issues/I4DQ1X) -* 修复 virpart.c 不适配的格式化打印问题 ([de29140](https://gitee.com/openharmony/kernel_liteos_a/commits/de29140edf2567f4847876cb1ed5e0b6857420f3)), closes [#I4PEVP](https://gitee.com/openharmony/kernel_liteos_a/issues/I4PEVP) -* 修复A核文档失效的问题 ([456d255](https://gitee.com/openharmony/kernel_liteos_a/commits/456d255a81c2031be8ebecc2bf897af80c3d3c7a)), closes [#I4U7TF](https://gitee.com/openharmony/kernel_liteos_a/issues/I4U7TF) -* 修复A核测试用例失败的问题 ([59329ce](https://gitee.com/openharmony/kernel_liteos_a/commits/59329ce7c6b6a00084df427748e6283287a773c0)), closes [#I4SQDR](https://gitee.com/openharmony/kernel_liteos_a/issues/I4SQDR) -* 修复A核测试用例失败的问题 ([be68dc8](https://gitee.com/openharmony/kernel_liteos_a/commits/be68dc8bcaf8d965039ae1d792775f00a08adfac)), closes [#I4SQDP](https://gitee.com/openharmony/kernel_liteos_a/issues/I4SQDP) -* 修复dispatch单词拼写错误。 ([9b07aec](https://gitee.com/openharmony/kernel_liteos_a/commits/9b07aece2dfa3494cf35e8b388410341508d6224)), closes [#I4BLE8](https://gitee.com/openharmony/kernel_liteos_a/issues/I4BLE8) -* 修复futime提示错误22的BUG ([f2861dd](https://gitee.com/openharmony/kernel_liteos_a/commits/f2861ddfb424af7b99c278273601ce0fab1f37e6)) -* 修复jffs2适配层错误释放锁的BUG ([011a55f](https://gitee.com/openharmony/kernel_liteos_a/commits/011a55ff21d95f969abac60bcff96f4c4d7a326d)), closes [#I4FH9M](https://gitee.com/openharmony/kernel_liteos_a/issues/I4FH9M) -* 修复los_vm_scan.c中内部函数OsInactiveListIsLow冗余代码 ([bc32a1e](https://gitee.com/openharmony/kernel_liteos_a/commits/bc32a1ec0fa5d19c6d2672bcf4a01de5e1be3afb)), closes [#I4HKFF](https://gitee.com/openharmony/kernel_liteos_a/issues/I4HKFF) -* 修复LOSCFG_FS_FAT_CACHE宏关闭后编译失败的BUG ([63e71fe](https://gitee.com/openharmony/kernel_liteos_a/commits/63e71feca05a8d46a49822c713258738740f0712)), closes [#I3T3N0](https://gitee.com/openharmony/kernel_liteos_a/issues/I3T3N0) -* 修复OsVmPhysFreeListAdd和OsVmPhysFreeListAddUnsafe函数内容重复 ([6827bd2](https://gitee.com/openharmony/kernel_liteos_a/commits/6827bd2a22b78aa05e20d6460412fc7b2d738929)), closes [#I4FL95](https://gitee.com/openharmony/kernel_liteos_a/issues/I4FL95) -* 修复PR520缺陷 ([4033891](https://gitee.com/openharmony/kernel_liteos_a/commits/40338918d9132399ee0494d331930a05b7a13c67)), closes [#I4DEG5](https://gitee.com/openharmony/kernel_liteos_a/issues/I4DEG5) -* 修复shcmd.h需要用宏包起来的问题 ([6c4e4b1](https://gitee.com/openharmony/kernel_liteos_a/commits/6c4e4b16abe9c68fea43d40b2d39b4f0ed4bfc9c)), closes [#I4N50W](https://gitee.com/openharmony/kernel_liteos_a/issues/I4N50W) -* 修复xts权限用例压测异常问题 ([b0d31cb](https://gitee.com/openharmony/kernel_liteos_a/commits/b0d31cb43f5a8d1c3da574b2b957e3b0e98b3067)), closes [#I3ZJ1D](https://gitee.com/openharmony/kernel_liteos_a/issues/I3ZJ1D) -* 修复硬随机不可用时,地址随机化不可用问题 ([665c152](https://gitee.com/openharmony/kernel_liteos_a/commits/665c152c27bb86395ddd0395279255f6cdaf7255)), closes [#I4D4TK](https://gitee.com/openharmony/kernel_liteos_a/issues/I4D4TK) -* 修复进程用例导致门禁概率失败 ([1ed28b4](https://gitee.com/openharmony/kernel_liteos_a/commits/1ed28b4c80cfd222be08b0c2e71e6287e52bb276)), closes [#I4FO0N](https://gitee.com/openharmony/kernel_liteos_a/issues/I4FO0N) -* 修复进程线程不稳定用例 ([f6ac03d](https://gitee.com/openharmony/kernel_liteos_a/commits/f6ac03d3e3c56236adc5734d4c059f1fbcc9e0c1)), closes [#I4F1XL](https://gitee.com/openharmony/kernel_liteos_a/issues/I4F1XL) -* 修复重复执行内存用例导致系统卡死问题 ([6c2b163](https://gitee.com/openharmony/kernel_liteos_a/commits/6c2b163c7d7c696ef89b17a0275f3cddb3d7cefb)), closes [#I4F7PO](https://gitee.com/openharmony/kernel_liteos_a/issues/I4F7PO) -* 修改MMU模块的注释错误 ([1a8e22d](https://gitee.com/openharmony/kernel_liteos_a/commits/1a8e22dcf15944153e013d004fd7bbf24557a8c7)), closes [#I4KMMJ](https://gitee.com/openharmony/kernel_liteos_a/issues/I4KMMJ) -* 共享内存问题修复 ([9fdb80f](https://gitee.com/openharmony/kernel_liteos_a/commits/9fdb80f85f92d0167a0456455a94fc6f679797ce)), closes [#I47X2Z](https://gitee.com/openharmony/kernel_liteos_a/issues/I47X2Z) -* 内核ERR打印,无进程和线程信息,不方便问题定位。 ([cb423f8](https://gitee.com/openharmony/kernel_liteos_a/commits/cb423f845462b8cc474c3cba261dadf3943a08ef)), closes [#I4DAKM](https://gitee.com/openharmony/kernel_liteos_a/issues/I4DAKM) -* 内核ERR级别及以上的打印输出当前进程和线程名 ([540b201](https://gitee.com/openharmony/kernel_liteos_a/commits/540b2017c5460e300365d2039a08abd5945cec6b)) -* 内源检视测试用例问题修复 ([a6ac759](https://gitee.com/openharmony/kernel_liteos_a/commits/a6ac7597f85043ba6de3a1b395ca676d85c65ea7)) -* 删除冗余的头文件 ([8e614bb](https://gitee.com/openharmony/kernel_liteos_a/commits/8e614bb1616b75bc89eee7ad7da49b7a9c285b47)), closes [#I4KN63](https://gitee.com/openharmony/kernel_liteos_a/issues/I4KN63) -* 增加pselect SYSCALL函数及测试用例 ([f601c16](https://gitee.com/openharmony/kernel_liteos_a/commits/f601c16b9e67d531dda51fc18389a53db4360b7b)), closes [#I45SXU](https://gitee.com/openharmony/kernel_liteos_a/issues/I45SXU) -* 增加内核epoll系统调用 ([2251b8a](https://gitee.com/openharmony/kernel_liteos_a/commits/2251b8a2d1f649422dd67f8551b085a7e0c63ec7)), closes [#I4FXPT](https://gitee.com/openharmony/kernel_liteos_a/issues/I4FXPT) -* 实现了musl库net模块中的一些函数接口和相应的测试用例 ([3d00a7d](https://gitee.com/openharmony/kernel_liteos_a/commits/3d00a7d23a96f29c138cfc1672825b90b9e0c05e)), closes [#I4JQI1](https://gitee.com/openharmony/third_party_musl/issues/I4JQI1) -* 添加进程线程冒烟用例 ([2be5968](https://gitee.com/openharmony/kernel_liteos_a/commits/2be59680f2fb0801b43522cd38cc387c8ff38766)), closes [#I4EOGA](https://gitee.com/openharmony/kernel_liteos_a/issues/I4EOGA) -* 用户态进程主线程退出时,其他子线程刚好进入异常处理流程会导致系统卡死 ([d955790](https://gitee.com/openharmony/kernel_liteos_a/commits/d955790a44a679421798ec1ac2900b4d75dd75a4)), closes [#I4KGBT](https://gitee.com/openharmony/kernel_liteos_a/issues/I4KGBT) -* 编码规范修改 ([d161a0b](https://gitee.com/openharmony/kernel_liteos_a/commits/d161a0b03de046c05fff45a2b625631b4e45a347)) -* 编码规范问题修复 ([f60bc94](https://gitee.com/openharmony/kernel_liteos_a/commits/f60bc94cf231bc615ff6603ca0393b8fe33a8c47)) -* 编译框架在做编译入口的统一 ([bdb9864](https://gitee.com/openharmony/kernel_liteos_a/commits/bdb9864436a6f128a4c3891bbd63e3c60352689f)), closes [#I4KRQN](https://gitee.com/openharmony/kernel_liteos_a/issues/I4KRQN) -* 解决dmesg -s参数double lock问题 ([e151256](https://gitee.com/openharmony/kernel_liteos_a/commits/e1512566e322eb1fbc8f5d5997f9bfcd022feac7)), closes [#I4HIJK](https://gitee.com/openharmony/kernel_liteos_a/issues/I4HIJK) -* 进程退出前自己回收vmspace中的所有region ([298ccea](https://gitee.com/openharmony/kernel_liteos_a/commits/298ccea3fedaccc651b38973f0455fa1ce12e516)), closes [#I4CKQC](https://gitee.com/openharmony/kernel_liteos_a/issues/I4CKQC) -* 通过g_uart_fputc_en关闭打印后,shell进程不能正常启动 ([d21b05c](https://gitee.com/openharmony/kernel_liteos_a/commits/d21b05c0f69877130366ad37b852a0f30c11809d)), closes [#I4CTY2](https://gitee.com/openharmony/kernel_liteos_a/issues/I4CTY2) -* 针对pr是否同步至release分支,增加原因说明规则 ([b37a7b7](https://gitee.com/openharmony/kernel_liteos_a/commits/b37a7b79292d93dae6c4914952b5f3bb509e8721)) -* 非当前进程销毁时,销毁liteipc时错误的销毁了当前进程的liteipc资源 ([0f0e85b](https://gitee.com/openharmony/kernel_liteos_a/commits/0f0e85b7a6bf76d540925fbf661c483c8dba1cba)), closes [#I4FSA7](https://gitee.com/openharmony/kernel_liteos_a/issues/I4FSA7) - - -### Code Refactoring - -* los_cir_buf.c中接口整合 ([0d325c5](https://gitee.com/openharmony/kernel_liteos_a/commits/0d325c56a1053043db05d53a6c8083f4d35f116b)), closes [#I4MC13](https://gitee.com/openharmony/kernel_liteos_a/issues/I4MC13) - - -### Features - - -* add option SIOCGIFBRDADDR for ioctl ([4ecc473](https://gitee.com/openharmony/kernel_liteos_a/commits/4ecc473843207d259613d26b8ee176d75e7f00fd)), closes [#I4DNRF](https://gitee.com/openharmony/kernel_liteos_a/issues/I4DNRF) -* add sync() to vfs ([f67c4da](https://gitee.com/openharmony/kernel_liteos_a/commits/f67c4dae5141914df2e069dce0196b14780649d8)), closes [#I480HV](https://gitee.com/openharmony/kernel_liteos_a/issues/I480HV) -* **build:** support gcc toolchain ([6e886d4](https://gitee.com/openharmony/kernel_liteos_a/commits/6e886d4233dec3b82a27642f174b920e5f98f6aa)) -* L0-L1 支持Perf ([6e0a3f1](https://gitee.com/openharmony/kernel_liteos_a/commits/6e0a3f10bbbfe29d110c050da927684b6d77b961)), closes [#I47I9A](https://gitee.com/openharmony/kernel_liteos_a/issues/I47I9A) -* L0~L1 支持Lms ([e748fdb](https://gitee.com/openharmony/kernel_liteos_a/commits/e748fdbe578a1ddd8eb10b2e207042676231ba26)), closes [#I4HYAV](https://gitee.com/openharmony/kernel_liteos_a/issues/I4HYAV) -* liteipc 静态内存优化 ([5237924](https://gitee.com/openharmony/kernel_liteos_a/commits/52379242c109e0cf442784dbe811ff9d42d5f33a)), closes [#I4G4HP](https://gitee.com/openharmony/kernel_liteos_a/issues/I4G4HP) -* page cache backed by vnode instead of filep ([38a6b80](https://gitee.com/openharmony/kernel_liteos_a/commits/38a6b804e9291d2fdbd189825ebd7d56165ec51c)), closes [#I44TBS](https://gitee.com/openharmony/kernel_liteos_a/issues/I44TBS) -* 提供低功耗默认处理框架 ([212d1bd](https://gitee.com/openharmony/kernel_liteos_a/commits/212d1bd1e806530fe7e7a16ea986cb2c6fb084ed)), closes [#I4KBG9](https://gitee.com/openharmony/kernel_liteos_a/issues/I4KBG9) -* 支持AT_RANDOM以增强用户态栈保护能力 ([06ea037](https://gitee.com/openharmony/kernel_liteos_a/commits/06ea03715f0cfb8728fadd0d9c19a403dc8f6028)), closes [#I4CB8M](https://gitee.com/openharmony/kernel_liteos_a/issues/I4CB8M) -* 支持L1 低功耗框架 ([64e49ab](https://gitee.com/openharmony/kernel_liteos_a/commits/64e49aba7c9c7d2280c5b3f29f04b17b63209855)), closes [#I4JSOT](https://gitee.com/openharmony/kernel_liteos_a/issues/I4JSOT) -* 支持LOS_TaskJoin 和 LOS_TaskDetach ([37bc11f](https://gitee.com/openharmony/kernel_liteos_a/commits/37bc11fa8837a3019a0a56702f401ec1845f6547)), closes [#I4EENF](https://gitee.com/openharmony/kernel_liteos_a/issues/I4EENF) -* 新增解析异常和backtrace信息脚本 ([7019fdf](https://gitee.com/openharmony/kernel_liteos_a/commits/7019fdfcbb33c660e8aa9fd399d5fccbd7e23b49)), closes [#I47EVQ](https://gitee.com/openharmony/kernel_liteos_a/issues/I47EVQ) -* 调度tick响应时间计算优化 ([f47da44](https://gitee.com/openharmony/kernel_liteos_a/commits/f47da44b39be7fa3e9b5031d7b79b9bef1fd4fbc)) -* 调度去进程化,优化进程线程依赖关系 ([dc479fb](https://gitee.com/openharmony/kernel_liteos_a/commits/dc479fb7bd9cb8441e4e47d44b42110ea07d76a2)) -* 调度相关模块间依赖优化 ([0e3936c](https://gitee.com/openharmony/kernel_liteos_a/commits/0e3936c4f8b8bcfc48d283a6d53413e0fc0619b3)), closes [#I4RPRW](https://gitee.com/openharmony/kernel_liteos_a/issues/I4RPRW) -* 进程cpup占用率结构优化为动态分配 ([f06e090](https://gitee.com/openharmony/kernel_liteos_a/commits/f06e090a1085a654fd726fbc3c3a1c2bc703d663)), closes [#I4GLNT](https://gitee.com/openharmony/kernel_liteos_a/issues/I4GLNT) -* 进程rlimit修改为动态分配,减少静态内存占用 ([cf8446c](https://gitee.com/openharmony/kernel_liteos_a/commits/cf8446c94112ed6993a2e6e71e793d83a72689d5)), closes [#I4EZY5](https://gitee.com/openharmony/kernel_liteos_a/issues/I4EZY5) - -### BREAKING CHANGES - -* 1. 删除 LOS_CirBufLock(),LOS_CirBufUnlock()内核对外接口 -2. LOS_CirBufWrite(),LOS_CirBufRead()由原先内部不进行上/解锁操作,变为默认已包含上/解锁操作。 -* 新增支持API: - -LOS_LmsCheckPoolAdd使能检测指定内存池 -LOS_LmsCheckPoolDel不检测指定内存池 -LOS_LmsAddrProtect为指定内存段上锁,不允许访问 -LOS_LmsAddrDisableProtect去能指定内存段的访问保护 -* 1.新增一系列perf的对外API,位于los_perf.h中. - LOS_PerfInit配置采样数据缓冲区 - LOS_PerfStart开启Perf采样 - LOS_PerfStop停止Perf采样 - LOS_PerfConfig配置Perf采样事件 - LOS_PerfDataRead读取采样数据 - LOS_PerfNotifyHookReg 注册采样数据缓冲区的钩子函数 - LOS_PerfFlushHookReg 注册缓冲区刷cache的钩子 - -2. 用户态新增perf命令 -【Usage】: -./perf [start] /[start id] Start perf. -./perf [stop] Stop perf. -./perf [read nBytes] Read nBytes raw data from perf buffer and print out. -./perf [list] List events to be used in -e. -./perf [stat] or [record]