Compare commits
19 Commits
master
...
OpenHarmon
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c059be5ec8 | ||
|
|
723b3ff8e2 | ||
|
|
7cf342c29f | ||
|
|
3b9ccc839e | ||
|
|
4f1e1619a5 | ||
|
|
6523c496c8 | ||
|
|
7648648887 | ||
|
|
1c0bbb66de | ||
|
|
d44f3904cf | ||
|
|
5cbb83dc6e | ||
|
|
13fa3d4403 | ||
|
|
e9522d44bf | ||
|
|
f30790c5c8 | ||
|
|
a0bb801f67 | ||
|
|
170aa8ba6f | ||
|
|
83b0e8f867 | ||
|
|
6b5d6be42d | ||
|
|
8b27064848 | ||
|
|
1ad74ab8e4 |
11
.gitee/ISSUE_TEMPLATE.zh-CN.md
Normal file
11
.gitee/ISSUE_TEMPLATE.zh-CN.md
Normal file
@@ -0,0 +1,11 @@
|
||||
### 该问题是怎么引起的?
|
||||
|
||||
|
||||
|
||||
### 重现步骤
|
||||
|
||||
|
||||
|
||||
### 报错信息
|
||||
|
||||
|
||||
12
.gitee/PULL_REQUEST_TEMPLATE.zh-CN.md
Normal file
12
.gitee/PULL_REQUEST_TEMPLATE.zh-CN.md
Normal file
@@ -0,0 +1,12 @@
|
||||
### 相关的Issue
|
||||
|
||||
|
||||
### 原因(目的、解决的问题等)
|
||||
|
||||
|
||||
### 描述(做了什么,变更了什么)
|
||||
|
||||
|
||||
### 测试用例(新增、改动、可能影响的功能)
|
||||
|
||||
|
||||
24
README.md
24
README.md
@@ -12,7 +12,7 @@
|
||||
|
||||
## Introduction<a name="section11660541593"></a>
|
||||
|
||||
The OpenHarmony LiteOS Cortex-A is a new-generation kernel developed based on the Huawei LiteOS kernel. Huawei LiteOS is a lightweight operating system \(OS\) built for the Internet of Things \(IoT\) field. With the rapid development of the IoT industry, OpenHarmony LiteOS Cortex-A brings small-sized, low-power, and high-performance experience and builds a unified and open ecosystem for developers. In addition, it provides rich kernel mechanisms, more comprehensive Portable Operating System Interface \(POSIX\), and a unified driver framework, Hardware Driver Foundation \(HDF\), which offers unified access for device developers and friendly development experience for application developers. [Figure1](#fig27311582210) shows the architecture of the OpenHarmony LiteOS Cortex-A kernel.
|
||||
The OpenHarmony LiteOS Cortex-A is a new-generation kernel developed based on the Huawei LiteOS kernel. Huawei LiteOS is a lightweight operating system \(OS\) built for the Internet of Things \(IoT\) field. With the rapid development of the IoT industry, OpenHarmony LiteOS Cortex-A brings small-sized, low-power, and high-performance experience and builds a unified and open ecosystem for developers. In addition, it provides rich kernel mechanisms, more comprehensive Portable Operating System Interface \(POSIX\), and a unified driver framework, Hardware Driver Foundation \(HDF\), which offers unified access for device developers and friendly development experience for application developers. [Figure 1](#fig27311582210) shows the architecture of the OpenHarmony LiteOS Cortex-A kernel.
|
||||
|
||||
**Figure 1** Architecture of the OpenHarmony LiteOS Cortex-A kernel<a name="fig27311582210"></a>
|
||||

|
||||
@@ -27,7 +27,7 @@ The OpenHarmony LiteOS Cortex-A is a new-generation kernel developed based on th
|
||||
├── bsd # Code of the driver and adaptation layer module related to the FreeBSD, such as the USB module
|
||||
├── compat # Kernel API compatibility
|
||||
│ └── posix # POSIX APIs
|
||||
├── drivers # Kernel driver
|
||||
├── drivers # Kernel drivers
|
||||
│ └── char # Character device
|
||||
│ ├── mem # Driver for accessing physical input/output (I/O) devices
|
||||
│ ├── quickstart # APIs for quick start of the system
|
||||
@@ -50,7 +50,7 @@ The OpenHarmony LiteOS Cortex-A is a new-generation kernel developed based on th
|
||||
├── lib # Kernel library
|
||||
├── net # Network module, which mainly derives from the lwIP open-source project
|
||||
├── platform # Code for supporting different systems on a chip (SOCs), such as Hi3516D V300
|
||||
│ ├── hw # Logic code related to clocks and interupts
|
||||
│ ├── hw # Logic code related to clocks and interrupts
|
||||
│ ├── include # Header files exposed externally
|
||||
│ └── uart # Logic code related to the serial port
|
||||
├── platform # Code for supporting different systems on a chip (SOCs), such as Hi3516D V300
|
||||
@@ -67,30 +67,32 @@ The OpenHarmony LiteOS Cortex-A is a new-generation kernel developed based on th
|
||||
|
||||
## Usage<a name="section741617511812"></a>
|
||||
|
||||
OpenHarmony LiteOS Cortex-A supports the [Hi3518E V300](https://gitee.com/openharmony/docs/blob/master/docs-en/quick-start/introduction-to-the-hi3518-development-board.md) and [Hi3516D V300](https://gitee.com/openharmony/docs/blob/master/docs-en/quick-start/introduction-to-the-hi3516-development-board.md). You can develop and run your applications based on both development boards.
|
||||
OpenHarmony LiteOS Cortex-A supports the [Hi3518E V300](https://gitee.com/openharmony/docs/blob/master/en/device-dev/quick-start/introduction-to-the-hi3518-development-board.md) and [Hi3516D V300](https://gitee.com/openharmony/docs/blob/master/en/device-dev/quick-start/introduction-to-the-hi3516-development-board.md). You can develop and run your applications based on both development boards.
|
||||
|
||||
### Preparations<a name="section1579912573329"></a>
|
||||
|
||||
You need to set up the compilation environment on Linux.
|
||||
|
||||
- For Hi3518E V300, see [Setting Up the Hi3518 Development Environment](https://gitee.com/openharmony/docs/blob/master/docs-en/quick-start/setting-up-the-hi3518-development-environment.md).
|
||||
- For Hi3516D V300, see [Setting Up the Hi3516 Development Environment](https://gitee.com/openharmony/docs/blob/master/docs-en/quick-start/setting-up-the-hi3516-development-environment.md).
|
||||
- For Hi3518E V300, see [Setting Up the Hi3518 Development Environment](https://gitee.com/openharmony/docs/blob/master/en/device-dev/quick-start/setting-up-the-hi3518-development-environment.md).
|
||||
- For Hi3516D V300, see [Setting Up the Hi3516 Development Environment](https://gitee.com/openharmony/docs/blob/master/en/device-dev/quick-start/setting-up-the-hi3516-development-environment.md).
|
||||
|
||||
### Source Code Acquisition<a name="section11443189655"></a>
|
||||
|
||||
Download and decompress a set of source code on a Linux server to acquire the [source code](https://repo.huaweicloud.com/harmonyos/os/1.0/code-1.0.tar.gz). For more acquisition methods, see [Source Code Acquisition](https://gitee.com/openharmony/docs/blob/master/docs-en/get-code/source-code-acquisition.md).
|
||||
Download and decompress a set of source code on a Linux server to acquire the [source code](https://repo.huaweicloud.com/harmonyos/os/1.0.1/code-1.0.1.tar.gz). For more acquisition methods, see [Source Code Acquisition](https://gitee.com/openharmony/docs/blob/master/en/device-dev/get-code/source-code-acquisition.md).
|
||||
|
||||
### Compilation and Building<a name="section2081013992812"></a>
|
||||
|
||||
For details about how to develop the first application, see:
|
||||
|
||||
- [Developing the First Example Program Running on Hi3518](https://gitee.com/openharmony/docs/blob/master/docs-en/quick-start/developing-the-first-example-program-running-on-hi3518.md)
|
||||
- [Developing the First Example Program Running on Hi3518](https://gitee.com/openharmony/docs/blob/master/en/device-dev/quick-start/developing-the-first-example-program-running-on-hi3518.md)
|
||||
|
||||
- [Developing the First Example Program Running on Hi3516](https://gitee.com/openharmony/docs/blob/master/docs-en/quick-start/developing-the-first-example-program-running-on-hi3516.md)
|
||||
- [Developing the First Example Program Running on Hi3516](https://gitee.com/openharmony/docs/blob/master/en/device-dev/quick-start/developing-the-first-example-program-running-on-hi3516.md)
|
||||
|
||||
## Repositories Involved<a name="section1371113476307"></a>
|
||||
|
||||
[drivers\_liteos](https://gitee.com/openharmony/drivers_liteos)
|
||||
[Kernel subsystem](https://gitee.com/openharmony/docs/blob/master/en/readme/kernel.md)
|
||||
|
||||
**[kernel\_liteos\_a](https://gitee.com/openharmony/kernel_liteos_a)**
|
||||
[drivers\_liteos](https://gitee.com/openharmony/drivers_liteos/blob/master/README.md)
|
||||
|
||||
**kernel\_liteos\_a**
|
||||
|
||||
|
||||
18
README_zh.md
18
README_zh.md
@@ -67,30 +67,32 @@ OpenHarmony LiteOS-A内核是基于Huawei LiteOS内核演进发展的新一代
|
||||
|
||||
## 使用说明<a name="section741617511812"></a>
|
||||
|
||||
OpenHarmony LiteOS-A内核支持Hi3518EV300([介绍](https://gitee.com/openharmony/docs/blob/master/quick-start/Hi3518%E5%BC%80%E5%8F%91%E6%9D%BF%E4%BB%8B%E7%BB%8D.md))、Hi3516DV300([介绍](https://gitee.com/openharmony/docs/blob/master/quick-start/Hi3516%E5%BC%80%E5%8F%91%E6%9D%BF%E4%BB%8B%E7%BB%8D.md))单板,开发者可基于两种单板开发运行自己的应用程序。
|
||||
OpenHarmony LiteOS-A内核支持Hi3518EV300([介绍](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/Hi3518%E5%BC%80%E5%8F%91%E6%9D%BF%E4%BB%8B%E7%BB%8D.md))、Hi3516DV300([介绍](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/Hi3516%E5%BC%80%E5%8F%91%E6%9D%BF%E4%BB%8B%E7%BB%8D.md))单板,开发者可基于两种单板开发运行自己的应用程序。
|
||||
|
||||
### 准备<a name="section1579912573329"></a>
|
||||
|
||||
开发者需要在Linux上搭建编译环境:
|
||||
|
||||
- Hi3518EV300单板:参考[环境搭建](https://gitee.com/openharmony/docs/blob/master/quick-start/Hi3518%E6%90%AD%E5%BB%BA%E7%8E%AF%E5%A2%83.md);
|
||||
- Hi3516DV300单板:参考[环境搭建](https://gitee.com/openharmony/docs/blob/master/quick-start/Hi3516%E6%90%AD%E5%BB%BA%E7%8E%AF%E5%A2%83.md)。
|
||||
- Hi3518EV300单板:参考[环境搭建](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/%E6%90%AD%E5%BB%BA%E7%8E%AF%E5%A2%83.md);
|
||||
- Hi3516DV300单板:参考[环境搭建](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/Hi3516%E6%90%AD%E5%BB%BA%E7%8E%AF%E5%A2%83.md)。
|
||||
|
||||
### 获取源码<a name="section11443189655"></a>
|
||||
|
||||
在Linux服务器上下载并解压一套源代码,获取源码([下载链接](https://repo.huaweicloud.com/harmonyos/os/1.0/code-1.0.tar.gz))。更多源码获取方式,参考[源码获取](https://gitee.com/openharmony/docs/blob/master/get-code/%E6%BA%90%E7%A0%81%E8%8E%B7%E5%8F%96.md)。
|
||||
在Linux服务器上下载并解压一套源代码,获取源码([下载链接](https://repo.huaweicloud.com/harmonyos/os/1.0.1/code-1.0.1.tar.gz))。更多源码获取方式,参考[源码获取](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/get-code/%E6%BA%90%E7%A0%81%E8%8E%B7%E5%8F%96.md)。
|
||||
|
||||
### 编译构建<a name="section2081013992812"></a>
|
||||
|
||||
开发者开发第一个应用程序可参考:
|
||||
|
||||
- [helloworld for Hi3518EV300](https://gitee.com/openharmony/docs/blob/master/quick-start/%E5%BC%80%E5%8F%91Hi3518%E7%AC%AC%E4%B8%80%E4%B8%AA%E7%A4%BA%E4%BE%8B%E7%A8%8B%E5%BA%8F.md);
|
||||
- [helloworld for Hi3518EV300](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/%E5%BC%80%E5%8F%91Hi3518%E7%AC%AC%E4%B8%80%E4%B8%AA%E7%A4%BA%E4%BE%8B%E7%A8%8B%E5%BA%8F.md);
|
||||
|
||||
- [helloworld for Hi3516DV300](https://gitee.com/openharmony/docs/blob/master/quick-start/%E5%BC%80%E5%8F%91Hi3516%E7%AC%AC%E4%B8%80%E4%B8%AA%E5%BA%94%E7%94%A8%E7%A8%8B%E5%BA%8F%E7%A4%BA%E4%BE%8B.md)。
|
||||
- [helloworld for Hi3516DV300](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/%E5%BC%80%E5%8F%91Hi3516%E7%AC%AC%E4%B8%80%E4%B8%AA%E5%BA%94%E7%94%A8%E7%A8%8B%E5%BA%8F%E7%A4%BA%E4%BE%8B.md)。
|
||||
|
||||
## 相关仓<a name="section1371113476307"></a>
|
||||
|
||||
[drivers\_liteos](https://gitee.com/openharmony/drivers_liteos)
|
||||
[内核子系统](https://gitee.com/openharmony/docs/blob/master/zh-cn/readme/%E5%86%85%E6%A0%B8%E5%AD%90%E7%B3%BB%E7%BB%9F.md)
|
||||
|
||||
**[kernel\_liteos\_a](https://gitee.com/openharmony/kernel_liteos_a)**
|
||||
[drivers\_liteos](https://gitee.com/openharmony/drivers_liteos/blob/master/README_zh.md)
|
||||
|
||||
**kernel\_liteos\_a**
|
||||
|
||||
|
||||
@@ -669,12 +669,21 @@ VOID BackTraceSub(UINTPTR regFP)
|
||||
|
||||
while (IsValidFP(backFP, stackStart, stackEnd, &kvaddr) == TRUE) {
|
||||
tmpFP = backFP;
|
||||
#ifdef LOSCFG_COMPILER_CLANG_LLVM
|
||||
backFP = *(UINTPTR *)(UINTPTR)kvaddr;
|
||||
if (IsValidFP(tmpFP + POINTER_SIZE, stackStart, stackEnd, &kvaddr) == FALSE) {
|
||||
PrintExcInfo("traceback backLR check failed, backLP: 0x%x\n", tmpFP + POINTER_SIZE);
|
||||
return;
|
||||
}
|
||||
backLR = *(UINTPTR *)(UINTPTR)kvaddr;
|
||||
#else
|
||||
backLR = *(UINTPTR *)(UINTPTR)kvaddr;
|
||||
if (IsValidFP(tmpFP - POINTER_SIZE, stackStart, stackEnd, &kvaddr) == FALSE) {
|
||||
PrintExcInfo("traceback backFP check failed, backFP: 0x%x\n", tmpFP - POINTER_SIZE);
|
||||
return;
|
||||
}
|
||||
backFP = *(UINTPTR *)(UINTPTR)kvaddr;
|
||||
#endif
|
||||
if (LOS_IsUserAddress((VADDR_T)backLR) == TRUE) {
|
||||
region = LOS_RegionFind(OsCurrProcessGet()->vmSpace, (VADDR_T)backLR);
|
||||
}
|
||||
|
||||
16
build.sh
16
build.sh
@@ -32,6 +32,7 @@ set -e
|
||||
|
||||
echo "sh param:$1,$2,$3,$4,$5,$6,$7"
|
||||
destination=".config"
|
||||
config_file=""
|
||||
tee=""
|
||||
outdir="../..$3/test_info/gen/kernel/test"
|
||||
if [ "$5" = "tee" ]; then
|
||||
@@ -41,15 +42,19 @@ productName="$(basename $7)"
|
||||
source="tools/build/config/${productName}_release.config"
|
||||
if [ "$2" = "clang" ]; then
|
||||
if [ "$4" = "debug" ]; then
|
||||
source="tools/build/config/debug/${productName}_$2$tee.config"
|
||||
config_file="${productName}_$2$tee.config"
|
||||
source="tools/build/config/debug/$config_file"
|
||||
else
|
||||
source="tools/build/config/${productName}_$2_release$tee.config"
|
||||
config_file="${productName}_$2_release$tee.config"
|
||||
source="tools/build/config/$config_file"
|
||||
fi
|
||||
elif [ "$2" = "gcc" ]; then
|
||||
if [ "$4" = "debug" ]; then
|
||||
source="tools/build/config/${productName}_debug_shell$tee.config"
|
||||
config_file="${productName}_debug_shell$tee.config"
|
||||
source="tools/build/config/$config_file"
|
||||
else
|
||||
source="tools/build/config/${productName}_release$tee.config"
|
||||
config_file="${productName}_release$tee.config"
|
||||
source="tools/build/config/$config_file"
|
||||
fi
|
||||
fi
|
||||
if [ -d "./out" ]; then
|
||||
@@ -58,6 +63,9 @@ fi
|
||||
if [ -f "$destination" ]; then
|
||||
rm -rf $destination
|
||||
fi
|
||||
if [ ! -f "$source" ]; then
|
||||
source="$7/config/sys/$config_file"
|
||||
fi
|
||||
cp $source $destination
|
||||
|
||||
mkdir -p $outdir
|
||||
|
||||
@@ -586,6 +586,7 @@ typedef struct {
|
||||
|
||||
static VOID SwtmrProc(UINTPTR tmrArg)
|
||||
{
|
||||
unsigned int intSave;
|
||||
int sig;
|
||||
pid_t pid;
|
||||
siginfo_t info;
|
||||
@@ -610,7 +611,10 @@ static VOID SwtmrProc(UINTPTR tmrArg)
|
||||
info.si_value.sival_ptr = arg->sigev_value.sival_ptr;
|
||||
|
||||
/* Send the signal */
|
||||
SCHEDULER_LOCK(intSave);
|
||||
OsDispatch(pid, &info, OS_USER_KILL_PERMISSION);
|
||||
SCHEDULER_UNLOCK(intSave);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -883,8 +887,10 @@ clock_t times(struct tms *buf)
|
||||
|
||||
int setitimer(int which, const struct itimerval *value, struct itimerval *ovalue)
|
||||
{
|
||||
UINT32 intSave;
|
||||
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;
|
||||
int ret = LOS_OK;
|
||||
@@ -894,15 +900,27 @@ int setitimer(int which, const struct itimerval *value, struct itimerval *ovalue
|
||||
set_errno(EINVAL);
|
||||
return -1;
|
||||
}
|
||||
LOS_TaskLock();
|
||||
|
||||
if (processCB->timerID == (timer_t)(UINTPTR)MAX_INVALID_TIMER_VID) {
|
||||
ret = timer_create(CLOCK_REALTIME, NULL, &processCB->timerID);
|
||||
ret = timer_create(CLOCK_REALTIME, NULL, &timerID);
|
||||
if (ret != LOS_OK) {
|
||||
LOS_TaskUnlock();
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
LOS_TaskUnlock();
|
||||
|
||||
/* The initialization of this global timer must be in spinlock
|
||||
* timer_create cannot be located in spinlock.
|
||||
*/
|
||||
SCHEDULER_LOCK(intSave);
|
||||
if (processCB->timerID == (timer_t)(UINTPTR)MAX_INVALID_TIMER_VID) {
|
||||
processCB->timerID = timerID;
|
||||
SCHEDULER_UNLOCK(intSave);
|
||||
} else {
|
||||
SCHEDULER_UNLOCK(intSave);
|
||||
if (timerID) {
|
||||
timer_delete(timerID);
|
||||
}
|
||||
}
|
||||
|
||||
if (!ValidTimeval(&value->it_value) || !ValidTimeval(&value->it_interval)) {
|
||||
set_errno(EINVAL);
|
||||
|
||||
120
fs/vfs/operation/fs_other.c
Executable file → Normal file
120
fs/vfs/operation/fs_other.c
Executable file → Normal file
@@ -526,16 +526,74 @@ static void PrintFileInfo(const struct stat *statInfo, const char *name)
|
||||
str[0], str[1], str[UGO_NUMS - 1], statInfo->st_size, statInfo->st_uid, statInfo->st_gid, name);
|
||||
}
|
||||
|
||||
void ls(const char *pathname)
|
||||
int LsFile(const char *path)
|
||||
{
|
||||
struct stat64 stat64_info;
|
||||
struct stat stat_info;
|
||||
struct dirent *pdirent = NULL;
|
||||
char *path = NULL;
|
||||
struct stat64 stat64Info;
|
||||
struct stat statInfo;
|
||||
|
||||
if (stat64(path, &stat64Info) == 0) {
|
||||
PrintFileInfo64(&stat64Info, path);
|
||||
} else if (stat(path, &statInfo) == 0) {
|
||||
PrintFileInfo(&statInfo, path);
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int LsDir(const char *path)
|
||||
{
|
||||
struct stat statInfo = { 0 };
|
||||
struct stat64 stat64Info = { 0 };
|
||||
DIR *d = NULL;
|
||||
char *fullpath = NULL;
|
||||
char *fullpath_bak = NULL;
|
||||
struct dirent *pdirent = NULL;
|
||||
|
||||
d = opendir(path);
|
||||
if (d == NULL) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
PRINTK("Directory %s:\n", path);
|
||||
do {
|
||||
pdirent = readdir(d);
|
||||
if (pdirent == NULL) {
|
||||
break;
|
||||
} else {
|
||||
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));
|
||||
fullpath = ls_get_fullpath(path, pdirent);
|
||||
if (fullpath == NULL) {
|
||||
(void)closedir(d);
|
||||
return -1;
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
} while (1);
|
||||
(void)closedir(d);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void ls(const char *pathname)
|
||||
{
|
||||
struct stat statInfo = { 0 };
|
||||
char *path = NULL;
|
||||
int ret;
|
||||
DIR *d = NULL;
|
||||
|
||||
if (pathname == NULL) {
|
||||
#ifdef VFS_USING_WORKDIR
|
||||
@@ -561,45 +619,23 @@ void ls(const char *pathname)
|
||||
}
|
||||
}
|
||||
|
||||
/* list all directory and file*/
|
||||
|
||||
d = opendir(path);
|
||||
if (d == NULL) {
|
||||
ret = stat(path, &statInfo);
|
||||
if (ret < 0) {
|
||||
perror("ls error");
|
||||
} else {
|
||||
PRINTK("Directory %s:\n", path);
|
||||
do {
|
||||
pdirent = readdir(d);
|
||||
if (pdirent == NULL) {
|
||||
break;
|
||||
} else {
|
||||
if (!strcmp(pdirent->d_name, ".") || !strcmp(pdirent->d_name, "..")) {
|
||||
continue;
|
||||
}
|
||||
(void)memset_s(&stat_info, sizeof(struct stat), 0, sizeof(struct stat));
|
||||
fullpath = ls_get_fullpath(path, pdirent);
|
||||
if (fullpath == NULL) {
|
||||
free(path);
|
||||
(void)closedir(d);
|
||||
return;
|
||||
}
|
||||
|
||||
fullpath_bak = fullpath;
|
||||
|
||||
if (stat64(fullpath, &stat64_info) == 0) {
|
||||
PrintFileInfo64(&stat64_info, pdirent->d_name);
|
||||
} else if (stat(fullpath, &stat_info) == 0) {
|
||||
PrintFileInfo(&stat_info, pdirent->d_name);
|
||||
} else
|
||||
PRINTK("BAD file: %s\n", pdirent->d_name);
|
||||
free(fullpath_bak);
|
||||
}
|
||||
} while (1);
|
||||
|
||||
(void)closedir(d);
|
||||
free(path);
|
||||
return;
|
||||
}
|
||||
free(path);
|
||||
|
||||
if (statInfo.st_mode & S_IFDIR) { /* list all directory and file */
|
||||
ret = LsDir((pathname == NULL) ? path : pathname);
|
||||
} else { /* show the file infomation */
|
||||
ret = LsFile(path);
|
||||
}
|
||||
if (ret < 0) {
|
||||
perror("ls error");
|
||||
}
|
||||
|
||||
free(path);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -510,7 +510,6 @@ int OsSigSuspend(const sigset_t *set)
|
||||
{
|
||||
unsigned int intSave;
|
||||
LosTaskCB *rtcb = NULL;
|
||||
unsigned int sigTempProcMask;
|
||||
sigset_t setSuspend;
|
||||
int ret;
|
||||
|
||||
@@ -519,7 +518,6 @@ int OsSigSuspend(const sigset_t *set)
|
||||
}
|
||||
SCHEDULER_LOCK(intSave);
|
||||
rtcb = OsCurrTaskGet();
|
||||
sigTempProcMask = rtcb->sig.sigprocmask;
|
||||
|
||||
/* Wait signal calc */
|
||||
setSuspend = FULL_SIGNAL_SET & (~(*set));
|
||||
@@ -530,8 +528,6 @@ int OsSigSuspend(const sigset_t *set)
|
||||
if (ret < 0) {
|
||||
PRINT_ERR("FUNC %s LINE = %d, ret = %x\n", __FUNCTION__, __LINE__, ret);
|
||||
}
|
||||
/* Restore old sigprocmask */
|
||||
OsSigMaskSwitch(rtcb, sigTempProcMask);
|
||||
|
||||
SCHEDULER_UNLOCK(intSave);
|
||||
return -EINTR;
|
||||
|
||||
@@ -63,7 +63,7 @@ extern "C" {
|
||||
#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 ((50 * OS_SYS_NS_PER_US) / OS_NS_PER_CYCLE) /* 50us */
|
||||
#define OS_TIME_SLICE_MIN (INT32)((50 * OS_SYS_NS_PER_US) / OS_NS_PER_CYCLE) /* 50us */
|
||||
#define OS_SCHED_MAX_RESPONSE_TIME (UINT64)(OS_64BIT_MAX - 1U)
|
||||
|
||||
typedef struct {
|
||||
|
||||
@@ -1570,6 +1570,8 @@ int socks_close(int sockfd)
|
||||
SYS_ARCH_UNPROTECT(lev);
|
||||
done_socket(sock);
|
||||
return lwip_close(sockfd);
|
||||
} else {
|
||||
PRINTK("no close socket s_refcount = %d\n", sock->s_refcount);
|
||||
}
|
||||
|
||||
sock->s_refcount--;
|
||||
|
||||
@@ -5,7 +5,7 @@ config PLATFORM
|
||||
default "virt" if PLATFORM_QEMU_ARM_VIRT_CA7
|
||||
|
||||
config PRODUCT_NAME
|
||||
string
|
||||
string "unknown"
|
||||
default "ipcamera_hi3516dv300_liteos" if PRODUCT_IPCAMERA_HI3516DV300_LITEOS
|
||||
default "ipcamera_hi3518ev300_liteos" if PRODUCT_IPCAMERA_HI3518EV300_LITEOS
|
||||
default "hispark_taurus" if PRODUCT_HISPARK_TAURUS
|
||||
@@ -13,7 +13,7 @@ config PRODUCT_NAME
|
||||
default "arm_virt" if PRODUCT_QEMU_ARM
|
||||
|
||||
config DEVICE_COMPANY
|
||||
string
|
||||
string "unknown"
|
||||
default "hisilicon" if PLATFORM_HI3516DV300
|
||||
default "hisilicon" if PLATFORM_HI3518EV300
|
||||
default "qemu" if PLATFORM_QEMU_ARM_VIRT_CA7
|
||||
|
||||
Reference in New Issue
Block a user