Compare commits
22 Commits
master
...
OpenHarmon
Author | SHA1 | Date |
---|---|---|
|
6be4577b12 | |
|
91c538f27e | |
|
93b2acdbe4 | |
|
886c4f181d | |
|
ee95e95a2f | |
|
efd0e27784 | |
|
bc7ff8f15b | |
|
93989ae946 | |
|
d8a6768d94 | |
|
eb618aa22b | |
|
7fa0a51b96 | |
|
f60fdfecda | |
|
1c18d227cf | |
|
146c23f42f | |
|
c49b81895e | |
|
f60bc94cf2 | |
|
174db030a4 | |
|
d161a0b03d | |
|
ba727e2678 | |
|
a6ac7597f8 | |
|
cdcf600571 | |
|
1bb40f9848 |
1
BUILD.gn
1
BUILD.gn
|
@ -75,7 +75,6 @@ generate_notice_file("kernel_notice_file") {
|
||||||
"$LITEOSTHIRDPARTY/musl",
|
"$LITEOSTHIRDPARTY/musl",
|
||||||
"$LITEOSTHIRDPARTY/zlib",
|
"$LITEOSTHIRDPARTY/zlib",
|
||||||
"$LITEOSTHIRDPARTY/FatFs",
|
"$LITEOSTHIRDPARTY/FatFs",
|
||||||
"$LITEOSTHIRDPARTY/Linux_Kernel",
|
|
||||||
"$LITEOSTHIRDPARTY/lwip",
|
"$LITEOSTHIRDPARTY/lwip",
|
||||||
"$LITEOSTHIRDPARTY/NuttX",
|
"$LITEOSTHIRDPARTY/NuttX",
|
||||||
"$LITEOSTHIRDPARTY/mtd-utils",
|
"$LITEOSTHIRDPARTY/mtd-utils",
|
||||||
|
|
6
Kconfig
6
Kconfig
|
@ -189,7 +189,7 @@ config DEBUG_VERSION
|
||||||
It also means you do not want to use debug modules, like shell,telnet,tftp,nfs and
|
It also means you do not want to use debug modules, like shell,telnet,tftp,nfs and
|
||||||
memory check, etc.
|
memory check, etc.
|
||||||
If you select this option that means you enable a debug version for LiteOS.
|
If you select this option that means you enable a debug version for LiteOS.
|
||||||
That means you want a opposite behaviour compared to release version.
|
That means you want an opposite behaviour compared to release version.
|
||||||
|
|
||||||
config DEBUG_KERNEL
|
config DEBUG_KERNEL
|
||||||
bool "Enable Debug LiteOS Kernel Resource"
|
bool "Enable Debug LiteOS Kernel Resource"
|
||||||
|
@ -198,7 +198,7 @@ config DEBUG_KERNEL
|
||||||
help
|
help
|
||||||
If you select this option that means you enable debugging kernel resource.
|
If you select this option that means you enable debugging kernel resource.
|
||||||
It also means you want to get queue, mutex, semaphore, memory debug information.
|
It also means you want to get queue, mutex, semaphore, memory debug information.
|
||||||
That means you want a opposite behaviour compared to release version.
|
That means you want an opposite behaviour compared to release version.
|
||||||
|
|
||||||
config DEBUG_QUEUE
|
config DEBUG_QUEUE
|
||||||
bool "Enable Queue Debugging"
|
bool "Enable Queue Debugging"
|
||||||
|
@ -265,7 +265,7 @@ config MEM_LEAKCHECK
|
||||||
default n
|
default n
|
||||||
depends on DEBUG_VERSION && MEM_DEBUG
|
depends on DEBUG_VERSION && MEM_DEBUG
|
||||||
help
|
help
|
||||||
Answer Y to enable record the LR of Function call stack of Mem operation, it can check the mem leak through the infomations of mem node.
|
Answer Y to enable record the LR of Function call stack of Mem operation, it can check the mem leak through the informations of mem node.
|
||||||
config BASE_MEM_NODE_INTEGRITY_CHECK
|
config BASE_MEM_NODE_INTEGRITY_CHECK
|
||||||
bool "Enable integrity check or not"
|
bool "Enable integrity check or not"
|
||||||
default n
|
default n
|
||||||
|
|
2
Makefile
2
Makefile
|
@ -97,7 +97,7 @@ Targets:
|
||||||
cleanall: clean all build outputs
|
cleanall: clean all build outputs
|
||||||
all: make liteos kernel image and rootfs image (Default target)
|
all: make liteos kernel image and rootfs image (Default target)
|
||||||
$(APPS): build all apps
|
$(APPS): build all apps
|
||||||
$(ROOTFS): make a original rootfs image
|
$(ROOTFS): make an original rootfs image
|
||||||
$(LITEOS_LIBS_TARGET): compile all kernel modules (libraries)
|
$(LITEOS_LIBS_TARGET): compile all kernel modules (libraries)
|
||||||
$(LITEOS_TARGET): make liteos kernel image
|
$(LITEOS_TARGET): make liteos kernel image
|
||||||
update_config: update product kernel config (use menuconfig)
|
update_config: update product kernel config (use menuconfig)
|
||||||
|
|
3
OAT.xml
3
OAT.xml
|
@ -12,9 +12,10 @@
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
See the License for the specific language governing permissions and
|
See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
|
-->
|
||||||
|
|
||||||
|
<!--
|
||||||
This is the configuration file template for OpenHarmony OSS Audit Tool, please copy it to your project root dir and modify it refer to OpenHarmony/tools_oat/README.
|
This is the configuration file template for OpenHarmony OSS Audit Tool, please copy it to your project root dir and modify it refer to OpenHarmony/tools_oat/README.
|
||||||
|
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<configuration>
|
<configuration>
|
||||||
|
|
17
README.md
17
README.md
|
@ -62,20 +62,19 @@ The OpenHarmony LiteOS Cortex-A is a new-generation kernel developed based on th
|
||||||
## Constraints<a name="section119744591305"></a>
|
## Constraints<a name="section119744591305"></a>
|
||||||
|
|
||||||
- Programming languages: C and C++
|
- Programming languages: C and C++
|
||||||
- Applicable development boards: Hi3518E V300 and Hi3516D V300
|
- Applicable development boards: Hi3516D V300
|
||||||
- Hi3518E V300 uses the JFFS2 file system by default, and Hi3516D V300 uses the FAT file system by default.
|
- Hi3516D V300 uses the FAT file system by default.
|
||||||
|
|
||||||
## Usage<a name="section741617511812"></a>
|
## Usage<a name="section741617511812"></a>
|
||||||
|
|
||||||
OpenHarmony LiteOS Cortex-A supports the [Hi3518E V300](https://gitee.com/openharmony/docs/blob/master/en/device-dev/quick-start/quickstart-lite-introduction-hi3518.md) and [Hi3516D V300](https://gitee.com/openharmony/docs/blob/master/en/device-dev/quick-start/quickstart-lite-introduction-hi3516.md). You can develop and run your applications based on both development boards.
|
OpenHarmony LiteOS Cortex-A supports the [Hi3516D V300](https://gitee.com/openharmony/docs/blob/master/en/device-dev/quick-start/quickstart-lite-introduction-hi3516.md). You can develop and run your applications based on this development board.
|
||||||
|
|
||||||
### Preparations<a name="section1579912573329"></a>
|
### Preparations<a name="section1579912573329"></a>
|
||||||
|
|
||||||
You need to set up the compilation environment on Linux.
|
You need to set up the compilation environment on Linux.
|
||||||
|
|
||||||
- [Compilation environment on Linux](https://gitee.com/openharmony/docs/blob/master/en/device-dev/quick-start/quickstart-lite-env-setup-lin.md)
|
- [Setting Up Ubuntu Development Environment](https://gitee.com/openharmony/docs/blob/master/en/device-dev/quick-start/quickstart-lite-env-setup.md)
|
||||||
- For Hi3518E V300, see [Setting Up the Hi3518 Development Environment](https://gitee.com/openharmony/docs/blob/master/en/device-dev/quick-start/quickstart-lite-steps-board3518-setting.md).
|
- For Hi3516D V300, see [Setting Up the Hi3516 Development Environment](https://gitee.com/openharmony/docs/blob/master/en/device-dev/quick-start/quickstart-lite-steps-hi3516-setting.md).
|
||||||
- For Hi3516D V300, see [Setting Up the Hi3516 Development Environment](https://gitee.com/openharmony/docs/blob/master/en/device-dev/quick-start/quickstart-lite-steps-board3516-setting.md).
|
|
||||||
|
|
||||||
### Source Code Acquisition<a name="section11443189655"></a>
|
### Source Code Acquisition<a name="section11443189655"></a>
|
||||||
|
|
||||||
|
@ -85,9 +84,7 @@ Download and decompress a set of source code on a Linux server to acquire the [
|
||||||
|
|
||||||
For details about how to develop the first application, see:
|
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/en/device-dev/quick-start/quickstart-lite-steps-board3518-running.md)
|
- [Developing the First Example Program Running on Hi3516](https://gitee.com/openharmony/docs/blob/master/en/device-dev/quick-start/quickstart-lite-steps-hi3516-running.md)
|
||||||
|
|
||||||
- [Developing the First Example Program Running on Hi3516](https://gitee.com/openharmony/docs/blob/master/en/device-dev/quick-start/quickstart-lite-steps-board3516-running.md)
|
|
||||||
|
|
||||||
## Repositories Involved<a name="section1371113476307"></a>
|
## Repositories Involved<a name="section1371113476307"></a>
|
||||||
|
|
||||||
|
@ -95,5 +92,5 @@ For details about how to develop the first application, see:
|
||||||
|
|
||||||
[drivers\_liteos](https://gitee.com/openharmony/drivers_liteos/blob/master/README.md)
|
[drivers\_liteos](https://gitee.com/openharmony/drivers_liteos/blob/master/README.md)
|
||||||
|
|
||||||
**kernel\_liteos\_a**
|
[kernel\_liteos\_a](https://gitee.com/openharmony/kernel_liteos_a/blob/master/README.md)
|
||||||
|
|
||||||
|
|
|
@ -62,19 +62,18 @@ OpenHarmony LiteOS-A內核是基於Huawei LiteOS內核演進發展的新一代
|
||||||
## 約束<a name="section119744591305"></a>
|
## 約束<a name="section119744591305"></a>
|
||||||
|
|
||||||
- 開發語言:C/C++;
|
- 開發語言:C/C++;
|
||||||
- 適用於Hi3518EV300、Hi3516DV300單板;
|
- 適用於Hi3516DV300單板;
|
||||||
- Hi3518EV300默認使用jffs2文件系統,Hi3516DV300默認使用FAT文件系統。
|
- Hi3516DV300默認使用FAT文件系統。
|
||||||
|
|
||||||
## 使用說明<a name="section741617511812"></a>
|
## 使用說明<a name="section741617511812"></a>
|
||||||
|
|
||||||
OpenHarmony LiteOS-A內核支持Hi3518EV300([介紹](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-lite-introduction-hi3518.md))、Hi3516DV300([介紹](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-lite-introduction-hi3516.md))單板,開發者可基於兩種單板開發運行自己的應用程序。
|
OpenHarmony LiteOS-A內核支持Hi3516DV300([介紹](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-lite-introduction-hi3516.md))單板,開發者可基於此單板開發運行自己的應用程序。
|
||||||
|
|
||||||
### 準備<a name="section1579912573329"></a>
|
### 準備<a name="section1579912573329"></a>
|
||||||
|
|
||||||
開發者需要在Linux上搭建編譯環境:
|
開發者需要在Linux上搭建編譯環境:
|
||||||
|
|
||||||
- [Ubuntu編譯環境凖備](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-lite-env-setup.md);
|
- [編譯環境凖備](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-lite-env-setup.md);
|
||||||
- Hi3518EV300單板:參考[環境搭建](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-lite-steps-hi3518-setting.md);
|
|
||||||
- Hi3516DV300單板:參考[環境搭建](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-lite-steps-hi3516-setting.md)。
|
- Hi3516DV300單板:參考[環境搭建](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-lite-steps-hi3516-setting.md)。
|
||||||
|
|
||||||
### 獲取源碼<a name="section11443189655"></a>
|
### 獲取源碼<a name="section11443189655"></a>
|
||||||
|
@ -85,8 +84,6 @@ OpenHarmony LiteOS-A內核支持Hi3518EV300([介紹](https://gitee.com/openhar
|
||||||
|
|
||||||
開發者開發第一個應用程序可參考:
|
開發者開發第一個應用程序可參考:
|
||||||
|
|
||||||
- [helloworld for Hi3518EV300](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-lite-steps-hi3518-running.md);
|
|
||||||
|
|
||||||
- [helloworld for Hi3516DV300](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-lite-steps-hi3516-running.md)。
|
- [helloworld for Hi3516DV300](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-lite-steps-hi3516-running.md)。
|
||||||
|
|
||||||
## 相關倉<a name="section1371113476307"></a>
|
## 相關倉<a name="section1371113476307"></a>
|
||||||
|
@ -95,4 +92,4 @@ OpenHarmony LiteOS-A內核支持Hi3518EV300([介紹](https://gitee.com/openhar
|
||||||
|
|
||||||
[drivers\_liteos](https://gitee.com/openharmony/drivers_liteos/blob/master/README_zh.md)
|
[drivers\_liteos](https://gitee.com/openharmony/drivers_liteos/blob/master/README_zh.md)
|
||||||
|
|
||||||
**kernel\_liteos\_a**
|
[kernel\_liteos\_a](https://gitee.com/openharmony/kernel_liteos_a/blob/master/README_zh-HK.md)
|
||||||
|
|
13
README_zh.md
13
README_zh.md
|
@ -61,19 +61,18 @@ OpenHarmony LiteOS-A内核是基于Huawei LiteOS内核演进发展的新一代
|
||||||
## 约束<a name="section119744591305"></a>
|
## 约束<a name="section119744591305"></a>
|
||||||
|
|
||||||
- 开发语言:C/C++;
|
- 开发语言:C/C++;
|
||||||
- 适用于Hi3518EV300、Hi3516DV300单板;
|
- 适用于Hi3516DV300单板;
|
||||||
- Hi3518EV300默认使用jffs2文件系统,Hi3516DV300默认使用FAT文件系统。
|
- Hi3516DV300默认使用FAT文件系统。
|
||||||
|
|
||||||
## 使用说明<a name="section741617511812"></a>
|
## 使用说明<a name="section741617511812"></a>
|
||||||
|
|
||||||
OpenHarmony LiteOS-A内核支持Hi3518EV300([介绍](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-lite-introduction-hi3518.md))、Hi3516DV300([介绍](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-lite-introduction-hi3516.md))单板,开发者可基于两种单板开发运行自己的应用程序。
|
OpenHarmony LiteOS-A内核支持[Hi3516DV300](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-lite-introduction-hi3516.md)单板。开发者可基于此单板开发运行自己的应用程序。
|
||||||
|
|
||||||
### 准备<a name="section1579912573329"></a>
|
### 准备<a name="section1579912573329"></a>
|
||||||
|
|
||||||
开发者需要在Linux上搭建编译环境:
|
开发者需要在Linux上搭建编译环境:
|
||||||
|
|
||||||
- [Ubuntu编译环境准备](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-lite-env-setup.md);
|
- [编译环境准备](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-lite-env-setup.md);
|
||||||
- Hi3518EV300单板:参考[环境搭建](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-lite-steps-hi3518-setting.md);
|
|
||||||
- Hi3516DV300单板:参考[环境搭建](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-lite-steps-hi3516-setting.md)。
|
- Hi3516DV300单板:参考[环境搭建](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-lite-steps-hi3516-setting.md)。
|
||||||
|
|
||||||
### 获取源码<a name="section11443189655"></a>
|
### 获取源码<a name="section11443189655"></a>
|
||||||
|
@ -84,8 +83,6 @@ OpenHarmony LiteOS-A内核支持Hi3518EV300([介绍](https://gitee.com/openhar
|
||||||
|
|
||||||
开发者开发第一个应用程序可参考:
|
开发者开发第一个应用程序可参考:
|
||||||
|
|
||||||
- [helloworld for Hi3518EV300](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-lite-steps-hi3518-running.md);
|
|
||||||
|
|
||||||
- [helloworld for Hi3516DV300](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-lite-steps-hi3516-running.md)。
|
- [helloworld for Hi3516DV300](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-lite-steps-hi3516-running.md)。
|
||||||
|
|
||||||
## 相关仓<a name="section1371113476307"></a>
|
## 相关仓<a name="section1371113476307"></a>
|
||||||
|
@ -94,5 +91,5 @@ OpenHarmony LiteOS-A内核支持Hi3518EV300([介绍](https://gitee.com/openhar
|
||||||
|
|
||||||
[drivers\_liteos](https://gitee.com/openharmony/drivers_liteos/blob/master/README_zh.md)
|
[drivers\_liteos](https://gitee.com/openharmony/drivers_liteos/blob/master/README_zh.md)
|
||||||
|
|
||||||
**kernel\_liteos\_a**
|
[kernel\_liteos\_a](https://gitee.com/openharmony/kernel_liteos_a/blob/master/README_zh.md)
|
||||||
|
|
||||||
|
|
|
@ -48,6 +48,7 @@
|
||||||
#endif
|
#endif
|
||||||
int main(int argc, char * const *argv)
|
int main(int argc, char * const *argv)
|
||||||
{
|
{
|
||||||
|
(void)argv;
|
||||||
int ret;
|
int ret;
|
||||||
pid_t gid;
|
pid_t gid;
|
||||||
const char *shellPath = "/bin/mksh";
|
const char *shellPath = "/bin/mksh";
|
||||||
|
|
|
@ -50,14 +50,16 @@ static void BufReadTest(void *buf, int start, int end)
|
||||||
|
|
||||||
static void LmsMallocTest(void)
|
static void LmsMallocTest(void)
|
||||||
{
|
{
|
||||||
|
#define TEST_SIZE 16
|
||||||
printf("\n-------- LmsMallocTest Start --------\n");
|
printf("\n-------- LmsMallocTest Start --------\n");
|
||||||
char *buf = (char *)malloc(16);
|
char *buf = (char *)malloc(TEST_SIZE);
|
||||||
printf("[LmsMallocTest] malloc addr:%p size:%d\n", buf, 16);
|
if (buf == NULL) {
|
||||||
|
return;
|
||||||
printf("[LmsMallocTest] read overflow & underflow error should be triggered, read range[-1,16]\n");
|
}
|
||||||
BufReadTest(buf, -1, 16);
|
printf("[LmsMallocTest] read overflow & underflow error should be triggered, read range[-1, TEST_SIZE]\n");
|
||||||
printf("[LmsMallocTest] write overflow error should be triggered, write range[0,16]\n");
|
BufReadTest(buf, -1, TEST_SIZE);
|
||||||
BufWriteTest(buf, 0, 16);
|
printf("[LmsMallocTest] write overflow error should be triggered, write range[0, TEST_SIZE]\n");
|
||||||
|
BufWriteTest(buf, 0, TEST_SIZE);
|
||||||
|
|
||||||
free(buf);
|
free(buf);
|
||||||
printf("\n-------- LmsMallocTest End --------\n");
|
printf("\n-------- LmsMallocTest End --------\n");
|
||||||
|
@ -65,46 +67,61 @@ static void LmsMallocTest(void)
|
||||||
|
|
||||||
static void LmsReallocTest(void)
|
static void LmsReallocTest(void)
|
||||||
{
|
{
|
||||||
|
#define TEST_SIZE 64
|
||||||
|
#define TEST_SIZE_MIN 32
|
||||||
printf("\n-------- LmsReallocTest Start --------\n");
|
printf("\n-------- LmsReallocTest Start --------\n");
|
||||||
char *buf = (char *)malloc(64);
|
char *buf = (char *)malloc(TEST_SIZE);
|
||||||
printf("[LmsReallocTest] malloc addr:%p size:%d\n", buf, 64);
|
printf("[LmsReallocTest] read overflow & underflow error should be triggered, read range[-1, TEST_SIZE]\n");
|
||||||
printf("[LmsReallocTest] read overflow & underflow error should be triggered, read range[-1,64]\n");
|
BufReadTest(buf, -1, TEST_SIZE);
|
||||||
BufReadTest(buf, -1, 64);
|
char *buf1 = (char *)realloc(buf, TEST_SIZE_MIN);
|
||||||
buf = (char *)realloc(buf, 32);
|
if (buf1 == NULL) {
|
||||||
printf("[LmsReallocTest] realloc addr:%p size:%d\n", buf, 32);
|
|
||||||
printf("[LmsReallocTest] read overflow & underflow error should be triggered, read range[-1,32]\n");
|
|
||||||
BufReadTest(buf, -1, 32);
|
|
||||||
free(buf);
|
free(buf);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
buf = NULL;
|
||||||
|
printf("[LmsReallocTest] read overflow & underflow error should be triggered, read range[-1, TEST_SIZE_MIN]\n");
|
||||||
|
BufReadTest(buf1, -1, TEST_SIZE_MIN);
|
||||||
|
free(buf1);
|
||||||
printf("\n-------- LmsReallocTest End --------\n");
|
printf("\n-------- LmsReallocTest End --------\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void LmsCallocTest(void)
|
static void LmsCallocTest(void)
|
||||||
{
|
{
|
||||||
|
#define TEST_SIZE 16
|
||||||
printf("\n-------- LmsCallocTest Start --------\n");
|
printf("\n-------- LmsCallocTest Start --------\n");
|
||||||
char *buf = (char *)calloc(4, 4);
|
char *buf = (char *)calloc(4, 4); /* 4: test size */
|
||||||
printf("[LmsCallocTest] calloc addr:%p size:%d\n", buf, 16);
|
if (buf == NULL) {
|
||||||
printf("[LmsCallocTest] read overflow & underflow error should be triggered, read range[-1,16]\n");
|
return;
|
||||||
BufReadTest(buf, -1, 16);
|
}
|
||||||
|
printf("[LmsCallocTest] read overflow & underflow error should be triggered, read range[-1, TEST_SIZE]\n");
|
||||||
|
BufReadTest(buf, -1, TEST_SIZE);
|
||||||
free(buf);
|
free(buf);
|
||||||
printf("\n-------- LmsCallocTest End --------\n");
|
printf("\n-------- LmsCallocTest End --------\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void LmsVallocTest(void)
|
static void LmsVallocTest(void)
|
||||||
{
|
{
|
||||||
|
#define TEST_SIZE 4096
|
||||||
printf("\n-------- LmsVallocTest Start --------\n");
|
printf("\n-------- LmsVallocTest Start --------\n");
|
||||||
char *buf = (char *)valloc(4096);
|
char *buf = (char *)valloc(TEST_SIZE);
|
||||||
printf("[LmsVallocTest] valloc addr:%p size:%d\n", buf, 4096);
|
if (buf == NULL) {
|
||||||
printf("[LmsVallocTest] read overflow & underflow error should be triggered, read range[-1,4096]\n");
|
return;
|
||||||
BufReadTest(buf, -1, 4096);
|
}
|
||||||
|
printf("[LmsVallocTest] read overflow & underflow error should be triggered, read range[-1, TEST_SIZE]\n");
|
||||||
|
BufReadTest(buf, -1, TEST_SIZE);
|
||||||
free(buf);
|
free(buf);
|
||||||
printf("\n-------- LmsVallocTest End --------\n");
|
printf("\n-------- LmsVallocTest End --------\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void LmsAlignedAllocTest(void)
|
static void LmsAlignedAllocTest(void)
|
||||||
{
|
{
|
||||||
|
#define TEST_ALIGN_SIZE 64
|
||||||
|
#define TEST_SIZE 128
|
||||||
printf("\n-------- LmsAlignedAllocTest Start --------\n");
|
printf("\n-------- LmsAlignedAllocTest Start --------\n");
|
||||||
char *buf = (char *)aligned_alloc(64, 128);
|
char *buf = (char *)aligned_alloc(TEST_ALIGN_SIZE, TEST_SIZE);
|
||||||
printf("[LmsAlignedAllocTest] aligned_alloc boundsize:%d addr:%p size:%d\n", 64, buf, 128);
|
if (buf == NULL) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
printf("[LmsAlignedAllocTest] read overflow & underflow error should be triggered, read range[-1,128]\n");
|
printf("[LmsAlignedAllocTest] read overflow & underflow error should be triggered, read range[-1,128]\n");
|
||||||
BufReadTest(buf, -1, 128);
|
BufReadTest(buf, -1, 128);
|
||||||
free(buf);
|
free(buf);
|
||||||
|
@ -113,44 +130,55 @@ static void LmsAlignedAllocTest(void)
|
||||||
|
|
||||||
static void LmsMemsetTest(void)
|
static void LmsMemsetTest(void)
|
||||||
{
|
{
|
||||||
|
#define TEST_SIZE 32
|
||||||
printf("\n-------- LmsMemsetTest Start --------\n");
|
printf("\n-------- LmsMemsetTest Start --------\n");
|
||||||
char *buf = (char *)malloc(32);
|
char *buf = (char *)malloc(TEST_SIZE);
|
||||||
printf("[LmsMemsetTest] malloc addr:%p size:%d\n", buf, 32);
|
if (buf == NULL) {
|
||||||
printf("[LmsMemsetTest] memset overflow & underflow error should be triggered, memset size:%d\n", 33);
|
return;
|
||||||
memset(buf, 0, 33);
|
}
|
||||||
|
printf("[LmsMemsetTest] memset overflow & underflow error should be triggered, memset size:%d\n", TEST_SIZE + 1);
|
||||||
|
memset(buf, 0, TEST_SIZE + 1);
|
||||||
free(buf);
|
free(buf);
|
||||||
printf("\n-------- LmsMemsetTest End --------\n");
|
printf("\n-------- LmsMemsetTest End --------\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void LmsMemcpyTest(void)
|
static void LmsMemcpyTest(void)
|
||||||
{
|
{
|
||||||
|
#define TEST_SIZE 20
|
||||||
printf("\n-------- LmsMemcpyTest Start --------\n");
|
printf("\n-------- LmsMemcpyTest Start --------\n");
|
||||||
char *buf = (char *)malloc(20);
|
char *buf = (char *)malloc(TEST_SIZE);
|
||||||
printf("[LmsMemcpyTest] malloc addr:%p size:%d\n", buf, 20);
|
if (buf == NULL) {
|
||||||
char localBuf[32] = {0};
|
return;
|
||||||
printf("[LmsMemcpyTest] memcpy overflow error should be triggered, memcpy size:%d\n", 21);
|
}
|
||||||
memcpy(buf, localBuf, 21);
|
char localBuf[32] = {0}; /* 32: test size */
|
||||||
|
printf("[LmsMemcpyTest] memcpy overflow error should be triggered, memcpy size:%d\n", TEST_SIZE + 1);
|
||||||
|
memcpy(buf, localBuf, TEST_SIZE + 1);
|
||||||
free(buf);
|
free(buf);
|
||||||
printf("\n-------- LmsMemcpyTest End --------\n");
|
printf("\n-------- LmsMemcpyTest End --------\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void LmsMemmoveTest(void)
|
static void LmsMemmoveTest(void)
|
||||||
{
|
{
|
||||||
|
#define TEST_SIZE 20
|
||||||
printf("\n-------- LmsMemmoveTest Start --------\n");
|
printf("\n-------- LmsMemmoveTest Start --------\n");
|
||||||
char *buf = (char *)malloc(20);
|
char *buf = (char *)malloc(TEST_SIZE);
|
||||||
printf("[LmsMemmoveTest] malloc addr:%p size:%d\n", buf, 20);
|
if (buf == NULL) {
|
||||||
printf("[LmsMemmoveTest] memmove overflow error should be triggered, dest addr:%p src addr:%p size:%d\n", buf + 12,
|
return;
|
||||||
buf, 10);
|
}
|
||||||
memmove(buf + 12, buf, 10);
|
printf("[LmsMemmoveTest] memmove overflow error should be triggered\n");
|
||||||
|
memmove(buf + 12, buf, 10); /* 12 and 10: test size */
|
||||||
free(buf);
|
free(buf);
|
||||||
printf("\n-------- LmsMemmoveTest End --------\n");
|
printf("\n-------- LmsMemmoveTest End --------\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void LmsStrcpyTest(void)
|
static void LmsStrcpyTest(void)
|
||||||
{
|
{
|
||||||
|
#define TEST_SIZE 16
|
||||||
printf("\n-------- LmsStrcpyTest Start --------\n");
|
printf("\n-------- LmsStrcpyTest Start --------\n");
|
||||||
char *buf = (char *)malloc(16);
|
char *buf = (char *)malloc(TEST_SIZE);
|
||||||
printf("[LmsStrcpyTest] malloc addr:%p size:%d\n", buf, 16);
|
if (buf == NULL) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
char *testStr = "bbbbbbbbbbbbbbbbb";
|
char *testStr = "bbbbbbbbbbbbbbbbb";
|
||||||
printf("[LmsStrcpyTest] strcpy overflow error should be triggered, src string buf size:%d\n", strlen(testStr) + 1);
|
printf("[LmsStrcpyTest] strcpy overflow error should be triggered, src string buf size:%d\n", strlen(testStr) + 1);
|
||||||
strcpy(buf, testStr);
|
strcpy(buf, testStr);
|
||||||
|
@ -160,9 +188,12 @@ static void LmsStrcpyTest(void)
|
||||||
|
|
||||||
static void LmsStrcatTest(void)
|
static void LmsStrcatTest(void)
|
||||||
{
|
{
|
||||||
|
#define TEST_SIZE 16
|
||||||
printf("\n-------- LmsStrcatTest Start --------\n");
|
printf("\n-------- LmsStrcatTest Start --------\n");
|
||||||
char *buf = (char *)malloc(16);
|
char *buf = (char *)malloc(TEST_SIZE);
|
||||||
printf("[LmsStrcatTest] malloc addr:%p size:%d\n", buf, 16);
|
if (buf == NULL) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
buf[0] = 'a';
|
buf[0] = 'a';
|
||||||
buf[1] = 'b';
|
buf[1] = 'b';
|
||||||
buf[2] = 0;
|
buf[2] = 0;
|
||||||
|
@ -177,22 +208,30 @@ static void LmsStrcatTest(void)
|
||||||
|
|
||||||
static void LmsFreeTest(void)
|
static void LmsFreeTest(void)
|
||||||
{
|
{
|
||||||
|
#define TEST_SIZE 16
|
||||||
printf("\n-------- LmsFreeTest Start --------\n");
|
printf("\n-------- LmsFreeTest Start --------\n");
|
||||||
char *buf = (char *)malloc(16);
|
char *buf = (char *)malloc(TEST_SIZE);
|
||||||
printf("[LmsFreeTest] malloc addr:%p size:%d\n", buf, 16);
|
if (buf == NULL) {
|
||||||
printf("[LmsFreeTest] free addr:%p\n", buf, 16);
|
return;
|
||||||
|
}
|
||||||
|
printf("[LmsFreeTest] free size:%d\n", TEST_SIZE);
|
||||||
free(buf);
|
free(buf);
|
||||||
printf("[LmsFreeTest] Use after free error should be triggered, read addr:%p range[1,1]\n", buf);
|
printf("[LmsFreeTest] Use after free error should be triggered, read range[1,1]\n");
|
||||||
BufReadTest(buf, 1, 1);
|
BufReadTest(buf, 1, 1);
|
||||||
printf("[LmsFreeTest] double free error should be triggered, free addr:%p\n", buf);
|
printf("[LmsFreeTest] double free error should be triggered\n");
|
||||||
free(buf);
|
free(buf);
|
||||||
printf("\n-------- LmsFreeTest End --------\n");
|
printf("\n-------- LmsFreeTest End --------\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char * const *argv)
|
int main(int argc, char * const *argv)
|
||||||
{
|
{
|
||||||
|
(void)argc;
|
||||||
|
(void)argv;
|
||||||
printf("\n############### Lms Test start ###############\n");
|
printf("\n############### Lms Test start ###############\n");
|
||||||
char *tmp = (char *)malloc(5000);
|
char *tmp = (char *)malloc(5000); /* 5000: test mem size */
|
||||||
|
if (tmp == NULL) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
LmsMallocTest();
|
LmsMallocTest();
|
||||||
LmsReallocTest();
|
LmsReallocTest();
|
||||||
LmsCallocTest();
|
LmsCallocTest();
|
||||||
|
@ -204,5 +243,6 @@ int main(int argc, char * const * argv)
|
||||||
LmsStrcpyTest();
|
LmsStrcpyTest();
|
||||||
LmsStrcatTest();
|
LmsStrcatTest();
|
||||||
LmsFreeTest();
|
LmsFreeTest();
|
||||||
|
free(tmp);
|
||||||
printf("\n############### Lms Test End ###############\n");
|
printf("\n############### Lms Test End ###############\n");
|
||||||
}
|
}
|
|
@ -62,10 +62,17 @@ int main(int argc, char **argv)
|
||||||
PerfStop(fd);
|
PerfStop(fd);
|
||||||
} else if ((argc == THREE_ARGS) && strcmp(argv[1], "read") == 0) {
|
} else if ((argc == THREE_ARGS) && strcmp(argv[1], "read") == 0) {
|
||||||
size_t size = strtoul(argv[THREE_ARGS - 1], NULL, 0);
|
size_t size = strtoul(argv[THREE_ARGS - 1], NULL, 0);
|
||||||
|
if (size <= 0) {
|
||||||
|
goto EXIT:
|
||||||
|
}
|
||||||
|
|
||||||
char *buf = (char *)malloc(size);
|
char *buf = (char *)malloc(size);
|
||||||
|
if (buf != NULL) {
|
||||||
int len = PerfRead(fd, buf, size);
|
int len = PerfRead(fd, buf, size);
|
||||||
PerfPrintBuffer(buf, len);
|
PerfPrintBuffer(buf, len);
|
||||||
free(buf);
|
free(buf);
|
||||||
|
buf = NULL;
|
||||||
|
}
|
||||||
} else if ((argc == TWO_ARGS) && strcmp(argv[1], "list") == 0) {
|
} else if ((argc == TWO_ARGS) && strcmp(argv[1], "list") == 0) {
|
||||||
PerfList();
|
PerfList();
|
||||||
} else if ((argc >= THREE_ARGS) && strcmp(argv[1], "stat") == 0) {
|
} else if ((argc >= THREE_ARGS) && strcmp(argv[1], "stat") == 0) {
|
||||||
|
@ -77,6 +84,7 @@ int main(int argc, char **argv)
|
||||||
PerfUsage();
|
PerfUsage();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EXIT:
|
||||||
close(fd);
|
close(fd);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -113,7 +113,6 @@ ssize_t PerfWriteFile(const char *filePath, const char *buf, ssize_t bufSize)
|
||||||
ssize_t totalWrite = 0;
|
ssize_t totalWrite = 0;
|
||||||
|
|
||||||
if (filePath == NULL || buf == NULL || bufSize == 0) {
|
if (filePath == NULL || buf == NULL || bufSize == 0) {
|
||||||
printf("filePath: %p, buf: %p, bufSize: %u!\n", filePath, buf, bufSize);
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -108,11 +108,15 @@ static int DoShellExec(char **argv)
|
||||||
if (!cmdLine) {
|
if (!cmdLine) {
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
memset_s(cmdLine, len, 0, len);
|
errno_t ret1 = memset_s(cmdLine, len, 0, len);
|
||||||
|
if (ret1 != EOK) {
|
||||||
|
free(cmdLine);
|
||||||
|
return ret1;
|
||||||
|
}
|
||||||
|
|
||||||
for (j = 0; j < i; j++) {
|
for (j = 0; j < i; j++) {
|
||||||
strcat_s(cmdLine, len, argv[j]);
|
(void)strcat_s(cmdLine, len, argv[j]);
|
||||||
strcat_s(cmdLine, len, " ");
|
(void)strcat_s(cmdLine, len, " ");
|
||||||
}
|
}
|
||||||
|
|
||||||
cmdLine[len - 2] = '\0'; /* 2, (len - 2) is the end of cmdline buf */
|
cmdLine[len - 2] = '\0'; /* 2, (len - 2) is the end of cmdline buf */
|
||||||
|
|
|
@ -36,7 +36,6 @@
|
||||||
#include "dirent.h"
|
#include "dirent.h"
|
||||||
#include "securec.h"
|
#include "securec.h"
|
||||||
|
|
||||||
|
|
||||||
#define SHELL_INIT_MAGIC_FLAG 0xABABABAB
|
#define SHELL_INIT_MAGIC_FLAG 0xABABABAB
|
||||||
#define CTRL_C 0x03 /* 0x03: ctrl+c ASCII */
|
#define CTRL_C 0x03 /* 0x03: ctrl+c ASCII */
|
||||||
|
|
||||||
|
@ -378,7 +377,7 @@ static int OsTabMatchFile(char *cmdKey, unsigned int *len)
|
||||||
* Description: Pass in the string and clear useless space ,which include:
|
* Description: Pass in the string and clear useless space ,which include:
|
||||||
* 1) The overmatch space which is not be marked by Quote's area
|
* 1) The overmatch space which is not be marked by Quote's area
|
||||||
* Squeeze the overmatch space into one space
|
* Squeeze the overmatch space into one space
|
||||||
* 2) Clear all space before first valid charatctor
|
* 2) Clear all space before first valid character
|
||||||
* Input: cmdKey : Pass in the buff string, which is ready to be operated
|
* Input: cmdKey : Pass in the buff string, which is ready to be operated
|
||||||
* cmdOut : Pass out the buffer string ,which has already been operated
|
* cmdOut : Pass out the buffer string ,which has already been operated
|
||||||
* size : cmdKey length
|
* size : cmdKey length
|
||||||
|
@ -407,17 +406,17 @@ unsigned int OsCmdKeyShift(const char *cmdKey, char *cmdOut, unsigned int size)
|
||||||
|
|
||||||
/* Backup the 'output' start address */
|
/* Backup the 'output' start address */
|
||||||
outputBak = output;
|
outputBak = output;
|
||||||
/* Scan each charactor in 'cmdKey',and squeeze the overmuch space and ignore invalid charactor */
|
/* Scan each character in 'cmdKey',and squeeze the overmuch space and ignore invalid character */
|
||||||
for (; *cmdKey != '\0'; cmdKey++) {
|
for (; *cmdKey != '\0'; cmdKey++) {
|
||||||
/* Detected a Double Quotes, switch the matching status */
|
/* Detected a Double Quotes, switch the matching status */
|
||||||
if (*(cmdKey) == '\"') {
|
if (*(cmdKey) == '\"') {
|
||||||
SWITCH_QUOTES_STATUS(quotes);
|
SWITCH_QUOTES_STATUS(quotes);
|
||||||
}
|
}
|
||||||
/* Ignore the current charactor in following situation */
|
/* Ignore the current character in following situation */
|
||||||
/* 1) Quotes matching status is FALSE (which said that the space is not been marked by double quotes) */
|
/* 1) Quotes matching status is FALSE (which said that the space is not been marked by double quotes) */
|
||||||
/* 2) Current charactor is a space */
|
/* 2) Current character is a space */
|
||||||
/* 3) Next charactor is a space too, or the string is been seeked to the end already(\0) */
|
/* 3) Next character is a space too, or the string is been seeked to the end already(\0) */
|
||||||
/* 4) Invalid charactor, such as single quotes */
|
/* 4) Invalid character, such as single quotes */
|
||||||
if ((*cmdKey == ' ') && ((*(cmdKey + 1) == ' ') || (*(cmdKey + 1) == '\0')) && QUOTES_STATUS_CLOSE(quotes)) {
|
if ((*cmdKey == ' ') && ((*(cmdKey + 1) == ' ') || (*(cmdKey + 1) == '\0')) && QUOTES_STATUS_CLOSE(quotes)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -431,7 +430,7 @@ unsigned int OsCmdKeyShift(const char *cmdKey, char *cmdOut, unsigned int size)
|
||||||
/* Restore the 'output' start address */
|
/* Restore the 'output' start address */
|
||||||
output = outputBak;
|
output = outputBak;
|
||||||
len = strlen(output);
|
len = strlen(output);
|
||||||
/* Clear the space which is located at the first charactor in buffer */
|
/* Clear the space which is located at the first character in buffer */
|
||||||
if (*output == ' ') {
|
if (*output == ' ') {
|
||||||
output++;
|
output++;
|
||||||
len--;
|
len--;
|
||||||
|
@ -585,7 +584,6 @@ END:
|
||||||
|
|
||||||
unsigned int OsCmdExec(CmdParsed *cmdParsed, char *cmdStr)
|
unsigned int OsCmdExec(CmdParsed *cmdParsed, char *cmdStr)
|
||||||
{
|
{
|
||||||
/* TODO: complete the usrspace command */
|
|
||||||
unsigned int ret = SH_OK;
|
unsigned int ret = SH_OK;
|
||||||
if (cmdParsed && cmdStr) {
|
if (cmdParsed && cmdStr) {
|
||||||
ret = SH_NOK;
|
ret = SH_NOK;
|
||||||
|
|
|
@ -334,12 +334,12 @@ char *GetCmdName(const char *cmdline, unsigned int len)
|
||||||
/* If reach a double quotes, switch the quotes matching status */
|
/* If reach a double quotes, switch the quotes matching status */
|
||||||
if (*tmpStr == '\"') {
|
if (*tmpStr == '\"') {
|
||||||
SWITCH_QUOTES_STATUS(quotes);
|
SWITCH_QUOTES_STATUS(quotes);
|
||||||
/* Ignore the double quote charactor itself */
|
/* Ignore the double quote character itself */
|
||||||
tmpStr++;
|
tmpStr++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
/* If detected a space which the quotes matching status is false */
|
/* If detected a space which the quotes matching status is false */
|
||||||
/* which said has detected the first space for seperator, finish this scan operation */
|
/* which said has detected the first space for separator, finish this scan operation */
|
||||||
if ((*tmpStr == ' ') && (QUOTES_STATUS_CLOSE(quotes))) {
|
if ((*tmpStr == ' ') && (QUOTES_STATUS_CLOSE(quotes))) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -503,7 +503,7 @@ unsigned int PreHandleCmdline(const char *input, char **output, unsigned int *ou
|
||||||
*output = shiftStr;
|
*output = shiftStr;
|
||||||
*outputlen = shiftLen;
|
*outputlen = shiftLen;
|
||||||
|
|
||||||
/* Check and parse "./", located at the first two charaters of the cmd */
|
/* Check and parse "./", located at the first two characters of the cmd */
|
||||||
if ((shiftLen > removeLen) && (shiftStr[0] == '.') && (shiftStr[1] == '/')) {
|
if ((shiftLen > removeLen) && (shiftStr[0] == '.') && (shiftStr[1] == '/')) {
|
||||||
execLen = strlen(execCmd);
|
execLen = strlen(execCmd);
|
||||||
newLen = execLen + shiftLen - removeLen; /* i.e., newLen - execLen == shiftLen - removeLen */
|
newLen = execLen + shiftLen - removeLen; /* i.e., newLen - execLen == shiftLen - removeLen */
|
||||||
|
|
|
@ -42,7 +42,7 @@ extern "C" {
|
||||||
|
|
||||||
#define TFTP_NULL_UINT32 ((u32_t)0xffffffffUL)
|
#define TFTP_NULL_UINT32 ((u32_t)0xffffffffUL)
|
||||||
|
|
||||||
#define TFTP_NULL_INT32 -1
|
#define TFTP_NULL_INT32 (-1)
|
||||||
|
|
||||||
/** @cond liteos
|
/** @cond liteos
|
||||||
* @defgroup TFTP_Interfaces
|
* @defgroup TFTP_Interfaces
|
||||||
|
@ -114,7 +114,7 @@ typedef enum tagTFTPC_OpCode {
|
||||||
TFTPC_OP_RRQ = 1, /* read request */
|
TFTPC_OP_RRQ = 1, /* read request */
|
||||||
TFTPC_OP_WRQ, /* write request */
|
TFTPC_OP_WRQ, /* write request */
|
||||||
TFTPC_OP_DATA, /* data packet */
|
TFTPC_OP_DATA, /* data packet */
|
||||||
TFTPC_OP_ACK, /* acknowledgement */
|
TFTPC_OP_ACK, /* acknowledgment */
|
||||||
TFTPC_OP_ERROR, /* error code */
|
TFTPC_OP_ERROR, /* error code */
|
||||||
TFTPC_OP_OPT /* option code */
|
TFTPC_OP_OPT /* option code */
|
||||||
} TFTPC_OPCODE_E;
|
} TFTPC_OPCODE_E;
|
||||||
|
|
|
@ -50,11 +50,11 @@ static char *TftpError[] = {
|
||||||
"Error while sending data to the peer\n",
|
"Error while sending data to the peer\n",
|
||||||
"Requested file is not found\n",
|
"Requested file is not found\n",
|
||||||
"This is the error sent by the server when hostname cannot be resolved\n",
|
"This is the error sent by the server when hostname cannot be resolved\n",
|
||||||
"Input paramters passed to TFTP interfaces are invalid\n",
|
"Input parameters passed to TFTP interfaces are invalid\n",
|
||||||
"Error detected in TFTP packet or the error received from the TFTP server\n",
|
"Error detected in TFTP packet or the error received from the TFTP server\n",
|
||||||
"Error during packet synhronization while sending or unexpected packet is received\n",
|
"Error during packet synhronization while sending or unexpected packet is received\n",
|
||||||
"File size limit crossed, Max block can be 0xFFFF, each block containing 512 bytes\n",
|
"File size limit crossed, Max block can be 0xFFFF, each block containing 512 bytes\n",
|
||||||
"File name lenght greater than 256\n",
|
"File name length greater than 256\n",
|
||||||
"Hostname IP is not valid\n",
|
"Hostname IP is not valid\n",
|
||||||
"TFTP server returned file access error\n",
|
"TFTP server returned file access error\n",
|
||||||
"TFTP server returned error signifying that the DISK is full to write\n",
|
"TFTP server returned error signifying that the DISK is full to write\n",
|
||||||
|
@ -66,11 +66,11 @@ static char *TftpError[] = {
|
||||||
"File create error\n",
|
"File create error\n",
|
||||||
"File write error\n",
|
"File write error\n",
|
||||||
"Max time expired while waiting for file to be recived\n",
|
"Max time expired while waiting for file to be recived\n",
|
||||||
"Error when the received packet is less than 4bytes(error lenght) or greater than 512bytes\n",
|
"Error when the received packet is less than 4bytes(error length) or greater than 512bytes\n",
|
||||||
"Returned by TFTP server for protocol user error\n",
|
"Returned by TFTP server for protocol user error\n",
|
||||||
"The destination file path length greater than 256\n",
|
"The destination file path length greater than 256\n",
|
||||||
"Returned by TFTP server for undefined transfer ID\n",
|
"Returned by TFTP server for undefined transfer ID\n",
|
||||||
"IOCTL fucntion failed at TFTP client while setting the socket to non-block\n",
|
"IOCTL function failed at TFTP client while setting the socket to non-block\n",
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifndef ARRAY_SIZE
|
#ifndef ARRAY_SIZE
|
||||||
|
|
|
@ -189,7 +189,7 @@ u32_t lwip_tftp_recv_from_server(s32_t iSockNum, u32_t *pulSize, TFTPC_PACKET_S
|
||||||
if (iRet == -1) {
|
if (iRet == -1) {
|
||||||
return TFTPC_SELECT_ERROR;
|
return TFTPC_SELECT_ERROR;
|
||||||
} else if (iRet == 0) {
|
} else if (iRet == 0) {
|
||||||
return TFTPC_TIMEOUT_ERROR; /* Select timeout occured */
|
return TFTPC_TIMEOUT_ERROR; /* Select timeout occurred */
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!FD_ISSET(iSockNum, &stReadfds)) {
|
if (!FD_ISSET(iSockNum, &stReadfds)) {
|
||||||
|
@ -268,7 +268,7 @@ u32_t lwip_tftp_recv_from_server(s32_t iSockNum, u32_t *pulSize, TFTPC_PACKET_S
|
||||||
*pulSize = (u32_t)iRet;
|
*pulSize = (u32_t)iRet;
|
||||||
|
|
||||||
/* If received packet is first block of data(for get operation) or if
|
/* If received packet is first block of data(for get operation) or if
|
||||||
received packet is acknowledgement for write request (put operation)
|
received packet is acknowledgment for write request (put operation)
|
||||||
store the received port number */
|
store the received port number */
|
||||||
if (((usOpcode == TFTPC_OP_DATA) &&
|
if (((usOpcode == TFTPC_OP_DATA) &&
|
||||||
(ntohs(pstRecvBuf->u.stTFTP_Data.usBlknum) == 1)) ||
|
(ntohs(pstRecvBuf->u.stTFTP_Data.usBlknum) == 1)) ||
|
||||||
|
@ -687,7 +687,7 @@ u32_t lwip_tftp_get_file_by_filename(u32_t ulHostAddr,
|
||||||
|
|
||||||
ulErrCode = lwip_tftp_recv_from_server(iSockNum, &ulRecvSize, pstRecvBuf,
|
ulErrCode = lwip_tftp_recv_from_server(iSockNum, &ulRecvSize, pstRecvBuf,
|
||||||
&ulIgnorePkt, &stServerAddr, pstSendBuf);
|
&ulIgnorePkt, &stServerAddr, pstSendBuf);
|
||||||
/* If select timeout occured */
|
/* If select timeout occurred */
|
||||||
if (ulErrCode == TFTPC_TIMEOUT_ERROR) {
|
if (ulErrCode == TFTPC_TIMEOUT_ERROR) {
|
||||||
ulTotalTime++;
|
ulTotalTime++;
|
||||||
if (ulTotalTime < TFTPC_MAX_SEND_REQ_ATTEMPTS) {
|
if (ulTotalTime < TFTPC_MAX_SEND_REQ_ATTEMPTS) {
|
||||||
|
@ -982,7 +982,7 @@ u32_t lwip_tftp_put_file_by_filename(u32_t ulHostAddr, u16_t usTftpServPort, u8_
|
||||||
return TFTPC_MEMALLOC_ERROR;
|
return TFTPC_MEMALLOC_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* First time intialize the buffer */
|
/* First time initialize the buffer */
|
||||||
(void)memset_s((void *)pstSendBuf, sizeof(TFTPC_PACKET_S), 0, sizeof(TFTPC_PACKET_S));
|
(void)memset_s((void *)pstSendBuf, sizeof(TFTPC_PACKET_S), 0, sizeof(TFTPC_PACKET_S));
|
||||||
|
|
||||||
/* The destination path can only be one of the following:
|
/* The destination path can only be one of the following:
|
||||||
|
@ -1221,7 +1221,7 @@ u32_t lwip_tftp_inner_put_file(s32_t iSockNum,
|
||||||
return TFTPC_MEMALLOC_ERROR;
|
return TFTPC_MEMALLOC_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* First time intialize the buffer */
|
/* First time initialize the buffer */
|
||||||
(void)memset_s((void *)pstRecvBuf, sizeof(TFTPC_PACKET_S), 0, sizeof(TFTPC_PACKET_S));
|
(void)memset_s((void *)pstRecvBuf, sizeof(TFTPC_PACKET_S), 0, sizeof(TFTPC_PACKET_S));
|
||||||
|
|
||||||
/* Initialize from address to the server address at first */
|
/* Initialize from address to the server address at first */
|
||||||
|
@ -1235,7 +1235,7 @@ u32_t lwip_tftp_inner_put_file(s32_t iSockNum,
|
||||||
ulError = lwip_tftp_recv_from_server(iSockNum, &ulPktSize,
|
ulError = lwip_tftp_recv_from_server(iSockNum, &ulPktSize,
|
||||||
pstRecvBuf, &ulIgnorePkt,
|
pstRecvBuf, &ulIgnorePkt,
|
||||||
pstServerAddr, pstSendBuf);
|
pstServerAddr, pstSendBuf);
|
||||||
/* If select timeout occured */
|
/* If select timeout occurred */
|
||||||
if (ulError == TFTPC_TIMEOUT_ERROR) {
|
if (ulError == TFTPC_TIMEOUT_ERROR) {
|
||||||
ulTotalTime++;
|
ulTotalTime++;
|
||||||
if (ulTotalTime < TFTPC_MAX_SEND_REQ_ATTEMPTS) {
|
if (ulTotalTime < TFTPC_MAX_SEND_REQ_ATTEMPTS) {
|
||||||
|
@ -1526,7 +1526,7 @@ u32_t lwip_tftp_get_file_by_filename_to_rawmem(u32_t ulHostAddr,
|
||||||
|
|
||||||
ulErrCode = lwip_tftp_recv_from_server(iSockNum, &ulRecvSize, pstRecvBuf, &ulIgnorePkt,
|
ulErrCode = lwip_tftp_recv_from_server(iSockNum, &ulRecvSize, pstRecvBuf, &ulIgnorePkt,
|
||||||
&stServerAddr, pstSendBuf);
|
&stServerAddr, pstSendBuf);
|
||||||
/* If select timeout occured */
|
/* If select timeout occurred */
|
||||||
if (ulErrCode == TFTPC_TIMEOUT_ERROR) {
|
if (ulErrCode == TFTPC_TIMEOUT_ERROR) {
|
||||||
ulTotalTime++;
|
ulTotalTime++;
|
||||||
if (ulTotalTime < TFTPC_MAX_SEND_REQ_ATTEMPTS) {
|
if (ulTotalTime < TFTPC_MAX_SEND_REQ_ATTEMPTS) {
|
||||||
|
|
|
@ -70,6 +70,10 @@ static void TraceRead(int fd, size_t size)
|
||||||
{
|
{
|
||||||
ssize_t i;
|
ssize_t i;
|
||||||
ssize_t len;
|
ssize_t len;
|
||||||
|
if (size <= 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
char *buffer = (char *)malloc(size);
|
char *buffer = (char *)malloc(size);
|
||||||
if (buffer == NULL) {
|
if (buffer == NULL) {
|
||||||
printf("Read buffer malloc failed.\n");
|
printf("Read buffer malloc failed.\n");
|
||||||
|
|
|
@ -246,7 +246,7 @@ STATIC INLINE INT32 LOS_AtomicIncRet(Atomic *v)
|
||||||
* @brief Atomic auto-decrement.
|
* @brief Atomic auto-decrement.
|
||||||
*
|
*
|
||||||
* @par Description:
|
* @par Description:
|
||||||
* This API is used to implementating the atomic auto-decrement.
|
* This API is used to implement the atomic auto-decrement.
|
||||||
* @attention
|
* @attention
|
||||||
* <ul>
|
* <ul>
|
||||||
* <li>The pointer v must not be NULL.</li>
|
* <li>The pointer v must not be NULL.</li>
|
||||||
|
@ -280,7 +280,7 @@ STATIC INLINE VOID LOS_AtomicDec(Atomic *v)
|
||||||
* @brief Atomic auto-decrement.
|
* @brief Atomic auto-decrement.
|
||||||
*
|
*
|
||||||
* @par Description:
|
* @par Description:
|
||||||
* This API is used to implementating the atomic auto-decrement and return the result of auto-decrement.
|
* This API is used to implement the atomic auto-decrement and return the result of auto-decrement.
|
||||||
* @attention
|
* @attention
|
||||||
* <ul>
|
* <ul>
|
||||||
* <li>The pointer v must not be NULL.</li>
|
* <li>The pointer v must not be NULL.</li>
|
||||||
|
@ -531,7 +531,7 @@ STATIC INLINE INT64 LOS_Atomic64IncRet(Atomic64 *v)
|
||||||
* @brief Atomic64 auto-decrement.
|
* @brief Atomic64 auto-decrement.
|
||||||
*
|
*
|
||||||
* @par Description:
|
* @par Description:
|
||||||
* This API is used to implementating the atomic64 auto-decrement.
|
* This API is used to implement the atomic64 auto-decrement.
|
||||||
* @attention
|
* @attention
|
||||||
* <ul>
|
* <ul>
|
||||||
* <li>The pointer v must not be NULL.</li>
|
* <li>The pointer v must not be NULL.</li>
|
||||||
|
@ -566,7 +566,7 @@ STATIC INLINE VOID LOS_Atomic64Dec(Atomic64 *v)
|
||||||
* @brief Atomic64 auto-decrement.
|
* @brief Atomic64 auto-decrement.
|
||||||
*
|
*
|
||||||
* @par Description:
|
* @par Description:
|
||||||
* This API is used to implementating the atomic64 auto-decrement and return the result of auto-decrement.
|
* This API is used to implement the atomic64 auto-decrement and return the result of auto-decrement.
|
||||||
* @attention
|
* @attention
|
||||||
* <ul>
|
* <ul>
|
||||||
* <li>The pointer v must not be NULL.</li>
|
* <li>The pointer v must not be NULL.</li>
|
||||||
|
|
|
@ -49,7 +49,7 @@ STATIC UINT32 g_curIrqNum = 0;
|
||||||
*/
|
*/
|
||||||
STATIC VOID GicWriteSgi(UINT32 vector, UINT32 cpuMask, UINT32 filter)
|
STATIC VOID GicWriteSgi(UINT32 vector, UINT32 cpuMask, UINT32 filter)
|
||||||
{
|
{
|
||||||
UINT32 val = ((filter & 0x3) << 24) | ((cpuMask & 0xFF) << 16) |
|
UINT32 val = ((filter & 0x3) << 24) | ((cpuMask & 0xFF) << 16) | /* 24, 16: Register bit offset */
|
||||||
(vector & 0xF);
|
(vector & 0xF);
|
||||||
|
|
||||||
GIC_REG_32(GICD_SGIR) = val;
|
GIC_REG_32(GICD_SGIR) = val;
|
||||||
|
@ -62,7 +62,7 @@ VOID HalIrqSendIpi(UINT32 target, UINT32 ipi)
|
||||||
|
|
||||||
VOID HalIrqSetAffinity(UINT32 vector, UINT32 cpuMask)
|
VOID HalIrqSetAffinity(UINT32 vector, UINT32 cpuMask)
|
||||||
{
|
{
|
||||||
UINT32 offset = vector / 4;
|
UINT32 offset = vector / 4; /* 4: Interrupt bit width */
|
||||||
UINT32 index = vector & 0x3;
|
UINT32 index = vector & 0x3;
|
||||||
|
|
||||||
GIC_REG_8(GICD_ITARGETSR(offset) + index) = cpuMask;
|
GIC_REG_8(GICD_ITARGETSR(offset) + index) = cpuMask;
|
||||||
|
@ -80,7 +80,7 @@ VOID HalIrqMask(UINT32 vector)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
GIC_REG_32(GICD_ICENABLER(vector / 32)) = 1U << (vector % 32);
|
GIC_REG_32(GICD_ICENABLER(vector / 32)) = 1U << (vector % 32); /* 32: Interrupt bit width */
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID HalIrqUnmask(UINT32 vector)
|
VOID HalIrqUnmask(UINT32 vector)
|
||||||
|
@ -89,7 +89,7 @@ VOID HalIrqUnmask(UINT32 vector)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
GIC_REG_32(GICD_ISENABLER(vector >> 5)) = 1U << (vector % 32);
|
GIC_REG_32(GICD_ISENABLER(vector >> 5)) = 1U << (vector % 32); /* 5, 32: Register bit offset */
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID HalIrqPending(UINT32 vector)
|
VOID HalIrqPending(UINT32 vector)
|
||||||
|
@ -98,7 +98,7 @@ VOID HalIrqPending(UINT32 vector)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
GIC_REG_32(GICD_ISPENDR(vector >> 5)) = 1U << (vector % 32);
|
GIC_REG_32(GICD_ISPENDR(vector >> 5)) = 1U << (vector % 32); /* 5, 32: Register bit offset */
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID HalIrqClear(UINT32 vector)
|
VOID HalIrqClear(UINT32 vector)
|
||||||
|
@ -119,24 +119,24 @@ VOID HalIrqInit(VOID)
|
||||||
{
|
{
|
||||||
UINT32 i;
|
UINT32 i;
|
||||||
|
|
||||||
/* set externel interrupts to be level triggered, active low. */
|
/* set external interrupts to be level triggered, active low. */
|
||||||
for (i = 32; i < OS_HWI_MAX_NUM; i += 16) {
|
for (i = 32; i < OS_HWI_MAX_NUM; i += 16) { /* 32: Start interrupt number, 16: Interrupt bit width */
|
||||||
GIC_REG_32(GICD_ICFGR(i / 16)) = 0;
|
GIC_REG_32(GICD_ICFGR(i / 16)) = 0; /* 16: Register bit offset */
|
||||||
}
|
}
|
||||||
|
|
||||||
/* set externel interrupts to CPU 0 */
|
/* set external interrupts to CPU 0 */
|
||||||
for (i = 32; i < OS_HWI_MAX_NUM; i += 4) {
|
for (i = 32; i < OS_HWI_MAX_NUM; i += 4) { /* 32: Start interrupt number, 4: Interrupt bit width */
|
||||||
GIC_REG_32(GICD_ITARGETSR(i / 4)) = 0x01010101;
|
GIC_REG_32(GICD_ITARGETSR(i / 4)) = 0x01010101;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* set priority on all interrupts */
|
/* set priority on all interrupts */
|
||||||
for (i = 0; i < OS_HWI_MAX_NUM; i += 4) {
|
for (i = 0; i < OS_HWI_MAX_NUM; i += 4) { /* 4: Interrupt bit width */
|
||||||
GIC_REG_32(GICD_IPRIORITYR(i / 4)) = GICD_INT_DEF_PRI_X4;
|
GIC_REG_32(GICD_IPRIORITYR(i / 4)) = GICD_INT_DEF_PRI_X4;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* disable all interrupts. */
|
/* disable all interrupts. */
|
||||||
for (i = 0; i < OS_HWI_MAX_NUM; i += 32) {
|
for (i = 0; i < OS_HWI_MAX_NUM; i += 32) { /* 32: Interrupt bit width */
|
||||||
GIC_REG_32(GICD_ICENABLER(i / 32)) = ~0;
|
GIC_REG_32(GICD_ICENABLER(i / 32)) = ~0; /* 32: Interrupt bit width */
|
||||||
}
|
}
|
||||||
|
|
||||||
HalIrqInitPercpu();
|
HalIrqInitPercpu();
|
||||||
|
|
|
@ -42,9 +42,9 @@ STATIC UINT32 g_curIrqNum = 0;
|
||||||
|
|
||||||
STATIC INLINE UINT64 MpidrToAffinity(UINT64 mpidr)
|
STATIC INLINE UINT64 MpidrToAffinity(UINT64 mpidr)
|
||||||
{
|
{
|
||||||
return ((MPIDR_AFF_LEVEL(mpidr, 3) << 32) |
|
return ((MPIDR_AFF_LEVEL(mpidr, 3) << 32) | /* 3: Serial number, 32: Register bit offset */
|
||||||
(MPIDR_AFF_LEVEL(mpidr, 2) << 16) |
|
(MPIDR_AFF_LEVEL(mpidr, 2) << 16) | /* 2: Serial number, 16: Register bit offset */
|
||||||
(MPIDR_AFF_LEVEL(mpidr, 1) << 8) |
|
(MPIDR_AFF_LEVEL(mpidr, 1) << 8) | /* 1: Serial number, 8: Register bit offset */
|
||||||
(MPIDR_AFF_LEVEL(mpidr, 0)));
|
(MPIDR_AFF_LEVEL(mpidr, 0)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -106,10 +106,10 @@ STATIC VOID GicSgi(UINT32 irq, UINT32 cpuMask)
|
||||||
tList = GicTargetList(&cpu, cpuMask, cluster);
|
tList = GicTargetList(&cpu, cpuMask, cluster);
|
||||||
|
|
||||||
/* Generates a Group 1 interrupt for the current security state */
|
/* Generates a Group 1 interrupt for the current security state */
|
||||||
val = ((MPIDR_AFF_LEVEL(cluster, 3) << 48) |
|
val = ((MPIDR_AFF_LEVEL(cluster, 3) << 48) | /* 3: Serial number, 48: Register bit offset */
|
||||||
(MPIDR_AFF_LEVEL(cluster, 2) << 32) |
|
(MPIDR_AFF_LEVEL(cluster, 2) << 32) | /* 2: Serial number, 32: Register bit offset */
|
||||||
(MPIDR_AFF_LEVEL(cluster, 1) << 16) |
|
(MPIDR_AFF_LEVEL(cluster, 1) << 16) | /* 1: Serial number, 16: Register bit offset */
|
||||||
(irq << 24) | tList);
|
(irq << 24) | tList); /* 24: Register bit offset */
|
||||||
|
|
||||||
GiccSetSgi1r(val);
|
GiccSetSgi1r(val);
|
||||||
}
|
}
|
||||||
|
@ -150,9 +150,9 @@ STATIC INLINE VOID GicdSetGroup(UINT32 irq)
|
||||||
{
|
{
|
||||||
/* configure spi as group 0 on secure mode and group 1 on unsecure mode */
|
/* configure spi as group 0 on secure mode and group 1 on unsecure mode */
|
||||||
#ifdef LOSCFG_ARCH_SECURE_MONITOR_MODE
|
#ifdef LOSCFG_ARCH_SECURE_MONITOR_MODE
|
||||||
GIC_REG_32(GICD_IGROUPR(irq / 32)) = 0;
|
GIC_REG_32(GICD_IGROUPR(irq / 32)) = 0; /* 32: Interrupt bit width */
|
||||||
#else
|
#else
|
||||||
GIC_REG_32(GICD_IGROUPR(irq / 32)) = 0xffffffff;
|
GIC_REG_32(GICD_IGROUPR(irq / 32)) = 0xffffffff; /* 32: Interrupt bit width */
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -248,13 +248,13 @@ UINT32 HalCurIrqGet(VOID)
|
||||||
VOID HalIrqMask(UINT32 vector)
|
VOID HalIrqMask(UINT32 vector)
|
||||||
{
|
{
|
||||||
INT32 i;
|
INT32 i;
|
||||||
const UINT32 mask = 1U << (vector % 32);
|
const UINT32 mask = 1U << (vector % 32); /* 32: Interrupt bit width */
|
||||||
|
|
||||||
if ((vector > OS_USER_HWI_MAX) || (vector < OS_USER_HWI_MIN)) {
|
if ((vector > OS_USER_HWI_MAX) || (vector < OS_USER_HWI_MIN)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (vector < 32) {
|
if (vector < 32) { /* 32: Interrupt bit width */
|
||||||
for (i = 0; i < LOSCFG_KERNEL_CORE_NUM; i++) {
|
for (i = 0; i < LOSCFG_KERNEL_CORE_NUM; i++) {
|
||||||
GIC_REG_32(GICR_ICENABLER0(i)) = mask;
|
GIC_REG_32(GICR_ICENABLER0(i)) = mask;
|
||||||
GicWaitForRwp(GICR_CTLR(i));
|
GicWaitForRwp(GICR_CTLR(i));
|
||||||
|
@ -268,19 +268,19 @@ VOID HalIrqMask(UINT32 vector)
|
||||||
VOID HalIrqUnmask(UINT32 vector)
|
VOID HalIrqUnmask(UINT32 vector)
|
||||||
{
|
{
|
||||||
INT32 i;
|
INT32 i;
|
||||||
const UINT32 mask = 1U << (vector % 32);
|
const UINT32 mask = 1U << (vector % 32); /* 32: Interrupt bit width */
|
||||||
|
|
||||||
if ((vector > OS_USER_HWI_MAX) || (vector < OS_USER_HWI_MIN)) {
|
if ((vector > OS_USER_HWI_MAX) || (vector < OS_USER_HWI_MIN)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (vector < 32) {
|
if (vector < 32) { /* 32: Interrupt bit width */
|
||||||
for (i = 0; i < LOSCFG_KERNEL_CORE_NUM; i++) {
|
for (i = 0; i < LOSCFG_KERNEL_CORE_NUM; i++) {
|
||||||
GIC_REG_32(GICR_ISENABLER0(i)) = mask;
|
GIC_REG_32(GICR_ISENABLER0(i)) = mask;
|
||||||
GicWaitForRwp(GICR_CTLR(i));
|
GicWaitForRwp(GICR_CTLR(i));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
GIC_REG_32(GICD_ISENABLER(vector >> 5)) = mask;
|
GIC_REG_32(GICD_ISENABLER(vector >> 5)) = mask; /* 5: Register bit offset */
|
||||||
GicWaitForRwp(GICD_CTLR);
|
GicWaitForRwp(GICD_CTLR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -291,7 +291,7 @@ VOID HalIrqPending(UINT32 vector)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
GIC_REG_32(GICD_ISPENDR(vector >> 5)) = 1U << (vector % 32);
|
GIC_REG_32(GICD_ISPENDR(vector >> 5)) = 1U << (vector % 32); /* 5: Register bit offset, 32: Interrupt bit width */
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID HalIrqClear(UINT32 vector)
|
VOID HalIrqClear(UINT32 vector)
|
||||||
|
@ -362,30 +362,30 @@ VOID HalIrqInit(VOID)
|
||||||
GicWaitForRwp(GICD_CTLR);
|
GicWaitForRwp(GICD_CTLR);
|
||||||
ISB;
|
ISB;
|
||||||
|
|
||||||
/* set externel interrupts to be level triggered, active low. */
|
/* set external interrupts to be level triggered, active low. */
|
||||||
for (i = 32; i < OS_HWI_MAX_NUM; i += 16) {
|
for (i = 32; i < OS_HWI_MAX_NUM; i += 16) { /* 32: Start interrupt number, 16: Interrupt bit width */
|
||||||
GIC_REG_32(GICD_ICFGR(i / 16)) = 0;
|
GIC_REG_32(GICD_ICFGR(i / 16)) = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* config distributer, mask and clear all spis, set group x */
|
/* config distributer, mask and clear all spis, set group x */
|
||||||
for (i = 32; i < OS_HWI_MAX_NUM; i += 32) {
|
for (i = 32; i < OS_HWI_MAX_NUM; i += 32) { /* 32: Start interrupt number, 32: Interrupt bit width */
|
||||||
GIC_REG_32(GICD_ICENABLER(i / 32)) = 0xffffffff;
|
GIC_REG_32(GICD_ICENABLER(i / 32)) = 0xffffffff; /* 32: Interrupt bit width */
|
||||||
GIC_REG_32(GICD_ICPENDR(i / 32)) = 0xffffffff;
|
GIC_REG_32(GICD_ICPENDR(i / 32)) = 0xffffffff; /* 32: Interrupt bit width */
|
||||||
GIC_REG_32(GICD_IGRPMODR(i / 32)) = 0;
|
GIC_REG_32(GICD_IGRPMODR(i / 32)) = 0; /* 32: Interrupt bit width */
|
||||||
|
|
||||||
GicdSetGroup(i);
|
GicdSetGroup(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* set spi priority as default */
|
/* set spi priority as default */
|
||||||
for (i = 32; i < OS_HWI_MAX_NUM; i++) {
|
for (i = 32; i < OS_HWI_MAX_NUM; i++) { /* 32: Start interrupt number */
|
||||||
GicdSetPmr(i, MIN_INTERRUPT_PRIORITY);
|
GicdSetPmr(i, MIN_INTERRUPT_PRIORITY);
|
||||||
}
|
}
|
||||||
|
|
||||||
GicWaitForRwp(GICD_CTLR);
|
GicWaitForRwp(GICD_CTLR);
|
||||||
|
|
||||||
/* disable all interrupts. */
|
/* disable all interrupts. */
|
||||||
for (i = 0; i < OS_HWI_MAX_NUM; i += 32) {
|
for (i = 0; i < OS_HWI_MAX_NUM; i += 32) { /* 32: Interrupt bit width */
|
||||||
GIC_REG_32(GICD_ICENABLER(i / 32)) = 0xffffffff;
|
GIC_REG_32(GICD_ICENABLER(i / 32)) = 0xffffffff; /* 32: Interrupt bit width */
|
||||||
}
|
}
|
||||||
|
|
||||||
/* enable distributor with ARE, group 1 enabled */
|
/* enable distributor with ARE, group 1 enabled */
|
||||||
|
@ -393,7 +393,7 @@ VOID HalIrqInit(VOID)
|
||||||
|
|
||||||
/* set spi to boot cpu only. ARE must be enabled */
|
/* set spi to boot cpu only. ARE must be enabled */
|
||||||
affinity = MpidrToAffinity(AARCH64_SYSREG_READ(mpidr_el1));
|
affinity = MpidrToAffinity(AARCH64_SYSREG_READ(mpidr_el1));
|
||||||
for (i = 32; i < OS_HWI_MAX_NUM; i++) {
|
for (i = 32; i < OS_HWI_MAX_NUM; i++) { /* 32: Start interrupt number */
|
||||||
GIC_REG_64(GICD_IROUTER(i)) = affinity;
|
GIC_REG_64(GICD_IROUTER(i)) = affinity;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -77,8 +77,8 @@ enum {
|
||||||
#define GICD_PIDR2V3 (GICD_OFFSET + 0xffe8)
|
#define GICD_PIDR2V3 (GICD_OFFSET + 0xffe8)
|
||||||
|
|
||||||
#ifdef LOSCFG_ARCH_GIC_V3
|
#ifdef LOSCFG_ARCH_GIC_V3
|
||||||
#define GICD_IGRPMODR(n) (GICD_OFFSET + 0x0d00 + (n) * 4) /* Interrupt Group Mode Reisters */
|
#define GICD_IGRPMODR(n) (GICD_OFFSET + 0x0d00 + (n) * 4) /* Interrupt Group Mode Registers */
|
||||||
#define GICD_IROUTER(n) (GICD_OFFSET + 0x6000 + (n) * 8) /* Interrupt Rounter Reisters */
|
#define GICD_IROUTER(n) (GICD_OFFSET + 0x6000 + (n) * 8) /* Interrupt Rounter Registers */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define GIC_REG_8(reg) (*(volatile UINT8 *)((UINTPTR)(GIC_BASE_ADDR + (reg))))
|
#define GIC_REG_8(reg) (*(volatile UINT8 *)((UINTPTR)(GIC_BASE_ADDR + (reg))))
|
||||||
|
|
|
@ -43,7 +43,6 @@
|
||||||
"bounds_checking_function",
|
"bounds_checking_function",
|
||||||
"toybox",
|
"toybox",
|
||||||
"NuttX",
|
"NuttX",
|
||||||
"Linux_Kernel",
|
|
||||||
"FatFs",
|
"FatFs",
|
||||||
"mksh",
|
"mksh",
|
||||||
"musl",
|
"musl",
|
||||||
|
|
|
@ -71,7 +71,7 @@ extern "C" {
|
||||||
/* CONSTANTS */
|
/* CONSTANTS */
|
||||||
|
|
||||||
#define MQ_USE_MAGIC 0x89abcdef
|
#define MQ_USE_MAGIC 0x89abcdef
|
||||||
/* not suppurt prio */
|
/* not support prio */
|
||||||
#define MQ_PRIO_MAX 1
|
#define MQ_PRIO_MAX 1
|
||||||
|
|
||||||
typedef union send_receive_t {
|
typedef union send_receive_t {
|
||||||
|
@ -297,7 +297,7 @@ extern int mq_send(mqd_t personal, const char *msg, size_t msgLen, unsigned int
|
||||||
* <li><b>EAGAIN</b>: The message queue is empty.</li>
|
* <li><b>EAGAIN</b>: The message queue is empty.</li>
|
||||||
* <li><b>EINVAL</b>: invalid parameter.</li>
|
* <li><b>EINVAL</b>: invalid parameter.</li>
|
||||||
* <li><b>EMSGSIZE</b>: The message to be received is too long.</li>
|
* <li><b>EMSGSIZE</b>: The message to be received is too long.</li>
|
||||||
* <li><b>ETIMEDOUT</b>: The operaton times out.</li>
|
* <li><b>ETIMEDOUT</b>: The operation times out.</li>
|
||||||
* </ul>
|
* </ul>
|
||||||
*
|
*
|
||||||
* @par Dependency:
|
* @par Dependency:
|
||||||
|
|
|
@ -40,7 +40,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void *calloc(size_t nitems, size_t size)
|
void *calloc(size_t nitems, size_t size)
|
||||||
{ /*lint !e578*/
|
{
|
||||||
size_t real_size;
|
size_t real_size;
|
||||||
void *ptr = NULL;
|
void *ptr = NULL;
|
||||||
|
|
||||||
|
@ -78,7 +78,7 @@ void free(void *ptr)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void *malloc(size_t size)
|
void *malloc(size_t size)
|
||||||
{ /*lint !e31 !e10*/
|
{
|
||||||
if (size == 0) {
|
if (size == 0) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -87,7 +87,7 @@ void *malloc(size_t size)
|
||||||
}
|
}
|
||||||
|
|
||||||
void *zalloc(size_t size)
|
void *zalloc(size_t size)
|
||||||
{ /*lint !e10*/
|
{
|
||||||
void *ptr = NULL;
|
void *ptr = NULL;
|
||||||
|
|
||||||
if (size == 0) {
|
if (size == 0) {
|
||||||
|
|
|
@ -647,7 +647,7 @@ int clock_getres(clockid_t clockID, struct timespec *tp)
|
||||||
case CLOCK_MONOTONIC_RAW:
|
case CLOCK_MONOTONIC_RAW:
|
||||||
case CLOCK_MONOTONIC:
|
case CLOCK_MONOTONIC:
|
||||||
case CLOCK_REALTIME:
|
case CLOCK_REALTIME:
|
||||||
/* the accessable rtc resolution */
|
/* the accessible rtc resolution */
|
||||||
tp->tv_nsec = OS_SYS_NS_PER_US; /* the precision of clock_gettime is 1us */
|
tp->tv_nsec = OS_SYS_NS_PER_US; /* the precision of clock_gettime is 1us */
|
||||||
tp->tv_sec = 0;
|
tp->tv_sec = 0;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -45,8 +45,6 @@
|
||||||
#include "bcache.h"
|
#include "bcache.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "pthread.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
#if __cplusplus
|
#if __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
@ -253,7 +251,7 @@ struct disk_divide_info {
|
||||||
* </ul>
|
* </ul>
|
||||||
*
|
*
|
||||||
* @param diskName [IN] Type #const CHAR * disk driver name.
|
* @param diskName [IN] Type #const CHAR * disk driver name.
|
||||||
* @param bops [IN] Type #const struct block_operations * block driver control sturcture.
|
* @param bops [IN] Type #const struct block_operations * block driver control structure.
|
||||||
* @param priv [IN] Type #VOID * private data of vnode.
|
* @param priv [IN] Type #VOID * private data of vnode.
|
||||||
* @param diskID [IN] Type #INT32 disk id number, less than SYS_MAX_DISK.
|
* @param diskID [IN] Type #INT32 disk id number, less than SYS_MAX_DISK.
|
||||||
* @param info [IN] Type #VOID * disk driver partition information.
|
* @param info [IN] Type #VOID * disk driver partition information.
|
||||||
|
@ -712,7 +710,7 @@ INT32 los_alloc_diskid_byname(const CHAR *diskName);
|
||||||
* @brief get the INUSED disk id.
|
* @brief get the INUSED disk id.
|
||||||
*
|
*
|
||||||
* @par Description:
|
* @par Description:
|
||||||
* Get the correponding INUSED disk id by diskName.
|
* Get the corresponding INUSED disk id by diskName.
|
||||||
*
|
*
|
||||||
* @attention
|
* @attention
|
||||||
* <ul>
|
* <ul>
|
||||||
|
|
|
@ -107,7 +107,7 @@ INT32 los_alloc_diskid_byname(const CHAR *diskName)
|
||||||
size_t nameLen;
|
size_t nameLen;
|
||||||
|
|
||||||
if (diskName == NULL) {
|
if (diskName == NULL) {
|
||||||
PRINT_ERR("The paramter disk_name is NULL");
|
PRINT_ERR("The parameter disk_name is NULL");
|
||||||
return VFS_ERROR;
|
return VFS_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -163,7 +163,7 @@ INT32 los_get_diskid_byname(const CHAR *diskName)
|
||||||
size_t diskNameLen;
|
size_t diskNameLen;
|
||||||
|
|
||||||
if (diskName == NULL) {
|
if (diskName == NULL) {
|
||||||
PRINT_ERR("The paramter diskName is NULL");
|
PRINT_ERR("The parameter diskName is NULL");
|
||||||
return VFS_ERROR;
|
return VFS_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -756,7 +756,7 @@ INT32 DiskPartitionRegister(los_disk *disk)
|
||||||
los_part *part = NULL;
|
los_part *part = NULL;
|
||||||
struct disk_divide_info parInfo;
|
struct disk_divide_info parInfo;
|
||||||
|
|
||||||
/* Fill disk_divide_info structure to set partition's infomation. */
|
/* Fill disk_divide_info structure to set partition's information. */
|
||||||
(VOID)memset_s(parInfo.part, sizeof(parInfo.part), 0, sizeof(parInfo.part));
|
(VOID)memset_s(parInfo.part, sizeof(parInfo.part), 0, sizeof(parInfo.part));
|
||||||
partSize = sizeof(parInfo.part) / sizeof(parInfo.part[0]);
|
partSize = sizeof(parInfo.part) / sizeof(parInfo.part[0]);
|
||||||
|
|
||||||
|
@ -788,7 +788,7 @@ INT32 DiskPartitionRegister(los_disk *disk)
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < partSize; i++) {
|
for (i = 0; i < partSize; i++) {
|
||||||
/* Read the disk_divide_info structure to get partition's infomation. */
|
/* Read the disk_divide_info structure to get partition's information. */
|
||||||
if ((parInfo.part[i].type != 0) && (parInfo.part[i].type != EXTENDED_PAR) &&
|
if ((parInfo.part[i].type != 0) && (parInfo.part[i].type != EXTENDED_PAR) &&
|
||||||
(parInfo.part[i].type != EXTENDED_8G)) {
|
(parInfo.part[i].type != EXTENDED_8G)) {
|
||||||
part = get_part(DiskAddPart(disk, parInfo.part[i].sector_start, parInfo.part[i].sector_count, TRUE));
|
part = get_part(DiskAddPart(disk, parInfo.part[i].sector_start, parInfo.part[i].sector_count, TRUE));
|
||||||
|
|
|
@ -41,7 +41,7 @@ void RandomOperationsInit(const RandomOperations *r)
|
||||||
if (r != NULL) {
|
if (r != NULL) {
|
||||||
(void)memcpy_s(&g_randomOp, sizeof(RandomOperations), r, sizeof(RandomOperations));
|
(void)memcpy_s(&g_randomOp, sizeof(RandomOperations), r, sizeof(RandomOperations));
|
||||||
} else {
|
} else {
|
||||||
PRINT_ERR("param is invalid\n", __FUNCTION__, __LINE__);
|
PRINT_ERR("%s %d param is invalid\n", __FUNCTION__, __LINE__);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -103,7 +103,7 @@ static ssize_t TraceWrite(struct file *filep, const char *buffer, size_t buflen)
|
||||||
if (info == NULL) {
|
if (info == NULL) {
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
memset_s(info, infoLen, 0, infoLen);
|
(void)memset_s(info, infoLen, 0, infoLen);
|
||||||
|
|
||||||
ret = LOS_CopyToKernel(info, infoLen, buffer, buflen);
|
ret = LOS_CopyToKernel(info, infoLen, buffer, buflen);
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
|
|
|
@ -289,7 +289,7 @@ static INT32 BlockDriverRegisterOperate(mtd_partition *newNode,
|
||||||
if (ret) {
|
if (ret) {
|
||||||
free(newNode->blockdriver_name);
|
free(newNode->blockdriver_name);
|
||||||
newNode->blockdriver_name = NULL;
|
newNode->blockdriver_name = NULL;
|
||||||
PRINT_ERR("register blkdev partion error\n");
|
PRINT_ERR("register blkdev partition error\n");
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -322,7 +322,7 @@ static INT32 CharDriverRegisterOperate(mtd_partition *newNode,
|
||||||
|
|
||||||
ret = register_driver(newNode->chardriver_name, param->char_ops, RWE_RW_RW, newNode);
|
ret = register_driver(newNode->chardriver_name, param->char_ops, RWE_RW_RW, newNode);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
PRINT_ERR("register chardev partion error\n");
|
PRINT_ERR("register chardev partition error\n");
|
||||||
free(newNode->chardriver_name);
|
free(newNode->chardriver_name);
|
||||||
newNode->chardriver_name = NULL;
|
newNode->chardriver_name = NULL;
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -340,7 +340,7 @@ static INT32 BlockDriverUnregister(mtd_partition *node)
|
||||||
if (node->blockdriver_name != NULL) {
|
if (node->blockdriver_name != NULL) {
|
||||||
ret = unregister_blockdriver(node->blockdriver_name);
|
ret = unregister_blockdriver(node->blockdriver_name);
|
||||||
if (ret == -EBUSY) {
|
if (ret == -EBUSY) {
|
||||||
PRINT_ERR("unregister blkdev partion error:%d\n", ret);
|
PRINT_ERR("unregister blkdev partition error:%d\n", ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
free(node->blockdriver_name);
|
free(node->blockdriver_name);
|
||||||
|
@ -356,7 +356,7 @@ static INT32 CharDriverUnregister(mtd_partition *node)
|
||||||
if (node->chardriver_name != NULL) {
|
if (node->chardriver_name != NULL) {
|
||||||
ret = unregister_driver(node->chardriver_name);
|
ret = unregister_driver(node->chardriver_name);
|
||||||
if (ret == -EBUSY) {
|
if (ret == -EBUSY) {
|
||||||
PRINT_ERR("unregister chardev partion error:%d\n", ret);
|
PRINT_ERR("unregister chardev partition error:%d\n", ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
free(node->chardriver_name);
|
free(node->chardriver_name);
|
||||||
|
|
|
@ -4,7 +4,7 @@ source "fs/ramfs/Kconfig"
|
||||||
source "fs/romfs/Kconfig"
|
source "fs/romfs/Kconfig"
|
||||||
source "fs/nfs/Kconfig"
|
source "fs/nfs/Kconfig"
|
||||||
source "fs/proc/Kconfig"
|
source "fs/proc/Kconfig"
|
||||||
source "fs/jffs2/Kconfig"
|
#source "fs/jffs2/Kconfig"
|
||||||
source "fs/rootfs/Kconfig"
|
source "fs/rootfs/Kconfig"
|
||||||
source "fs/patchfs/Kconfig"
|
source "fs/patchfs/Kconfig"
|
||||||
source "fs/zpfs/Kconfig"
|
source "fs/zpfs/Kconfig"
|
|
@ -319,7 +319,7 @@ FRESULT f_regvirfs(FATFS *fs)
|
||||||
|
|
||||||
/* Set the CHILD object field */
|
/* Set the CHILD object field */
|
||||||
for (i = 0; i < fs->vir_amount; i++) {
|
for (i = 0; i < fs->vir_amount; i++) {
|
||||||
pfs = ff_memalloc(sizeof(FATFS)); /* Allocate a memeory for current child FATFS object */
|
pfs = ff_memalloc(sizeof(FATFS)); /* Allocate a memory for current child FATFS object */
|
||||||
if (pfs == NULL) { /* If allocate failed, must call 'f_unregvirfs' to free the previous FATFS object memory */
|
if (pfs == NULL) { /* If allocate failed, must call 'f_unregvirfs' to free the previous FATFS object memory */
|
||||||
goto ERROUT;
|
goto ERROUT;
|
||||||
}
|
}
|
||||||
|
@ -500,7 +500,7 @@ static void FatfsSetChildClst(BYTE *work, FATFS *fs, WORD i)
|
||||||
* - FR_OK : The external SD configure is complete, all info has been set to the
|
* - FR_OK : The external SD configure is complete, all info has been set to the
|
||||||
* each CHILD FATFS
|
* each CHILD FATFS
|
||||||
* - FR_NOT_MATCHED : The virtual partition's configure does not matched as current setting
|
* - FR_NOT_MATCHED : The virtual partition's configure does not matched as current setting
|
||||||
* - FR_MODIFIED : The virtual partition's configure has been destoried partly or completely
|
* - FR_MODIFIED : The virtual partition's configure has been destroyed partly or completely
|
||||||
* - FR_NOVIRPART : The external SD has not been apllied as virtual partition yet
|
* - FR_NOVIRPART : The external SD has not been apllied as virtual partition yet
|
||||||
*
|
*
|
||||||
* Others Return Value:
|
* Others Return Value:
|
||||||
|
|
|
@ -98,7 +98,7 @@ extern char *rindex(const char *s, int c);
|
||||||
* @ingroup fs
|
* @ingroup fs
|
||||||
*
|
*
|
||||||
* @par Description:
|
* @par Description:
|
||||||
* The set_label() function shall set the value of a global varible,
|
* The set_label() function shall set the value of a global variable,
|
||||||
* the value will be used to set the label of SD card in format().
|
* the value will be used to set the label of SD card in format().
|
||||||
*
|
*
|
||||||
* @param name [IN] label to set, the length must be less than 12
|
* @param name [IN] label to set, the length must be less than 12
|
||||||
|
|
|
@ -28,23 +28,89 @@
|
||||||
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
import("//kernel/liteos_a/liteos.gni")
|
import("//kernel/liteos_a/liteos.gni")
|
||||||
import("//third_party/Linux_Kernel/Linux_Kernel.gni")
|
|
||||||
|
|
||||||
module_switch = defined(LOSCFG_FS_JFFS)
|
module_switch = defined(LOSCFG_FS_JFFS)
|
||||||
module_name = get_path_info(rebase_path("."), "name")
|
module_name = get_path_info(rebase_path("."), "name")
|
||||||
|
linux_path = rebase_path("//kernel/linux/linux-5.10")
|
||||||
|
out_path = rebase_path(target_out_dir)
|
||||||
|
|
||||||
kernel_module(module_name) {
|
kernel_module(module_name) {
|
||||||
|
patch_path = rebase_path(".")
|
||||||
|
cmd = "if [ -d ${out_path}/jffs2_build ]; then rm -r ${out_path}/jffs2_build; fi && mkdir -p ${out_path}/jffs2_build/fs"
|
||||||
|
cmd += " && cp ${linux_path}/fs/jffs2 ${out_path}/jffs2_build/fs/. -r"
|
||||||
|
cmd += " && pushd ${out_path}/jffs2_build/"
|
||||||
|
cmd += " && patch -p1 < ${patch_path}/jffs2.patch && popd"
|
||||||
|
exec_script("//build/lite/run_shell_cmd.py", [ cmd ])
|
||||||
|
|
||||||
sources = [
|
sources = [
|
||||||
"src/jffs2_hash.c",
|
"src/jffs2_hash.c",
|
||||||
"src/vfs_jffs2.c",
|
"src/vfs_jffs2.c",
|
||||||
]
|
]
|
||||||
|
|
||||||
sources += LINUX_KERNEL_FS_JFFS2_SRC_FILES
|
sources += [
|
||||||
|
"${out_path}/jffs2_build/fs/jffs2/background.c",
|
||||||
|
"${out_path}/jffs2_build/fs/jffs2/build.c",
|
||||||
|
"${out_path}/jffs2_build/fs/jffs2/compr.c",
|
||||||
|
"${out_path}/jffs2_build/fs/jffs2/compr_rtime.c",
|
||||||
|
"${out_path}/jffs2_build/fs/jffs2/compr_rubin.c",
|
||||||
|
"${out_path}/jffs2_build/fs/jffs2/compr_zlib.c",
|
||||||
|
"${out_path}/jffs2_build/fs/jffs2/debug.c",
|
||||||
|
"${out_path}/jffs2_build/fs/jffs2/dir.c",
|
||||||
|
"${out_path}/jffs2_build/fs/jffs2/erase.c",
|
||||||
|
"${out_path}/jffs2_build/fs/jffs2/file.c",
|
||||||
|
"${out_path}/jffs2_build/fs/jffs2/fs.c",
|
||||||
|
"${out_path}/jffs2_build/fs/jffs2/gc.c",
|
||||||
|
"${out_path}/jffs2_build/fs/jffs2/malloc.c",
|
||||||
|
"${out_path}/jffs2_build/fs/jffs2/nodelist.c",
|
||||||
|
"${out_path}/jffs2_build/fs/jffs2/nodemgmt.c",
|
||||||
|
"${out_path}/jffs2_build/fs/jffs2/read.c",
|
||||||
|
"${out_path}/jffs2_build/fs/jffs2/readinode.c",
|
||||||
|
"${out_path}/jffs2_build/fs/jffs2/scan.c",
|
||||||
|
"${out_path}/jffs2_build/fs/jffs2/summary.c",
|
||||||
|
"${out_path}/jffs2_build/fs/jffs2/super.c",
|
||||||
|
"${out_path}/jffs2_build/fs/jffs2/write.c",
|
||||||
|
"${out_path}/jffs2_build/fs/jffs2/writev.c",
|
||||||
|
]
|
||||||
|
|
||||||
include_dirs = LINUX_KERNEL_FS_JFFS2_INCLUDE_DIRS
|
include_dirs = [
|
||||||
|
"${out_path}/jffs2_build/fs",
|
||||||
|
"${out_path}/jffs2_build/fs/jffs2",
|
||||||
|
]
|
||||||
|
|
||||||
public_configs = [ ":public" ]
|
public_configs = [ ":public" ]
|
||||||
|
|
||||||
|
deps = [ ":cp_jffs2_src" ]
|
||||||
}
|
}
|
||||||
|
|
||||||
config("public") {
|
config("public") {
|
||||||
include_dirs = [ "include" ]
|
include_dirs = [ "include" ]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
action("cp_jffs2_src") {
|
||||||
|
script = "//build/lite/run_shell_cmd.py"
|
||||||
|
|
||||||
|
outputs = [
|
||||||
|
"${target_out_dir}/jffs2_build/fs/jffs2/background.c",
|
||||||
|
"${target_out_dir}/jffs2_build/fs/jffs2/build.c",
|
||||||
|
"${target_out_dir}/jffs2_build/fs/jffs2/compr.c",
|
||||||
|
"${target_out_dir}/jffs2_build/fs/jffs2/compr_rtime.c",
|
||||||
|
"${target_out_dir}/jffs2_build/fs/jffs2/compr_rubin.c",
|
||||||
|
"${target_out_dir}/jffs2_build/fs/jffs2/compr_zlib.c",
|
||||||
|
"${target_out_dir}/jffs2_build/fs/jffs2/debug.c",
|
||||||
|
"${target_out_dir}/jffs2_build/fs/jffs2/dir.c",
|
||||||
|
"${target_out_dir}/jffs2_build/fs/jffs2/erase.c",
|
||||||
|
"${target_out_dir}/jffs2_build/fs/jffs2/file.c",
|
||||||
|
"${target_out_dir}/jffs2_build/fs/jffs2/fs.c",
|
||||||
|
"${target_out_dir}/jffs2_build/fs/jffs2/gc.c",
|
||||||
|
"${target_out_dir}/jffs2_build/fs/jffs2/malloc.c",
|
||||||
|
"${target_out_dir}/jffs2_build/fs/jffs2/nodelist.c",
|
||||||
|
"${target_out_dir}/jffs2_build/fs/jffs2/nodemgmt.c",
|
||||||
|
"${target_out_dir}/jffs2_build/fs/jffs2/read.c",
|
||||||
|
"${target_out_dir}/jffs2_build/fs/jffs2/readinode.c",
|
||||||
|
"${target_out_dir}/jffs2_build/fs/jffs2/scan.c",
|
||||||
|
"${target_out_dir}/jffs2_build/fs/jffs2/summary.c",
|
||||||
|
"${target_out_dir}/jffs2_build/fs/jffs2/super.c",
|
||||||
|
"${target_out_dir}/jffs2_build/fs/jffs2/write.c",
|
||||||
|
"${target_out_dir}/jffs2_build/fs/jffs2/writev.c",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
|
@ -31,13 +31,51 @@ include $(LITEOSTOPDIR)/config.mk
|
||||||
|
|
||||||
MODULE_NAME := $(notdir $(shell pwd))
|
MODULE_NAME := $(notdir $(shell pwd))
|
||||||
|
|
||||||
LOCAL_SRCS := $(wildcard src/*.c) \
|
LINUX_PATH := $(LITEOSTOPDIR)/../linux/linux-5.10
|
||||||
$(wildcard $(LITEOSTHIRDPARTY)/Linux_Kernel/fs/jffs2/*.c)
|
LOCAL_PATH := $(shell pwd)
|
||||||
|
TEMP_SRC_PATH := $(OUT)/jffs2_build
|
||||||
|
|
||||||
|
LOCAL_SRCS := \
|
||||||
|
$(TEMP_SRC_PATH)/fs/jffs2/background.c \
|
||||||
|
$(TEMP_SRC_PATH)/fs/jffs2/build.c \
|
||||||
|
$(TEMP_SRC_PATH)/fs/jffs2/compr.c \
|
||||||
|
$(TEMP_SRC_PATH)/fs/jffs2/compr_rtime.c \
|
||||||
|
$(TEMP_SRC_PATH)/fs/jffs2/compr_rubin.c \
|
||||||
|
$(TEMP_SRC_PATH)/fs/jffs2/compr_zlib.c \
|
||||||
|
$(TEMP_SRC_PATH)/fs/jffs2/debug.c \
|
||||||
|
$(TEMP_SRC_PATH)/fs/jffs2/dir.c \
|
||||||
|
$(TEMP_SRC_PATH)/fs/jffs2/erase.c \
|
||||||
|
$(TEMP_SRC_PATH)/fs/jffs2/file.c \
|
||||||
|
$(TEMP_SRC_PATH)/fs/jffs2/fs.c \
|
||||||
|
$(TEMP_SRC_PATH)/fs/jffs2/gc.c \
|
||||||
|
$(TEMP_SRC_PATH)/fs/jffs2/malloc.c \
|
||||||
|
$(TEMP_SRC_PATH)/fs/jffs2/nodelist.c \
|
||||||
|
$(TEMP_SRC_PATH)/fs/jffs2/nodemgmt.c \
|
||||||
|
$(TEMP_SRC_PATH)/fs/jffs2/read.c \
|
||||||
|
$(TEMP_SRC_PATH)/fs/jffs2/readinode.c \
|
||||||
|
$(TEMP_SRC_PATH)/fs/jffs2/scan.c \
|
||||||
|
$(TEMP_SRC_PATH)/fs/jffs2/summary.c \
|
||||||
|
$(TEMP_SRC_PATH)/fs/jffs2/super.c \
|
||||||
|
$(TEMP_SRC_PATH)/fs/jffs2/write.c \
|
||||||
|
$(TEMP_SRC_PATH)/fs/jffs2/writev.c \
|
||||||
|
$(LOCAL_PATH)/src/jffs2_hash.c \
|
||||||
|
$(LOCAL_PATH)/src/vfs_jffs2.c \
|
||||||
|
|
||||||
LOCAL_INCLUDE := \
|
LOCAL_INCLUDE := \
|
||||||
-I $(LITEOSTOPDIR)/fs/jffs2/include \
|
-I $(LITEOSTOPDIR)/fs/jffs2/include \
|
||||||
-I $(LITEOSTHIRDPARTY)/Linux_Kernel/fs/jffs2 \
|
-I $(TEMP_SRC_PATH)/fs/jffs2 \
|
||||||
-I $(LITEOSTHIRDPARTY)/Linux_Kernel/fs
|
-I $(TEMP_SRC_PATH)/fs
|
||||||
LOCAL_FLAGS := $(LOCAL_INCLUDE)
|
LOCAL_FLAGS := $(LOCAL_INCLUDE)
|
||||||
|
|
||||||
|
.PHONY: patch patch_clean
|
||||||
|
$(LOCAL_SRCS): patch
|
||||||
|
|
||||||
|
patch: patch_clean
|
||||||
|
cp $(LINUX_PATH)/fs/jffs2 $(TEMP_SRC_PATH)/fs/. -r
|
||||||
|
cd $(TEMP_SRC_PATH) && patch -p1 < $(LOCAL_PATH)/jffs2.patch
|
||||||
|
|
||||||
|
patch_clean:
|
||||||
|
$(HIDE) $(RM) -rf $(TEMP_SRC_PATH)
|
||||||
|
|
||||||
include $(MODULE)
|
include $(MODULE)
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -55,14 +55,15 @@ INT32 OsMountPatchFs(VOID)
|
||||||
}
|
}
|
||||||
partInfo.fsType = strdup(FS_TYPE);
|
partInfo.fsType = strdup(FS_TYPE);
|
||||||
if (partInfo.fsType == NULL) {
|
if (partInfo.fsType == NULL) {
|
||||||
return LOS_NOK;
|
ret = LOS_NOK;
|
||||||
|
goto EXIT;
|
||||||
}
|
}
|
||||||
partInfo.startAddr = PATCHFS_FLASH_ADDR;
|
partInfo.startAddr = PATCHFS_FLASH_ADDR;
|
||||||
partInfo.partSize = PATCHFS_FLASH_SIZE;
|
partInfo.partSize = PATCHFS_FLASH_SIZE;
|
||||||
#else
|
#else
|
||||||
ret = GetPartitionInfo(&partInfo);
|
ret = GetPartitionInfo(&partInfo);
|
||||||
if (ret != LOS_OK) {
|
if (ret != LOS_OK) {
|
||||||
return ret;
|
goto EXIT;
|
||||||
}
|
}
|
||||||
partInfo.startAddr = (partInfo.startAddr >= 0) ? partInfo.startAddr : PATCHFS_FLASH_ADDR;
|
partInfo.startAddr = (partInfo.startAddr >= 0) ? partInfo.startAddr : PATCHFS_FLASH_ADDR;
|
||||||
partInfo.partSize = (partInfo.partSize >= 0) ? partInfo.partSize : PATCHFS_FLASH_SIZE;
|
partInfo.partSize = (partInfo.partSize >= 0) ? partInfo.partSize : PATCHFS_FLASH_SIZE;
|
||||||
|
@ -71,7 +72,7 @@ INT32 OsMountPatchFs(VOID)
|
||||||
ret = LOS_NOK;
|
ret = LOS_NOK;
|
||||||
partInfo.devName = strdup(PATCH_FLASH_DEV_NAME);
|
partInfo.devName = strdup(PATCH_FLASH_DEV_NAME);
|
||||||
if (partInfo.devName == NULL) {
|
if (partInfo.devName == NULL) {
|
||||||
return LOS_NOK;
|
goto EXIT;
|
||||||
}
|
}
|
||||||
const CHAR *devName = GetDevNameOfPartition(&partInfo);
|
const CHAR *devName = GetDevNameOfPartition(&partInfo);
|
||||||
if (devName != NULL) {
|
if (devName != NULL) {
|
||||||
|
@ -92,9 +93,13 @@ INT32 OsMountPatchFs(VOID)
|
||||||
ResetDevNameofPartition(&partInfo);
|
ResetDevNameofPartition(&partInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EXIT:
|
||||||
free(partInfo.devName);
|
free(partInfo.devName);
|
||||||
|
partInfo.devName = NULL;
|
||||||
free(partInfo.storageType);
|
free(partInfo.storageType);
|
||||||
|
partInfo.storageType = NULL;
|
||||||
free(partInfo.fsType);
|
free(partInfo.fsType);
|
||||||
|
partInfo.fsType = NULL;
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -60,7 +60,7 @@ typedef unsigned short fmode_t;
|
||||||
#define FMODE_64BITHASH ((fmode_t)0x400)
|
#define FMODE_64BITHASH ((fmode_t)0x400)
|
||||||
/* 32bit hashes as llseek() offset (for directories) */
|
/* 32bit hashes as llseek() offset (for directories) */
|
||||||
#define FMODE_32BITHASH ((fmode_t)0x200)
|
#define FMODE_32BITHASH ((fmode_t)0x200)
|
||||||
/* File is opened using open(.., 3, ..) and is writeable only for ioctls
|
/* File is opened using open(.., 3, ..) and is writable only for ioctls
|
||||||
* (specialy hack for floppy.c)
|
* (specialy hack for floppy.c)
|
||||||
*/
|
*/
|
||||||
#define FMODE_WRITE_IOCTL ((fmode_t)0x100)
|
#define FMODE_WRITE_IOCTL ((fmode_t)0x100)
|
||||||
|
|
|
@ -87,7 +87,7 @@ static struct ProcDirEntry *ProcFindNode(struct ProcDirEntry *parent, const char
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* descrition: find the file's handle
|
* description: find the file's handle
|
||||||
* path: the file of fullpath
|
* path: the file of fullpath
|
||||||
* return: the file of handle
|
* return: the file of handle
|
||||||
* add by ll
|
* add by ll
|
||||||
|
@ -519,7 +519,7 @@ int ProcOpen(struct ProcFile *procFile)
|
||||||
|
|
||||||
static int ProcRead(struct ProcDirEntry *pde, char *buf, size_t len)
|
static int ProcRead(struct ProcDirEntry *pde, char *buf, size_t len)
|
||||||
{
|
{
|
||||||
if (pde == NULL || pde == NULL || pde->pf == NULL) {
|
if (pde == NULL || pde->pf == NULL) {
|
||||||
return PROC_ERROR;
|
return PROC_ERROR;
|
||||||
}
|
}
|
||||||
struct ProcFile *procFile = pde->pf;
|
struct ProcFile *procFile = pde->pf;
|
||||||
|
|
|
@ -214,7 +214,7 @@ UINT64 LOS_SizeStrToNum(CHAR *value)
|
||||||
UINT64 num = 0;
|
UINT64 num = 0;
|
||||||
|
|
||||||
/* If the string is a hexadecimal value */
|
/* If the string is a hexadecimal value */
|
||||||
if (sscanf_s(value, "0x%x", &num) > 0) {
|
if (sscanf_s(value, "0x%llx", &num) > 0) {
|
||||||
value += strlen("0x");
|
value += strlen("0x");
|
||||||
if (strspn(value, "0123456789abcdefABCDEF") < strlen(value)) {
|
if (strspn(value, "0123456789abcdefABCDEF") < strlen(value)) {
|
||||||
goto ERROUT;
|
goto ERROUT;
|
||||||
|
|
|
@ -327,7 +327,7 @@ STATIC INT32 CheckValidation(UINT64 rootAddr, UINT64 rootSize, UINT64 userAddr,
|
||||||
|
|
||||||
if ((rootAddr & (alignSize - 1)) || (rootSize & (alignSize - 1)) ||
|
if ((rootAddr & (alignSize - 1)) || (rootSize & (alignSize - 1)) ||
|
||||||
(userAddr & (alignSize - 1)) || (userSize & (alignSize - 1))) {
|
(userAddr & (alignSize - 1)) || (userSize & (alignSize - 1))) {
|
||||||
PRINT_ERR("The address or size value should be 0x%x aligned!\n", alignSize);
|
PRINT_ERR("The address or size value should be 0x%llx aligned!\n", alignSize);
|
||||||
return LOS_NOK;
|
return LOS_NOK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -351,7 +351,7 @@ static INT32 BcacheSyncBlock(OsBcache *bc, OsBcacheBlock *block)
|
||||||
UINT32 len, start, end;
|
UINT32 len, start, end;
|
||||||
|
|
||||||
if (block->modified == TRUE) {
|
if (block->modified == TRUE) {
|
||||||
D(("bcache writting block = %llu\n", block->num));
|
D(("bcache writing block = %llu\n", block->num));
|
||||||
|
|
||||||
ret = FindFlagPos(block->flag, bc->sectorPerBlock >> UNINT_LOG2_SHIFT, &start, &end);
|
ret = FindFlagPos(block->flag, bc->sectorPerBlock >> UNINT_LOG2_SHIFT, &start, &end);
|
||||||
if (ret == ENOERR) {
|
if (ret == ENOERR) {
|
||||||
|
@ -932,7 +932,7 @@ INT32 BlockCacheWrite(OsBcache *bc, const UINT8 *buf, UINT32 *len, UINT64 sector
|
||||||
bc->modifiedBlock++;
|
bc->modifiedBlock++;
|
||||||
}
|
}
|
||||||
if ((pos == 0) && (currentSize == bc->blockSize)) {
|
if ((pos == 0) && (currentSize == bc->blockSize)) {
|
||||||
memset_s(block->flag, sizeof(block->flag), 0xFF, sizeof(block->flag));
|
(void)memset_s(block->flag, sizeof(block->flag), 0xFF, sizeof(block->flag));
|
||||||
block->allDirty = TRUE;
|
block->allDirty = TRUE;
|
||||||
} else {
|
} else {
|
||||||
BcacheSetFlag(bc, block, (UINT32)pos, currentSize);
|
BcacheSetFlag(bc, block, (UINT32)pos, currentSize);
|
||||||
|
|
|
@ -242,6 +242,11 @@ int epoll_ctl(int epfd, int op, int fd, struct epoll_event *ev)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ev == NULL) {
|
||||||
|
set_errno(EINVAL);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
switch (op) {
|
switch (op) {
|
||||||
case EPOLL_CTL_ADD:
|
case EPOLL_CTL_ADD:
|
||||||
ret = CheckFdExist(epHead, fd);
|
ret = CheckFdExist(epHead, fd);
|
||||||
|
@ -304,7 +309,7 @@ int epoll_wait(int epfd, FAR struct epoll_event *evs, int maxevents, int timeout
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (maxevents <= 0) {
|
if ((maxevents <= 0) || (evs == NULL)) {
|
||||||
set_errno(EINVAL);
|
set_errno(EINVAL);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,113 +37,172 @@
|
||||||
/* vnode operations returns EIO */
|
/* vnode operations returns EIO */
|
||||||
static int ErrorVopCreate(struct Vnode *parent, const char *name, int mode, struct Vnode **vnode)
|
static int ErrorVopCreate(struct Vnode *parent, const char *name, int mode, struct Vnode **vnode)
|
||||||
{
|
{
|
||||||
|
(void)parent;
|
||||||
|
(void)name;
|
||||||
|
(void)mode;
|
||||||
|
(void)vnode;
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ErrorVopLookup(struct Vnode *parent, const char *name, int len, struct Vnode **vnode)
|
static int ErrorVopLookup(struct Vnode *parent, const char *name, int len, struct Vnode **vnode)
|
||||||
{
|
{
|
||||||
|
(void)parent;
|
||||||
|
(void)name;
|
||||||
|
(void)len;
|
||||||
|
(void)vnode;
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ErrorVopOpen(struct Vnode *vnode, int fd, int mode, int flags)
|
static int ErrorVopOpen(struct Vnode *vnode, int fd, int mode, int flags)
|
||||||
{
|
{
|
||||||
|
(void)vnode;
|
||||||
|
(void)fd;
|
||||||
|
(void)mode;
|
||||||
|
(void)flags;
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ErrorVopClose(struct Vnode *vnode)
|
static int ErrorVopClose(struct Vnode *vnode)
|
||||||
{
|
{
|
||||||
|
(void)vnode;
|
||||||
/* already closed at force umount, do nothing here */
|
/* already closed at force umount, do nothing here */
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ErrorVopReclaim(struct Vnode *vnode)
|
static int ErrorVopReclaim(struct Vnode *vnode)
|
||||||
{
|
{
|
||||||
|
(void)vnode;
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ErrorVopUnlink(struct Vnode *parent, struct Vnode *vnode, const char *fileName)
|
static int ErrorVopUnlink(struct Vnode *parent, struct Vnode *vnode, const char *fileName)
|
||||||
{
|
{
|
||||||
|
(void)parent;
|
||||||
|
(void)vnode;
|
||||||
|
(void)fileName;
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ErrorVopRmdir(struct Vnode *parent, struct Vnode *vnode, const char *dirName)
|
static int ErrorVopRmdir(struct Vnode *parent, struct Vnode *vnode, const char *dirName)
|
||||||
{
|
{
|
||||||
|
(void)parent;
|
||||||
|
(void)vnode;
|
||||||
|
(void)dirName;
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ErrorVopMkdir(struct Vnode *parent, const char *dirName, mode_t mode, struct Vnode **vnode)
|
static int ErrorVopMkdir(struct Vnode *parent, const char *dirName, mode_t mode, struct Vnode **vnode)
|
||||||
{
|
{
|
||||||
|
(void)parent;
|
||||||
|
(void)dirName;
|
||||||
|
(void)mode;
|
||||||
|
(void)vnode;
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ErrorVopReaddir(struct Vnode *vnode, struct fs_dirent_s *dir)
|
static int ErrorVopReaddir(struct Vnode *vnode, struct fs_dirent_s *dir)
|
||||||
{
|
{
|
||||||
|
(void)vnode;
|
||||||
|
(void)dir;
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ErrorVopOpendir(struct Vnode *vnode, struct fs_dirent_s *dir)
|
static int ErrorVopOpendir(struct Vnode *vnode, struct fs_dirent_s *dir)
|
||||||
{
|
{
|
||||||
|
(void)vnode;
|
||||||
|
(void)dir;
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ErrorVopRewinddir(struct Vnode *vnode, struct fs_dirent_s *dir)
|
static int ErrorVopRewinddir(struct Vnode *vnode, struct fs_dirent_s *dir)
|
||||||
{
|
{
|
||||||
|
(void)vnode;
|
||||||
|
(void)dir;
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ErrorVopClosedir(struct Vnode *vnode, struct fs_dirent_s *dir)
|
static int ErrorVopClosedir(struct Vnode *vnode, struct fs_dirent_s *dir)
|
||||||
{
|
{
|
||||||
|
(void)vnode;
|
||||||
|
(void)dir;
|
||||||
/* already closed at force umount, do nothing here */
|
/* already closed at force umount, do nothing here */
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ErrorVopGetattr(struct Vnode *vnode, struct stat *st)
|
static int ErrorVopGetattr(struct Vnode *vnode, struct stat *st)
|
||||||
{
|
{
|
||||||
|
(void)vnode;
|
||||||
|
(void)st;
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ErrorVopSetattr(struct Vnode *vnode, struct stat *st)
|
static int ErrorVopSetattr(struct Vnode *vnode, struct stat *st)
|
||||||
{
|
{
|
||||||
|
(void)vnode;
|
||||||
|
(void)st;
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ErrorVopChattr(struct Vnode *vnode, struct IATTR *attr)
|
static int ErrorVopChattr(struct Vnode *vnode, struct IATTR *attr)
|
||||||
{
|
{
|
||||||
|
(void)vnode;
|
||||||
|
(void)attr;
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ErrorVopRename(struct Vnode *src, struct Vnode *dstParent, const char *srcName, const char *dstName)
|
static int ErrorVopRename(struct Vnode *src, struct Vnode *dstParent, const char *srcName, const char *dstName)
|
||||||
{
|
{
|
||||||
|
(void)src;
|
||||||
|
(void)dstParent;
|
||||||
|
(void)srcName;
|
||||||
|
(void)dstName;
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ErrorVopTruncate(struct Vnode *vnode, off_t len)
|
static int ErrorVopTruncate(struct Vnode *vnode, off_t len)
|
||||||
{
|
{
|
||||||
|
(void)vnode;
|
||||||
|
(void)len;
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ErrorVopTruncate64(struct Vnode *vnode, off64_t len)
|
static int ErrorVopTruncate64(struct Vnode *vnode, off64_t len)
|
||||||
{
|
{
|
||||||
|
(void)vnode;
|
||||||
|
(void)len;
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ErrorVopFscheck(struct Vnode *vnode, struct fs_dirent_s *dir)
|
static int ErrorVopFscheck(struct Vnode *vnode, struct fs_dirent_s *dir)
|
||||||
{
|
{
|
||||||
|
(void)vnode;
|
||||||
|
(void)dir;
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ErrorVopLink(struct Vnode *src, struct Vnode *dstParent, struct Vnode **dst, const char *dstName)
|
static int ErrorVopLink(struct Vnode *src, struct Vnode *dstParent, struct Vnode **dst, const char *dstName)
|
||||||
{
|
{
|
||||||
|
(void)src;
|
||||||
|
(void)dstParent;
|
||||||
|
(void)dst;
|
||||||
|
(void)dstName;
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ErrorVopSymlink(struct Vnode *parentVnode, struct Vnode **newVnode, const char *path, const char *target)
|
static int ErrorVopSymlink(struct Vnode *parentVnode, struct Vnode **newVnode, const char *path, const char *target)
|
||||||
{
|
{
|
||||||
|
(void)parentVnode;
|
||||||
|
(void)newVnode;
|
||||||
|
(void)path;
|
||||||
|
(void)target;
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
static ssize_t ErrorVopReadlink(struct Vnode *vnode, char *buffer, size_t bufLen)
|
static ssize_t ErrorVopReadlink(struct Vnode *vnode, char *buffer, size_t bufLen)
|
||||||
{
|
{
|
||||||
|
(void)vnode;
|
||||||
|
(void)buffer;
|
||||||
|
(void)bufLen;
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -175,72 +234,105 @@ static struct VnodeOps g_errorVnodeOps = {
|
||||||
/* file operations returns EIO */
|
/* file operations returns EIO */
|
||||||
static int ErrorFopOpen(struct file *filep)
|
static int ErrorFopOpen(struct file *filep)
|
||||||
{
|
{
|
||||||
|
(void)filep;
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ErrorFopClose(struct file *filep)
|
static int ErrorFopClose(struct file *filep)
|
||||||
{
|
{
|
||||||
|
(void)filep;
|
||||||
/* already closed at force umount, do nothing here */
|
/* already closed at force umount, do nothing here */
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static ssize_t ErrorFopRead(struct file *filep, char *buffer, size_t buflen)
|
static ssize_t ErrorFopRead(struct file *filep, char *buffer, size_t buflen)
|
||||||
{
|
{
|
||||||
|
(void)filep;
|
||||||
|
(void)buffer;
|
||||||
|
(void)buflen;
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
static ssize_t ErrorFopWrite(struct file *filep, const char *buffer, size_t buflen)
|
static ssize_t ErrorFopWrite(struct file *filep, const char *buffer, size_t buflen)
|
||||||
{
|
{
|
||||||
|
(void)filep;
|
||||||
|
(void)buffer;
|
||||||
|
(void)buflen;
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
static off_t ErrorFopSeek(struct file *filep, off_t offset, int whence)
|
static off_t ErrorFopSeek(struct file *filep, off_t offset, int whence)
|
||||||
{
|
{
|
||||||
|
(void)filep;
|
||||||
|
(void)offset;
|
||||||
|
(void)whence;
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ErrorFopIoctl(struct file *filep, int cmd, unsigned long arg)
|
static int ErrorFopIoctl(struct file *filep, int cmd, unsigned long arg)
|
||||||
{
|
{
|
||||||
|
(void)filep;
|
||||||
|
(void)cmd;
|
||||||
|
(void)arg;
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ErrorFopMmap(struct file* filep, struct VmMapRegion *region)
|
static int ErrorFopMmap(struct file* filep, struct VmMapRegion *region)
|
||||||
{
|
{
|
||||||
|
(void)filep;
|
||||||
|
(void)region;
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ErrorFopPoll(struct file *filep, poll_table *fds)
|
static int ErrorFopPoll(struct file *filep, poll_table *fds)
|
||||||
{
|
{
|
||||||
|
(void)filep;
|
||||||
|
(void)fds;
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ErrorFopStat(struct file *filep, struct stat* st)
|
static int ErrorFopStat(struct file *filep, struct stat* st)
|
||||||
{
|
{
|
||||||
|
(void)filep;
|
||||||
|
(void)st;
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ErrorFopFallocate(struct file* filep, int mode, off_t offset, off_t len)
|
static int ErrorFopFallocate(struct file* filep, int mode, off_t offset, off_t len)
|
||||||
{
|
{
|
||||||
|
(void)filep;
|
||||||
|
(void)mode;
|
||||||
|
(void)offset;
|
||||||
|
(void)len;
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ErrorFopFallocate64(struct file *filep, int mode, off64_t offset, off64_t len)
|
static int ErrorFopFallocate64(struct file *filep, int mode, off64_t offset, off64_t len)
|
||||||
{
|
{
|
||||||
|
(void)filep;
|
||||||
|
(void)mode;
|
||||||
|
(void)offset;
|
||||||
|
(void)len;
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ErrorFopFsync(struct file *filep)
|
static int ErrorFopFsync(struct file *filep)
|
||||||
{
|
{
|
||||||
|
(void)filep;
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
static ssize_t ErrorFopReadpage(struct file *filep, char *buffer, size_t buflen)
|
static ssize_t ErrorFopReadpage(struct file *filep, char *buffer, size_t buflen)
|
||||||
{
|
{
|
||||||
|
(void)filep;
|
||||||
|
(void)buffer;
|
||||||
|
(void)buflen;
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ErrorFopUnlink(struct Vnode *vnode)
|
static int ErrorFopUnlink(struct Vnode *vnode)
|
||||||
{
|
{
|
||||||
|
(void)vnode;
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -637,7 +637,7 @@ void ls(const char *pathname)
|
||||||
|
|
||||||
if (statInfo.st_mode & S_IFDIR) { /* list all directory and file */
|
if (statInfo.st_mode & S_IFDIR) { /* list all directory and file */
|
||||||
ret = LsDir((pathname == NULL) ? path : pathname);
|
ret = LsDir((pathname == NULL) ? path : pathname);
|
||||||
} else { /* show the file infomation */
|
} else { /* show the file information */
|
||||||
ret = LsFile(path);
|
ret = LsFile(path);
|
||||||
}
|
}
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
|
|
|
@ -654,7 +654,7 @@ static int os_shell_cmd_do_cp(const char *src_filepath, const char *dst_filename
|
||||||
char *dst_filepath = NULL;
|
char *dst_filepath = NULL;
|
||||||
char *buf = NULL;
|
char *buf = NULL;
|
||||||
const char *filename = NULL;
|
const char *filename = NULL;
|
||||||
size_t r_size, w_size;
|
ssize_t r_size, w_size;
|
||||||
int src_fd = -1;
|
int src_fd = -1;
|
||||||
int dst_fd = -1;
|
int dst_fd = -1;
|
||||||
struct stat stat_buf;
|
struct stat stat_buf;
|
||||||
|
@ -1391,8 +1391,8 @@ int checkNum(const char *arg)
|
||||||
#ifdef LOSCFG_KERNEL_SYSCALL
|
#ifdef LOSCFG_KERNEL_SYSCALL
|
||||||
int osShellCmdSu(int argc, const char **argv)
|
int osShellCmdSu(int argc, const char **argv)
|
||||||
{
|
{
|
||||||
unsigned int su_uid;
|
int su_uid;
|
||||||
unsigned int su_gid;
|
int su_gid;
|
||||||
|
|
||||||
if (argc == 0)
|
if (argc == 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -198,7 +198,7 @@ int VnodeFree(struct Vnode *vnode)
|
||||||
g_totalVnodeSize--;
|
g_totalVnodeSize--;
|
||||||
} else {
|
} else {
|
||||||
/* for normal vnode, reclaim it to g_VnodeFreeList */
|
/* for normal vnode, reclaim it to g_VnodeFreeList */
|
||||||
memset_s(vnode, sizeof(struct Vnode), 0, sizeof(struct Vnode));
|
(void)memset_s(vnode, sizeof(struct Vnode), 0, sizeof(struct Vnode));
|
||||||
LOS_ListAdd(&g_vnodeFreeList, &vnode->actFreeEntry);
|
LOS_ListAdd(&g_vnodeFreeList, &vnode->actFreeEntry);
|
||||||
g_freeVnodeSize++;
|
g_freeVnodeSize++;
|
||||||
}
|
}
|
||||||
|
@ -380,6 +380,11 @@ int VnodeLookupAt(const char *path, struct Vnode **result, uint32_t flags, struc
|
||||||
if (orgVnode != NULL) {
|
if (orgVnode != NULL) {
|
||||||
startVnode = orgVnode;
|
startVnode = orgVnode;
|
||||||
normalizedPath = strdup(path);
|
normalizedPath = strdup(path);
|
||||||
|
if (normalizedPath == NULL) {
|
||||||
|
PRINT_ERR("[VFS]lookup failed, strdup err\n");
|
||||||
|
ret = -EINVAL;
|
||||||
|
goto OUT_FREE_PATH;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
ret = PreProcess(path, &startVnode, &normalizedPath);
|
ret = PreProcess(path, &startVnode, &normalizedPath);
|
||||||
if (ret != LOS_OK) {
|
if (ret != LOS_OK) {
|
||||||
|
|
|
@ -176,7 +176,7 @@ STATIC ProcessGroup *OsFindProcessGroup(UINT32 gid)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
PRINT_INFO("%s is find group : %u failed!\n", __FUNCTION__, gid);
|
PRINT_INFO("%s failed! group id = %u\n", __FUNCTION__, gid);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2002,6 +2002,8 @@ LITE_OS_SEC_TEXT VOID LOS_Exit(INT32 status)
|
||||||
{
|
{
|
||||||
UINT32 intSave;
|
UINT32 intSave;
|
||||||
|
|
||||||
|
(void)status;
|
||||||
|
|
||||||
/* The exit of a kernel - state process must be kernel - state and all threads must actively exit */
|
/* The exit of a kernel - state process must be kernel - state and all threads must actively exit */
|
||||||
LosProcessCB *processCB = OsCurrProcessGet();
|
LosProcessCB *processCB = OsCurrProcessGet();
|
||||||
SCHEDULER_LOCK(intSave);
|
SCHEDULER_LOCK(intSave);
|
||||||
|
|
|
@ -168,6 +168,10 @@ LITE_OS_SEC_TEXT_INIT UINT32 OsSwtmrInit(VOID)
|
||||||
return LOS_OK;
|
return LOS_OK;
|
||||||
|
|
||||||
ERROR:
|
ERROR:
|
||||||
|
(VOID)LOS_MemFree(m_aucSysMem0, g_swtmrCBArray);
|
||||||
|
g_swtmrCBArray = NULL;
|
||||||
|
(VOID)LOS_MemFree(m_aucSysMem1, g_swtmrHandlerPool);
|
||||||
|
g_swtmrHandlerPool = NULL;
|
||||||
PRINT_ERR("OsSwtmrInit error! ret = %u\n", ret);
|
PRINT_ERR("OsSwtmrInit error! ret = %u\n", ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -278,7 +282,7 @@ LITE_OS_SEC_TEXT UINT32 OsSwtmrGetNextTimeout(VOID)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Description: Stop of Software Timer interface
|
* Description: Stop of Software Timer interface
|
||||||
* Input : swtmr --- the software timer contrl handler
|
* Input : swtmr --- the software timer control handler
|
||||||
*/
|
*/
|
||||||
LITE_OS_SEC_TEXT STATIC VOID OsSwtmrStop(SWTMR_CTRL_S *swtmr)
|
LITE_OS_SEC_TEXT STATIC VOID OsSwtmrStop(SWTMR_CTRL_S *swtmr)
|
||||||
{
|
{
|
||||||
|
@ -292,7 +296,7 @@ LITE_OS_SEC_TEXT STATIC VOID OsSwtmrStop(SWTMR_CTRL_S *swtmr)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Description: Get next software timer expiretime
|
* Description: Get next software timer expiretime
|
||||||
* Input : swtmr --- the software timer contrl handler
|
* Input : swtmr --- the software timer control handler
|
||||||
*/
|
*/
|
||||||
LITE_OS_SEC_TEXT STATIC UINT32 OsSwtmrTimeGet(const SWTMR_CTRL_S *swtmr)
|
LITE_OS_SEC_TEXT STATIC UINT32 OsSwtmrTimeGet(const SWTMR_CTRL_S *swtmr)
|
||||||
{
|
{
|
||||||
|
|
|
@ -277,9 +277,9 @@ STATIC INLINE UINT32 OsTaskSyncWait(const LosTaskCB *taskCB)
|
||||||
/*
|
/*
|
||||||
* gc soft timer works every OS_MP_GC_PERIOD period, to prevent this timer
|
* gc soft timer works every OS_MP_GC_PERIOD period, to prevent this timer
|
||||||
* triggered right at the timeout has reached, we set the timeout as double
|
* triggered right at the timeout has reached, we set the timeout as double
|
||||||
* of the gc peroid.
|
* of the gc period.
|
||||||
*/
|
*/
|
||||||
if (LOS_SemPend(taskCB->syncSignal, OS_MP_GC_PERIOD * 2) != LOS_OK) {
|
if (LOS_SemPend(taskCB->syncSignal, OS_MP_GC_PERIOD * 2) != LOS_OK) { /* 2: Wait 200 ms */
|
||||||
ret = LOS_ERRNO_TSK_MP_SYNC_FAILED;
|
ret = LOS_ERRNO_TSK_MP_SYNC_FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1257,19 +1257,19 @@ EXIT:
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
UINT32 OsUserTaskOperatePermissionsCheck(LosTaskCB *taskCB)
|
INT32 OsUserTaskOperatePermissionsCheck(const LosTaskCB *taskCB)
|
||||||
{
|
{
|
||||||
return OsUserProcessOperatePermissionsCheck(taskCB, OsCurrProcessGet()->processID);
|
return OsUserProcessOperatePermissionsCheck(taskCB, OsCurrProcessGet()->processID);
|
||||||
}
|
}
|
||||||
|
|
||||||
UINT32 OsUserProcessOperatePermissionsCheck(LosTaskCB *taskCB, UINT32 processID)
|
INT32 OsUserProcessOperatePermissionsCheck(const LosTaskCB *taskCB, UINT32 processID)
|
||||||
{
|
{
|
||||||
if (taskCB == NULL) {
|
if (taskCB == NULL) {
|
||||||
return LOS_EINVAL;
|
return LOS_EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (processID == OS_INVALID_VALUE) {
|
if (processID == OS_INVALID_VALUE) {
|
||||||
return OS_INVALID_VALUE;
|
return LOS_EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (taskCB->taskStatus & OS_TASK_STATUS_UNUSED) {
|
if (taskCB->taskStatus & OS_TASK_STATUS_UNUSED) {
|
||||||
|
|
|
@ -54,7 +54,7 @@ extern BOOL OsMemIsHeapNode(const VOID *ptr);
|
||||||
extern UINT32 OsShellCmdMemCheck(INT32 argc, const CHAR *argv[]);
|
extern UINT32 OsShellCmdMemCheck(INT32 argc, const CHAR *argv[]);
|
||||||
|
|
||||||
/* memory expand size at least 1/8 of pool size if we can */
|
/* memory expand size at least 1/8 of pool size if we can */
|
||||||
#define MEM_EXPAND_SIZE(poolSize) (poolSize >> 3)
|
#define MEM_EXPAND_SIZE(poolSize) ((poolSize) >> 3)
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
#if __cplusplus
|
#if __cplusplus
|
||||||
|
|
|
@ -138,28 +138,28 @@ STATIC INLINE BOOL OsSchedIsLock(VOID)
|
||||||
return (OsSchedRunQue()->taskLockCnt != 0);
|
return (OsSchedRunQue()->taskLockCnt != 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check if preemptable with counter flag */
|
/* Check if preemptible with counter flag */
|
||||||
STATIC INLINE BOOL OsPreemptable(VOID)
|
STATIC INLINE BOOL OsPreemptable(VOID)
|
||||||
{
|
{
|
||||||
SchedRunQue *rq = OsSchedRunQue();
|
SchedRunQue *rq = OsSchedRunQue();
|
||||||
/*
|
/*
|
||||||
* Unlike OsPreemptableInSched, the int may be not disabled when OsPreemptable
|
* Unlike OsPreemptableInSched, the int may be not disabled when OsPreemptable
|
||||||
* is called, needs mannually disable interrupt, to prevent current task from
|
* is called, needs manually disable interrupt, to prevent current task from
|
||||||
* being migrated to another core, and get the wrong preeptable status.
|
* being migrated to another core, and get the wrong preemptable status.
|
||||||
*/
|
*/
|
||||||
UINT32 intSave = LOS_IntLock();
|
UINT32 intSave = LOS_IntLock();
|
||||||
BOOL preemptable = (rq->taskLockCnt == 0);
|
BOOL preemptible = (rq->taskLockCnt == 0);
|
||||||
if (!preemptable) {
|
if (!preemptible) {
|
||||||
/* Set schedule flag if preemption is disabled */
|
/* Set schedule flag if preemption is disabled */
|
||||||
rq->schedFlag |= INT_PEND_RESCH;
|
rq->schedFlag |= INT_PEND_RESCH;
|
||||||
}
|
}
|
||||||
LOS_IntRestore(intSave);
|
LOS_IntRestore(intSave);
|
||||||
return preemptable;
|
return preemptible;
|
||||||
}
|
}
|
||||||
|
|
||||||
STATIC INLINE BOOL OsPreemptableInSched(VOID)
|
STATIC INLINE BOOL OsPreemptableInSched(VOID)
|
||||||
{
|
{
|
||||||
BOOL preemptable = FALSE;
|
BOOL preemptible = FALSE;
|
||||||
SchedRunQue *rq = OsSchedRunQue();
|
SchedRunQue *rq = OsSchedRunQue();
|
||||||
|
|
||||||
#ifdef LOSCFG_KERNEL_SMP
|
#ifdef LOSCFG_KERNEL_SMP
|
||||||
|
@ -167,17 +167,17 @@ STATIC INLINE BOOL OsPreemptableInSched(VOID)
|
||||||
* For smp systems, schedule must hold the task spinlock, and this counter
|
* For smp systems, schedule must hold the task spinlock, and this counter
|
||||||
* will increase by 1 in that case.
|
* will increase by 1 in that case.
|
||||||
*/
|
*/
|
||||||
preemptable = (rq->taskLockCnt == 1);
|
preemptible = (rq->taskLockCnt == 1);
|
||||||
|
|
||||||
#else
|
#else
|
||||||
preemptable = (rq->taskLockCnt == 0);
|
preemptible = (rq->taskLockCnt == 0);
|
||||||
#endif
|
#endif
|
||||||
if (!preemptable) {
|
if (!preemptible) {
|
||||||
/* Set schedule flag if preemption is disabled */
|
/* Set schedule flag if preemption is disabled */
|
||||||
rq->schedFlag |= INT_PEND_RESCH;
|
rq->schedFlag |= INT_PEND_RESCH;
|
||||||
}
|
}
|
||||||
|
|
||||||
return preemptable;
|
return preemptible;
|
||||||
}
|
}
|
||||||
|
|
||||||
STATIC INLINE UINT32 OsSchedGetRunQueIdle(VOID)
|
STATIC INLINE UINT32 OsSchedGetRunQueIdle(VOID)
|
||||||
|
|
|
@ -48,7 +48,7 @@ typedef struct {
|
||||||
} StackInfo;
|
} StackInfo;
|
||||||
|
|
||||||
#define OS_INVALID_WATERLINE 0xFFFFFFFF
|
#define OS_INVALID_WATERLINE 0xFFFFFFFF
|
||||||
#define OS_STACK_MAGIC_CHECK(topstack) (*(UINTPTR *)(topstack) == OS_STACK_MAGIC_WORD) /* 1:magic valid 0:unvalid */
|
#define OS_STACK_MAGIC_CHECK(topstack) (*(UINTPTR *)(topstack) == OS_STACK_MAGIC_WORD) /* 1:magic valid 0:invalid */
|
||||||
|
|
||||||
extern VOID OsExcStackInfo(VOID);
|
extern VOID OsExcStackInfo(VOID);
|
||||||
extern VOID OsExcStackInfoReg(const StackInfo *stackInfo, UINT32 stackNum);
|
extern VOID OsExcStackInfoReg(const StackInfo *stackInfo, UINT32 stackNum);
|
||||||
|
|
|
@ -43,9 +43,9 @@ extern "C" {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ingroup los_task
|
* @ingroup los_task
|
||||||
* Define task siginal types.
|
* Define task signal types.
|
||||||
*
|
*
|
||||||
* Task siginal types.
|
* Task signal types.
|
||||||
*/
|
*/
|
||||||
#define SIGNAL_NONE 0U
|
#define SIGNAL_NONE 0U
|
||||||
#define SIGNAL_KILL (1U << 0)
|
#define SIGNAL_KILL (1U << 0)
|
||||||
|
@ -323,8 +323,8 @@ extern UINT32 OsCreateUserTask(UINT32 processID, TSK_INIT_PARAM_S *initParam);
|
||||||
extern INT32 OsSetTaskName(LosTaskCB *taskCB, const CHAR *name, BOOL setPName);
|
extern INT32 OsSetTaskName(LosTaskCB *taskCB, const CHAR *name, BOOL setPName);
|
||||||
extern VOID OsTaskCBRecycleToFree(VOID);
|
extern VOID OsTaskCBRecycleToFree(VOID);
|
||||||
extern VOID OsRunningTaskToExit(LosTaskCB *runTask, UINT32 status);
|
extern VOID OsRunningTaskToExit(LosTaskCB *runTask, UINT32 status);
|
||||||
extern UINT32 OsUserTaskOperatePermissionsCheck(LosTaskCB *taskCB);
|
extern INT32 OsUserTaskOperatePermissionsCheck(const LosTaskCB *taskCB);
|
||||||
extern UINT32 OsUserProcessOperatePermissionsCheck(LosTaskCB *taskCB, UINT32 processID);
|
extern INT32 OsUserProcessOperatePermissionsCheck(const LosTaskCB *taskCB, UINT32 processID);
|
||||||
extern INT32 OsTcbDispatch(LosTaskCB *stcb, siginfo_t *info);
|
extern INT32 OsTcbDispatch(LosTaskCB *stcb, siginfo_t *info);
|
||||||
extern VOID OsWriteResourceEvent(UINT32 events);
|
extern VOID OsWriteResourceEvent(UINT32 events);
|
||||||
extern VOID OsWriteResourceEventUnsafe(UINT32 events);
|
extern VOID OsWriteResourceEventUnsafe(UINT32 events);
|
||||||
|
|
|
@ -50,7 +50,7 @@ extern "C" {
|
||||||
#define min(x, y) ((x) < (y) ? (x) : (y))
|
#define min(x, y) ((x) < (y) ? (x) : (y))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define VM_PAGE_TO_PHYS(page) (page->physAddr)
|
#define VM_PAGE_TO_PHYS(page) ((page)->physAddr)
|
||||||
#define VM_ORDER_TO_PAGES(order) (1 << (order))
|
#define VM_ORDER_TO_PAGES(order) (1 << (order))
|
||||||
#define VM_ORDER_TO_PHYS(order) (1 << (PAGE_SHIFT + (order)))
|
#define VM_ORDER_TO_PHYS(order) (1 << (PAGE_SHIFT + (order)))
|
||||||
#define VM_PHYS_TO_ORDER(phys) (min(LOS_LowBitGet((phys) >> PAGE_SHIFT), VM_LIST_ORDER_MAX - 1))
|
#define VM_PHYS_TO_ORDER(phys) (min(LOS_LowBitGet((phys) >> PAGE_SHIFT), VM_LIST_ORDER_MAX - 1))
|
||||||
|
|
|
@ -86,18 +86,18 @@ extern "C" {
|
||||||
#define PERIPH_UNCACHED_SIZE U32_C(PERIPH_PMM_SIZE)
|
#define PERIPH_UNCACHED_SIZE U32_C(PERIPH_PMM_SIZE)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define IO_DEVICE_ADDR(paddr) (paddr - PERIPH_PMM_BASE + PERIPH_DEVICE_BASE)
|
#define IO_DEVICE_ADDR(paddr) ((paddr) - PERIPH_PMM_BASE + PERIPH_DEVICE_BASE)
|
||||||
#define IO_CACHED_ADDR(paddr) (paddr - PERIPH_PMM_BASE + PERIPH_CACHED_BASE)
|
#define IO_CACHED_ADDR(paddr) ((paddr) - PERIPH_PMM_BASE + PERIPH_CACHED_BASE)
|
||||||
#define IO_UNCACHED_ADDR(paddr) (paddr - PERIPH_PMM_BASE + PERIPH_UNCACHED_BASE)
|
#define IO_UNCACHED_ADDR(paddr) ((paddr) - PERIPH_PMM_BASE + PERIPH_UNCACHED_BASE)
|
||||||
|
|
||||||
#define MEM_CACHED_ADDR(paddr) (paddr - DDR_MEM_ADDR + KERNEL_VMM_BASE)
|
#define MEM_CACHED_ADDR(paddr) ((paddr) - DDR_MEM_ADDR + KERNEL_VMM_BASE)
|
||||||
#define MEM_UNCACHED_ADDR(paddr) (paddr - DDR_MEM_ADDR + UNCACHED_VMM_BASE)
|
#define MEM_UNCACHED_ADDR(paddr) ((paddr) - DDR_MEM_ADDR + UNCACHED_VMM_BASE)
|
||||||
|
|
||||||
#define VMM_TO_UNCACHED_ADDR(vaddr) (vaddr - KERNEL_VMM_BASE + UNCACHED_VMM_BASE)
|
#define VMM_TO_UNCACHED_ADDR(vaddr) ((vaddr) - KERNEL_VMM_BASE + UNCACHED_VMM_BASE)
|
||||||
#define UNCACHED_TO_VMM_ADDR(vaddr) (vaddr - UNCACHED_VMM_BASE + KERNEL_VMM_BASE)
|
#define UNCACHED_TO_VMM_ADDR(vaddr) ((vaddr) - UNCACHED_VMM_BASE + KERNEL_VMM_BASE)
|
||||||
|
|
||||||
#define VMM_TO_DMA_ADDR(vaddr) (vaddr - KERNEL_VMM_BASE + SYS_MEM_BASE)
|
#define VMM_TO_DMA_ADDR(vaddr) ((vaddr) - KERNEL_VMM_BASE + SYS_MEM_BASE)
|
||||||
#define DMA_TO_VMM_ADDR(vaddr) (vaddr - SYS_MEM_BASE + KERNEL_VMM_BASE)
|
#define DMA_TO_VMM_ADDR(vaddr) ((vaddr) - SYS_MEM_BASE + KERNEL_VMM_BASE)
|
||||||
|
|
||||||
#if (PERIPH_UNCACHED_BASE >= (0xFFFFFFFFU - PERIPH_UNCACHED_SIZE))
|
#if (PERIPH_UNCACHED_BASE >= (0xFFFFFFFFU - PERIPH_UNCACHED_SIZE))
|
||||||
#error "Kernel virtual memory space has overflowed!"
|
#error "Kernel virtual memory space has overflowed!"
|
||||||
|
|
|
@ -112,16 +112,16 @@ STATIC VOID OsFutexShowTaskNodeAttr(const LOS_DL_LIST *futexList)
|
||||||
LOS_DL_LIST *queueList = NULL;
|
LOS_DL_LIST *queueList = NULL;
|
||||||
|
|
||||||
tempNode = OS_FUTEX_FROM_FUTEXLIST(futexList);
|
tempNode = OS_FUTEX_FROM_FUTEXLIST(futexList);
|
||||||
PRINTK("key(pid) : 0x%x(%d) : ->", tempNode->key, tempNode->pid);
|
PRINTK("key(pid) : 0x%x(%u) : ->", tempNode->key, tempNode->pid);
|
||||||
|
|
||||||
for (queueList = &tempNode->queueList; ;) {
|
for (queueList = &tempNode->queueList; ;) {
|
||||||
lastNode = OS_FUTEX_FROM_QUEUELIST(queueList);
|
lastNode = OS_FUTEX_FROM_QUEUELIST(queueList);
|
||||||
if (!LOS_ListEmpty(&(lastNode->pendList))) {
|
if (!LOS_ListEmpty(&(lastNode->pendList))) {
|
||||||
taskCB = OS_TCB_FROM_PENDLIST(LOS_DL_LIST_FIRST(&(lastNode->pendList)));
|
taskCB = OS_TCB_FROM_PENDLIST(LOS_DL_LIST_FIRST(&(lastNode->pendList)));
|
||||||
PRINTK(" %d(%d) ->", taskCB->taskID, taskCB->priority);
|
PRINTK(" %u(%u) ->", taskCB->taskID, taskCB->priority);
|
||||||
} else {
|
} else {
|
||||||
taskCB = LOS_DL_LIST_ENTRY(lastNode, LosTaskCB, futex);
|
taskCB = LOS_DL_LIST_ENTRY(lastNode, LosTaskCB, futex);
|
||||||
PRINTK(" %d(%d) ->", taskCB->taskID, -1);
|
PRINTK(" %u(%d) ->", taskCB->taskID, -1);
|
||||||
}
|
}
|
||||||
queueList = queueList->pstNext;
|
queueList = queueList->pstNext;
|
||||||
if (queueList == &tempNode->queueList) {
|
if (queueList == &tempNode->queueList) {
|
||||||
|
|
|
@ -82,7 +82,7 @@ VOID OsQueueDbgUpdate(UINT32 queueID, TSK_ENTRY_FUNC entry)
|
||||||
STATIC INLINE VOID OsQueueInfoOutPut(const LosQueueCB *node)
|
STATIC INLINE VOID OsQueueInfoOutPut(const LosQueueCB *node)
|
||||||
{
|
{
|
||||||
PRINTK("Queue ID <0x%x> may leak, queue len is 0x%x, "
|
PRINTK("Queue ID <0x%x> may leak, queue len is 0x%x, "
|
||||||
"readable cnt:0x%x, writeable cnt:0x%x, ",
|
"readable cnt:0x%x, writable cnt:0x%x, ",
|
||||||
node->queueID,
|
node->queueID,
|
||||||
node->queueLen,
|
node->queueLen,
|
||||||
node->readWriteableCnt[OS_QUEUE_READ],
|
node->readWriteableCnt[OS_QUEUE_READ],
|
||||||
|
|
|
@ -93,7 +93,7 @@ LITE_OS_SEC_TEXT_INIT UINT32 LOS_MemboxInit(VOID *pool, UINT32 poolSize, UINT32
|
||||||
}
|
}
|
||||||
|
|
||||||
MEMBOX_LOCK(intSave);
|
MEMBOX_LOCK(intSave);
|
||||||
boxInfo->uwBlkSize = LOS_MEMBOX_ALLIGNED(blkSize + OS_MEMBOX_NODE_HEAD_SIZE);
|
boxInfo->uwBlkSize = LOS_MEMBOX_ALIGNED(blkSize + OS_MEMBOX_NODE_HEAD_SIZE);
|
||||||
boxInfo->uwBlkNum = (poolSize - sizeof(LOS_MEMBOX_INFO)) / boxInfo->uwBlkSize;
|
boxInfo->uwBlkNum = (poolSize - sizeof(LOS_MEMBOX_INFO)) / boxInfo->uwBlkSize;
|
||||||
boxInfo->uwBlkCnt = 0;
|
boxInfo->uwBlkCnt = 0;
|
||||||
if (boxInfo->uwBlkNum == 0) {
|
if (boxInfo->uwBlkNum == 0) {
|
||||||
|
|
|
@ -169,7 +169,7 @@ struct OsMemPoolHead {
|
||||||
|
|
||||||
/* The memory pool support expand. */
|
/* The memory pool support expand. */
|
||||||
#define OS_MEM_POOL_EXPAND_ENABLE 0x01
|
#define OS_MEM_POOL_EXPAND_ENABLE 0x01
|
||||||
/* The memory pool ssupport no lock. */
|
/* The memory pool support no lock. */
|
||||||
#define OS_MEM_POOL_LOCK_ENABLE 0x02
|
#define OS_MEM_POOL_LOCK_ENABLE 0x02
|
||||||
|
|
||||||
#define OS_MEM_NODE_MAGIC 0xABCDDCBA
|
#define OS_MEM_NODE_MAGIC 0xABCDDCBA
|
||||||
|
@ -486,7 +486,7 @@ STATIC INLINE VOID OsLmsAllocAlignMark(VOID *ptr, VOID *alignedPtr, UINT32 size)
|
||||||
g_lms->simpleMark((UINTPTR)ptr + sizeof(UINT32), (UINTPTR)alignedPtr, LMS_SHADOW_REDZONE_U8);
|
g_lms->simpleMark((UINTPTR)ptr + sizeof(UINT32), (UINTPTR)alignedPtr, LMS_SHADOW_REDZONE_U8);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* mark remining as redzone */
|
/* mark remaining as redzone */
|
||||||
g_lms->simpleMark(LMS_ADDR_ALIGN((UINTPTR)alignedPtr + size), (UINTPTR)OS_MEM_NEXT_NODE(allocNode),
|
g_lms->simpleMark(LMS_ADDR_ALIGN((UINTPTR)alignedPtr + size), (UINTPTR)OS_MEM_NEXT_NODE(allocNode),
|
||||||
LMS_SHADOW_REDZONE_U8);
|
LMS_SHADOW_REDZONE_U8);
|
||||||
}
|
}
|
||||||
|
@ -649,9 +649,12 @@ STATIC INLINE struct OsMemFreeNodeHead *OsMemFindCurSuitableBlock(struct OsMemPo
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define BITMAP_INDEX(index) ((index) >> 5)
|
||||||
STATIC INLINE UINT32 OsMemNotEmptyIndexGet(struct OsMemPoolHead *poolHead, UINT32 index)
|
STATIC INLINE UINT32 OsMemNotEmptyIndexGet(struct OsMemPoolHead *poolHead, UINT32 index)
|
||||||
{
|
{
|
||||||
UINT32 mask = poolHead->freeListBitmap[index >> 5]; /* 5: Divide by 32 to calculate the index of the bitmap array. */
|
UINT32 mask;
|
||||||
|
|
||||||
|
mask = poolHead->freeListBitmap[BITMAP_INDEX(index)];
|
||||||
mask &= ~((1 << (index & OS_MEM_BITMAP_MASK)) - 1);
|
mask &= ~((1 << (index & OS_MEM_BITMAP_MASK)) - 1);
|
||||||
if (mask != 0) {
|
if (mask != 0) {
|
||||||
index = OsMemFFS(mask) + (index & ~OS_MEM_BITMAP_MASK);
|
index = OsMemFFS(mask) + (index & ~OS_MEM_BITMAP_MASK);
|
||||||
|
@ -685,8 +688,8 @@ STATIC INLINE struct OsMemFreeNodeHead *OsMemFindNextSuitableBlock(VOID *pool, U
|
||||||
goto DONE;
|
goto DONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (index = LOS_Align(index + 1, 32); index < OS_MEM_FREE_LIST_COUNT; index += 32) {
|
for (index = LOS_Align(index + 1, 32); index < OS_MEM_FREE_LIST_COUNT; index += 32) { /* 32: align size */
|
||||||
mask = poolHead->freeListBitmap[index >> 5]; /* 5: Divide by 32 to calculate the index of the bitmap array. */
|
mask = poolHead->freeListBitmap[BITMAP_INDEX(index)];
|
||||||
if (mask != 0) {
|
if (mask != 0) {
|
||||||
index = OsMemFFS(mask) + index;
|
index = OsMemFFS(mask) + index;
|
||||||
goto DONE;
|
goto DONE;
|
||||||
|
@ -707,12 +710,12 @@ DONE:
|
||||||
|
|
||||||
STATIC INLINE VOID OsMemSetFreeListBit(struct OsMemPoolHead *head, UINT32 index)
|
STATIC INLINE VOID OsMemSetFreeListBit(struct OsMemPoolHead *head, UINT32 index)
|
||||||
{
|
{
|
||||||
head->freeListBitmap[index >> 5] |= 1U << (index & 0x1f); /* 5: Divide by 32 to calculate the index of the bitmap array. */
|
head->freeListBitmap[BITMAP_INDEX(index)] |= 1U << (index & 0x1f);
|
||||||
}
|
}
|
||||||
|
|
||||||
STATIC INLINE VOID OsMemClearFreeListBit(struct OsMemPoolHead *head, UINT32 index)
|
STATIC INLINE VOID OsMemClearFreeListBit(struct OsMemPoolHead *head, UINT32 index)
|
||||||
{
|
{
|
||||||
head->freeListBitmap[index >> 5] &= ~(1U << (index & 0x1f)); /* 5: Divide by 32 to calculate the index of the bitmap array. */
|
head->freeListBitmap[BITMAP_INDEX(index)] &= ~(1U << (index & 0x1f));
|
||||||
}
|
}
|
||||||
|
|
||||||
STATIC INLINE VOID OsMemListAdd(struct OsMemPoolHead *pool, UINT32 listIndex, struct OsMemFreeNodeHead *node)
|
STATIC INLINE VOID OsMemListAdd(struct OsMemPoolHead *pool, UINT32 listIndex, struct OsMemFreeNodeHead *node)
|
||||||
|
@ -1183,42 +1186,45 @@ STATIC INLINE BOOL OsMemIsNodeValid(const struct OsMemNodeHead *node, const stru
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
STATIC UINT32 OsMemCheckUsedNode(const struct OsMemPoolHead *pool, const struct OsMemNodeHead *node)
|
STATIC BOOL MemCheckUsedNode(const struct OsMemPoolHead *pool, const struct OsMemNodeHead *node,
|
||||||
|
const struct OsMemNodeHead *startNode, const struct OsMemNodeHead *endNode)
|
||||||
{
|
{
|
||||||
struct OsMemNodeHead *startNode = (struct OsMemNodeHead *)OS_MEM_FIRST_NODE(pool);
|
|
||||||
struct OsMemNodeHead *endNode = (struct OsMemNodeHead *)OS_MEM_END_NODE(pool, pool->info.totalSize);
|
|
||||||
struct OsMemNodeHead *nextNode = NULL;
|
|
||||||
BOOL doneFlag = FALSE;
|
|
||||||
|
|
||||||
do {
|
|
||||||
do {
|
|
||||||
if (!OsMemIsNodeValid(node, startNode, endNode, pool)) {
|
if (!OsMemIsNodeValid(node, startNode, endNode, pool)) {
|
||||||
break;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!OS_MEM_NODE_GET_USED_FLAG(node->sizeAndFlag)) {
|
if (!OS_MEM_NODE_GET_USED_FLAG(node->sizeAndFlag)) {
|
||||||
break;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
nextNode = OS_MEM_NEXT_NODE(node);
|
const struct OsMemNodeHead *nextNode = OS_MEM_NEXT_NODE(node);
|
||||||
if (!OsMemIsNodeValid(nextNode, startNode, endNode, pool)) {
|
if (!OsMemIsNodeValid(nextNode, startNode, endNode, pool)) {
|
||||||
break;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!OS_MEM_NODE_GET_LAST_FLAG(nextNode->sizeAndFlag)) {
|
if (!OS_MEM_NODE_GET_LAST_FLAG(nextNode->sizeAndFlag)) {
|
||||||
if (nextNode->ptr.prev != node) {
|
if (nextNode->ptr.prev != node) {
|
||||||
break;
|
return FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((node != startNode) &&
|
if ((node != startNode) &&
|
||||||
((!OsMemIsNodeValid(node->ptr.prev, startNode, endNode, pool)) ||
|
((!OsMemIsNodeValid(node->ptr.prev, startNode, endNode, pool)) ||
|
||||||
(OS_MEM_NEXT_NODE(node->ptr.prev) != node))) {
|
(OS_MEM_NEXT_NODE(node->ptr.prev) != node))) {
|
||||||
break;
|
return FALSE;
|
||||||
}
|
}
|
||||||
doneFlag = TRUE;
|
|
||||||
} while (0);
|
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
STATIC UINT32 OsMemCheckUsedNode(const struct OsMemPoolHead *pool, const struct OsMemNodeHead *node)
|
||||||
|
{
|
||||||
|
struct OsMemNodeHead *startNode = (struct OsMemNodeHead *)OS_MEM_FIRST_NODE(pool);
|
||||||
|
struct OsMemNodeHead *endNode = (struct OsMemNodeHead *)OS_MEM_END_NODE(pool, pool->info.totalSize);
|
||||||
|
BOOL doneFlag = FALSE;
|
||||||
|
|
||||||
|
do {
|
||||||
|
doneFlag = MemCheckUsedNode(pool, node, startNode, endNode);
|
||||||
if (!doneFlag) {
|
if (!doneFlag) {
|
||||||
#if OS_MEM_EXPAND_ENABLE
|
#if OS_MEM_EXPAND_ENABLE
|
||||||
if (OsMemIsLastSentinelNode(endNode) == FALSE) {
|
if (OsMemIsLastSentinelNode(endNode) == FALSE) {
|
||||||
|
@ -1291,16 +1297,17 @@ STATIC INLINE UINT32 OsMemFree(struct OsMemPoolHead *pool, struct OsMemNodeHead
|
||||||
|
|
||||||
UINT32 LOS_MemFree(VOID *pool, VOID *ptr)
|
UINT32 LOS_MemFree(VOID *pool, VOID *ptr)
|
||||||
{
|
{
|
||||||
|
UINT32 intSave;
|
||||||
|
UINT32 ret = LOS_NOK;
|
||||||
|
|
||||||
if ((pool == NULL) || (ptr == NULL) || !OS_MEM_IS_ALIGNED(pool, sizeof(VOID *)) ||
|
if ((pool == NULL) || (ptr == NULL) || !OS_MEM_IS_ALIGNED(pool, sizeof(VOID *)) ||
|
||||||
!OS_MEM_IS_ALIGNED(ptr, sizeof(VOID *))) {
|
!OS_MEM_IS_ALIGNED(ptr, sizeof(VOID *))) {
|
||||||
return LOS_NOK;
|
return ret;
|
||||||
}
|
}
|
||||||
OsHookCall(LOS_HOOK_TYPE_MEM_FREE, pool, ptr);
|
OsHookCall(LOS_HOOK_TYPE_MEM_FREE, pool, ptr);
|
||||||
|
|
||||||
UINT32 ret = LOS_NOK;
|
|
||||||
struct OsMemPoolHead *poolHead = (struct OsMemPoolHead *)pool;
|
struct OsMemPoolHead *poolHead = (struct OsMemPoolHead *)pool;
|
||||||
struct OsMemNodeHead *node = NULL;
|
struct OsMemNodeHead *node = NULL;
|
||||||
UINT32 intSave;
|
|
||||||
|
|
||||||
do {
|
do {
|
||||||
UINT32 gapSize = *(UINT32 *)((UINTPTR)ptr - sizeof(UINT32));
|
UINT32 gapSize = *(UINT32 *)((UINTPTR)ptr - sizeof(UINT32));
|
||||||
|
@ -1741,7 +1748,7 @@ STATIC VOID OsMemNodeInfo(const struct OsMemNodeHead *tmpNode,
|
||||||
usedNode->header.ptr.prev, usedNode->header.magic, usedNode->header.sizeAndFlag);
|
usedNode->header.ptr.prev, usedNode->header.magic, usedNode->header.sizeAndFlag);
|
||||||
} else {
|
} else {
|
||||||
freeNode = (struct OsMemFreeNodeHead *)tmpNode;
|
freeNode = (struct OsMemFreeNodeHead *)tmpNode;
|
||||||
PRINTK("\n broken node head: %#x %#x %#x %#x, ",
|
PRINTK("\n broken node head: %#x %#x %#x %#x, %#x",
|
||||||
freeNode->header.ptr.prev, freeNode->next, freeNode->prev, freeNode->header.magic,
|
freeNode->header.ptr.prev, freeNode->next, freeNode->prev, freeNode->header.magic,
|
||||||
freeNode->header.sizeAndFlag);
|
freeNode->header.sizeAndFlag);
|
||||||
}
|
}
|
||||||
|
@ -1752,7 +1759,7 @@ STATIC VOID OsMemNodeInfo(const struct OsMemNodeHead *tmpNode,
|
||||||
usedNode->header.ptr.prev, usedNode->header.magic, usedNode->header.sizeAndFlag);
|
usedNode->header.ptr.prev, usedNode->header.magic, usedNode->header.sizeAndFlag);
|
||||||
} else {
|
} else {
|
||||||
freeNode = (struct OsMemFreeNodeHead *)preNode;
|
freeNode = (struct OsMemFreeNodeHead *)preNode;
|
||||||
PRINTK("prev node head: %#x %#x %#x %#x, ",
|
PRINTK("prev node head: %#x %#x %#x %#x, %#x",
|
||||||
freeNode->header.ptr.prev, freeNode->next, freeNode->prev, freeNode->header.magic,
|
freeNode->header.ptr.prev, freeNode->next, freeNode->prev, freeNode->header.magic,
|
||||||
freeNode->header.sizeAndFlag);
|
freeNode->header.sizeAndFlag);
|
||||||
}
|
}
|
||||||
|
@ -1804,7 +1811,7 @@ STATIC VOID OsMemIntegrityCheckError(struct OsMemPoolHead *pool,
|
||||||
tmpNode, preNode, taskCB->taskName);
|
tmpNode, preNode, taskCB->taskName);
|
||||||
#else
|
#else
|
||||||
MEM_UNLOCK(pool, intSave);
|
MEM_UNLOCK(pool, intSave);
|
||||||
LOS_Panic("Memory interity check error, cur node: %#x, pre node: %#x\n", tmpNode, preNode);
|
LOS_Panic("Memory integrity check error, cur node: %#x, pre node: %#x\n", tmpNode, preNode);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1994,8 +2001,10 @@ UINT32 LOS_MemFreeNodeShow(VOID *pool)
|
||||||
} else {
|
} else {
|
||||||
UINT32 val = 1 << (((index - OS_MEM_SMALL_BUCKET_COUNT) >> OS_MEM_SLI) + OS_MEM_LARGE_START_BUCKET);
|
UINT32 val = 1 << (((index - OS_MEM_SMALL_BUCKET_COUNT) >> OS_MEM_SLI) + OS_MEM_LARGE_START_BUCKET);
|
||||||
UINT32 offset = val >> OS_MEM_SLI;
|
UINT32 offset = val >> OS_MEM_SLI;
|
||||||
PRINTK("size: [%#x, %#x], num: %u\n", (offset * ((index - OS_MEM_SMALL_BUCKET_COUNT) % (1 << OS_MEM_SLI))) + val,
|
PRINTK("size: [%#x, %#x], num: %u\n",
|
||||||
((offset * (((index - OS_MEM_SMALL_BUCKET_COUNT) % (1 << OS_MEM_SLI)) + 1)) + val - 1), countNum[index]);
|
(offset * ((index - OS_MEM_SMALL_BUCKET_COUNT) % (1 << OS_MEM_SLI))) + val,
|
||||||
|
((offset * (((index - OS_MEM_SMALL_BUCKET_COUNT) % (1 << OS_MEM_SLI)) + 1)) + val - 1),
|
||||||
|
countNum[index]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
PRINTK("\n ********************************************************************\n\n");
|
PRINTK("\n ********************************************************************\n\n");
|
||||||
|
|
|
@ -117,9 +117,11 @@ VOID OsExcStackInfoReg(const StackInfo *stackInfo, UINT32 stackNum)
|
||||||
VOID OsStackInit(VOID *stacktop, UINT32 stacksize)
|
VOID OsStackInit(VOID *stacktop, UINT32 stacksize)
|
||||||
{
|
{
|
||||||
/* initialize the task stack, write magic num to stack top */
|
/* initialize the task stack, write magic num to stack top */
|
||||||
(VOID)memset_s(stacktop, stacksize, (INT32)OS_STACK_INIT, stacksize);
|
errno_t ret = memset_s(stacktop, stacksize, (INT32)OS_STACK_INIT, stacksize);
|
||||||
|
if (ret == EOK) {
|
||||||
*((UINTPTR *)stacktop) = OS_STACK_MAGIC_WORD;
|
*((UINTPTR *)stacktop) = OS_STACK_MAGIC_WORD;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef LOSCFG_SHELL_CMD_DEBUG
|
#ifdef LOSCFG_SHELL_CMD_DEBUG
|
||||||
SHELLCMD_ENTRY(stack_shellcmd, CMD_TYPE_EX, "stack", 1, (CmdCallBackFunc)OsExcStackInfo);
|
SHELLCMD_ENTRY(stack_shellcmd, CMD_TYPE_EX, "stack", 1, (CmdCallBackFunc)OsExcStackInfo);
|
||||||
|
|
|
@ -87,7 +87,7 @@ STATIC INLINE CHAR *OsLockDepErrorStringGet(enum LockDepErrType type)
|
||||||
errorString = "lockdep overflow";
|
errorString = "lockdep overflow";
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
errorString = "unknow error code";
|
errorString = "unknown error code";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -142,7 +142,7 @@ STATIC VOID OsLockDepDumpLock(const LosTaskCB *task, const SPIN_LOCK_S *lock,
|
||||||
OsPrintLockDepInfo("task name : %s\n", temp->taskName);
|
OsPrintLockDepInfo("task name : %s\n", temp->taskName);
|
||||||
OsPrintLockDepInfo("task id : %u\n", temp->taskID);
|
OsPrintLockDepInfo("task id : %u\n", temp->taskID);
|
||||||
OsPrintLockDepInfo("cpu num : %u\n", temp->currCpu);
|
OsPrintLockDepInfo("cpu num : %u\n", temp->currCpu);
|
||||||
OsPrintLockDepInfo("start dumping lockdep infomation\n");
|
OsPrintLockDepInfo("start dumping lockdep information\n");
|
||||||
for (i = 0; i < lockDep->lockDepth; i++) {
|
for (i = 0; i < lockDep->lockDepth; i++) {
|
||||||
if (lockDep->heldLocks[i].lockPtr == lock) {
|
if (lockDep->heldLocks[i].lockPtr == lock) {
|
||||||
OsPrintLockDepInfo("[%d] %s <-- addr:0x%x\n", i, LOCKDEP_GET_NAME(lockDep, i),
|
OsPrintLockDepInfo("[%d] %s <-- addr:0x%x\n", i, LOCKDEP_GET_NAME(lockDep, i),
|
||||||
|
@ -165,7 +165,7 @@ STATIC VOID OsLockDepDumpLock(const LosTaskCB *task, const SPIN_LOCK_S *lock,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
STATIC BOOL OsLockDepCheckDependancy(const LosTaskCB *current, LosTaskCB *lockOwner)
|
STATIC BOOL OsLockDepCheckDependency(const LosTaskCB *current, LosTaskCB *lockOwner)
|
||||||
{
|
{
|
||||||
BOOL checkResult = TRUE;
|
BOOL checkResult = TRUE;
|
||||||
SPIN_LOCK_S *lockTemp = NULL;
|
SPIN_LOCK_S *lockTemp = NULL;
|
||||||
|
@ -217,7 +217,7 @@ VOID OsLockDepCheckIn(SPIN_LOCK_S *lock)
|
||||||
goto OUT;
|
goto OUT;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (OsLockDepCheckDependancy(current, lockOwner) != TRUE) {
|
if (OsLockDepCheckDependency(current, lockOwner) != TRUE) {
|
||||||
checkResult = LOCKDEP_ERR_DEAD_LOCK;
|
checkResult = LOCKDEP_ERR_DEAD_LOCK;
|
||||||
goto OUT;
|
goto OUT;
|
||||||
}
|
}
|
||||||
|
@ -313,7 +313,7 @@ VOID OsLockDepCheckOut(SPIN_LOCK_S *lock)
|
||||||
/* record lock holding time */
|
/* record lock holding time */
|
||||||
heldlocks[depth].holdTime = OsLockDepGetCycles() - heldlocks[depth].holdTime;
|
heldlocks[depth].holdTime = OsLockDepGetCycles() - heldlocks[depth].holdTime;
|
||||||
|
|
||||||
/* if unlock a older lock, needs move heldLock records */
|
/* if unlock an older lock, needs move heldLock records */
|
||||||
while (depth < lockDep->lockDepth - 1) {
|
while (depth < lockDep->lockDepth - 1) {
|
||||||
lockDep->heldLocks[depth] = lockDep->heldLocks[depth + 1];
|
lockDep->heldLocks[depth] = lockDep->heldLocks[depth + 1];
|
||||||
depth++;
|
depth++;
|
||||||
|
|
|
@ -173,7 +173,7 @@ LITE_OS_SEC_TEXT_MINOR VOID OsShellCmdDumpSched(VOID)
|
||||||
|
|
||||||
affinity = (UINT32)taskCB->cpuAffiMask;
|
affinity = (UINT32)taskCB->cpuAffiMask;
|
||||||
|
|
||||||
PRINTK("%-30s0x%-6x%+16lf ms %10d\n", taskCB->taskName, taskCB->taskID,
|
PRINTK("%-30s0x%-6x%+16lf ms %10u\n", taskCB->taskName, taskCB->taskID,
|
||||||
(DOUBLE)(taskCB->schedStat.allRuntime) / NS_PER_MS,
|
(DOUBLE)(taskCB->schedStat.allRuntime) / NS_PER_MS,
|
||||||
taskCB->schedStat.allContextSwitch);
|
taskCB->schedStat.allContextSwitch);
|
||||||
|
|
||||||
|
@ -183,7 +183,7 @@ LITE_OS_SEC_TEXT_MINOR VOID OsShellCmdDumpSched(VOID)
|
||||||
}
|
}
|
||||||
|
|
||||||
PRINTK(" "
|
PRINTK(" "
|
||||||
"CPU%d %+16lf ms %12d\n", cpuid,
|
"CPU%u %+16lf ms %12u\n", cpuid,
|
||||||
(DOUBLE)(taskCB->schedStat.schedPercpu[cpuid].runtime) / NS_PER_MS,
|
(DOUBLE)(taskCB->schedStat.schedPercpu[cpuid].runtime) / NS_PER_MS,
|
||||||
taskCB->schedStat.schedPercpu[cpuid].contexSwitch);
|
taskCB->schedStat.schedPercpu[cpuid].contexSwitch);
|
||||||
}
|
}
|
||||||
|
@ -251,7 +251,7 @@ LITE_OS_SEC_TEXT_MINOR VOID OsMpStaticShow(UINT64 mpStaticPastTime)
|
||||||
"---------- ---------- ---------- ----------\n");
|
"---------- ---------- ---------- ----------\n");
|
||||||
|
|
||||||
for (cpuid = 0; cpuid < LOSCFG_KERNEL_CORE_NUM; cpuid++) {
|
for (cpuid = 0; cpuid < LOSCFG_KERNEL_CORE_NUM; cpuid++) {
|
||||||
PRINTK("CPU%d %+10lf%14d%14d%14d %+11lf %+11lf %+11lf%14d %+11lf\n", cpuid,
|
PRINTK("CPU%u %+10lf%14u%14u%14u %+11lf %+11lf %+11lf%14u %+11lf\n", cpuid,
|
||||||
((DOUBLE)(g_mpStatPercpu[cpuid].idleRuntime) / mpStaticPastTime) * DECIMAL_TO_PERCENTAGE,
|
((DOUBLE)(g_mpStatPercpu[cpuid].idleRuntime) / mpStaticPastTime) * DECIMAL_TO_PERCENTAGE,
|
||||||
g_mpStatPercpu[cpuid].contexSwitch,
|
g_mpStatPercpu[cpuid].contexSwitch,
|
||||||
g_mpStatPercpu[cpuid].hwiNum,
|
g_mpStatPercpu[cpuid].hwiNum,
|
||||||
|
|
|
@ -169,6 +169,29 @@ UINT32 OsShellShowTickRespo(VOID)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef LOSCFG_SCHED_DEBUG
|
#ifdef LOSCFG_SCHED_DEBUG
|
||||||
|
STATIC VOID SchedDataGet(LosTaskCB *taskCB, UINT64 *runTime, UINT64 *timeSlice, UINT64 *pendTime, UINT64 *schedWait)
|
||||||
|
{
|
||||||
|
if (taskCB->schedStat.switchCount >= 1) {
|
||||||
|
UINT64 averRunTime = taskCB->schedStat.runTime / taskCB->schedStat.switchCount;
|
||||||
|
*runTime = (averRunTime * OS_NS_PER_CYCLE) / OS_SYS_NS_PER_US;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (taskCB->schedStat.timeSliceCount > 1) {
|
||||||
|
UINT64 averTimeSlice = taskCB->schedStat.timeSliceTime / (taskCB->schedStat.timeSliceCount - 1);
|
||||||
|
*timeSlice = (averTimeSlice * OS_NS_PER_CYCLE) / OS_SYS_NS_PER_US;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (taskCB->schedStat.pendCount > 1) {
|
||||||
|
UINT64 averPendTime = taskCB->schedStat.pendTime / taskCB->schedStat.pendCount;
|
||||||
|
*pendTime = (averPendTime * OS_NS_PER_CYCLE) / OS_SYS_NS_PER_US;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (taskCB->schedStat.waitSchedCount > 0) {
|
||||||
|
UINT64 averSchedWait = taskCB->schedStat.waitSchedTime / taskCB->schedStat.waitSchedCount;
|
||||||
|
*schedWait = (averSchedWait * OS_NS_PER_CYCLE) / OS_SYS_NS_PER_US;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
UINT32 OsShellShowSchedParam(VOID)
|
UINT32 OsShellShowSchedParam(VOID)
|
||||||
{
|
{
|
||||||
UINT64 averRunTime;
|
UINT64 averRunTime;
|
||||||
|
@ -198,25 +221,7 @@ UINT32 OsShellShowSchedParam(VOID)
|
||||||
averPendTime = 0;
|
averPendTime = 0;
|
||||||
averSchedWait = 0;
|
averSchedWait = 0;
|
||||||
|
|
||||||
if (taskCB->schedStat.switchCount >= 1) {
|
SchedDataGet(taskCB, &averRunTime, &averTimeSlice, &averPendTime, &averSchedWait);
|
||||||
averRunTime = taskCB->schedStat.runTime / taskCB->schedStat.switchCount;
|
|
||||||
averRunTime = (averRunTime * OS_NS_PER_CYCLE) / OS_SYS_NS_PER_US;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (taskCB->schedStat.timeSliceCount > 1) {
|
|
||||||
averTimeSlice = taskCB->schedStat.timeSliceTime / (taskCB->schedStat.timeSliceCount - 1);
|
|
||||||
averTimeSlice = (averTimeSlice * OS_NS_PER_CYCLE) / OS_SYS_NS_PER_US;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (taskCB->schedStat.pendCount > 1) {
|
|
||||||
averPendTime = taskCB->schedStat.pendTime / taskCB->schedStat.pendCount;
|
|
||||||
averPendTime = (averPendTime * OS_NS_PER_CYCLE) / OS_SYS_NS_PER_US;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (taskCB->schedStat.waitSchedCount > 0) {
|
|
||||||
averSchedWait = taskCB->schedStat.waitSchedTime / taskCB->schedStat.waitSchedCount;
|
|
||||||
averSchedWait = (averSchedWait * OS_NS_PER_CYCLE) / OS_SYS_NS_PER_US;
|
|
||||||
}
|
|
||||||
|
|
||||||
PRINTK("%5u%19llu%15llu%19llu%18llu%19llu%18llu %-32s\n", taskCB->taskID,
|
PRINTK("%5u%19llu%15llu%19llu%18llu%19llu%18llu %-32s\n", taskCB->taskID,
|
||||||
averRunTime, taskCB->schedStat.switchCount,
|
averRunTime, taskCB->schedStat.switchCount,
|
||||||
|
@ -771,7 +776,9 @@ BOOL OsSchedSwtmrTimeListFind(SCHED_TL_FIND_FUNC checkFunc, UINTPTR arg)
|
||||||
for (UINT16 cpuid = 0; cpuid < LOSCFG_KERNEL_CORE_NUM; cpuid++) {
|
for (UINT16 cpuid = 0; cpuid < LOSCFG_KERNEL_CORE_NUM; cpuid++) {
|
||||||
SchedRunQue *rq = OsSchedRunQueByID(cpuid);
|
SchedRunQue *rq = OsSchedRunQueByID(cpuid);
|
||||||
SortLinkAttribute *swtmrSortLink = &rq->swtmrSortLink;
|
SortLinkAttribute *swtmrSortLink = &rq->swtmrSortLink;
|
||||||
return SchedSwtmrRunQueFind(swtmrSortLink, checkFunc, arg);
|
if (SchedSwtmrRunQueFind(swtmrSortLink, checkFunc, arg)) {
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -322,16 +322,16 @@ CHAR *OsArchFlagsToStr(const UINT32 archFlags)
|
||||||
(VOID)memset_s(archMmuFlagsStr, flagSize, 0, flagSize);
|
(VOID)memset_s(archMmuFlagsStr, flagSize, 0, flagSize);
|
||||||
switch (cacheFlags) {
|
switch (cacheFlags) {
|
||||||
case 0UL:
|
case 0UL:
|
||||||
strcat_s(archMmuFlagsStr, flagSize, " CH\0");
|
(VOID)strcat_s(archMmuFlagsStr, flagSize, " CH\0");
|
||||||
break;
|
break;
|
||||||
case 1UL:
|
case 1UL:
|
||||||
strcat_s(archMmuFlagsStr, flagSize, " UC\0");
|
(VOID)strcat_s(archMmuFlagsStr, flagSize, " UC\0");
|
||||||
break;
|
break;
|
||||||
case 2UL:
|
case 2UL:
|
||||||
strcat_s(archMmuFlagsStr, flagSize, " UD\0");
|
(VOID)strcat_s(archMmuFlagsStr, flagSize, " UD\0");
|
||||||
break;
|
break;
|
||||||
case 3UL:
|
case 3UL:
|
||||||
strcat_s(archMmuFlagsStr, flagSize, " WC\0");
|
(VOID)strcat_s(archMmuFlagsStr, flagSize, " WC\0");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -462,7 +462,7 @@ LosVmMapRegion *OsCreateRegion(VADDR_T vaddr, size_t len, UINT32 regionFlags, un
|
||||||
return region;
|
return region;
|
||||||
}
|
}
|
||||||
|
|
||||||
memset_s(region, sizeof(LosVmMapRegion), 0, sizeof(LosVmMapRegion));
|
(void)memset_s(region, sizeof(LosVmMapRegion), 0, sizeof(LosVmMapRegion));
|
||||||
region->range.base = vaddr;
|
region->range.base = vaddr;
|
||||||
region->range.size = len;
|
region->range.size = len;
|
||||||
region->pgOff = offset;
|
region->pgOff = offset;
|
||||||
|
|
|
@ -387,7 +387,7 @@ STATUS_T OsMremapCheck(VADDR_T addr, size_t oldLen, VADDR_T newAddr, size_t newL
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* avoid new region overlaping with the old one */
|
/* avoid new region overlapping with the old one */
|
||||||
if (flags & MREMAP_FIXED) {
|
if (flags & MREMAP_FIXED) {
|
||||||
if (((region->range.base + region->range.size) > newAddr) &&
|
if (((region->range.base + region->range.size) > newAddr) &&
|
||||||
(region->range.base < (newAddr + newLen))) {
|
(region->range.base < (newAddr + newLen))) {
|
||||||
|
|
|
@ -88,7 +88,7 @@ INT32 GetFilepOps(const struct file *filep, struct file **privFilep, const struc
|
||||||
goto ERROUT;
|
goto ERROUT;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* to find console device's filep(now it is *privFilep) throught i_private */
|
/* to find console device's filep(now it is *privFilep) through i_private */
|
||||||
struct drv_data *drv = (struct drv_data *)filep->f_vnode->data;
|
struct drv_data *drv = (struct drv_data *)filep->f_vnode->data;
|
||||||
*privFilep = (struct file *)drv->priv;
|
*privFilep = (struct file *)drv->priv;
|
||||||
if (((*privFilep)->f_vnode == NULL) || ((*privFilep)->f_vnode->data == NULL)) {
|
if (((*privFilep)->f_vnode == NULL) || ((*privFilep)->f_vnode->data == NULL)) {
|
||||||
|
@ -1073,7 +1073,7 @@ STATIC INT32 OsConsoleDevInit(CONSOLE_CB *consoleCB, const CHAR *deviceName)
|
||||||
filep->f_path = NULL;
|
filep->f_path = NULL;
|
||||||
filep->f_priv = NULL;
|
filep->f_priv = NULL;
|
||||||
/*
|
/*
|
||||||
* Use filep to connect console and uart, we can find uart driver function throught filep.
|
* Use filep to connect console and uart, we can find uart driver function through filep.
|
||||||
* now we can operate /dev/console to operate /dev/ttyS0 through filep.
|
* now we can operate /dev/console to operate /dev/ttyS0 through filep.
|
||||||
*/
|
*/
|
||||||
devOps = (struct file_operations_vfs *)((struct drv_data*)vnode->data)->ops;
|
devOps = (struct file_operations_vfs *)((struct drv_data*)vnode->data)->ops;
|
||||||
|
@ -1325,7 +1325,9 @@ INT32 system_console_init(const CHAR *deviceName)
|
||||||
LOS_SpinLockSave(&g_consoleSpin, &intSave);
|
LOS_SpinLockSave(&g_consoleSpin, &intSave);
|
||||||
(VOID)OsConsoleDelete(consoleCB);
|
(VOID)OsConsoleDelete(consoleCB);
|
||||||
g_console[consoleID - 1] = NULL;
|
g_console[consoleID - 1] = NULL;
|
||||||
|
if (OsCurrTaskGet() != NULL) {
|
||||||
g_taskConsoleIDArray[OsCurrTaskGet()->taskID] = 0;
|
g_taskConsoleIDArray[OsCurrTaskGet()->taskID] = 0;
|
||||||
|
}
|
||||||
LOS_SpinUnlockRestore(&g_consoleSpin, intSave);
|
LOS_SpinUnlockRestore(&g_consoleSpin, intSave);
|
||||||
return VFS_ERROR;
|
return VFS_ERROR;
|
||||||
}
|
}
|
||||||
|
|
|
@ -186,7 +186,7 @@ LITE_OS_SEC_TEXT_INIT VOID OsSystemInfo(VOID)
|
||||||
KERNEL_NAME, KERNEL_MAJOR, KERNEL_MINOR, KERNEL_PATCH, KERNEL_ITRE, buildType);
|
KERNEL_NAME, KERNEL_MAJOR, KERNEL_MINOR, KERNEL_PATCH, KERNEL_ITRE, buildType);
|
||||||
}
|
}
|
||||||
|
|
||||||
LITE_OS_SEC_TEXT_INIT INT32 OsMain(VOID)
|
LITE_OS_SEC_TEXT_INIT UINT32 OsMain(VOID)
|
||||||
{
|
{
|
||||||
UINT32 ret;
|
UINT32 ret;
|
||||||
#ifdef LOS_INIT_STATISTICS
|
#ifdef LOS_INIT_STATISTICS
|
||||||
|
|
|
@ -453,7 +453,7 @@ typedef VOID (*log_read_write_fn)(UINT32 startAddr, UINT32 space, UINT32 rwFlag,
|
||||||
VOID LOS_ExcInfoRegHook(UINT32 startAddr, UINT32 space, CHAR *buf, log_read_write_fn hook);
|
VOID LOS_ExcInfoRegHook(UINT32 startAddr, UINT32 space, CHAR *buf, log_read_write_fn hook);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern INT32 OsMain(VOID);
|
extern UINT32 OsMain(VOID);
|
||||||
|
|
||||||
typedef VOID (*SystemRebootFunc)(VOID);
|
typedef VOID (*SystemRebootFunc)(VOID);
|
||||||
VOID OsSetRebootHook(SystemRebootFunc func);
|
VOID OsSetRebootHook(SystemRebootFunc func);
|
||||||
|
|
|
@ -34,11 +34,9 @@
|
||||||
|
|
||||||
LITE_OS_SEC_TEXT_INIT INT32 main(VOID)
|
LITE_OS_SEC_TEXT_INIT INT32 main(VOID)
|
||||||
{
|
{
|
||||||
UINT32 uwRet;
|
UINT32 ret = OsMain();
|
||||||
|
if (ret != LOS_OK) {
|
||||||
uwRet = OsMain();
|
return (INT32)LOS_NOK;
|
||||||
if (uwRet != LOS_OK) {
|
|
||||||
return LOS_NOK;
|
|
||||||
}
|
}
|
||||||
CPU_MAP_SET(0, OsHwIDGet());
|
CPU_MAP_SET(0, OsHwIDGet());
|
||||||
|
|
||||||
|
|
|
@ -284,8 +284,8 @@ LITE_OS_SEC_TEXT_MINOR STATIC VOID OsCpupGetPos(UINT16 mode, UINT16 *curPosPoint
|
||||||
curPos = CPUP_PRE_POS(tmpPos);
|
curPos = CPUP_PRE_POS(tmpPos);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The current postion has nothing to do with the CPUP modes,
|
* The current position has nothing to do with the CPUP modes,
|
||||||
* however, the previous postion differs.
|
* however, the previous position differs.
|
||||||
*/
|
*/
|
||||||
switch (mode) {
|
switch (mode) {
|
||||||
case CPUP_LAST_ONE_SECONDS:
|
case CPUP_LAST_ONE_SECONDS:
|
||||||
|
|
|
@ -45,7 +45,6 @@
|
||||||
#ifdef LOSCFG_DRIVERS_TZDRIVER
|
#ifdef LOSCFG_DRIVERS_TZDRIVER
|
||||||
#include "fs/file.h"
|
#include "fs/file.h"
|
||||||
#endif
|
#endif
|
||||||
#include "fs/file.h"
|
|
||||||
#include "unistd.h"
|
#include "unistd.h"
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
|
@ -148,7 +148,7 @@ static int HiLogBufferCopy(unsigned char *dst, unsigned dstLen, const unsigned c
|
||||||
|
|
||||||
static int HiLogReadRingBuffer(unsigned char *buffer, size_t bufLen)
|
static int HiLogReadRingBuffer(unsigned char *buffer, size_t bufLen)
|
||||||
{
|
{
|
||||||
size_t retval;
|
int retval;
|
||||||
size_t bufLeft = HILOG_BUFFER - g_hiLogDev.headOffset;
|
size_t bufLeft = HILOG_BUFFER - g_hiLogDev.headOffset;
|
||||||
if (bufLeft > bufLen) {
|
if (bufLeft > bufLen) {
|
||||||
retval = HiLogBufferCopy(buffer, bufLen, HiLogBufferHead(), bufLen);
|
retval = HiLogBufferCopy(buffer, bufLen, HiLogBufferHead(), bufLen);
|
||||||
|
@ -165,7 +165,7 @@ static int HiLogReadRingBuffer(unsigned char *buffer, size_t bufLen)
|
||||||
|
|
||||||
static ssize_t HiLogRead(struct file *filep, char *buffer, size_t bufLen)
|
static ssize_t HiLogRead(struct file *filep, char *buffer, size_t bufLen)
|
||||||
{
|
{
|
||||||
size_t retval;
|
int retval;
|
||||||
struct HiLogEntry header;
|
struct HiLogEntry header;
|
||||||
|
|
||||||
(void)filep;
|
(void)filep;
|
||||||
|
@ -209,7 +209,7 @@ out:
|
||||||
g_hiLogDev.count = 0;
|
g_hiLogDev.count = 0;
|
||||||
}
|
}
|
||||||
(VOID)LOS_MuxRelease(&g_hiLogDev.mtx);
|
(VOID)LOS_MuxRelease(&g_hiLogDev.mtx);
|
||||||
return retval;
|
return (ssize_t)retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int HiLogWriteRingBuffer(unsigned char *buffer, size_t bufLen)
|
static int HiLogWriteRingBuffer(unsigned char *buffer, size_t bufLen)
|
||||||
|
|
|
@ -103,7 +103,7 @@ LITE_OS_SEC_TEXT_INIT UINT32 OsLiteIpcInit(VOID)
|
||||||
#if (USE_TASKID_AS_HANDLE == 1)
|
#if (USE_TASKID_AS_HANDLE == 1)
|
||||||
g_cmsTask.status = HANDLE_NOT_USED;
|
g_cmsTask.status = HANDLE_NOT_USED;
|
||||||
#else
|
#else
|
||||||
memset_s(g_serviceHandleMap, sizeof(g_serviceHandleMap), 0, sizeof(g_serviceHandleMap));
|
(void)memset_s(g_serviceHandleMap, sizeof(g_serviceHandleMap), 0, sizeof(g_serviceHandleMap));
|
||||||
#endif
|
#endif
|
||||||
ret = LOS_MuxInit(&g_serviceHandleMapMux, NULL);
|
ret = LOS_MuxInit(&g_serviceHandleMapMux, NULL);
|
||||||
if (ret != LOS_OK) {
|
if (ret != LOS_OK) {
|
||||||
|
@ -565,7 +565,7 @@ LITE_OS_SEC_TEXT STATIC UINT32 SendDeathMsg(UINT32 processID, UINT32 serviceHand
|
||||||
}
|
}
|
||||||
content.flag = SEND;
|
content.flag = SEND;
|
||||||
content.outMsg = &msg;
|
content.outMsg = &msg;
|
||||||
memset_s(content.outMsg, sizeof(IpcMsg), 0, sizeof(IpcMsg));
|
(void)memset_s(content.outMsg, sizeof(IpcMsg), 0, sizeof(IpcMsg));
|
||||||
content.outMsg->type = MT_DEATH_NOTIFY;
|
content.outMsg->type = MT_DEATH_NOTIFY;
|
||||||
content.outMsg->target.handle = ipcTaskID;
|
content.outMsg->target.handle = ipcTaskID;
|
||||||
content.outMsg->target.token = serviceHandle;
|
content.outMsg->target.token = serviceHandle;
|
||||||
|
@ -1161,7 +1161,7 @@ LITE_OS_SEC_TEXT STATIC UINT32 LiteIpcRead(IpcContent *content)
|
||||||
if (ret == LOS_OK) {
|
if (ret == LOS_OK) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (ret == -ENOENT) { /* It means that we've recieved a failed reply */
|
if (ret == -ENOENT) { /* It means that we've received a failed reply */
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1208,7 +1208,7 @@ LITE_OS_SEC_TEXT STATIC UINT32 LiteIpcMsgHandle(IpcContent *con)
|
||||||
}
|
}
|
||||||
content->outMsg = msg;
|
content->outMsg = msg;
|
||||||
if ((content->outMsg->type < 0) || (content->outMsg->type >= MT_DEATH_NOTIFY)) {
|
if ((content->outMsg->type < 0) || (content->outMsg->type >= MT_DEATH_NOTIFY)) {
|
||||||
PRINT_ERR("LiteIpc unknow msg type:%d\n", content->outMsg->type);
|
PRINT_ERR("LiteIpc unknown msg type:%d\n", content->outMsg->type);
|
||||||
ret = -EINVAL;
|
ret = -EINVAL;
|
||||||
goto BUFFER_FREE;
|
goto BUFFER_FREE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -150,8 +150,8 @@ typedef struct {
|
||||||
VOID *data;
|
VOID *data;
|
||||||
UINT32 spObjNum;
|
UINT32 spObjNum;
|
||||||
VOID *offsets;
|
VOID *offsets;
|
||||||
UINT32 processID; /**< filled by kernel, processId of sender/reciever */
|
UINT32 processID; /**< filled by kernel, processId of sender/receiver */
|
||||||
UINT32 taskID; /**< filled by kernel, taskId of sender/reciever */
|
UINT32 taskID; /**< filled by kernel, taskId of sender/receiver */
|
||||||
#ifdef LOSCFG_SECURITY_CAPABILITY
|
#ifdef LOSCFG_SECURITY_CAPABILITY
|
||||||
UINT32 userID;
|
UINT32 userID;
|
||||||
UINT32 gid;
|
UINT32 gid;
|
||||||
|
|
|
@ -94,7 +94,7 @@ typedef struct {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ingroup los_trace
|
* @ingroup los_trace
|
||||||
* struct to store the event infomation
|
* struct to store the event information
|
||||||
*/
|
*/
|
||||||
typedef struct {
|
typedef struct {
|
||||||
UINT32 cmd; /* trace start or stop cmd */
|
UINT32 cmd; /* trace start or stop cmd */
|
||||||
|
|
|
@ -57,6 +57,9 @@ UINT32 SerialPipelineInit(VOID)
|
||||||
|
|
||||||
UINT32 SerialDataReceive(UINT8 *data, UINT32 size, UINT32 timeout)
|
UINT32 SerialDataReceive(UINT8 *data, UINT32 size, UINT32 timeout)
|
||||||
{
|
{
|
||||||
|
(VOID)data;
|
||||||
|
(VOID)size;
|
||||||
|
(VOID)timeout;
|
||||||
return LOS_OK;
|
return LOS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -132,7 +132,7 @@ VOID OsTraceDataSend(UINT8 type, UINT16 len, UINT8 *data)
|
||||||
UINT32 intSave;
|
UINT32 intSave;
|
||||||
UINT8 outBuf[LOSCFG_TRACE_TLV_BUF_SIZE] = {0};
|
UINT8 outBuf[LOSCFG_TRACE_TLV_BUF_SIZE] = {0};
|
||||||
|
|
||||||
if ((type > TRACE_MSG_MAX) || (len > LOSCFG_TRACE_TLV_BUF_SIZE)) {
|
if ((type >= TRACE_MSG_MAX) || (len > LOSCFG_TRACE_TLV_BUF_SIZE)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -187,7 +187,7 @@ STATIC VOID OsTraceInfoEventData(VOID)
|
||||||
UINT32 taskLockCnt = frame->core.taskLockCnt;
|
UINT32 taskLockCnt = frame->core.taskLockCnt;
|
||||||
#ifdef LOSCFG_KERNEL_SMP
|
#ifdef LOSCFG_KERNEL_SMP
|
||||||
/*
|
/*
|
||||||
* For smp systems, TRACE_LOCK will requst taskLock, and this counter
|
* For smp systems, TRACE_LOCK will request taskLock, and this counter
|
||||||
* will increase by 1 in that case.
|
* will increase by 1 in that case.
|
||||||
*/
|
*/
|
||||||
taskLockCnt -= 1;
|
taskLockCnt -= 1;
|
||||||
|
|
|
@ -1,3 +1,34 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2013-2019 Huawei Technologies 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:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||||
|
* conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||||
|
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||||
|
* provided with the distribution.
|
||||||
|
*
|
||||||
|
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
||||||
|
* to endorse or promote products derived from this software without specific prior written
|
||||||
|
* permission.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||||
|
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
|
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||||
|
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||||
|
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||||
|
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
||||||
|
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||||
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||||
|
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||||
|
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm")
|
OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm")
|
||||||
OUTPUT_ARCH(arm)
|
OUTPUT_ARCH(arm)
|
||||||
|
|
||||||
|
|
|
@ -90,10 +90,10 @@ extern VOID *LOS_SoLoad(CHAR *elfFileName);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ingroup dynload
|
* @ingroup dynload
|
||||||
* @brief Load a object file.
|
* @brief Load an object file.
|
||||||
*
|
*
|
||||||
* @par Description:
|
* @par Description:
|
||||||
* This API is used to load a object file under a particular module file path.
|
* This API is used to load an object file under a particular module file path.
|
||||||
* @attention
|
* @attention
|
||||||
* <ul>
|
* <ul>
|
||||||
* <li>The parameter passed to this API should be a legal path of an object file.</li>
|
* <li>The parameter passed to this API should be a legal path of an object file.</li>
|
||||||
|
|
|
@ -74,14 +74,14 @@ typedef LOS_MEMBOX_INFO OS_MEMBOX_S;
|
||||||
* @ingroup los_membox
|
* @ingroup los_membox
|
||||||
* Memory pool alignment
|
* Memory pool alignment
|
||||||
*/
|
*/
|
||||||
#define LOS_MEMBOX_ALLIGNED(memAddr) (((UINTPTR)(memAddr) + sizeof(UINTPTR) - 1) & (~(sizeof(UINTPTR) - 1)))
|
#define LOS_MEMBOX_ALIGNED(memAddr) (((UINTPTR)(memAddr) + sizeof(UINTPTR) - 1) & (~(sizeof(UINTPTR) - 1)))
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ingroup los_membox
|
* @ingroup los_membox
|
||||||
* Memory pool size
|
* Memory pool size
|
||||||
*/
|
*/
|
||||||
#define LOS_MEMBOX_SIZE(blkSize, blkNum) \
|
#define LOS_MEMBOX_SIZE(blkSize, blkNum) \
|
||||||
(sizeof(LOS_MEMBOX_INFO) + (LOS_MEMBOX_ALLIGNED((blkSize) + OS_MEMBOX_NODE_HEAD_SIZE) * (blkNum)))
|
(sizeof(LOS_MEMBOX_INFO) + (LOS_MEMBOX_ALIGNED((blkSize) + OS_MEMBOX_NODE_HEAD_SIZE) * (blkNum)))
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ingroup los_membox
|
* @ingroup los_membox
|
||||||
|
|
|
@ -59,7 +59,7 @@ extern "C" {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ingroup los_memory
|
* @ingroup los_memory
|
||||||
* The recored layers of function call.
|
* The recorded layers of function call.
|
||||||
*/
|
*/
|
||||||
#define LOS_RECORD_LR_CNT 3
|
#define LOS_RECORD_LR_CNT 3
|
||||||
#endif
|
#endif
|
||||||
|
@ -101,11 +101,11 @@ extern UINT32 LOS_MemDeInit(VOID *pool);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ingroup los_memory
|
* @ingroup los_memory
|
||||||
* @brief Print infomation about all pools.
|
* @brief Print information about all pools.
|
||||||
*
|
*
|
||||||
* @par Description:
|
* @par Description:
|
||||||
* <ul>
|
* <ul>
|
||||||
* <li>This API is used to print infomation about all pools.</li>
|
* <li>This API is used to print information about all pools.</li>
|
||||||
* </ul>
|
* </ul>
|
||||||
*
|
*
|
||||||
* @retval #UINT32 The pool number.
|
* @retval #UINT32 The pool number.
|
||||||
|
@ -351,11 +351,11 @@ extern UINT32 LOS_MemTotalUsedGet(VOID *pool);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ingroup los_memory
|
* @ingroup los_memory
|
||||||
* @brief Get the infomation of memory pool.
|
* @brief Get the information of memory pool.
|
||||||
*
|
*
|
||||||
* @par Description:
|
* @par Description:
|
||||||
* <ul>
|
* <ul>
|
||||||
* <li>This API is used to get the infomation of memory pool.</li>
|
* <li>This API is used to get the information of memory pool.</li>
|
||||||
* </ul>
|
* </ul>
|
||||||
* @attention
|
* @attention
|
||||||
* <ul>
|
* <ul>
|
||||||
|
@ -366,7 +366,7 @@ extern UINT32 LOS_MemTotalUsedGet(VOID *pool);
|
||||||
* @param poolStatus [IN] A pointer for storage the pool status
|
* @param poolStatus [IN] A pointer for storage the pool status
|
||||||
*
|
*
|
||||||
* @retval #LOS_NOK The incoming parameter pool is NULL or invalid.
|
* @retval #LOS_NOK The incoming parameter pool is NULL or invalid.
|
||||||
* @retval #LOS_OK Success to get memory infomation.
|
* @retval #LOS_OK Success to get memory information.
|
||||||
* @par Dependency:
|
* @par Dependency:
|
||||||
* <ul><li>los_memory.h: the header file that contains the API declaration.</li></ul>
|
* <ul><li>los_memory.h: the header file that contains the API declaration.</li></ul>
|
||||||
* @see None.
|
* @see None.
|
||||||
|
|
|
@ -80,7 +80,7 @@ typedef VOID (*pf_OUTPUT)(const CHAR *fmt, ...);
|
||||||
* <li>None</li>
|
* <li>None</li>
|
||||||
* </ul>
|
* </ul>
|
||||||
*
|
*
|
||||||
* @param fmt [IN] Type char* controls the ouput as in C printf.
|
* @param fmt [IN] Type char* controls the output as in C printf.
|
||||||
*
|
*
|
||||||
* @retval None
|
* @retval None
|
||||||
* @par Dependency:
|
* @par Dependency:
|
||||||
|
|
|
@ -184,7 +184,7 @@ extern UINT32 LOS_RwlockTryRdLock(LosRwlock *rwlock);
|
||||||
* the task scheduling.</li>
|
* the task scheduling.</li>
|
||||||
* is disabled.</li>
|
* is disabled.</li>
|
||||||
* <li>Do not wait on a rwlock during an interrupt.</li>
|
* <li>Do not wait on a rwlock during an interrupt.</li>
|
||||||
* <li>The funtion fails when other tasks have the read or write lock.</li>
|
* <li>The function fails when other tasks have the read or write lock.</li>
|
||||||
* <li>A recursive rwlock can be locked more than once by the same thread.</li>
|
* <li>A recursive rwlock can be locked more than once by the same thread.</li>
|
||||||
* <li>Do not call this API in software timer callback. </li>
|
* <li>Do not call this API in software timer callback. </li>
|
||||||
* </ul>
|
* </ul>
|
||||||
|
@ -218,7 +218,7 @@ extern UINT32 LOS_RwlockWrLock(LosRwlock *rwlock, UINT32 timeout);
|
||||||
* when the task scheduling.</li>
|
* when the task scheduling.</li>
|
||||||
* is disabled.</li>
|
* is disabled.</li>
|
||||||
* <li>Do not wait on a rwlock during an interrupt.</li>
|
* <li>Do not wait on a rwlock during an interrupt.</li>
|
||||||
* <li>The funtion fails when other tasks have the read or write lock.</li>
|
* <li>The function fails when other tasks have the read or write lock.</li>
|
||||||
* <li>A recursive rwlock can be locked more than once by the same thread.</li>
|
* <li>A recursive rwlock can be locked more than once by the same thread.</li>
|
||||||
* <li>Do not call this API in software timer callback. </li>
|
* <li>Do not call this API in software timer callback. </li>
|
||||||
* </ul>
|
* </ul>
|
||||||
|
|
|
@ -221,7 +221,7 @@ extern "C" {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ingroup los_task
|
* @ingroup los_task
|
||||||
* Task error code: The task yeild occurs when the task is locked.
|
* Task error code: The task yield occurs when the task is locked.
|
||||||
* Value: 0x0200020f
|
* Value: 0x0200020f
|
||||||
*
|
*
|
||||||
* Solution: Check the task.
|
* Solution: Check the task.
|
||||||
|
@ -411,7 +411,7 @@ extern "C" {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ingroup los_task
|
* @ingroup los_task
|
||||||
* Task error code: Task yeild in int is not permited, which will result in unexpected result.
|
* Task error code: Task yield in int is not permited, which will result in unexpected result.
|
||||||
*
|
*
|
||||||
* Value: 0x02000224
|
* Value: 0x02000224
|
||||||
*
|
*
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue