Compare commits
38 Commits
monthly_20
...
monthly_20
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bf19a69b3c | ||
|
|
ddb8c8f2ca | ||
|
|
f86ead69d2 | ||
|
|
fc761badd0 | ||
|
|
38a9313a1b | ||
|
|
7fc770192d | ||
|
|
44ec199465 | ||
|
|
7437408f65 | ||
|
|
1134332a58 | ||
|
|
8099f6578d | ||
|
|
ba23a26f95 | ||
|
|
2dc24da826 | ||
|
|
6302c5f767 | ||
|
|
f0d5959576 | ||
|
|
65790b67d5 | ||
|
|
9eff5cff1d | ||
|
|
99ea8d4ed2 | ||
|
|
1568c317bb | ||
|
|
5e70129199 | ||
|
|
089376994a | ||
|
|
12adfd5832 | ||
|
|
c46c5a640d | ||
|
|
c812b0c27b | ||
|
|
51528ec39c | ||
|
|
beb03bfc81 | ||
|
|
bbbd96784e | ||
|
|
1c0de289ec | ||
|
|
a3d757c8e1 | ||
|
|
6fede4eb92 | ||
|
|
7be302633f | ||
|
|
0164461b33 | ||
|
|
9bb4be5e13 | ||
|
|
4acf1e9f8d | ||
|
|
870221452d | ||
|
|
30c3fb086e | ||
|
|
9b1e0a186b | ||
|
|
00dbf1e5d5 | ||
|
|
9fb176b827 |
2
BUILD.gn
2
BUILD.gn
@@ -323,7 +323,7 @@ group("liteos_a") {
|
||||
deps += [
|
||||
":apps",
|
||||
":tests",
|
||||
"//prebuilts/lite/sysroot/build:strip",
|
||||
"//third_party/musl/scripts/build_lite:strip",
|
||||
]
|
||||
if (liteos_skip_make == false) {
|
||||
deps += [ ":make" ]
|
||||
|
||||
2
Kconfig
2
Kconfig
@@ -265,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 informations 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 information of mem node.
|
||||
config BASE_MEM_NODE_INTEGRITY_CHECK
|
||||
bool "Enable integrity check or not"
|
||||
default n
|
||||
|
||||
2
Makefile
2
Makefile
@@ -121,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)/../../prebuilts/lite/sysroot/build/Makefile && \
|
||||
ln -snf $(LITEOSTOPDIR)/../../third_party/musl/scripts/build_lite/Makefile && \
|
||||
$(MAKE) TARGETS=liteos_a_user \
|
||||
ARCH=$(ARCH) \
|
||||
TARGET=$(LOSCFG_LLVM_TARGET) \
|
||||
|
||||
1
OAT.xml
1
OAT.xml
@@ -23,6 +23,7 @@
|
||||
<licensefile></licensefile>
|
||||
<policylist>
|
||||
<policy name="projectPolicy" desc="">
|
||||
<policyitem type="copyright" name="Huawei Technologies Co., Ltd. All rights reserved." path=".*" desc="original liteos copyright"/>
|
||||
<policyitem type="copyright" name="Huawei Device Co., Ltd. All rights reserved." path=".*" desc="original liteos copyright"/>
|
||||
<policyitem type="license" name="BSD-3-Clause" path=".*" desc="Liteos kernel use bsd3 license"/>
|
||||
</policy>
|
||||
|
||||
@@ -33,6 +33,7 @@ OpenHarmony LiteOS-A内核是基于Huawei LiteOS内核演进发展的新一代
|
||||
│ ├── quickstart # 系统快速启动接口目录
|
||||
│ ├── random # 随机数设备驱动
|
||||
│ └── video # framebuffer驱动框架
|
||||
├── figures # 内核架构图
|
||||
├── fs # 文件系统模块,主要来源于NuttX开源项目
|
||||
│ ├── fat # fat文件系统
|
||||
│ ├── jffs2 # jffs2文件系统
|
||||
@@ -54,7 +55,9 @@ OpenHarmony LiteOS-A内核是基于Huawei LiteOS内核演进发展的新一代
|
||||
│ ├── include # 对外暴露头文件存放目录
|
||||
│ └── uart # 串口相关逻辑代码
|
||||
├── security # 安全特性相关的代码,包括进程权限管理和虚拟id映射管理
|
||||
├── shell # 接收用户输入的命令,内核去执行
|
||||
├── syscall # 系统调用
|
||||
├── testsuilts # 测试套件
|
||||
└── tools # 构建工具及相关配置和代码
|
||||
```
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ copy("copy_mksh_src") {
|
||||
|
||||
build_ext_component("build_mksh") {
|
||||
deps = [ ":copy_mksh_src" ]
|
||||
deps += [ "//prebuilts/lite/sysroot" ]
|
||||
deps += [ "//third_party/musl:sysroot_lite" ]
|
||||
exec_path = rebase_path("$target_out_dir/mksh_build")
|
||||
|
||||
cflags = [
|
||||
|
||||
@@ -422,7 +422,7 @@ static void DoCmdExec(const char *cmdName, const char *cmdline, unsigned int len
|
||||
|
||||
forkPid = fork();
|
||||
if (forkPid < 0) {
|
||||
printf("Faild to fork from shell\n");
|
||||
printf("Failed to fork from shell\n");
|
||||
return;
|
||||
} else if (forkPid == 0) {
|
||||
ChildExec(cmdParsed->paramArray[0], cmdParsed->paramArray, foreground);
|
||||
|
||||
@@ -500,7 +500,7 @@ static void lwip_tftp_send_error(s32_t iSockNum, u32_t ulError, const char *szEr
|
||||
}
|
||||
}
|
||||
|
||||
/* INTEFACE to get a file using filename
|
||||
/* INTERFACE 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
|
||||
/* INTEFACE to get a file using filename
|
||||
/* INTERFACE to get a file using filename
|
||||
ulHostAddr - IP address of Host
|
||||
szSrcFileName - Source file
|
||||
szDestMemAddr - The target memory address in the client
|
||||
|
||||
@@ -51,7 +51,7 @@ build_ext_component("build_toybox") {
|
||||
":copy_toybox_config",
|
||||
":copy_toybox_src",
|
||||
]
|
||||
deps += [ "//prebuilts/lite/sysroot" ]
|
||||
deps += [ "//third_party/musl:sysroot_lite" ]
|
||||
exec_path = rebase_path("$target_out_dir/toybox_build")
|
||||
|
||||
cflags = [
|
||||
|
||||
@@ -276,11 +276,11 @@ 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, Auxlliary Control Register */
|
||||
mrc p15, 0, r12, c1, c0, 1 /* ACTLR, Auxiliary 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, Auxlliary Control Register */
|
||||
mcr p15, 0, r12, c1, c0, 1 /* ACTLR, Auxiliary Control Register */
|
||||
dsb
|
||||
mrc p15, 0, r12, c1, c0, 0
|
||||
bic r12, #(1 << 29 | 1 << 28) /* Disable TRE/AFE */
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
include $(LITEOSTOPDIR)/config.mk
|
||||
include $(LITEOSTOPDIR)/../../drivers/adapter/khdf/liteos/lite.mk
|
||||
include $(LITEOSTOPDIR)/../../drivers/hdf_core/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/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 \
|
||||
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 \
|
||||
-I$(LITEOSTOPDIR)/../../third_party/FreeBSD/sys/dev/evdev
|
||||
|
||||
LOCAL_SRCS += $(INPUT_SRC)/uhid.c \
|
||||
|
||||
@@ -71,7 +71,7 @@
|
||||
|
||||
#ifdef LOSCFG_AARCH64
|
||||
/*
|
||||
* This two structures originally did't exit,
|
||||
* This two structures originally didn't exit,
|
||||
* they added by liteos to support 64bit interfaces on 32bit platform,
|
||||
* in 64bit platform, timeval64 define to timeval which is platform adaptive.
|
||||
*/
|
||||
@@ -478,7 +478,6 @@ 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;
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ config DRIVERS
|
||||
Answer Y to enable LiteOS support driver.
|
||||
|
||||
source "bsd/dev/usb/Kconfig"
|
||||
source "../../drivers/adapter/khdf/liteos/Kconfig"
|
||||
source "../../drivers/hdf_core/adapter/khdf/liteos/Kconfig"
|
||||
|
||||
# Device driver Kconfig import
|
||||
source "$(DEVICE_PATH)/drivers/Kconfig"
|
||||
@@ -17,5 +17,4 @@ 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"
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
extern "C"{
|
||||
extern "C" {
|
||||
#endif
|
||||
#endif /* __cplusplus */
|
||||
|
||||
|
||||
@@ -343,7 +343,8 @@ 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;
|
||||
|
||||
@@ -64,7 +64,7 @@ extern "C" {
|
||||
#define MBR_PRIMARY_PART_NUM 4
|
||||
#define JUMP_CODE "\xEB\xFE\x90"
|
||||
|
||||
/* Partiton type */
|
||||
/* Partition 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
|
||||
|
||||
@@ -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 scaned the FAT and update field.
|
||||
* - FR_OK : Successfully scanned 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
|
||||
|
||||
@@ -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 scaned the FAT and update field.
|
||||
* - FR_OK : Successfully scanned the FAT and update field.
|
||||
*
|
||||
* Others Return Value:
|
||||
* - FR_INVAILD_FATFS : The FATFS object has error or the info in it has been occuried
|
||||
|
||||
@@ -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:
|
||||
@@ -244,8 +244,9 @@ 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.</li>
|
||||
*
|
||||
* @retval CONTINE_NUTTX_FCNTL doesn't support some cmds in VfsFcntl, needs to continue going through
|
||||
* Nuttx vfs operation.</li>
|
||||
*
|
||||
* @par Dependency:
|
||||
* <ul><li>fs.h</li></ul>
|
||||
* @see None
|
||||
|
||||
@@ -49,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; /* szie of active vnodes list */
|
||||
int activeVnodeSize; /* size of active vnodes list */
|
||||
void *data; /* private data */
|
||||
uint32_t hashseed; /* Random seed for vfshash */
|
||||
unsigned long mountFlags; /* Flags for mount */
|
||||
|
||||
@@ -5499,7 +5499,7 @@ diff -Nupr old/fs/jffs2/readinode.c new/fs/jffs2/readinode.c
|
||||
break;
|
||||
|
||||
default:
|
||||
+ JFFS2_ERROR("Unknow f->inocache->state %d!\n", f->inocache->state);
|
||||
+ JFFS2_ERROR("Unknown f->inocache->state %d!\n", f->inocache->state);
|
||||
BUG();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2021-2021 Huawei Device Co., Ltd. All rights reserved.
|
||||
* Copyright (c) 2021-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:
|
||||
@@ -682,7 +682,6 @@ 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);
|
||||
}
|
||||
@@ -809,7 +808,6 @@ 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);
|
||||
}
|
||||
|
||||
@@ -137,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 moudule;
|
||||
* Interface for modules using proc below internal proc module;
|
||||
*/
|
||||
/**
|
||||
* @ingroup procfs
|
||||
|
||||
@@ -135,7 +135,7 @@ void ProcFdInit(void)
|
||||
{
|
||||
struct ProcDirEntry *pde = CreateProcEntry("fd", 0, NULL);
|
||||
if (pde == NULL) {
|
||||
PRINT_ERR("creat /proc/fd error.\n");
|
||||
PRINT_ERR("create /proc/fd error.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2021-2021 Huawei Device Co., Ltd. All rights reserved.
|
||||
* Copyright (c) 2021-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:
|
||||
@@ -154,7 +154,8 @@ 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());
|
||||
|
||||
@@ -91,7 +91,7 @@ void ProcMountsInit(void)
|
||||
{
|
||||
struct ProcDirEntry *pde = CreateProcEntry("mounts", 0, NULL);
|
||||
if (pde == NULL) {
|
||||
PRINT_ERR("creat mounts error!\n");
|
||||
PRINT_ERR("create mounts error!\n");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -78,7 +78,7 @@ void ProcUptimeInit(void)
|
||||
{
|
||||
struct ProcDirEntry *pde = CreateProcEntry("uptime", 0, NULL);
|
||||
if (pde == NULL) {
|
||||
PRINT_ERR("creat /proc/uptime error!\n");
|
||||
PRINT_ERR("create /proc/uptime error!\n");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -62,8 +62,8 @@ int OsShellCmdWriteProc(int argc, char **argv)
|
||||
|
||||
if (argc == WRITEPROC_ARGC) {
|
||||
value = argv[0];
|
||||
path = argv[2];
|
||||
len = strlen(value) + 1; /* +1:add the \0 */
|
||||
path = argv[2]; // 2: index of path
|
||||
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");
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2021-2021 Huawei Device Co., Ltd. All rights reserved.
|
||||
* Copyright (c) 2021-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:
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -138,7 +138,7 @@ typedef struct tagOsBcache {
|
||||
* <li>The block number is automatically adjusted if position is greater than block size.</li>
|
||||
* </ul>
|
||||
*
|
||||
* @retval #0 read succeded
|
||||
* @retval #0 read succeeded
|
||||
* @retval #INT32 read failed
|
||||
*
|
||||
* @par Dependency:
|
||||
@@ -168,7 +168,7 @@ INT32 BlockCacheRead(OsBcache *bc,
|
||||
* <li>The block number is automatically adjusted if position is greater than block size.</li>
|
||||
* </ul>
|
||||
*
|
||||
* @retval #0 write succeded
|
||||
* @retval #0 write succeeded
|
||||
* @retval #INT32 write failed
|
||||
*
|
||||
* @par Dependency:
|
||||
@@ -193,7 +193,7 @@ INT32 BlockCacheWrite(OsBcache *bc,
|
||||
* <li>None.</li>
|
||||
* </ul>
|
||||
*
|
||||
* @retval #0 sync succeded
|
||||
* @retval #0 sync succeeded
|
||||
* @retval #INT32 sync failed
|
||||
*
|
||||
* @par Dependency:
|
||||
@@ -219,7 +219,7 @@ INT32 BlockCacheSync(OsBcache *bc);
|
||||
* <li>None.</li>
|
||||
* </ul>
|
||||
*
|
||||
* @retval #OsBcache * init succeded
|
||||
* @retval #OsBcache * init succeeded
|
||||
* @retval #NULL init failed
|
||||
*
|
||||
* @par Dependency:
|
||||
|
||||
@@ -225,7 +225,6 @@ 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);
|
||||
@@ -258,11 +257,10 @@ 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");
|
||||
@@ -275,20 +273,18 @@ 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();
|
||||
@@ -308,7 +304,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;
|
||||
|
||||
@@ -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();
|
||||
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;
|
||||
}
|
||||
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;
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -155,7 +155,6 @@ int chdir(const char *path)
|
||||
char *fullpath_bak = NULL;
|
||||
struct stat statBuff;
|
||||
|
||||
|
||||
if (!path) {
|
||||
set_errno(EFAULT);
|
||||
return -1;
|
||||
|
||||
@@ -57,7 +57,6 @@ int utime(const char *path, const struct utimbuf *ptimes)
|
||||
|
||||
/* Sanity checks */
|
||||
|
||||
|
||||
if (path == NULL) {
|
||||
ret = -EINVAL;
|
||||
goto errout;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2021-2021 Huawei Device Co., Ltd. All rights reserved.
|
||||
* Copyright (c) 2021-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:
|
||||
@@ -239,7 +239,7 @@ BOOL VnodeInUseIter(const struct Mount *mount)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
int VnodeHold()
|
||||
int VnodeHold(void)
|
||||
{
|
||||
int ret = LOS_MuxLock(&g_vnodeMux, LOS_WAIT_FOREVER);
|
||||
if (ret != LOS_OK) {
|
||||
@@ -248,7 +248,7 @@ int VnodeHold()
|
||||
return ret;
|
||||
}
|
||||
|
||||
int VnodeDrop()
|
||||
int VnodeDrop(void)
|
||||
{
|
||||
int ret = LOS_MuxUnlock(&g_vnodeMux);
|
||||
if (ret != LOS_OK) {
|
||||
@@ -583,7 +583,7 @@ int VnodeCreate(struct Vnode *parent, const char *name, int mode, struct Vnode *
|
||||
return 0;
|
||||
}
|
||||
|
||||
int VnodeDevInit()
|
||||
int VnodeDevInit(void)
|
||||
{
|
||||
struct Vnode *devNode = NULL;
|
||||
struct Mount *devMount = NULL;
|
||||
@@ -616,7 +616,7 @@ int VnodeGetattr(struct Vnode *vnode, struct stat *buf)
|
||||
return LOS_OK;
|
||||
}
|
||||
|
||||
struct Vnode *VnodeGetRoot()
|
||||
struct Vnode *VnodeGetRoot(void)
|
||||
{
|
||||
return g_rootVnode;
|
||||
}
|
||||
@@ -697,7 +697,7 @@ LIST_HEAD* GetVnodeActiveList()
|
||||
return &g_vnodeActiveList;
|
||||
}
|
||||
|
||||
int VnodeClearCache()
|
||||
int VnodeClearCache(void)
|
||||
{
|
||||
struct Vnode *item = NULL;
|
||||
struct Vnode *nextItem = NULL;
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
include $(LITEOSTOPDIR)/config.mk
|
||||
include $(LITEOSTOPDIR)/../../drivers/adapter/khdf/liteos/lite.mk
|
||||
include $(LITEOSTOPDIR)/../../drivers/hdf_core/adapter/khdf/liteos/lite.mk
|
||||
|
||||
MODULE_NAME := $(notdir $(shell pwd))
|
||||
|
||||
|
||||
@@ -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 creater, UINT16 count);
|
||||
STATIC INLINE VOID OsSemDbgUpdateHook(UINT32 semID, TSK_ENTRY_FUNC creater, UINT16 count)
|
||||
extern VOID OsSemDbgUpdate(UINT32 semID, TSK_ENTRY_FUNC creator, UINT16 count);
|
||||
STATIC INLINE VOID OsSemDbgUpdateHook(UINT32 semID, TSK_ENTRY_FUNC creator, UINT16 count)
|
||||
{
|
||||
#ifdef LOSCFG_DEBUG_SEMAPHORE
|
||||
OsSemDbgUpdate(semID, creater, count);
|
||||
OsSemDbgUpdate(semID, creator, count);
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
#ifdef LOSCFG_DEBUG_QUEUE
|
||||
|
||||
typedef struct {
|
||||
TSK_ENTRY_FUNC creater; /* The task entry who created this queue */
|
||||
TSK_ENTRY_FUNC creator; /* 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->creater = entry;
|
||||
queueDebug->creator = 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 creater:0x%p, Latest operation time: 0x%llx\n",
|
||||
node->creater, node->lastAccessTime);
|
||||
PRINTK("TaskEntry of creator:0x%p, Latest operation time: 0x%llx\n",
|
||||
node->creator, 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.creater == NULL))) {
|
||||
((queueNode.queueState == OS_QUEUE_INUSED) && (queueDebugNode.creator == NULL))) {
|
||||
continue;
|
||||
}
|
||||
if ((queueNode.queueState == OS_QUEUE_INUSED) &&
|
||||
|
||||
@@ -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 creater; /* The task entry who created this sem */
|
||||
TSK_ENTRY_FUNC creator; /* 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 creater, UINT16 count)
|
||||
VOID OsSemDbgUpdate(UINT32 semID, TSK_ENTRY_FUNC creator, UINT16 count)
|
||||
{
|
||||
SemDebugCB *semDebug = &g_semDebugArray[GET_SEM_INDEX(semID)];
|
||||
semDebug->creater = creater;
|
||||
semDebug->creator = creator;
|
||||
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 Creater(TaskEntry) LastAccessTime\n");
|
||||
PRINTK("\r\n SemID Count OriginalCount Creator(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.creater == NULL)) {
|
||||
if ((semNode.semStat != OS_SEM_USED) || (semDebug.creator == NULL)) {
|
||||
continue;
|
||||
}
|
||||
PRINTK(" 0x%-07x0x%-07u0x%-14u%-22p0x%llx\n", semNode.semID, semDebug.origSemCount,
|
||||
semNode.semCount, semDebug.creater, semDebug.lastAccessTime);
|
||||
semNode.semCount, semDebug.creator, 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->creater != NULL)) {
|
||||
if ((semNode->semStat == OS_SEM_USED) && (semDebug->creator != 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->creater == NULL)) {
|
||||
if ((semNode->semStat != OS_SEM_USED) || (semDebug->creator == NULL)) {
|
||||
continue;
|
||||
}
|
||||
*(semIndexArray + count) = i;
|
||||
|
||||
@@ -284,7 +284,7 @@ static int SigProcessSignalHandler(LosTaskCB *tcb, void *arg)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* If the default tcb is not setted, then set this one as default. */
|
||||
/* If the default tcb is not set, then set this one as default. */
|
||||
if (!info->defaultTcb) {
|
||||
info->defaultTcb = tcb;
|
||||
}
|
||||
@@ -305,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 setted, then set it. */
|
||||
/* if unblockedTcb of this signal is not set, then set it. */
|
||||
if (!info->unblockedTcb) {
|
||||
info->unblockedTcb = tcb;
|
||||
}
|
||||
|
||||
@@ -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_ACCESSABLE_U8);
|
||||
LMS_SHADOW_ACCESSIBLE_U8);
|
||||
}
|
||||
|
||||
STATIC INLINE VOID OsLmsReallocSplitNodeMark(struct OsMemNodeHead *node)
|
||||
|
||||
@@ -1238,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("creat sem for uart failed\n");
|
||||
PRINT_ERR("create sem for uart failed\n");
|
||||
goto ERR_WITH_BUF;
|
||||
}
|
||||
|
||||
|
||||
@@ -1026,7 +1026,7 @@ LITE_OS_SEC_TEXT STATIC UINT32 CheckPara(IpcContent *content, UINT32 *dstTid)
|
||||
#endif
|
||||
break;
|
||||
default:
|
||||
PRINT_DEBUG("Unknow msg type:%d\n", msg->type);
|
||||
PRINT_DEBUG("Unknown msg type:%d\n", msg->type);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -1118,13 +1118,13 @@ LITE_OS_SEC_TEXT STATIC UINT32 CheckRecievedMsg(IpcListNode *node, IpcContent *c
|
||||
}
|
||||
#if (USE_TIMESTAMP == 1)
|
||||
if (node->msg.timestamp != content->outMsg->timestamp) {
|
||||
PRINT_ERR("Recieve a unmatch reply, drop it\n");
|
||||
PRINT_ERR("Receive 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("Recieve a unmatch reply, drop it\n");
|
||||
PRINT_ERR("Receive a unmatch reply, drop it\n");
|
||||
ret = -EINVAL;
|
||||
}
|
||||
#endif
|
||||
@@ -1132,7 +1132,7 @@ LITE_OS_SEC_TEXT STATIC UINT32 CheckRecievedMsg(IpcListNode *node, IpcContent *c
|
||||
case MT_DEATH_NOTIFY:
|
||||
break;
|
||||
default:
|
||||
PRINT_ERR("Unknow msg type:%d\n", node->msg.type);
|
||||
PRINT_ERR("Unknown msg type:%d\n", node->msg.type);
|
||||
ret = -EINVAL;
|
||||
}
|
||||
if (ret != LOS_OK) {
|
||||
@@ -1310,7 +1310,7 @@ LITE_OS_SEC_TEXT STATIC UINT32 HandleCmsCmd(CmsCmdContent *content)
|
||||
}
|
||||
return AddServiceAccess(localContent.taskID, localContent.serviceHandle);
|
||||
default:
|
||||
PRINT_DEBUG("Unknow cmd cmd:%d\n", localContent.cmd);
|
||||
PRINT_DEBUG("Unknown cmd cmd:%d\n", localContent.cmd);
|
||||
return -EINVAL;
|
||||
}
|
||||
return ret;
|
||||
@@ -1375,7 +1375,7 @@ LITE_OS_SEC_TEXT int LiteIpcIoctl(struct file *filep, int cmd, unsigned long arg
|
||||
}
|
||||
break;
|
||||
default:
|
||||
PRINT_ERR("Unknow liteipc ioctl cmd:%d\n", cmd);
|
||||
PRINT_ERR("Unknown liteipc ioctl cmd:%d\n", cmd);
|
||||
return -EINVAL;
|
||||
}
|
||||
return (INT32)ret;
|
||||
|
||||
@@ -326,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_ACCESSABLE_U8);
|
||||
OsLmsSetShadowValue(node, curNodeStartAddr + nodeHeadSize, nextNodeStartAddr, LMS_SHADOW_ACCESSIBLE_U8);
|
||||
OsLmsSetShadowValue(node, nextNodeStartAddr, nextNodeStartAddr + nodeHeadSize, LMS_SHADOW_REDZONE_U8);
|
||||
LMS_UNLOCK(intSave);
|
||||
}
|
||||
@@ -344,7 +344,7 @@ VOID OsLmsCheckValid(UINTPTR checkAddr, BOOL isFreeCheck)
|
||||
|
||||
OsLmsGetShadowValue(node, checkAddr, &shadowValue);
|
||||
LMS_UNLOCK(intSave);
|
||||
if ((shadowValue == LMS_SHADOW_ACCESSABLE) || ((isFreeCheck) && (shadowValue == LMS_SHADOW_PAINT))) {
|
||||
if ((shadowValue == LMS_SHADOW_ACCESSIBLE) || ((isFreeCheck) && (shadowValue == LMS_SHADOW_PAINT))) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -367,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_ACCESSABLE) && (shadowValue != LMS_SHADOW_PAINT)) {
|
||||
if ((shadowValue != LMS_SHADOW_ACCESSIBLE) && (shadowValue != LMS_SHADOW_PAINT)) {
|
||||
LMS_UNLOCK(intSave);
|
||||
OsLmsReportError(curNodeStartAddr + nodeHeadSize, MEM_REGION_SIZE_1, FREE_ERRORMODE);
|
||||
return;
|
||||
@@ -408,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_ACCESSABLE_U8);
|
||||
OsLmsSetShadowValue(node, addrStart, addrEnd, LMS_SHADOW_ACCESSIBLE_U8);
|
||||
}
|
||||
LMS_UNLOCK(intSave);
|
||||
}
|
||||
@@ -426,7 +426,7 @@ STATIC UINT32 OsLmsCheckAddr(UINTPTR addr)
|
||||
LmsMemListNode *node = OsLmsGetPoolNodeFromAddr(addr);
|
||||
if (node == NULL) {
|
||||
LMS_UNLOCK(intSave);
|
||||
return LMS_SHADOW_ACCESSABLE_U8;
|
||||
return LMS_SHADOW_ACCESSIBLE_U8;
|
||||
}
|
||||
|
||||
OsLmsGetShadowValue(node, addr, &shadowValue);
|
||||
@@ -542,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_ACCESSABLE_U8) {
|
||||
if (info->shadowValue != LMS_SHADOW_ACCESSIBLE_U8) {
|
||||
return;
|
||||
} else {
|
||||
OsLmsGetShadowInfo(node, addr + size - 1, info);
|
||||
@@ -558,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_ACCESSABLE:
|
||||
case LMS_SHADOW_ACCESSIBLE:
|
||||
PRINT_ERR("No error\n");
|
||||
break;
|
||||
default:
|
||||
@@ -614,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_ACCESSABLE_U8) {
|
||||
if (OsLmsCheckAddr(p) != LMS_SHADOW_ACCESSIBLE_U8) {
|
||||
OsLmsReportError(p, MEM_REGION_SIZE_1, STORE_ERRMODE);
|
||||
}
|
||||
}
|
||||
@@ -690,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_ACCESSABLE_U8) {
|
||||
if (OsLmsCheckAddr(p) != LMS_SHADOW_ACCESSIBLE_U8) {
|
||||
OsLmsReportError(p, MEM_REGION_SIZE_1, LOAD_ERRMODE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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_ACCESSABLE 0x00
|
||||
#define LMS_SHADOW_ACCESSIBLE 0x00
|
||||
#define LMS_SHADOW_AFTERFREE 0x03
|
||||
#define LMS_SHADOW_REDZONE 0x02
|
||||
#define LMS_SHADOW_PAINT 0x01
|
||||
#define LMS_SHADOW_MASK 0x03
|
||||
|
||||
#define LMS_SHADOW_ACCESSABLE_U8 0x00
|
||||
#define LMS_SHADOW_ACCESSIBLE_U8 0x00
|
||||
#define LMS_SHADOW_AFTERFREE_U8 0xFF
|
||||
#define LMS_SHADOW_REDZONE_U8 0xAA
|
||||
#define LMS_SHADOW_MASK_U8 0xFF
|
||||
|
||||
@@ -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_ACCESSABLE_U8;
|
||||
*shadowValue = LMS_SHADOW_ACCESSIBLE_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_ACCESSABLE_U8);
|
||||
LmsSetShadowValue(accessMemStart, nextRzStart, LMS_SHADOW_ACCESSIBLE_U8);
|
||||
LmsSetShadowValue(nextRzStart, RzEndAddr, LMS_SHADOW_REDZONE_U8);
|
||||
}
|
||||
|
||||
@@ -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_ACCESSABLE_U8) {
|
||||
if (info->shadowValue != LMS_SHADOW_ACCESSIBLE_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_ACCESSABLE:
|
||||
case LMS_SHADOW_ACCESSIBLE:
|
||||
LMS_OUTPUT_ERROR("No error!\n");
|
||||
break;
|
||||
default:
|
||||
@@ -343,7 +343,7 @@ ATTRIBUTE_NO_SANITIZE_ADDRESS static void LmsPrintErrInfo(LmsAddrInfo *info, uin
|
||||
info->shadowOffset, info->shadowValue);
|
||||
|
||||
LMS_OUTPUT_INFO("\n");
|
||||
LMS_OUTPUT_INFO("%-25s%d\n", "Accessable heap addr", LMS_SHADOW_ACCESSABLE);
|
||||
LMS_OUTPUT_INFO("%-25s%d\n", "Accessible heap addr", LMS_SHADOW_ACCESSIBLE);
|
||||
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_ACCESSABLE_U8) {
|
||||
if (LmsCheckAddr((uintptr_t)dest) != LMS_SHADOW_ACCESSIBLE_U8) {
|
||||
LmsReportError((uintptr_t)dest, MEM_REGION_SIZE_1, STORE_ERRMODE);
|
||||
return;
|
||||
}
|
||||
|
||||
if (LmsCheckAddr((uintptr_t)src) != LMS_SHADOW_ACCESSABLE_U8) {
|
||||
if (LmsCheckAddr((uintptr_t)src) != LMS_SHADOW_ACCESSIBLE_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_ACCESSABLE_U8) {
|
||||
if (LmsCheckAddr((uintptr_t)dest + i + 1) != LMS_SHADOW_ACCESSIBLE_U8) {
|
||||
LmsReportError((uintptr_t)dest + i + 1, MEM_REGION_SIZE_1, STORE_ERRMODE);
|
||||
return;
|
||||
}
|
||||
|
||||
if (LmsCheckAddr((uintptr_t)src + i + 1) != LMS_SHADOW_ACCESSABLE_U8) {
|
||||
if (LmsCheckAddr((uintptr_t)src + i + 1) != LMS_SHADOW_ACCESSIBLE_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_ACCESSABLE_U8) {
|
||||
if (LmsCheckAddr(p) != LMS_SHADOW_ACCESSIBLE_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_ACCESSABLE_U8) {
|
||||
if (LmsCheckAddr(p) != LMS_SHADOW_ACCESSIBLE_U8) {
|
||||
LmsReportError(p, MEM_REGION_SIZE_1, LOAD_ERRMODE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ extern "C" {
|
||||
#define SANITIZER_INTERFACE_ATTRIBUTE
|
||||
#define ATTRIBUTE_NO_SANITIZE_ADDRESS __attribute__((no_sanitize_address))
|
||||
|
||||
#define LMS_SHADOW_ACCESSABLE 0x00
|
||||
#define LMS_SHADOW_ACCESSIBLE 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_ACCESSABLE_U8 0x00
|
||||
#define LMS_SHADOW_ACCESSIBLE_U8 0x00
|
||||
#define LMS_SHADOW_AFTERFREE_U8 0xFF
|
||||
#define LMS_SHADOW_REDZONE_U8 0xAA
|
||||
#define LMS_SHADOW_MASK_U8 0xFF
|
||||
|
||||
@@ -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_ACCESSABLE) {
|
||||
if (acShadowValue != LMS_SHADOW_ACCESSIBLE) {
|
||||
char erroMode = (acShadowValue == LMS_SHADOW_AFTERFREE ? FREE_ERRORMODE : UNKNOWN_ERROR);
|
||||
LmsReportError((uintptr_t)ptr, MEM_REGION_SIZE_1, erroMode);
|
||||
goto UNLOCK_OUT;
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -977,7 +977,7 @@ extern UINT32 LOS_TaskInfoGet(UINT32 taskID, TSK_INFO_S *taskInfo);
|
||||
*
|
||||
* @attention
|
||||
* <ul>
|
||||
* <li>If any low LOSCFG_KERNEL_CORE_NUM bit of the mask is not setted, an error is reported.</li>
|
||||
* <li>If any low LOSCFG_KERNEL_CORE_NUM bit of the mask is not set, an error is reported.</li>
|
||||
* </ul>
|
||||
*
|
||||
* @param uwTaskID [IN] Type #UINT32 Task ID. The task id value is obtained from task creation.
|
||||
@@ -987,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 setted.
|
||||
* @retval #LOS_OK The task cpu affinity mask is successfully set.
|
||||
* @par Dependency:
|
||||
* <ul><li>los_task.h: the header file that contains the API declaration.</li></ul>
|
||||
* @see LOS_TaskCpuAffiGet
|
||||
|
||||
@@ -31,7 +31,7 @@ import("$root_out_dir/config.gni")
|
||||
|
||||
LITEOSTOPDIR = "//kernel/liteos_a"
|
||||
LITEOSTHIRDPARTY = "//third_party"
|
||||
HDFTOPDIR = "//drivers/adapter/khdf/liteos"
|
||||
HDFTOPDIR = "//drivers/hdf_core/adapter/khdf/liteos"
|
||||
|
||||
ARCH = ""
|
||||
if (defined(LOSCFG_ARCH_ARM_AARCH32)) {
|
||||
|
||||
@@ -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)); \
|
||||
|
||||
@@ -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 cahe the prinf data to a buf, and when the tcpip */
|
||||
/* deadlock. So we cache the print 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];
|
||||
@@ -365,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;
|
||||
|
||||
@@ -1031,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 */
|
||||
|
||||
@@ -1057,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 */
|
||||
|
||||
@@ -1076,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;
|
||||
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;
|
||||
}
|
||||
(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);
|
||||
@@ -1158,9 +1158,9 @@ struct arp_option {
|
||||
unsigned int ipaddr;
|
||||
/* hw addr */
|
||||
unsigned char ethaddr[6];
|
||||
/* 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 */
|
||||
/* 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 */
|
||||
sys_sem_t cb_completed;
|
||||
char cb_print_buf[PRINT_BUF_LEN];
|
||||
int print_buf_len;
|
||||
@@ -1191,7 +1191,6 @@ 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;
|
||||
}
|
||||
@@ -1305,7 +1304,7 @@ void lwip_arp_internal(void *arg)
|
||||
for (netif = netif_list; netif != NULL; netif = netif->next) {
|
||||
ret = etharp_delete_arp_entry(netif, &ipaddr);
|
||||
if (ret == ERR_OK) {
|
||||
/*only can del success one time*/
|
||||
/* only can del success one time */
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1326,7 +1325,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), "Successed\n");
|
||||
(void)snprintf_s(arp_cmd->cb_print_buf, PRINT_BUF_LEN, (PRINT_BUF_LEN - 1), "Succeeded\n");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -1387,7 +1386,7 @@ u32_t lwip_arp(int argc, const char **argv)
|
||||
goto arp_error;
|
||||
}
|
||||
i += 2;
|
||||
argc -= 2;
|
||||
argc -= 2; // 2: number of used parameters
|
||||
} else if (strcmp("-d", argv[i]) == 0 && (argc > 1)) {
|
||||
/* arp delete */
|
||||
arp_cmd.option = ARP_OPTION_DEL;
|
||||
@@ -1399,8 +1398,8 @@ u32_t lwip_arp(int argc, const char **argv)
|
||||
}
|
||||
|
||||
i += 2;
|
||||
argc -= 2;
|
||||
} else if (strcmp("-s", argv[i]) == 0 && (argc > 2)) {
|
||||
argc -= 2; // 2: number of used parameters
|
||||
} else if (strcmp("-s", argv[i]) == 0 && (argc > 2)) { // 2: require more than 2 parameters
|
||||
/* arp add */
|
||||
char *digit = NULL;
|
||||
u32_t macaddrlen = strlen(argv[i + 2]) + 1;
|
||||
@@ -1418,7 +1417,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;
|
||||
@@ -1452,7 +1451,7 @@ u32_t lwip_arp(int argc, const char **argv)
|
||||
}
|
||||
|
||||
i += 3;
|
||||
argc -= 3;
|
||||
argc -= 3; // 3: number of used parameters
|
||||
} else {
|
||||
goto arp_error;
|
||||
}
|
||||
@@ -1727,7 +1726,7 @@ LWIP_STATIC int osPingFunc(u32_t destip, u32_t cnt, u32_t interval, u32_t data_l
|
||||
break;
|
||||
}
|
||||
intrvl -= 1000;
|
||||
sys_msleep(1000);
|
||||
sys_msleep(1000); // 1000: delay 1 s
|
||||
if (ping_kill == 1)
|
||||
break;
|
||||
} while (intrvl > 0);
|
||||
@@ -1819,7 +1818,7 @@ u32_t osShellPing(int argc, const char **argv)
|
||||
count = ret;
|
||||
count_set = 1;
|
||||
i += 2;
|
||||
argc -= 2;
|
||||
argc -= 2; // 2: nuber of arguments that has been checked
|
||||
} else if (strcmp("-t", argv[i]) == 0) {
|
||||
count = 0; /* ping forerver */
|
||||
count_set = 1;
|
||||
@@ -1834,7 +1833,7 @@ u32_t osShellPing(int argc, const char **argv)
|
||||
|
||||
interval = ret;
|
||||
i += 2;
|
||||
argc -= 2;
|
||||
argc -= 2; // 2:number of arguments that has been checked
|
||||
} 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))) {
|
||||
@@ -1844,7 +1843,7 @@ u32_t osShellPing(int argc, const char **argv)
|
||||
}
|
||||
data_len = ret;
|
||||
i += 2;
|
||||
argc -= 2;
|
||||
argc -= 2; // 2: number of elements has been checked
|
||||
} else if (strcmp("-k", argv[i]) == 0) {
|
||||
if (ping_taskid > 0) {
|
||||
ping_kill = 1; /* stop the current ping task */
|
||||
@@ -1896,7 +1895,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;
|
||||
stPingTask.auwArgs[3] = data_len; // 3: index of data length
|
||||
ret = LOS_TaskCreate((UINT32 *)(&ping_taskid), &stPingTask);
|
||||
if (ret != LOS_OK) {
|
||||
PRINTK("ping_task create failed 0x%08x.\n", ret);
|
||||
@@ -1923,7 +1922,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)
|
||||
{
|
||||
@@ -2076,7 +2075,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)
|
||||
@@ -2234,13 +2233,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 [Doesnot contain even the header !!] */
|
||||
/* Drop the packet if its too short [Doesn't 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 wont contain IPv6 Header since its an AF_INET6 RAW Socket */
|
||||
/* Here, pbuf_resp->payload won't 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) {
|
||||
@@ -2283,7 +2282,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)) {
|
||||
/* Incase of delayed packet wait on socket for other response before sending a new PING */
|
||||
/* In case 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;
|
||||
}
|
||||
@@ -2311,9 +2310,10 @@ 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 atleast one packet is received */
|
||||
/* Display rtt stats only if at least 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);
|
||||
}
|
||||
|
||||
@@ -2629,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)
|
||||
@@ -2778,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 atleast udp header available */
|
||||
/* check if there is enough space for at least udp header available */
|
||||
if (udpbuf->tot_len < UDP_HLEN) {
|
||||
goto FUNC_OUT;
|
||||
}
|
||||
@@ -2866,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 /*+ conn->lrcv_left*/), retVal);
|
||||
SYS_ARCH_GET(((unsigned int)conn->recv_avail), retVal); // + conn->lrcv_left
|
||||
break;
|
||||
default:
|
||||
retVal = 0; /* ur... very ugly, damn DHCP DNS and SNTP */
|
||||
@@ -2922,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;
|
||||
@@ -2966,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
|
||||
}
|
||||
@@ -2992,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 /*+ conn->lrcv_left*/), retVal);
|
||||
SYS_ARCH_GET(((unsigned int)conn->recv_avail), retVal); // + conn->lrcv_left
|
||||
break;
|
||||
default:
|
||||
retVal = 0; /* ur... very ugly, damn DHCP DNS and SNTP */
|
||||
@@ -3271,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, /*rpcb->hdrincl*/0);
|
||||
"raw", recvQlen, sendQlen, local_ip_port, remote_ip_port, proto, 0); // rpcb->hdrincl
|
||||
if ((iRet <= 0) || ((u32_t)(iRet) >= entry_buf_len)) {
|
||||
goto out;
|
||||
}
|
||||
@@ -3297,7 +3297,8 @@ void netstat_internal(void *ctx)
|
||||
sendQlen = netstat_netconn_sendq(rpcb->recv_arg);
|
||||
|
||||
for (netif = netif_list; netif != NULL; netif = netif->next) {
|
||||
if (netif_get_index(netif)/*netif->ifindex*/ == rpcb->netif_idx/*index*/) {
|
||||
/* netif->ifindex and index */
|
||||
if (netif_get_index(netif) == rpcb->netif_idx) {
|
||||
(void)snprintf_s((char *)netif_name, IFNAMSIZ, IFNAMSIZ - 1, "%s", netif_get_name(netif));
|
||||
break;
|
||||
}
|
||||
@@ -3307,7 +3308,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);
|
||||
@@ -3884,4 +3885,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
|
||||
|
||||
@@ -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 respose message during base message creation */
|
||||
The correct flags has already been added in the response 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
|
||||
|
||||
@@ -412,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) {
|
||||
|
||||
@@ -98,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
|
||||
|
||||
@@ -803,12 +803,10 @@ 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);
|
||||
@@ -979,7 +977,6 @@ 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 {
|
||||
@@ -1090,7 +1087,6 @@ 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) {
|
||||
@@ -1165,7 +1161,6 @@ 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 {
|
||||
|
||||
@@ -263,7 +263,7 @@ SYSCALL_HAND_DEF(__NR_statx, SysStatx, int, ARG_NUM_5)
|
||||
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_creat_user_thread, SysCreateUserThread, unsigned int, ARG_NUM_3)
|
||||
SYSCALL_HAND_DEF(__NR_create_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)
|
||||
|
||||
@@ -86,14 +86,14 @@ extern "C" {
|
||||
#endif /* __cpluscplus */
|
||||
#endif /* __cpluscplus */
|
||||
|
||||
#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 = 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 { \
|
||||
(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; \
|
||||
} while (0);
|
||||
|
||||
#ifdef LOSCFG_KERNEL_SMP
|
||||
|
||||
@@ -50,7 +50,7 @@ VOID RecordIntrTrace(INT32 irq, INT32 direction)
|
||||
VOID ResetIntrTrace(VOID)
|
||||
{
|
||||
g_traceIdx = 0;
|
||||
memset(g_intrTrace, 0, RECORD_SIZE);
|
||||
(void)memset_s(g_intrTrace, RECORD_SIZE, 0, RECORD_SIZE);
|
||||
}
|
||||
|
||||
UINT32 CheckIntrTrace(UINT32 *expect, UINT32 num)
|
||||
|
||||
@@ -44,7 +44,7 @@ static VOID NestingPrioHigh(INT32 irq, VOID *data)
|
||||
{
|
||||
g_intrHandleEnd = 1;
|
||||
UINT32 temp[0x100][2] = {0};
|
||||
memset(temp, 1, sizeof(UINT32) * 0x100 * 2); // 2, buffer size.
|
||||
(void)memset_s(temp, sizeof(UINT32) * 0x100 * 2, 1, sizeof(UINT32) * 0x100 * 2); // 2, buffer size.
|
||||
}
|
||||
|
||||
static VOID TaskF01(VOID)
|
||||
|
||||
@@ -58,7 +58,7 @@ static UINT32 Testcase(void)
|
||||
// 32, number of cycles
|
||||
for (index = 0; index < 32; index++) {
|
||||
task1.usTaskPrio = index;
|
||||
snprintf(acName, 10, "Tsk040A%2d", index); // 10, snprintf size.
|
||||
(void)snprintf_s(acName, TASK_NAME_NUM, TASK_NAME_NUM - 1, "Tsk040A%2d", index);
|
||||
task1.pcName = acName;
|
||||
task1.uwResved = LOS_TASK_STATUS_DETACHED;
|
||||
|
||||
|
||||
@@ -58,9 +58,10 @@ EXIT:
|
||||
static UINT32 Testcase(void)
|
||||
{
|
||||
UINT32 ret;
|
||||
TSK_INIT_PARAM_S task1;
|
||||
TSK_INIT_PARAM_S task1 = {0};
|
||||
|
||||
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;
|
||||
|
||||
@@ -142,7 +142,8 @@ static UINT32 Testcase(void)
|
||||
ret = LOS_TaskCreate(&g_testTaskID01, &task1);
|
||||
ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret);
|
||||
|
||||
memset(&task1, 0, sizeof(TSK_INIT_PARAM_S));
|
||||
ret = memset_s(&task1, sizeof(TSK_INIT_PARAM_S), 0, sizeof(TSK_INIT_PARAM_S));
|
||||
ICUNIT_ASSERT_EQUAL(ret, 0, ret);
|
||||
task1.pfnTaskEntry = (TSK_ENTRY_FUNC)TaskF02;
|
||||
task1.uwStackSize = TASK_STACK_SIZE_TEST;
|
||||
task1.pcName = "Tsk118B";
|
||||
|
||||
@@ -142,7 +142,8 @@ static UINT32 Testcase(void)
|
||||
ret = LOS_TaskCreate(&g_testTaskID01, &task1);
|
||||
ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret);
|
||||
|
||||
memset(&task1, 0, sizeof(TSK_INIT_PARAM_S));
|
||||
ret = memset_s(&task1, sizeof(TSK_INIT_PARAM_S), 0, sizeof(TSK_INIT_PARAM_S));
|
||||
ICUNIT_ASSERT_EQUAL(ret, 0, ret);
|
||||
task1.pfnTaskEntry = (TSK_ENTRY_FUNC)TaskF02;
|
||||
task1.uwStackSize = TASK_STACK_SIZE_TEST;
|
||||
task1.pcName = "Tsk118B";
|
||||
|
||||
@@ -80,7 +80,8 @@ static UINT32 Testcase(void)
|
||||
currCpuid = (ArchCurrCpuid() + 1) % LOSCFG_KERNEL_CORE_NUM;
|
||||
#endif
|
||||
|
||||
memset(&task, 0, sizeof(TSK_INIT_PARAM_S));
|
||||
ret = memset_s(&task, sizeof(TSK_INIT_PARAM_S), 0, sizeof(TSK_INIT_PARAM_S));
|
||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT);
|
||||
task.pfnTaskEntry = (TSK_ENTRY_FUNC)ItTimeslice001F01;
|
||||
task.usTaskPrio = TASK_PRIO_TEST_TASK + 1;
|
||||
task.pcName = "it_timeslice_001_f01";
|
||||
|
||||
@@ -99,7 +99,8 @@ static UINT32 Testcase(void)
|
||||
currCpuid = (ArchCurrCpuid() + 1) % LOSCFG_KERNEL_CORE_NUM;
|
||||
#endif
|
||||
|
||||
memset(&task, 0, sizeof(TSK_INIT_PARAM_S));
|
||||
ret = memset_s(&task, sizeof(TSK_INIT_PARAM_S), 0, sizeof(TSK_INIT_PARAM_S));
|
||||
ICUNIT_ASSERT_EQUAL(ret, 0, ret);
|
||||
task.pfnTaskEntry = (TSK_ENTRY_FUNC)ItTimeslice002F01;
|
||||
task.usTaskPrio = TASK_PRIO_TEST_TASK + 1;
|
||||
task.pcName = "it_timeslice_002_f01";
|
||||
|
||||
@@ -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);
|
||||
|
||||
/* creat preempt task */
|
||||
/* create preempt task */
|
||||
task1.usCpuAffiMask = 0;
|
||||
ret = LOS_TaskCreate(&g_testTaskID01, &task1);
|
||||
ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret);
|
||||
|
||||
@@ -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;
|
||||
|
||||
/* creat high prio task on every cores */
|
||||
/* create 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));
|
||||
|
||||
@@ -59,7 +59,7 @@ static UINT32 Testcase(void)
|
||||
TSK_INIT_PARAM_S task1 = { 0 };
|
||||
g_testCount = 0;
|
||||
|
||||
// 5, lengh of the queue; 50, max queue msg size.
|
||||
// 5, length of the queue; 50, max queue msg size.
|
||||
ret = LOS_QueueCreate("queue", 5, &g_queue, 0, 50);
|
||||
ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret);
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ static UINT32 Testcase(void)
|
||||
TSK_INIT_PARAM_S task1 = { 0 };
|
||||
g_testCount = 0;
|
||||
|
||||
// 5, lengh of the queue; 50, max queue msg size.
|
||||
// 5, length 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);
|
||||
|
||||
@@ -72,7 +72,7 @@ static UINT32 Testcase(void)
|
||||
TSK_INIT_PARAM_S task1 = { 0 };
|
||||
g_testCount = 0;
|
||||
|
||||
// 5, lengh of the queue; 50, max queue msg size.
|
||||
// 5, length 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);
|
||||
|
||||
@@ -71,7 +71,7 @@ static UINT32 Testcase(void)
|
||||
UINT32 ret;
|
||||
TSK_INIT_PARAM_S task1 = { 0 };
|
||||
g_testCount = 0;
|
||||
// 5, lengh of the queue; 50, max queue msg size.
|
||||
// 5, length 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);
|
||||
|
||||
@@ -57,7 +57,7 @@ static UINT32 Testcase(void)
|
||||
int i;
|
||||
|
||||
for (i = 0; i < LOSCFG_KERNEL_CORE_NUM; i++) {
|
||||
/* creat core_num same priority tasks */
|
||||
/* create 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 successed */
|
||||
/* Check if task yield definitely succeeded */
|
||||
ICUNIT_GOTO_NOT_EQUAL(timesliceCount2, timesliceCount1, timesliceCount2 - timesliceCount1, EXIT);
|
||||
|
||||
for (i = 0; i < LOSCFG_KERNEL_CORE_NUM; i++) {
|
||||
|
||||
@@ -57,8 +57,8 @@ EXIT:
|
||||
static UINT32 Testcase(VOID)
|
||||
{
|
||||
UINT32 ret;
|
||||
TSK_INIT_PARAM_S task1;
|
||||
memset(&task1, 0, sizeof(TSK_INIT_PARAM_S));
|
||||
TSK_INIT_PARAM_S task1 = {0};
|
||||
|
||||
task1.pfnTaskEntry = (TSK_ENTRY_FUNC)TaskF01;
|
||||
task1.pcName = "EventTsk1";
|
||||
task1.uwStackSize = TASK_STACK_SIZE_TEST;
|
||||
|
||||
@@ -60,8 +60,8 @@ EXIT:
|
||||
static UINT32 Testcase(VOID)
|
||||
{
|
||||
UINT32 ret;
|
||||
TSK_INIT_PARAM_S task1;
|
||||
memset(&task1, 0, sizeof(TSK_INIT_PARAM_S));
|
||||
TSK_INIT_PARAM_S task1 = {0};
|
||||
|
||||
task1.pfnTaskEntry = (TSK_ENTRY_FUNC)TaskF01;
|
||||
task1.pcName = "EventTsk2";
|
||||
task1.uwStackSize = TASK_STACK_SIZE_TEST;
|
||||
|
||||
@@ -56,8 +56,8 @@ EXIT:
|
||||
static UINT32 Testcase(VOID)
|
||||
{
|
||||
UINT32 ret;
|
||||
TSK_INIT_PARAM_S task1;
|
||||
memset(&task1, 0, sizeof(TSK_INIT_PARAM_S));
|
||||
TSK_INIT_PARAM_S task1 = {0};
|
||||
|
||||
task1.pfnTaskEntry = (TSK_ENTRY_FUNC)TaskF01;
|
||||
task1.pcName = "EventTsk3";
|
||||
task1.uwStackSize = TASK_STACK_SIZE_TEST;
|
||||
|
||||
@@ -57,8 +57,8 @@ EXIT:
|
||||
static UINT32 Testcase(VOID)
|
||||
{
|
||||
UINT32 ret;
|
||||
TSK_INIT_PARAM_S task1;
|
||||
memset(&task1, 0, sizeof(TSK_INIT_PARAM_S));
|
||||
TSK_INIT_PARAM_S task1 = {0};
|
||||
|
||||
task1.pfnTaskEntry = (TSK_ENTRY_FUNC)TaskF01;
|
||||
task1.pcName = "EventTsk4";
|
||||
task1.uwStackSize = TASK_STACK_SIZE_TEST;
|
||||
|
||||
@@ -62,8 +62,8 @@ EXIT:
|
||||
static UINT32 Testcase(VOID)
|
||||
{
|
||||
UINT32 ret;
|
||||
TSK_INIT_PARAM_S task1;
|
||||
memset(&task1, 0, sizeof(TSK_INIT_PARAM_S));
|
||||
TSK_INIT_PARAM_S task1 = {0};
|
||||
|
||||
task1.pfnTaskEntry = (TSK_ENTRY_FUNC)TaskF01;
|
||||
task1.pcName = "EventTsk6";
|
||||
task1.uwStackSize = TASK_STACK_SIZE_TEST;
|
||||
|
||||
@@ -88,8 +88,8 @@ EXIT:
|
||||
static UINT32 Testcase(VOID)
|
||||
{
|
||||
UINT32 ret;
|
||||
TSK_INIT_PARAM_S task1;
|
||||
memset(&task1, 0, sizeof(TSK_INIT_PARAM_S));
|
||||
TSK_INIT_PARAM_S task1 = {0};
|
||||
|
||||
task1.pfnTaskEntry = (TSK_ENTRY_FUNC)TaskF01;
|
||||
task1.pcName = "EventTsk7";
|
||||
task1.uwStackSize = TASK_STACK_SIZE_TEST;
|
||||
|
||||
@@ -62,8 +62,8 @@ EXIT:
|
||||
static UINT32 Testcase(VOID)
|
||||
{
|
||||
UINT32 ret;
|
||||
TSK_INIT_PARAM_S task1;
|
||||
memset(&task1, 0, sizeof(TSK_INIT_PARAM_S));
|
||||
TSK_INIT_PARAM_S task1 = {0};
|
||||
|
||||
task1.pfnTaskEntry = (TSK_ENTRY_FUNC)TaskF01;
|
||||
task1.pcName = "EventTsk8";
|
||||
task1.uwStackSize = TASK_STACK_SIZE_TEST;
|
||||
|
||||
@@ -70,8 +70,8 @@ EXIT:
|
||||
static UINT32 Testcase(VOID)
|
||||
{
|
||||
UINT32 ret;
|
||||
TSK_INIT_PARAM_S task1;
|
||||
memset(&task1, 0, sizeof(TSK_INIT_PARAM_S));
|
||||
TSK_INIT_PARAM_S task1 = {0};
|
||||
|
||||
task1.pfnTaskEntry = (TSK_ENTRY_FUNC)TaskF01;
|
||||
task1.pcName = "EventTsk9";
|
||||
task1.uwStackSize = TASK_STACK_SIZE_TEST;
|
||||
|
||||
@@ -62,8 +62,8 @@ EXIT:
|
||||
static UINT32 Testcase(VOID)
|
||||
{
|
||||
UINT32 ret;
|
||||
TSK_INIT_PARAM_S task1;
|
||||
memset(&task1, 0, sizeof(TSK_INIT_PARAM_S));
|
||||
TSK_INIT_PARAM_S task1 = {0};
|
||||
|
||||
task1.pfnTaskEntry = (TSK_ENTRY_FUNC)TaskF01;
|
||||
task1.pcName = "EventTsk10";
|
||||
task1.uwStackSize = TASK_STACK_SIZE_TEST;
|
||||
|
||||
@@ -69,8 +69,8 @@ EXIT:
|
||||
static UINT32 Testcase(VOID)
|
||||
{
|
||||
UINT32 ret;
|
||||
TSK_INIT_PARAM_S task1;
|
||||
memset(&task1, 0, sizeof(TSK_INIT_PARAM_S));
|
||||
TSK_INIT_PARAM_S task1 = {0};
|
||||
|
||||
task1.pfnTaskEntry = (TSK_ENTRY_FUNC)TaskF01;
|
||||
task1.pcName = "EventTsk11";
|
||||
task1.uwStackSize = TASK_STACK_SIZE_TEST;
|
||||
|
||||
@@ -74,8 +74,8 @@ static UINT32 Testcase(VOID)
|
||||
{
|
||||
UINT32 ret;
|
||||
|
||||
TSK_INIT_PARAM_S task1;
|
||||
memset(&task1, 0, sizeof(TSK_INIT_PARAM_S));
|
||||
TSK_INIT_PARAM_S task1 = {0};
|
||||
|
||||
task1.pfnTaskEntry = (TSK_ENTRY_FUNC)TaskF01;
|
||||
task1.pcName = "EventTsk12";
|
||||
task1.uwStackSize = TASK_STACK_SIZE_TEST;
|
||||
|
||||
@@ -75,8 +75,8 @@ EXIT:
|
||||
static UINT32 Testcase(VOID)
|
||||
{
|
||||
UINT32 ret;
|
||||
TSK_INIT_PARAM_S task1;
|
||||
memset(&task1, 0, sizeof(TSK_INIT_PARAM_S));
|
||||
TSK_INIT_PARAM_S task1 = {0};
|
||||
|
||||
task1.pfnTaskEntry = (TSK_ENTRY_FUNC)TaskF01;
|
||||
task1.pcName = "EventTsk13";
|
||||
task1.uwStackSize = TASK_STACK_SIZE_TEST;
|
||||
|
||||
@@ -67,8 +67,8 @@ EXIT:
|
||||
static UINT32 Testcase(VOID)
|
||||
{
|
||||
UINT32 ret;
|
||||
TSK_INIT_PARAM_S task1;
|
||||
memset(&task1, 0, sizeof(TSK_INIT_PARAM_S));
|
||||
TSK_INIT_PARAM_S task1 = {0};
|
||||
|
||||
task1.pfnTaskEntry = (TSK_ENTRY_FUNC)TaskF01;
|
||||
task1.pcName = "EventTsk14";
|
||||
task1.uwStackSize = TASK_STACK_SIZE_TEST;
|
||||
|
||||
@@ -65,8 +65,8 @@ EXIT:
|
||||
static UINT32 Testcase(VOID)
|
||||
{
|
||||
UINT32 ret;
|
||||
TSK_INIT_PARAM_S task1;
|
||||
memset(&task1, 0, sizeof(TSK_INIT_PARAM_S));
|
||||
TSK_INIT_PARAM_S task1 = {0};
|
||||
|
||||
task1.pfnTaskEntry = (TSK_ENTRY_FUNC)TaskF01;
|
||||
task1.pcName = "EventTsk15";
|
||||
task1.uwStackSize = TASK_STACK_SIZE_TEST;
|
||||
|
||||
@@ -60,8 +60,8 @@ EXIT:
|
||||
static UINT32 Testcase(VOID)
|
||||
{
|
||||
UINT32 ret;
|
||||
TSK_INIT_PARAM_S task1;
|
||||
memset(&task1, 0, sizeof(TSK_INIT_PARAM_S));
|
||||
TSK_INIT_PARAM_S task1 = {0};
|
||||
|
||||
task1.pfnTaskEntry = (TSK_ENTRY_FUNC)TaskF01;
|
||||
task1.pcName = "EventTsk16";
|
||||
task1.uwStackSize = TASK_STACK_SIZE_TEST;
|
||||
|
||||
@@ -74,8 +74,8 @@ EXIT:
|
||||
static UINT32 Testcase(VOID)
|
||||
{
|
||||
UINT32 ret;
|
||||
TSK_INIT_PARAM_S task1;
|
||||
memset(&task1, 0, sizeof(TSK_INIT_PARAM_S));
|
||||
TSK_INIT_PARAM_S task1 = {0};
|
||||
|
||||
task1.pfnTaskEntry = (TSK_ENTRY_FUNC)TaskF01;
|
||||
task1.pcName = "EvtTsk18A";
|
||||
task1.uwStackSize = TASK_STACK_SIZE_TEST;
|
||||
|
||||
@@ -83,8 +83,8 @@ EXIT:
|
||||
static UINT32 Testcase(VOID)
|
||||
{
|
||||
UINT32 ret;
|
||||
TSK_INIT_PARAM_S task1;
|
||||
memset(&task1, 0, sizeof(TSK_INIT_PARAM_S));
|
||||
TSK_INIT_PARAM_S task1 = {0};
|
||||
|
||||
task1.pfnTaskEntry = (TSK_ENTRY_FUNC)TaskF01;
|
||||
task1.pcName = "EvtTsk19A";
|
||||
task1.uwStackSize = TASK_STACK_SIZE_TEST;
|
||||
|
||||
@@ -84,8 +84,8 @@ EXIT:
|
||||
static UINT32 Testcase(VOID)
|
||||
{
|
||||
UINT32 ret;
|
||||
TSK_INIT_PARAM_S task1;
|
||||
memset(&task1, 0, sizeof(TSK_INIT_PARAM_S));
|
||||
TSK_INIT_PARAM_S task1 = {0};
|
||||
|
||||
task1.pfnTaskEntry = (TSK_ENTRY_FUNC)TaskF01;
|
||||
task1.pcName = "EvtTsk20A";
|
||||
task1.uwStackSize = TASK_STACK_SIZE_TEST;
|
||||
|
||||
@@ -54,8 +54,8 @@ EXIT:
|
||||
static VOID TaskF01(VOID)
|
||||
{
|
||||
UINT32 ret;
|
||||
TSK_INIT_PARAM_S task1;
|
||||
memset(&task1, 0, sizeof(TSK_INIT_PARAM_S));
|
||||
TSK_INIT_PARAM_S task1 = {0};
|
||||
|
||||
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;
|
||||
memset(&task1, 0, sizeof(TSK_INIT_PARAM_S));
|
||||
TSK_INIT_PARAM_S task1 = {0};
|
||||
|
||||
task1.pfnTaskEntry = (TSK_ENTRY_FUNC)TaskF01;
|
||||
task1.pcName = "EvtTsk21A";
|
||||
task1.uwStackSize = TASK_STACK_SIZE_TEST;
|
||||
|
||||
@@ -73,8 +73,8 @@ EXIT:
|
||||
static UINT32 Testcase(VOID)
|
||||
{
|
||||
UINT32 ret;
|
||||
TSK_INIT_PARAM_S task1;
|
||||
memset(&task1, 0, sizeof(TSK_INIT_PARAM_S));
|
||||
TSK_INIT_PARAM_S task1 = {0};
|
||||
|
||||
task1.pfnTaskEntry = (TSK_ENTRY_FUNC)TaskF01;
|
||||
task1.pcName = "EvtTsk22A";
|
||||
task1.uwStackSize = TASK_STACK_SIZE_TEST;
|
||||
|
||||
@@ -92,9 +92,8 @@ EXIT:
|
||||
static UINT32 Testcase(VOID)
|
||||
{
|
||||
UINT32 ret;
|
||||
TSK_INIT_PARAM_S task1;
|
||||
TSK_INIT_PARAM_S task1 = {0};
|
||||
|
||||
memset(&task1, 0, sizeof(TSK_INIT_PARAM_S));
|
||||
task1.pfnTaskEntry = (TSK_ENTRY_FUNC)TaskF01;
|
||||
task1.pcName = "EvtTsk23A";
|
||||
task1.uwStackSize = TASK_STACK_SIZE_TEST;
|
||||
|
||||
@@ -66,8 +66,8 @@ EXIT:
|
||||
static UINT32 Testcase(VOID)
|
||||
{
|
||||
UINT32 ret;
|
||||
TSK_INIT_PARAM_S task1;
|
||||
memset(&task1, 0, sizeof(TSK_INIT_PARAM_S));
|
||||
TSK_INIT_PARAM_S task1 = {0};
|
||||
|
||||
task1.pfnTaskEntry = (TSK_ENTRY_FUNC)TaskF01;
|
||||
task1.pcName = "EventTsk26";
|
||||
task1.uwStackSize = TASK_STACK_SIZE_TEST;
|
||||
|
||||
@@ -81,8 +81,8 @@ static UINT32 Testcase(VOID)
|
||||
|
||||
UINT16 swTmrID;
|
||||
|
||||
TSK_INIT_PARAM_S task1;
|
||||
memset(&task1, 0, sizeof(TSK_INIT_PARAM_S));
|
||||
TSK_INIT_PARAM_S task1 = {0};
|
||||
|
||||
task1.pfnTaskEntry = (TSK_ENTRY_FUNC)TaskF01;
|
||||
task1.pcName = "EventTsk27";
|
||||
task1.uwStackSize = TASK_STACK_SIZE_TEST;
|
||||
|
||||
@@ -55,10 +55,9 @@ static UINT32 Testcase(VOID)
|
||||
{
|
||||
UINT32 ret;
|
||||
UINT32 event;
|
||||
TSK_INIT_PARAM_S task1;
|
||||
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 = "EventTsk29";
|
||||
task1.uwStackSize = TASK_STACK_SIZE_TEST;
|
||||
|
||||
@@ -52,8 +52,8 @@ EXIT:
|
||||
static UINT32 Testcase(VOID)
|
||||
{
|
||||
UINT32 ret;
|
||||
TSK_INIT_PARAM_S task1;
|
||||
memset(&task1, 0, sizeof(TSK_INIT_PARAM_S));
|
||||
TSK_INIT_PARAM_S task1 = {0};
|
||||
|
||||
task1.pfnTaskEntry = (TSK_ENTRY_FUNC)TaskF01;
|
||||
task1.pcName = "EventTsk30";
|
||||
task1.uwStackSize = TASK_STACK_SIZE_TEST;
|
||||
|
||||
@@ -83,12 +83,11 @@ EXIT:
|
||||
static UINT32 Testcase(VOID)
|
||||
{
|
||||
UINT32 ret;
|
||||
TSK_INIT_PARAM_S task1;
|
||||
TSK_INIT_PARAM_S task1 = {0};
|
||||
|
||||
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;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user