Compare commits

...

97 Commits

Author SHA1 Message Date
openharmony_ci
e46f96de46 !1170 挑单swtmr遍历不全导致的用例问题到3.2
Merge pull request !1170 from wangchen/0726_32
2023-07-29 01:55:55 +00:00
wangchen
82f06317c5 Fix: 挑单swtmr遍历不全导致的用例问题到3.2
Close #I7O084
Signed-off-by: wangchen <wangchen240@huawei.com>
2023-07-26 09:54:00 +08:00
openharmony_ci
379aa8dd27 !1130 【同步到monthly_20221018分支】fix:修复内核调用栈解析脚本bug
Merge pull request !1130 from zhangdengyu/cherry-pick-1677501665
2023-03-06 04:17:04 +00:00
zhangdengyu
3b2c37aa66 fixed f924cc7 from https://gitee.com/zhangdengyu/kernel_liteos_a/pulls/1129
fix:修复内核调用栈解析脚本bug

方案描述:
1、修复内核调用栈解析脚本parse_mem_info.sh的bug,将多余符号(`)去除

BREAKING CHANGE:
无

Close:#I6I6BA

Signed-off-by: zhangdengyu <zhangdengyu2@huawei.com>
Change-Id: I0b0d7e5f6e79313e5f517f89395f4195883cfe06
2023-02-27 12:41:06 +00:00
openharmony_ci
f7dbd27a33 !1111 Fix : 删除冗余函数挑单到monthly_20221018分支
Merge pull request !1111 from yinjiaming/cherry-pick-1675760069
2023-02-09 02:01:05 +00:00
yinjiaming
0b3430e574 fixed d17bc9d from https://gitee.com/hgbveiu743/kernel_liteos_a/pulls/1109
fix:删除冗余的函数
代码扫描工具发现代码中有被注释的多余函数,现删除。

Signed-off-by: yinjiaming <yinjiaming@huawei.com>
Change-Id: I26980061390924d53c77e467b2cab2f56b192a82
2023-02-07 08:54:29 +00:00
openharmony_ci
518d448a2f !1093 Fix : 内核告警清理挑单到monthly_20221018
Merge pull request !1093 from yinjiaming/cherry-pick-1672881303
2023-01-06 11:29:40 +00:00
yinjiaming
05b07a29fe fixed ebc3f30 from https://gitee.com/hgbveiu743/kernel_liteos_a/pulls/1089
fix:修复codecheck扫描出的告警
给宏定义中的参数加上了括号,删除了多余的函数声明

Signed-off-by: yinjiaming <yinjiaming@huawei.com>
Change-Id: I8853f6a9717ede96578cd674b83b716c8e63f0d8
2023-01-05 01:15:05 +00:00
openharmony_ci
2bef65046a !1081 fix: 【挑单】codecheck问题清零
Merge pull request !1081 from zhushengle/cherry-pick-1669685670
2022-11-29 03:20:11 +00:00
zhushengle
205df75f15 fixed 8d980de from https://gitee.com/zhushengle/kernel_liteos_a/pulls/1078
fix: codecheck问题清零

1.shell初始化异常流程double free
2.los_disk_init中冗余初始化
3.OsKProcessPmUsage 中OsUProcessPmUsage异常退出时,存在使用未初始化的变量
4.HiLogHeadInit异常推出后,存在使用未初始化的变量
5.api_shell.c 中存在冗余初始化

fix #I63H5G

Signed-off-by: zhushengle <zhushengle@huawei.com>
Change-Id: If17d8ed1e6f2276e20fbce24b32de169bfd22e54
2022-11-29 01:34:30 +00:00
openharmony_ci
85f1c9e0ca !1067 【挑单】time相关系统调用内核栈信息泄露排查
Merge pull request !1067 from zhushengle/cherry-pick-1668158211
2022-11-14 03:24:57 +00:00
zhushengle
c04ff6b10f fixed 0b05a46 from https://gitee.com/zhushengle/kernel_liteos_a/pulls/1061
task: time相关系统调用内核栈信息泄露排查

解决方案:
    在涉及从内核拷贝数据到用户态的场景时,先将内核的数据进行清零操作,再填充内核数据
Close #I60M1P

Signed-off-by: zhushengle <zhushengle@huawei.com>
Change-Id: Ia61d4e39b9e190accea477ff5b361e41d0eed2af
2022-11-11 09:16:52 +00:00
openharmony_ci
1b61489512 !1048 Fix : 内核告警清理挑单到monthly 分支
Merge pull request !1048 from yinjiaming/cherry-pick-1666774395
2022-10-27 14:24:41 +00:00
yinjiaming
29c459e045 fixed 8d55bb1 from https://gitee.com/hgbveiu743/kernel_liteos_a/pulls/1046
fix: 内核告警清理
【背景】
内核告警清理

【修改方案】
删去了多余的空格,更改了魔数字

【影响】
对现有的产品编译不会有影响。

Signed-off-by: yinjiaming <yinjiaming@huawei.com>
Change-Id: Iba21be6cb23027dfb369576847d7d21e85f936b4
2022-10-26 08:53:15 +00:00
openharmony_ci
e7daa28200 !1025 清除一些静态检查工具发现的问题
Merge pull request !1025 from Far/master
2022-10-17 01:39:02 +00:00
Far
987a722d2d fix: 修复一些静态检查工具发现的问题
Signed-off-by: Far <yesiyuan2@huawei.com>
Change-Id: I2b93259d55a9eb1a9dfd5887fd7821c15274bb7f
2022-10-15 17:36:45 +08:00
openharmony_ci
ccdfa72431 !1016 修复执行测试用例执行时间过长等问题
Merge pull request !1016 from 夏不白/fix_unittest
2022-10-12 06:29:16 +00:00
openharmony_ci
557a71c1c3 !1020 jffs2.patch 文件适配LTS补丁升级
Merge pull request !1020 from 闻飞/master
2022-10-08 11:28:25 +00:00
wenfei
569aecb6ea jffs2.patch update
Signed-off-by: wenfei <wenfei9@huawei.com>
2022-09-30 11:23:29 +08:00
xiacong
8c0b7d0f38 <fix>
修复测试用例不过的问题

<body>
1.修复执行liteos_a_basic_unittest.bin时间过长的问题
2.修复测试shm系列系统调用函数用例失败的问题

Signed-off-by: xiacong <xiacong4@huawei.com>
Change-Id: Iabc541cb1c0e97dac0fe13aaeb98e85404e5bf6f
Signed-off-by: xiacong <xiacong4@huawei.com>
2022-09-28 17:24:14 +08:00
openharmony_ci
c488817b32 !1008 修复内核告警信息
Merge pull request !1008 from zhangdengyu/fix_preferused
2022-09-26 12:52:00 +00:00
openharmony_ci
43d47a27e3 !1011 fix: 修复shell_lk.c告警清零带来的逻辑修改
Merge pull request !1011 from 夏不白/module_fix
2022-09-26 11:22:57 +00:00
xiacong
a83f916298 <fix>
恢复告警清零带来的逻辑改变

Signed-off-by: xiacong <xiacong4@huawei.com>
Change-Id: I8d34d2b9c43ea54e5474cbddcde0048658cbb891
Signed-off-by: xiacong <xiacong4@huawei.com>
2022-09-26 17:29:08 +08:00
zhangdengyu
8dbfd3846e fix: 修复告警
Signed-off-by: zhangdengyu <zhangdengyu2@huawei.com>
2022-09-26 17:08:56 +08:00
openharmony_ci
f34762c105 !1001 修复函数返回错误等问题
Merge pull request !1001 from zhangdengyu/fix_tsacn
2022-09-25 06:42:18 +00:00
zhangdengyu
043e84dfcb fix:修复函数返回错误等问题
Signed-off-by: zhangdengyu <zhangdengyu2@huawei.com>
2022-09-25 10:09:29 +08:00
openharmony_ci
453c376198 !997 Fix : 内核告警清理
Merge pull request !997 from yinjiaming/fix
2022-09-22 11:33:00 +00:00
yinjiaming
204d7a4abb fix: 内核告警清理
【背景】
内核中经扫描有可以修改的告警之处

【修改方案】
优化了代码的格式

【影响】
对现有的产品编译不会有影响。

re #I5SHM2

Signed-off-by: yinjiaming <yinjiaming@huawei.com>
Change-Id: I89be86a8317637f9eb54257131712b5b79f1e454
2022-09-22 16:53:11 +08:00
openharmony_ci
f2861a84bf !987 Fix : 内核告警清理
Merge pull request !987 from yinjiaming/fix
2022-09-21 04:42:42 +00:00
yinjiaming
96b2d557ac fix: 内核告警修复
【背景】
经代码扫描工具检测,内核代码中存在
可以修复的告警

【修改方案】
1.将单语句的if, while等加上括号
2.将C语言风格的类型转换变为C++风格

【影响】
对现有的产品编译不会有影响。

Signed-off-by: yinjiaming <yinjiaming@huawei.com>
Change-Id: I7d4a04a8904abb3c33e843049bf15f4386d3efd8
2022-09-21 11:38:51 +08:00
openharmony_ci
ffa11535ca !991 【OpenHarmony开源贡献者计划2022】fix warning: expression result unused
Merge pull request !991 from xiwen1225/void
2022-09-19 03:19:16 +00:00
openharmony_ci
b581207045 !992 【OpenHarmony开源贡献者计划2022】fix warning for signal_test_016.cpp
Merge pull request !992 from queuechen/warn
2022-09-19 02:44:00 +00:00
ookami78
5105249ecf fix warning for signal_test_016.cpp
Signed-off-by: ookami78 <ookami78@mymailcr.com>
2022-09-18 14:21:46 +08:00
cunwen
a61e2cf16e fix warning: expression result unused
Signed-off-by: cunwen <cunwen181168@liuxiuhai.cn>
2022-09-18 11:29:44 +08:00
openharmony_ci
39e25c5220 !989 Fix : 修复测试用例返回值问题
Merge pull request !989 from yinjiaming/dev
2022-09-13 12:38:03 +00:00
yinjiaming
5541965365 fix: 修复测试用例中函数返回值的问题
【背景】
测试用例中有函数的返回值不正确

【修改方案】
将返回值为VOID *的函数的返回值改为
retrun NULL

【影响】
对现有的产品编译不会有影响。

re #I5O3LH

Signed-off-by: yinjiaming <yinjiaming@huawei.com>
Change-Id: I6d3ce9efbe9afe14b1e9dd12538b80e69928fd71
2022-09-09 15:28:22 +08:00
openharmony_ci
edd2223083 !983 【OpenHarmony开源贡献者计划2022】删除未使用的变量 count
Merge pull request !983 from leijiawei/master
2022-09-06 06:20:52 +00:00
openharmony_ci
22392965b5 !947 Fix : 版权头时间更新
Merge pull request !947 from yinjiaming/dev
2022-09-06 02:55:30 +00:00
yinjiaming
d906bb91ea fix: 版权头时间更新问题
【背景】
一些代码文件经过修改后需要更新版权头

【修改方案】
更新了需要更新的版权头时间

【影响】
对现有的产品编译不会有影响。

re #I5LG22

Signed-off-by: yinjiaming <yinjiaming@huawei.com>
Change-Id: I7963bf6ce5746707bad688dd4c634ae9d72b3c04
2022-09-05 16:03:30 +08:00
leijiawei
51f6a20723 fix warning:unused variable 'count' & add return value
Signed-off-by: leijiawei <18691361562@163.com>
2022-08-31 15:28:27 +08:00
leibanli
325ea29df3 fix warning:unused variable 'count'
Signed-off-by: leijiawei <18691361562@163.com>
2022-08-31 15:01:32 +08:00
leibanli
c2f9f6705f 【openHarmony开源贡献者计划2022】18691361562@163.com
Signed-off-by: leibanli <18691361562@163.com>
2022-08-30 21:53:58 +08:00
openharmony_ci
71e51d8813 !971 非安全函数告警清理
Merge pull request !971 from xuxinyu/function_s
2022-08-26 04:45:29 +00:00
xuxinyu
e0b4fcb23d test: replace unsecure function with secure function
Signed-off-by: xuxinyu <xuxinyu6@huawei.com>
Change-Id: Ie120ffa529798f0f087ddfcd34f5d9c5802b6766
2022-08-25 23:08:58 +08:00
openharmony_ci
7d62d3d62b !979 style: shell脚本中不同函数使用不同变量
Merge pull request !979 from Hongjin Li/dev
2022-08-25 03:32:45 +00:00
Hongjin Li
69f3bf3a2a style: using different variable in different functions
Signed-off-by: Hongjin Li <lihongjin1@huawei.com>
Change-Id: I814dcccefcd6248ea32cae94bfde567f3077c7cd
2022-08-25 10:16:45 +08:00
openharmony_ci
2590e34346 !969 编译构建规范优化
Merge pull request !969 from Hongjin Li/dev
2022-08-23 12:55:42 +00:00
Hongjin Li
660b314f90 style: string format in python
Signed-off-by: Hongjin Li <lihongjin1@huawei.com>
Change-Id: Ie84a97ca5e0250991aa774b737eb7787e27d80af
2022-08-23 20:22:13 +08:00
openharmony_ci
44ec199465 !951 【OpenHarmony开源贡献者计划2022】fix moudule to module
Merge pull request !951 from bingge88/module
2022-08-12 02:16:38 +00:00
openharmony_ci
7437408f65 !950 OpenHarmony开源贡献者计划2022】fix: change szie to size
Merge pull request !950 from Dream_Liu/master
2022-08-12 02:15:42 +00:00
binge889
1134332a58 fix moudule to module
Signed-off-by: binge889 <binge889@liuxiuhai.cn>
2022-08-11 23:31:52 +08:00
Dream_Liu
8099f6578d fix:change szie to size
Signed-off-by: Dream_Liu <lxm201x@163.com>
2022-08-11 23:14:20 +08:00
openharmony_ci
ba23a26f95 !928 Fix : 内核告警清理
Merge pull request !928 from yinjiaming/fix
2022-08-09 08:37:34 +00:00
yinjiaming
2dc24da826 fix: 内核告警清理
【背景】
内核代码经代码扫描工具发现存在一些关于代码格式的告警,
现经修改解除掉告警.

【修改方案】
修改了代码中格式不规范的地方,修改的点有:
1.代码中一行过长
2.没有合理的添加空格和空行
3.没有按照规范进行缩进
4.括号的格式没有按照规范
5.注释的格式不对以及存在魔数字
6.函数的声明与定义的格式不一致
并更新了修改文件的版权头时间

【影响】
对现有的产品编译不会有影响。

re #I5H6F5

Signed-off-by: yinjiaming <yinjiaming@huawei.com>
Change-Id: Ie46b5b3238fd88c25f99542b8ccd138b956c6458
2022-08-08 13:09:54 +00:00
openharmony_ci
6302c5f767 !938 修复用例告警
Merge pull request !938 from xuxinyu/master
2022-07-29 03:46:59 +00:00
xuxinyu
f0d5959576 fix: 修复用例告警问题
re #I5I21P

Signed-off-by: xuxinyu <xuxinyu6@huawei.com>
Change-Id: Iedab5b6fddafc2042c7fd23fbcd82061629f87d8
2022-07-26 11:07:02 +08:00
openharmony_ci
65790b67d5 !937 拼写错误修正
Merge pull request !937 from yinjiaming/dev
2022-07-25 11:06:35 +00:00
openharmony_ci
9eff5cff1d !934 refactor: sysroot部件化
Merge pull request !934 from Zhaotianyu/20220716sysroot_lite
2022-07-22 08:57:25 +00:00
yinjiaming
99ea8d4ed2 fix: 拼写错误修正
【背景】
代码中存在拼写错误

【修改方案】
修改存在拼写错误的地方

【影响】
对现有的产品编译不会有影响。

re #I5IA7P

Signed-off-by: yinjiaming <yinjiaming@huawei.com>
Change-Id: Idd5d7fc9705e5ec661596aa6533402e8d4a8a117
2022-07-21 11:05:11 +00:00
arvinzzz
1568c317bb refactor: sysroot部件化
close: #I5HF8S

Signed-off-by: arvinzzz <zhaotianyu9@huawei.com>
Change-Id: I727b10c3b419fc71e228f5ad92abc107e756bbac
2022-07-19 12:32:32 +08:00
openharmony_ci
5e70129199 !917 【OpenHarmony开源贡献者计划2022】fix warning: unused variable
Merge pull request !917 from rtos_ming/unused
2022-07-04 01:24:28 +00:00
zhumingxian
089376994a fix warning: unused variable
Signed-off-by: zhumingxian <zhumingxian@ohos.com.cn>
2022-06-30 20:49:50 +08:00
openharmony_ci
12adfd5832 !915 【OpenHarmony开源贡献者计划2022】Fixed typos.
Merge pull request !915 from Mr_YX/master
2022-06-30 06:11:01 +00:00
openharmony_ci
c46c5a640d !905 「OpenHarmony贡献者计划2022」update signal_test_020.cpp
Merge pull request !905 from Mr_YX/master
2022-06-30 06:09:18 +00:00
mr-yx
c812b0c27b fixed typos
Signed-off-by: mr-yx <496043997@qq.com>
2022-06-28 23:48:24 +08:00
openharmony_ci
51528ec39c !906 【OpenHarmony开源贡献者计划2022】Optimized conversion instructions.
Merge pull request !906 from Mr_YX/master
2022-06-27 09:31:08 +00:00
openharmony_ci
beb03bfc81 !903 【OpenHarmony开源贡献者计划2022】fix typos for net
Merge pull request !903 from c01dface/master
2022-06-23 14:54:42 +00:00
openharmony_ci
bbbd96784e !904 修复liteos_a仓库中存在的一些拼写错误
Merge pull request !904 from Hongjin Li/dev
2022-06-23 04:15:03 +00:00
lihongjin
1c0de289ec style: Misspelling
Signed-off-by: lihongjin <lihongjin1@huawei.com>
Change-Id: I13163f2e4d1e4b6e6c6bedaf9d4e705544df926b
2022-06-23 09:45:46 +08:00
openharmony_ci
a3d757c8e1 !898 【轻量级 PR】:「OpenHarmony开源贡献者计划2022」update testsuites/unittest/libc/util/smoke/util_test_005.cpp.
Merge pull request !898 from Mr_YX/N/A
2022-06-23 01:02:42 +00:00
openharmony_ci
6fede4eb92 !892 【OpenHarmony开源贡献者计划2022】更新readme中的目录结构
Merge pull request !892 from wanggang/master
2022-06-23 00:43:57 +00:00
Mr_YX
7be302633f Signed-off-by: mr-yx <496043997@qq.com> 2022-06-20 18:08:19 +00:00
Mr_YX
0164461b33 Signed-off-by: mr-yx <496043997@qq.com> 2022-06-20 15:16:02 +00:00
Neil Chen
9bb4be5e13 fix typos for net
Signed-off-by: Neil Chen <jingsi.chen@petalmail.com>
2022-06-19 14:10:19 +08:00
openharmony_ci
4acf1e9f8d !896 feat: normalize drivers framework component and repos
Merge pull request !896 from yuanbo/master
2022-06-17 06:39:48 +00:00
openharmony_ci
870221452d !900 【轻量级 PR】:remove tzdriver Kconfig
Merge pull request !900 from WoolenSky/N/A
2022-06-17 03:16:48 +00:00
WoolenSky
30c3fb086e remove tzdriver Kconfig
Signed-off-by: YuanHao<yuanhao34@huawei.com>
2022-06-16 11:59:28 +00:00
Mr_YX
9b1e0a186b update testsuites/unittest/libc/util/smoke/util_test_005.cpp.
Signed-off-by: mr-yx <496043997@qq.com>
2022-06-15 14:05:19 +00:00
yuanbo
00dbf1e5d5 feat: normalize drivers framework component and repos
Signed-off-by: yuanbo <yuanbo@huawei.com>
2022-06-15 20:02:05 +08:00
openharmony_ci
16fdbdf650 !885 【OpenHarmony开源贡献者计划2022】代码打印中sucess修改为success
Merge pull request !885 from lingxin_2019/master
2022-06-14 01:57:54 +00:00
openharmony_ci
bee3d97163 !890 fix:修复llvm编译告警
Merge pull request !890 from Zhaotianyu/0601llvm_apt
2022-06-13 02:20:53 +00:00
wanggang
9fb176b827 update readme
Signed-off-by: wanggang <wanggang@kaihongdigi.com>
2022-06-10 10:11:17 +08:00
openharmony_ci
398f4a6ada !891 fix : 修复测试用例中部分测试内容硬编码的问题
Merge pull request !891 from yinjiaming/master
2022-06-09 12:42:07 +00:00
yinjiaming
19553f73e1 fix: 修复测试用例中部分测试内容硬编码的问题
【背景】
A核测试用例中有一些敏感字符串需要修改

【修改方案】
将敏感的字符串改为随机生成

【影响】
对现有的产品编译不会有影响。

re #I5ALBS

Signed-off-by: yinjiaming <yinjiaming@huawei.com>
Change-Id: Ib9b023ace6be1d58248c993f7b9919a96afbea96
2022-06-09 02:28:05 +00:00
arvinzzz
de24efadfa fix: llvm10.0->12.0
close: I5AM0I

Signed-off-by: arvinzzz <zhaotianyu9@huawei.com>
Change-Id: I02ae045208411c6dac1234372b706ce0dbec5cef
2022-06-07 15:35:33 +08:00
openharmony_ci
0057fb0dd5 !886 修复文档链接失效问题
Merge pull request !886 from xuxinyu/master
2022-05-30 08:50:35 +00:00
x_xiny
bcf7e8ee02 修复文档链接失效问题
re #I59PF7

Signed-off-by: x_xiny <1301913191@qq.com>
Change-Id: Idc498604fbaadd8a00db4a5690de094883b280c4
2022-05-30 15:43:46 +08:00
lingxin_2019
0b9cac2cd3 Signed-off-by: 贺婷婷 <596256905@qq.com> 2022-05-26 08:09:56 +00:00
lingxin_2019
9958f647f5 Signed-off-by: 贺婷婷 <596256905@qq.com> 2022-05-26 12:24:46 +08:00
openharmony_ci
fa6b2d352c !880 【OpenHarmony开源贡献者计划2022】readme表达规范性和OAT英文表达规范性
Merge pull request !880 from king_he/master
2022-05-17 07:09:56 +00:00
openharmony_ci
7f57e11ef9 !881 修改jffs2引用路径
Merge pull request !881 from xuxinyu/master
2022-05-11 07:02:30 +00:00
x_xiny
1097d41a40 修改jffs2引用路径
Signed-off-by: x_xiny <1301913191@qq.com>
Change-Id: Id4ab149ff33747f1957b3a6843a1d8e43447e00e
2022-05-11 11:27:11 +08:00
openharmony_ci
90d6ff9a6f !871 fix: newlib for liteos_a and clip for liteos_a_mini
Merge pull request !871 from Harylee/qemu
2022-05-05 08:41:34 +00:00
king_he
eebe85fe31 update README_zh.md.
Signed-off-by: king_he <6384784@qq.com>
2022-04-30 03:41:16 +00:00
king_he
b126f1cb5f update README_zh.md.
Signed-off-by: king_he <6384784@qq.com>
2022-04-30 03:35:27 +00:00
king_he
639160f517 update OAT.xml.
Signed-off-by: king_he <6384784@qq.com>
2022-04-30 03:26:01 +00:00
Haryslee
7fef6ac8d9 fix: newlib for liteos_a and clip for liteos_a_mini
close #I53VW6

Signed-off-by: Haryslee <lihao189@huawei.com>
Change-Id: I591b4ffaeb220311b63bd95f19400e0b9fde3c45
2022-04-29 14:12:29 +08:00
551 changed files with 13313 additions and 2806 deletions

View File

@@ -35,6 +35,7 @@ declare_args() {
tee_enable = false
liteos_name = "OHOS_Image"
liteos_skip_make = false
liteos_is_mini = false
}
tee = ""
@@ -128,7 +129,9 @@ config("stdinc_config") {
"-isystem",
std_include,
]
cflags += [ "-nostdinc" ]
if (!defined(LOSCFG_LIBC_NEWLIB)) {
cflags += [ "-nostdinc" ]
}
asmflags = cflags
}
@@ -315,14 +318,16 @@ group("kernel") {
}
group("liteos_a") {
deps = [
":apps",
":kernel",
":tests",
"//prebuilts/lite/sysroot/build:strip",
]
if (liteos_skip_make == false) {
deps += [ ":make" ]
deps = [ ":kernel" ]
if (!liteos_is_mini) {
deps += [
":apps",
":tests",
"//third_party/musl/scripts/build_lite:strip",
]
if (liteos_skip_make == false) {
deps += [ ":make" ]
}
}
}
@@ -339,6 +344,17 @@ executable("liteos") {
"-Wl,--no-eh-frame-hdr",
]
if (defined(LOSCFG_LIBC_NEWLIB)) {
ldflags += [
"-Wl,--wrap=_free_r",
"-Wl,--wrap,_malloc_usable_size_r",
"-Wl,--wrap,_malloc_r",
"-Wl,--wrap,_memalign_r",
"-Wl,--wrap,_realloc_r",
"-Wl,--wrap,_fseeko_r",
]
ldflags -= [ "-nostdlib" ]
}
libgcc = exec_script("//build/lite/run_shell_cmd.py",
[ "$cc -print-libgcc-file-name" ],
"trim string")
@@ -350,7 +366,7 @@ executable("liteos") {
} else {
ldflags +=
[ "-Wl,-T" + rebase_path("tools/build/liteos.ld", root_build_dir) ]
ldflags += [ "-Wl,-nostartfiles" ]
ldflags += [ "-nostartfiles" ]
inputs = [ "tools/build/liteos.ld" ]
}

View File

@@ -265,7 +265,7 @@ config MEM_LEAKCHECK
default n
depends on DEBUG_VERSION && MEM_DEBUG
help
Answer Y to enable record the LR of Function call stack of Mem operation, it can check the mem leak through the informations of mem node.
Answer Y to enable record the LR of Function call stack of Mem operation, it can check the mem leak through the information of mem node.
config BASE_MEM_NODE_INTEGRITY_CHECK
bool "Enable integrity check or not"
default n

View File

@@ -121,7 +121,7 @@ sysroot:
$(HIDE)echo "sysroot:" $(abspath $(SYSROOT_PATH))
ifeq ($(origin SYSROOT_PATH),file)
$(HIDE)mkdir -p $(SYSROOT_PATH)/build && cd $(SYSROOT_PATH)/build && \
ln -snf $(LITEOSTOPDIR)/../../prebuilts/lite/sysroot/build/Makefile && \
ln -snf $(LITEOSTOPDIR)/../../third_party/musl/scripts/build_lite/Makefile && \
$(MAKE) TARGETS=liteos_a_user \
ARCH=$(ARCH) \
TARGET=$(LOSCFG_LLVM_TARGET) \

View File

@@ -15,7 +15,7 @@
-->
<!--
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 by referring to OpenHarmony/tools_oat/README.
-->
<configuration>
@@ -24,6 +24,7 @@
<policylist>
<policy name="projectPolicy" desc="">
<policyitem type="copyright" name="Huawei Technologies Co., Ltd. All rights reserved." path=".*" desc="original liteos copyright"/>
<policyitem type="copyright" name="Huawei Device Co., Ltd. All rights reserved." path=".*" desc="original liteos copyright"/>
<policyitem type="license" name="BSD-3-Clause" path=".*" desc="Liteos kernel use bsd3 license"/>
</policy>
</policylist>
@@ -38,7 +39,7 @@
<!--filteritem type="filepath" name="abcdefg/.*.uvwxyz" desc="Describe the reason for filtering scan results"/-->
<!--filteritem type="filepath" name="projectroot/[a-zA-Z0-9]{20,}.sh" desc="Temp files"/-->
</filefilter>
<filefilter name="defaultPolicyFilter" desc="Filters for compatibilitylicense header policies">
<filefilter name="defaultPolicyFilter" desc="Filters for license header policies">
<!--filteritem type="filename" name="*.uvwxyz" desc="Describe the reason for filtering scan results"/-->
<!--filteritem type="filepath" name="abcdefg/.*.uvwxyz" desc="Describe the reason for filtering scan results"/-->
<!--filteritem type="filepath" name="projectroot/[a-zA-Z0-9]{20,}.sh" desc="Temp files"/-->

View File

@@ -62,19 +62,18 @@ 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.
- [Setting Up Ubuntu Development Environment](https://gitee.com/openharmony/docs/blob/master/en/device-dev/quick-start/quickstart-lite-env-setup-linux.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-hi3518-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,8 +84,6 @@ 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-hi3518-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>

View File

@@ -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上搭建編譯環境
- [編譯環境凖備](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-lite-package-environment.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>

View File

@@ -33,6 +33,7 @@ OpenHarmony LiteOS-A内核是基于Huawei LiteOS内核演进发展的新一代
│ ├── quickstart # 系统快速启动接口目录
│ ├── random # 随机数设备驱动
│ └── video # framebuffer驱动框架
├── figures # 内核架构图
├── fs # 文件系统模块主要来源于NuttX开源项目
│ ├── fat # fat文件系统
│ ├── jffs2 # jffs2文件系统
@@ -54,26 +55,27 @@ OpenHarmony LiteOS-A内核是基于Huawei LiteOS内核演进发展的新一代
│ ├── include # 对外暴露头文件存放目录
│ └── uart # 串口相关逻辑代码
├── security # 安全特性相关的代码包括进程权限管理和虚拟id映射管理
├── shell # 接收用户输入的命令,内核去执行
├── syscall # 系统调用
├── testsuilts # 测试套件
└── tools # 构建工具及相关配置和代码
```
## 约束<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上搭建编译环境
- [编译环境准备](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-lite-package-environment.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>
@@ -82,9 +84,7 @@ OpenHarmony LiteOS-A内核支持Hi3518EV300[介绍](https://gitee.com/openhar
### 编译构建<a name="section2081013992812"></a>
开发者开发第一个应用程序可参考:
- [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)。

View File

@@ -180,7 +180,8 @@ static void LmsStrcpyTest(void)
return;
}
char *testStr = "bbbbbbbbbbbbbbbbb";
printf("[LmsStrcpyTest] strcpy overflow error should be triggered, src string buf size:%d\n", strlen(testStr) + 1);
printf("[LmsStrcpyTest] strcpy overflow error should be triggered, src string buf size:%d\n",
(int)strlen(testStr) + 1);
strcpy(buf, testStr);
free(buf);
printf("\n-------- LmsStrcpyTest End --------\n");

View File

@@ -42,7 +42,7 @@ copy("copy_mksh_src") {
build_ext_component("build_mksh") {
deps = [ ":copy_mksh_src" ]
deps += [ "//prebuilts/lite/sysroot" ]
deps += [ "//third_party/musl:sysroot_lite" ]
exec_path = rebase_path("$target_out_dir/mksh_build")
cflags = [

View File

@@ -62,7 +62,7 @@ int main(int argc, char **argv)
PerfStop(fd);
} else if ((argc == THREE_ARGS) && strcmp(argv[1], "read") == 0) {
size_t size = strtoul(argv[THREE_ARGS - 1], NULL, 0);
if (size <= 0) {
if (size == 0) {
goto EXIT:
}

View File

@@ -49,7 +49,7 @@ ShellCB *OsGetShellCb()
return g_shellCB;
}
void ShellDeinit(ShellCB *shellCB)
static void ShellDeinit(ShellCB *shellCB)
{
(void)pthread_mutex_destroy(&shellCB->historyMutex);
(void)pthread_mutex_destroy(&shellCB->keyMutex);
@@ -65,27 +65,23 @@ static int OsShellCreateTask(ShellCB *shellCB)
ret = sched_getparam(getpid(), &param);
if (ret != SH_OK) {
goto OUT;
return ret;
}
param.sched_priority = SHELL_PROCESS_PRIORITY_INIT;
ret = sched_setparam(getpid(), &param);
if (ret != SH_OK) {
goto OUT;
return ret;
}
ret = ShellTaskInit(shellCB);
if (ret != SH_OK) {
goto OUT;
return ret;
}
shellCB->shellEntryHandle = pthread_self();
return 0;
OUT:
ShellDeinit(shellCB);
return ret;
}
static int DoShellExec(char **argv)
@@ -148,7 +144,7 @@ int main(int argc, char **argv)
shellCB = (ShellCB *)malloc(sizeof(ShellCB));
if (shellCB == NULL) {
goto ERR_OUT1;
return SH_NOK;
}
ret = memset_s(shellCB, sizeof(ShellCB), 0, sizeof(ShellCB));
if (ret != SH_OK) {
@@ -176,7 +172,9 @@ int main(int argc, char **argv)
g_shellCB = shellCB;
ret = OsShellCreateTask(shellCB);
if (ret != SH_OK) {
goto ERR_OUT3;
ShellDeinit(shellCB);
g_shellCB = NULL;
return ret;
}
ShellEntry(shellCB);

View File

@@ -422,7 +422,7 @@ static void DoCmdExec(const char *cmdName, const char *cmdline, unsigned int len
forkPid = fork();
if (forkPid < 0) {
printf("Faild to fork from shell\n");
printf("Failed to fork from shell\n");
return;
} else if (forkPid == 0) {
ChildExec(cmdParsed->paramArray[0], cmdParsed->paramArray, foreground);

View File

@@ -500,7 +500,7 @@ static void lwip_tftp_send_error(s32_t iSockNum, u32_t ulError, const char *szEr
}
}
/* INTEFACE to get a file using filename
/* INTERFACE to get a file using filename
ulHostAddr - IP address of Host
szSrcFileName - Source file
szDestDirPath - Destination file path
@@ -1419,7 +1419,7 @@ err_handler:
}
#ifdef TFTP_TO_RAWMEM
/* INTEFACE to get a file using filename
/* INTERFACE to get a file using filename
ulHostAddr - IP address of Host
szSrcFileName - Source file
szDestMemAddr - The target memory address in the client
@@ -1437,10 +1437,8 @@ u32_t lwip_tftp_get_file_by_filename_to_rawmem(u32_t ulHostAddr,
{
s32_t iSockNum = TFTP_NULL_INT32;
u32_t ulSrcStrLen;
u32_t lDestStrLen;
u32_t ulSize;
u32_t ulRecvSize = TFTP_NULL_UINT32;
s32_t iErrCode;
u32_t ulErrCode;
u16_t usReadReq;
u16_t usTempServPort;

View File

@@ -51,7 +51,7 @@ build_ext_component("build_toybox") {
":copy_toybox_config",
":copy_toybox_src",
]
deps += [ "//prebuilts/lite/sysroot" ]
deps += [ "//third_party/musl:sysroot_lite" ]
exec_path = rebase_path("$target_out_dir/toybox_build")
cflags = [

View File

@@ -70,7 +70,7 @@ static void TraceRead(int fd, size_t size)
{
ssize_t i;
ssize_t len;
if (size <= 0) {
if (size == 0) {
return;
}

View File

@@ -88,6 +88,7 @@ STATIC UINT32 g_nextExcWaitCpu = INVALID_CPUID;
#define OS_MAX_BACKTRACE 15U
#define DUMPSIZE 128U
#define DUMPREGS 12U
#define COM_REGS 4U
#define INSTR_SET_MASK 0x01000020U
#define THUMB_INSTR_LEN 2U
#define ARM_INSTR_LEN 4U
@@ -516,13 +517,22 @@ VOID OsDumpContextMem(const ExcContext *excBufAddr)
return;
}
for (excReg = &(excBufAddr->R0); count <= DUMPREGS; excReg++, count++) {
for (excReg = &(excBufAddr->R0); count < COM_REGS; excReg++, count++) {
if (IS_VALID_ADDR(*excReg)) {
PrintExcInfo("\ndump mem around R%u:%p", count, (*excReg));
OsDumpMemByte(DUMPSIZE, ((*excReg) - (DUMPSIZE >> 1)));
}
}
for (excReg = &(excBufAddr->R4); count < DUMPREGS; excReg++, count++) {
if (IS_VALID_ADDR(*excReg)) {
PrintExcInfo("\ndump mem around R%u:%p", count, (*excReg));
OsDumpMemByte(DUMPSIZE, ((*excReg) - (DUMPSIZE >> 1)));
}
}
if (IS_VALID_ADDR(excBufAddr->R12)) {
PrintExcInfo("\ndump mem around R12:%p", excBufAddr->R12);
OsDumpMemByte(DUMPSIZE, (excBufAddr->R12 - (DUMPSIZE >> 1)));
}
if (IS_VALID_ADDR(excBufAddr->SP)) {
PrintExcInfo("\ndump mem around SP:%p", excBufAddr->SP);
OsDumpMemByte(DUMPSIZE, (excBufAddr->SP - (DUMPSIZE >> 1)));
@@ -645,6 +655,7 @@ STATIC INLINE BOOL FindSuitableStack(UINTPTR regFP, UINTPTR *start, UINTPTR *end
const StackInfo *stack = NULL;
vaddr_t kvaddr;
#ifdef LOSCFG_KERNEL_VM
if (g_excFromUserMode[ArchCurrCpuid()] == TRUE) {
taskCB = OsCurrTaskGet();
stackStart = taskCB->userMapBase;
@@ -655,6 +666,7 @@ STATIC INLINE BOOL FindSuitableStack(UINTPTR regFP, UINTPTR *start, UINTPTR *end
}
return found;
}
#endif
/* Search in the task stacks */
for (index = 0; index < g_taskMaxNum; index++) {

View File

@@ -276,11 +276,11 @@ mmu_setup:
mov r12, #0x7 /* 0b0111 */
mcr p15, 0, r12, c3, c0, 0 /* Set DACR with 0b0111, client and manager domian */
isb
mrc p15, 0, r12, c1, c0, 1 /* ACTLR, Auxlliary Control Register */
mrc p15, 0, r12, c1, c0, 1 /* ACTLR, Auxiliary Control Register */
orr r12, r12, #(1 << 6) /* SMP, Enables coherent requests to the processor. */
orr r12, r12, #(1 << 2) /* Enable D-side prefetch */
orr r12, r12, #(1 << 11) /* Global BP Enable bit */
mcr p15, 0, r12, c1, c0, 1 /* ACTLR, Auxlliary Control Register */
mcr p15, 0, r12, c1, c0, 1 /* ACTLR, Auxiliary Control Register */
dsb
mrc p15, 0, r12, c1, c0, 0
bic r12, #(1 << 29 | 1 << 28) /* Disable TRE/AFE */

View File

@@ -28,7 +28,7 @@
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
include $(LITEOSTOPDIR)/config.mk
include $(LITEOSTOPDIR)/../../drivers/adapter/khdf/liteos/lite.mk
include $(LITEOSTOPDIR)/../../drivers/hdf_core/adapter/khdf/liteos/lite.mk
MODULE_NAME := usb_base
@@ -122,13 +122,13 @@ LOCAL_SRCS += $(STORAGE_SRC)/umass.c
endif
ifeq ($(LOSCFG_DRIVERS_USB_HID_CLASS)_$(LOSCFG_DRIVERS_HDF_INPUT), y_y)
LOCAL_FLAGS += -I$(LITEOSTOPDIR)/../../drivers/framework/model/input/driver \
-I$(LITEOSTOPDIR)/../../drivers/framework/include/core \
-I$(LITEOSTOPDIR)/../../drivers/framework/core/common/include/host \
-I$(LITEOSTOPDIR)/../../drivers/framework/utils \
-I$(LITEOSTOPDIR)/../../drivers/framework/osal \
-I$(LITEOSTOPDIR)/../../drivers/framework/ability/sbuf/include \
-I$(LITEOSTOPDIR)/../../drivers/framework/include/osal \
LOCAL_FLAGS += -I$(LITEOSTOPDIR)/../../drivers/hdf_core/framework/model/input/driver \
-I$(LITEOSTOPDIR)/../../drivers/hdf_core/framework/include/core \
-I$(LITEOSTOPDIR)/../../drivers/hdf_core/framework/core/common/include/host \
-I$(LITEOSTOPDIR)/../../drivers/hdf_core/framework/utils \
-I$(LITEOSTOPDIR)/../../drivers/hdf_core/framework/osal \
-I$(LITEOSTOPDIR)/../../drivers/hdf_core/framework/ability/sbuf/include \
-I$(LITEOSTOPDIR)/../../drivers/hdf_core/framework/include/osal \
-I$(LITEOSTOPDIR)/../../third_party/FreeBSD/sys/dev/evdev
LOCAL_SRCS += $(INPUT_SRC)/uhid.c \

View File

@@ -1,6 +1,6 @@
/*
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
* Copyright (c) 2020-2022 Huawei Device Co., Ltd. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
@@ -71,7 +71,7 @@
#ifdef LOSCFG_AARCH64
/*
* This two structures originally did't exit,
* This two structures originally didn't exit,
* they added by liteos to support 64bit interfaces on 32bit platform,
* in 64bit platform, timeval64 define to timeval which is platform adaptive.
*/
@@ -387,9 +387,16 @@ int gettimeofday64(struct timeval64 *tv, struct timezone *tz)
}
#endif
#ifdef LOSCFG_LIBC_NEWLIB
int gettimeofday(struct timeval *tv, void *_tz)
#else
int gettimeofday(struct timeval *tv, struct timezone *tz)
#endif
{
struct timeval64 stTimeVal64 = {0};
#ifdef LOSCFG_LIBC_NEWLIB
struct timezone *tz = (struct timezone *)_tz;
#endif
if (tv == NULL) {
TIME_RETURN(EINVAL);
@@ -471,7 +478,6 @@ static int PthreadGetCputime(clockid_t clockID, struct timespec *ats)
uint64_t runtime;
UINT32 intSave;
UINT32 tid = GetTidFromClockID(clockID);
if (OS_TID_CHECK_INVALID(tid)) {
return -EINVAL;
}
@@ -718,6 +724,7 @@ typedef struct {
static VOID SwtmrProc(UINTPTR tmrArg)
{
#ifdef LOSCFG_KERNEL_VM
INT32 sig, ret;
UINT32 intSave;
pid_t pid;
@@ -761,9 +768,47 @@ static VOID SwtmrProc(UINTPTR tmrArg)
return;
EXIT:
PRINT_ERR("Dispatch signals failed!, ret: %d\r\n", ret);
#endif
return;
}
int timer_create(clockid_t clockID, struct sigevent *restrict evp, timer_t *restrict timerID)
{
UINT32 ret;
UINT16 swtmrID;
#ifdef LOSCFG_SECURITY_VID
UINT16 vid;
#endif
if (!timerID || (clockID != CLOCK_REALTIME) || !evp) {
errno = EINVAL;
return -1;
}
if ((evp->sigev_notify != SIGEV_THREAD) || evp->sigev_notify_attributes) {
errno = ENOTSUP;
return -1;
}
ret = LOS_SwtmrCreate(1, LOS_SWTMR_MODE_ONCE, (SWTMR_PROC_FUNC)evp->sigev_notify_function,
&swtmrID, (UINTPTR)evp->sigev_value.sival_ptr);
if (ret != LOS_OK) {
errno = (ret == LOS_ERRNO_SWTMR_MAXSIZE) ? EAGAIN : EINVAL;
return -1;
}
#ifdef LOSCFG_SECURITY_VID
vid = AddNodeByRid(swtmrID);
if (vid == MAX_INVALID_TIMER_VID) {
(VOID)LOS_SwtmrDelete(swtmrID);
return -1;
}
swtmrID = vid;
#endif
*timerID = (timer_t)(UINTPTR)swtmrID;
return 0;
}
int OsTimerCreate(clockid_t clockID, struct ksigevent *evp, timer_t *timerID)
{
UINT32 ret;
@@ -823,6 +868,7 @@ int timer_delete(timer_t timerID)
{
UINT16 swtmrID = (UINT16)(UINTPTR)timerID;
VOID *arg = NULL;
UINTPTR swtmrProc;
#ifdef LOSCFG_SECURITY_VID
swtmrID = GetRidByVid(swtmrID);
@@ -832,10 +878,11 @@ int timer_delete(timer_t timerID)
}
arg = (VOID *)OS_SWT_FROM_SID(swtmrID)->uwArg;
swtmrProc = (UINTPTR)OS_SWT_FROM_SID(swtmrID)->pfnHandler;
if (LOS_SwtmrDelete(swtmrID)) {
goto ERROUT;
}
if (arg != NULL) {
if ((swtmrProc == (UINTPTR)SwtmrProc) && (arg != NULL)) {
free(arg);
}
@@ -979,7 +1026,11 @@ STATIC INT32 DoNanoSleep(UINT64 nanoseconds)
return -1;
}
#ifdef LOSCFG_LIBC_NEWLIB
int usleep(unsigned long useconds)
#else
int usleep(unsigned useconds)
#endif
{
return DoNanoSleep((UINT64)useconds * OS_SYS_NS_PER_US);
}

View File

@@ -5,7 +5,7 @@ config DRIVERS
Answer Y to enable LiteOS support driver.
source "bsd/dev/usb/Kconfig"
source "../../drivers/adapter/khdf/liteos/Kconfig"
source "../../drivers/hdf_core/adapter/khdf/liteos/Kconfig"
# Device driver Kconfig import
source "$(DEVICE_PATH)/drivers/Kconfig"
@@ -17,5 +17,4 @@ source "drivers/char/video/Kconfig"
source "drivers/char/trace/Kconfig"
source "drivers/char/perf/Kconfig"
source "../../drivers/liteos/tzdriver/Kconfig"
source "../../drivers/liteos/hievent/Kconfig"

View File

@@ -163,7 +163,7 @@ extern "C" {
#define DISK_ATA_GET_MODEL 21 /* Get model name */
#define DISK_ATA_GET_SN 22 /* Get serial number */
#ifdef LOSCFG_FS_FAT_CACHE
#ifndef LOSCFG_FS_FAT_CACHE
#define DISK_DIRECT_BUFFER_SIZE 4 /* los_disk direct io buffer when bcache is off */
#endif

View File

@@ -1,6 +1,6 @@
/*
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
* Copyright (c) 2020-2022 Huawei Device Co., Ltd. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
@@ -42,7 +42,7 @@
#ifdef __cplusplus
#if __cplusplus
extern "C"{
extern "C" {
#endif
#endif /* __cplusplus */

View File

@@ -1465,7 +1465,7 @@ INT32 los_disk_init(const CHAR *diskName, const struct block_operations *bops,
ret = VnodeLookup(diskName, &blkDriver, 0);
if (ret < 0) {
VnodeDrop();
ret = ENOENT;
PRINT_ERR("disk_init : %s, failed to find the vnode, ERRNO=%d\n", diskName, ret);
goto DISK_FIND_ERROR;
}
struct block_operations *bops2 = (struct block_operations *)((struct drv_data *)blkDriver->data)->ops;

View File

@@ -33,6 +33,7 @@ group("fs") {
deps = [
"fat",
"fat/virpart",
"jffs2",
"nfs",
"patchfs",
"proc",

View File

@@ -1,6 +1,6 @@
/*
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
* Copyright (c) 2020-2022 Huawei Device Co., Ltd. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
@@ -343,7 +343,8 @@ static FRESULT init_cluster(DIR_FILE *pdfp, DIR *dp_new, FATFS *fs, int type, co
return FR_OK;
}
static int fatfs_create_obj(struct Vnode *parent, const char *name, int mode, struct Vnode **vpp, BYTE type, const char *target)
static int fatfs_create_obj(struct Vnode *parent, const char *name, int mode, struct Vnode **vpp,
BYTE type, const char *target)
{
struct Vnode *vp = NULL;
FATFS *fs = (FATFS *)parent->originMount->data;
@@ -1408,7 +1409,7 @@ DWORD fattime_format(time_t time)
ftime |= ((DWORD)((st.tm_year > YEAR_OFFSET) ? (st.tm_year - YEAR_OFFSET) : 0)) << FTIME_YEAR_OFFSET;
ftime <<= FTIME_DATE_OFFSET;
ftime = (DWORD)st.tm_sec / SEC_MULTIPLIER;
ftime |= (DWORD)st.tm_sec / SEC_MULTIPLIER;
ftime |= ((DWORD)st.tm_min) << FTIME_MIN_OFFSET;
ftime |= ((DWORD)st.tm_hour) << FTIME_HR_OFFSET;
@@ -2166,7 +2167,7 @@ int fatfs_symlink(struct Vnode *parentVnode, struct Vnode **newVnode, const char
ssize_t fatfs_readlink(struct Vnode *vnode, char *buffer, size_t bufLen)
{
int ret;
FRESULT res = FR_OK;
FRESULT res;
DWORD clust;
QWORD sect;
DIR_FILE *dfp = (DIR_FILE *)(vnode->data);

View File

@@ -64,7 +64,7 @@ extern "C" {
#define MBR_PRIMARY_PART_NUM 4
#define JUMP_CODE "\xEB\xFE\x90"
/* Partiton type */
/* Partition type */
#define FAT12 0x01 /* FAT12 as primary partition in first physical 32MB */
#define FAT16 0x04 /* FAT16 with less than 65536 sectors(32MB) */
#define EXTENDED_PARTITION_CHS 0x05

View File

@@ -179,7 +179,7 @@ static INT FatfsDisablePart(void *handle)
* Scan the FAT inside the boundary of CHILD FATFS limit, and update the free cluster and last cluster
* for all CHILD FATFS.
* Acceptable Return Value:
* - FR_OK : Successfully scaned the FAT and update field.
* - FR_OK : Successfully scanned the FAT and update field.
* Others Return Value:
* - FR_INVAILD_FATFS : The FATFS object has error or the info in it has been occuried
* - FR_DENIED : The virtual partition feature has been shut down by switcher

View File

@@ -373,7 +373,7 @@ static FRESULT FatfsCheckScanFatParam(FATFS *fs)
* Scan the FAT inside the boundary of CHILD FATFS limit, and update the free cluster and last cluster
*
* Acceptable Return Value:
* - FR_OK : Successfully scaned the FAT and update field.
* - FR_OK : Successfully scanned the FAT and update field.
*
* Others Return Value:
* - FR_INVAILD_FATFS : The FATFS object has error or the info in it has been occuried

View File

@@ -1,6 +1,6 @@
/*
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
* Copyright (c) 2020-2022 Huawei Device Co., Ltd. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
@@ -244,8 +244,9 @@ extern int chattr(const char *pathname, struct IATTR *attr);
*
* @retval #0 On success.
* @retval #-1 On failure with errno set.
* @retval CONTINE_NUTTX_FCNTL doesn't support some cmds in VfsFcntl, needs to continue going through Nuttx vfs operation.</li>
*
* @retval CONTINE_NUTTX_FCNTL doesn't support some cmds in VfsFcntl, needs to continue going through
* Nuttx vfs operation.</li>
*
* @par Dependency:
* <ul><li>fs.h</li></ul>
* @see None

View File

@@ -49,7 +49,7 @@ struct Mount {
LIST_HEAD vnodeList; /* list of vnodes */
int vnodeSize; /* size of vnode list */
LIST_HEAD activeVnodeList; /* list of active vnodes */
int activeVnodeSize; /* szie of active vnodes list */
int activeVnodeSize; /* size of active vnodes list */
void *data; /* private data */
uint32_t hashseed; /* Random seed for vfshash */
unsigned long mountFlags; /* Flags for mount */

View File

@@ -31,19 +31,86 @@ import("//kernel/liteos_a/liteos.gni")
module_switch = defined(LOSCFG_FS_JFFS)
module_name = get_path_info(rebase_path("."), "name")
linux_path = rebase_path("//kernel/linux/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",
]
}

View File

@@ -31,13 +31,51 @@ include $(LITEOSTOPDIR)/config.mk
MODULE_NAME := $(notdir $(shell pwd))
LOCAL_SRCS := $(wildcard src/*.c) \
$(wildcard $(LITEOSTOPDIR)/../linux/linux-5.10/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 $(LITEOSTOPDIR)/../linux/linux-5.10/fs/jffs2 \
-I $(LITEOSTOPDIR)/../linux/linux-5.10/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)

9936
fs/jffs2/jffs2.patch Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021-2021 Huawei Device Co., Ltd. All rights reserved.
* Copyright (c) 2021-2022 Huawei Device Co., Ltd. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
@@ -682,7 +682,6 @@ int VfsJffs2Rmdir(struct Vnode *parentVnode, struct Vnode *targetVnode, const ch
LOS_MuxLock(&g_jffs2FsLock, (uint32_t)JFFS2_WAITING_FOREVER);
ret = jffs2_rmdir(parentInode, targetInode, (const unsigned char *)path);
if (ret == 0) {
(void)jffs2_iput(targetInode);
}
@@ -781,7 +780,6 @@ ssize_t VfsJffs2Readlink(struct Vnode *vnode, char *buffer, size_t bufLen)
cnt = (bufLen - 1) < targetLen ? (bufLen - 1) : targetLen;
if (LOS_CopyFromKernel(buffer, bufLen, (const char *)f->target, cnt) != 0) {
cnt = 0;
LOS_MuxUnlock(&g_jffs2FsLock);
return -EFAULT;
}
@@ -809,7 +807,6 @@ int VfsJffs2Unlink(struct Vnode *parentVnode, struct Vnode *targetVnode, const c
LOS_MuxLock(&g_jffs2FsLock, (uint32_t)JFFS2_WAITING_FOREVER);
ret = jffs2_unlink(parentInode, targetInode, (const unsigned char *)path);
if (ret == 0) {
(void)jffs2_iput(targetInode);
}

View File

@@ -137,7 +137,7 @@ struct ProcData {
#define S_IALLUGO (S_ISUID | S_ISGID | S_ISVTX | S_IRWXU | S_IRWXG | S_IRWXO)
/**
* Interface for modules using proc below internal proc moudule;
* Interface for modules using proc below internal proc module;
*/
/**
* @ingroup procfs

View File

@@ -135,7 +135,7 @@ void ProcFdInit(void)
{
struct ProcDirEntry *pde = CreateProcEntry("fd", 0, NULL);
if (pde == NULL) {
PRINT_ERR("creat /proc/fd error.\n");
PRINT_ERR("create /proc/fd error.\n");
return;
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021-2021 Huawei Device Co., Ltd. All rights reserved.
* Copyright (c) 2021-2022 Huawei Device Co., Ltd. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
@@ -154,7 +154,8 @@ static int FsCacheInfoFill(struct SeqBuf *buf, void *arg)
VnodeHold();
LosBufPrintf(buf, "\n=================================================================\n");
LosBufPrintf(buf, "VnodeAddr ParentAddr DataAddr VnodeOps Hash Ref Type Gid Uid Mode\n");
LosBufPrintf(buf,
"VnodeAddr ParentAddr DataAddr VnodeOps Hash Ref Type Gid Uid Mode\n");
vnodeVirtual = VnodeListProcess(buf, GetVnodeVirtualList());
vnodeFree = VnodeListProcess(buf, GetVnodeFreeList());
vnodeActive = VnodeListProcess(buf, GetVnodeActiveList());

View File

@@ -91,7 +91,7 @@ void ProcMountsInit(void)
{
struct ProcDirEntry *pde = CreateProcEntry("mounts", 0, NULL);
if (pde == NULL) {
PRINT_ERR("creat mounts error!\n");
PRINT_ERR("create mounts error!\n");
return;
}

View File

@@ -78,7 +78,7 @@ void ProcUptimeInit(void)
{
struct ProcDirEntry *pde = CreateProcEntry("uptime", 0, NULL);
if (pde == NULL) {
PRINT_ERR("creat /proc/uptime error!\n");
PRINT_ERR("create /proc/uptime error!\n");
return;
}

View File

@@ -62,8 +62,9 @@ static struct ProcDirEntry g_procRootDirEntry = {
int ProcMatch(unsigned int len, const char *name, struct ProcDirEntry *pn)
{
if (len != pn->nameLen)
if (len != pn->nameLen) {
return 0;
}
return !strncmp(name, pn->name, len);
}
@@ -387,8 +388,9 @@ static void FreeProcEntry(struct ProcDirEntry *entry)
void ProcFreeEntry(struct ProcDirEntry *pn)
{
if (atomic_dec_and_test(&pn->count))
if (atomic_dec_and_test(&pn->count)) {
FreeProcEntry(pn);
}
}
static void RemoveProcEntryTravalsal(struct ProcDirEntry *pn)

View File

@@ -1,6 +1,6 @@
/*
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
* Copyright (c) 2020-2022 Huawei Device Co., Ltd. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
@@ -62,8 +62,8 @@ int OsShellCmdWriteProc(int argc, char **argv)
if (argc == WRITEPROC_ARGC) {
value = argv[0];
path = argv[2];
len = strlen(value) + 1; /* +1:add the \0 */
path = argv[2]; // 2: index of path
len = strlen(value) + 1; /* + 1:add the \0 */
if (strncmp(argv[1], ">>", strlen(">>")) == 0) {
if ((realpath(path, realPath) == NULL) || (strncmp(realPath, rootProcDir, strlen(rootProcDir)) != 0)) {
PRINT_ERR("No such file or directory\n");

View File

@@ -581,8 +581,8 @@ static OsBcacheBlock *AllocNewBlock(OsBcache *bc, BOOL read, UINT64 num)
DelBlock(bc, prefer);
}
if (prefer->used) {
MergeSyncBlocks(bc, prefer);
if (prefer->used) { /* do not combine with next check */
MergeSyncBlocks(bc, prefer); /* prefer->used may be changed here */
}
if (prefer->used) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021-2021 Huawei Device Co., Ltd. All rights reserved.
* Copyright (c) 2021-2022 Huawei Device Co., Ltd. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
@@ -304,7 +304,7 @@ int epoll_wait(int epfd, FAR struct epoll_event *evs, int maxevents, int timeout
int pollSize;
epHead = EpollGetDataBuff(epfd);
if (epHead== NULL) {
if (epHead == NULL) {
set_errno(EBADF);
return -1;
}

View File

@@ -138,7 +138,7 @@ typedef struct tagOsBcache {
* <li>The block number is automatically adjusted if position is greater than block size.</li>
* </ul>
*
* @retval #0 read succeded
* @retval #0 read succeeded
* @retval #INT32 read failed
*
* @par Dependency:
@@ -168,7 +168,7 @@ INT32 BlockCacheRead(OsBcache *bc,
* <li>The block number is automatically adjusted if position is greater than block size.</li>
* </ul>
*
* @retval #0 write succeded
* @retval #0 write succeeded
* @retval #INT32 write failed
*
* @par Dependency:
@@ -193,7 +193,7 @@ INT32 BlockCacheWrite(OsBcache *bc,
* <li>None.</li>
* </ul>
*
* @retval #0 sync succeded
* @retval #0 sync succeeded
* @retval #INT32 sync failed
*
* @par Dependency:
@@ -219,7 +219,7 @@ INT32 BlockCacheSync(OsBcache *bc);
* <li>None.</li>
* </ul>
*
* @retval #OsBcache * init succeded
* @retval #OsBcache * init succeeded
* @retval #NULL init failed
*
* @par Dependency:

View File

@@ -160,7 +160,7 @@ typedef int VfsHashCmp(struct Vnode *vnode, void *arg);
int VnodesInit(void);
int VnodeDevInit(void);
int VnodeAlloc(struct VnodeOps *vop, struct Vnode **vnode);
int VnodeAlloc(struct VnodeOps *vop, struct Vnode **newVnode);
int VnodeFree(struct Vnode *vnode);
int VnodeLookup(const char *path, struct Vnode **vnode, uint32_t flags);
int VnodeLookupFullpath(const char *fullpath, struct Vnode **vnode, uint32_t flags);

View File

@@ -1,6 +1,6 @@
/*
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
* Copyright (c) 2020-2022 Huawei Device Co., Ltd. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
@@ -225,7 +225,6 @@ static char *vfs_normalize_fullpath(const char *directory, const char *filename,
/* it's a absolute path, use it directly */
fullpath = strdup(filename); /* copy string */
if (fullpath == NULL) {
*pathname = NULL;
set_errno(ENOMEM);
@@ -258,11 +257,10 @@ int vfs_normalize_path(const char *directory, const char *filename, char **pathn
}
#ifdef VFS_USING_WORKDIR
if (directory == NULL)
{
if (directory == NULL) {
spin_lock_irqsave(&curr->files->workdir_lock, lock_flags);
directory = curr->files->workdir;
}
}
#else
if ((directory == NULL) && (filename[0] != '/')) {
PRINT_ERR("NO_WORKING_DIR\n");
@@ -275,20 +273,18 @@ int vfs_normalize_path(const char *directory, const char *filename, char **pathn
if ((filename[0] != '/') && (strlen(directory) + namelen + 2 > TEMP_PATH_MAX)) {
#ifdef VFS_USING_WORKDIR
if (dir_flags == TRUE)
{
if (dir_flags == TRUE) {
spin_unlock_irqrestore(&curr->files->workdir_lock, lock_flags);
}
}
#endif
return -ENAMETOOLONG;
}
fullpath = vfs_normalize_fullpath(directory, filename, pathname, namelen);
#ifdef VFS_USING_WORKDIR
if (dir_flags == TRUE)
{
if (dir_flags == TRUE) {
spin_unlock_irqrestore(&curr->files->workdir_lock, lock_flags);
}
}
#endif
if (fullpath == NULL) {
return -get_errno();
@@ -308,7 +304,7 @@ int vfs_normalize_path(const char *directory, const char *filename, char **pathn
int vfs_normalize_pathat(int dirfd, const char *filename, char **pathname)
{
/* Get path by dirfd*/
/* Get path by dirfd */
char *relativeoldpath = NULL;
char *fullpath = NULL;
int ret = 0;

View File

@@ -353,7 +353,7 @@ static struct file_operations_vfs g_errorFileOps = {
.unlink = ErrorFopUnlink,
};
static struct Mount* GetDevMountPoint(struct Vnode *dev)
static struct Mount* GetDevMountPoint(const struct Vnode *dev)
{
struct Mount *mnt = NULL;
LIST_HEAD *mntList = GetMountList();
@@ -394,7 +394,7 @@ static void FilePreClose(struct file *filep, const struct file_operations_vfs *o
}
}
static void FileDisableAndClean(struct Mount *mnt)
static void FileDisableAndClean(const struct Mount *mnt)
{
struct filelist *flist = &tg_filelist;
struct file *filep = NULL;
@@ -435,7 +435,7 @@ static void VnodeTryFree(struct Vnode *vnode)
vnode->fop = &g_errorFileOps;
}
static void VnodeTryFreeAll(struct Mount *mount)
static void VnodeTryFreeAll(const struct Mount *mount)
{
struct Vnode *vnode = NULL;
struct Vnode *nextVnode = NULL;

View File

@@ -1,6 +1,6 @@
/*
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
* Copyright (c) 2020-2022 Huawei Device Co., Ltd. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
@@ -132,19 +132,19 @@ int VfsPermissionCheck(uint fuid, uint fgid, uint fileMode, int accMode)
#ifdef VFS_USING_WORKDIR
static int SetWorkDir(const char *dir, size_t len)
{
errno_t ret;
uint lock_flags;
LosProcessCB *curr = OsCurrProcessGet();
errno_t ret;
uint lock_flags;
LosProcessCB *curr = OsCurrProcessGet();
spin_lock_irqsave(&curr->files->workdir_lock, lock_flags);
ret = strncpy_s(curr->files->workdir, PATH_MAX, dir, len);
curr->files->workdir[PATH_MAX - 1] = '\0';
spin_unlock_irqrestore(&curr->files->workdir_lock, lock_flags);
if (ret != EOK) {
return -1;
}
spin_lock_irqsave(&curr->files->workdir_lock, lock_flags);
ret = strncpy_s(curr->files->workdir, PATH_MAX, dir, len);
curr->files->workdir[PATH_MAX - 1] = '\0';
spin_unlock_irqrestore(&curr->files->workdir_lock, lock_flags);
if (ret != EOK) {
return -1;
}
return 0;
return 0;
}
#endif
@@ -155,7 +155,6 @@ int chdir(const char *path)
char *fullpath_bak = NULL;
struct stat statBuff;
if (!path) {
set_errno(EFAULT);
return -1;

View File

@@ -1,6 +1,6 @@
/*
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
* Copyright (c) 2020-2022 Huawei Device Co., Ltd. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
@@ -57,7 +57,6 @@ int utime(const char *path, const struct utimbuf *ptimes)
/* Sanity checks */
if (path == NULL) {
ret = -EINVAL;
goto errout;

View File

@@ -66,7 +66,6 @@ static int iov_trans_to_buf(char *buf, ssize_t totallen, const struct iovec *iov
} else {
writepart = bytestowrite - ret;
curbuf += writepart;
totallen -= writepart;
break;
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021-2021 Huawei Device Co., Ltd. All rights reserved.
* Copyright (c) 2021-2022 Huawei Device Co., Ltd. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
@@ -239,7 +239,7 @@ BOOL VnodeInUseIter(const struct Mount *mount)
return FALSE;
}
int VnodeHold()
int VnodeHold(void)
{
int ret = LOS_MuxLock(&g_vnodeMux, LOS_WAIT_FOREVER);
if (ret != LOS_OK) {
@@ -248,7 +248,7 @@ int VnodeHold()
return ret;
}
int VnodeDrop()
int VnodeDrop(void)
{
int ret = LOS_MuxUnlock(&g_vnodeMux);
if (ret != LOS_OK) {
@@ -583,7 +583,7 @@ int VnodeCreate(struct Vnode *parent, const char *name, int mode, struct Vnode *
return 0;
}
int VnodeDevInit()
int VnodeDevInit(void)
{
struct Vnode *devNode = NULL;
struct Mount *devMount = NULL;
@@ -616,7 +616,7 @@ int VnodeGetattr(struct Vnode *vnode, struct stat *buf)
return LOS_OK;
}
struct Vnode *VnodeGetRoot()
struct Vnode *VnodeGetRoot(void)
{
return g_rootVnode;
}
@@ -697,7 +697,7 @@ LIST_HEAD* GetVnodeActiveList()
return &g_vnodeActiveList;
}
int VnodeClearCache()
int VnodeClearCache(void)
{
struct Vnode *item = NULL;
struct Vnode *nextItem = NULL;

View File

@@ -90,8 +90,13 @@ kernel_module(module_name) {
}
public_configs = [ ":public" ]
configs += [ ":private" ]
}
config("public") {
include_dirs = [ "include" ]
}
config("private") {
cflags = [ "-Wno-frame-address" ]
}

View File

@@ -28,7 +28,7 @@
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
include $(LITEOSTOPDIR)/config.mk
include $(LITEOSTOPDIR)/../../drivers/adapter/khdf/liteos/lite.mk
include $(LITEOSTOPDIR)/../../drivers/hdf_core/adapter/khdf/liteos/lite.mk
MODULE_NAME := $(notdir $(shell pwd))
@@ -40,6 +40,6 @@ LOCAL_SRCS := $(wildcard ipc/*.c) $(wildcard core/*.c) $(wildcard mem/membox/*.
$(wildcard sched/*.c) \
$(wildcard vm/*.c)
LOCAL_FLAGS := $(LITEOS_CFLAGS_INTERWORK)
LOCAL_FLAGS := $(LITEOS_CFLAGS_INTERWORK) -Wno-frame-address
include $(MODULE)

View File

@@ -583,7 +583,7 @@ STATIC INLINE BOOL SwtmrRunqueueFind(SortLinkAttribute *swtmrSortLink, SCHED_TL_
STATIC BOOL SwtmrTimeListFind(SCHED_TL_FIND_FUNC checkFunc, UINTPTR arg)
{
for (UINT16 cpuid = 0; cpuid < LOSCFG_KERNEL_CORE_NUM; cpuid++) {
SortLinkAttribute *swtmrSortLink = &g_swtmrRunqueue[ArchCurrCpuid()].swtmrSortLink;
SortLinkAttribute *swtmrSortLink = &g_swtmrRunqueue[cpuid].swtmrSortLink;
if (SwtmrRunqueueFind(swtmrSortLink, checkFunc, arg)) {
return TRUE;
}

View File

@@ -226,6 +226,9 @@ LITE_OS_SEC_TEXT_INIT UINT32 OsIdleTaskCreate(VOID)
taskInitParam.usCpuAffiMask = CPUID_TO_AFFI_MASK(ArchCurrCpuid());
#endif
ret = LOS_TaskCreateOnly(&idleTaskID, &taskInitParam);
if (ret != LOS_OK) {
return ret;
}
LosTaskCB *idleTask = OS_TCB_FROM_TID(idleTaskID);
idleTask->taskStatus |= OS_TASK_FLAG_SYSTEM_TASK;
OsSchedRunqueueIdleInit(idleTaskID);

View File

@@ -41,7 +41,9 @@
#endif
#include "los_stackinfo_pri.h"
#include "los_futex_pri.h"
#ifdef LOSCFG_KERNEL_PM
#include "los_pm_pri.h"
#endif
#include "los_signal.h"
#ifdef LOSCFG_KERNEL_CPUP
#include "los_cpup_pri.h"
@@ -555,9 +557,11 @@ STATIC INLINE VOID SchedTaskFreeze(LosTaskCB *taskCB)
{
UINT64 responseTime;
#ifdef LOSCFG_KERNEL_PM
if (!OsIsPmMode()) {
return;
}
#endif
if (!(taskCB->taskStatus & (OS_TASK_STATUS_PEND_TIME | OS_TASK_STATUS_DELAY))) {
return;

View File

@@ -61,11 +61,11 @@ STATIC INLINE VOID OsSemDbgTimeUpdateHook(UINT32 semID)
return;
}
/* Update the SEM_DEBUG_CB of the semaphore when created or deleted */
extern VOID OsSemDbgUpdate(UINT32 semID, TSK_ENTRY_FUNC creater, UINT16 count);
STATIC INLINE VOID OsSemDbgUpdateHook(UINT32 semID, TSK_ENTRY_FUNC creater, UINT16 count)
extern VOID OsSemDbgUpdate(UINT32 semID, TSK_ENTRY_FUNC creator, UINT16 count);
STATIC INLINE VOID OsSemDbgUpdateHook(UINT32 semID, TSK_ENTRY_FUNC creator, UINT16 count)
{
#ifdef LOSCFG_DEBUG_SEMAPHORE
OsSemDbgUpdate(semID, creater, count);
OsSemDbgUpdate(semID, creator, count);
#endif
return;
}

View File

@@ -70,7 +70,7 @@ VOID OsVmPhysDump(VOID);
VOID OsVmPhysUsedInfoGet(UINT32 *usedCount, UINT32 *totalCount);
INT32 OsRegionOverlapCheck(LosVmSpace *space, LosVmMapRegion *region);
VOID OsDumpPte(VADDR_T vaddr);
LosProcessCB *OsGetPIDByAspace(LosVmSpace *space);
LosProcessCB *OsGetPIDByAspace(const LosVmSpace *space);
CHAR *OsArchFlagsToStr(const UINT32 archFlags);
#ifdef __cplusplus

View File

@@ -193,7 +193,7 @@ VOID OsVmmFileRegionFree(struct file *filep, LosProcessCB *processCB);
LosFilePage *OsPageCacheAlloc(struct page_mapping *mapping, VM_OFFSET_T pgoff);
LosFilePage *OsFindGetEntry(struct page_mapping *mapping, VM_OFFSET_T pgoff);
LosMapInfo *OsGetMapInfo(LosFilePage *page, LosArchMmu *archMmu, VADDR_T vaddr);
LosMapInfo *OsGetMapInfo(const LosFilePage *page, const LosArchMmu *archMmu, VADDR_T vaddr);
VOID OsAddMapInfo(LosFilePage *page, LosArchMmu *archMmu, VADDR_T vaddr);
VOID OsDelMapInfo(LosVmMapRegion *region, LosVmPgFault *pgFault, BOOL cleanDirty);
VOID OsFileCacheFlush(struct page_mapping *mapping);
@@ -208,7 +208,7 @@ VOID OsDeletePageCacheLru(LosFilePage *page);
VOID OsPageRefDecNoLock(LosFilePage *page);
VOID OsPageRefIncLocked(LosFilePage *page);
int OsTryShrinkMemory(size_t nPage);
VOID OsMarkPageDirty(LosFilePage *fpage, LosVmMapRegion *region, int off, int len);
VOID OsMarkPageDirty(LosFilePage *fpage, const LosVmMapRegion *region, int off, int len);
#ifdef LOSCFG_DEBUG_VERSION
VOID ResetPageCacheHitInfo(int *try, int *hit);

View File

@@ -40,7 +40,7 @@
#ifdef LOSCFG_DEBUG_QUEUE
typedef struct {
TSK_ENTRY_FUNC creater; /* The task entry who created this queue */
TSK_ENTRY_FUNC creator; /* The task entry who created this queue */
UINT64 lastAccessTime; /* The last access time */
} QueueDebugCB;
STATIC QueueDebugCB *g_queueDebugArray = NULL;
@@ -74,7 +74,7 @@ VOID OsQueueDbgTimeUpdate(UINT32 queueID)
VOID OsQueueDbgUpdate(UINT32 queueID, TSK_ENTRY_FUNC entry)
{
QueueDebugCB *queueDebug = &g_queueDebugArray[GET_QUEUE_INDEX(queueID)];
queueDebug->creater = entry;
queueDebug->creator = entry;
queueDebug->lastAccessTime = LOS_TickCountGet();
return;
}
@@ -91,8 +91,8 @@ STATIC INLINE VOID OsQueueInfoOutPut(const LosQueueCB *node)
STATIC INLINE VOID OsQueueOpsOutput(const QueueDebugCB *node)
{
PRINTK("TaskEntry of creater:0x%p, Latest operation time: 0x%llx\n",
node->creater, node->lastAccessTime);
PRINTK("TaskEntry of creator:0x%p, Latest operation time: 0x%llx\n",
node->creator, node->lastAccessTime);
}
STATIC VOID SortQueueIndexArray(UINT32 *indexArray, UINT32 count)
@@ -149,7 +149,7 @@ VOID OsQueueCheck(VOID)
&g_queueDebugArray[index], sizeof(QueueDebugCB));
SCHEDULER_UNLOCK(intSave);
if ((queueNode.queueState == OS_QUEUE_UNUSED) ||
((queueNode.queueState == OS_QUEUE_INUSED) && (queueDebugNode.creater == NULL))) {
((queueNode.queueState == OS_QUEUE_INUSED) && (queueDebugNode.creator == NULL))) {
continue;
}
if ((queueNode.queueState == OS_QUEUE_INUSED) &&

View File

@@ -96,7 +96,7 @@ UINT32 LOS_RwlockDestroy(LosRwlock *rwlock)
return LOS_OK;
}
STATIC UINT32 OsRwlockCheck(LosRwlock *rwlock)
STATIC UINT32 OsRwlockCheck(const LosRwlock *rwlock)
{
if (rwlock == NULL) {
return LOS_EINVAL;

View File

@@ -80,7 +80,7 @@ STATIC VOID OsSemPendedTaskNamePrint(LosSemCB *semNode)
typedef struct {
UINT16 origSemCount; /* Number of original available semaphores */
UINT64 lastAccessTime; /* The last operation time */
TSK_ENTRY_FUNC creater; /* The task entry who created this sem */
TSK_ENTRY_FUNC creator; /* The task entry who created this sem */
} SemDebugCB;
STATIC SemDebugCB *g_semDebugArray = NULL;
@@ -110,10 +110,10 @@ VOID OsSemDbgTimeUpdate(UINT32 semID)
return;
}
VOID OsSemDbgUpdate(UINT32 semID, TSK_ENTRY_FUNC creater, UINT16 count)
VOID OsSemDbgUpdate(UINT32 semID, TSK_ENTRY_FUNC creator, UINT16 count)
{
SemDebugCB *semDebug = &g_semDebugArray[GET_SEM_INDEX(semID)];
semDebug->creater = creater;
semDebug->creator = creator;
semDebug->lastAccessTime = LOS_TickCountGet();
semDebug->origSemCount = count;
return;
@@ -133,7 +133,7 @@ STATIC VOID OsSemSort(UINT32 *semIndexArray, UINT32 usedCount)
/* It will Print out ALL the Used Semaphore List. */
PRINTK("Used Semaphore List: \n");
PRINTK("\r\n SemID Count OriginalCount Creater(TaskEntry) LastAccessTime\n");
PRINTK("\r\n SemID Count OriginalCount Creator(TaskEntry) LastAccessTime\n");
PRINTK(" ------ ------ ------------- ------------------ -------------- \n");
SCHEDULER_LOCK(intSave);
@@ -145,11 +145,11 @@ STATIC VOID OsSemSort(UINT32 *semIndexArray, UINT32 usedCount)
(VOID)memcpy_s(&semNode, sizeof(LosSemCB), semCB, sizeof(LosSemCB));
(VOID)memcpy_s(&semDebug, sizeof(SemDebugCB), &g_semDebugArray[semIndexArray[i]], sizeof(SemDebugCB));
SCHEDULER_UNLOCK(intSave);
if ((semNode.semStat != OS_SEM_USED) || (semDebug.creater == NULL)) {
if ((semNode.semStat != OS_SEM_USED) || (semDebug.creator == NULL)) {
continue;
}
PRINTK(" 0x%-07x0x%-07u0x%-14u%-22p0x%llx\n", semNode.semID, semDebug.origSemCount,
semNode.semCount, semDebug.creater, semDebug.lastAccessTime);
semNode.semCount, semDebug.creator, semDebug.lastAccessTime);
if (!LOS_ListEmpty(&semNode.semList)) {
OsSemPendedTaskNamePrint(semCB);
}
@@ -170,7 +170,7 @@ UINT32 OsSemInfoGetFullData(VOID)
for (i = 0; i < LOSCFG_BASE_IPC_SEM_LIMIT; i++) {
semNode = GET_SEM(i);
semDebug = &g_semDebugArray[i];
if ((semNode->semStat == OS_SEM_USED) && (semDebug->creater != NULL)) {
if ((semNode->semStat == OS_SEM_USED) && (semDebug->creator != NULL)) {
usedSemCnt++;
}
}
@@ -190,7 +190,7 @@ UINT32 OsSemInfoGetFullData(VOID)
for (i = 0; i < LOSCFG_BASE_IPC_SEM_LIMIT; i++) {
semNode = GET_SEM(i);
semDebug = &g_semDebugArray[i];
if ((semNode->semStat != OS_SEM_USED) || (semDebug->creater == NULL)) {
if ((semNode->semStat != OS_SEM_USED) || (semDebug->creator == NULL)) {
continue;
}
*(semIndexArray + count) = i;

View File

@@ -78,7 +78,6 @@ STATIC VOID OsMoveTmpInfoToUnbInfo(sig_cb *sigcb, INT32 signo)
/* delete tmpinfo from tmpList. */
*prevHook = tmpInfoNode->next;
(VOID)LOS_MemFree(m_aucSysMem0, tmpInfoNode);
tmpInfoNode = *prevHook;
break;
}
prevHook = &tmpInfoNode->next;
@@ -284,7 +283,7 @@ static int SigProcessSignalHandler(LosTaskCB *tcb, void *arg)
return 0;
}
/* If the default tcb is not setted, then set this one as default. */
/* If the default tcb is not set, then set this one as default. */
if (!info->defaultTcb) {
info->defaultTcb = tcb;
}
@@ -305,7 +304,7 @@ static int SigProcessSignalHandler(LosTaskCB *tcb, void *arg)
/* Is this signal unblocked on this thread? */
isMember = OsSigIsMember(&tcb->sig.sigprocmask, info->sigInfo->si_signo);
if ((!isMember) && (!info->receivedTcb) && (tcb != info->awakenedTcb)) {
/* if unblockedTcb of this signal is not setted, then set it. */
/* if unblockedTcb of this signal is not set, then set it. */
if (!info->unblockedTcb) {
info->unblockedTcb = tcb;
}

View File

@@ -498,7 +498,7 @@ STATIC INLINE VOID OsLmsReallocMergeNodeMark(struct OsMemNodeHead *node)
}
g_lms->simpleMark((UINTPTR)node + OS_MEM_NODE_HEAD_SIZE, (UINTPTR)OS_MEM_NEXT_NODE(node),
LMS_SHADOW_ACCESSABLE_U8);
LMS_SHADOW_ACCESSIBLE_U8);
}
STATIC INLINE VOID OsLmsReallocSplitNodeMark(struct OsMemNodeHead *node)
@@ -918,7 +918,7 @@ STATIC UINT32 OsMemPoolAdd(VOID *pool, UINT32 size)
return LOS_OK;
}
STATIC UINT32 OsMemPoolDelete(VOID *pool)
STATIC UINT32 OsMemPoolDelete(const VOID *pool)
{
UINT32 ret = LOS_NOK;
VOID *nextPool = NULL;

View File

@@ -190,11 +190,7 @@ VOID OsLockDepCheckIn(SPIN_LOCK_S *lock)
{
UINT32 intSave;
enum LockDepErrType checkResult = LOCKDEP_SUCCESS;
#ifdef LOSCFG_COMPILER_CLANG_LLVM
VOID *requestAddr = (VOID *)__builtin_return_address(1);
#else
VOID *requestAddr = (VOID *)__builtin_return_address(0);
#endif
LosTaskCB *current = OsCurrTaskGet();
LockDep *lockDep = &current->lockDep;
LosTaskCB *lockOwner = NULL;
@@ -275,12 +271,8 @@ VOID OsLockDepCheckOut(SPIN_LOCK_S *lock)
{
UINT32 intSave;
INT32 depth;
enum LockDepErrType checkResult = LOCKDEP_SUCCESS;
#ifdef LOSCFG_COMPILER_CLANG_LLVM
enum LockDepErrType checkResult;
VOID *requestAddr = (VOID *)__builtin_return_address(1);
#else
VOID *requestAddr = (VOID *)__builtin_return_address(0);
#endif
LosTaskCB *current = OsCurrTaskGet();
LosTaskCB *owner = NULL;
LockDep *lockDep = NULL;

View File

@@ -146,7 +146,6 @@ UINT32 OsKProcessPmUsage(LosVmSpace *kSpace, UINT32 *actualPm)
LosVmSpace *space = NULL;
LOS_DL_LIST *spaceList = NULL;
UINT32 UProcessUsed = 0;
UINT32 pmTmp;
if (actualPm == NULL) {
return 0;
@@ -167,8 +166,7 @@ UINT32 OsKProcessPmUsage(LosVmSpace *kSpace, UINT32 *actualPm)
if (space == LOS_GetKVmSpace()) {
continue;
}
(VOID)OsUProcessPmUsage(space, NULL, &pmTmp);
UProcessUsed += pmTmp;
UProcessUsed += OsUProcessPmUsage(space, NULL, NULL);
}
(VOID)LOS_MuxRelease(vmSpaceListMux);
@@ -208,15 +206,12 @@ UINT32 OsUProcessPmUsage(LosVmSpace *space, UINT32 *sharePm, UINT32 *actualPm)
PADDR_T paddr;
STATUS_T ret;
INT32 shareRef;
UINT32 pmSize = 0;
if (sharePm != NULL) {
*sharePm = 0;
}
if (actualPm != NULL) {
*actualPm = 0;
}
ret = LOS_MuxAcquire(&space->regionMux);
if (ret != 0) {
return 0;
@@ -240,22 +235,23 @@ UINT32 OsUProcessPmUsage(LosVmSpace *space, UINT32 *sharePm, UINT32 *actualPm)
if (sharePm != NULL) {
*sharePm += PAGE_SIZE;
}
if (actualPm != NULL) {
*actualPm += PAGE_SIZE / shareRef;
}
pmSize += PAGE_SIZE / shareRef;
} else {
if (actualPm != NULL) {
*actualPm += PAGE_SIZE;
}
pmSize += PAGE_SIZE;
}
}
RB_SCAN_SAFE_END(&oldVmSpace->regionRbTree, pstRbNode, pstRbNodeNext)
(VOID)LOS_MuxRelease(&space->regionMux);
return *actualPm;
if (actualPm != NULL) {
*actualPm = pmSize;
}
return pmSize;
}
LosProcessCB *OsGetPIDByAspace(LosVmSpace *space)
LosProcessCB *OsGetPIDByAspace(const LosVmSpace *space)
{
UINT32 pid;
UINT32 intSave;
@@ -305,7 +301,7 @@ UINT32 OsCountRegionPages(LosVmSpace *space, LosVmMapRegion *region, UINT32 *pss
}
if (pssPages != NULL) {
*pssPages = (UINT32)(pss + 0.5);
*pssPages = (UINT32)(pss + 0.5); /* 0.5, for page alignment */
}
return regionPages;

View File

@@ -125,10 +125,10 @@ VOID OsAddMapInfo(LosFilePage *page, LosArchMmu *archMmu, VADDR_T vaddr)
page->n_maps++;
}
LosMapInfo *OsGetMapInfo(LosFilePage *page, LosArchMmu *archMmu, VADDR_T vaddr)
LosMapInfo *OsGetMapInfo(const LosFilePage *page, const LosArchMmu *archMmu, VADDR_T vaddr)
{
LosMapInfo *info = NULL;
LOS_DL_LIST *immap = &page->i_mmap;
const LOS_DL_LIST *immap = &page->i_mmap;
LOS_DL_LIST_FOR_EACH_ENTRY(info, immap, LosMapInfo, node) {
if ((info->archMmu == archMmu) && (info->vaddr == vaddr) && (info->page == page)) {
@@ -214,7 +214,7 @@ VOID OsVmmFileRemove(LosVmMapRegion *region, LosArchMmu *archMmu, VM_OFFSET_T pg
return;
}
VOID OsMarkPageDirty(LosFilePage *fpage, LosVmMapRegion *region, INT32 off, INT32 len)
VOID OsMarkPageDirty(LosFilePage *fpage, const LosVmMapRegion *region, INT32 off, INT32 len)
{
if (region != NULL) {
OsSetPageDirty(fpage->vmPage);

View File

@@ -233,7 +233,7 @@ LosVmSpace *OsCreateUserVmSpace(VOID)
return space;
}
STATIC BOOL OsVmSpaceParamCheck(LosVmSpace *vmSpace)
STATIC BOOL OsVmSpaceParamCheck(const LosVmSpace *vmSpace)
{
if (vmSpace == NULL) {
return FALSE;

View File

@@ -297,7 +297,7 @@ int OsTryShrinkMemory(size_t nPage)
LosFilePage *fpage = NULL;
LosFilePage *fnext = NULL;
if (nPage <= 0) {
if (nPage == 0) {
nPage = VM_FILEMAP_MIN_SCAN;
}

View File

@@ -166,7 +166,7 @@ MMAP_DONE:
STATUS_T LOS_UnMMap(VADDR_T addr, size_t size)
{
if ((addr <= 0) || (size <= 0)) {
if ((addr <= 0) || (size == 0)) {
return -EINVAL;
}

View File

@@ -404,7 +404,7 @@ STATIC VOID EchoToTerminal(CONSOLE_CB *consoleCB, struct file *filep, const stru
{
if (consoleCB->consoleTermios.c_lflag & ECHO) {
if (ch == '\b') {
(VOID)fops->write(filep, "\b \b", 3);
(VOID)fops->write(filep, "\b \b", 3); // 3: length of "\b \b"
} else {
(VOID)fops->write(filep, &ch, EACH_CHAR);
}
@@ -709,7 +709,6 @@ STATIC ssize_t DoWrite(CirBufSendCB *cirBufSendCB, CHAR *buffer, size_t bufLen)
{
INT32 cnt;
size_t written = 0;
size_t toWrite = bufLen;
UINT32 intSave;
#ifdef LOSCFG_SHELL_DMESG
@@ -730,7 +729,6 @@ STATIC ssize_t DoWrite(CirBufSendCB *cirBufSendCB, CHAR *buffer, size_t bufLen)
if (cnt <= 0) {
break;
}
toWrite -= cnt;
written += cnt;
}
LOS_SpinUnlockRestore(&g_consoleWriteSpinLock, intSave);
@@ -1238,7 +1236,7 @@ STATIC CONSOLE_CB *OsConsoleCreate(UINT32 consoleID, const CHAR *deviceName)
ret = (INT32)LOS_SemCreate(1, &consoleCB->consoleSem);
if (ret != LOS_OK) {
PRINT_ERR("creat sem for uart failed\n");
PRINT_ERR("create sem for uart failed\n");
goto ERR_WITH_BUF;
}
@@ -1536,7 +1534,15 @@ STATIC ssize_t WriteToTerminal(const CONSOLE_CB *consoleCB, const CHAR *buffer,
fd = consoleCB->fd;
ret = fs_getfilep(fd, &filep);
if (ret < 0) {
ret = -EPERM;
goto ERROUT;
}
ret = GetFilepOps(filep, &privFilep, &fileOps);
if (ret != ENOERR) {
ret = -EINVAL;
goto ERROUT;
}
if ((fileOps == NULL) || (fileOps->write == NULL)) {
ret = EFAULT;

View File

@@ -87,7 +87,6 @@ STATIC VOID InitLevelCall(const CHAR *name, const UINT32 level, struct ModuleIni
LOS_SpinUnlock(&g_initLock);
if (module->hook != NULL) {
#ifdef LOS_INIT_DEBUG
ret = LOS_OK;
startNsec = LOS_CurrNanosec();
ret = (UINT32)module->hook();
endNsec = LOS_CurrNanosec();

View File

@@ -198,6 +198,7 @@ __attribute__((noinline)) VOID UartPrintf(const CHAR *fmt, ...)
va_end(ap);
}
#ifndef LOSCFG_LIBC_NEWLIB
__attribute__((noinline)) VOID dprintf(const CHAR *fmt, ...)
{
va_list ap;
@@ -210,6 +211,7 @@ __attribute__((noinline)) VOID dprintf(const CHAR *fmt, ...)
#endif
va_end(ap);
}
#endif
VOID LkDprintf(const CHAR *fmt, va_list ap)
{
@@ -279,7 +281,7 @@ VOID LOS_LkPrint(INT32 level, const CHAR *func, INT32 line, const CHAR *fmt, ...
}
if ((level != LOS_COMMON_LEVEL) && ((level > LOS_EMG_LEVEL) && (level <= LOS_TRACE_LEVEL))) {
dprintf("[%s][%s:%s]", g_logString[level],
PRINTK("[%s][%s:%s]", g_logString[level],
((OsCurrProcessGet() == NULL) ? "NULL" : OsCurrProcessGet()->processName),
((OsCurrTaskGet() == NULL) ? "NULL" : OsCurrTaskGet()->taskName));
}

View File

@@ -51,7 +51,7 @@ STATIC BOOL g_srandInit;
STATIC INT32 OsELFOpen(const CHAR *fileName, INT32 oflags)
{
INT32 ret = -LOS_NOK;
INT32 ret;
INT32 procFd;
procFd = AllocProcessFd();

View File

@@ -179,7 +179,7 @@ static ssize_t HiLogRead(struct file *filep, char *buffer, size_t bufLen)
}
if (bufLen < header.len + sizeof(header)) {
dprintf("buffer too small,bufLen=%d, header.len=%d,%d\n", bufLen, header.len, header.hdrSize);
PRINTK("buffer too small,bufLen=%d, header.len=%d,%d\n", bufLen, header.len, header.hdrSize);
retval = -ENOMEM;
goto out;
}
@@ -233,14 +233,8 @@ static int HiLogWriteRingBuffer(unsigned char *buffer, size_t bufLen)
static void HiLogHeadInit(struct HiLogEntry *header, size_t len)
{
struct timespec now;
int ret;
ret = clock_gettime(CLOCK_REALTIME, &now);
if (ret != 0) {
dprintf("In %s line %d,clock_gettime fail\n", __FUNCTION__, __LINE__);
return;
}
struct timespec now = {0};
(void)clock_gettime(CLOCK_REALTIME, &now);
header->len = len;
header->pid = LOS_GetCurrProcessID();
@@ -274,7 +268,7 @@ static void HiLogCoverOldLog(size_t bufLen)
if (isLastTimeFull == 1 && isThisTimeFull == 0) {
/* so we can only print one log if hilog ring buffer is full in a short time */
if (dropLogLines > 0) {
dprintf("hilog ringbuffer full, drop %d line(s) log\n", dropLogLines);
PRINTK("hilog ringbuffer full, drop %d line(s) log\n", dropLogLines);
}
isLastTimeFull = 0;
dropLogLines = 0;
@@ -319,7 +313,7 @@ out:
wake_up_interruptible(&g_hiLogDev.wq);
}
if (retval < 0) {
dprintf("write fail retval=%d\n", retval);
PRINTK("write fail retval=%d\n", retval);
}
return retval;
}
@@ -328,7 +322,7 @@ static ssize_t HiLogWrite(struct file *filep, const char *buffer, size_t bufLen)
{
(void)filep;
if (bufLen + sizeof(struct HiLogEntry) > HILOG_BUFFER) {
dprintf("input too large\n");
PRINTK("input too large\n");
return -ENOMEM;
}
@@ -339,7 +333,7 @@ static void HiLogDeviceInit(void)
{
g_hiLogDev.buffer = LOS_MemAlloc((VOID *)OS_SYS_MEM_ADDR, HILOG_BUFFER);
if (g_hiLogDev.buffer == NULL) {
dprintf("In %s line %d,LOS_MemAlloc fail\n", __FUNCTION__, __LINE__);
PRINTK("In %s line %d,LOS_MemAlloc fail\n", __FUNCTION__, __LINE__);
}
init_waitqueue_head(&g_hiLogDev.wq);

View File

@@ -1026,7 +1026,7 @@ LITE_OS_SEC_TEXT STATIC UINT32 CheckPara(IpcContent *content, UINT32 *dstTid)
#endif
break;
default:
PRINT_DEBUG("Unknow msg type:%d\n", msg->type);
PRINT_DEBUG("Unknown msg type:%d\n", msg->type);
return -EINVAL;
}
@@ -1118,13 +1118,13 @@ LITE_OS_SEC_TEXT STATIC UINT32 CheckRecievedMsg(IpcListNode *node, IpcContent *c
}
#if (USE_TIMESTAMP == 1)
if (node->msg.timestamp != content->outMsg->timestamp) {
PRINT_ERR("Recieve a unmatch reply, drop it\n");
PRINT_ERR("Receive a unmatch reply, drop it\n");
ret = -EINVAL;
}
#else
if ((node->msg.code != content->outMsg->code) ||
(node->msg.target.token != content->outMsg->target.token)) {
PRINT_ERR("Recieve a unmatch reply, drop it\n");
PRINT_ERR("Receive a unmatch reply, drop it\n");
ret = -EINVAL;
}
#endif
@@ -1132,7 +1132,7 @@ LITE_OS_SEC_TEXT STATIC UINT32 CheckRecievedMsg(IpcListNode *node, IpcContent *c
case MT_DEATH_NOTIFY:
break;
default:
PRINT_ERR("Unknow msg type:%d\n", node->msg.type);
PRINT_ERR("Unknown msg type:%d\n", node->msg.type);
ret = -EINVAL;
}
if (ret != LOS_OK) {
@@ -1310,7 +1310,7 @@ LITE_OS_SEC_TEXT STATIC UINT32 HandleCmsCmd(CmsCmdContent *content)
}
return AddServiceAccess(localContent.taskID, localContent.serviceHandle);
default:
PRINT_DEBUG("Unknow cmd cmd:%d\n", localContent.cmd);
PRINT_DEBUG("Unknown cmd cmd:%d\n", localContent.cmd);
return -EINVAL;
}
return ret;
@@ -1375,7 +1375,7 @@ LITE_OS_SEC_TEXT int LiteIpcIoctl(struct file *filep, int cmd, unsigned long arg
}
break;
default:
PRINT_ERR("Unknow liteipc ioctl cmd:%d\n", cmd);
PRINT_ERR("Unknown liteipc ioctl cmd:%d\n", cmd);
return -EINVAL;
}
return (INT32)ret;

View File

@@ -326,7 +326,7 @@ VOID OsLmsLosMallocMark(const VOID *curNodeStart, const VOID *nextNodeStart, UIN
}
OsLmsSetShadowValue(node, curNodeStartAddr, curNodeStartAddr + nodeHeadSize, LMS_SHADOW_REDZONE_U8);
OsLmsSetShadowValue(node, curNodeStartAddr + nodeHeadSize, nextNodeStartAddr, LMS_SHADOW_ACCESSABLE_U8);
OsLmsSetShadowValue(node, curNodeStartAddr + nodeHeadSize, nextNodeStartAddr, LMS_SHADOW_ACCESSIBLE_U8);
OsLmsSetShadowValue(node, nextNodeStartAddr, nextNodeStartAddr + nodeHeadSize, LMS_SHADOW_REDZONE_U8);
LMS_UNLOCK(intSave);
}
@@ -344,7 +344,7 @@ VOID OsLmsCheckValid(UINTPTR checkAddr, BOOL isFreeCheck)
OsLmsGetShadowValue(node, checkAddr, &shadowValue);
LMS_UNLOCK(intSave);
if ((shadowValue == LMS_SHADOW_ACCESSABLE) || ((isFreeCheck) && (shadowValue == LMS_SHADOW_PAINT))) {
if ((shadowValue == LMS_SHADOW_ACCESSIBLE) || ((isFreeCheck) && (shadowValue == LMS_SHADOW_PAINT))) {
return;
}
@@ -367,7 +367,7 @@ VOID OsLmsLosFreeMark(const VOID *curNodeStart, const VOID *nextNodeStart, UINT3
UINTPTR nextNodeStartAddr = (UINTPTR)nextNodeStart;
OsLmsGetShadowValue(node, curNodeStartAddr + nodeHeadSize, &shadowValue);
if ((shadowValue != LMS_SHADOW_ACCESSABLE) && (shadowValue != LMS_SHADOW_PAINT)) {
if ((shadowValue != LMS_SHADOW_ACCESSIBLE) && (shadowValue != LMS_SHADOW_PAINT)) {
LMS_UNLOCK(intSave);
OsLmsReportError(curNodeStartAddr + nodeHeadSize, MEM_REGION_SIZE_1, FREE_ERRORMODE);
return;
@@ -408,7 +408,7 @@ VOID LOS_LmsAddrDisableProtect(UINTPTR addrStart, UINTPTR addrEnd)
LMS_LOCK(intSave);
LmsMemListNode *node = OsLmsGetPoolNodeFromAddr(addrStart);
if (node != NULL) {
OsLmsSetShadowValue(node, addrStart, addrEnd, LMS_SHADOW_ACCESSABLE_U8);
OsLmsSetShadowValue(node, addrStart, addrEnd, LMS_SHADOW_ACCESSIBLE_U8);
}
LMS_UNLOCK(intSave);
}
@@ -426,7 +426,7 @@ STATIC UINT32 OsLmsCheckAddr(UINTPTR addr)
LmsMemListNode *node = OsLmsGetPoolNodeFromAddr(addr);
if (node == NULL) {
LMS_UNLOCK(intSave);
return LMS_SHADOW_ACCESSABLE_U8;
return LMS_SHADOW_ACCESSIBLE_U8;
}
OsLmsGetShadowValue(node, addr, &shadowValue);
@@ -542,7 +542,7 @@ STATIC VOID OsLmsGetErrorInfo(UINTPTR addr, UINT32 size, LmsAddrInfo *info)
{
LmsMemListNode *node = OsLmsGetPoolNodeFromAddr(addr);
OsLmsGetShadowInfo(node, addr, info);
if (info->shadowValue != LMS_SHADOW_ACCESSABLE_U8) {
if (info->shadowValue != LMS_SHADOW_ACCESSIBLE_U8) {
return;
} else {
OsLmsGetShadowInfo(node, addr + size - 1, info);
@@ -558,7 +558,7 @@ STATIC VOID OsLmsPrintErrInfo(LmsAddrInfo *info, UINT32 errMod)
case LMS_SHADOW_REDZONE:
PRINT_ERR("Heap buffer overflow error detected\n");
break;
case LMS_SHADOW_ACCESSABLE:
case LMS_SHADOW_ACCESSIBLE:
PRINT_ERR("No error\n");
break;
default:
@@ -614,7 +614,7 @@ VOID OsLmsReportError(UINTPTR p, UINT32 size, UINT32 errMod)
#ifdef LOSCFG_LMS_STORE_CHECK
VOID __asan_store1_noabort(UINTPTR p)
{
if (OsLmsCheckAddr(p) != LMS_SHADOW_ACCESSABLE_U8) {
if (OsLmsCheckAddr(p) != LMS_SHADOW_ACCESSIBLE_U8) {
OsLmsReportError(p, MEM_REGION_SIZE_1, STORE_ERRMODE);
}
}
@@ -690,7 +690,7 @@ VOID __asan_storeN_noabort(UINTPTR p, UINT32 size)
#ifdef LOSCFG_LMS_LOAD_CHECK
VOID __asan_load1_noabort(UINTPTR p)
{
if (OsLmsCheckAddr(p) != LMS_SHADOW_ACCESSABLE_U8) {
if (OsLmsCheckAddr(p) != LMS_SHADOW_ACCESSIBLE_U8) {
OsLmsReportError(p, MEM_REGION_SIZE_1, LOAD_ERRMODE);
}
}

View File

@@ -59,13 +59,13 @@ extern "C" {
#define LMS_POOL_RESIZE(size) ((size) / (LMS_SHADOW_U8_REFER_BYTES + 1) * LMS_SHADOW_U8_REFER_BYTES)
#define LMS_ADDR_ALIGN(p) (((UINTPTR)(p) + sizeof(UINTPTR) - 1) & ~((UINTPTR)(sizeof(UINTPTR) - 1)))
#define LMS_SHADOW_ACCESSABLE 0x00
#define LMS_SHADOW_ACCESSIBLE 0x00
#define LMS_SHADOW_AFTERFREE 0x03
#define LMS_SHADOW_REDZONE 0x02
#define LMS_SHADOW_PAINT 0x01
#define LMS_SHADOW_MASK 0x03
#define LMS_SHADOW_ACCESSABLE_U8 0x00
#define LMS_SHADOW_ACCESSIBLE_U8 0x00
#define LMS_SHADOW_AFTERFREE_U8 0xFF
#define LMS_SHADOW_REDZONE_U8 0xAA
#define LMS_SHADOW_MASK_U8 0xFF

View File

@@ -124,8 +124,8 @@ ATTRIBUTE_NO_SANITIZE_ADDRESS void LmsSetShadowValue(uintptr_t startAddr, uintpt
uint32_t startOffset;
uint32_t endOffset;
char shadowValueMask;
char shadowValue;
unsigned char shadowValueMask;
unsigned char shadowValue;
/* endAddr - 1, then we mark [startAddr, endAddr) to value */
LmsMem2Shadow(startAddr, &shadowStart, &startOffset);
@@ -174,7 +174,7 @@ ATTRIBUTE_NO_SANITIZE_ADDRESS void LmsGetShadowValue(uintptr_t addr, uint32_t *s
LmsMem2Shadow(addr, &shadowAddr, &shadowOffset);
/* If the shadow addr is not mapped then regarded as legal access */
if (LmsIsShadowAddrMapped(shadowAddr, shadowAddr) != LMS_OK) {
*shadowValue = LMS_SHADOW_ACCESSABLE_U8;
*shadowValue = LMS_SHADOW_ACCESSIBLE_U8;
return;
}
@@ -185,7 +185,7 @@ ATTRIBUTE_NO_SANITIZE_ADDRESS void LmsMallocMark(uintptr_t preRzStart, uintptr_t
uintptr_t RzEndAddr)
{
LmsSetShadowValue(preRzStart, accessMemStart, LMS_SHADOW_REDZONE_U8);
LmsSetShadowValue(accessMemStart, nextRzStart, LMS_SHADOW_ACCESSABLE_U8);
LmsSetShadowValue(accessMemStart, nextRzStart, LMS_SHADOW_ACCESSIBLE_U8);
LmsSetShadowValue(nextRzStart, RzEndAddr, LMS_SHADOW_REDZONE_U8);
}
@@ -266,7 +266,7 @@ ATTRIBUTE_NO_SANITIZE_ADDRESS void LmsPrintMemInfo(uintptr_t addr)
}
}
LMS_OUTPUT_INFO("|\t[0x%x | %2d]: ", shadowAddr, shadowOffset);
LMS_OUTPUT_INFO("|\t[0x%x | %2u]: ", shadowAddr, shadowOffset);
for (int x = 0; x < printX; x += LMS_MEM_BYTES_PER_SHADOW_CELL) {
LmsGetShadowValue(dumpAddr + x, &shadowValue);
@@ -300,7 +300,7 @@ ATTRIBUTE_NO_SANITIZE_ADDRESS static inline void LmsGetShadowInfo(uintptr_t memA
ATTRIBUTE_NO_SANITIZE_ADDRESS static void LmsGetErrorInfo(uintptr_t addr, size_t size, LmsAddrInfo *info)
{
LmsGetShadowInfo(addr, info);
if (info->shadowValue != LMS_SHADOW_ACCESSABLE_U8) {
if (info->shadowValue != LMS_SHADOW_ACCESSIBLE_U8) {
return;
} else {
LmsGetShadowInfo(addr + size - 1, info);
@@ -316,7 +316,7 @@ ATTRIBUTE_NO_SANITIZE_ADDRESS static void LmsPrintErrInfo(LmsAddrInfo *info, uin
case LMS_SHADOW_REDZONE:
LMS_OUTPUT_ERROR("Heap buffer overflow error detected!\n");
break;
case LMS_SHADOW_ACCESSABLE:
case LMS_SHADOW_ACCESSIBLE:
LMS_OUTPUT_ERROR("No error!\n");
break;
default:
@@ -339,11 +339,11 @@ ATTRIBUTE_NO_SANITIZE_ADDRESS static void LmsPrintErrInfo(LmsAddrInfo *info, uin
break;
}
LMS_OUTPUT_INFO("Shadow memory address: [0x%x : %d] Shadow memory value: [%d] \n", info->shadowAddr,
LMS_OUTPUT_INFO("Shadow memory address: [0x%x : %u] Shadow memory value: [%u] \n", info->shadowAddr,
info->shadowOffset, info->shadowValue);
LMS_OUTPUT_INFO("\n");
LMS_OUTPUT_INFO("%-25s%d\n", "Accessable heap addr", LMS_SHADOW_ACCESSABLE);
LMS_OUTPUT_INFO("%-25s%d\n", "Accessible heap addr", LMS_SHADOW_ACCESSIBLE);
LMS_OUTPUT_INFO("%-25s%d\n", "Heap red zone", LMS_SHADOW_REDZONE);
LMS_OUTPUT_INFO("%-25s%d\n", "Heap freed buffer", LMS_SHADOW_AFTERFREE);
LMS_OUTPUT_INFO("\n");
@@ -373,23 +373,23 @@ ATTRIBUTE_NO_SANITIZE_ADDRESS void LmsReportError(uintptr_t p, size_t size, uint
void LmsCheckValid(const char *dest, const char *src)
{
if (LmsCheckAddr((uintptr_t)dest) != LMS_SHADOW_ACCESSABLE_U8) {
if (LmsCheckAddr((uintptr_t)dest) != LMS_SHADOW_ACCESSIBLE_U8) {
LmsReportError((uintptr_t)dest, MEM_REGION_SIZE_1, STORE_ERRMODE);
return;
}
if (LmsCheckAddr((uintptr_t)src) != LMS_SHADOW_ACCESSABLE_U8) {
if (LmsCheckAddr((uintptr_t)src) != LMS_SHADOW_ACCESSIBLE_U8) {
LmsReportError((uintptr_t)src, MEM_REGION_SIZE_1, LOAD_ERRMODE);
return;
}
for (uint32_t i = 0; *(src + i) != '\0'; i++) {
if (LmsCheckAddr((uintptr_t)dest + i + 1) != LMS_SHADOW_ACCESSABLE_U8) {
if (LmsCheckAddr((uintptr_t)dest + i + 1) != LMS_SHADOW_ACCESSIBLE_U8) {
LmsReportError((uintptr_t)dest + i + 1, MEM_REGION_SIZE_1, STORE_ERRMODE);
return;
}
if (LmsCheckAddr((uintptr_t)src + i + 1) != LMS_SHADOW_ACCESSABLE_U8) {
if (LmsCheckAddr((uintptr_t)src + i + 1) != LMS_SHADOW_ACCESSIBLE_U8) {
LmsReportError((uintptr_t)src + i + 1, MEM_REGION_SIZE_1, LOAD_ERRMODE);
return;
}
@@ -398,7 +398,7 @@ void LmsCheckValid(const char *dest, const char *src)
void __asan_store1_noabort(uintptr_t p)
{
if (LmsCheckAddr(p) != LMS_SHADOW_ACCESSABLE_U8) {
if (LmsCheckAddr(p) != LMS_SHADOW_ACCESSIBLE_U8) {
LmsReportError(p, MEM_REGION_SIZE_1, STORE_ERRMODE);
}
}
@@ -440,7 +440,7 @@ void __asan_storeN_noabort(uintptr_t p, size_t size)
void __asan_load1_noabort(uintptr_t p)
{
if (LmsCheckAddr(p) != LMS_SHADOW_ACCESSABLE_U8) {
if (LmsCheckAddr(p) != LMS_SHADOW_ACCESSIBLE_U8) {
LmsReportError(p, MEM_REGION_SIZE_1, LOAD_ERRMODE);
}
}

View File

@@ -50,7 +50,7 @@ extern "C" {
#define SANITIZER_INTERFACE_ATTRIBUTE
#define ATTRIBUTE_NO_SANITIZE_ADDRESS __attribute__((no_sanitize_address))
#define LMS_SHADOW_ACCESSABLE 0x00
#define LMS_SHADOW_ACCESSIBLE 0x00
#define LMS_SHADOW_AFTERFREE 0x03
#define LMS_SHADOW_REDZONE 0x02
#define LMS_SHADOW_PAINT 0x01
@@ -61,7 +61,7 @@ extern "C" {
#define LMS_SHADOW_U8_CELL_NUM 4
#define LMS_SHADOW_U8_REFER_BYTES 16
#define LMS_SHADOW_ACCESSABLE_U8 0x00
#define LMS_SHADOW_ACCESSIBLE_U8 0x00
#define LMS_SHADOW_AFTERFREE_U8 0xFF
#define LMS_SHADOW_REDZONE_U8 0xAA
#define LMS_SHADOW_MASK_U8 0xFF

View File

@@ -45,7 +45,7 @@ ATTRIBUTE_NO_SANITIZE_ADDRESS void LmsFree(void *ptr)
if (LmsIsShadowAddrMapped(shadowAddr, shadowAddr) == LMS_OK) {
uint32_t acShadowValue;
LmsGetShadowValue((uintptr_t)ptr, &acShadowValue);
if (acShadowValue != LMS_SHADOW_ACCESSABLE) {
if (acShadowValue != LMS_SHADOW_ACCESSIBLE) {
char erroMode = (acShadowValue == LMS_SHADOW_AFTERFREE ? FREE_ERRORMODE : UNKNOWN_ERROR);
LmsReportError((uintptr_t)ptr, MEM_REGION_SIZE_1, erroMode);
goto UNLOCK_OUT;

View File

@@ -289,7 +289,7 @@ STATIC UINT32 OsPerfCollectData(Event *event, PerfSampleData *data, PerfRegs *re
* return TRUE if user haven't specified any taskId(which is supposed
* to instrument the whole system)
*/
STATIC INLINE BOOL OsFilterId(UINT32 id, UINT32 *ids, UINT8 idsNr)
STATIC INLINE BOOL OsFilterId(UINT32 id, const UINT32 *ids, UINT8 idsNr)
{
UINT32 i;
if (!idsNr) {

View File

@@ -300,7 +300,7 @@ UINT32 LOS_PmRegister(LOS_PmNodeType type, VOID *node)
return LOS_EINVAL;
}
STATIC UINT32 OsPmDeviceUnregister(LosPmCB *pm, LosPmDevice *device)
STATIC UINT32 OsPmDeviceUnregister(LosPmCB *pm, const LosPmDevice *device)
{
LOS_SpinLock(&g_pmSpin);
if (pm->device == device) {

View File

@@ -87,9 +87,9 @@ typedef VOID (*pf_OUTPUT)(const CHAR *fmt, ...);
* <ul><li>los_printf.h: the header file that contains the API declaration.</li></ul>
* @see printf
*/
#ifndef LOSCFG_LIBC_NEWLIB
extern void dprintf(const char *fmt, ...);
#define diag_printf dprintf
#endif
#define PRINT_DEBUG(fmt, args...) LOS_LkPrint(LOS_DEBUG_LEVEL, __FUNCTION__, __LINE__, fmt, ##args)
#define PRINT_INFO(fmt, args...) LOS_LkPrint(LOS_INFO_LEVEL, __FUNCTION__, __LINE__, fmt, ##args)

View File

@@ -1,6 +1,6 @@
/*
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
* Copyright (c) 2020-2022 Huawei Device Co., Ltd. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
@@ -50,8 +50,8 @@ extern "C" {
* Rwlock object.
*/
typedef struct OsRwlock {
INT32 magic:24; /**< Magic number */
INT32 rwCount:8; /**< Times of locking the rwlock, rwCount > 0 when rwkick is read mode, rwCount < 0
INT32 magic : 24; /**< Magic number */
INT32 rwCount : 8; /**< Times of locking the rwlock, rwCount > 0 when rwkick is read mode, rwCount < 0
when the rwlock is write mode, rwCount = 0 when the lock is free. */
VOID *writeOwner; /**< The current write thread that is locking the rwlock */
LOS_DL_LIST readList; /**< Read waiting list */

View File

@@ -977,7 +977,7 @@ extern UINT32 LOS_TaskInfoGet(UINT32 taskID, TSK_INFO_S *taskInfo);
*
* @attention
* <ul>
* <li>If any low LOSCFG_KERNEL_CORE_NUM bit of the mask is not setted, an error is reported.</li>
* <li>If any low LOSCFG_KERNEL_CORE_NUM bit of the mask is not set, an error is reported.</li>
* </ul>
*
* @param uwTaskID [IN] Type #UINT32 Task ID. The task id value is obtained from task creation.
@@ -987,7 +987,7 @@ extern UINT32 LOS_TaskInfoGet(UINT32 taskID, TSK_INFO_S *taskInfo);
* @retval #LOS_ERRNO_TSK_ID_INVALID Invalid task ID.
* @retval #LOS_ERRNO_TSK_NOT_CREATED The task is not created.
* @retval #LOS_ERRNO_TSK_CPU_AFFINITY_MASK_ERR The task cpu affinity mask is incorrect.
* @retval #LOS_OK The task cpu affinity mask is successfully setted.
* @retval #LOS_OK The task cpu affinity mask is successfully set.
* @par Dependency:
* <ul><li>los_task.h: the header file that contains the API declaration.</li></ul>
* @see LOS_TaskCpuAffiGet

View File

@@ -5,6 +5,20 @@ config LIB_LIBC
help
Answer Y to enable libc for full code.
choice
prompt "choose libc"
default LIBC_MUSL
depends on LIB_LIBC
help
Choose libc.
config LIBC_NEWLIB
bool "newlibc"
config LIBC_MUSL
bool "musl libc"
endchoice
config LIB_ZLIB
bool "Enable Zlib"
default y

View File

@@ -1,5 +1,5 @@
# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
# Copyright (c) 2020-2022 Huawei Device Co., Ltd. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
@@ -29,93 +29,16 @@
import("//kernel/liteos_a/liteos.gni")
MUSLDIR = "$LITEOSTHIRDPARTY/musl"
import("//third_party/optimized-routines/optimized-routines.gni")
import("$MUSLDIR/porting/liteos_a/kernel/musl.gni")
module_switch = defined(LOSCFG_LIB_LIBC)
module_name = get_path_info(rebase_path("."), "name")
kernel_module(module_name) {
sources = MUSL_SRC_COMMON
if (defined(LOSCFG_ARCH_ARM_AARCH32)) {
sources += MUSL_SRC_ARM
foreach(f, MUSL_SRC_ARM) {
sources -= [ string_replace(f, "/arm/", "/") ]
}
}
if (LOSCFG_ARCH_ARM_VER == "armv7-a") {
sources -= [
"$MUSLPORTINGDIR/src/string/memchr.c",
"$MUSLPORTINGDIR/src/string/memcpy.c",
"$MUSLPORTINGDIR/src/string/strcmp.c",
"$MUSLPORTINGDIR/src/string/strcpy.c",
"$MUSLPORTINGDIR/src/string/strlen.c",
]
sources += [
"src/arch/arm/memcmp.S",
"src/arch/arm/memset.S",
]
sources += OPTRT_STRING_ARM_SRC_FILES_FOR_ARMV7_A
asmflags = [
"-D__strlen_armv6t2=strlen",
"-D__strcmp_arm=strcmp",
"-D__memchr_arm=memchr",
]
if (defined(LOSCFG_KERNEL_LMS)) {
asmflags += [
"-D__memcpy_arm=__memcpy",
"-D__strcpy_arm=__strcpy",
]
} else {
asmflags += [
"-D__memcpy_arm=memcpy",
"-D__strcpy_arm=strcpy",
]
}
} else {
# arch is not armv7-a
sources += [
"src/memcmp.c",
"src/memset.c",
]
}
include_dirs = [
"$MUSLPORTINGDIR/src/include",
"$MUSLPORTINGDIR/src/internal",
group("libc") {
deps = [
"musl",
"newlib",
]
public_configs = [ ":public" ]
configs += [ ":private" ]
}
config("public") {
cflags = [
"-isystem",
rebase_path("$MUSLPORTINGDIR/include"),
]
}
config("private") {
if (defined(LOSCFG_COMPILER_CLANG_LLVM)) {
cflags = [
"-Wno-char-subscripts",
"-Wno-unknown-pragmas",
]
} else {
cflags = [
"-frounding-math",
"-Wno-unused-but-set-variable",
"-Wno-unknown-pragmas",
]
}
cflags += [
"-Wno-shift-op-parentheses",
"-Wno-logical-op-parentheses",
"-Wno-bitwise-op-parentheses",
configs = [
"musl:public",
"newlib:public",
]
}

122
lib/libc/musl/BUILD.gn Normal file
View File

@@ -0,0 +1,122 @@
# 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.
import("//kernel/liteos_a/liteos.gni")
MUSLDIR = "$LITEOSTHIRDPARTY/musl"
import("//third_party/optimized-routines/optimized-routines.gni")
import("$MUSLDIR/porting/liteos_a/kernel/musl.gni")
module_switch = defined(LOSCFG_LIBC_MUSL)
module_name = get_path_info(rebase_path("."), "name")
kernel_module(module_name) {
sources = MUSL_SRC_COMMON
if (defined(LOSCFG_ARCH_ARM_AARCH32)) {
sources += MUSL_SRC_ARM
foreach(f, MUSL_SRC_ARM) {
sources -= [ string_replace(f, "/arm/", "/") ]
}
}
if (LOSCFG_ARCH_ARM_VER == "armv7-a") {
sources -= [
"$MUSLPORTINGDIR/src/string/memchr.c",
"$MUSLPORTINGDIR/src/string/memcpy.c",
"$MUSLPORTINGDIR/src/string/strcmp.c",
"$MUSLPORTINGDIR/src/string/strcpy.c",
"$MUSLPORTINGDIR/src/string/strlen.c",
]
sources += [
"src/arch/arm/memcmp.S",
"src/arch/arm/memset.S",
]
sources += OPTRT_STRING_ARM_SRC_FILES_FOR_ARMV7_A
asmflags = [
"-D__strlen_armv6t2=strlen",
"-D__strcmp_arm=strcmp",
"-D__memchr_arm=memchr",
]
if (defined(LOSCFG_KERNEL_LMS)) {
asmflags += [
"-D__memcpy_arm=__memcpy",
"-D__strcpy_arm=__strcpy",
]
} else {
asmflags += [
"-D__memcpy_arm=memcpy",
"-D__strcpy_arm=strcpy",
]
}
} else {
# arch is not armv7-a
sources += [
"src/memcmp.c",
"src/memset.c",
]
}
include_dirs = [
"$MUSLPORTINGDIR/src/include",
"$MUSLPORTINGDIR/src/internal",
]
public_configs = [ ":public" ]
configs += [ ":private" ]
}
config("public") {
cflags = [
"-isystem",
rebase_path("$MUSLPORTINGDIR/include"),
]
}
config("private") {
if (defined(LOSCFG_COMPILER_CLANG_LLVM)) {
cflags = [
"-Wno-char-subscripts",
"-Wno-ignored-pragmas",
"-Wno-strict-prototypes",
]
} else {
cflags = [
"-frounding-math",
"-Wno-unused-but-set-variable",
]
}
cflags += [
"-Wno-shift-op-parentheses",
"-Wno-logical-op-parentheses",
"-Wno-bitwise-op-parentheses",
"-Wno-unknown-pragmas",
]
}

View File

@@ -59,10 +59,10 @@ LOCAL_INCLUDE += $(addprefix -I$(MUSLPORTINGDIR)/, src/include src/internal)
LOCAL_FLAGS := $(LOCAL_INCLUDE) $(LOCAL_CMACRO)
ifeq ($(LOSCFG_COMPILER_CLANG_LLVM), y)
LOCAL_FLAGS +=-Wno-char-subscripts -Wno-unknown-pragmas
LOCAL_FLAGS +=-Wno-char-subscripts -Wno-ignored-pragmas -Wno-strict-prototypes
else
LOCAL_FLAGS += -frounding-math -Wno-unused-but-set-variable -Wno-unknown-pragmas
LOCAL_FLAGS += -frounding-math -Wno-unused-but-set-variable
endif
LOCAL_FLAGS += -Wno-shift-op-parentheses -Wno-logical-op-parentheses -Wno-bitwise-op-parentheses
LOCAL_FLAGS += -Wno-shift-op-parentheses -Wno-logical-op-parentheses -Wno-bitwise-op-parentheses -Wno-unknown-pragmas
include $(MODULE)

58
lib/libc/newlib/BUILD.gn Normal file
View File

@@ -0,0 +1,58 @@
# Copyright (c) 2022-2022 Huawei Device Co., Ltd. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this list of
# conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice, this list
# of conditions and the following disclaimer in the documentation and/or other materials
# provided with the distribution.
#
# 3. Neither the name of the copyright holder nor the names of its contributors may be used
# to endorse or promote products derived from this software without specific prior written
# permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import("//kernel/liteos_a/liteos.gni")
import("//third_party/musl/porting/liteos_a_newlib/kernel/newlib.gni")
module_switch = defined(LOSCFG_LIBC_NEWLIB)
module_name = get_path_info(rebase_path("."), "name")
kernel_module(module_name) {
sources = NEWLIB_ADAPT_SRC_COMMON
configs += [ "$LITEOSTOPDIR:warn_config" ]
configs += [ ":private" ]
}
config("public") {
include_dirs = [ "porting/include" ]
include_dirs += NEWLIB_ADAPT_INCLUDE_DIRS
}
config("private") {
cflags = [
"-frounding-math",
"-Wno-unused-but-set-variable",
"-Wno-unknown-pragmas",
]
cflags += [
"-Wno-shift-op-parentheses",
"-Wno-logical-op-parentheses",
"-Wno-bitwise-op-parentheses",
]
}

View File

@@ -31,7 +31,7 @@ import("$root_out_dir/config.gni")
LITEOSTOPDIR = "//kernel/liteos_a"
LITEOSTHIRDPARTY = "//third_party"
HDFTOPDIR = "//drivers/adapter/khdf/liteos"
HDFTOPDIR = "//drivers/hdf_core/adapter/khdf/liteos"
ARCH = ""
if (defined(LOSCFG_ARCH_ARM_AARCH32)) {

View File

@@ -1,6 +1,6 @@
/*
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
* Copyright (c) 2020-2022 Huawei Device Co., Ltd. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
@@ -58,7 +58,7 @@
#define ip_addr_set_val(dest, src) do { \
IP_SET_TYPE_VAL(*dest, IP_GET_TYPE(src)); \
if(IP_IS_V6_VAL(*(src))) { \
if (IP_IS_V6_VAL(*(src))) { \
ip6_addr_set(ip_2_ip6(dest), ip_2_ip6(src)); \
} else { \
ip4_addr_set(ip_2_ip4(dest), ip_2_ip4(src)); \

View File

@@ -1,6 +1,6 @@
/*
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
* Copyright (c) 2020-2022 Huawei Device Co., Ltd. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
@@ -243,7 +243,7 @@ struct ifconfig_option {
unsigned char ethaddr[6];
u16_t mtu;
/* when using telnet, print to the telnet socket will result in system */
/* deadlock. So we cahe the prinf data to a buf, and when the tcpip */
/* deadlock. So we cache the print data to a buf, and when the tcpip */
/* callback returns, then print the data out to the telnet socket */
sys_sem_t cb_completed;
char cb_print_buf[PRINT_BUF_LEN];
@@ -342,7 +342,7 @@ int print_netif(struct netif *netif, char *print_buf, unsigned int buf_len)
buf_len -= (unsigned int)ret;
ret = snprintf_s(tmp, buf_len, (buf_len - 1), " MTU:%d %s", netif->mtu,
netif->flags & NETIF_FLAG_UP ? "Running" : "Stop");
(netif->flags & NETIF_FLAG_UP) ? "Running" : "Stop");
if ((ret <= 0) || ((unsigned int)ret >= buf_len))
goto out;
tmp += ret;
@@ -356,7 +356,8 @@ int print_netif(struct netif *netif, char *print_buf, unsigned int buf_len)
buf_len -= (unsigned int)ret;
}
ret = snprintf_s(tmp, buf_len, (buf_len - 1), " %s\n", netif->flags & NETIF_FLAG_LINK_UP ? "Link UP" : "Link Down");
ret = snprintf_s(tmp, buf_len, (buf_len - 1), " %s\n",
(netif->flags & NETIF_FLAG_LINK_UP) ? "Link UP" : "Link Down");
if ((ret <= 0) || ((unsigned int)ret >= buf_len))
goto out;
tmp += ret;
@@ -365,19 +366,19 @@ int print_netif(struct netif *netif, char *print_buf, unsigned int buf_len)
ret = snprintf_s(tmp, buf_len, (buf_len - 1), "\tRX packets:%u ",
netif->mib2_counters.ifinucastpkts + netif->mib2_counters.ifinnucastpkts);
if ((ret <= 0) || ((unsigned int)ret >= buf_len))
goto out;
goto out;
tmp += ret;
buf_len -= (unsigned int)ret;
ret = snprintf_s(tmp, buf_len, (buf_len - 1), "errors:%u ", netif->mib2_counters.ifinerrors);
if ((ret <= 0) || ((unsigned int)ret >= buf_len))
goto out;
goto out;
tmp += ret;
buf_len -= (unsigned int)ret;
ret = snprintf_s(tmp, buf_len, (buf_len - 1), "dropped:%u ", netif->mib2_counters.ifindiscards);
if ((ret <= 0) || ((unsigned int)ret >= buf_len))
goto out;
goto out;
tmp += ret;
buf_len -= (unsigned int)ret;
@@ -1031,12 +1032,12 @@ u32_t lwip_ifconfig(int argc, const char **argv)
#if LWIP_ARP && LWIP_ENABLE_IP_CONFLICT_SIGNAL
if ((ifconfig_cmd.option & IFCONFIG_OPTION_SET_IP) && IP_IS_V4_VAL((ifconfig_cmd.ip_addr))) {
/* Create the semaphore for ip conflict detection. */
if (sys_sem_new(&ip_conflict_detect, 0) != ERR_OK) {
sys_sem_free(&ifconfig_cmd.cb_completed);
PRINTK("ifconfig: internal error\n");
return 1;
}
is_ip_conflict_signal = 1;
if (sys_sem_new(&ip_conflict_detect, 0) != ERR_OK) {
sys_sem_free(&ifconfig_cmd.cb_completed);
PRINTK("ifconfig: internal error\n");
return 1;
}
is_ip_conflict_signal = 1;
}
#endif /* LWIP_ARP && LWIP_ENABLE_IP_CONFLICT_SIGNAL */
@@ -1057,8 +1058,8 @@ u32_t lwip_ifconfig(int argc, const char **argv)
sys_sem_free(&ifconfig_cmd.cb_completed);
#if LWIP_ARP && LWIP_ENABLE_IP_CONFLICT_SIGNAL
if ((ifconfig_cmd.option & IFCONFIG_OPTION_SET_IP) && IP_IS_V4_VAL((ifconfig_cmd.ip_addr))) {
is_ip_conflict_signal = 0;
sys_sem_free(&ip_conflict_detect);
is_ip_conflict_signal = 0;
sys_sem_free(&ip_conflict_detect);
}
#endif /* LWIP_ARP && LWIP_ENABLE_IP_CONFLICT_SIGNAL */
@@ -1076,37 +1077,37 @@ u32_t lwip_ifconfig(int argc, const char **argv)
ifconfig_cmd.cb_print_buf[PRINT_BUF_LEN - 1] = '\0';
PRINTK("%s", ifconfig_cmd.cb_print_buf);
#if LWIP_ARP && LWIP_ENABLE_IP_CONFLICT_SIGNAL
/* Pend 2 seconds for waiting the arp reply if the ip is already in use.*/
/* Pend 2 seconds for waiting the arp reply if the ip is already in use. */
if ((ifconfig_cmd.option & IFCONFIG_OPTION_SET_IP) && IP_IS_V4_VAL((ifconfig_cmd.ip_addr))) {
err = (err_t)sys_arch_sem_wait(&ip_conflict_detect, DUP_ARP_DETECT_TIME);
is_ip_conflict_signal = 0;
sys_sem_free(&ip_conflict_detect);
if (err < 0) {
/* The result neither conflict nor timeout. */
PRINT_ERR("ifconfig: internal error\n");
sys_sem_free(&ifconfig_cmd.cb_completed);
return 1;
} else if (err < DUP_ARP_DETECT_TIME) {
/* Duplicate use of new ip, restore it to the old one. */
PRINT_ERR("ifconfig: ip conflict!\n");
ip_addr_set_ip4_u32_val(ifconfig_cmd.ip_addr, old_ip4addr);
ret = tcpip_callback(lwip_ifconfig_internal, &ifconfig_cmd);
if (ret != ERR_OK) {
sys_sem_free(&ifconfig_cmd.cb_completed);
PRINTK("%s : tcpip_callback failed in line %d : errnu %d", __FUNCTION__, __LINE__, ret);
return 1;
err = (err_t)sys_arch_sem_wait(&ip_conflict_detect, DUP_ARP_DETECT_TIME);
is_ip_conflict_signal = 0;
sys_sem_free(&ip_conflict_detect);
if (err < 0) {
/* The result neither conflict nor timeout. */
PRINT_ERR("ifconfig: internal error\n");
sys_sem_free(&ifconfig_cmd.cb_completed);
return 1;
} else if (err < DUP_ARP_DETECT_TIME) {
/* Duplicate use of new ip, restore it to the old one. */
PRINT_ERR("ifconfig: ip conflict!\n");
ip_addr_set_ip4_u32_val(ifconfig_cmd.ip_addr, old_ip4addr);
ret = tcpip_callback(lwip_ifconfig_internal, &ifconfig_cmd);
if (ret != ERR_OK) {
sys_sem_free(&ifconfig_cmd.cb_completed);
PRINTK("%s : tcpip_callback failed in line %d : errnu %d", __FUNCTION__, __LINE__, ret);
return 1;
}
(void)sys_arch_sem_wait(&ifconfig_cmd.cb_completed, 0);
sys_sem_free(&ifconfig_cmd.cb_completed);
ifconfig_cmd.cb_print_buf[PRINT_BUF_LEN - 1] = '\0';
PRINTK("%s", ifconfig_cmd.cb_print_buf);
return 1;
}
(void)sys_arch_sem_wait(&ifconfig_cmd.cb_completed, 0);
sys_sem_free(&ifconfig_cmd.cb_completed);
ifconfig_cmd.cb_print_buf[PRINT_BUF_LEN - 1] = '\0';
PRINTK("%s", ifconfig_cmd.cb_print_buf);
return 1;
}
}
#endif /* LWIP_ARP && LWIP_ENABLE_IP_CONFLICT_SIGNAL */
#if LWIP_IPV6
if ((ifconfig_cmd.option & IFCONFIG_OPTION_SET_IP) && IP_IS_V6_VAL(ifconfig_cmd.ip_addr)) {
/* Pend 2 seconds for waiting the arp reply if the ip is already in use.*/
/* Pend 2 seconds for waiting the arp reply if the ip is already in use. */
retval = sys_arch_sem_wait(&dup_addr_detect, DUP_ARP_DETECT_TIME);
is_dup_detect_initialized = 0;
sys_sem_free(&dup_addr_detect);
@@ -1158,9 +1159,9 @@ struct arp_option {
unsigned int ipaddr;
/* hw addr */
unsigned char ethaddr[6];
/* when using telnet, printf to the telnet socket will result in system */
/* deadlock.so don't do it.cahe the data to prinf to a buf, and when */
/* callback returns, then printf the data out to the telnet socket */
/* when using telnet, print to the telnet socket will result in system */
/* deadlock.so don't do it. cache the data to print to a buf, and when */
/* callback returns, then print the data out to the telnet socket */
sys_sem_t cb_completed;
char cb_print_buf[PRINT_BUF_LEN];
int print_buf_len;
@@ -1191,7 +1192,6 @@ void lwip_arp_show_internal(struct netif *netif, char *printf_buf, unsigned int
|| (state == ETHARP_STATE_STATIC)
#endif /* ETHARP_SUPPORT_STATIC_ENTRIES */
) && arp_table[i].netif) {
if (strcmp(netif_get_name(netif), netif_get_name(arp_table[i].netif)) != 0) {
continue;
}
@@ -1305,7 +1305,7 @@ void lwip_arp_internal(void *arg)
for (netif = netif_list; netif != NULL; netif = netif->next) {
ret = etharp_delete_arp_entry(netif, &ipaddr);
if (ret == ERR_OK) {
/*only can del success one time*/
/* only can del success one time */
break;
}
}
@@ -1326,7 +1326,7 @@ out:
} else if (ret == ERR_RTE) {
(void)snprintf_s(arp_cmd->cb_print_buf, PRINT_BUF_LEN, (PRINT_BUF_LEN - 1), "Network is unreachable\n");
} else {
(void)snprintf_s(arp_cmd->cb_print_buf, PRINT_BUF_LEN, (PRINT_BUF_LEN - 1), "Successed\n");
(void)snprintf_s(arp_cmd->cb_print_buf, PRINT_BUF_LEN, (PRINT_BUF_LEN - 1), "Succeeded\n");
}
}
#endif
@@ -1387,7 +1387,7 @@ u32_t lwip_arp(int argc, const char **argv)
goto arp_error;
}
i += 2;
argc -= 2;
argc -= 2; // 2: number of used parameters
} else if (strcmp("-d", argv[i]) == 0 && (argc > 1)) {
/* arp delete */
arp_cmd.option = ARP_OPTION_DEL;
@@ -1399,8 +1399,8 @@ u32_t lwip_arp(int argc, const char **argv)
}
i += 2;
argc -= 2;
} else if (strcmp("-s", argv[i]) == 0 && (argc > 2)) {
argc -= 2; // 2: number of used parameters
} else if (strcmp("-s", argv[i]) == 0 && (argc > 2)) { // 2: require more than 2 parameters
/* arp add */
char *digit = NULL;
u32_t macaddrlen = strlen(argv[i + 2]) + 1;
@@ -1418,7 +1418,7 @@ u32_t lwip_arp(int argc, const char **argv)
goto arp_error;
}
/*cannot add an arp entry of 127.*.*.* */
/* cannot add an arp entry of 127.*.*.* */
if ((arp_cmd.ipaddr & (u32_t)0x0000007fUL) == (u32_t)0x0000007fUL) {
PRINTK("IP address is not correct!\n");
goto arp_error;
@@ -1452,7 +1452,7 @@ u32_t lwip_arp(int argc, const char **argv)
}
i += 3;
argc -= 3;
argc -= 3; // 3: number of used parameters
} else {
goto arp_error;
}
@@ -1727,7 +1727,7 @@ LWIP_STATIC int osPingFunc(u32_t destip, u32_t cnt, u32_t interval, u32_t data_l
break;
}
intrvl -= 1000;
sys_msleep(1000);
sys_msleep(1000); // 1000: delay 1 s
if (ping_kill == 1)
break;
} while (intrvl > 0);
@@ -1819,7 +1819,7 @@ u32_t osShellPing(int argc, const char **argv)
count = ret;
count_set = 1;
i += 2;
argc -= 2;
argc -= 2; // 2: nuber of arguments that has been checked
} else if (strcmp("-t", argv[i]) == 0) {
count = 0; /* ping forerver */
count_set = 1;
@@ -1834,7 +1834,7 @@ u32_t osShellPing(int argc, const char **argv)
interval = ret;
i += 2;
argc -= 2;
argc -= 2; // 2:number of arguments that has been checked
} else if (strcmp("-l", argv[i]) == 0 && (argc > 1)) {
ret = atoi(argv[i + 1]);
if (ret < 0 || ret > (int)(LWIP_MAX_UDP_RAW_SEND_SIZE - sizeof(struct icmp_echo_hdr))) {
@@ -1844,7 +1844,7 @@ u32_t osShellPing(int argc, const char **argv)
}
data_len = ret;
i += 2;
argc -= 2;
argc -= 2; // 2: number of elements has been checked
} else if (strcmp("-k", argv[i]) == 0) {
if (ping_taskid > 0) {
ping_kill = 1; /* stop the current ping task */
@@ -1896,7 +1896,7 @@ u32_t osShellPing(int argc, const char **argv)
stPingTask.auwArgs[0] = dst_ipaddr.addr; /* network order */
stPingTask.auwArgs[1] = count;
stPingTask.auwArgs[2] = interval;
stPingTask.auwArgs[3] = data_len;
stPingTask.auwArgs[3] = data_len; // 3: index of data length
ret = LOS_TaskCreate((UINT32 *)(&ping_taskid), &stPingTask);
if (ret != LOS_OK) {
PRINTK("ping_task create failed 0x%08x.\n", ret);
@@ -1923,7 +1923,7 @@ ping_error:
SHELLCMD_ENTRY(ping_shellcmd, CMD_TYPE_EX, "ping", XARGS, (CmdCallBackFunc)osShellPing);
#endif /* LOSCFG_SHELL */
#else /* LWIP_EXT_POLL_SUPPORT*/
#else /* LWIP_EXT_POLL_SUPPORT */
u32_t osShellPing(int argc, const char **argv)
{
@@ -2076,7 +2076,7 @@ FAILURE:
SHELLCMD_ENTRY(ping_shellcmd, CMD_TYPE_EX, "ping", XARGS, (CmdCallBackFunc)osShellPing);
#endif /* LOSCFG_SHELL */
#endif /* LWIP_EXT_POLL_SUPPORT*/
#endif /* LWIP_EXT_POLL_SUPPORT */
#if LWIP_IPV6
u32_t osShellPing6(int argc, const char **argv)
@@ -2175,8 +2175,6 @@ u32_t osShellPing6(int argc, const char **argv)
/* Setting the start time of the entire ping task for statistics */
(void)clock_gettime(CLOCK_MONOTONIC_RAW, &first);
nsent = 0;
for (nsent = 0; nsent < ping6_params.pingcount; nsent++) {
/* capture the start tick to calculate rtt */
(void)clock_gettime(CLOCK_MONOTONIC_RAW, &start);
@@ -2234,13 +2232,13 @@ u32_t osShellPing6(int argc, const char **argv)
}
if ((u32_t)ret < sizeof(struct icmp6_echo_hdr *)) {
/* Drop the packet if its too short [Doesnot contain even the header !!] */
/* Drop the packet if its too short [Doesn't contain even the header !!] */
PRINTK("ping6 : received ICMP echo response too short\n");
goto REDUCE_SELECT_TIME;
}
/* Acceping the ICMPv6 payload. */
/* Here, pbuf_resp->payload wont contain IPv6 Header since its an AF_INET6 RAW Socket */
/* Here, pbuf_resp->payload won't contain IPv6 Header since its an AF_INET6 RAW Socket */
iecho_resp = (struct icmp6_echo_hdr *)pbuf_resp->payload;
if (iecho_resp->id == icmpv6_id) {
@@ -2283,7 +2281,7 @@ u32_t osShellPing6(int argc, const char **argv)
/* Checking if its a delayed packet */
if ((iecho_resp->seqno != icmpv6_seq) && (nsent < ping6_params.pingcount)) {
/* Incase of delayed packet wait on socket for other response before sending a new PING */
/* In case of delayed packet wait on socket for other response before sending a new PING */
/* We have to reduce the timeout value now when selecting on socket */
goto REDUCE_SELECT_TIME;
}
@@ -2311,9 +2309,10 @@ REDUCE_SELECT_TIME:
PRINTK("--- %s ping statistics ---\n", argv[ping6_params.host_index]);
PRINTK("%d packets transmitted, %d received, %.2f%% packet loss, time %dms\n",
nsent, nrecieve, (float)(((float)(nsent - nrecieve)) * ((float)(100)) / ((float)(nsent))),
/* 1000: convert seconds to milliseconds, 1000000: convert nanoseconds to milliseconds */
((last.tv_sec - first.tv_sec) * 1000 + (last.tv_nsec - first.tv_nsec) / 1000000));
if (nrecieve) {
/* Display rtt stats only if atleast one packet is received */
/* Display rtt stats only if at least one packet is received */
PRINTK("rtt min/avg/max = %u/%.2f/%u ms\n", ping6_stats.min_rtt, ping6_stats.avg_rtt, ping6_stats.max_rtt);
}
@@ -2629,7 +2628,7 @@ usage:
SHELLCMD_ENTRY(ntpdate_shellcmd, CMD_TYPE_EX, "ntpdate", XARGS, (CmdCallBackFunc)osShellNtpdate);
#endif /* LOSCFG_SHELL_CMD_DEBUG */
#endif /* LWIP_SNTP*/
#endif /* LWIP_SNTP */
#if LWIP_DNS
u32_t osShellDns(int argc, const char **argv)
@@ -2778,7 +2777,7 @@ int netstat_get_udp_sendQLen6(struct udp_pcb *udppcb, struct pbuf *udpbuf)
goto FUNC_OUT;
}
/* check if there is enough space for atleast udp header available */
/* check if there is enough space for at least udp header available */
if (udpbuf->tot_len < UDP_HLEN) {
goto FUNC_OUT;
}
@@ -2866,7 +2865,7 @@ int netstat_tcp_recvq(struct tcp_pcb *tpcb)
case NETCONN_UDP_IPV6:
#endif
case NETCONN_UDP:
SYS_ARCH_GET(((unsigned int)conn->recv_avail /*+ conn->lrcv_left*/), retVal);
SYS_ARCH_GET(((unsigned int)conn->recv_avail), retVal); // + conn->lrcv_left
break;
default:
retVal = 0; /* ur... very ugly, damn DHCP DNS and SNTP */
@@ -2922,7 +2921,7 @@ int netstat_udp_sendq6(struct udp_pcb *upcb)
#else
ret = netstat_get_udp_sendQLen6(upcb, neighbor_cache[idx].q);
if (ret >= 0) {
retLen += ret;
retLen += ret;
}
#endif
return retLen;
@@ -2966,10 +2965,10 @@ int netstat_udp_sendq(struct udp_pcb *upcb)
#else
ret = netstat_get_udp_sendQLen(upcb, arp_table[arpidx].q);
if (ret > 0) {
retLen += ret;
if (retLen <= 0) { // overflow, set rteLen = -1 to indicate
retLen = -1;
}
retLen += ret;
if (retLen <= 0) { // overflow, set rteLen = -1 to indicate
retLen = -1;
}
}
#endif
}
@@ -2992,7 +2991,7 @@ int netstat_netconn_recvq(const struct netconn *conn)
case NETCONN_PKT_RAW:
#endif
case NETCONN_UDP:
SYS_ARCH_GET(((unsigned int)conn->recv_avail /*+ conn->lrcv_left*/), retVal);
SYS_ARCH_GET(((unsigned int)conn->recv_avail), retVal); // + conn->lrcv_left
break;
default:
retVal = 0; /* ur... very ugly, damn DHCP DNS and SNTP */
@@ -3019,8 +3018,8 @@ int netstat_netconn_sendq(struct netconn *conn)
#if PF_PKT_SUPPORT
case NETCONN_PKT_RAW:
retVal = 0; /* always be 0 as frame send to driver directly */
#endif
break;
#endif
case NETCONN_UDP:
retVal = netstat_udp_sendq(conn->pcb.udp);
break;
@@ -3169,7 +3168,6 @@ void netstat_internal(void *ctx)
}
/* For listen PCBs */
recvQlen = 0;
sendQlen = 0;
for (lpcb = tcp_listen_pcbs.listen_pcbs; lpcb != NULL; lpcb = lpcb->next) {
@@ -3271,10 +3269,10 @@ void netstat_internal(void *ctx)
recvQlen = netstat_netconn_recvq(rpcb->recv_arg);
sendQlen = netstat_netconn_sendq(rpcb->recv_arg);
proto = rpcb->protocol;//raw_proto;
proto = rpcb->protocol; // raw_proto;
iRet = snprintf_s((char *)(entry_buf + entry_buf_offset), entry_buf_len, entry_buf_len - 1,
"%-8s%-12d%-12d%-20s%-20s%-16u%-16d\n",
"raw", recvQlen, sendQlen, local_ip_port, remote_ip_port, proto, /*rpcb->hdrincl*/0);
"raw", recvQlen, sendQlen, local_ip_port, remote_ip_port, proto, 0); // rpcb->hdrincl
if ((iRet <= 0) || ((u32_t)(iRet) >= entry_buf_len)) {
goto out;
}
@@ -3297,7 +3295,8 @@ void netstat_internal(void *ctx)
sendQlen = netstat_netconn_sendq(rpcb->recv_arg);
for (netif = netif_list; netif != NULL; netif = netif->next) {
if (netif_get_index(netif)/*netif->ifindex*/ == rpcb->netif_idx/*index*/) {
/* netif->ifindex and index */
if (netif_get_index(netif) == rpcb->netif_idx) {
(void)snprintf_s((char *)netif_name, IFNAMSIZ, IFNAMSIZ - 1, "%s", netif_get_name(netif));
break;
}
@@ -3307,7 +3306,7 @@ void netstat_internal(void *ctx)
(void)snprintf_s((char *)netif_name, IFNAMSIZ, IFNAMSIZ - 1, "%s", "None");
}
proto = rpcb->protocol;//ntohs(rpcb->proto.eth_proto);
proto = rpcb->protocol; // ntohs(rpcb->proto.eth_proto);
iRet = snprintf_s((char *)(entry_buf + entry_buf_offset), entry_buf_len, entry_buf_len - 1,
"%-12s%-12d%-12d%-16x%-12s\n", "pkt-raw", recvQlen, sendQlen, proto, netif_name);
@@ -3668,7 +3667,7 @@ u32_t netdebug_sock(int argc, const char **argv)
int idx;
u32_t ret = LOS_NOK;
if (argc == 2) {
if (argc == 2) { /* 2: Number of command parameters */
if (!strcmp("-i", argv[1])) {
/* netdebug sock -i */
for (idx = 0; idx < (int)LWIP_CONFIG_NUM_SOCKETS; idx++) {
@@ -3676,10 +3675,9 @@ u32_t netdebug_sock(int argc, const char **argv)
}
ret = LOS_OK;
}
} else if (argc == 3) {
} else if (argc == 3) { /* 3: Number of command parameters */
if (!strcmp("-d", argv[1])) {
/* netdebug sock -d <idx> */
idx = atoi(argv[2]);
idx = atoi(argv[2]); /* 2: netdebug sock -d <idx> */
if (idx >= 0) {
debug_socket_info(idx, 1, 1);
ret = LOS_OK;
@@ -3796,8 +3794,9 @@ u32_t osShellIpDebug(int argc, const char **argv)
PRINTK("%-50s ", acIPv6Addr);
if (snprintf_s(aclladdr, sizeof(aclladdr), sizeof(aclladdr) - 1, "%02X:%02X:%02X:%02X:%02X:%02X",
neighbor_cache[i].lladdr[0], neighbor_cache[i].lladdr[1], neighbor_cache[i].lladdr[2],
neighbor_cache[i].lladdr[3], neighbor_cache[i].lladdr[4], neighbor_cache[i].lladdr[5]) < 0) {
neighbor_cache[i].lladdr[0], neighbor_cache[i].lladdr[1], /* 0, 1, member number */
neighbor_cache[i].lladdr[2], neighbor_cache[i].lladdr[3], /* 2, 3, member number */
neighbor_cache[i].lladdr[4], neighbor_cache[i].lladdr[5]) < 0) { /* 4, 5, member number */
return LOS_NOK;
}
PRINTK("%-25s ", aclladdr);
@@ -3884,4 +3883,4 @@ SHELLCMD_ENTRY(reboot_shellcmd, CMD_TYPE_EX, "reboot", XARGS, (CmdCallBackFunc)o
#endif /* LOSCFG_SHELL_CMD_DEBUG */
#endif
#endif //LWIP_ENABLE_LOS_SHELL_CMD
#endif // LWIP_ENABLE_LOS_SHELL_CMD

View File

@@ -1,6 +1,6 @@
/*
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
* Copyright (c) 2020-2022 Huawei Device Co., Ltd. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
@@ -435,9 +435,9 @@ LWIP_STATIC void handle_discover(struct netif *netif, struct dhcps *dhcps,
}
#else
else {
LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE,
("handle_discover: sendto(OFFER, IP_ADDR_BROADCAST, DHCP_CLIENT_PORT)\n"));
(void)udp_sendto_if_src(dhcps->pcb, out_msg, IP_ADDR_BROADCAST, DHCP_CLIENT_PORT, netif, &(netif->ip_addr));
LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE,
("handle_discover: sendto(OFFER, IP_ADDR_BROADCAST, DHCP_CLIENT_PORT)\n"));
(void)udp_sendto_if_src(dhcps->pcb, out_msg, IP_ADDR_BROADCAST, DHCP_CLIENT_PORT, netif, &(netif->ip_addr));
}
#endif
@@ -601,7 +601,7 @@ LWIP_STATIC void handle_request(struct netif *netif, struct dhcps *dhcps, struct
dhcp_common_option_byte(srvr_msg, DHCP_NAK, &options_len);
/* Just set this here, so that the NAK message is brcasted.
The correct flags has already been added in the respose message during base message creation */
The correct flags has already been added in the response message during base message creation */
client_msg->flags |= htons(DHCP_BROADCAST_FLAG);
client_msg->ciaddr.addr = 0; /* This is done so that NAK Gets brcasted */
#ifdef LWIP_DEV_DEBUG

Some files were not shown because too many files have changed in this diff Show More