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/zlib",
|
||||
"$LITEOSTHIRDPARTY/FatFs",
|
||||
"$LITEOSTHIRDPARTY/Linux_Kernel",
|
||||
"$LITEOSTHIRDPARTY/lwip",
|
||||
"$LITEOSTHIRDPARTY/NuttX",
|
||||
"$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
|
||||
memory check, etc.
|
||||
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
|
||||
bool "Enable Debug LiteOS Kernel Resource"
|
||||
|
@ -198,7 +198,7 @@ config DEBUG_KERNEL
|
|||
help
|
||||
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.
|
||||
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
|
||||
bool "Enable Queue Debugging"
|
||||
|
@ -265,7 +265,7 @@ config MEM_LEAKCHECK
|
|||
default n
|
||||
depends on DEBUG_VERSION && MEM_DEBUG
|
||||
help
|
||||
Answer Y to enable record the LR of Function call stack of Mem operation, it can check the mem leak through the 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
|
||||
bool "Enable integrity check or not"
|
||||
default n
|
||||
|
|
2
Makefile
2
Makefile
|
@ -97,7 +97,7 @@ Targets:
|
|||
cleanall: clean all build outputs
|
||||
all: make liteos kernel image and rootfs image (Default target)
|
||||
$(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_TARGET): make liteos kernel image
|
||||
update_config: update product kernel config (use menuconfig)
|
||||
|
|
5
OAT.xml
5
OAT.xml
|
@ -12,9 +12,10 @@
|
|||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
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>
|
||||
|
|
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>
|
||||
|
||||
- Programming languages: C and C++
|
||||
- Applicable development boards: Hi3518E V300 and Hi3516D V300
|
||||
- Hi3518E V300 uses the JFFS2 file system by default, and Hi3516D V300 uses the FAT file system by default.
|
||||
- Applicable development boards: Hi3516D V300
|
||||
- Hi3516D V300 uses the FAT file system by default.
|
||||
|
||||
## 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>
|
||||
|
||||
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)
|
||||
- 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-board3516-setting.md).
|
||||
- [Setting Up Ubuntu Development Environment](https://gitee.com/openharmony/docs/blob/master/en/device-dev/quick-start/quickstart-lite-env-setup.md)
|
||||
- For Hi3516D V300, see [Setting Up the Hi3516 Development Environment](https://gitee.com/openharmony/docs/blob/master/en/device-dev/quick-start/quickstart-lite-steps-hi3516-setting.md).
|
||||
|
||||
### Source Code Acquisition<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:
|
||||
|
||||
- [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-board3516-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)
|
||||
|
||||
## 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)
|
||||
|
||||
**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>
|
||||
|
||||
- 開發語言:C/C++;
|
||||
- 適用於Hi3518EV300、Hi3516DV300單板;
|
||||
- Hi3518EV300默認使用jffs2文件系統,Hi3516DV300默認使用FAT文件系統。
|
||||
- 適用於Hi3516DV300單板;
|
||||
- Hi3516DV300默認使用FAT文件系統。
|
||||
|
||||
## 使用說明<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>
|
||||
|
||||
開發者需要在Linux上搭建編譯環境:
|
||||
|
||||
- [Ubuntu編譯環境凖備](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);
|
||||
- [編譯環境凖備](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-lite-env-setup.md);
|
||||
- Hi3516DV300單板:參考[環境搭建](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-lite-steps-hi3516-setting.md)。
|
||||
|
||||
### 獲取源碼<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)。
|
||||
|
||||
## 相關倉<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)
|
||||
|
||||
**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>
|
||||
|
||||
- 开发语言:C/C++;
|
||||
- 适用于Hi3518EV300、Hi3516DV300单板;
|
||||
- Hi3518EV300默认使用jffs2文件系统,Hi3516DV300默认使用FAT文件系统。
|
||||
- 适用于Hi3516DV300单板;
|
||||
- Hi3516DV300默认使用FAT文件系统。
|
||||
|
||||
## 使用说明<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>
|
||||
|
||||
开发者需要在Linux上搭建编译环境:
|
||||
|
||||
- [Ubuntu编译环境准备](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);
|
||||
- [编译环境准备](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-lite-env-setup.md);
|
||||
- Hi3516DV300单板:参考[环境搭建](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-lite-steps-hi3516-setting.md)。
|
||||
|
||||
### 获取源码<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)。
|
||||
|
||||
## 相关仓<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)
|
||||
|
||||
**kernel\_liteos\_a**
|
||||
[kernel\_liteos\_a](https://gitee.com/openharmony/kernel_liteos_a/blob/master/README_zh.md)
|
||||
|
||||
|
|
|
@ -48,6 +48,7 @@
|
|||
#endif
|
||||
int main(int argc, char * const *argv)
|
||||
{
|
||||
(void)argv;
|
||||
int ret;
|
||||
pid_t gid;
|
||||
const char *shellPath = "/bin/mksh";
|
||||
|
|
|
@ -50,14 +50,16 @@ static void BufReadTest(void *buf, int start, int end)
|
|||
|
||||
static void LmsMallocTest(void)
|
||||
{
|
||||
#define TEST_SIZE 16
|
||||
printf("\n-------- LmsMallocTest Start --------\n");
|
||||
char *buf = (char *)malloc(16);
|
||||
printf("[LmsMallocTest] malloc addr:%p size:%d\n", buf, 16);
|
||||
|
||||
printf("[LmsMallocTest] read overflow & underflow error should be triggered, read range[-1,16]\n");
|
||||
BufReadTest(buf, -1, 16);
|
||||
printf("[LmsMallocTest] write overflow error should be triggered, write range[0,16]\n");
|
||||
BufWriteTest(buf, 0, 16);
|
||||
char *buf = (char *)malloc(TEST_SIZE);
|
||||
if (buf == NULL) {
|
||||
return;
|
||||
}
|
||||
printf("[LmsMallocTest] read overflow & underflow error should be triggered, read range[-1, TEST_SIZE]\n");
|
||||
BufReadTest(buf, -1, TEST_SIZE);
|
||||
printf("[LmsMallocTest] write overflow error should be triggered, write range[0, TEST_SIZE]\n");
|
||||
BufWriteTest(buf, 0, TEST_SIZE);
|
||||
|
||||
free(buf);
|
||||
printf("\n-------- LmsMallocTest End --------\n");
|
||||
|
@ -65,46 +67,61 @@ static void LmsMallocTest(void)
|
|||
|
||||
static void LmsReallocTest(void)
|
||||
{
|
||||
#define TEST_SIZE 64
|
||||
#define TEST_SIZE_MIN 32
|
||||
printf("\n-------- LmsReallocTest Start --------\n");
|
||||
char *buf = (char *)malloc(64);
|
||||
printf("[LmsReallocTest] malloc addr:%p size:%d\n", buf, 64);
|
||||
printf("[LmsReallocTest] read overflow & underflow error should be triggered, read range[-1,64]\n");
|
||||
BufReadTest(buf, -1, 64);
|
||||
buf = (char *)realloc(buf, 32);
|
||||
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);
|
||||
char *buf = (char *)malloc(TEST_SIZE);
|
||||
printf("[LmsReallocTest] read overflow & underflow error should be triggered, read range[-1, TEST_SIZE]\n");
|
||||
BufReadTest(buf, -1, TEST_SIZE);
|
||||
char *buf1 = (char *)realloc(buf, TEST_SIZE_MIN);
|
||||
if (buf1 == NULL) {
|
||||
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");
|
||||
}
|
||||
|
||||
static void LmsCallocTest(void)
|
||||
{
|
||||
#define TEST_SIZE 16
|
||||
printf("\n-------- LmsCallocTest Start --------\n");
|
||||
char *buf = (char *)calloc(4, 4);
|
||||
printf("[LmsCallocTest] calloc addr:%p size:%d\n", buf, 16);
|
||||
printf("[LmsCallocTest] read overflow & underflow error should be triggered, read range[-1,16]\n");
|
||||
BufReadTest(buf, -1, 16);
|
||||
char *buf = (char *)calloc(4, 4); /* 4: test size */
|
||||
if (buf == NULL) {
|
||||
return;
|
||||
}
|
||||
printf("[LmsCallocTest] read overflow & underflow error should be triggered, read range[-1, TEST_SIZE]\n");
|
||||
BufReadTest(buf, -1, TEST_SIZE);
|
||||
free(buf);
|
||||
printf("\n-------- LmsCallocTest End --------\n");
|
||||
}
|
||||
|
||||
static void LmsVallocTest(void)
|
||||
{
|
||||
#define TEST_SIZE 4096
|
||||
printf("\n-------- LmsVallocTest Start --------\n");
|
||||
char *buf = (char *)valloc(4096);
|
||||
printf("[LmsVallocTest] valloc addr:%p size:%d\n", buf, 4096);
|
||||
printf("[LmsVallocTest] read overflow & underflow error should be triggered, read range[-1,4096]\n");
|
||||
BufReadTest(buf, -1, 4096);
|
||||
char *buf = (char *)valloc(TEST_SIZE);
|
||||
if (buf == NULL) {
|
||||
return;
|
||||
}
|
||||
printf("[LmsVallocTest] read overflow & underflow error should be triggered, read range[-1, TEST_SIZE]\n");
|
||||
BufReadTest(buf, -1, TEST_SIZE);
|
||||
free(buf);
|
||||
printf("\n-------- LmsVallocTest End --------\n");
|
||||
}
|
||||
|
||||
static void LmsAlignedAllocTest(void)
|
||||
{
|
||||
#define TEST_ALIGN_SIZE 64
|
||||
#define TEST_SIZE 128
|
||||
printf("\n-------- LmsAlignedAllocTest Start --------\n");
|
||||
char *buf = (char *)aligned_alloc(64, 128);
|
||||
printf("[LmsAlignedAllocTest] aligned_alloc boundsize:%d addr:%p size:%d\n", 64, buf, 128);
|
||||
char *buf = (char *)aligned_alloc(TEST_ALIGN_SIZE, TEST_SIZE);
|
||||
if (buf == NULL) {
|
||||
return;
|
||||
}
|
||||
printf("[LmsAlignedAllocTest] read overflow & underflow error should be triggered, read range[-1,128]\n");
|
||||
BufReadTest(buf, -1, 128);
|
||||
free(buf);
|
||||
|
@ -113,44 +130,55 @@ static void LmsAlignedAllocTest(void)
|
|||
|
||||
static void LmsMemsetTest(void)
|
||||
{
|
||||
#define TEST_SIZE 32
|
||||
printf("\n-------- LmsMemsetTest Start --------\n");
|
||||
char *buf = (char *)malloc(32);
|
||||
printf("[LmsMemsetTest] malloc addr:%p size:%d\n", buf, 32);
|
||||
printf("[LmsMemsetTest] memset overflow & underflow error should be triggered, memset size:%d\n", 33);
|
||||
memset(buf, 0, 33);
|
||||
char *buf = (char *)malloc(TEST_SIZE);
|
||||
if (buf == NULL) {
|
||||
return;
|
||||
}
|
||||
printf("[LmsMemsetTest] memset overflow & underflow error should be triggered, memset size:%d\n", TEST_SIZE + 1);
|
||||
memset(buf, 0, TEST_SIZE + 1);
|
||||
free(buf);
|
||||
printf("\n-------- LmsMemsetTest End --------\n");
|
||||
}
|
||||
|
||||
static void LmsMemcpyTest(void)
|
||||
{
|
||||
#define TEST_SIZE 20
|
||||
printf("\n-------- LmsMemcpyTest Start --------\n");
|
||||
char *buf = (char *)malloc(20);
|
||||
printf("[LmsMemcpyTest] malloc addr:%p size:%d\n", buf, 20);
|
||||
char localBuf[32] = {0};
|
||||
printf("[LmsMemcpyTest] memcpy overflow error should be triggered, memcpy size:%d\n", 21);
|
||||
memcpy(buf, localBuf, 21);
|
||||
char *buf = (char *)malloc(TEST_SIZE);
|
||||
if (buf == NULL) {
|
||||
return;
|
||||
}
|
||||
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);
|
||||
printf("\n-------- LmsMemcpyTest End --------\n");
|
||||
}
|
||||
|
||||
static void LmsMemmoveTest(void)
|
||||
{
|
||||
#define TEST_SIZE 20
|
||||
printf("\n-------- LmsMemmoveTest Start --------\n");
|
||||
char *buf = (char *)malloc(20);
|
||||
printf("[LmsMemmoveTest] malloc addr:%p size:%d\n", buf, 20);
|
||||
printf("[LmsMemmoveTest] memmove overflow error should be triggered, dest addr:%p src addr:%p size:%d\n", buf + 12,
|
||||
buf, 10);
|
||||
memmove(buf + 12, buf, 10);
|
||||
char *buf = (char *)malloc(TEST_SIZE);
|
||||
if (buf == NULL) {
|
||||
return;
|
||||
}
|
||||
printf("[LmsMemmoveTest] memmove overflow error should be triggered\n");
|
||||
memmove(buf + 12, buf, 10); /* 12 and 10: test size */
|
||||
free(buf);
|
||||
printf("\n-------- LmsMemmoveTest End --------\n");
|
||||
}
|
||||
|
||||
static void LmsStrcpyTest(void)
|
||||
{
|
||||
#define TEST_SIZE 16
|
||||
printf("\n-------- LmsStrcpyTest Start --------\n");
|
||||
char *buf = (char *)malloc(16);
|
||||
printf("[LmsStrcpyTest] malloc addr:%p size:%d\n", buf, 16);
|
||||
char *buf = (char *)malloc(TEST_SIZE);
|
||||
if (buf == NULL) {
|
||||
return;
|
||||
}
|
||||
char *testStr = "bbbbbbbbbbbbbbbbb";
|
||||
printf("[LmsStrcpyTest] strcpy overflow error should be triggered, src string buf size:%d\n", strlen(testStr) + 1);
|
||||
strcpy(buf, testStr);
|
||||
|
@ -160,9 +188,12 @@ static void LmsStrcpyTest(void)
|
|||
|
||||
static void LmsStrcatTest(void)
|
||||
{
|
||||
#define TEST_SIZE 16
|
||||
printf("\n-------- LmsStrcatTest Start --------\n");
|
||||
char *buf = (char *)malloc(16);
|
||||
printf("[LmsStrcatTest] malloc addr:%p size:%d\n", buf, 16);
|
||||
char *buf = (char *)malloc(TEST_SIZE);
|
||||
if (buf == NULL) {
|
||||
return;
|
||||
}
|
||||
buf[0] = 'a';
|
||||
buf[1] = 'b';
|
||||
buf[2] = 0;
|
||||
|
@ -177,22 +208,30 @@ static void LmsStrcatTest(void)
|
|||
|
||||
static void LmsFreeTest(void)
|
||||
{
|
||||
#define TEST_SIZE 16
|
||||
printf("\n-------- LmsFreeTest Start --------\n");
|
||||
char *buf = (char *)malloc(16);
|
||||
printf("[LmsFreeTest] malloc addr:%p size:%d\n", buf, 16);
|
||||
printf("[LmsFreeTest] free addr:%p\n", buf, 16);
|
||||
char *buf = (char *)malloc(TEST_SIZE);
|
||||
if (buf == NULL) {
|
||||
return;
|
||||
}
|
||||
printf("[LmsFreeTest] free size:%d\n", TEST_SIZE);
|
||||
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);
|
||||
printf("[LmsFreeTest] double free error should be triggered, free addr:%p\n", buf);
|
||||
printf("[LmsFreeTest] double free error should be triggered\n");
|
||||
free(buf);
|
||||
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");
|
||||
char *tmp = (char *)malloc(5000);
|
||||
char *tmp = (char *)malloc(5000); /* 5000: test mem size */
|
||||
if (tmp == NULL) {
|
||||
return;
|
||||
}
|
||||
LmsMallocTest();
|
||||
LmsReallocTest();
|
||||
LmsCallocTest();
|
||||
|
@ -204,5 +243,6 @@ int main(int argc, char * const * argv)
|
|||
LmsStrcpyTest();
|
||||
LmsStrcatTest();
|
||||
LmsFreeTest();
|
||||
free(tmp);
|
||||
printf("\n############### Lms Test End ###############\n");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -62,10 +62,17 @@ int main(int argc, char **argv)
|
|||
PerfStop(fd);
|
||||
} else if ((argc == THREE_ARGS) && strcmp(argv[1], "read") == 0) {
|
||||
size_t size = strtoul(argv[THREE_ARGS - 1], NULL, 0);
|
||||
if (size <= 0) {
|
||||
goto EXIT:
|
||||
}
|
||||
|
||||
char *buf = (char *)malloc(size);
|
||||
int len = PerfRead(fd, buf, size);
|
||||
PerfPrintBuffer(buf, len);
|
||||
free(buf);
|
||||
if (buf != NULL) {
|
||||
int len = PerfRead(fd, buf, size);
|
||||
PerfPrintBuffer(buf, len);
|
||||
free(buf);
|
||||
buf = NULL;
|
||||
}
|
||||
} else if ((argc == TWO_ARGS) && strcmp(argv[1], "list") == 0) {
|
||||
PerfList();
|
||||
} else if ((argc >= THREE_ARGS) && strcmp(argv[1], "stat") == 0) {
|
||||
|
@ -77,6 +84,7 @@ int main(int argc, char **argv)
|
|||
PerfUsage();
|
||||
}
|
||||
|
||||
EXIT:
|
||||
close(fd);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -113,7 +113,6 @@ ssize_t PerfWriteFile(const char *filePath, const char *buf, ssize_t bufSize)
|
|||
ssize_t totalWrite = 0;
|
||||
|
||||
if (filePath == NULL || buf == NULL || bufSize == 0) {
|
||||
printf("filePath: %p, buf: %p, bufSize: %u!\n", filePath, buf, bufSize);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
|
@ -108,11 +108,15 @@ static int DoShellExec(char **argv)
|
|||
if (!cmdLine) {
|
||||
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++) {
|
||||
strcat_s(cmdLine, len, argv[j]);
|
||||
strcat_s(cmdLine, len, " ");
|
||||
(void)strcat_s(cmdLine, len, argv[j]);
|
||||
(void)strcat_s(cmdLine, len, " ");
|
||||
}
|
||||
|
||||
cmdLine[len - 2] = '\0'; /* 2, (len - 2) is the end of cmdline buf */
|
||||
|
|
|
@ -36,7 +36,6 @@
|
|||
#include "dirent.h"
|
||||
#include "securec.h"
|
||||
|
||||
|
||||
#define SHELL_INIT_MAGIC_FLAG 0xABABABAB
|
||||
#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:
|
||||
* 1) The overmatch space which is not be marked by Quote's area
|
||||
* 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
|
||||
* cmdOut : Pass out the buffer string ,which has already been operated
|
||||
* size : cmdKey length
|
||||
|
@ -407,17 +406,17 @@ unsigned int OsCmdKeyShift(const char *cmdKey, char *cmdOut, unsigned int size)
|
|||
|
||||
/* Backup the 'output' start address */
|
||||
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++) {
|
||||
/* Detected a Double Quotes, switch the matching status */
|
||||
if (*(cmdKey) == '\"') {
|
||||
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) */
|
||||
/* 2) Current charactor is a space */
|
||||
/* 3) Next charactor is a space too, or the string is been seeked to the end already(\0) */
|
||||
/* 4) Invalid charactor, such as single quotes */
|
||||
/* 2) Current character is a space */
|
||||
/* 3) Next character is a space too, or the string is been seeked to the end already(\0) */
|
||||
/* 4) Invalid character, such as single quotes */
|
||||
if ((*cmdKey == ' ') && ((*(cmdKey + 1) == ' ') || (*(cmdKey + 1) == '\0')) && QUOTES_STATUS_CLOSE(quotes)) {
|
||||
continue;
|
||||
}
|
||||
|
@ -431,7 +430,7 @@ unsigned int OsCmdKeyShift(const char *cmdKey, char *cmdOut, unsigned int size)
|
|||
/* Restore the 'output' start address */
|
||||
output = outputBak;
|
||||
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 == ' ') {
|
||||
output++;
|
||||
len--;
|
||||
|
@ -585,7 +584,6 @@ END:
|
|||
|
||||
unsigned int OsCmdExec(CmdParsed *cmdParsed, char *cmdStr)
|
||||
{
|
||||
/* TODO: complete the usrspace command */
|
||||
unsigned int ret = SH_OK;
|
||||
if (cmdParsed && cmdStr) {
|
||||
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 (*tmpStr == '\"') {
|
||||
SWITCH_QUOTES_STATUS(quotes);
|
||||
/* Ignore the double quote charactor itself */
|
||||
/* Ignore the double quote character itself */
|
||||
tmpStr++;
|
||||
continue;
|
||||
}
|
||||
/* 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))) {
|
||||
break;
|
||||
}
|
||||
|
@ -503,7 +503,7 @@ unsigned int PreHandleCmdline(const char *input, char **output, unsigned int *ou
|
|||
*output = shiftStr;
|
||||
*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] == '/')) {
|
||||
execLen = strlen(execCmd);
|
||||
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_INT32 -1
|
||||
#define TFTP_NULL_INT32 (-1)
|
||||
|
||||
/** @cond liteos
|
||||
* @defgroup TFTP_Interfaces
|
||||
|
@ -114,7 +114,7 @@ typedef enum tagTFTPC_OpCode {
|
|||
TFTPC_OP_RRQ = 1, /* read request */
|
||||
TFTPC_OP_WRQ, /* write request */
|
||||
TFTPC_OP_DATA, /* data packet */
|
||||
TFTPC_OP_ACK, /* acknowledgement */
|
||||
TFTPC_OP_ACK, /* acknowledgment */
|
||||
TFTPC_OP_ERROR, /* error code */
|
||||
TFTPC_OP_OPT /* option code */
|
||||
} TFTPC_OPCODE_E;
|
||||
|
|
|
@ -50,11 +50,11 @@ static char *TftpError[] = {
|
|||
"Error while sending data to the peer\n",
|
||||
"Requested file is not found\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 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 name lenght greater than 256\n",
|
||||
"File name length greater than 256\n",
|
||||
"Hostname IP is not valid\n",
|
||||
"TFTP server returned file access error\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 write error\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",
|
||||
"The destination file path length greater than 256\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
|
||||
|
|
|
@ -189,7 +189,7 @@ u32_t lwip_tftp_recv_from_server(s32_t iSockNum, u32_t *pulSize, TFTPC_PACKET_S
|
|||
if (iRet == -1) {
|
||||
return TFTPC_SELECT_ERROR;
|
||||
} else if (iRet == 0) {
|
||||
return TFTPC_TIMEOUT_ERROR; /* Select timeout occured */
|
||||
return TFTPC_TIMEOUT_ERROR; /* Select timeout occurred */
|
||||
}
|
||||
|
||||
if (!FD_ISSET(iSockNum, &stReadfds)) {
|
||||
|
@ -218,7 +218,7 @@ u32_t lwip_tftp_recv_from_server(s32_t iSockNum, u32_t *pulSize, TFTPC_PACKET_S
|
|||
usOpcode = ntohs(pstRecvBuf->usOpcode);
|
||||
/* if this packet is ERROR packet */
|
||||
if (usOpcode == TFTPC_OP_ERROR) {
|
||||
ulError = ntohs (pstRecvBuf->u.stTFTP_Err.usErrNum);
|
||||
ulError = ntohs(pstRecvBuf->u.stTFTP_Err.usErrNum);
|
||||
|
||||
/*If the error is according to RFC,then convert to lwip error codes.
|
||||
Constant values are used in the cases as these error codes are as per
|
||||
|
@ -268,7 +268,7 @@ u32_t lwip_tftp_recv_from_server(s32_t iSockNum, u32_t *pulSize, TFTPC_PACKET_S
|
|||
*pulSize = (u32_t)iRet;
|
||||
|
||||
/* 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 */
|
||||
if (((usOpcode == TFTPC_OP_DATA) &&
|
||||
(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,
|
||||
&ulIgnorePkt, &stServerAddr, pstSendBuf);
|
||||
/* If select timeout occured */
|
||||
/* If select timeout occurred */
|
||||
if (ulErrCode == TFTPC_TIMEOUT_ERROR) {
|
||||
ulTotalTime++;
|
||||
if (ulTotalTime < TFTPC_MAX_SEND_REQ_ATTEMPTS) {
|
||||
|
@ -727,7 +727,7 @@ u32_t lwip_tftp_get_file_by_filename(u32_t ulHostAddr,
|
|||
}
|
||||
|
||||
/* if this packet is unkonwn or incorrect packet */
|
||||
if (ntohs (pstRecvBuf->usOpcode) != TFTPC_OP_DATA) {
|
||||
if (ntohs(pstRecvBuf->usOpcode) != TFTPC_OP_DATA) {
|
||||
/* Send error packet to server */
|
||||
lwip_tftp_send_error(iSockNum,
|
||||
TFTPC_PROTOCOL_PROTO_ERROR,
|
||||
|
@ -982,7 +982,7 @@ u32_t lwip_tftp_put_file_by_filename(u32_t ulHostAddr, u16_t usTftpServPort, u8_
|
|||
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));
|
||||
|
||||
/* 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;
|
||||
}
|
||||
|
||||
/* First time intialize the buffer */
|
||||
/* First time initialize the buffer */
|
||||
(void)memset_s((void *)pstRecvBuf, sizeof(TFTPC_PACKET_S), 0, sizeof(TFTPC_PACKET_S));
|
||||
|
||||
/* 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,
|
||||
pstRecvBuf, &ulIgnorePkt,
|
||||
pstServerAddr, pstSendBuf);
|
||||
/* If select timeout occured */
|
||||
/* If select timeout occurred */
|
||||
if (ulError == TFTPC_TIMEOUT_ERROR) {
|
||||
ulTotalTime++;
|
||||
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,
|
||||
&stServerAddr, pstSendBuf);
|
||||
/* If select timeout occured */
|
||||
/* If select timeout occurred */
|
||||
if (ulErrCode == TFTPC_TIMEOUT_ERROR) {
|
||||
ulTotalTime++;
|
||||
if (ulTotalTime < TFTPC_MAX_SEND_REQ_ATTEMPTS) {
|
||||
|
@ -1557,7 +1557,7 @@ u32_t lwip_tftp_get_file_by_filename_to_rawmem(u32_t ulHostAddr,
|
|||
}
|
||||
|
||||
/* if this packet is unkonwn or incorrect packet */
|
||||
if (ntohs (pstRecvBuf->usOpcode) != TFTPC_OP_DATA) {
|
||||
if (ntohs(pstRecvBuf->usOpcode) != TFTPC_OP_DATA) {
|
||||
/* Send error packet to server */
|
||||
lwip_tftp_send_error(iSockNum,
|
||||
TFTPC_PROTOCOL_PROTO_ERROR,
|
||||
|
|
|
@ -70,6 +70,10 @@ static void TraceRead(int fd, size_t size)
|
|||
{
|
||||
ssize_t i;
|
||||
ssize_t len;
|
||||
if (size <= 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
char *buffer = (char *)malloc(size);
|
||||
if (buffer == NULL) {
|
||||
printf("Read buffer malloc failed.\n");
|
||||
|
|
|
@ -246,7 +246,7 @@ STATIC INLINE INT32 LOS_AtomicIncRet(Atomic *v)
|
|||
* @brief Atomic auto-decrement.
|
||||
*
|
||||
* @par Description:
|
||||
* This API is used to implementating the atomic auto-decrement.
|
||||
* This API is used to implement the atomic auto-decrement.
|
||||
* @attention
|
||||
* <ul>
|
||||
* <li>The pointer v must not be NULL.</li>
|
||||
|
@ -280,7 +280,7 @@ STATIC INLINE VOID LOS_AtomicDec(Atomic *v)
|
|||
* @brief Atomic auto-decrement.
|
||||
*
|
||||
* @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
|
||||
* <ul>
|
||||
* <li>The pointer v must not be NULL.</li>
|
||||
|
@ -531,7 +531,7 @@ STATIC INLINE INT64 LOS_Atomic64IncRet(Atomic64 *v)
|
|||
* @brief Atomic64 auto-decrement.
|
||||
*
|
||||
* @par Description:
|
||||
* This API is used to implementating the atomic64 auto-decrement.
|
||||
* This API is used to implement the atomic64 auto-decrement.
|
||||
* @attention
|
||||
* <ul>
|
||||
* <li>The pointer v must not be NULL.</li>
|
||||
|
@ -566,7 +566,7 @@ STATIC INLINE VOID LOS_Atomic64Dec(Atomic64 *v)
|
|||
* @brief Atomic64 auto-decrement.
|
||||
*
|
||||
* @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
|
||||
* <ul>
|
||||
* <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)
|
||||
{
|
||||
UINT32 val = ((filter & 0x3) << 24) | ((cpuMask & 0xFF) << 16) |
|
||||
UINT32 val = ((filter & 0x3) << 24) | ((cpuMask & 0xFF) << 16) | /* 24, 16: Register bit offset */
|
||||
(vector & 0xF);
|
||||
|
||||
GIC_REG_32(GICD_SGIR) = val;
|
||||
|
@ -62,7 +62,7 @@ VOID HalIrqSendIpi(UINT32 target, UINT32 ipi)
|
|||
|
||||
VOID HalIrqSetAffinity(UINT32 vector, UINT32 cpuMask)
|
||||
{
|
||||
UINT32 offset = vector / 4;
|
||||
UINT32 offset = vector / 4; /* 4: Interrupt bit width */
|
||||
UINT32 index = vector & 0x3;
|
||||
|
||||
GIC_REG_8(GICD_ITARGETSR(offset) + index) = cpuMask;
|
||||
|
@ -80,7 +80,7 @@ VOID HalIrqMask(UINT32 vector)
|
|||
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)
|
||||
|
@ -89,7 +89,7 @@ VOID HalIrqUnmask(UINT32 vector)
|
|||
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)
|
||||
|
@ -98,7 +98,7 @@ VOID HalIrqPending(UINT32 vector)
|
|||
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)
|
||||
|
@ -119,24 +119,24 @@ VOID HalIrqInit(VOID)
|
|||
{
|
||||
UINT32 i;
|
||||
|
||||
/* set externel interrupts to be level triggered, active low. */
|
||||
for (i = 32; i < OS_HWI_MAX_NUM; i += 16) {
|
||||
GIC_REG_32(GICD_ICFGR(i / 16)) = 0;
|
||||
/* set external interrupts to be level triggered, active low. */
|
||||
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; /* 16: Register bit offset */
|
||||
}
|
||||
|
||||
/* set externel interrupts to CPU 0 */
|
||||
for (i = 32; i < OS_HWI_MAX_NUM; i += 4) {
|
||||
/* set external interrupts to CPU 0 */
|
||||
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;
|
||||
}
|
||||
|
||||
/* 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;
|
||||
}
|
||||
|
||||
/* disable all interrupts. */
|
||||
for (i = 0; i < OS_HWI_MAX_NUM; i += 32) {
|
||||
GIC_REG_32(GICD_ICENABLER(i / 32)) = ~0;
|
||||
for (i = 0; i < OS_HWI_MAX_NUM; i += 32) { /* 32: Interrupt bit width */
|
||||
GIC_REG_32(GICD_ICENABLER(i / 32)) = ~0; /* 32: Interrupt bit width */
|
||||
}
|
||||
|
||||
HalIrqInitPercpu();
|
||||
|
|
|
@ -42,9 +42,9 @@ STATIC UINT32 g_curIrqNum = 0;
|
|||
|
||||
STATIC INLINE UINT64 MpidrToAffinity(UINT64 mpidr)
|
||||
{
|
||||
return ((MPIDR_AFF_LEVEL(mpidr, 3) << 32) |
|
||||
(MPIDR_AFF_LEVEL(mpidr, 2) << 16) |
|
||||
(MPIDR_AFF_LEVEL(mpidr, 1) << 8) |
|
||||
return ((MPIDR_AFF_LEVEL(mpidr, 3) << 32) | /* 3: Serial number, 32: Register bit offset */
|
||||
(MPIDR_AFF_LEVEL(mpidr, 2) << 16) | /* 2: Serial number, 16: Register bit offset */
|
||||
(MPIDR_AFF_LEVEL(mpidr, 1) << 8) | /* 1: Serial number, 8: Register bit offset */
|
||||
(MPIDR_AFF_LEVEL(mpidr, 0)));
|
||||
}
|
||||
|
||||
|
@ -106,10 +106,10 @@ STATIC VOID GicSgi(UINT32 irq, UINT32 cpuMask)
|
|||
tList = GicTargetList(&cpu, cpuMask, cluster);
|
||||
|
||||
/* Generates a Group 1 interrupt for the current security state */
|
||||
val = ((MPIDR_AFF_LEVEL(cluster, 3) << 48) |
|
||||
(MPIDR_AFF_LEVEL(cluster, 2) << 32) |
|
||||
(MPIDR_AFF_LEVEL(cluster, 1) << 16) |
|
||||
(irq << 24) | tList);
|
||||
val = ((MPIDR_AFF_LEVEL(cluster, 3) << 48) | /* 3: Serial number, 48: Register bit offset */
|
||||
(MPIDR_AFF_LEVEL(cluster, 2) << 32) | /* 2: Serial number, 32: Register bit offset */
|
||||
(MPIDR_AFF_LEVEL(cluster, 1) << 16) | /* 1: Serial number, 16: Register bit offset */
|
||||
(irq << 24) | tList); /* 24: Register bit offset */
|
||||
|
||||
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 */
|
||||
#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
|
||||
GIC_REG_32(GICD_IGROUPR(irq / 32)) = 0xffffffff;
|
||||
GIC_REG_32(GICD_IGROUPR(irq / 32)) = 0xffffffff; /* 32: Interrupt bit width */
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -248,13 +248,13 @@ UINT32 HalCurIrqGet(VOID)
|
|||
VOID HalIrqMask(UINT32 vector)
|
||||
{
|
||||
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)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (vector < 32) {
|
||||
if (vector < 32) { /* 32: Interrupt bit width */
|
||||
for (i = 0; i < LOSCFG_KERNEL_CORE_NUM; i++) {
|
||||
GIC_REG_32(GICR_ICENABLER0(i)) = mask;
|
||||
GicWaitForRwp(GICR_CTLR(i));
|
||||
|
@ -268,19 +268,19 @@ VOID HalIrqMask(UINT32 vector)
|
|||
VOID HalIrqUnmask(UINT32 vector)
|
||||
{
|
||||
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)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (vector < 32) {
|
||||
if (vector < 32) { /* 32: Interrupt bit width */
|
||||
for (i = 0; i < LOSCFG_KERNEL_CORE_NUM; i++) {
|
||||
GIC_REG_32(GICR_ISENABLER0(i)) = mask;
|
||||
GicWaitForRwp(GICR_CTLR(i));
|
||||
}
|
||||
} else {
|
||||
GIC_REG_32(GICD_ISENABLER(vector >> 5)) = mask;
|
||||
GIC_REG_32(GICD_ISENABLER(vector >> 5)) = mask; /* 5: Register bit offset */
|
||||
GicWaitForRwp(GICD_CTLR);
|
||||
}
|
||||
}
|
||||
|
@ -291,7 +291,7 @@ VOID HalIrqPending(UINT32 vector)
|
|||
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)
|
||||
|
@ -362,30 +362,30 @@ VOID HalIrqInit(VOID)
|
|||
GicWaitForRwp(GICD_CTLR);
|
||||
ISB;
|
||||
|
||||
/* set externel interrupts to be level triggered, active low. */
|
||||
for (i = 32; i < OS_HWI_MAX_NUM; i += 16) {
|
||||
/* set external interrupts to be level triggered, active low. */
|
||||
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;
|
||||
}
|
||||
|
||||
/* config distributer, mask and clear all spis, set group x */
|
||||
for (i = 32; i < OS_HWI_MAX_NUM; i += 32) {
|
||||
GIC_REG_32(GICD_ICENABLER(i / 32)) = 0xffffffff;
|
||||
GIC_REG_32(GICD_ICPENDR(i / 32)) = 0xffffffff;
|
||||
GIC_REG_32(GICD_IGRPMODR(i / 32)) = 0;
|
||||
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; /* 32: Interrupt bit width */
|
||||
GIC_REG_32(GICD_ICPENDR(i / 32)) = 0xffffffff; /* 32: Interrupt bit width */
|
||||
GIC_REG_32(GICD_IGRPMODR(i / 32)) = 0; /* 32: Interrupt bit width */
|
||||
|
||||
GicdSetGroup(i);
|
||||
}
|
||||
|
||||
/* 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);
|
||||
}
|
||||
|
||||
GicWaitForRwp(GICD_CTLR);
|
||||
|
||||
/* disable all interrupts. */
|
||||
for (i = 0; i < OS_HWI_MAX_NUM; i += 32) {
|
||||
GIC_REG_32(GICD_ICENABLER(i / 32)) = 0xffffffff;
|
||||
for (i = 0; i < OS_HWI_MAX_NUM; i += 32) { /* 32: Interrupt bit width */
|
||||
GIC_REG_32(GICD_ICENABLER(i / 32)) = 0xffffffff; /* 32: Interrupt bit width */
|
||||
}
|
||||
|
||||
/* enable distributor with ARE, group 1 enabled */
|
||||
|
@ -393,7 +393,7 @@ VOID HalIrqInit(VOID)
|
|||
|
||||
/* set spi to boot cpu only. ARE must be enabled */
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
|
@ -77,8 +77,8 @@ enum {
|
|||
#define GICD_PIDR2V3 (GICD_OFFSET + 0xffe8)
|
||||
|
||||
#ifdef LOSCFG_ARCH_GIC_V3
|
||||
#define GICD_IGRPMODR(n) (GICD_OFFSET + 0x0d00 + (n) * 4) /* Interrupt Group Mode Reisters */
|
||||
#define GICD_IROUTER(n) (GICD_OFFSET + 0x6000 + (n) * 8) /* Interrupt Rounter 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 Registers */
|
||||
#endif
|
||||
|
||||
#define GIC_REG_8(reg) (*(volatile UINT8 *)((UINTPTR)(GIC_BASE_ADDR + (reg))))
|
||||
|
|
|
@ -43,7 +43,6 @@
|
|||
"bounds_checking_function",
|
||||
"toybox",
|
||||
"NuttX",
|
||||
"Linux_Kernel",
|
||||
"FatFs",
|
||||
"mksh",
|
||||
"musl",
|
||||
|
@ -63,4 +62,4 @@
|
|||
"test": []
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -71,7 +71,7 @@ extern "C" {
|
|||
/* CONSTANTS */
|
||||
|
||||
#define MQ_USE_MAGIC 0x89abcdef
|
||||
/* not suppurt prio */
|
||||
/* not support prio */
|
||||
#define MQ_PRIO_MAX 1
|
||||
|
||||
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>EINVAL</b>: invalid parameter.</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>
|
||||
*
|
||||
* @par Dependency:
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
*/
|
||||
|
||||
void *calloc(size_t nitems, size_t size)
|
||||
{ /*lint !e578*/
|
||||
{
|
||||
size_t real_size;
|
||||
void *ptr = NULL;
|
||||
|
||||
|
@ -78,7 +78,7 @@ void free(void *ptr)
|
|||
*/
|
||||
|
||||
void *malloc(size_t size)
|
||||
{ /*lint !e31 !e10*/
|
||||
{
|
||||
if (size == 0) {
|
||||
return NULL;
|
||||
}
|
||||
|
@ -87,7 +87,7 @@ void *malloc(size_t size)
|
|||
}
|
||||
|
||||
void *zalloc(size_t size)
|
||||
{ /*lint !e10*/
|
||||
{
|
||||
void *ptr = NULL;
|
||||
|
||||
if (size == 0) {
|
||||
|
@ -142,4 +142,4 @@ void *realloc(void *ptr, size_t size)
|
|||
}
|
||||
|
||||
return LOS_KernelRealloc(ptr, (UINT32) size);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -647,7 +647,7 @@ int clock_getres(clockid_t clockID, struct timespec *tp)
|
|||
case CLOCK_MONOTONIC_RAW:
|
||||
case CLOCK_MONOTONIC:
|
||||
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_sec = 0;
|
||||
break;
|
||||
|
|
|
@ -45,8 +45,6 @@
|
|||
#include "bcache.h"
|
||||
#endif
|
||||
|
||||
#include "pthread.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
extern "C" {
|
||||
|
@ -253,7 +251,7 @@ struct disk_divide_info {
|
|||
* </ul>
|
||||
*
|
||||
* @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 diskID [IN] Type #INT32 disk id number, less than SYS_MAX_DISK.
|
||||
* @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.
|
||||
*
|
||||
* @par Description:
|
||||
* Get the correponding INUSED disk id by diskName.
|
||||
* Get the corresponding INUSED disk id by diskName.
|
||||
*
|
||||
* @attention
|
||||
* <ul>
|
||||
|
|
|
@ -107,7 +107,7 @@ INT32 los_alloc_diskid_byname(const CHAR *diskName)
|
|||
size_t nameLen;
|
||||
|
||||
if (diskName == NULL) {
|
||||
PRINT_ERR("The paramter disk_name is NULL");
|
||||
PRINT_ERR("The parameter disk_name is NULL");
|
||||
return VFS_ERROR;
|
||||
}
|
||||
|
||||
|
@ -163,7 +163,7 @@ INT32 los_get_diskid_byname(const CHAR *diskName)
|
|||
size_t diskNameLen;
|
||||
|
||||
if (diskName == NULL) {
|
||||
PRINT_ERR("The paramter diskName is NULL");
|
||||
PRINT_ERR("The parameter diskName is NULL");
|
||||
return VFS_ERROR;
|
||||
}
|
||||
|
||||
|
@ -756,7 +756,7 @@ INT32 DiskPartitionRegister(los_disk *disk)
|
|||
los_part *part = NULL;
|
||||
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));
|
||||
partSize = sizeof(parInfo.part) / sizeof(parInfo.part[0]);
|
||||
|
||||
|
@ -788,7 +788,7 @@ INT32 DiskPartitionRegister(los_disk *disk)
|
|||
}
|
||||
|
||||
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) &&
|
||||
(parInfo.part[i].type != EXTENDED_8G)) {
|
||||
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) {
|
||||
(void)memcpy_s(&g_randomOp, sizeof(RandomOperations), r, sizeof(RandomOperations));
|
||||
} else {
|
||||
PRINT_ERR("param is invalid\n", __FUNCTION__, __LINE__);
|
||||
PRINT_ERR("%s %d param is invalid\n", __FUNCTION__, __LINE__);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -103,7 +103,7 @@ static ssize_t TraceWrite(struct file *filep, const char *buffer, size_t buflen)
|
|||
if (info == NULL) {
|
||||
return -ENOMEM;
|
||||
}
|
||||
memset_s(info, infoLen, 0, infoLen);
|
||||
(void)memset_s(info, infoLen, 0, infoLen);
|
||||
|
||||
ret = LOS_CopyToKernel(info, infoLen, buffer, buflen);
|
||||
if (ret != 0) {
|
||||
|
|
|
@ -289,7 +289,7 @@ static INT32 BlockDriverRegisterOperate(mtd_partition *newNode,
|
|||
if (ret) {
|
||||
free(newNode->blockdriver_name);
|
||||
newNode->blockdriver_name = NULL;
|
||||
PRINT_ERR("register blkdev partion error\n");
|
||||
PRINT_ERR("register blkdev partition error\n");
|
||||
return ret;
|
||||
}
|
||||
} else {
|
||||
|
@ -322,7 +322,7 @@ static INT32 CharDriverRegisterOperate(mtd_partition *newNode,
|
|||
|
||||
ret = register_driver(newNode->chardriver_name, param->char_ops, RWE_RW_RW, newNode);
|
||||
if (ret) {
|
||||
PRINT_ERR("register chardev partion error\n");
|
||||
PRINT_ERR("register chardev partition error\n");
|
||||
free(newNode->chardriver_name);
|
||||
newNode->chardriver_name = NULL;
|
||||
return ret;
|
||||
|
@ -340,7 +340,7 @@ static INT32 BlockDriverUnregister(mtd_partition *node)
|
|||
if (node->blockdriver_name != NULL) {
|
||||
ret = unregister_blockdriver(node->blockdriver_name);
|
||||
if (ret == -EBUSY) {
|
||||
PRINT_ERR("unregister blkdev partion error:%d\n", ret);
|
||||
PRINT_ERR("unregister blkdev partition error:%d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
free(node->blockdriver_name);
|
||||
|
@ -356,7 +356,7 @@ static INT32 CharDriverUnregister(mtd_partition *node)
|
|||
if (node->chardriver_name != NULL) {
|
||||
ret = unregister_driver(node->chardriver_name);
|
||||
if (ret == -EBUSY) {
|
||||
PRINT_ERR("unregister chardev partion error:%d\n", ret);
|
||||
PRINT_ERR("unregister chardev partition error:%d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
free(node->chardriver_name);
|
||||
|
|
|
@ -4,7 +4,7 @@ source "fs/ramfs/Kconfig"
|
|||
source "fs/romfs/Kconfig"
|
||||
source "fs/nfs/Kconfig"
|
||||
source "fs/proc/Kconfig"
|
||||
source "fs/jffs2/Kconfig"
|
||||
#source "fs/jffs2/Kconfig"
|
||||
source "fs/rootfs/Kconfig"
|
||||
source "fs/patchfs/Kconfig"
|
||||
source "fs/zpfs/Kconfig"
|
||||
source "fs/zpfs/Kconfig"
|
||||
|
|
|
@ -1861,7 +1861,7 @@ static FRESULT fatfs_setlabel(los_part *part)
|
|||
return result;
|
||||
}
|
||||
|
||||
int fatfs_mkfs (struct Vnode *device, int sectors, int option)
|
||||
int fatfs_mkfs(struct Vnode *device, int sectors, int option)
|
||||
{
|
||||
BYTE *work_buff = NULL;
|
||||
los_part *part = NULL;
|
||||
|
|
|
@ -137,7 +137,7 @@ int fatfs_readdir(struct Vnode *vnode, struct fs_dirent_s *idir);
|
|||
int fatfs_rewinddir(struct Vnode *vnode, struct fs_dirent_s *dir);
|
||||
int fatfs_closedir(struct Vnode *vnode, struct fs_dirent_s *dir);
|
||||
int fatfs_rename(struct Vnode *oldvnode, struct Vnode *newparent, const char *oldname, const char *newname);
|
||||
int fatfs_mkfs (struct Vnode *device, int sectors, int option);
|
||||
int fatfs_mkfs(struct Vnode *device, int sectors, int option);
|
||||
int fatfs_mkdir(struct Vnode *parent, const char *name, mode_t mode, struct Vnode **vpp);
|
||||
int fatfs_rmdir(struct Vnode *parent, struct Vnode *vp, const char *name);
|
||||
int fatfs_unlink(struct Vnode *parent, struct Vnode *vp, const char *name);
|
||||
|
|
|
@ -319,7 +319,7 @@ FRESULT f_regvirfs(FATFS *fs)
|
|||
|
||||
/* Set the CHILD object field */
|
||||
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 */
|
||||
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
|
||||
* each CHILD FATFS
|
||||
* - 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
|
||||
*
|
||||
* Others Return Value:
|
||||
|
@ -581,11 +581,11 @@ FRESULT f_checkvirpart(FATFS *fs, const TCHAR *path, BYTE vol)
|
|||
labelTmp = (DWORD *)label;
|
||||
*labelTmp = tmp;
|
||||
tmp = ld_dword(work + VR_PARTITION + i * VR_ITEMSIZE + VR_Entry + 4);
|
||||
*((DWORD * )(label + 4)) = tmp;
|
||||
*((DWORD *)(label + 4)) = tmp;
|
||||
tmp = ld_dword(work + VR_PARTITION + i * VR_ITEMSIZE + VR_Entry + 8);
|
||||
*((DWORD * )(label + 8)) = tmp;
|
||||
*((DWORD *)(label + 8)) = tmp;
|
||||
tmp = ld_dword(work + VR_PARTITION + i * VR_ITEMSIZE + VR_Entry + 12);
|
||||
*((DWORD * )(label + 12)) = tmp;
|
||||
*((DWORD *)(label + 12)) = tmp;
|
||||
|
||||
if (f_checkname(label) != FR_OK) {
|
||||
(void)f_unregvirfs(fs);
|
||||
|
@ -721,11 +721,11 @@ FRESULT f_makevirpart(FATFS *fs, const TCHAR *path, BYTE vol)
|
|||
labelTmp = (DWORD *)label;
|
||||
tmp = *labelTmp;
|
||||
st_dword(work + VR_PARTITION + i * VR_ITEMSIZE + VR_Entry + 0, tmp);
|
||||
tmp = *((DWORD * )(label + 4));
|
||||
tmp = *((DWORD *)(label + 4));
|
||||
st_dword(work + VR_PARTITION + i * VR_ITEMSIZE + VR_Entry + 4, tmp);
|
||||
tmp = *((DWORD * )(label + 8));
|
||||
tmp = *((DWORD *)(label + 8));
|
||||
st_dword(work + VR_PARTITION + i * VR_ITEMSIZE + VR_Entry + 8, tmp);
|
||||
tmp = *((DWORD * )(label + 12));
|
||||
tmp = *((DWORD *)(label + 12));
|
||||
st_dword(work + VR_PARTITION + i * VR_ITEMSIZE + VR_Entry + 12, tmp);
|
||||
|
||||
virpartper += g_fatVirPart.virtualinfo.virpartpercent[i];
|
||||
|
|
|
@ -98,7 +98,7 @@ extern char *rindex(const char *s, int c);
|
|||
* @ingroup fs
|
||||
*
|
||||
* @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().
|
||||
*
|
||||
* @param name [IN] label to set, the length must be less than 12
|
||||
|
|
|
@ -28,23 +28,89 @@
|
|||
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
import("//kernel/liteos_a/liteos.gni")
|
||||
import("//third_party/Linux_Kernel/Linux_Kernel.gni")
|
||||
|
||||
module_switch = defined(LOSCFG_FS_JFFS)
|
||||
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) {
|
||||
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 = [
|
||||
"src/jffs2_hash.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" ]
|
||||
|
||||
deps = [ ":cp_jffs2_src" ]
|
||||
}
|
||||
|
||||
config("public") {
|
||||
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))
|
||||
|
||||
LOCAL_SRCS := $(wildcard src/*.c) \
|
||||
$(wildcard $(LITEOSTHIRDPARTY)/Linux_Kernel/fs/jffs2/*.c)
|
||||
LINUX_PATH := $(LITEOSTOPDIR)/../linux/linux-5.10
|
||||
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 := \
|
||||
-I $(LITEOSTOPDIR)/fs/jffs2/include \
|
||||
-I $(LITEOSTHIRDPARTY)/Linux_Kernel/fs/jffs2 \
|
||||
-I $(LITEOSTHIRDPARTY)/Linux_Kernel/fs
|
||||
-I $(TEMP_SRC_PATH)/fs/jffs2 \
|
||||
-I $(TEMP_SRC_PATH)/fs
|
||||
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)
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -55,14 +55,15 @@ INT32 OsMountPatchFs(VOID)
|
|||
}
|
||||
partInfo.fsType = strdup(FS_TYPE);
|
||||
if (partInfo.fsType == NULL) {
|
||||
return LOS_NOK;
|
||||
ret = LOS_NOK;
|
||||
goto EXIT;
|
||||
}
|
||||
partInfo.startAddr = PATCHFS_FLASH_ADDR;
|
||||
partInfo.partSize = PATCHFS_FLASH_SIZE;
|
||||
#else
|
||||
ret = GetPartitionInfo(&partInfo);
|
||||
if (ret != LOS_OK) {
|
||||
return ret;
|
||||
goto EXIT;
|
||||
}
|
||||
partInfo.startAddr = (partInfo.startAddr >= 0) ? partInfo.startAddr : PATCHFS_FLASH_ADDR;
|
||||
partInfo.partSize = (partInfo.partSize >= 0) ? partInfo.partSize : PATCHFS_FLASH_SIZE;
|
||||
|
@ -71,7 +72,7 @@ INT32 OsMountPatchFs(VOID)
|
|||
ret = LOS_NOK;
|
||||
partInfo.devName = strdup(PATCH_FLASH_DEV_NAME);
|
||||
if (partInfo.devName == NULL) {
|
||||
return LOS_NOK;
|
||||
goto EXIT;
|
||||
}
|
||||
const CHAR *devName = GetDevNameOfPartition(&partInfo);
|
||||
if (devName != NULL) {
|
||||
|
@ -92,9 +93,13 @@ INT32 OsMountPatchFs(VOID)
|
|||
ResetDevNameofPartition(&partInfo);
|
||||
}
|
||||
|
||||
EXIT:
|
||||
free(partInfo.devName);
|
||||
partInfo.devName = NULL;
|
||||
free(partInfo.storageType);
|
||||
partInfo.storageType = NULL;
|
||||
free(partInfo.fsType);
|
||||
partInfo.fsType = NULL;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
@ -60,7 +60,7 @@ typedef unsigned short fmode_t;
|
|||
#define FMODE_64BITHASH ((fmode_t)0x400)
|
||||
/* 32bit hashes as llseek() offset (for directories) */
|
||||
#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)
|
||||
*/
|
||||
#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
|
||||
* return: the file of handle
|
||||
* add by ll
|
||||
|
@ -519,7 +519,7 @@ int ProcOpen(struct ProcFile *procFile)
|
|||
|
||||
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;
|
||||
}
|
||||
struct ProcFile *procFile = pde->pf;
|
||||
|
|
|
@ -214,7 +214,7 @@ UINT64 LOS_SizeStrToNum(CHAR *value)
|
|||
UINT64 num = 0;
|
||||
|
||||
/* 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");
|
||||
if (strspn(value, "0123456789abcdefABCDEF") < strlen(value)) {
|
||||
goto ERROUT;
|
||||
|
@ -247,4 +247,4 @@ UINT64 LOS_SizeStrToNum(CHAR *value)
|
|||
ERROUT:
|
||||
PRINT_ERR("Invalid value string \"%s\"!\n", value);
|
||||
return num;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -327,7 +327,7 @@ STATIC INT32 CheckValidation(UINT64 rootAddr, UINT64 rootSize, UINT64 userAddr,
|
|||
|
||||
if ((rootAddr & (alignSize - 1)) || (rootSize & (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;
|
||||
}
|
||||
|
||||
|
@ -371,4 +371,4 @@ INT32 OsMountRootfs()
|
|||
}
|
||||
|
||||
return LOS_OK;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -351,7 +351,7 @@ static INT32 BcacheSyncBlock(OsBcache *bc, OsBcacheBlock *block)
|
|||
UINT32 len, start, end;
|
||||
|
||||
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);
|
||||
if (ret == ENOERR) {
|
||||
|
@ -932,7 +932,7 @@ INT32 BlockCacheWrite(OsBcache *bc, const UINT8 *buf, UINT32 *len, UINT64 sector
|
|||
bc->modifiedBlock++;
|
||||
}
|
||||
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;
|
||||
} else {
|
||||
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;
|
||||
}
|
||||
|
||||
if (ev == NULL) {
|
||||
set_errno(EINVAL);
|
||||
return -1;
|
||||
}
|
||||
|
||||
switch (op) {
|
||||
case EPOLL_CTL_ADD:
|
||||
ret = CheckFdExist(epHead, fd);
|
||||
|
@ -304,7 +309,7 @@ int epoll_wait(int epfd, FAR struct epoll_event *evs, int maxevents, int timeout
|
|||
return -1;
|
||||
}
|
||||
|
||||
if (maxevents <= 0) {
|
||||
if ((maxevents <= 0) || (evs == NULL)) {
|
||||
set_errno(EINVAL);
|
||||
return -1;
|
||||
}
|
||||
|
|
|
@ -35,115 +35,174 @@
|
|||
#include "path_cache.h"
|
||||
|
||||
/* 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;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
static int ErrorVopClose (struct Vnode *vnode)
|
||||
static int ErrorVopClose(struct Vnode *vnode)
|
||||
{
|
||||
(void)vnode;
|
||||
/* already closed at force umount, do nothing here */
|
||||
return OK;
|
||||
}
|
||||
|
||||
static int ErrorVopReclaim (struct Vnode *vnode)
|
||||
static int ErrorVopReclaim(struct Vnode *vnode)
|
||||
{
|
||||
(void)vnode;
|
||||
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;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
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 */
|
||||
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;
|
||||
}
|
||||
|
||||
static int ErrorVopSetattr (struct Vnode *vnode, struct stat *st)
|
||||
static int ErrorVopSetattr(struct Vnode *vnode, struct stat *st)
|
||||
{
|
||||
(void)vnode;
|
||||
(void)st;
|
||||
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;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
static int ErrorVopTruncate (struct Vnode *vnode, off_t len)
|
||||
static int ErrorVopTruncate(struct Vnode *vnode, off_t len)
|
||||
{
|
||||
(void)vnode;
|
||||
(void)len;
|
||||
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;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -173,74 +232,107 @@ static struct VnodeOps g_errorVnodeOps = {
|
|||
};
|
||||
|
||||
/* file operations returns EIO */
|
||||
static int ErrorFopOpen (struct file *filep)
|
||||
static int ErrorFopOpen(struct file *filep)
|
||||
{
|
||||
(void)filep;
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
static int ErrorFopClose (struct file *filep)
|
||||
static int ErrorFopClose(struct file *filep)
|
||||
{
|
||||
(void)filep;
|
||||
/* already closed at force umount, do nothing here */
|
||||
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;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
static int ErrorFopMmap (struct file* filep, struct VmMapRegion *region)
|
||||
static int ErrorFopMmap(struct file* filep, struct VmMapRegion *region)
|
||||
{
|
||||
(void)filep;
|
||||
(void)region;
|
||||
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;
|
||||
}
|
||||
|
||||
static int ErrorFopStat (struct file *filep, struct stat* st)
|
||||
static int ErrorFopStat(struct file *filep, struct stat* st)
|
||||
{
|
||||
(void)filep;
|
||||
(void)st;
|
||||
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;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
static int ErrorFopFsync (struct file *filep)
|
||||
static int ErrorFopFsync(struct file *filep)
|
||||
{
|
||||
(void)filep;
|
||||
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;
|
||||
}
|
||||
|
||||
static int ErrorFopUnlink (struct Vnode *vnode)
|
||||
static int ErrorFopUnlink(struct Vnode *vnode)
|
||||
{
|
||||
(void)vnode;
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
|
|
|
@ -637,7 +637,7 @@ void ls(const char *pathname)
|
|||
|
||||
if (statInfo.st_mode & S_IFDIR) { /* list all directory and file */
|
||||
ret = LsDir((pathname == NULL) ? path : pathname);
|
||||
} else { /* show the file infomation */
|
||||
} else { /* show the file information */
|
||||
ret = LsFile(path);
|
||||
}
|
||||
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 *buf = NULL;
|
||||
const char *filename = NULL;
|
||||
size_t r_size, w_size;
|
||||
ssize_t r_size, w_size;
|
||||
int src_fd = -1;
|
||||
int dst_fd = -1;
|
||||
struct stat stat_buf;
|
||||
|
@ -1391,8 +1391,8 @@ int checkNum(const char *arg)
|
|||
#ifdef LOSCFG_KERNEL_SYSCALL
|
||||
int osShellCmdSu(int argc, const char **argv)
|
||||
{
|
||||
unsigned int su_uid;
|
||||
unsigned int su_gid;
|
||||
int su_uid;
|
||||
int su_gid;
|
||||
|
||||
if (argc == 0)
|
||||
{
|
||||
|
|
|
@ -198,7 +198,7 @@ int VnodeFree(struct Vnode *vnode)
|
|||
g_totalVnodeSize--;
|
||||
} else {
|
||||
/* 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);
|
||||
g_freeVnodeSize++;
|
||||
}
|
||||
|
@ -380,6 +380,11 @@ int VnodeLookupAt(const char *path, struct Vnode **result, uint32_t flags, struc
|
|||
if (orgVnode != NULL) {
|
||||
startVnode = orgVnode;
|
||||
normalizedPath = strdup(path);
|
||||
if (normalizedPath == NULL) {
|
||||
PRINT_ERR("[VFS]lookup failed, strdup err\n");
|
||||
ret = -EINVAL;
|
||||
goto OUT_FREE_PATH;
|
||||
}
|
||||
} else {
|
||||
ret = PreProcess(path, &startVnode, &normalizedPath);
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -2002,6 +2002,8 @@ LITE_OS_SEC_TEXT VOID LOS_Exit(INT32 status)
|
|||
{
|
||||
UINT32 intSave;
|
||||
|
||||
(void)status;
|
||||
|
||||
/* The exit of a kernel - state process must be kernel - state and all threads must actively exit */
|
||||
LosProcessCB *processCB = OsCurrProcessGet();
|
||||
SCHEDULER_LOCK(intSave);
|
||||
|
|
|
@ -168,6 +168,10 @@ LITE_OS_SEC_TEXT_INIT UINT32 OsSwtmrInit(VOID)
|
|||
return LOS_OK;
|
||||
|
||||
ERROR:
|
||||
(VOID)LOS_MemFree(m_aucSysMem0, g_swtmrCBArray);
|
||||
g_swtmrCBArray = NULL;
|
||||
(VOID)LOS_MemFree(m_aucSysMem1, g_swtmrHandlerPool);
|
||||
g_swtmrHandlerPool = NULL;
|
||||
PRINT_ERR("OsSwtmrInit error! ret = %u\n", ret);
|
||||
return ret;
|
||||
}
|
||||
|
@ -278,7 +282,7 @@ LITE_OS_SEC_TEXT UINT32 OsSwtmrGetNextTimeout(VOID)
|
|||
|
||||
/*
|
||||
* 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)
|
||||
{
|
||||
|
@ -292,7 +296,7 @@ LITE_OS_SEC_TEXT STATIC VOID OsSwtmrStop(SWTMR_CTRL_S *swtmr)
|
|||
|
||||
/*
|
||||
* 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)
|
||||
{
|
||||
|
|
|
@ -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
|
||||
* 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;
|
||||
}
|
||||
|
||||
|
@ -1257,19 +1257,19 @@ EXIT:
|
|||
return err;
|
||||
}
|
||||
|
||||
UINT32 OsUserTaskOperatePermissionsCheck(LosTaskCB *taskCB)
|
||||
INT32 OsUserTaskOperatePermissionsCheck(const LosTaskCB *taskCB)
|
||||
{
|
||||
return OsUserProcessOperatePermissionsCheck(taskCB, OsCurrProcessGet()->processID);
|
||||
}
|
||||
|
||||
UINT32 OsUserProcessOperatePermissionsCheck(LosTaskCB *taskCB, UINT32 processID)
|
||||
INT32 OsUserProcessOperatePermissionsCheck(const LosTaskCB *taskCB, UINT32 processID)
|
||||
{
|
||||
if (taskCB == NULL) {
|
||||
return LOS_EINVAL;
|
||||
}
|
||||
|
||||
if (processID == OS_INVALID_VALUE) {
|
||||
return OS_INVALID_VALUE;
|
||||
return LOS_EINVAL;
|
||||
}
|
||||
|
||||
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[]);
|
||||
|
||||
/* 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
|
||||
#if __cplusplus
|
||||
|
|
|
@ -138,28 +138,28 @@ STATIC INLINE BOOL OsSchedIsLock(VOID)
|
|||
return (OsSchedRunQue()->taskLockCnt != 0);
|
||||
}
|
||||
|
||||
/* Check if preemptable with counter flag */
|
||||
/* Check if preemptible with counter flag */
|
||||
STATIC INLINE BOOL OsPreemptable(VOID)
|
||||
{
|
||||
SchedRunQue *rq = OsSchedRunQue();
|
||||
/*
|
||||
* Unlike OsPreemptableInSched, the int may be not disabled when OsPreemptable
|
||||
* is called, needs mannually disable interrupt, to prevent current task from
|
||||
* being migrated to another core, and get the wrong preeptable status.
|
||||
* is called, needs manually disable interrupt, to prevent current task from
|
||||
* being migrated to another core, and get the wrong preemptable status.
|
||||
*/
|
||||
UINT32 intSave = LOS_IntLock();
|
||||
BOOL preemptable = (rq->taskLockCnt == 0);
|
||||
if (!preemptable) {
|
||||
BOOL preemptible = (rq->taskLockCnt == 0);
|
||||
if (!preemptible) {
|
||||
/* Set schedule flag if preemption is disabled */
|
||||
rq->schedFlag |= INT_PEND_RESCH;
|
||||
}
|
||||
LOS_IntRestore(intSave);
|
||||
return preemptable;
|
||||
return preemptible;
|
||||
}
|
||||
|
||||
STATIC INLINE BOOL OsPreemptableInSched(VOID)
|
||||
{
|
||||
BOOL preemptable = FALSE;
|
||||
BOOL preemptible = FALSE;
|
||||
SchedRunQue *rq = OsSchedRunQue();
|
||||
|
||||
#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
|
||||
* will increase by 1 in that case.
|
||||
*/
|
||||
preemptable = (rq->taskLockCnt == 1);
|
||||
preemptible = (rq->taskLockCnt == 1);
|
||||
|
||||
#else
|
||||
preemptable = (rq->taskLockCnt == 0);
|
||||
preemptible = (rq->taskLockCnt == 0);
|
||||
#endif
|
||||
if (!preemptable) {
|
||||
if (!preemptible) {
|
||||
/* Set schedule flag if preemption is disabled */
|
||||
rq->schedFlag |= INT_PEND_RESCH;
|
||||
}
|
||||
|
||||
return preemptable;
|
||||
return preemptible;
|
||||
}
|
||||
|
||||
STATIC INLINE UINT32 OsSchedGetRunQueIdle(VOID)
|
||||
|
|
|
@ -48,7 +48,7 @@ typedef struct {
|
|||
} StackInfo;
|
||||
|
||||
#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 OsExcStackInfoReg(const StackInfo *stackInfo, UINT32 stackNum);
|
||||
|
@ -81,4 +81,4 @@ extern UINT32 OsStackWaterLineGet(const UINTPTR *stackBottom, const UINTPTR *sta
|
|||
#endif /* __cplusplus */
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* _LOS_STACK_INFO_PRI_H */
|
||||
#endif /* _LOS_STACK_INFO_PRI_H */
|
||||
|
|
|
@ -43,9 +43,9 @@ extern "C" {
|
|||
|
||||
/**
|
||||
* @ingroup los_task
|
||||
* Define task siginal types.
|
||||
* Define task signal types.
|
||||
*
|
||||
* Task siginal types.
|
||||
* Task signal types.
|
||||
*/
|
||||
#define SIGNAL_NONE 0U
|
||||
#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 VOID OsTaskCBRecycleToFree(VOID);
|
||||
extern VOID OsRunningTaskToExit(LosTaskCB *runTask, UINT32 status);
|
||||
extern UINT32 OsUserTaskOperatePermissionsCheck(LosTaskCB *taskCB);
|
||||
extern UINT32 OsUserProcessOperatePermissionsCheck(LosTaskCB *taskCB, UINT32 processID);
|
||||
extern INT32 OsUserTaskOperatePermissionsCheck(const LosTaskCB *taskCB);
|
||||
extern INT32 OsUserProcessOperatePermissionsCheck(const LosTaskCB *taskCB, UINT32 processID);
|
||||
extern INT32 OsTcbDispatch(LosTaskCB *stcb, siginfo_t *info);
|
||||
extern VOID OsWriteResourceEvent(UINT32 events);
|
||||
extern VOID OsWriteResourceEventUnsafe(UINT32 events);
|
||||
|
|
|
@ -50,7 +50,7 @@ extern "C" {
|
|||
#define min(x, y) ((x) < (y) ? (x) : (y))
|
||||
#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_PHYS(order) (1 << (PAGE_SHIFT + (order)))
|
||||
#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)
|
||||
#endif
|
||||
|
||||
#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_UNCACHED_ADDR(paddr) (paddr - PERIPH_PMM_BASE + PERIPH_UNCACHED_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_UNCACHED_ADDR(paddr) ((paddr) - PERIPH_PMM_BASE + PERIPH_UNCACHED_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_CACHED_ADDR(paddr) ((paddr) - DDR_MEM_ADDR + KERNEL_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 UNCACHED_TO_VMM_ADDR(vaddr) (vaddr - UNCACHED_VMM_BASE + KERNEL_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 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 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)
|
||||
|
||||
#if (PERIPH_UNCACHED_BASE >= (0xFFFFFFFFU - PERIPH_UNCACHED_SIZE))
|
||||
#error "Kernel virtual memory space has overflowed!"
|
||||
|
|
|
@ -112,16 +112,16 @@ STATIC VOID OsFutexShowTaskNodeAttr(const LOS_DL_LIST *futexList)
|
|||
LOS_DL_LIST *queueList = NULL;
|
||||
|
||||
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; ;) {
|
||||
lastNode = OS_FUTEX_FROM_QUEUELIST(queueList);
|
||||
if (!LOS_ListEmpty(&(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 {
|
||||
taskCB = LOS_DL_LIST_ENTRY(lastNode, LosTaskCB, futex);
|
||||
PRINTK(" %d(%d) ->", taskCB->taskID, -1);
|
||||
PRINTK(" %u(%d) ->", taskCB->taskID, -1);
|
||||
}
|
||||
queueList = queueList->pstNext;
|
||||
if (queueList == &tempNode->queueList) {
|
||||
|
|
|
@ -82,7 +82,7 @@ VOID OsQueueDbgUpdate(UINT32 queueID, TSK_ENTRY_FUNC entry)
|
|||
STATIC INLINE VOID OsQueueInfoOutPut(const LosQueueCB *node)
|
||||
{
|
||||
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->queueLen,
|
||||
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);
|
||||
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->uwBlkCnt = 0;
|
||||
if (boxInfo->uwBlkNum == 0) {
|
||||
|
|
|
@ -169,7 +169,7 @@ struct OsMemPoolHead {
|
|||
|
||||
/* The memory pool support expand. */
|
||||
#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_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);
|
||||
}
|
||||
|
||||
/* mark remining as redzone */
|
||||
/* mark remaining as redzone */
|
||||
g_lms->simpleMark(LMS_ADDR_ALIGN((UINTPTR)alignedPtr + size), (UINTPTR)OS_MEM_NEXT_NODE(allocNode),
|
||||
LMS_SHADOW_REDZONE_U8);
|
||||
}
|
||||
|
@ -636,7 +636,7 @@ STATIC INLINE UINT32 OsMemFreeListIndexGet(UINT32 size)
|
|||
}
|
||||
|
||||
STATIC INLINE struct OsMemFreeNodeHead *OsMemFindCurSuitableBlock(struct OsMemPoolHead *poolHead,
|
||||
UINT32 index, UINT32 size)
|
||||
UINT32 index, UINT32 size)
|
||||
{
|
||||
struct OsMemFreeNodeHead *node = NULL;
|
||||
|
||||
|
@ -649,9 +649,12 @@ STATIC INLINE struct OsMemFreeNodeHead *OsMemFindCurSuitableBlock(struct OsMemPo
|
|||
return NULL;
|
||||
}
|
||||
|
||||
#define BITMAP_INDEX(index) ((index) >> 5)
|
||||
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);
|
||||
if (mask != 0) {
|
||||
index = OsMemFFS(mask) + (index & ~OS_MEM_BITMAP_MASK);
|
||||
|
@ -685,8 +688,8 @@ STATIC INLINE struct OsMemFreeNodeHead *OsMemFindNextSuitableBlock(VOID *pool, U
|
|||
goto DONE;
|
||||
}
|
||||
|
||||
for (index = LOS_Align(index + 1, 32); index < OS_MEM_FREE_LIST_COUNT; index += 32) {
|
||||
mask = poolHead->freeListBitmap[index >> 5]; /* 5: Divide by 32 to calculate the index of the bitmap array. */
|
||||
for (index = LOS_Align(index + 1, 32); index < OS_MEM_FREE_LIST_COUNT; index += 32) { /* 32: align size */
|
||||
mask = poolHead->freeListBitmap[BITMAP_INDEX(index)];
|
||||
if (mask != 0) {
|
||||
index = OsMemFFS(mask) + index;
|
||||
goto DONE;
|
||||
|
@ -707,12 +710,12 @@ DONE:
|
|||
|
||||
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)
|
||||
{
|
||||
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)
|
||||
|
@ -1183,42 +1186,45 @@ STATIC INLINE BOOL OsMemIsNodeValid(const struct OsMemNodeHead *node, const stru
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
STATIC BOOL MemCheckUsedNode(const struct OsMemPoolHead *pool, const struct OsMemNodeHead *node,
|
||||
const struct OsMemNodeHead *startNode, const struct OsMemNodeHead *endNode)
|
||||
{
|
||||
if (!OsMemIsNodeValid(node, startNode, endNode, pool)) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!OS_MEM_NODE_GET_USED_FLAG(node->sizeAndFlag)) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
const struct OsMemNodeHead *nextNode = OS_MEM_NEXT_NODE(node);
|
||||
if (!OsMemIsNodeValid(nextNode, startNode, endNode, pool)) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!OS_MEM_NODE_GET_LAST_FLAG(nextNode->sizeAndFlag)) {
|
||||
if (nextNode->ptr.prev != node) {
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
if ((node != startNode) &&
|
||||
((!OsMemIsNodeValid(node->ptr.prev, startNode, endNode, pool)) ||
|
||||
(OS_MEM_NEXT_NODE(node->ptr.prev) != node))) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
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);
|
||||
struct OsMemNodeHead *nextNode = NULL;
|
||||
BOOL doneFlag = FALSE;
|
||||
|
||||
do {
|
||||
do {
|
||||
if (!OsMemIsNodeValid(node, startNode, endNode, pool)) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (!OS_MEM_NODE_GET_USED_FLAG(node->sizeAndFlag)) {
|
||||
break;
|
||||
}
|
||||
|
||||
nextNode = OS_MEM_NEXT_NODE(node);
|
||||
if (!OsMemIsNodeValid(nextNode, startNode, endNode, pool)) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (!OS_MEM_NODE_GET_LAST_FLAG(nextNode->sizeAndFlag)) {
|
||||
if (nextNode->ptr.prev != node) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ((node != startNode) &&
|
||||
((!OsMemIsNodeValid(node->ptr.prev, startNode, endNode, pool)) ||
|
||||
(OS_MEM_NEXT_NODE(node->ptr.prev) != node))) {
|
||||
break;
|
||||
}
|
||||
doneFlag = TRUE;
|
||||
} while (0);
|
||||
|
||||
doneFlag = MemCheckUsedNode(pool, node, startNode, endNode);
|
||||
if (!doneFlag) {
|
||||
#if OS_MEM_EXPAND_ENABLE
|
||||
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 intSave;
|
||||
UINT32 ret = LOS_NOK;
|
||||
|
||||
if ((pool == NULL) || (ptr == NULL) || !OS_MEM_IS_ALIGNED(pool, sizeof(VOID *)) ||
|
||||
!OS_MEM_IS_ALIGNED(ptr, sizeof(VOID *))) {
|
||||
return LOS_NOK;
|
||||
return ret;
|
||||
}
|
||||
OsHookCall(LOS_HOOK_TYPE_MEM_FREE, pool, ptr);
|
||||
|
||||
UINT32 ret = LOS_NOK;
|
||||
struct OsMemPoolHead *poolHead = (struct OsMemPoolHead *)pool;
|
||||
struct OsMemNodeHead *node = NULL;
|
||||
UINT32 intSave;
|
||||
|
||||
do {
|
||||
UINT32 gapSize = *(UINT32 *)((UINTPTR)ptr - sizeof(UINT32));
|
||||
|
@ -1397,7 +1404,7 @@ STATIC INLINE VOID *OsGetRealPtr(const VOID *pool, VOID *ptr)
|
|||
}
|
||||
|
||||
STATIC INLINE VOID *OsMemRealloc(struct OsMemPoolHead *pool, const VOID *ptr,
|
||||
struct OsMemNodeHead *node, UINT32 size, UINT32 intSave)
|
||||
struct OsMemNodeHead *node, UINT32 size, UINT32 intSave)
|
||||
{
|
||||
struct OsMemNodeHead *nextNode = NULL;
|
||||
UINT32 allocSize = OS_MEM_ALIGN(size + OS_MEM_NODE_HEAD_SIZE, OS_MEM_ALIGN_SIZE);
|
||||
|
@ -1619,7 +1626,7 @@ STATIC UINT32 OsMemAddrValidCheckPrint(const VOID *pool, struct OsMemFreeNodeHea
|
|||
}
|
||||
|
||||
STATIC UINT32 OsMemIntegrityCheckSub(struct OsMemNodeHead **tmpNode, const VOID *pool,
|
||||
const struct OsMemNodeHead *endNode)
|
||||
const struct OsMemNodeHead *endNode)
|
||||
{
|
||||
if (!OS_MEM_MAGIC_VALID(*tmpNode)) {
|
||||
OsMemMagicCheckPrint(tmpNode);
|
||||
|
@ -1635,7 +1642,7 @@ STATIC UINT32 OsMemIntegrityCheckSub(struct OsMemNodeHead **tmpNode, const VOID
|
|||
}
|
||||
|
||||
STATIC UINT32 OsMemFreeListNodeCheck(const struct OsMemPoolHead *pool,
|
||||
const struct OsMemFreeNodeHead *node)
|
||||
const struct OsMemFreeNodeHead *node)
|
||||
{
|
||||
if (!OsMemAddrValidCheck(pool, node) ||
|
||||
!OsMemAddrValidCheck(pool, node->prev) ||
|
||||
|
@ -1698,7 +1705,7 @@ OUT:
|
|||
}
|
||||
|
||||
STATIC UINT32 OsMemIntegrityCheck(const struct OsMemPoolHead *pool, struct OsMemNodeHead **tmpNode,
|
||||
struct OsMemNodeHead **preNode)
|
||||
struct OsMemNodeHead **preNode)
|
||||
{
|
||||
struct OsMemNodeHead *endNode = OS_MEM_END_NODE(pool, pool->info.totalSize);
|
||||
|
||||
|
@ -1741,7 +1748,7 @@ STATIC VOID OsMemNodeInfo(const struct OsMemNodeHead *tmpNode,
|
|||
usedNode->header.ptr.prev, usedNode->header.magic, usedNode->header.sizeAndFlag);
|
||||
} else {
|
||||
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.sizeAndFlag);
|
||||
}
|
||||
|
@ -1752,7 +1759,7 @@ STATIC VOID OsMemNodeInfo(const struct OsMemNodeHead *tmpNode,
|
|||
usedNode->header.ptr.prev, usedNode->header.magic, usedNode->header.sizeAndFlag);
|
||||
} else {
|
||||
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.sizeAndFlag);
|
||||
}
|
||||
|
@ -1804,7 +1811,7 @@ STATIC VOID OsMemIntegrityCheckError(struct OsMemPoolHead *pool,
|
|||
tmpNode, preNode, taskCB->taskName);
|
||||
#else
|
||||
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
|
||||
}
|
||||
|
||||
|
@ -1846,7 +1853,7 @@ ERROR_OUT:
|
|||
}
|
||||
|
||||
STATIC INLINE VOID OsMemInfoGet(struct OsMemPoolHead *poolInfo, struct OsMemNodeHead *node,
|
||||
LOS_MEM_POOL_STATUS *poolStatus)
|
||||
LOS_MEM_POOL_STATUS *poolStatus)
|
||||
{
|
||||
UINT32 totalUsedSize = 0;
|
||||
UINT32 totalFreeSize = 0;
|
||||
|
@ -1994,8 +2001,10 @@ UINT32 LOS_MemFreeNodeShow(VOID *pool)
|
|||
} else {
|
||||
UINT32 val = 1 << (((index - OS_MEM_SMALL_BUCKET_COUNT) >> OS_MEM_SLI) + OS_MEM_LARGE_START_BUCKET);
|
||||
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,
|
||||
((offset * (((index - OS_MEM_SMALL_BUCKET_COUNT) % (1 << OS_MEM_SLI)) + 1)) + val - 1), countNum[index]);
|
||||
PRINTK("size: [%#x, %#x], num: %u\n",
|
||||
(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");
|
||||
|
|
|
@ -117,8 +117,10 @@ VOID OsExcStackInfoReg(const StackInfo *stackInfo, UINT32 stackNum)
|
|||
VOID OsStackInit(VOID *stacktop, UINT32 stacksize)
|
||||
{
|
||||
/* initialize the task stack, write magic num to stack top */
|
||||
(VOID)memset_s(stacktop, stacksize, (INT32)OS_STACK_INIT, stacksize);
|
||||
*((UINTPTR *)stacktop) = OS_STACK_MAGIC_WORD;
|
||||
errno_t ret = memset_s(stacktop, stacksize, (INT32)OS_STACK_INIT, stacksize);
|
||||
if (ret == EOK) {
|
||||
*((UINTPTR *)stacktop) = OS_STACK_MAGIC_WORD;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef LOSCFG_SHELL_CMD_DEBUG
|
||||
|
|
|
@ -193,7 +193,7 @@ LITE_OS_SEC_TEXT_MINOR UINT32 OsShellCmdUname(INT32 argc, const CHAR *argv[])
|
|||
|
||||
if (argc == 1) {
|
||||
if (strcmp(argv[0], "-a") == 0) {
|
||||
PRINTK("%s %d.%d.%d.%d %s %s\n", KERNEL_NAME, KERNEL_MAJOR, KERNEL_MINOR, KERNEL_PATCH, KERNEL_ITRE,\
|
||||
PRINTK("%s %d.%d.%d.%d %s %s\n", KERNEL_NAME, KERNEL_MAJOR, KERNEL_MINOR, KERNEL_PATCH, KERNEL_ITRE, \
|
||||
__DATE__, __TIME__);
|
||||
return 0;
|
||||
} else if (strcmp(argv[0], "-s") == 0) {
|
||||
|
|
|
@ -87,7 +87,7 @@ STATIC INLINE CHAR *OsLockDepErrorStringGet(enum LockDepErrType type)
|
|||
errorString = "lockdep overflow";
|
||||
break;
|
||||
default:
|
||||
errorString = "unknow error code";
|
||||
errorString = "unknown error code";
|
||||
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 id : %u\n", temp->taskID);
|
||||
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++) {
|
||||
if (lockDep->heldLocks[i].lockPtr == lock) {
|
||||
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;
|
||||
SPIN_LOCK_S *lockTemp = NULL;
|
||||
|
@ -217,7 +217,7 @@ VOID OsLockDepCheckIn(SPIN_LOCK_S *lock)
|
|||
goto OUT;
|
||||
}
|
||||
|
||||
if (OsLockDepCheckDependancy(current, lockOwner) != TRUE) {
|
||||
if (OsLockDepCheckDependency(current, lockOwner) != TRUE) {
|
||||
checkResult = LOCKDEP_ERR_DEAD_LOCK;
|
||||
goto OUT;
|
||||
}
|
||||
|
@ -313,7 +313,7 @@ VOID OsLockDepCheckOut(SPIN_LOCK_S *lock)
|
|||
/* record lock holding time */
|
||||
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) {
|
||||
lockDep->heldLocks[depth] = lockDep->heldLocks[depth + 1];
|
||||
depth++;
|
||||
|
|
|
@ -173,7 +173,7 @@ LITE_OS_SEC_TEXT_MINOR VOID OsShellCmdDumpSched(VOID)
|
|||
|
||||
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,
|
||||
taskCB->schedStat.allContextSwitch);
|
||||
|
||||
|
@ -183,7 +183,7 @@ LITE_OS_SEC_TEXT_MINOR VOID OsShellCmdDumpSched(VOID)
|
|||
}
|
||||
|
||||
PRINTK(" "
|
||||
"CPU%d %+16lf ms %12d\n", cpuid,
|
||||
"CPU%u %+16lf ms %12u\n", cpuid,
|
||||
(DOUBLE)(taskCB->schedStat.schedPercpu[cpuid].runtime) / NS_PER_MS,
|
||||
taskCB->schedStat.schedPercpu[cpuid].contexSwitch);
|
||||
}
|
||||
|
@ -251,7 +251,7 @@ LITE_OS_SEC_TEXT_MINOR VOID OsMpStaticShow(UINT64 mpStaticPastTime)
|
|||
"---------- ---------- ---------- ----------\n");
|
||||
|
||||
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,
|
||||
g_mpStatPercpu[cpuid].contexSwitch,
|
||||
g_mpStatPercpu[cpuid].hwiNum,
|
||||
|
|
|
@ -169,6 +169,29 @@ UINT32 OsShellShowTickRespo(VOID)
|
|||
#endif
|
||||
|
||||
#ifdef LOSCFG_SCHED_DEBUG
|
||||
STATIC VOID SchedDataGet(LosTaskCB *taskCB, UINT64 *runTime, UINT64 *timeSlice, UINT64 *pendTime, UINT64 *schedWait)
|
||||
{
|
||||
if (taskCB->schedStat.switchCount >= 1) {
|
||||
UINT64 averRunTime = taskCB->schedStat.runTime / taskCB->schedStat.switchCount;
|
||||
*runTime = (averRunTime * OS_NS_PER_CYCLE) / OS_SYS_NS_PER_US;
|
||||
}
|
||||
|
||||
if (taskCB->schedStat.timeSliceCount > 1) {
|
||||
UINT64 averTimeSlice = taskCB->schedStat.timeSliceTime / (taskCB->schedStat.timeSliceCount - 1);
|
||||
*timeSlice = (averTimeSlice * OS_NS_PER_CYCLE) / OS_SYS_NS_PER_US;
|
||||
}
|
||||
|
||||
if (taskCB->schedStat.pendCount > 1) {
|
||||
UINT64 averPendTime = taskCB->schedStat.pendTime / taskCB->schedStat.pendCount;
|
||||
*pendTime = (averPendTime * OS_NS_PER_CYCLE) / OS_SYS_NS_PER_US;
|
||||
}
|
||||
|
||||
if (taskCB->schedStat.waitSchedCount > 0) {
|
||||
UINT64 averSchedWait = taskCB->schedStat.waitSchedTime / taskCB->schedStat.waitSchedCount;
|
||||
*schedWait = (averSchedWait * OS_NS_PER_CYCLE) / OS_SYS_NS_PER_US;
|
||||
}
|
||||
}
|
||||
|
||||
UINT32 OsShellShowSchedParam(VOID)
|
||||
{
|
||||
UINT64 averRunTime;
|
||||
|
@ -198,25 +221,7 @@ UINT32 OsShellShowSchedParam(VOID)
|
|||
averPendTime = 0;
|
||||
averSchedWait = 0;
|
||||
|
||||
if (taskCB->schedStat.switchCount >= 1) {
|
||||
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;
|
||||
}
|
||||
SchedDataGet(taskCB, &averRunTime, &averTimeSlice, &averPendTime, &averSchedWait);
|
||||
|
||||
PRINTK("%5u%19llu%15llu%19llu%18llu%19llu%18llu %-32s\n", taskCB->taskID,
|
||||
averRunTime, taskCB->schedStat.switchCount,
|
||||
|
@ -578,7 +583,7 @@ BOOL OsSchedModifyTaskSchedParam(LosTaskCB *taskCB, UINT16 policy, UINT16 priori
|
|||
}
|
||||
|
||||
taskCB->priority = priority;
|
||||
OsHookCall(LOS_HOOK_TYPE_TASK_PRIMODIFY, taskCB, taskCB->priority);
|
||||
OsHookCall(LOS_HOOK_TYPE_TASK_PRIMODIFY, taskCB, taskCB->priority);
|
||||
if (taskCB->taskStatus & OS_TASK_STATUS_INIT) {
|
||||
OsSchedTaskEnQueue(taskCB);
|
||||
return TRUE;
|
||||
|
@ -771,7 +776,9 @@ BOOL OsSchedSwtmrTimeListFind(SCHED_TL_FIND_FUNC checkFunc, UINTPTR arg)
|
|||
for (UINT16 cpuid = 0; cpuid < LOSCFG_KERNEL_CORE_NUM; cpuid++) {
|
||||
SchedRunQue *rq = OsSchedRunQueByID(cpuid);
|
||||
SortLinkAttribute *swtmrSortLink = &rq->swtmrSortLink;
|
||||
return SchedSwtmrRunQueFind(swtmrSortLink, checkFunc, arg);
|
||||
if (SchedSwtmrRunQueFind(swtmrSortLink, checkFunc, arg)) {
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
|
|
@ -322,16 +322,16 @@ CHAR *OsArchFlagsToStr(const UINT32 archFlags)
|
|||
(VOID)memset_s(archMmuFlagsStr, flagSize, 0, flagSize);
|
||||
switch (cacheFlags) {
|
||||
case 0UL:
|
||||
strcat_s(archMmuFlagsStr, flagSize, " CH\0");
|
||||
(VOID)strcat_s(archMmuFlagsStr, flagSize, " CH\0");
|
||||
break;
|
||||
case 1UL:
|
||||
strcat_s(archMmuFlagsStr, flagSize, " UC\0");
|
||||
(VOID)strcat_s(archMmuFlagsStr, flagSize, " UC\0");
|
||||
break;
|
||||
case 2UL:
|
||||
strcat_s(archMmuFlagsStr, flagSize, " UD\0");
|
||||
(VOID)strcat_s(archMmuFlagsStr, flagSize, " UD\0");
|
||||
break;
|
||||
case 3UL:
|
||||
strcat_s(archMmuFlagsStr, flagSize, " WC\0");
|
||||
(VOID)strcat_s(archMmuFlagsStr, flagSize, " WC\0");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
|
|
@ -462,7 +462,7 @@ LosVmMapRegion *OsCreateRegion(VADDR_T vaddr, size_t len, UINT32 regionFlags, un
|
|||
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.size = len;
|
||||
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 (((region->range.base + region->range.size) > newAddr) &&
|
||||
(region->range.base < (newAddr + newLen))) {
|
||||
|
|
|
@ -88,7 +88,7 @@ INT32 GetFilepOps(const struct file *filep, struct file **privFilep, const struc
|
|||
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;
|
||||
*privFilep = (struct file *)drv->priv;
|
||||
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_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.
|
||||
*/
|
||||
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);
|
||||
(VOID)OsConsoleDelete(consoleCB);
|
||||
g_console[consoleID - 1] = NULL;
|
||||
g_taskConsoleIDArray[OsCurrTaskGet()->taskID] = 0;
|
||||
if (OsCurrTaskGet() != NULL) {
|
||||
g_taskConsoleIDArray[OsCurrTaskGet()->taskID] = 0;
|
||||
}
|
||||
LOS_SpinUnlockRestore(&g_consoleSpin, intSave);
|
||||
return VFS_ERROR;
|
||||
}
|
||||
|
|
|
@ -182,11 +182,11 @@ LITE_OS_SEC_TEXT_INIT VOID OsSystemInfo(VOID)
|
|||
#ifdef LOSCFG_KERNEL_SMP
|
||||
LOSCFG_KERNEL_SMP_CORE_NUM,
|
||||
#endif
|
||||
HalIrqVersion(), __DATE__, __TIME__,\
|
||||
HalIrqVersion(), __DATE__, __TIME__, \
|
||||
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;
|
||||
#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);
|
||||
#endif
|
||||
|
||||
extern INT32 OsMain(VOID);
|
||||
extern UINT32 OsMain(VOID);
|
||||
|
||||
typedef VOID (*SystemRebootFunc)(VOID);
|
||||
VOID OsSetRebootHook(SystemRebootFunc func);
|
||||
|
|
|
@ -162,7 +162,7 @@ struct ModuleInitInfo {
|
|||
*/
|
||||
#define OS_INIT_LEVEL_REG(_type, _num, _list) \
|
||||
INIT_LABEL_REG_##_num(EXTERN_LABEL, _type) \
|
||||
STATIC struct ModuleInitInfo* _list [] = { \
|
||||
STATIC struct ModuleInitInfo *_list[] = { \
|
||||
INIT_LABEL_REG_##_num(GET_LABEL, _type) \
|
||||
}
|
||||
|
||||
|
|
|
@ -198,7 +198,7 @@ __attribute__((noinline)) VOID UartPrintf(const CHAR *fmt, ...)
|
|||
va_end(ap);
|
||||
}
|
||||
|
||||
__attribute__ ((noinline)) VOID dprintf(const CHAR *fmt, ...)
|
||||
__attribute__((noinline)) VOID dprintf(const CHAR *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
va_start(ap, fmt);
|
||||
|
@ -229,7 +229,7 @@ VOID DmesgPrintf(const CHAR *fmt, va_list ap)
|
|||
#endif
|
||||
|
||||
#ifdef LOSCFG_PLATFORM_UART_WITHOUT_VFS
|
||||
__attribute__ ((noinline)) INT32 printf(const CHAR *fmt, ...)
|
||||
__attribute__((noinline)) INT32 printf(const CHAR *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
va_start(ap, fmt);
|
||||
|
|
|
@ -34,11 +34,9 @@
|
|||
|
||||
LITE_OS_SEC_TEXT_INIT INT32 main(VOID)
|
||||
{
|
||||
UINT32 uwRet;
|
||||
|
||||
uwRet = OsMain();
|
||||
if (uwRet != LOS_OK) {
|
||||
return LOS_NOK;
|
||||
UINT32 ret = OsMain();
|
||||
if (ret != LOS_OK) {
|
||||
return (INT32)LOS_NOK;
|
||||
}
|
||||
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);
|
||||
|
||||
/*
|
||||
* The current postion has nothing to do with the CPUP modes,
|
||||
* however, the previous postion differs.
|
||||
* The current position has nothing to do with the CPUP modes,
|
||||
* however, the previous position differs.
|
||||
*/
|
||||
switch (mode) {
|
||||
case CPUP_LAST_ONE_SECONDS:
|
||||
|
|
|
@ -45,7 +45,6 @@
|
|||
#ifdef LOSCFG_DRIVERS_TZDRIVER
|
||||
#include "fs/file.h"
|
||||
#endif
|
||||
#include "fs/file.h"
|
||||
#include "unistd.h"
|
||||
|
||||
#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)
|
||||
{
|
||||
size_t retval;
|
||||
int retval;
|
||||
size_t bufLeft = HILOG_BUFFER - g_hiLogDev.headOffset;
|
||||
if (bufLeft > 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)
|
||||
{
|
||||
size_t retval;
|
||||
int retval;
|
||||
struct HiLogEntry header;
|
||||
|
||||
(void)filep;
|
||||
|
@ -209,7 +209,7 @@ out:
|
|||
g_hiLogDev.count = 0;
|
||||
}
|
||||
(VOID)LOS_MuxRelease(&g_hiLogDev.mtx);
|
||||
return retval;
|
||||
return (ssize_t)retval;
|
||||
}
|
||||
|
||||
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)
|
||||
g_cmsTask.status = HANDLE_NOT_USED;
|
||||
#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
|
||||
ret = LOS_MuxInit(&g_serviceHandleMapMux, NULL);
|
||||
if (ret != LOS_OK) {
|
||||
|
@ -565,7 +565,7 @@ LITE_OS_SEC_TEXT STATIC UINT32 SendDeathMsg(UINT32 processID, UINT32 serviceHand
|
|||
}
|
||||
content.flag = SEND;
|
||||
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->target.handle = ipcTaskID;
|
||||
content.outMsg->target.token = serviceHandle;
|
||||
|
@ -1161,7 +1161,7 @@ LITE_OS_SEC_TEXT STATIC UINT32 LiteIpcRead(IpcContent *content)
|
|||
if (ret == LOS_OK) {
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
@ -1208,7 +1208,7 @@ LITE_OS_SEC_TEXT STATIC UINT32 LiteIpcMsgHandle(IpcContent *con)
|
|||
}
|
||||
content->outMsg = msg;
|
||||
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;
|
||||
goto BUFFER_FREE;
|
||||
}
|
||||
|
|
|
@ -150,8 +150,8 @@ typedef struct {
|
|||
VOID *data;
|
||||
UINT32 spObjNum;
|
||||
VOID *offsets;
|
||||
UINT32 processID; /**< filled by kernel, processId of sender/reciever */
|
||||
UINT32 taskID; /**< filled by kernel, taskId of sender/reciever */
|
||||
UINT32 processID; /**< filled by kernel, processId of sender/receiver */
|
||||
UINT32 taskID; /**< filled by kernel, taskId of sender/receiver */
|
||||
#ifdef LOSCFG_SECURITY_CAPABILITY
|
||||
UINT32 userID;
|
||||
UINT32 gid;
|
||||
|
|
|
@ -56,7 +56,7 @@ void *memcpy(void *dest, const void *src, size_t len)
|
|||
}
|
||||
|
||||
#undef strcat
|
||||
char *strcat (char *s, const char *append)
|
||||
char *strcat(char *s, const char *append)
|
||||
{
|
||||
if ((s == NULL) || (append == NULL)) {
|
||||
return NULL;
|
||||
|
@ -119,4 +119,4 @@ char *strncpy(char *dest, const char *src, size_t n)
|
|||
__asan_storeN_noabort((UINTPTR)dest, n);
|
||||
__asan_loadN_noabort((UINTPTR)src, size + 1);
|
||||
return __strncpy(dest, src, n);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -104,7 +104,7 @@ typedef struct {
|
|||
#define PMU_INT(_num) PMU_LABEL_INT_##_num
|
||||
|
||||
#define OS_PMU_INTS(_num, _list) \
|
||||
STATIC UINT32 _list [_num] = { \
|
||||
STATIC UINT32 _list[_num] = { \
|
||||
PMU_INT(_num) \
|
||||
}
|
||||
|
||||
|
|
|
@ -181,7 +181,7 @@ STATIC VOID LOS_TraceTaskResume(const LosTaskCB *taskCB)
|
|||
|
||||
STATIC VOID LOS_TraceTaskSuspend(const LosTaskCB *taskCB)
|
||||
{
|
||||
LOS_TRACE(TASK_SUSPEND, taskCB->taskID, taskCB->taskStatus,OsCurrTaskGet()->taskID);
|
||||
LOS_TRACE(TASK_SUSPEND, taskCB->taskID, taskCB->taskStatus, OsCurrTaskGet()->taskID);
|
||||
}
|
||||
|
||||
STATIC VOID LOS_TraceIsrEnter(UINT32 hwiNum)
|
||||
|
|
|
@ -94,7 +94,7 @@ typedef struct {
|
|||
|
||||
/**
|
||||
* @ingroup los_trace
|
||||
* struct to store the event infomation
|
||||
* struct to store the event information
|
||||
*/
|
||||
typedef struct {
|
||||
UINT32 cmd; /* trace start or stop cmd */
|
||||
|
|
|
@ -57,6 +57,9 @@ UINT32 SerialPipelineInit(VOID)
|
|||
|
||||
UINT32 SerialDataReceive(UINT8 *data, UINT32 size, UINT32 timeout)
|
||||
{
|
||||
(VOID)data;
|
||||
(VOID)size;
|
||||
(VOID)timeout;
|
||||
return LOS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -132,7 +132,7 @@ VOID OsTraceDataSend(UINT8 type, UINT16 len, UINT8 *data)
|
|||
UINT32 intSave;
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
|
@ -187,7 +187,7 @@ STATIC VOID OsTraceInfoEventData(VOID)
|
|||
UINT32 taskLockCnt = frame->core.taskLockCnt;
|
||||
#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.
|
||||
*/
|
||||
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_ARCH(arm)
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue