Compare commits
74 Commits
weekly_202
...
weekly_202
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3119d83a6a | ||
|
|
8482c9d7be | ||
|
|
248e9f7089 | ||
|
|
f2a35262bd | ||
|
|
794cdae65f | ||
|
|
7975f5c8ef | ||
|
|
fc4c694235 | ||
|
|
ead4da80ba | ||
|
|
8d980ded54 | ||
|
|
07e3feb456 | ||
|
|
b5ce4d34df | ||
|
|
99c81c4ffa | ||
|
|
4d1fd22b1c | ||
|
|
efa336ab26 | ||
|
|
0b05a46691 | ||
|
|
177f32283f | ||
|
|
6888193e3f | ||
|
|
6c352a7b10 | ||
|
|
73a9587f02 | ||
|
|
cbd03bd7e0 | ||
|
|
8d55bb1d8c | ||
|
|
e7daa28200 | ||
|
|
987a722d2d | ||
|
|
ccdfa72431 | ||
|
|
557a71c1c3 | ||
|
|
569aecb6ea | ||
|
|
8c0b7d0f38 | ||
|
|
c488817b32 | ||
|
|
43d47a27e3 | ||
|
|
a83f916298 | ||
|
|
8dbfd3846e | ||
|
|
f34762c105 | ||
|
|
043e84dfcb | ||
|
|
453c376198 | ||
|
|
204d7a4abb | ||
|
|
f2861a84bf | ||
|
|
96b2d557ac | ||
|
|
ffa11535ca | ||
|
|
b581207045 | ||
|
|
5105249ecf | ||
|
|
a61e2cf16e | ||
|
|
39e25c5220 | ||
|
|
5541965365 | ||
|
|
edd2223083 | ||
|
|
22392965b5 | ||
|
|
d906bb91ea | ||
|
|
51f6a20723 | ||
|
|
325ea29df3 | ||
|
|
c2f9f6705f | ||
|
|
71e51d8813 | ||
|
|
e0b4fcb23d | ||
|
|
7d62d3d62b | ||
|
|
69f3bf3a2a | ||
|
|
2590e34346 | ||
|
|
660b314f90 | ||
|
|
44ec199465 | ||
|
|
7437408f65 | ||
|
|
1134332a58 | ||
|
|
8099f6578d | ||
|
|
ba23a26f95 | ||
|
|
2dc24da826 | ||
|
|
6302c5f767 | ||
|
|
f0d5959576 | ||
|
|
65790b67d5 | ||
|
|
9eff5cff1d | ||
|
|
99ea8d4ed2 | ||
|
|
1568c317bb | ||
|
|
5e70129199 | ||
|
|
089376994a | ||
|
|
12adfd5832 | ||
|
|
c46c5a640d | ||
|
|
c812b0c27b | ||
|
|
059c1c22b1 | ||
|
|
0164461b33 |
@@ -10,6 +10,12 @@
|
||||
### 测试用例(新增、改动、可能影响的功能)
|
||||
|
||||
|
||||
### 是否涉及对外变更(典型的如:对外API规格变更、新增对外接口等等)
|
||||
|
||||
必须选择一项(在MarkDown模式下用[x]替换[ ]即可勾选对应选项):
|
||||
- [ ] 是,涉及对外变更: 需要在commit message中按【[模板要求](https://gitee.com/openharmony/kernel_liteos_a/wikis/Commit%20message%20%E8%A7%84%E8%8C%83)】描述变更点
|
||||
- [ ] 否,不涉及对外变更
|
||||
|
||||
### 是否需要同步至release(如:3.0LTS ... )分支?
|
||||
|
||||
必须选择一项(在MarkDown模式下用[x]替换[ ]即可勾选对应选项):
|
||||
|
||||
2
BUILD.gn
2
BUILD.gn
@@ -323,7 +323,7 @@ group("liteos_a") {
|
||||
deps += [
|
||||
":apps",
|
||||
":tests",
|
||||
"//prebuilts/lite/sysroot/build:strip",
|
||||
"//third_party/musl/scripts/build_lite:strip",
|
||||
]
|
||||
if (liteos_skip_make == false) {
|
||||
deps += [ ":make" ]
|
||||
|
||||
338
CHANGELOG.md
Normal file
338
CHANGELOG.md
Normal file
@@ -0,0 +1,338 @@
|
||||
# (2022-03-30)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
|
||||
* **arm-virt:** HW_RANDOM_ENABLE配置支持arm virt平台 ([68f9f49](https://gitee.com/openharmony/kernel_liteos_a/commits/68f9f49c2a62d3271db14ccb896c9f9fc78a60e4))
|
||||
* A核代码静态告警定期清理 ([9ba725c](https://gitee.com/openharmony/kernel_liteos_a/commits/9ba725c3d486dd28fe9b2489b0f95a65354d7d86)), closes [#I4I0O8](https://gitee.com/openharmony/kernel_liteos_a/issues/I4I0O8)
|
||||
* change default permission of procfs to 0550 ([a776c04](https://gitee.com/openharmony/kernel_liteos_a/commits/a776c04a3da414f73ef7136a543c029cc6dd75be)), closes [#I4NY49](https://gitee.com/openharmony/kernel_liteos_a/issues/I4NY49)
|
||||
* change the execFile field in TCB to execVnode ([e4a0662](https://gitee.com/openharmony/kernel_liteos_a/commits/e4a06623ceb49b5bead60d45c0534db88b9c666f)), closes [#I4CLL9](https://gitee.com/openharmony/kernel_liteos_a/issues/I4CLL9)
|
||||
* close file when process interpretor failed ([a375bf5](https://gitee.com/openharmony/kernel_liteos_a/commits/a375bf5668a5e86e082d0e124b538e423023a259)), closes [#I4](https://gitee.com/openharmony/kernel_liteos_a/issues/I4)
|
||||
* codex 清理 ([9ab3e35](https://gitee.com/openharmony/kernel_liteos_a/commits/9ab3e351d38cdae2ec083048a50a253bc2a3b604)), closes [#I4BL3](https://gitee.com/openharmony/kernel_liteos_a/issues/I4BL3)
|
||||
* dyload open close failed ([5e87d8c](https://gitee.com/openharmony/kernel_liteos_a/commits/5e87d8c183471166294e2caa041ab4da8570c6a1)), closes [#I452Z7](https://gitee.com/openharmony/kernel_liteos_a/issues/I452Z7)
|
||||
* fix ppoll ([a55f68f](https://gitee.com/openharmony/kernel_liteos_a/commits/a55f68f957e9f8ad74bd9e0c1b3d27775e0f8c75))
|
||||
* fix some function declarations ([63fd8bc](https://gitee.com/openharmony/kernel_liteos_a/commits/63fd8bc39b21fffb6990f74e879eefecafad6c88))
|
||||
* implicit declaration of function 'syscall' in apps/shell ([bd0c083](https://gitee.com/openharmony/kernel_liteos_a/commits/bd0c0835fc58ed5f941dbbc9adfac74253eeb874))
|
||||
* LOS_Panic和魔法键功能中的使用PRINTK打印,依赖任务调度,特殊情况下存在打印不出来的问题 ([53addea](https://gitee.com/openharmony/kernel_liteos_a/commits/53addea304de09e0df457b690403ac652bbcea72)), closes [#I4NOC7](https://gitee.com/openharmony/kernel_liteos_a/issues/I4NOC7)
|
||||
* los_stat_pri.h中缺少依赖的头文件 ([2cd03c5](https://gitee.com/openharmony/kernel_liteos_a/commits/2cd03c55b7a614c648adc965ebfe494d491fe20f)), closes [#I4KEZ1](https://gitee.com/openharmony/kernel_liteos_a/issues/I4KEZ1)
|
||||
* los_trace.h接口注释错误修正 ([6d24961](https://gitee.com/openharmony/kernel_liteos_a/commits/6d249618aecc216388f9b1a2b48fe0ac6dd19ff2)), closes [#I4](https://gitee.com/openharmony/kernel_liteos_a/issues/I4)
|
||||
* MMU竞态问题修复 ([748e0d8](https://gitee.com/openharmony/kernel_liteos_a/commits/748e0d8ffb6ee9c8757ed056f575e3abc6c10702)), closes [#I2](https://gitee.com/openharmony/kernel_liteos_a/issues/I2)
|
||||
* **mtd:** 去除mtd对hisilicon驱动的依赖 ([f7d010d](https://gitee.com/openharmony/kernel_liteos_a/commits/f7d010dfa4cb825096267528e131a9e2735d7505)), closes [#I49](https://gitee.com/openharmony/kernel_liteos_a/issues/I49)
|
||||
* OsFutexWaitParamCheck函数中absTime为0时,直接返回,不需要打印 ([3f71be7](https://gitee.com/openharmony/kernel_liteos_a/commits/3f71be75355f11037d9de80cc4d7da0f01905003)), closes [#I4D67](https://gitee.com/openharmony/kernel_liteos_a/issues/I4D67)
|
||||
* OsLockDepCheckIn异常处理中存在g_lockdepAvailable锁嵌套调用, ([bf030b6](https://gitee.com/openharmony/kernel_liteos_a/commits/bf030b6bb5843151a5b8b8736246a1376a5fb9d0)), closes [#I457](https://gitee.com/openharmony/kernel_liteos_a/issues/I457)
|
||||
* pr模板补充说明 ([e3cd485](https://gitee.com/openharmony/kernel_liteos_a/commits/e3cd485db528490a16a8932d734faab263b44bc9))
|
||||
* same file mode for procfs files ([c79bcd0](https://gitee.com/openharmony/kernel_liteos_a/commits/c79bcd028e1be34b45cba000077230fa2ef95e68)), closes [#I4](https://gitee.com/openharmony/kernel_liteos_a/issues/I4)
|
||||
* shell支持exit退出,完善帮助信息,特殊处理不可见字符 ([cc6e112](https://gitee.com/openharmony/kernel_liteos_a/commits/cc6e11281e63b6bdc9be8e5d3c39f1258eb2ceaa))
|
||||
* smp初始化中副核冗余的启动框架调用 ([5ce70a5](https://gitee.com/openharmony/kernel_liteos_a/commits/5ce70a50c3733b6ec8cc4b444837e366ec837f69)), closes [#I4F8A5](https://gitee.com/openharmony/kernel_liteos_a/issues/I4F8A5)
|
||||
* solve SIGCHLD ignored in sigsuspend() ([5a80d4e](https://gitee.com/openharmony/kernel_liteos_a/commits/5a80d4e1a34c94204a0bb01443bf25a4fdb12750)), closes [#I47](https://gitee.com/openharmony/kernel_liteos_a/issues/I47)
|
||||
* syscall review bugfix ([214f44e](https://gitee.com/openharmony/kernel_liteos_a/commits/214f44e935277c29d347c50b553a31ea7df36448)), closes [#149](https://gitee.com/openharmony/kernel_liteos_a/issues/149)
|
||||
* **test:** misc09用例因依赖hosts文件而失败 ([f2f5c5f](https://gitee.com/openharmony/kernel_liteos_a/commits/f2f5c5fdc3202610de173e7046adab4df5e59142)), closes [re#I48IZ0](https://gitee.com/re/issues/I48IZ0)
|
||||
* **test:** 修复sys部分用例因依赖passwd、group文件而失败 ([614cdcc](https://gitee.com/openharmony/kernel_liteos_a/commits/614cdccf91bd2d220c4c76418b53400ce714c6cb)), closes [re#I48](https://gitee.com/re/issues/I48)
|
||||
* 中断中调用PRINTK概率卡死,导致系统不能正常响应中断 ([9726ba1](https://gitee.com/openharmony/kernel_liteos_a/commits/9726ba11a79f3d2d1e616e12ef0bb44e4fc5cd20)), closes [#I4C9](https://gitee.com/openharmony/kernel_liteos_a/issues/I4C9)
|
||||
* 临终遗言重定向内容缺失task相关信息,对应的shell命令中申请的内存需要cacheline对齐 ([48ca854](https://gitee.com/openharmony/kernel_liteos_a/commits/48ca854bf07f8dcda9657f950601043a485a1b33)), closes [#I482S5](https://gitee.com/openharmony/kernel_liteos_a/issues/I482S5)
|
||||
* 优化liteipc任务状态,删除功能重复字段 ([5004ef4](https://gitee.com/openharmony/kernel_liteos_a/commits/5004ef4d87b54fb6d7f748ca8212ae155bcefac5)), closes [#I4](https://gitee.com/openharmony/kernel_liteos_a/issues/I4)
|
||||
* 优化trace buffer初始化,删除swtmr 桩中的无效参数 ([b551270](https://gitee.com/openharmony/kernel_liteos_a/commits/b551270ef50cb206360e2eee3dd20ace5cecccb7)), closes [#I4DQ1](https://gitee.com/openharmony/kernel_liteos_a/issues/I4DQ1)
|
||||
* 修复 virpart.c 不适配的格式化打印问题 ([de29140](https://gitee.com/openharmony/kernel_liteos_a/commits/de29140edf2567f4847876cb1ed5e0b6857420f3)), closes [#I4](https://gitee.com/openharmony/kernel_liteos_a/issues/I4)
|
||||
* 修复A核文档失效的问题 ([456d255](https://gitee.com/openharmony/kernel_liteos_a/commits/456d255a81c2031be8ebecc2bf897af80c3d3c7a)), closes [#I4U7](https://gitee.com/openharmony/kernel_liteos_a/issues/I4U7)
|
||||
* 修复A核测试用例失败的问题 ([59329ce](https://gitee.com/openharmony/kernel_liteos_a/commits/59329ce7c6b6a00084df427748e6283287a773c0)), closes [#I4](https://gitee.com/openharmony/kernel_liteos_a/issues/I4)
|
||||
* 修复A核测试用例失败的问题 ([be68dc8](https://gitee.com/openharmony/kernel_liteos_a/commits/be68dc8bcaf8d965039ae1d792775f00a08adfac)), closes [#I4](https://gitee.com/openharmony/kernel_liteos_a/issues/I4)
|
||||
* 修复dispatch单词拼写错误。 ([9b07aec](https://gitee.com/openharmony/kernel_liteos_a/commits/9b07aece2dfa3494cf35e8b388410341508d6224)), closes [#I4BLE8](https://gitee.com/openharmony/kernel_liteos_a/issues/I4BLE8)
|
||||
* 修复futime提示错误22的BUG ([f2861dd](https://gitee.com/openharmony/kernel_liteos_a/commits/f2861ddfb424af7b99c278273601ce0fab1f37e6))
|
||||
* 修复jffs2适配层错误释放锁的BUG ([011a55f](https://gitee.com/openharmony/kernel_liteos_a/commits/011a55ff21d95f969abac60bcff96f4c4d7a326d)), closes [#I4FH9](https://gitee.com/openharmony/kernel_liteos_a/issues/I4FH9)
|
||||
* 修复los_vm_scan.c中内部函数OsInactiveListIsLow冗余代码 ([bc32a1e](https://gitee.com/openharmony/kernel_liteos_a/commits/bc32a1ec0fa5d19c6d2672bcf4a01de5e1be3afb)), closes [#I4](https://gitee.com/openharmony/kernel_liteos_a/issues/I4)
|
||||
* 修复LOSCFG_FS_FAT_CACHE宏关闭后编译失败的BUG ([63e71fe](https://gitee.com/openharmony/kernel_liteos_a/commits/63e71feca05a8d46a49822c713258738740f0712)), closes [#I3T3N0](https://gitee.com/openharmony/kernel_liteos_a/issues/I3T3N0)
|
||||
* 修复OsVmPhysFreeListAdd和OsVmPhysFreeListAddUnsafe函数内容重复 ([6827bd2](https://gitee.com/openharmony/kernel_liteos_a/commits/6827bd2a22b78aa05e20d6460412fc7b2d738929)), closes [#I4FL95](https://gitee.com/openharmony/kernel_liteos_a/issues/I4FL95)
|
||||
* 修复PR520缺陷 ([4033891](https://gitee.com/openharmony/kernel_liteos_a/commits/40338918d9132399ee0494d331930a05b7a13c67)), closes [re#I4DEG5](https://gitee.com/re/issues/I4DEG5)
|
||||
* 修复shcmd.h需要用宏包起来的问题 ([6c4e4b1](https://gitee.com/openharmony/kernel_liteos_a/commits/6c4e4b16abe9c68fea43d40b2d39b4f0ed4bfc9c)), closes [#I4N50](https://gitee.com/openharmony/kernel_liteos_a/issues/I4N50)
|
||||
* 修复xts权限用例压测异常问题 ([b0d31cb](https://gitee.com/openharmony/kernel_liteos_a/commits/b0d31cb43f5a8d1c3da574b2b957e3b0e98b3067)), closes [#I3ZJ1](https://gitee.com/openharmony/kernel_liteos_a/issues/I3ZJ1)
|
||||
* 修复硬随机不可用时,地址随机化不可用问题 ([665c152](https://gitee.com/openharmony/kernel_liteos_a/commits/665c152c27bb86395ddd0395279255f6cdaf7255)), closes [#I4D4](https://gitee.com/openharmony/kernel_liteos_a/issues/I4D4)
|
||||
* 修复进程用例导致门禁概率失败 ([1ed28b4](https://gitee.com/openharmony/kernel_liteos_a/commits/1ed28b4c80cfd222be08b0c2e71e6287e52bb276)), closes [#I4FO0](https://gitee.com/openharmony/kernel_liteos_a/issues/I4FO0)
|
||||
* 修复进程线程不稳定用例 ([f6ac03d](https://gitee.com/openharmony/kernel_liteos_a/commits/f6ac03d3e3c56236adc5734d4c059f1fbcc9e0c1)), closes [#I4F1](https://gitee.com/openharmony/kernel_liteos_a/issues/I4F1)
|
||||
* 修复重复执行内存用例导致系统卡死问题 ([6c2b163](https://gitee.com/openharmony/kernel_liteos_a/commits/6c2b163c7d7c696ef89b17a0275f3cddb3d7cefb)), closes [#I4F7](https://gitee.com/openharmony/kernel_liteos_a/issues/I4F7)
|
||||
* 修改MMU模块的注释错误 ([1a8e22d](https://gitee.com/openharmony/kernel_liteos_a/commits/1a8e22dcf15944153e013d004fd7bbf24557a8c7)), closes [#I4](https://gitee.com/openharmony/kernel_liteos_a/issues/I4)
|
||||
* 共享内存问题修复 ([9fdb80f](https://gitee.com/openharmony/kernel_liteos_a/commits/9fdb80f85f92d0167a0456455a94fc6f679797ce)), closes [#I47X2](https://gitee.com/openharmony/kernel_liteos_a/issues/I47X2)
|
||||
* 内核ERR打印,无进程和线程信息,不方便问题定位。 ([cb423f8](https://gitee.com/openharmony/kernel_liteos_a/commits/cb423f845462b8cc474c3cba261dadf3943a08ef)), closes [#I4](https://gitee.com/openharmony/kernel_liteos_a/issues/I4)
|
||||
* 内核ERR级别及以上的打印输出当前进程和线程名 ([540b201](https://gitee.com/openharmony/kernel_liteos_a/commits/540b2017c5460e300365d2039a08abd5945cec6b))
|
||||
* 内源检视测试用例问题修复 ([a6ac759](https://gitee.com/openharmony/kernel_liteos_a/commits/a6ac7597f85043ba6de3a1b395ca676d85c65ea7))
|
||||
* 删除冗余的头文件 ([8e614bb](https://gitee.com/openharmony/kernel_liteos_a/commits/8e614bb1616b75bc89eee7ad7da49b7a9c285b47)), closes [#I4KN63](https://gitee.com/openharmony/kernel_liteos_a/issues/I4KN63)
|
||||
* 增加pselect SYSCALL函数及测试用例 ([f601c16](https://gitee.com/openharmony/kernel_liteos_a/commits/f601c16b9e67d531dda51fc18389a53db4360b7b)), closes [#I45](https://gitee.com/openharmony/kernel_liteos_a/issues/I45)
|
||||
* 增加内核epoll系统调用 ([2251b8a](https://gitee.com/openharmony/kernel_liteos_a/commits/2251b8a2d1f649422dd67f8551b085a7e0c63ec7)), closes [#I4](https://gitee.com/openharmony/kernel_liteos_a/issues/I4)
|
||||
* 实现了musl库net模块中的一些函数接口和相应的测试用例 ([3d00a7d](https://gitee.com/openharmony/kernel_liteos_a/commits/3d00a7d23a96f29c138cfc1672825b90b9e0c05e)), closes [#I4JQI1](https://gitee.com/openharmony/kernel_liteos_a/issues/I4JQI1)
|
||||
* 添加进程线程冒烟用例 ([2be5968](https://gitee.com/openharmony/kernel_liteos_a/commits/2be59680f2fb0801b43522cd38cc387c8ff38766)), closes [#I4](https://gitee.com/openharmony/kernel_liteos_a/issues/I4)
|
||||
* 用户态进程主线程退出时,其他子线程刚好进入异常处理流程会导致系统卡死 ([d955790](https://gitee.com/openharmony/kernel_liteos_a/commits/d955790a44a679421798ec1ac2900b4d75dd75a4)), closes [#I4](https://gitee.com/openharmony/kernel_liteos_a/issues/I4)
|
||||
* 编码规范修改 ([d161a0b](https://gitee.com/openharmony/kernel_liteos_a/commits/d161a0b03de046c05fff45a2b625631b4e45a347))
|
||||
* 编码规范问题修复 ([f60bc94](https://gitee.com/openharmony/kernel_liteos_a/commits/f60bc94cf231bc615ff6603ca0393b8fe33a8c47))
|
||||
* 编译框架在做编译入口的统一 ([bdb9864](https://gitee.com/openharmony/kernel_liteos_a/commits/bdb9864436a6f128a4c3891bbd63e3c60352689f)), closes [#I4](https://gitee.com/openharmony/kernel_liteos_a/issues/I4)
|
||||
* 解决dmesg -s参数double lock问题 ([e151256](https://gitee.com/openharmony/kernel_liteos_a/commits/e1512566e322eb1fbc8f5d5997f9bfcd022feac7)), closes [#I4](https://gitee.com/openharmony/kernel_liteos_a/issues/I4)
|
||||
* 进程退出前自己回收vmspace中的所有region ([298ccea](https://gitee.com/openharmony/kernel_liteos_a/commits/298ccea3fedaccc651b38973f0455fa1ce12e516)), closes [#I4](https://gitee.com/openharmony/kernel_liteos_a/issues/I4)
|
||||
* 通过g_uart_fputc_en关闭打印后,shell进程不能正常启动 ([d21b05c](https://gitee.com/openharmony/kernel_liteos_a/commits/d21b05c0f69877130366ad37b852a0f30c11809d)), closes [#I4CTY2](https://gitee.com/openharmony/kernel_liteos_a/issues/I4CTY2)
|
||||
* 针对pr是否同步至release分支,增加原因说明规则 ([b37a7b7](https://gitee.com/openharmony/kernel_liteos_a/commits/b37a7b79292d93dae6c4914952b5f3bb509e8721))
|
||||
* 非当前进程销毁时,销毁liteipc时错误的销毁了当前进程的liteipc资源 ([0f0e85b](https://gitee.com/openharmony/kernel_liteos_a/commits/0f0e85b7a6bf76d540925fbf661c483c8dba1cba)), closes [#I4FSA7](https://gitee.com/openharmony/kernel_liteos_a/issues/I4FSA7)
|
||||
|
||||
|
||||
### Code Refactoring
|
||||
|
||||
* los_cir_buf.c中接口整合 ([0d325c5](https://gitee.com/openharmony/kernel_liteos_a/commits/0d325c56a1053043db05d53a6c8083f4d35f116b)), closes [#I4MC13](https://gitee.com/openharmony/kernel_liteos_a/issues/I4MC13)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
|
||||
* add option SIOCGIFBRDADDR for ioctl ([4ecc473](https://gitee.com/openharmony/kernel_liteos_a/commits/4ecc473843207d259613d26b8ee176d75e7f00fd)), closes [#I4](https://gitee.com/openharmony/kernel_liteos_a/issues/I4)
|
||||
* add sync() to vfs ([f67c4da](https://gitee.com/openharmony/kernel_liteos_a/commits/f67c4dae5141914df2e069dce0196b14780649d8)), closes [#I480](https://gitee.com/openharmony/kernel_liteos_a/issues/I480)
|
||||
* **build:** support gcc toolchain ([6e886d4](https://gitee.com/openharmony/kernel_liteos_a/commits/6e886d4233dec3b82a27642f174b920e5f98f6aa))
|
||||
* L0-L1 支持Perf ([6e0a3f1](https://gitee.com/openharmony/kernel_liteos_a/commits/6e0a3f10bbbfe29d110c050da927684b6d77b961)), closes [#I47I9](https://gitee.com/openharmony/kernel_liteos_a/issues/I47I9)
|
||||
* L0~L1 支持Lms ([e748fdb](https://gitee.com/openharmony/kernel_liteos_a/commits/e748fdbe578a1ddd8eb10b2e207042676231ba26)), closes [#I4](https://gitee.com/openharmony/kernel_liteos_a/issues/I4)
|
||||
* liteipc 静态内存优化 ([5237924](https://gitee.com/openharmony/kernel_liteos_a/commits/52379242c109e0cf442784dbe811ff9d42d5f33a)), closes [#I4G4](https://gitee.com/openharmony/kernel_liteos_a/issues/I4G4)
|
||||
* page cache backed by vnode instead of filep ([38a6b80](https://gitee.com/openharmony/kernel_liteos_a/commits/38a6b804e9291d2fdbd189825ebd7d56165ec51c)), closes [#I44](https://gitee.com/openharmony/kernel_liteos_a/issues/I44)
|
||||
* 提供低功耗默认处理框架 ([212d1bd](https://gitee.com/openharmony/kernel_liteos_a/commits/212d1bd1e806530fe7e7a16ea986cb2c6fb084ed)), closes [#I4KBG9](https://gitee.com/openharmony/kernel_liteos_a/issues/I4KBG9)
|
||||
* 支持AT_RANDOM以增强用户态栈保护能力 ([06ea037](https://gitee.com/openharmony/kernel_liteos_a/commits/06ea03715f0cfb8728fadd0d9c19a403dc8f6028)), closes [#I4CB8](https://gitee.com/openharmony/kernel_liteos_a/issues/I4CB8)
|
||||
* 支持L1 低功耗框架 ([64e49ab](https://gitee.com/openharmony/kernel_liteos_a/commits/64e49aba7c9c7d2280c5b3f29f04b17b63209855)), closes [#I4](https://gitee.com/openharmony/kernel_liteos_a/issues/I4)
|
||||
* 支持LOS_TaskJoin 和 LOS_TaskDetach ([37bc11f](https://gitee.com/openharmony/kernel_liteos_a/commits/37bc11fa8837a3019a0a56702f401ec1845f6547)), closes [#I4](https://gitee.com/openharmony/kernel_liteos_a/issues/I4)
|
||||
* 新增解析异常和backtrace信息脚本 ([7019fdf](https://gitee.com/openharmony/kernel_liteos_a/commits/7019fdfcbb33c660e8aa9fd399d5fccbd7e23b49)), closes [#I47](https://gitee.com/openharmony/kernel_liteos_a/issues/I47)
|
||||
* 调度tick响应时间计算优化 ([f47da44](https://gitee.com/openharmony/kernel_liteos_a/commits/f47da44b39be7fa3e9b5031d7b79b9bef1fd4fbc))
|
||||
* 调度去进程化,优化进程线程依赖关系 ([dc479fb](https://gitee.com/openharmony/kernel_liteos_a/commits/dc479fb7bd9cb8441e4e47d44b42110ea07d76a2))
|
||||
* 调度相关模块间依赖优化 ([0e3936c](https://gitee.com/openharmony/kernel_liteos_a/commits/0e3936c4f8b8bcfc48d283a6d53413e0fc0619b3)), closes [#I4](https://gitee.com/openharmony/kernel_liteos_a/issues/I4)
|
||||
* 进程cpup占用率结构优化为动态分配 ([f06e090](https://gitee.com/openharmony/kernel_liteos_a/commits/f06e090a1085a654fd726fbc3c3a1c2bc703d663)), closes [#I4](https://gitee.com/openharmony/kernel_liteos_a/issues/I4)
|
||||
* 进程rlimit修改为动态分配,减少静态内存占用 ([cf8446c](https://gitee.com/openharmony/kernel_liteos_a/commits/cf8446c94112ed6993a2e6e71e793d83a72689d5)), closes [#I4EZY5](https://gitee.com/openharmony/kernel_liteos_a/issues/I4EZY5)
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
* 1. 删除 LOS_CirBufLock(),LOS_CirBufUnlock()内核对外接口
|
||||
2. LOS_CirBufWrite(),LOS_CirBufRead()由原先内部不进行上/解锁操作,变为默认已包含上/解锁操作。
|
||||
* 新增支持API:
|
||||
|
||||
LOS_LmsCheckPoolAdd使能检测指定内存池
|
||||
LOS_LmsCheckPoolDel不检测指定内存池
|
||||
LOS_LmsAddrProtect为指定内存段上锁,不允许访问
|
||||
LOS_LmsAddrDisableProtect去能指定内存段的访问保护
|
||||
* 1.新增一系列perf的对外API,位于los_perf.h中.
|
||||
LOS_PerfInit配置采样数据缓冲区
|
||||
LOS_PerfStart开启Perf采样
|
||||
LOS_PerfStop停止Perf采样
|
||||
LOS_PerfConfig配置Perf采样事件
|
||||
LOS_PerfDataRead读取采样数据
|
||||
LOS_PerfNotifyHookReg 注册采样数据缓冲区的钩子函数
|
||||
LOS_PerfFlushHookReg 注册缓冲区刷cache的钩子
|
||||
|
||||
2. 用户态新增perf命令
|
||||
【Usage】:
|
||||
./perf [start] /[start id] Start perf.
|
||||
./perf [stop] Stop perf.
|
||||
./perf [read nBytes] Read nBytes raw data from perf buffer and print out.
|
||||
./perf [list] List events to be used in -e.
|
||||
./perf [stat] or [record] <option> <command>
|
||||
-e, event selector. use './perf list' to list available events.
|
||||
-p, event period.
|
||||
-o, perf data output filename.
|
||||
-t, taskId filter(whiltelist), if not set perf will sample all tasks.
|
||||
-s, type of data to sample defined in PerfSampleType los_perf.h.
|
||||
-P, processId filter(whiltelist), if not set perf will sample all processes.
|
||||
-d, whether to prescaler (once every 64 counts), which only take effect on cpu cycle hardware event.
|
||||
|
||||
|
||||
# (2021-09-30)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* A核代码告警清零 ([698756d](https://gitee.com/openharmony/kernel_liteos_a/commits/698756d1e6dfb11b9f874c02ce6a1496646f2c27)), closes [#I4378](https://gitee.com/openharmony/kernel_liteos_a/issues/I4378)
|
||||
* A核告警消除 ([d16bfd0](https://gitee.com/openharmony/kernel_liteos_a/commits/d16bfd005a6dae78df2df3ad55cf21e0716dfae9)), closes [#I46KF6](https://gitee.com/openharmony/kernel_liteos_a/issues/I46KF6)
|
||||
* 3518平台, 异常测试进程无法正常退出 ([23937a2](https://gitee.com/openharmony/kernel_liteos_a/commits/23937a239f50d1487e89f3184e4f4b933d6842c6)), closes [#I3V8R5](https://gitee.com/openharmony/kernel_liteos_a/issues/I3V8R5)
|
||||
* add (void) to GetFileMappingList method ([56b8eca](https://gitee.com/openharmony/kernel_liteos_a/commits/56b8ecaf171671c0fe97f1dd1f191bebb7812a51)), closes [#I3](https://gitee.com/openharmony/kernel_liteos_a/issues/I3)
|
||||
* add capability and amend smoke testcase ([c9d69e2](https://gitee.com/openharmony/kernel_liteos_a/commits/c9d69e2d1bde57c67068cc36f6a79327d5db5daf))
|
||||
* add fchdir api ([e828cbd](https://gitee.com/openharmony/kernel_liteos_a/commits/e828cbdeac7d60bfd6ed98c75a9958ee8ec7b672))
|
||||
* add fchmod api ([2f214bf](https://gitee.com/openharmony/kernel_liteos_a/commits/2f214bf4de6c31875c77e84b1763e96bc5ceb669))
|
||||
* add fststfs api and unitest ([4c57aa2](https://gitee.com/openharmony/kernel_liteos_a/commits/4c57aa26ad3644ce2429effc8e8fe7fd3c52ebc2))
|
||||
* add product_path parameter for driver build ([88fe4eb](https://gitee.com/openharmony/kernel_liteos_a/commits/88fe4eb3e1eafa6d1e32c7b96579a07f5a8c6e35)), closes [#I3PQ10](https://gitee.com/openharmony/kernel_liteos_a/issues/I3PQ10)
|
||||
* add syscall for ppoll & add 2 testcases ([defedb6](https://gitee.com/openharmony/kernel_liteos_a/commits/defedb6fdf0806da4a39e22408544cdfb405f2ff))
|
||||
* avoid compile warning ignored ([eca711b](https://gitee.com/openharmony/kernel_liteos_a/commits/eca711bb64a7c806ae34c8483cac73fe22b0104f)), closes [#I3](https://gitee.com/openharmony/kernel_liteos_a/issues/I3)
|
||||
* A核codex修改 ([ec977a1](https://gitee.com/openharmony/kernel_liteos_a/commits/ec977a1c7e9ba4ea6621ceb1d0d10e586148208d)), closes [#I40B1](https://gitee.com/openharmony/kernel_liteos_a/issues/I40B1)
|
||||
* BBOX使用预留物理内存缓存故障日志 ([2ad176e](https://gitee.com/openharmony/kernel_liteos_a/commits/2ad176e587d5ed7106831a25d386a88e26192e2b)), closes [#I41](https://gitee.com/openharmony/kernel_liteos_a/issues/I41)
|
||||
* bootargs解析与rootfs挂载解耦,并支持自定义bootargs参数 ([80473f0](https://gitee.com/openharmony/kernel_liteos_a/commits/80473f0975fe6fd4c4eae3a8a473674ad2dd1293)), closes [#I41CL8](https://gitee.com/openharmony/kernel_liteos_a/issues/I41CL8)
|
||||
* **build:** clang10.0.1支持lto,去掉冗余判断 ([73223ae](https://gitee.com/openharmony/kernel_liteos_a/commits/73223ae7e652b7cd9f1e1848c32b2b2573d07b2a))
|
||||
* **build:** fix rootfsdir.sh target directory not exist ([21bf2b8](https://gitee.com/openharmony/kernel_liteos_a/commits/21bf2b889931787fb18ca7ea238291fd57e76d51)), closes [#I3NHQ0](https://gitee.com/openharmony/kernel_liteos_a/issues/I3NHQ0)
|
||||
* **build:** 去除冗余单板相关的宏配置 ([471de36](https://gitee.com/openharmony/kernel_liteos_a/commits/471de3663ea8b63f7448162edc0293b8723dcefc))
|
||||
* clang10 lld could not recognized Oz ([87a0006](https://gitee.com/openharmony/kernel_liteos_a/commits/87a0006d5e1976fdf5efe4be383921610eb04ec6))
|
||||
* clang相关编译选项隔离 ([77dcef4](https://gitee.com/openharmony/kernel_liteos_a/commits/77dcef4bc0c92d0141f7a3be0addd4d5cb533b0b)), closes [#I444](https://gitee.com/openharmony/kernel_liteos_a/issues/I444)
|
||||
* codex ([101a55d](https://gitee.com/openharmony/kernel_liteos_a/commits/101a55d1199530d621f809976f0024aa8295cce8))
|
||||
* codex clean ([b5370af](https://gitee.com/openharmony/kernel_liteos_a/commits/b5370af822c8e81ed2248ac8aa3bb479a0db9dae)), closes [#I3](https://gitee.com/openharmony/kernel_liteos_a/issues/I3)
|
||||
* compile error when fatfs disabled ([fd3f407](https://gitee.com/openharmony/kernel_liteos_a/commits/fd3f4072b5c3dff710013ccdaddf114b0e13f435))
|
||||
* console compile bug fix ([f8441a0](https://gitee.com/openharmony/kernel_liteos_a/commits/f8441a0cdea301449416b0c0477dc48a05b6ab4e))
|
||||
* correct spelling ([c66fe03](https://gitee.com/openharmony/kernel_liteos_a/commits/c66fe0313f76ba41992b4864c93cf82934378ad3))
|
||||
* Correctly handle the return value of LOS_EventRead in QuickstartListen. ([0e0ab81](https://gitee.com/openharmony/kernel_liteos_a/commits/0e0ab81ff9474cffd5e60a8ee741840eac5d737b)), closes [#I3](https://gitee.com/openharmony/kernel_liteos_a/issues/I3)
|
||||
* Ctrl-C move out of LOS_MAGIC_KEY_ENABLE ([40f239a](https://gitee.com/openharmony/kernel_liteos_a/commits/40f239a7d4673dc740c853b1011b5072e48385b7))
|
||||
* Delete useless 'exc interaction' macros and function declarations. ([d2f2679](https://gitee.com/openharmony/kernel_liteos_a/commits/d2f26790716c9f76589c4a7d6fa5518f9ccd743c)), closes [#I3](https://gitee.com/openharmony/kernel_liteos_a/issues/I3)
|
||||
* dereference NULL point bug fix ([deaa564](https://gitee.com/openharmony/kernel_liteos_a/commits/deaa564a66b83c9fe19a37b8a061ec9064ece354))
|
||||
* do not build toybox temporarily ([044f2c7](https://gitee.com/openharmony/kernel_liteos_a/commits/044f2c7c17c68e10aeccc3af0c222cfc722d194c))
|
||||
* do not override existing libs ([8118408](https://gitee.com/openharmony/kernel_liteos_a/commits/8118408123e75f7f5a4ab9101e388be6bba0dcda))
|
||||
* **doc:** 修复README_zh-HK.md的链接错误 ([f1b4c87](https://gitee.com/openharmony/kernel_liteos_a/commits/f1b4c87bc44650348504bc00b3f6f94491c341a0))
|
||||
* fatfs memory leak ([fbfd71d](https://gitee.com/openharmony/kernel_liteos_a/commits/fbfd71dfe3b5555ef09e542d96a630dfba636daa))
|
||||
* fix function name OsSchedSetIdleTaskSchedParam ([8f8c038](https://gitee.com/openharmony/kernel_liteos_a/commits/8f8c038b217d5ba2518413bfc1ba857587d47442))
|
||||
* Fix kernel page fault exception handling causing system exception. ([a89fb57](https://gitee.com/openharmony/kernel_liteos_a/commits/a89fb57f5795236b93fd19ee2d7a059cae1b2b1b)), closes [#I3RAN4](https://gitee.com/openharmony/kernel_liteos_a/issues/I3RAN4)
|
||||
* fix length typo ([12d98b1](https://gitee.com/openharmony/kernel_liteos_a/commits/12d98b144b70e726d3fd31ddc9d17ed855d0ec1b))
|
||||
* fix mq function by enable mq_notify api ([4427142](https://gitee.com/openharmony/kernel_liteos_a/commits/4427142d734df8f95f4599093392904abacc5c93))
|
||||
* Fix quickstart codingstyle ([2e011b6](https://gitee.com/openharmony/kernel_liteos_a/commits/2e011b672f6b96ea7e0db066a07e3f9fb6ba5df3)), closes [#I3](https://gitee.com/openharmony/kernel_liteos_a/issues/I3)
|
||||
* fix stored typo ([d25560f](https://gitee.com/openharmony/kernel_liteos_a/commits/d25560f8ac3216670d198cbbb25891c394e0b3c2))
|
||||
* fix syscall faccessat,fstatfs,fstatat & add 6 testcases ([aa1cd24](https://gitee.com/openharmony/kernel_liteos_a/commits/aa1cd245a5711e5b53c328b688da5ddc2e783d5f))
|
||||
* fix the inappropriate errno in FatFs ([af61187](https://gitee.com/openharmony/kernel_liteos_a/commits/af61187587411dca38ff62e720451f08f19c1c82)), closes [#I3O8](https://gitee.com/openharmony/kernel_liteos_a/issues/I3O8)
|
||||
* fix typo in quickstart ([3b2ff4b](https://gitee.com/openharmony/kernel_liteos_a/commits/3b2ff4b71fc5ae1dc74180c33fd66f69da0059d1)), closes [#I3M1S8](https://gitee.com/openharmony/kernel_liteos_a/issues/I3M1S8)
|
||||
* Fix wrong judgment in los_trace.c to avoid null pointer access. ([4d863e9](https://gitee.com/openharmony/kernel_liteos_a/commits/4d863e985b6372f7895db57b602b662dba5cadd0)), closes [#I3RT9](https://gitee.com/openharmony/kernel_liteos_a/issues/I3RT9)
|
||||
* Identical condition 'ret<0', second condition is always false. :bug: ([1348809](https://gitee.com/openharmony/kernel_liteos_a/commits/1348809807548dd481286a55a6677a9169fcd705))
|
||||
* init进程收到子进程退出信号后,调用fork重新拉起进程,会导致系统卡死 ([35a2f3a](https://gitee.com/openharmony/kernel_liteos_a/commits/35a2f3af33a5dba1e0ba36587efced8fead97223)), closes [#I41](https://gitee.com/openharmony/kernel_liteos_a/issues/I41)
|
||||
* kernel crashed after rmdir the umounted folder ([ac0d083](https://gitee.com/openharmony/kernel_liteos_a/commits/ac0d083b1c89c4ad3fdaab0347d11f174d0185cb))
|
||||
* kernel crashed when delete a umounted folder ([f305d1f](https://gitee.com/openharmony/kernel_liteos_a/commits/f305d1f702a770010125a0f4f0152ffefeeec5c4))
|
||||
* kernel crashed when delete a umounted folder ([c6e9212](https://gitee.com/openharmony/kernel_liteos_a/commits/c6e921241b1cf26bcbfeea44e20f6b596512e259))
|
||||
* **kernel_test:** 内核mem/shm冒烟用例重复运行失败 ([0676578](https://gitee.com/openharmony/kernel_liteos_a/commits/0676578aae09c101d79e7a276823e849df293e29)), closes [#I3TH4](https://gitee.com/openharmony/kernel_liteos_a/issues/I3TH4)
|
||||
* L1 toybox 命令功能实现 ([2ff44c4](https://gitee.com/openharmony/kernel_liteos_a/commits/2ff44c4938d2e66ce60e9497c505eb6e97efc8c2)), closes [#I41N2](https://gitee.com/openharmony/kernel_liteos_a/issues/I41N2)
|
||||
* liteipc max data size too small ([4dc421e](https://gitee.com/openharmony/kernel_liteos_a/commits/4dc421e3decdaae60219d533c4a93dbc9334e35f))
|
||||
* LiteOS_A BBOX Codex整改 ([6a5a032](https://gitee.com/openharmony/kernel_liteos_a/commits/6a5a0326d2b18ffacce5d38fb351530973c2f245)), closes [#I43](https://gitee.com/openharmony/kernel_liteos_a/issues/I43)
|
||||
* Liteos-a创建的文件夹在Ubuntu中不可见 ([a9fc1e0](https://gitee.com/openharmony/kernel_liteos_a/commits/a9fc1e0e5d3e5eb8a34c568a8d147320a9afebe1)), closes [#I3XMY6](https://gitee.com/openharmony/kernel_liteos_a/issues/I3XMY6)
|
||||
* lookup new vnode may cause parent vnode freeing ([902a11d](https://gitee.com/openharmony/kernel_liteos_a/commits/902a11de9a4b08e799820fb87942cb2171b9e095)), closes [#I3MYP4](https://gitee.com/openharmony/kernel_liteos_a/issues/I3MYP4)
|
||||
* **mini:** fix compile error in mini liteos_a ([e13cb3b](https://gitee.com/openharmony/kernel_liteos_a/commits/e13cb3bcc4e74d4c49c31d290d686f99a4e81e3f))
|
||||
* minimal compile ([ac8c2c6](https://gitee.com/openharmony/kernel_liteos_a/commits/ac8c2c6d5b9ede0e46b48212f0b3447605a613c4))
|
||||
* misspell ([08980ea](https://gitee.com/openharmony/kernel_liteos_a/commits/08980eac3c249ec6a6717d8a04fb0be7716053a1))
|
||||
* mkdir -p is more robust ([e38f9a9](https://gitee.com/openharmony/kernel_liteos_a/commits/e38f9a98c9d373db8381af707c5996d1fefef64e))
|
||||
* mksh compile bug fix ([d8263b1](https://gitee.com/openharmony/kernel_liteos_a/commits/d8263b1e91d76706d52df321ef642c1c8297e8e4)), closes [#I3ZMR7](https://gitee.com/openharmony/kernel_liteos_a/issues/I3ZMR7)
|
||||
* modify event API description ([937734b](https://gitee.com/openharmony/kernel_liteos_a/commits/937734b1e9f5fc52e0ac727549bd2e4b4c864e3c))
|
||||
* move nuttx head file back ([4c8a86e](https://gitee.com/openharmony/kernel_liteos_a/commits/4c8a86ece7cafa8f74441bacc74c7788c0a1b780)), closes [#I4443](https://gitee.com/openharmony/kernel_liteos_a/issues/I4443)
|
||||
* nanosleep 接口的rmtp参数被错误清零 ([9458de9](https://gitee.com/openharmony/kernel_liteos_a/commits/9458de9ac664cd75540c8b638b9a6caf82812fc8)), closes [#I41U0](https://gitee.com/openharmony/kernel_liteos_a/issues/I41U0)
|
||||
* no exception information output, when the system is abnormal ([5bf4d1c](https://gitee.com/openharmony/kernel_liteos_a/commits/5bf4d1c7128e6718611bbec23cb4373bcb3bfe55))
|
||||
* no exception information output, when the system is abnormal ([28aa777](https://gitee.com/openharmony/kernel_liteos_a/commits/28aa777191e7b41e4f1f346ab79f8688edc59c6d))
|
||||
* no exception information output, when the system is abnormal after holding ([0ed8adf](https://gitee.com/openharmony/kernel_liteos_a/commits/0ed8adfe3ae59672e284331d40ef3b9e0bc8e094))
|
||||
* Optimiz macro of quickstart cmd ([cb140a4](https://gitee.com/openharmony/kernel_liteos_a/commits/cb140a4442c02dd0b1925cc58deecbf4da36dcea)), closes [#I3](https://gitee.com/openharmony/kernel_liteos_a/issues/I3)
|
||||
* Optimize /dev/quickstart permissions. ([4e24b57](https://gitee.com/openharmony/kernel_liteos_a/commits/4e24b572897c33e1b2723122c0e13d3931096bae)), closes [#I3](https://gitee.com/openharmony/kernel_liteos_a/issues/I3)
|
||||
* Optimize quickstart node implementation ([4abd2e0](https://gitee.com/openharmony/kernel_liteos_a/commits/4abd2e0247b14718bb21756fb446142140d30a88)), closes [#I3R8O8](https://gitee.com/openharmony/kernel_liteos_a/issues/I3R8O8)
|
||||
* OsGerCurrSchedTimeCycle 函数存在拼写错误 ([53ced1a](https://gitee.com/openharmony/kernel_liteos_a/commits/53ced1a85edc3d06230225ced3916772f432243f)), closes [#I446](https://gitee.com/openharmony/kernel_liteos_a/issues/I446)
|
||||
* OsGetArgsAddr声明所在头文件不正确 ([14bd753](https://gitee.com/openharmony/kernel_liteos_a/commits/14bd753aa8beb49af887c8d0aedaefa446409760)), closes [#I41](https://gitee.com/openharmony/kernel_liteos_a/issues/I41)
|
||||
* parent point of vnode found by VfsHashGet should be updated ([f32caa5](https://gitee.com/openharmony/kernel_liteos_a/commits/f32caa52c67eca20d58676be4e0439acbb4c5ac3)), closes [#I3](https://gitee.com/openharmony/kernel_liteos_a/issues/I3)
|
||||
* PathCacheFree try to free name field in struct PathCache ([9f47faf](https://gitee.com/openharmony/kernel_liteos_a/commits/9f47faff732609cf2249f104b94ed55f3ef133bb)), closes [#I3NTH9](https://gitee.com/openharmony/kernel_liteos_a/issues/I3NTH9)
|
||||
* PathCacheMemoryDump miscalculate the RAM usage of PathCache ([87da7c7](https://gitee.com/openharmony/kernel_liteos_a/commits/87da7c794c9bc8e311ae5242820fbf8aefd8d558)), closes [#I3](https://gitee.com/openharmony/kernel_liteos_a/issues/I3)
|
||||
* Provide a separate configuration macro for boot environment in RAM. ([e28e06b](https://gitee.com/openharmony/kernel_liteos_a/commits/e28e06b08f5b28091153e584cb9d93014a9f2b10))
|
||||
* Provide a separate configuration macro for boot environment in RAM. ([bc67393](https://gitee.com/openharmony/kernel_liteos_a/commits/bc67393a67f714e0a8165b6103e53699c676341c))
|
||||
* Provide a separate configuration macro for boot environment in RAM. ([f13b90e](https://gitee.com/openharmony/kernel_liteos_a/commits/f13b90e4308ba3d60683799b9ce62fb3705ac277)), closes [#I3](https://gitee.com/openharmony/kernel_liteos_a/issues/I3)
|
||||
* race condition in liteipc ([7e2aef2](https://gitee.com/openharmony/kernel_liteos_a/commits/7e2aef2480b15f71ee0e089cef4443f578e03dbb)), closes [#I3PW5](https://gitee.com/openharmony/kernel_liteos_a/issues/I3PW5)
|
||||
* rebuild mksh depends on rebuild.sh script ([bef4ab9](https://gitee.com/openharmony/kernel_liteos_a/commits/bef4ab9835dec865898c74337dfb7154718b94aa))
|
||||
* remove redundant headfile ([73a7777](https://gitee.com/openharmony/kernel_liteos_a/commits/73a777777e1b834192f6bb2c0e8bd03c69765c11)), closes [#I3](https://gitee.com/openharmony/kernel_liteos_a/issues/I3)
|
||||
* Remove redundant invalid codes ([fe05df4](https://gitee.com/openharmony/kernel_liteos_a/commits/fe05df40ae710632adb1bd54fb04ad4a8e0c1429)), closes [#I3R70](https://gitee.com/openharmony/kernel_liteos_a/issues/I3R70)
|
||||
* Show conflicting files for git apply or patch -p command ([35f7957](https://gitee.com/openharmony/kernel_liteos_a/commits/35f79579758644cbcac6005f894be21f34f42b99)), closes [#I3](https://gitee.com/openharmony/kernel_liteos_a/issues/I3)
|
||||
* SIOCGIFCONF ioctl malloc size error in kernel ([bfd27e7](https://gitee.com/openharmony/kernel_liteos_a/commits/bfd27e78b259eedbd4c30548e80c9b4d789d26e1)), closes [#I3XEZ3](https://gitee.com/openharmony/kernel_liteos_a/issues/I3XEZ3)
|
||||
* smp启动代码解耦及内存映射关系解耦 ([3bb3173](https://gitee.com/openharmony/kernel_liteos_a/commits/3bb3173604dc4dea09301f61da402974185dc112)), closes [#I41P8](https://gitee.com/openharmony/kernel_liteos_a/issues/I41P8)
|
||||
* some branch in format does not release the vnode mutex properly ([9b2b700](https://gitee.com/openharmony/kernel_liteos_a/commits/9b2b700fa0e3a8edadb38f09c917a3e3f013347f)), closes [#I3](https://gitee.com/openharmony/kernel_liteos_a/issues/I3)
|
||||
* Sortlink, the response time to insert the node should be inserted into the back of the existing node. ([1323874](https://gitee.com/openharmony/kernel_liteos_a/commits/1323874389030c55fb053fead12ca1c6654d8851)), closes [#I3PSJ8](https://gitee.com/openharmony/kernel_liteos_a/issues/I3PSJ8)
|
||||
* statfs can't get f_bfree and f_bavail of a FAT12/FAT16 partition ([9503c4a](https://gitee.com/openharmony/kernel_liteos_a/commits/9503c4a9fc30aaa8ea2031d4fb794436f3c98055)), closes [#I3Q0](https://gitee.com/openharmony/kernel_liteos_a/issues/I3Q0)
|
||||
* SysOpenat返回值应该为进程fd,而非系统全局fd。 ([3457c0b](https://gitee.com/openharmony/kernel_liteos_a/commits/3457c0b11debb2cf5d4abe325c2510a750654512)), closes [#I3](https://gitee.com/openharmony/kernel_liteos_a/issues/I3)
|
||||
* the total used vnode number not increased after unlink a file under ([4f514a1](https://gitee.com/openharmony/kernel_liteos_a/commits/4f514a16af5a3f3b9c4ea182de774297afb17f66)), closes [#I3TS1](https://gitee.com/openharmony/kernel_liteos_a/issues/I3TS1)
|
||||
* tick 动态化计算优化,消除中断执行时间对系统总体时间的影响,保证软件定时器的响应精度。 ([8df3e8c](https://gitee.com/openharmony/kernel_liteos_a/commits/8df3e8c96515a1907455a9bbc61426f43c803c62)), closes [#I43](https://gitee.com/openharmony/kernel_liteos_a/issues/I43)
|
||||
* toybox update ([c3245b3](https://gitee.com/openharmony/kernel_liteos_a/commits/c3245b3ce317eb58c8dad58fdfc7f094b9b9794b))
|
||||
* toybox命令升级 ([76f45b3](https://gitee.com/openharmony/kernel_liteos_a/commits/76f45b3fb2783d1cab45a6ba08787c29dfa2c948)), closes [#I41N2](https://gitee.com/openharmony/kernel_liteos_a/issues/I41N2)
|
||||
* update LOS_DL_LIST_IS_END comment ([900269b](https://gitee.com/openharmony/kernel_liteos_a/commits/900269bd4645252d898f6d3b73de01d8548c960c))
|
||||
* userfs分区的起始地址与大小改为通过bootargs配置 ([2e2b142](https://gitee.com/openharmony/kernel_liteos_a/commits/2e2b14205f4b81c7483ab42d62f144487097e9a4)), closes [#I3](https://gitee.com/openharmony/kernel_liteos_a/issues/I3)
|
||||
* VnodeInUseIter and VnodeFreeAll used to be recursive ([5f6656c](https://gitee.com/openharmony/kernel_liteos_a/commits/5f6656cb36a2ffb0b290aeb53981aba7501e80b2)), closes [#I3NN3](https://gitee.com/openharmony/kernel_liteos_a/issues/I3NN3)
|
||||
* 以g_sysSchedStartTime是否为0判断时间轴是否生效存在极限场景导致调度时间不生效 ([67ac8c4](https://gitee.com/openharmony/kernel_liteos_a/commits/67ac8c4c586adc371ece56700fd42371ca7fc885)), closes [#I45HP5](https://gitee.com/openharmony/kernel_liteos_a/issues/I45HP5)
|
||||
* 修复FATFS中不同内部接口不支持FAT12/FAT16 FAT表结束标志 ([33f5c70](https://gitee.com/openharmony/kernel_liteos_a/commits/33f5c70e6c8781758d2bfde0f60ca3d6ec7d543f)), closes [#I409R6](https://gitee.com/openharmony/kernel_liteos_a/issues/I409R6)
|
||||
* 修复kill进程时,因liteipc阻塞的进程概率无法退出问题 ([7de43bb](https://gitee.com/openharmony/kernel_liteos_a/commits/7de43bb004a12f926550f0b36ca3c2fa610feb27)), closes [#I3XX7](https://gitee.com/openharmony/kernel_liteos_a/issues/I3XX7)
|
||||
* 修复MagicKey数组越界访问 ([071cd62](https://gitee.com/openharmony/kernel_liteos_a/commits/071cd6268aeaaef702387dacaf4ef1ffbb7618fc)), closes [#I3U4N9](https://gitee.com/openharmony/kernel_liteos_a/issues/I3U4N9)
|
||||
* 修复mprotect修改地址区间的权限后,相应的区间名丢失问题 ([e425187](https://gitee.com/openharmony/kernel_liteos_a/commits/e425187d176a5e09bc5253faefc9cfc8454da0a3)), closes [#I43R40](https://gitee.com/openharmony/kernel_liteos_a/issues/I43R40)
|
||||
* 修复mq_close关闭后仍然占用文件描述符的问题 ([590c7b4](https://gitee.com/openharmony/kernel_liteos_a/commits/590c7b4e22662781d05ad035a785e985d573ec33)), closes [#I3](https://gitee.com/openharmony/kernel_liteos_a/issues/I3)
|
||||
* 修复mqueue问题 ([26ee8b8](https://gitee.com/openharmony/kernel_liteos_a/commits/26ee8b836e346e641de4ecd72284f5d377bca6f8)), closes [#I43P4](https://gitee.com/openharmony/kernel_liteos_a/issues/I43P4)
|
||||
* 修复sigwait等待到的信号值与获取的siginfo中的值不一致 ([ed7defb](https://gitee.com/openharmony/kernel_liteos_a/commits/ed7defbd439c345a07159d40eb04433afd530004)), closes [#I3M12](https://gitee.com/openharmony/kernel_liteos_a/issues/I3M12)
|
||||
* 修复了LOSCFG_FS_FAT_VIRTUAL_PARTITION宏开关错误作用域引起的功能错误 ([acda419](https://gitee.com/openharmony/kernel_liteos_a/commits/acda419a2d773ea890052a16ee66b4872f941fbb)), closes [#I3W1](https://gitee.com/openharmony/kernel_liteos_a/issues/I3W1)
|
||||
* 修复了内核的VFAT测试用例 ([a8384b5](https://gitee.com/openharmony/kernel_liteos_a/commits/a8384b5db2274d50a350910d7cfd3fc36b4f4103)), closes [#I3XF3](https://gitee.com/openharmony/kernel_liteos_a/issues/I3XF3)
|
||||
* 修复内核access chmod chown接口 ([56a95b9](https://gitee.com/openharmony/kernel_liteos_a/commits/56a95b9ec903f815f9199ac65ca318e00a83b2ed)), closes [#I3Z5L6](https://gitee.com/openharmony/kernel_liteos_a/issues/I3Z5L6)
|
||||
* 修复内核c库的makefile中被优化函数替换的高频函数依然参与了编译的问题 ([6f6dc4f](https://gitee.com/openharmony/kernel_liteos_a/commits/6f6dc4f24c8ab05a6d42da46a9fa41d74a477bd7)), closes [#I3XGM8](https://gitee.com/openharmony/kernel_liteos_a/issues/I3XGM8)
|
||||
* 修复内核堆完整性检查逻辑中访问非法指针导致系统异常问题。 ([30f5ab8](https://gitee.com/openharmony/kernel_liteos_a/commits/30f5ab89b72d45f596b15af82a8e8e01add7977d)), closes [#I3](https://gitee.com/openharmony/kernel_liteos_a/issues/I3)
|
||||
* 修复启动框架debug模式下-Werror=maybe-uninitialized告警以及符号链接不进镜像的隐患 ([4c02415](https://gitee.com/openharmony/kernel_liteos_a/commits/4c024159a9600745863e49ee955308470a5b657b)), closes [#I3T5](https://gitee.com/openharmony/kernel_liteos_a/issues/I3T5)
|
||||
* 修复开机概率挂死 ([2e82c36](https://gitee.com/openharmony/kernel_liteos_a/commits/2e82c361f73b2119613c3571c48faae8ec41d4eb)), closes [#I3SWY2](https://gitee.com/openharmony/kernel_liteos_a/issues/I3SWY2)
|
||||
* 修复文档链接失效问题 ([42a3a6c](https://gitee.com/openharmony/kernel_liteos_a/commits/42a3a6c51bfca4ade8ce94084ea2f8eb1c86a137)), closes [#I45297](https://gitee.com/openharmony/kernel_liteos_a/issues/I45297)
|
||||
* 修改/proc/mounts显示格式 ([6860246](https://gitee.com/openharmony/kernel_liteos_a/commits/6860246cfaac6f540665e79bbc4c3d54c419b092)), closes [#I3](https://gitee.com/openharmony/kernel_liteos_a/issues/I3)
|
||||
* 修改clock_gettime接口适配posix标准测试用例011输入clk_id错误时返回值ESRCH为EINVAL. ([f8cf6e6](https://gitee.com/openharmony/kernel_liteos_a/commits/f8cf6e6439ee017fe8e0d4ecfc9949c28fa6775f)), closes [#I3](https://gitee.com/openharmony/kernel_liteos_a/issues/I3)
|
||||
* 修改DoNanoSleep 以纳秒为单位 ([6917e08](https://gitee.com/openharmony/kernel_liteos_a/commits/6917e08431689ccbd5a30e9a39b67016ffb64d0a)), closes [#I3Z9](https://gitee.com/openharmony/kernel_liteos_a/issues/I3Z9)
|
||||
* 修改某些平台保存bbox日志失败的问题 ([8f6a1dd](https://gitee.com/openharmony/kernel_liteos_a/commits/8f6a1dd33c59164070e8d2fb5abbd3e76ef8ac8e)), closes [#I41](https://gitee.com/openharmony/kernel_liteos_a/issues/I41)
|
||||
* 修改默认窗口宽度到400 ([09c491c](https://gitee.com/openharmony/kernel_liteos_a/commits/09c491ca1fd6d3110eafb0d07e45b25bdc3bd5d0)), closes [#I40](https://gitee.com/openharmony/kernel_liteos_a/issues/I40)
|
||||
* 关闭jffs和fat后,rootfs配置也被相应关闭,导致nand介质的rootfs不可用。 ([0ea476b](https://gitee.com/openharmony/kernel_liteos_a/commits/0ea476b9741fabd3c255c2770688f587920cf509)), closes [#I3](https://gitee.com/openharmony/kernel_liteos_a/issues/I3)
|
||||
* 内核态在console初始化完成后,使用printf无法正常打印 ([44ce696](https://gitee.com/openharmony/kernel_liteos_a/commits/44ce6969048c2e252f3f9d66fa485c77bdab8ae7)), closes [#I3UG00](https://gitee.com/openharmony/kernel_liteos_a/issues/I3UG00)
|
||||
* 去掉冗余的strip操作 ([7819d15](https://gitee.com/openharmony/kernel_liteos_a/commits/7819d15b3619681ae37a1349a6bec2440c829ae9)), closes [#I43767](https://gitee.com/openharmony/kernel_liteos_a/issues/I43767)
|
||||
* 合并进程栈两个地址连续的region ([42f374d](https://gitee.com/openharmony/kernel_liteos_a/commits/42f374dd7a353f1c8227e92fa92827c1c7b32424)), closes [#I43](https://gitee.com/openharmony/kernel_liteos_a/issues/I43)
|
||||
* 在内核提示No idle TCB时,增加打印当前系统任务信息,以方便问题定位。 ([11a9b00](https://gitee.com/openharmony/kernel_liteos_a/commits/11a9b00d43a6dbe9fba9f6eb07d78a9d226c28f8)), closes [#I434](https://gitee.com/openharmony/kernel_liteos_a/issues/I434)
|
||||
* 增加表头,内容以制表符分栏。 ([e9ad6b7](https://gitee.com/openharmony/kernel_liteos_a/commits/e9ad6b71c3b1136414672cd21b339ded7a02dfb9)), closes [#I3W2M9](https://gitee.com/openharmony/kernel_liteos_a/issues/I3W2M9)
|
||||
* 将用户态内存调测解析脚本移至tools目录下 ([85b4cb7](https://gitee.com/openharmony/kernel_liteos_a/commits/85b4cb7a67b717984d3ebf68115c7139cc61d690)), closes [#I42T9](https://gitee.com/openharmony/kernel_liteos_a/issues/I42T9)
|
||||
* 恢复了FATFS设置卷标的功能 ([9515d53](https://gitee.com/openharmony/kernel_liteos_a/commits/9515d53dccc9a6458bfbaf8e15143928f05cb660)), closes [#I3Y5G8](https://gitee.com/openharmony/kernel_liteos_a/issues/I3Y5G8)
|
||||
* 解决kill进程时无法保证进程的已持有的内核资源合理释放. ([cf89f01](https://gitee.com/openharmony/kernel_liteos_a/commits/cf89f016e93f28f8d72e6f5de08640d08a155908)), closes [#I3S0N0](https://gitee.com/openharmony/kernel_liteos_a/issues/I3S0N0)
|
||||
* 解决不同环境下计算的rootfs的size偏小,导致mcopy造成的disk full错误 ([c54879b](https://gitee.com/openharmony/kernel_liteos_a/commits/c54879b54875abece53b1f64072cfacbd2e1970e)), closes [#I3IA06](https://gitee.com/openharmony/kernel_liteos_a/issues/I3IA06)
|
||||
* 设置qemu默认userfs大小/修改qemu驱动目录 ([1d952a2](https://gitee.com/openharmony/kernel_liteos_a/commits/1d952a254a6e7ec2f70f7112eb27355cfd01ba4d)), closes [#I3XW96](https://gitee.com/openharmony/kernel_liteos_a/issues/I3XW96) [#I3](https://gitee.com/openharmony/kernel_liteos_a/issues/I3)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* active mksh & toybox ([cacb4f0](https://gitee.com/openharmony/kernel_liteos_a/commits/cacb4f0103ecb2d1b7af54d84957f88d3e9443d2)), closes [#I3](https://gitee.com/openharmony/kernel_liteos_a/issues/I3)
|
||||
* Add /dev/quickstart to support synchronous communication between processes in user mode startup. ([46b63f7](https://gitee.com/openharmony/kernel_liteos_a/commits/46b63f71537789743ed2f3f337c1809ee4900d71)), closes [#I3OHO5](https://gitee.com/openharmony/kernel_liteos_a/issues/I3OHO5)
|
||||
* add /proc/fd file to dump the pid/fd/path information ([600dded](https://gitee.com/openharmony/kernel_liteos_a/commits/600dded31e80df275ed08c326c0ce3d1857d8dd8)), closes [#I3WB5](https://gitee.com/openharmony/kernel_liteos_a/issues/I3WB5)
|
||||
* add /proc/fs_cache to display cache info ([231cb6b](https://gitee.com/openharmony/kernel_liteos_a/commits/231cb6be27380948bc48136ae2e02c28450f47a8)), closes [#I3](https://gitee.com/openharmony/kernel_liteos_a/issues/I3)
|
||||
* add /proc/fs_cache to display cache info ([53c6d96](https://gitee.com/openharmony/kernel_liteos_a/commits/53c6d96c6f97cb006216769f8b73f50fba3bc325)), closes [#I3](https://gitee.com/openharmony/kernel_liteos_a/issues/I3)
|
||||
* add and fix some syscall ([ce849f2](https://gitee.com/openharmony/kernel_liteos_a/commits/ce849f2145e1569517c5244c9ffcaebed53f3a66))
|
||||
* add blackbox for liteos_a ([a195aac](https://gitee.com/openharmony/kernel_liteos_a/commits/a195aac9fb60b0163f9eebb29084287d226bd14c)), closes [#I406](https://gitee.com/openharmony/kernel_liteos_a/issues/I406)
|
||||
* add blackbox for liteos_a ([425975e](https://gitee.com/openharmony/kernel_liteos_a/commits/425975e4811023e31a520979c20ea2562224d9d0)), closes [#I3NN7](https://gitee.com/openharmony/kernel_liteos_a/issues/I3NN7)
|
||||
* add clear cache cmd to /proc/fs_cache ([3d1cf68](https://gitee.com/openharmony/kernel_liteos_a/commits/3d1cf683f37a6f75e9db2ce1f11ec93159b77663)), closes [#I3](https://gitee.com/openharmony/kernel_liteos_a/issues/I3)
|
||||
* add liteos patch ability ([98ca844](https://gitee.com/openharmony/kernel_liteos_a/commits/98ca8441fe75ee1c3318a6a09376fd72f5a51350))
|
||||
* add support for gn build system ([a8805a6](https://gitee.com/openharmony/kernel_liteos_a/commits/a8805a65aab9109b915364fccf36c8328f636e48))
|
||||
* add uid/gid for ProcFs ([6780659](https://gitee.com/openharmony/kernel_liteos_a/commits/67806596a3c0df9a54893d8c74ebe9da98d7fb06)), closes [#I3](https://gitee.com/openharmony/kernel_liteos_a/issues/I3)
|
||||
* A核proc文件系统在echo模式下新增write的功能 ([f10dd7c](https://gitee.com/openharmony/kernel_liteos_a/commits/f10dd7c135d37a5fb0d78610d5ece5807d01eb1f)), closes [#I3T6](https://gitee.com/openharmony/kernel_liteos_a/issues/I3T6)
|
||||
* build OHOS_Image from kernel ([abf4d8f](https://gitee.com/openharmony/kernel_liteos_a/commits/abf4d8fb252631aca9d46211762880a23be2a0b1))
|
||||
* **build:** make liteos_config_file available as gn argument ([f9a9077](https://gitee.com/openharmony/kernel_liteos_a/commits/f9a907772f506ca7e2d84e96d4d17cffc7dae50f))
|
||||
* **build:** 使用xts -notest选项时,内核用例不参与编译构建和用例编译配置方式调整 ([9bdf716](https://gitee.com/openharmony/kernel_liteos_a/commits/9bdf716407c125c9877b6f49c2133112c18cdabc))
|
||||
* don't apply module_swith on configs of config ([f3beb4b](https://gitee.com/openharmony/kernel_liteos_a/commits/f3beb4b273c9a76fbfaffe57302f27d2a74cd2ba))
|
||||
* enable gn build for toybox and mksh ([c54bfa1](https://gitee.com/openharmony/kernel_liteos_a/commits/c54bfa16e3907482c252e9738192df869c63326e))
|
||||
* fatfs支持符号链接功能 ([e50cf0b](https://gitee.com/openharmony/kernel_liteos_a/commits/e50cf0be6f6d118022b6d79c5177aece574ba150)), closes [#I3V8D1](https://gitee.com/openharmony/kernel_liteos_a/issues/I3V8D1)
|
||||
* **file system:** add memory-based romfs ([c4595d2](https://gitee.com/openharmony/kernel_liteos_a/commits/c4595d25042b188570d991a815009764c37f3cb3)), closes [#I3S0](https://gitee.com/openharmony/kernel_liteos_a/issues/I3S0)
|
||||
* introduce mksh toybox to rootfs ([41c7689](https://gitee.com/openharmony/kernel_liteos_a/commits/41c7689dfa49c52fb15705ce15ef22a278fbf2ef))
|
||||
* L0-L1 支持Trace ([dc9ec68](https://gitee.com/openharmony/kernel_liteos_a/commits/dc9ec6856fe14aa604f037f55f17a3ba2bafb098)), closes [#I46WA0](https://gitee.com/openharmony/kernel_liteos_a/issues/I46WA0)
|
||||
* L1支持低功耗投票框架 ([21d8ac8](https://gitee.com/openharmony/kernel_liteos_a/commits/21d8ac8752469f6e0dc2d50d28b75421f665385a)), closes [#I3VS5](https://gitee.com/openharmony/kernel_liteos_a/issues/I3VS5)
|
||||
* **libc:** upgrade optimized-routines to v21.02 ([1ec8d5a](https://gitee.com/openharmony/kernel_liteos_a/commits/1ec8d5a454658e95c4acb821d0878f357f4e82ad))
|
||||
* **make:** optimize makefiles and remove some unused files ([0e26094](https://gitee.com/openharmony/kernel_liteos_a/commits/0e260949c962158a263d4b0ad45fe9f6843d6e30))
|
||||
* Open macro for ADC moudule ([c71ec9d](https://gitee.com/openharmony/kernel_liteos_a/commits/c71ec9d7e8574078a9dc2a8463f3141cca3d625a))
|
||||
* **QEMU_ARM_VIRT_CA7:** 使能FAT文件系统编译选项 ([49856dc](https://gitee.com/openharmony/kernel_liteos_a/commits/49856dc1e0de1c5e92346c83eda641dfb1bb16be))
|
||||
* support .mkshrc ([51a50c9](https://gitee.com/openharmony/kernel_liteos_a/commits/51a50c95b4cd47b6931523926b728d1c0ff8988b)), closes [#I3Y5](https://gitee.com/openharmony/kernel_liteos_a/issues/I3Y5)
|
||||
* support link/symlink/readlink ([6eddc86](https://gitee.com/openharmony/kernel_liteos_a/commits/6eddc869d349be59860bfd84ff10b7579a9b00a9)), closes [#I3Q0](https://gitee.com/openharmony/kernel_liteos_a/issues/I3Q0)
|
||||
* support toybox in qemu ([5618319](https://gitee.com/openharmony/kernel_liteos_a/commits/561831928bb1ad1871b2d60d2bba2d67488cea5f)), closes [#I3V17](https://gitee.com/openharmony/kernel_liteos_a/issues/I3V17)
|
||||
* timer_create支持以SIGEV_THREAD方式创建定时器 ([e5f6bf0](https://gitee.com/openharmony/kernel_liteos_a/commits/e5f6bf05567c2d193f3746caca502199e7b81e92)), closes [#I3](https://gitee.com/openharmony/kernel_liteos_a/issues/I3)
|
||||
* using kconfiglib instead of kconfig ([8784694](https://gitee.com/openharmony/kernel_liteos_a/commits/878469468647a19f704e7ee2af696b0ba8ab775a))
|
||||
* vfs support sdcard hotplug ([2db80ec](https://gitee.com/openharmony/kernel_liteos_a/commits/2db80ecb389176b53c77807567895470bb180a06)), closes [#I44WH1](https://gitee.com/openharmony/kernel_liteos_a/issues/I44WH1)
|
||||
* **vfs:** vfs支持FD_CLOEXEC标记 ([27dca4d](https://gitee.com/openharmony/kernel_liteos_a/commits/27dca4d857ef8de6b4bb9302e0dd435be7e3284f)), closes [#I3U81](https://gitee.com/openharmony/kernel_liteos_a/issues/I3U81)
|
||||
* 删除zpfs冗余代码 ([3393479](https://gitee.com/openharmony/kernel_liteos_a/commits/3393479c52f4a9dfe2394bb32beb4b98fca8e171))
|
||||
* 基于汇编实现内核对用户态内存清零的功能 ([9db3407](https://gitee.com/openharmony/kernel_liteos_a/commits/9db3407589bb0b2d4a5772faac3130032bc0b8a9)), closes [#I3XXT0](https://gitee.com/openharmony/kernel_liteos_a/issues/I3XXT0)
|
||||
* 增加mount的MS_RDONLY标志的支持 ([8729f6e](https://gitee.com/openharmony/kernel_liteos_a/commits/8729f6ee57ea57bc664d076ff112c8726fedded9)), closes [#I3Z1W6](https://gitee.com/openharmony/kernel_liteos_a/issues/I3Z1W6)
|
||||
* 支持killpg和waitid ([dc3cc09](https://gitee.com/openharmony/kernel_liteos_a/commits/dc3cc094a75c6da65d87522930afea06106d3933))
|
||||
* 新增toybox reboot命令 ([e567a10](https://gitee.com/openharmony/kernel_liteos_a/commits/e567a10d021c3e0fe02d6911dbe8687255c67ffa)), closes [#I3YQ7](https://gitee.com/openharmony/kernel_liteos_a/issues/I3YQ7)
|
||||
* 给开发者提供系统信息导出Hidumper工具。 ([cb17fa5](https://gitee.com/openharmony/kernel_liteos_a/commits/cb17fa50ed28e6e8f59b7d68ede13c759b983311)), closes [#I3NN7](https://gitee.com/openharmony/kernel_liteos_a/issues/I3NN7)
|
||||
* 自研shell命令回补 ([7bc68f4](https://gitee.com/openharmony/kernel_liteos_a/commits/7bc68f454ff5fbf415712c9b8479b8c832f68417)), closes [#I44U0](https://gitee.com/openharmony/kernel_liteos_a/issues/I44U0)
|
||||
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* assign '-1' to uninitialized variable: ret ([e0a27ba](https://gitee.com/openharmony/kernel_liteos_a/commits/e0a27badde20868cf3a5b4a44305b90af00e4f3f))
|
||||
|
||||
|
||||
### Reverts
|
||||
|
||||
* Revert "fix: 修改默认窗口宽度到400" ([1878849](https://gitee.com/openharmony/kernel_liteos_a/commits/187884937cd087e39a28c033c41033163d6b4766)), closes [#I42X9](https://gitee.com/openharmony/kernel_liteos_a/issues/I42X9)
|
||||
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
* 1.新增一系列trace的对外API,位于los_trace.h中.
|
||||
LOS_TRACE_EASY简易插桩
|
||||
LOS_TRACE标准插桩
|
||||
LOS_TraceInit配置Trace缓冲区的地址和大小
|
||||
LOS_TraceStart开启事件记录
|
||||
LOS_TraceStop停止事件记录
|
||||
LOS_TraceRecordDump输出Trace缓冲区数据
|
||||
LOS_TraceRecordGet获取Trace缓冲区的首地址
|
||||
LOS_TraceReset清除Trace缓冲区中的事件
|
||||
LOS_TraceEventMaskSet设置事件掩码,仅记录某些模块的事件
|
||||
LOS_TraceHwiFilterHookReg注册过滤特定中断号事件的钩子函数
|
||||
* **vfs:** 执行exec类函数后,进程拥有的文件描述符情况发生变化:修改前,默认关闭所有的进程文件描述符,0,1,2重新打开;修改后,除非文件描述符拥有FD_CLOEXEC标记,否则该描述符不会被关闭。
|
||||
|
||||
|
||||
|
||||
5
Makefile
5
Makefile
@@ -82,9 +82,6 @@ endif
|
||||
ifeq ($(LOSCFG_STORAGE_SPINAND), y)
|
||||
FSTYPE = yaffs2
|
||||
endif
|
||||
ifeq ($(LOSCFG_PLATFORM_QEMU_ARM_VIRT_CA7), y)
|
||||
FSTYPE = jffs2
|
||||
endif
|
||||
ROOTFS_DIR = $(OUT)/rootfs
|
||||
ROOTFS_ZIP = $(OUT)/rootfs.zip
|
||||
|
||||
@@ -121,7 +118,7 @@ sysroot:
|
||||
$(HIDE)echo "sysroot:" $(abspath $(SYSROOT_PATH))
|
||||
ifeq ($(origin SYSROOT_PATH),file)
|
||||
$(HIDE)mkdir -p $(SYSROOT_PATH)/build && cd $(SYSROOT_PATH)/build && \
|
||||
ln -snf $(LITEOSTOPDIR)/../../prebuilts/lite/sysroot/build/Makefile && \
|
||||
ln -snf $(LITEOSTOPDIR)/../../third_party/musl/scripts/build_lite/Makefile && \
|
||||
$(MAKE) TARGETS=liteos_a_user \
|
||||
ARCH=$(ARCH) \
|
||||
TARGET=$(LOSCFG_LLVM_TARGET) \
|
||||
|
||||
1
OAT.xml
1
OAT.xml
@@ -23,6 +23,7 @@
|
||||
<licensefile></licensefile>
|
||||
<policylist>
|
||||
<policy name="projectPolicy" desc="">
|
||||
<policyitem type="copyright" name="Huawei Technologies Co., Ltd. All rights reserved." path=".*" desc="original liteos copyright"/>
|
||||
<policyitem type="copyright" name="Huawei Device Co., Ltd. All rights reserved." path=".*" desc="original liteos copyright"/>
|
||||
<policyitem type="license" name="BSD-3-Clause" path=".*" desc="Liteos kernel use bsd3 license"/>
|
||||
</policy>
|
||||
|
||||
31
README.md
31
README.md
@@ -4,10 +4,10 @@
|
||||
- [Directory Structure](#section161941989596)
|
||||
- [Constraints](#section119744591305)
|
||||
- [Usage](#section741617511812)
|
||||
- [Preparations](#section1579912573329)
|
||||
- [Source Code Acquisition](#section11443189655)
|
||||
- [Compilation and Building](#section2081013992812)
|
||||
|
||||
- [Preparations](#section1579912573329)
|
||||
- [Source Code Acquisition](#section11443189655)
|
||||
- [Compilation and Building](#section2081013992812)
|
||||
- [Contribution](#section1371123476304)
|
||||
- [Repositories Involved](#section1371113476307)
|
||||
|
||||
## Introduction<a name="section11660541593"></a>
|
||||
@@ -67,24 +67,33 @@ The OpenHarmony LiteOS Cortex-A is a new-generation kernel developed based on th
|
||||
|
||||
## Usage<a name="section741617511812"></a>
|
||||
|
||||
OpenHarmony LiteOS Cortex-A supports the [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.
|
||||
OpenHarmony LiteOS Cortex-A supports the [Hi3516D V300](https://gitee.com/openharmony/docs/blob/master/en/device-dev/quick-start/quickstart-appendix-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.
|
||||
You need to set up the compilation environment on Ubuntu.
|
||||
|
||||
- [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).
|
||||
- [Setting Up Ubuntu Development Environment](https://gitee.com/openharmony/docs/blob/master/en/device-dev/quick-start/Readme-EN.md)
|
||||
|
||||
### Source Code Acquisition<a name="section11443189655"></a>
|
||||
|
||||
Download and decompress a set of source code on a Linux server to acquire the [source code](https://gitee.com/openharmony/docs/blob/master/en/device-dev/get-code/sourcecode-acquire.md).
|
||||
Download and decompress a set of source code on a Ubuntu server to acquire the [source code](https://gitee.com/openharmony/docs/blob/master/en/device-dev/get-code/sourcecode-acquire.md).
|
||||
|
||||
### Compilation and Building<a name="section2081013992812"></a>
|
||||
|
||||
For details about how to develop the first application, see:
|
||||
For details about how to develop the first application, see: [Developing the First Example Program Running on Hi3516](https://gitee.com/openharmony/docs/blob/master/en/device-dev/quick-start/quickstart-pkg-3516-helloworld.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)
|
||||
For compilation, please refer to the [compilation instructions](https://gitee.com/openharmony/docs/blob/master/en/device-dev/quick-start/quickstart-pkg-3516-build.md).
|
||||
|
||||
## Contribution<a name="section1371123476304"></a>
|
||||
|
||||
[How to involve](https://gitee.com/openharmony/docs/blob/HEAD/en/contribute/contribution.md)
|
||||
|
||||
[Commit message spec](https://gitee.com/openharmony/kernel_liteos_a/wikis/Commit%20message%20%E8%A7%84%E8%8C%83)
|
||||
|
||||
[C&C++ Secure Coding Guide](https://gitee.com/openharmony/docs/blob/master/en/contribute/OpenHarmony-c-cpp-secure-coding-guide.md)
|
||||
|
||||
[LiteOS-A Kernel Coding Style Guide](https://gitee.com/openharmony/kernel_liteos_a/wikis/LiteOS-A%20%E5%86%85%E6%A0%B8%E7%BC%96%E7%A0%81%E8%A7%84%E8%8C%83%E6%8C%87%E5%8D%97)
|
||||
|
||||
## Repositories Involved<a name="section1371113476307"></a>
|
||||
|
||||
|
||||
@@ -4,10 +4,10 @@
|
||||
- [目錄](#section161941989596)
|
||||
- [約束](#section119744591305)
|
||||
- [使用說明](#section741617511812)
|
||||
- [準備](#section1579912573329)
|
||||
- [獲取源碼](#section11443189655)
|
||||
- [編譯構建](#section2081013992812)
|
||||
|
||||
- [準備](#section1579912573329)
|
||||
- [獲取源碼](#section11443189655)
|
||||
- [編譯構建](#section2081013992812)
|
||||
- [貢獻](#section1371123476304)
|
||||
- [相關倉](#section1371113476307)
|
||||
|
||||
## 簡介<a name="section11660541593"></a>
|
||||
@@ -67,24 +67,33 @@ OpenHarmony LiteOS-A內核是基於Huawei LiteOS內核演進發展的新一代
|
||||
|
||||
## 使用說明<a name="section741617511812"></a>
|
||||
|
||||
OpenHarmony LiteOS-A內核支持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-appendix-hi3516.md)單板,開發者可基於此單板開發運行自己的應用程序。
|
||||
|
||||
### 準備<a name="section1579912573329"></a>
|
||||
|
||||
開發者需要在Linux上搭建編譯環境:
|
||||
開發者需要在Ubuntu上搭建編譯環境:
|
||||
|
||||
- [編譯環境凖備](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-lite-env-setup.md);
|
||||
- Hi3516DV300單板:參考[環境搭建](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-lite-steps-hi3516-setting.md)。
|
||||
- [編譯環境凖備](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/Readme-CN.md);
|
||||
|
||||
### 獲取源碼<a name="section11443189655"></a>
|
||||
|
||||
在Linux服務器上下載並解壓一套源代碼,源碼獲取方式參考[源碼獲取](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/get-code/sourcecode-acquire.md)。
|
||||
在Ubuntu服務器上下載並解壓一套源代碼,源碼獲取方式參考[源碼獲取](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/get-code/sourcecode-acquire.md)。
|
||||
|
||||
### 編譯構建<a name="section2081013992812"></a>
|
||||
|
||||
開發者開發第一個應用程序可參考:
|
||||
開發者開發第一個應用程序可參考:[helloworld for Hi3516DV300](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-pkg-3516-helloworld.md)。
|
||||
|
||||
- [helloworld for Hi3516DV300](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-lite-steps-hi3516-running.md)。
|
||||
編譯可以參考:[編譯指導](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-pkg-3516-build.md)
|
||||
|
||||
## 貢獻<a name="section1371123476304"></a>
|
||||
|
||||
[如何貢獻](https://gitee.com/openharmony/docs/blob/HEAD/zh-cn/contribute/%E5%8F%82%E4%B8%8E%E8%B4%A1%E7%8C%AE.md)
|
||||
|
||||
[Commit message規範](https://gitee.com/openharmony/kernel_liteos_a/wikis/Commit%20message%20%E8%A7%84%E8%8C%83)
|
||||
|
||||
[OpenHarmony C&C++ 安全編程指南](https://gitee.com/openharmony/docs/blob/master/zh-cn/contribute/OpenHarmony-c-cpp-secure-coding-guide.md)
|
||||
|
||||
[LiteOS-A 內核編碼規範指南](https://gitee.com/openharmony/kernel_liteos_a/wikis/LiteOS-A%20%E5%86%85%E6%A0%B8%E7%BC%96%E7%A0%81%E8%A7%84%E8%8C%83%E6%8C%87%E5%8D%97)
|
||||
|
||||
## 相關倉<a name="section1371113476307"></a>
|
||||
|
||||
|
||||
31
README_zh.md
31
README_zh.md
@@ -4,10 +4,10 @@
|
||||
- [目录](#section161941989596)
|
||||
- [约束](#section119744591305)
|
||||
- [使用说明](#section741617511812)
|
||||
- [准备](#section1579912573329)
|
||||
- [获取源码](#section11443189655)
|
||||
- [编译构建](#section2081013992812)
|
||||
|
||||
- [准备](#section1579912573329)
|
||||
- [获取源码](#section11443189655)
|
||||
- [编译构建](#section2081013992812)
|
||||
- [贡献](#section1371123476304)
|
||||
- [相关仓](#section1371113476307)
|
||||
|
||||
## 简介<a name="section11660541593"></a>
|
||||
@@ -69,24 +69,33 @@ OpenHarmony LiteOS-A内核是基于Huawei LiteOS内核演进发展的新一代
|
||||
|
||||
## 使用说明<a name="section741617511812"></a>
|
||||
|
||||
OpenHarmony LiteOS-A内核支持[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-appendix-hi3516.md)单板。开发者可基于此单板开发运行自己的应用程序。
|
||||
|
||||
### 准备<a name="section1579912573329"></a>
|
||||
|
||||
开发者需要在Linux上搭建编译环境:
|
||||
开发者需要在Ubuntu上搭建编译环境:
|
||||
|
||||
- [编译环境准备](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-lite-env-setup.md);
|
||||
- Hi3516DV300单板:参考[环境搭建](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-lite-steps-hi3516-setting.md)。
|
||||
- [编译环境准备](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/Readme-CN.md);
|
||||
|
||||
### 获取源码<a name="section11443189655"></a>
|
||||
|
||||
在Linux服务器上下载并解压一套源代码,源码获取方式参考[源码获取](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/get-code/sourcecode-acquire.md)。
|
||||
在Ubuntu服务器源码获取方式参考: [源码获取](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/get-code/sourcecode-acquire.md)。
|
||||
|
||||
### 编译构建<a name="section2081013992812"></a>
|
||||
|
||||
如果这是您的首次应用程序开发,可参考:
|
||||
如果这是您的首次应用程序开发,可参考:[helloworld for Hi3516DV300](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-pkg-3516-helloworld.md)。
|
||||
|
||||
- [helloworld for Hi3516DV300](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-lite-steps-hi3516-running.md)。
|
||||
编译可以参考:[编译指导](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-pkg-3516-build.md)
|
||||
|
||||
## 贡献<a name="section1371123476304"></a>
|
||||
|
||||
[如何贡献](https://gitee.com/openharmony/docs/blob/HEAD/zh-cn/contribute/%E5%8F%82%E4%B8%8E%E8%B4%A1%E7%8C%AE.md)
|
||||
|
||||
[Commit message规范](https://gitee.com/openharmony/kernel_liteos_a/wikis/Commit%20message%20%E8%A7%84%E8%8C%83)
|
||||
|
||||
[OpenHarmony C&C++ 安全编程指南](https://gitee.com/openharmony/docs/blob/master/zh-cn/contribute/OpenHarmony-c-cpp-secure-coding-guide.md)
|
||||
|
||||
[LiteOS-A 内核编码规范指南](https://gitee.com/openharmony/kernel_liteos_a/wikis/LiteOS-A%20%E5%86%85%E6%A0%B8%E7%BC%96%E7%A0%81%E8%A7%84%E8%8C%83%E6%8C%87%E5%8D%97)
|
||||
|
||||
## 相关仓<a name="section1371113476307"></a>
|
||||
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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 = [
|
||||
|
||||
@@ -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:
|
||||
}
|
||||
|
||||
|
||||
@@ -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(), ¶m);
|
||||
if (ret != SH_OK) {
|
||||
goto OUT;
|
||||
return ret;
|
||||
}
|
||||
|
||||
param.sched_priority = SHELL_PROCESS_PRIORITY_INIT;
|
||||
|
||||
ret = sched_setparam(getpid(), ¶m);
|
||||
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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 = [
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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:
|
||||
@@ -478,7 +478,6 @@ static int PthreadGetCputime(clockid_t clockID, struct timespec *ats)
|
||||
uint64_t runtime;
|
||||
UINT32 intSave;
|
||||
UINT32 tid = GetTidFromClockID(clockID);
|
||||
|
||||
if (OS_TID_CHECK_INVALID(tid)) {
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -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 */
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -39,10 +39,6 @@ kernel_module(module_name) {
|
||||
|
||||
include_dirs = [ "$LITEOSTOPDIR/fs/jffs2/include" ]
|
||||
|
||||
if (defined(LOSCFG_PLATFORM_QEMU_ARM_VIRT_CA7)) {
|
||||
include_dirs += [ "//device/qemu/drivers/cfiflash" ]
|
||||
}
|
||||
|
||||
public_configs = [ ":public" ]
|
||||
}
|
||||
|
||||
|
||||
@@ -36,10 +36,6 @@ LOCAL_SRCS := $(wildcard src/*.c)
|
||||
LOCAL_INCLUDE := \
|
||||
-I $(LITEOSTOPDIR)/fs/jffs2/include
|
||||
|
||||
ifeq ($(LOSCFG_PLATFORM_QEMU_ARM_VIRT_CA7), y)
|
||||
LOCAL_INCLUDE += -I $(LITEOSTOPDIR)/../../device/qemu/drivers/cfiflash
|
||||
endif
|
||||
|
||||
LOCAL_FLAGS := $(LOCAL_INCLUDE)
|
||||
|
||||
include $(MODULE)
|
||||
|
||||
@@ -39,11 +39,6 @@
|
||||
#include "fs/driver.h"
|
||||
#include "mtd/mtd_legacy_lite.h"
|
||||
|
||||
#ifdef LOSCFG_PLATFORM_QEMU_ARM_VIRT_CA7
|
||||
#include "cfiflash.h"
|
||||
#endif
|
||||
|
||||
|
||||
#define DRIVER_NAME_ADD_SIZE 3
|
||||
pthread_mutex_t g_mtdPartitionLock = PTHREAD_MUTEX_INITIALIZER;
|
||||
|
||||
@@ -134,17 +129,10 @@ static VOID MtdNorParamAssign(partition_param *spinorParam, const struct MtdDev
|
||||
* you can change the SPIBLK_NAME or SPICHR_NAME to NULL.
|
||||
*/
|
||||
spinorParam->flash_mtd = (struct MtdDev *)spinorMtd;
|
||||
#ifndef LOSCFG_PLATFORM_QEMU_ARM_VIRT_CA7
|
||||
spinorParam->flash_ops = GetDevSpinorOps();
|
||||
spinorParam->char_ops = GetMtdCharFops();
|
||||
spinorParam->blockname = SPIBLK_NAME;
|
||||
spinorParam->charname = SPICHR_NAME;
|
||||
#else
|
||||
spinorParam->flash_ops = GetCfiBlkOps();
|
||||
spinorParam->char_ops = NULL;
|
||||
spinorParam->blockname = CFI_DRIVER;
|
||||
spinorParam->charname = NULL;
|
||||
#endif
|
||||
spinorParam->partition_head = g_spinorPartitionHead;
|
||||
spinorParam->block_size = spinorMtd->eraseSize;
|
||||
}
|
||||
@@ -158,11 +146,7 @@ static VOID MtdDeinitSpinorParam(VOID)
|
||||
|
||||
static partition_param *MtdInitSpinorParam(partition_param *spinorParam)
|
||||
{
|
||||
#ifndef LOSCFG_PLATFORM_QEMU_ARM_VIRT_CA7
|
||||
struct MtdDev *spinorMtd = GetMtd("spinor");
|
||||
#else
|
||||
struct MtdDev *spinorMtd = GetCfiMtdDev();
|
||||
#endif
|
||||
if (spinorMtd == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 155 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 139 KiB |
@@ -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);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
||||
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
||||
* Copyright (c) 2020-2022 Huawei Device Co., Ltd. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
@@ -244,8 +244,9 @@ extern int chattr(const char *pathname, struct IATTR *attr);
|
||||
*
|
||||
* @retval #0 On success.
|
||||
* @retval #-1 On failure with errno set.
|
||||
* @retval CONTINE_NUTTX_FCNTL doesn't support some cmds in VfsFcntl, needs to continue going through Nuttx vfs operation.</li>
|
||||
*
|
||||
* @retval CONTINE_NUTTX_FCNTL doesn't support some cmds in VfsFcntl, needs to continue going through
|
||||
* Nuttx vfs operation.</li>
|
||||
*
|
||||
* @par Dependency:
|
||||
* <ul><li>fs.h</li></ul>
|
||||
* @see None
|
||||
|
||||
@@ -49,7 +49,7 @@ struct Mount {
|
||||
LIST_HEAD vnodeList; /* list of vnodes */
|
||||
int vnodeSize; /* size of vnode list */
|
||||
LIST_HEAD activeVnodeList; /* list of active vnodes */
|
||||
int activeVnodeSize; /* szie of active vnodes list */
|
||||
int activeVnodeSize; /* size of active vnodes list */
|
||||
void *data; /* private data */
|
||||
uint32_t hashseed; /* Random seed for vfshash */
|
||||
unsigned long mountFlags; /* Flags for mount */
|
||||
|
||||
@@ -2311,7 +2311,7 @@ diff -Nupr old/fs/jffs2/erase.c new/fs/jffs2/erase.c
|
||||
diff -Nupr old/fs/jffs2/file.c new/fs/jffs2/file.c
|
||||
--- old/fs/jffs2/file.c 2022-05-09 17:22:53.000000000 +0800
|
||||
+++ new/fs/jffs2/file.c 2022-05-10 09:43:14.250000000 +0800
|
||||
@@ -9,325 +9,34 @@
|
||||
@@ -9,335 +9,30 @@
|
||||
* For licensing information, see the file 'LICENCE' in this directory.
|
||||
*
|
||||
*/
|
||||
@@ -2336,32 +2336,35 @@ diff -Nupr old/fs/jffs2/file.c new/fs/jffs2/file.c
|
||||
- loff_t pos, unsigned len, unsigned flags,
|
||||
- struct page **pagep, void **fsdata);
|
||||
-static int jffs2_readpage (struct file *filp, struct page *pg);
|
||||
-
|
||||
-int jffs2_fsync(struct file *filp, loff_t start, loff_t end, int datasync)
|
||||
-{
|
||||
- struct inode *inode = filp->f_mapping->host;
|
||||
- struct jffs2_sb_info *c = JFFS2_SB_INFO(inode->i_sb);
|
||||
- int ret;
|
||||
-
|
||||
- ret = file_write_and_wait_range(filp, start, end);
|
||||
- if (ret)
|
||||
- return ret;
|
||||
|
||||
- inode_lock(inode);
|
||||
- /* Trigger GC to flush any pending writes for this inode */
|
||||
- jffs2_flush_wbuf_gc(c, inode->i_ino);
|
||||
- inode_unlock(inode);
|
||||
+static unsigned char gc_buffer[PAGE_SIZE]; //avoids malloc when user may be under memory pressure
|
||||
|
||||
- return 0;
|
||||
-}
|
||||
|
||||
-const struct file_operations jffs2_file_operations =
|
||||
-int jffs2_fsync(struct file *filp, loff_t start, loff_t end, int datasync)
|
||||
+unsigned char *jffs2_gc_fetch_page(struct jffs2_sb_info *c,
|
||||
+ struct jffs2_inode_info *f,
|
||||
+ unsigned long offset,
|
||||
+ unsigned long *priv)
|
||||
{
|
||||
- struct inode *inode = filp->f_mapping->host;
|
||||
- struct jffs2_sb_info *c = JFFS2_SB_INFO(inode->i_sb);
|
||||
+ /* FIXME: This works only with one file system mounted at a time */
|
||||
int ret;
|
||||
-
|
||||
- ret = file_write_and_wait_range(filp, start, end);
|
||||
+ ret = jffs2_read_inode_range(c, f, gc_buffer,
|
||||
+ offset & ~(PAGE_SIZE-1), PAGE_SIZE);
|
||||
if (ret)
|
||||
- return ret;
|
||||
-
|
||||
- inode_lock(inode);
|
||||
- /* Trigger GC to flush any pending writes for this inode */
|
||||
- jffs2_flush_wbuf_gc(c, inode->i_ino);
|
||||
- inode_unlock(inode);
|
||||
-
|
||||
- return 0;
|
||||
-}
|
||||
-
|
||||
-const struct file_operations jffs2_file_operations =
|
||||
-{
|
||||
- .llseek = generic_file_llseek,
|
||||
- .open = generic_file_open,
|
||||
- .read_iter = generic_file_read_iter,
|
||||
@@ -2395,9 +2398,8 @@ diff -Nupr old/fs/jffs2/file.c new/fs/jffs2/file.c
|
||||
- struct jffs2_inode_info *f = JFFS2_INODE_INFO(inode);
|
||||
- struct jffs2_sb_info *c = JFFS2_SB_INFO(inode->i_sb);
|
||||
- unsigned char *pg_buf;
|
||||
+ /* FIXME: This works only with one file system mounted at a time */
|
||||
int ret;
|
||||
|
||||
- int ret;
|
||||
-
|
||||
- jffs2_dbg(2, "%s(): ino #%lu, page at offset 0x%lx\n",
|
||||
- __func__, inode->i_ino, pg->index << PAGE_SHIFT);
|
||||
-
|
||||
@@ -2436,18 +2438,15 @@ diff -Nupr old/fs/jffs2/file.c new/fs/jffs2/file.c
|
||||
-{
|
||||
- struct jffs2_inode_info *f = JFFS2_INODE_INFO(pg->mapping->host);
|
||||
- int ret;
|
||||
+ ret = jffs2_read_inode_range(c, f, gc_buffer,
|
||||
+ offset & ~(PAGE_SIZE-1), PAGE_SIZE);
|
||||
+ if (ret)
|
||||
+ return ERR_PTR(ret);
|
||||
|
||||
-
|
||||
- mutex_lock(&f->sem);
|
||||
- ret = jffs2_do_readpage_unlock(pg->mapping->host, pg);
|
||||
- mutex_unlock(&f->sem);
|
||||
- return ret;
|
||||
+ return ERR_PTR(ret);
|
||||
+ return gc_buffer;
|
||||
}
|
||||
-
|
||||
|
||||
-static int jffs2_write_begin(struct file *filp, struct address_space *mapping,
|
||||
- loff_t pos, unsigned len, unsigned flags,
|
||||
- struct page **pagep, void **fsdata)
|
||||
@@ -2458,20 +2457,15 @@ diff -Nupr old/fs/jffs2/file.c new/fs/jffs2/file.c
|
||||
- struct page *pg;
|
||||
- struct inode *inode = mapping->host;
|
||||
- struct jffs2_inode_info *f = JFFS2_INODE_INFO(inode);
|
||||
- struct jffs2_sb_info *c = JFFS2_SB_INFO(inode->i_sb);
|
||||
- pgoff_t index = pos >> PAGE_SHIFT;
|
||||
- uint32_t pageofs = index << PAGE_SHIFT;
|
||||
- int ret = 0;
|
||||
-
|
||||
- pg = grab_cache_page_write_begin(mapping, index, flags);
|
||||
- if (!pg)
|
||||
- return -ENOMEM;
|
||||
- *pagep = pg;
|
||||
-
|
||||
- jffs2_dbg(1, "%s()\n", __func__);
|
||||
-
|
||||
- if (pageofs > inode->i_size) {
|
||||
- /* Make new hole frag from old EOF to new page */
|
||||
- struct jffs2_sb_info *c = JFFS2_SB_INFO(inode->i_sb);
|
||||
- struct jffs2_raw_inode ri;
|
||||
- struct jffs2_full_dnode *fn;
|
||||
- uint32_t alloc_len;
|
||||
@@ -2482,7 +2476,7 @@ diff -Nupr old/fs/jffs2/file.c new/fs/jffs2/file.c
|
||||
- ret = jffs2_reserve_space(c, sizeof(ri), &alloc_len,
|
||||
- ALLOC_NORMAL, JFFS2_SUMMARY_INODE_SIZE);
|
||||
- if (ret)
|
||||
- goto out_page;
|
||||
- goto out_err;
|
||||
-
|
||||
- mutex_lock(&f->sem);
|
||||
- memset(&ri, 0, sizeof(ri));
|
||||
@@ -2512,7 +2506,7 @@ diff -Nupr old/fs/jffs2/file.c new/fs/jffs2/file.c
|
||||
- ret = PTR_ERR(fn);
|
||||
- jffs2_complete_reservation(c);
|
||||
- mutex_unlock(&f->sem);
|
||||
- goto out_page;
|
||||
- goto out_err;
|
||||
- }
|
||||
- ret = jffs2_add_full_dnode_to_inode(c, f, fn);
|
||||
- if (f->metadata) {
|
||||
@@ -2527,7 +2521,7 @@ diff -Nupr old/fs/jffs2/file.c new/fs/jffs2/file.c
|
||||
- jffs2_free_full_dnode(fn);
|
||||
- jffs2_complete_reservation(c);
|
||||
- mutex_unlock(&f->sem);
|
||||
- goto out_page;
|
||||
- goto out_err;
|
||||
- }
|
||||
- jffs2_complete_reservation(c);
|
||||
- inode->i_size = pageofs;
|
||||
@@ -2535,6 +2529,19 @@ diff -Nupr old/fs/jffs2/file.c new/fs/jffs2/file.c
|
||||
- }
|
||||
-
|
||||
- /*
|
||||
- * While getting a page and reading data in, lock c->alloc_sem until
|
||||
- * the page is Uptodate. Otherwise GC task may attempt to read the same
|
||||
- * page in read_cache_page(), which causes a deadlock.
|
||||
- */
|
||||
- mutex_lock(&c->alloc_sem);
|
||||
- pg = grab_cache_page_write_begin(mapping, index, flags);
|
||||
- if (!pg) {
|
||||
- ret = -ENOMEM;
|
||||
- goto release_sem;
|
||||
- }
|
||||
- *pagep = pg;
|
||||
-
|
||||
- /*
|
||||
- * Read in the page if it wasn't already present. Cannot optimize away
|
||||
- * the whole page write case until jffs2_write_end can handle the
|
||||
- * case of a short-copy.
|
||||
@@ -2543,19 +2550,20 @@ diff -Nupr old/fs/jffs2/file.c new/fs/jffs2/file.c
|
||||
- mutex_lock(&f->sem);
|
||||
- ret = jffs2_do_readpage_nolock(inode, pg);
|
||||
- mutex_unlock(&f->sem);
|
||||
- if (ret)
|
||||
- goto out_page;
|
||||
- if (ret) {
|
||||
- unlock_page(pg);
|
||||
- put_page(pg);
|
||||
- goto release_sem;
|
||||
- }
|
||||
- }
|
||||
- jffs2_dbg(1, "end write_begin(). pg->flags %lx\n", pg->flags);
|
||||
- return ret;
|
||||
-
|
||||
-out_page:
|
||||
- unlock_page(pg);
|
||||
- put_page(pg);
|
||||
-release_sem:
|
||||
- mutex_unlock(&c->alloc_sem);
|
||||
-out_err:
|
||||
- return ret;
|
||||
+ /* Do nothing */
|
||||
}
|
||||
|
||||
-}
|
||||
-
|
||||
-static int jffs2_write_end(struct file *filp, struct address_space *mapping,
|
||||
- loff_t pos, unsigned len, unsigned copied,
|
||||
- struct page *pg, void *fsdata)
|
||||
@@ -2653,7 +2661,8 @@ diff -Nupr old/fs/jffs2/file.c new/fs/jffs2/file.c
|
||||
- unlock_page(pg);
|
||||
- put_page(pg);
|
||||
- return writtenlen > 0 ? writtenlen : ret;
|
||||
-}
|
||||
+ /* Do nothing */
|
||||
}
|
||||
diff -Nupr old/fs/jffs2/fs.c new/fs/jffs2/fs.c
|
||||
--- old/fs/jffs2/fs.c 2022-05-09 17:22:53.000000000 +0800
|
||||
+++ new/fs/jffs2/fs.c 2022-05-10 16:13:37.830000000 +0800
|
||||
@@ -2769,7 +2778,11 @@ diff -Nupr old/fs/jffs2/fs.c new/fs/jffs2/fs.c
|
||||
ri->version = cpu_to_je32(++f->highest_version);
|
||||
+ ri->uid = cpu_to_je16(inode->i_uid);
|
||||
+ ri->gid = cpu_to_je16(inode->i_gid);
|
||||
+
|
||||
|
||||
- ri->uid = cpu_to_je16((ivalid & ATTR_UID)?
|
||||
- from_kuid(&init_user_ns, iattr->ia_uid):i_uid_read(inode));
|
||||
- ri->gid = cpu_to_je16((ivalid & ATTR_GID)?
|
||||
- from_kgid(&init_user_ns, iattr->ia_gid):i_gid_read(inode));
|
||||
+ if (ivalid & CHG_UID) {
|
||||
+ if (((c_uid != inode->i_uid) || (attr->attr_chg_uid != inode->i_uid)) && (!IsCapPermit(CAP_CHOWN))) {
|
||||
+ jffs2_complete_reservation(c);
|
||||
@@ -2791,16 +2804,7 @@ diff -Nupr old/fs/jffs2/fs.c new/fs/jffs2/fs.c
|
||||
+ ri->gid = cpu_to_je16(attr->attr_chg_gid);
|
||||
+ }
|
||||
+ }
|
||||
|
||||
- ri->uid = cpu_to_je16((ivalid & ATTR_UID)?
|
||||
- from_kuid(&init_user_ns, iattr->ia_uid):i_uid_read(inode));
|
||||
- ri->gid = cpu_to_je16((ivalid & ATTR_GID)?
|
||||
- from_kgid(&init_user_ns, iattr->ia_gid):i_gid_read(inode));
|
||||
-
|
||||
- if (ivalid & ATTR_MODE)
|
||||
- ri->mode = cpu_to_jemode(iattr->ia_mode);
|
||||
- else
|
||||
- ri->mode = cpu_to_jemode(inode->i_mode);
|
||||
+
|
||||
+ if (ivalid & CHG_MODE) {
|
||||
+ if (!IsCapPermit(CAP_FOWNER) && (c_uid != inode->i_uid)) {
|
||||
+ jffs2_complete_reservation(c);
|
||||
@@ -2814,6 +2818,10 @@ diff -Nupr old/fs/jffs2/fs.c new/fs/jffs2/fs.c
|
||||
+ }
|
||||
+ }
|
||||
|
||||
- if (ivalid & ATTR_MODE)
|
||||
- ri->mode = cpu_to_jemode(iattr->ia_mode);
|
||||
- else
|
||||
- ri->mode = cpu_to_jemode(inode->i_mode);
|
||||
+ if (ivalid & CHG_ATIME) {
|
||||
+ if ((c_uid != inode->i_uid) || (attr->attr_chg_uid != inode->i_uid)) {
|
||||
+ return -EPERM;
|
||||
@@ -2823,7 +2831,7 @@ diff -Nupr old/fs/jffs2/fs.c new/fs/jffs2/fs.c
|
||||
+ } else {
|
||||
+ ri->atime = cpu_to_je32(inode->i_atime);
|
||||
+ }
|
||||
+
|
||||
|
||||
+ if (ivalid & CHG_MTIME) {
|
||||
+ if ((c_uid != inode->i_uid) || (attr->attr_chg_uid != inode->i_uid)) {
|
||||
+ return -EPERM;
|
||||
@@ -2875,7 +2883,7 @@ diff -Nupr old/fs/jffs2/fs.c new/fs/jffs2/fs.c
|
||||
if (IS_ERR(new_metadata)) {
|
||||
jffs2_complete_reservation(c);
|
||||
jffs2_free_raw_inode(ri);
|
||||
@@ -147,23 +140,20 @@ int jffs2_do_setattr (struct inode *inod
|
||||
@@ -147,23 +140,20 @@ int jffs2_do_setattr (struct inode *inode, struct iattr *iattr)
|
||||
return PTR_ERR(new_metadata);
|
||||
}
|
||||
/* It worked. Update the inode */
|
||||
@@ -2908,7 +2916,7 @@ diff -Nupr old/fs/jffs2/fs.c new/fs/jffs2/fs.c
|
||||
f->metadata = NULL;
|
||||
} else {
|
||||
f->metadata = new_metadata;
|
||||
@@ -182,315 +172,201 @@ int jffs2_do_setattr (struct inode *inod
|
||||
@@ -182,315 +172,201 @@ int jffs2_do_setattr (struct inode *inode, struct iattr *iattr)
|
||||
We are protected from a simultaneous write() extending i_size
|
||||
back past iattr->ia_size, because do_truncate() holds the
|
||||
generic inode semaphore. */
|
||||
@@ -2927,31 +2935,43 @@ diff -Nupr old/fs/jffs2/fs.c new/fs/jffs2/fs.c
|
||||
{
|
||||
- struct inode *inode = d_inode(dentry);
|
||||
- int rc;
|
||||
-
|
||||
- rc = setattr_prepare(dentry, iattr);
|
||||
- if (rc)
|
||||
- return rc;
|
||||
-
|
||||
- rc = jffs2_do_setattr(inode, iattr);
|
||||
- if (!rc && (iattr->ia_valid & ATTR_MODE))
|
||||
- rc = posix_acl_chmod(inode, inode->i_mode);
|
||||
+ /* We can forget about this inode for now - drop all
|
||||
+ * the nodelists associated with it, etc.
|
||||
+ */
|
||||
+ struct jffs2_sb_info *c = JFFS2_SB_INFO(inode->i_sb);
|
||||
+ struct jffs2_inode_info *f = JFFS2_INODE_INFO(inode);
|
||||
+
|
||||
+ jffs2_do_clear_inode(c, f);
|
||||
+}
|
||||
|
||||
- rc = setattr_prepare(dentry, iattr);
|
||||
- if (rc)
|
||||
- return rc;
|
||||
+static struct jffs2_inode *ilookup(struct super_block *sb, uint32_t ino)
|
||||
+{
|
||||
+ struct jffs2_inode *node = NULL;
|
||||
|
||||
- rc = jffs2_do_setattr(inode, iattr);
|
||||
- if (!rc && (iattr->ia_valid & ATTR_MODE))
|
||||
- rc = posix_acl_chmod(inode, inode->i_mode);
|
||||
+ if (sb->s_root == NULL) {
|
||||
+ return NULL;
|
||||
+ }
|
||||
|
||||
- return rc;
|
||||
+ jffs2_do_clear_inode(c, f);
|
||||
+ // Check for this inode in the cache
|
||||
+ Jffs2NodeLock();
|
||||
+ (void)Jffs2HashGet(&sb->s_node_hash_lock, &sb->s_node_hash[0], sb, ino, &node);
|
||||
+ Jffs2NodeUnlock();
|
||||
+ return node;
|
||||
}
|
||||
|
||||
-int jffs2_statfs(struct dentry *dentry, struct kstatfs *buf)
|
||||
+static struct jffs2_inode *ilookup(struct super_block *sb, uint32_t ino)
|
||||
+struct jffs2_inode *new_inode(struct super_block *sb)
|
||||
{
|
||||
- struct jffs2_sb_info *c = JFFS2_SB_INFO(dentry->d_sb);
|
||||
- unsigned long avail;
|
||||
+ struct jffs2_inode *node = NULL;
|
||||
|
||||
-
|
||||
- buf->f_type = JFFS2_SUPER_MAGIC;
|
||||
- buf->f_bsize = 1 << PAGE_SHIFT;
|
||||
- buf->f_blocks = c->flash_size >> PAGE_SHIFT;
|
||||
@@ -2970,47 +2990,35 @@ diff -Nupr old/fs/jffs2/fs.c new/fs/jffs2/fs.c
|
||||
- spin_unlock(&c->erase_completion_lock);
|
||||
-
|
||||
- buf->f_bavail = buf->f_bfree = avail >> PAGE_SHIFT;
|
||||
+ if (sb->s_root == NULL) {
|
||||
+ return NULL;
|
||||
+ }
|
||||
+ struct jffs2_inode *inode = NULL;
|
||||
|
||||
- return 0;
|
||||
+ // Check for this inode in the cache
|
||||
+ Jffs2NodeLock();
|
||||
+ (void)Jffs2HashGet(&sb->s_node_hash_lock, &sb->s_node_hash[0], sb, ino, &node);
|
||||
+ Jffs2NodeUnlock();
|
||||
+ return node;
|
||||
}
|
||||
-}
|
||||
+ inode = zalloc(sizeof (struct jffs2_inode));
|
||||
+ if (inode == NULL)
|
||||
+ return 0;
|
||||
|
||||
+ D2(PRINTK("malloc new_inode %x ####################################\n",
|
||||
+ inode));
|
||||
|
||||
-
|
||||
-void jffs2_evict_inode (struct inode *inode)
|
||||
+struct jffs2_inode *new_inode(struct super_block *sb)
|
||||
{
|
||||
-{
|
||||
- /* We can forget about this inode for now - drop all
|
||||
- * the nodelists associated with it, etc.
|
||||
- */
|
||||
- struct jffs2_sb_info *c = JFFS2_SB_INFO(inode->i_sb);
|
||||
- struct jffs2_inode_info *f = JFFS2_INODE_INFO(inode);
|
||||
+ struct jffs2_inode *inode = NULL;
|
||||
+ inode->i_sb = sb;
|
||||
+ inode->i_ino = 1;
|
||||
+ inode->i_nlink = 1; // Let JFFS2 manage the link count
|
||||
+ inode->i_size = 0;
|
||||
+ LOS_ListInit((&(inode->i_hashlist)));
|
||||
|
||||
- jffs2_dbg(1, "%s(): ino #%lu mode %o\n",
|
||||
- __func__, inode->i_ino, inode->i_mode);
|
||||
- truncate_inode_pages_final(&inode->i_data);
|
||||
- clear_inode(inode);
|
||||
- jffs2_do_clear_inode(c, f);
|
||||
+ inode = zalloc(sizeof (struct jffs2_inode));
|
||||
+ if (inode == NULL)
|
||||
+ return 0;
|
||||
+
|
||||
+ D2(PRINTK("malloc new_inode %x ####################################\n",
|
||||
+ inode));
|
||||
+
|
||||
+ inode->i_sb = sb;
|
||||
+ inode->i_ino = 1;
|
||||
+ inode->i_nlink = 1; // Let JFFS2 manage the link count
|
||||
+ inode->i_size = 0;
|
||||
+ LOS_ListInit((&(inode->i_hashlist)));
|
||||
+
|
||||
+ return inode;
|
||||
}
|
||||
|
||||
@@ -3075,16 +3083,16 @@ diff -Nupr old/fs/jffs2/fs.c new/fs/jffs2/fs.c
|
||||
- inode->i_ctime = ITIME(je32_to_cpu(latest_node.ctime));
|
||||
-
|
||||
- set_nlink(inode, f->inocache->pino_nlink);
|
||||
-
|
||||
- inode->i_blocks = (inode->i_size + 511) >> 9;
|
||||
+ inode->i_atime = je32_to_cpu(latest_node.atime);
|
||||
+ inode->i_mtime = je32_to_cpu(latest_node.mtime);
|
||||
+ inode->i_ctime = je32_to_cpu(latest_node.ctime);
|
||||
+ inode->i_nlink = f->inocache->pino_nlink;
|
||||
|
||||
- inode->i_blocks = (inode->i_size + 511) >> 9;
|
||||
- switch (inode->i_mode & S_IFMT) {
|
||||
+ (void)mutex_unlock(&f->sem);
|
||||
|
||||
- switch (inode->i_mode & S_IFMT) {
|
||||
-
|
||||
- case S_IFLNK:
|
||||
- inode->i_op = &jffs2_symlink_inode_operations;
|
||||
- inode->i_link = f->target;
|
||||
@@ -3154,20 +3162,21 @@ diff -Nupr old/fs/jffs2/fs.c new/fs/jffs2/fs.c
|
||||
jffs2_dbg(1, "jffs2_read_inode() returning\n");
|
||||
- unlock_new_inode(inode);
|
||||
- return inode;
|
||||
-
|
||||
+ Jffs2NodeUnlock();
|
||||
|
||||
-error_io:
|
||||
- ret = -EIO;
|
||||
-error:
|
||||
- mutex_unlock(&f->sem);
|
||||
- iget_failed(inode);
|
||||
- return ERR_PTR(ret);
|
||||
-}
|
||||
+ Jffs2NodeUnlock();
|
||||
+ return inode;
|
||||
}
|
||||
|
||||
-void jffs2_dirty_inode(struct inode *inode, int flags)
|
||||
-{
|
||||
- struct iattr iattr;
|
||||
-
|
||||
|
||||
- if (!(inode->i_state & I_DIRTY_DATASYNC)) {
|
||||
- jffs2_dbg(2, "%s(): not calling setattr() for ino #%lu\n",
|
||||
- __func__, inode->i_ino);
|
||||
@@ -3186,16 +3195,19 @@ diff -Nupr old/fs/jffs2/fs.c new/fs/jffs2/fs.c
|
||||
- iattr.ia_ctime = inode->i_ctime;
|
||||
-
|
||||
- jffs2_do_setattr(inode, &iattr);
|
||||
+ return inode;
|
||||
}
|
||||
-}
|
||||
+// -------------------------------------------------------------------------
|
||||
+// Decrement the reference count on an inode. If this makes the ref count
|
||||
+// zero, then this inode can be freed.
|
||||
|
||||
-int jffs2_do_remount_fs(struct super_block *sb, struct fs_context *fc)
|
||||
-{
|
||||
+int jffs2_iput(struct jffs2_inode *i)
|
||||
{
|
||||
- struct jffs2_sb_info *c = JFFS2_SB_INFO(sb);
|
||||
-
|
||||
- if (c->flags & JFFS2_SB_FLAG_RO && !sb_rdonly(sb))
|
||||
- return -EROFS;
|
||||
|
||||
-
|
||||
- /* We stop if it was running, then restart if it needs to.
|
||||
- This also catches the case where it was stopped and this
|
||||
- is just a remount to restart it.
|
||||
@@ -3206,12 +3218,9 @@ diff -Nupr old/fs/jffs2/fs.c new/fs/jffs2/fs.c
|
||||
- jffs2_flush_wbuf_pad(c);
|
||||
- mutex_unlock(&c->alloc_sem);
|
||||
- }
|
||||
+// -------------------------------------------------------------------------
|
||||
+// Decrement the reference count on an inode. If this makes the ref count
|
||||
+// zero, then this inode can be freed.
|
||||
+
|
||||
+int jffs2_iput(struct jffs2_inode *i)
|
||||
+{
|
||||
-
|
||||
- if (!(fc->sb_flags & SB_RDONLY))
|
||||
- jffs2_start_garbage_collect_thread(c);
|
||||
+ // Called in jffs2_find
|
||||
+ // (and jffs2_open and jffs2_ops_mkdir?)
|
||||
+ // super.c jffs2_fill_super,
|
||||
@@ -3233,9 +3242,6 @@ diff -Nupr old/fs/jffs2/fs.c new/fs/jffs2/fs.c
|
||||
+ free(i);
|
||||
+ Jffs2NodeUnlock();
|
||||
|
||||
- if (!(fc->sb_flags & SB_RDONLY))
|
||||
- jffs2_start_garbage_collect_thread(c);
|
||||
-
|
||||
- fc->sb_flags |= SB_NOATIME;
|
||||
return 0;
|
||||
}
|
||||
@@ -3342,7 +3348,7 @@ diff -Nupr old/fs/jffs2/fs.c new/fs/jffs2/fs.c
|
||||
{
|
||||
/*
|
||||
* Pick a inocache hash size based on the size of the medium.
|
||||
@@ -510,117 +386,17 @@ static int calculate_inocache_hashsize(u
|
||||
@@ -510,118 +386,17 @@ static int calculate_inocache_hashsize(uint32_t flash_size)
|
||||
return hashsize;
|
||||
}
|
||||
|
||||
@@ -3438,8 +3444,9 @@ diff -Nupr old/fs/jffs2/fs.c new/fs/jffs2/fs.c
|
||||
- jffs2_free_ino_caches(c);
|
||||
- jffs2_free_raw_node_refs(c);
|
||||
- kvfree(c->blocks);
|
||||
- out_inohash:
|
||||
- jffs2_clear_xattr_subsystem(c);
|
||||
- jffs2_sum_exit(c);
|
||||
- out_inohash:
|
||||
- kfree(c->inocache_list);
|
||||
- out_wbuf:
|
||||
- jffs2_flash_cleanup(c);
|
||||
@@ -3448,8 +3455,7 @@ diff -Nupr old/fs/jffs2/fs.c new/fs/jffs2/fs.c
|
||||
-}
|
||||
-
|
||||
void jffs2_gc_release_inode(struct jffs2_sb_info *c,
|
||||
- struct jffs2_inode_info *f)
|
||||
+ struct jffs2_inode_info *f)
|
||||
struct jffs2_inode_info *f)
|
||||
{
|
||||
- iput(OFNI_EDONI_2SFFJ(f));
|
||||
+ struct jffs2_inode *node = OFNI_EDONI_2SFFJ(f);
|
||||
@@ -3464,7 +3470,7 @@ diff -Nupr old/fs/jffs2/fs.c new/fs/jffs2/fs.c
|
||||
struct jffs2_inode_cache *ic;
|
||||
|
||||
if (unlinked) {
|
||||
@@ -668,72 +444,9 @@ struct jffs2_inode_info *jffs2_gc_fetch_
|
||||
@@ -669,72 +444,9 @@ struct jffs2_inode_info *jffs2_gc_fetch_inode(struct jffs2_sb_info *c,
|
||||
Just iget() it, and if read_inode() is necessary that's OK.
|
||||
*/
|
||||
inode = jffs2_iget(OFNI_BS_2SFFJ(c), inum);
|
||||
@@ -5556,7 +5562,7 @@ diff -Nupr old/fs/jffs2/scan.c new/fs/jffs2/scan.c
|
||||
|
||||
#define DEFAULT_EMPTY_SCAN_SIZE 256
|
||||
|
||||
@@ -74,7 +73,7 @@ static int file_dirty(struct jffs2_sb_in
|
||||
@@ -74,7 +73,7 @@ static int file_dirty(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb)
|
||||
return ret;
|
||||
if ((ret = jffs2_scan_dirty_space(c, jeb, jeb->free_size)))
|
||||
return ret;
|
||||
@@ -5565,15 +5571,13 @@ diff -Nupr old/fs/jffs2/scan.c new/fs/jffs2/scan.c
|
||||
think it's recoverable now. */
|
||||
jeb->dirty_size += jeb->wasted_size;
|
||||
c->dirty_size += jeb->wasted_size;
|
||||
@@ -95,40 +94,26 @@ int jffs2_scan_medium(struct jffs2_sb_in
|
||||
@@ -95,40 +94,26 @@ int jffs2_scan_medium(struct jffs2_sb_info *c)
|
||||
unsigned char *flashbuf = NULL;
|
||||
uint32_t buf_size = 0;
|
||||
struct jffs2_summary *s = NULL; /* summary info collected by the scan process */
|
||||
-#ifndef __ECOS
|
||||
- size_t pointlen, try_size;
|
||||
+ struct super_block *sb = NULL;
|
||||
+ struct MtdNorDev *device = NULL;
|
||||
|
||||
-
|
||||
- ret = mtd_point(c->mtd, 0, c->mtd->size, &pointlen,
|
||||
- (void **)&flashbuf, NULL);
|
||||
- if (!ret && pointlen < c->mtd->size) {
|
||||
@@ -5586,6 +5590,9 @@ diff -Nupr old/fs/jffs2/scan.c new/fs/jffs2/scan.c
|
||||
- if (ret && ret != -EOPNOTSUPP)
|
||||
- jffs2_dbg(1, "MTD point failed %d\n", ret);
|
||||
-#endif
|
||||
+ struct super_block *sb = NULL;
|
||||
+ struct MtdNorDev *device = NULL;
|
||||
+
|
||||
if (!flashbuf) {
|
||||
/* For NAND it's quicker to read a whole eraseblock at a time,
|
||||
apparently */
|
||||
@@ -5613,7 +5620,7 @@ diff -Nupr old/fs/jffs2/scan.c new/fs/jffs2/scan.c
|
||||
}
|
||||
|
||||
if (jffs2_sum_active()) {
|
||||
@@ -140,7 +125,9 @@ int jffs2_scan_medium(struct jffs2_sb_in
|
||||
@@ -140,7 +125,9 @@ int jffs2_scan_medium(struct jffs2_sb_info *c)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5624,7 +5631,7 @@ diff -Nupr old/fs/jffs2/scan.c new/fs/jffs2/scan.c
|
||||
struct jffs2_eraseblock *jeb = &c->blocks[i];
|
||||
|
||||
cond_resched();
|
||||
@@ -269,19 +256,12 @@ int jffs2_scan_medium(struct jffs2_sb_in
|
||||
@@ -269,14 +256,10 @@ int jffs2_scan_medium(struct jffs2_sb_info *c)
|
||||
ret = -EIO;
|
||||
goto out;
|
||||
}
|
||||
@@ -5634,20 +5641,13 @@ diff -Nupr old/fs/jffs2/scan.c new/fs/jffs2/scan.c
|
||||
}
|
||||
ret = 0;
|
||||
out:
|
||||
- if (buf_size)
|
||||
- kfree(flashbuf);
|
||||
-#ifndef __ECOS
|
||||
- else
|
||||
- mtd_unpoint(c->mtd, 0, c->mtd->size);
|
||||
-#endif
|
||||
- jffs2_sum_reset_collected(s);
|
||||
- kfree(s);
|
||||
+
|
||||
+ kfree(flashbuf);
|
||||
+
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -411,7 +391,7 @@ static int jffs2_scan_xref_node(struct j
|
||||
out_buf:
|
||||
if (buf_size)
|
||||
kfree(flashbuf);
|
||||
@@ -413,7 +396,7 @@ static int jffs2_scan_xref_node(struct jffs2_sb_info *c, struct jffs2_eraseblock
|
||||
if (!ref)
|
||||
return -ENOMEM;
|
||||
|
||||
@@ -5656,7 +5656,7 @@ diff -Nupr old/fs/jffs2/scan.c new/fs/jffs2/scan.c
|
||||
* and AFTER xattr_ref is marked as a dead xref,
|
||||
* ref->xid is used to store 32bit xid, xd is not used
|
||||
* ref->ino is used to store 32bit inode-number, ic is not used
|
||||
@@ -484,10 +464,10 @@ static int jffs2_scan_eraseblock (struct
|
||||
@@ -486,10 +469,10 @@ static int jffs2_scan_eraseblock (struct jffs2_sb_info *c, struct jffs2_eraseblo
|
||||
struct jffs2_sum_marker *sm;
|
||||
void *sumptr = NULL;
|
||||
uint32_t sumlen;
|
||||
@@ -5669,7 +5669,7 @@ diff -Nupr old/fs/jffs2/scan.c new/fs/jffs2/scan.c
|
||||
if (je32_to_cpu(sm->magic) == JFFS2_SUM_MAGIC) {
|
||||
sumptr = buf + je32_to_cpu(sm->offset);
|
||||
sumlen = c->sector_size - je32_to_cpu(sm->offset);
|
||||
@@ -500,13 +480,13 @@ static int jffs2_scan_eraseblock (struct
|
||||
@@ -502,13 +485,13 @@ static int jffs2_scan_eraseblock (struct jffs2_sb_info *c, struct jffs2_eraseblo
|
||||
buf_len = sizeof(*sm);
|
||||
|
||||
/* Read as much as we want into the _end_ of the preallocated buffer */
|
||||
@@ -5686,7 +5686,7 @@ diff -Nupr old/fs/jffs2/scan.c new/fs/jffs2/scan.c
|
||||
if (je32_to_cpu(sm->magic) == JFFS2_SUM_MAGIC) {
|
||||
sumlen = c->sector_size - je32_to_cpu(sm->offset);
|
||||
sumptr = buf + buf_size - sumlen;
|
||||
@@ -521,18 +501,15 @@ static int jffs2_scan_eraseblock (struct
|
||||
@@ -523,18 +506,15 @@ static int jffs2_scan_eraseblock (struct jffs2_sb_info *c, struct jffs2_eraseblo
|
||||
sumptr = kmalloc(sumlen, GFP_KERNEL);
|
||||
if (!sumptr)
|
||||
return -ENOMEM;
|
||||
@@ -5709,7 +5709,7 @@ diff -Nupr old/fs/jffs2/scan.c new/fs/jffs2/scan.c
|
||||
}
|
||||
}
|
||||
|
||||
@@ -543,7 +520,7 @@ static int jffs2_scan_eraseblock (struct
|
||||
@@ -545,7 +525,7 @@ static int jffs2_scan_eraseblock (struct jffs2_sb_info *c, struct jffs2_eraseblo
|
||||
|
||||
if (buf_size && sumlen > buf_size)
|
||||
kfree(sumptr);
|
||||
@@ -5718,7 +5718,7 @@ diff -Nupr old/fs/jffs2/scan.c new/fs/jffs2/scan.c
|
||||
If it returns positive, that's a block classification
|
||||
(i.e. BLK_STATE_xxx) so return that too.
|
||||
If it returns zero, fall through to full scan. */
|
||||
@@ -605,7 +582,7 @@ full_scan:
|
||||
@@ -607,7 +587,7 @@ static int jffs2_scan_eraseblock (struct jffs2_sb_info *c, struct jffs2_eraseblo
|
||||
/* Now ofs is a complete physical flash offset as it always was... */
|
||||
ofs += jeb->offset;
|
||||
|
||||
@@ -5727,7 +5727,7 @@ diff -Nupr old/fs/jffs2/scan.c new/fs/jffs2/scan.c
|
||||
|
||||
dbg_summary("no summary found in jeb 0x%08x. Apply original scan.\n",jeb->offset);
|
||||
|
||||
@@ -698,7 +675,7 @@ scan_more:
|
||||
@@ -700,7 +680,7 @@ static int jffs2_scan_eraseblock (struct jffs2_sb_info *c, struct jffs2_eraseblo
|
||||
scan_end = buf_len;
|
||||
goto more_empty;
|
||||
}
|
||||
@@ -5736,7 +5736,7 @@ diff -Nupr old/fs/jffs2/scan.c new/fs/jffs2/scan.c
|
||||
/* See how much more there is to read in this eraseblock... */
|
||||
buf_len = min_t(uint32_t, buf_size, jeb->offset + c->sector_size - ofs);
|
||||
if (!buf_len) {
|
||||
@@ -948,7 +925,7 @@ scan_more:
|
||||
@@ -950,7 +930,7 @@ static int jffs2_scan_eraseblock (struct jffs2_sb_info *c, struct jffs2_eraseblo
|
||||
jffs2_dbg(1, "Block at 0x%08x: free 0x%08x, dirty 0x%08x, unchecked 0x%08x, used 0x%08x, wasted 0x%08x\n",
|
||||
jeb->offset, jeb->free_size, jeb->dirty_size,
|
||||
jeb->unchecked_size, jeb->used_size, jeb->wasted_size);
|
||||
@@ -5745,7 +5745,7 @@ diff -Nupr old/fs/jffs2/scan.c new/fs/jffs2/scan.c
|
||||
/* mark_node_obsolete can add to wasted !! */
|
||||
if (jeb->wasted_size) {
|
||||
jeb->dirty_size += jeb->wasted_size;
|
||||
@@ -976,7 +953,6 @@ struct jffs2_inode_cache *jffs2_scan_mak
|
||||
@@ -978,7 +958,6 @@ struct jffs2_inode_cache *jffs2_scan_make_ino_cache(struct jffs2_sb_info *c, uin
|
||||
pr_notice("%s(): allocation of inode cache failed\n", __func__);
|
||||
return NULL;
|
||||
}
|
||||
@@ -5753,7 +5753,7 @@ diff -Nupr old/fs/jffs2/scan.c new/fs/jffs2/scan.c
|
||||
|
||||
ic->ino = ino;
|
||||
ic->nodes = (void *)ic;
|
||||
@@ -1067,7 +1043,7 @@ static int jffs2_scan_dirent_node(struct
|
||||
@@ -1069,7 +1048,7 @@ static int jffs2_scan_dirent_node(struct jffs2_sb_info *c, struct jffs2_eraseblo
|
||||
pseudo_random += je32_to_cpu(rd->version);
|
||||
|
||||
/* Should never happen. Did. (OLPC trac #4184)*/
|
||||
@@ -5762,7 +5762,7 @@ diff -Nupr old/fs/jffs2/scan.c new/fs/jffs2/scan.c
|
||||
if (checkedlen < rd->nsize) {
|
||||
pr_err("Dirent at %08x has zeroes in name. Truncating to %d chars\n",
|
||||
ofs, checkedlen);
|
||||
@@ -1079,7 +1055,7 @@ static int jffs2_scan_dirent_node(struct
|
||||
@@ -1081,7 +1060,7 @@ static int jffs2_scan_dirent_node(struct jffs2_sb_info *c, struct jffs2_eraseblo
|
||||
memcpy(&fd->name, rd->name, checkedlen);
|
||||
fd->name[checkedlen] = 0;
|
||||
|
||||
@@ -5771,7 +5771,248 @@ diff -Nupr old/fs/jffs2/scan.c new/fs/jffs2/scan.c
|
||||
if (crc != je32_to_cpu(rd->name_crc)) {
|
||||
pr_notice("%s(): Name CRC failed on node at 0x%08x: Read 0x%08x, calculated 0x%08x\n",
|
||||
__func__, ofs, je32_to_cpu(rd->name_crc), crc);
|
||||
@@ -1104,7 +1080,7 @@ static int jffs2_scan_dirent_node(struct
|
||||
@@ -1106,7 +1085,7 @@ static int jffs2_scan_dirent_node(struct jffs2_sb_info *c, struct jffs2_eraseblo
|
||||
fd->next = NULL;
|
||||
fd->version = je32_to_cpu(rd->version);
|
||||
fd->ino = je32_to_cpu(rd->ino);
|
||||
- fd->nhash = full_name_hash(NULL, fd->name, checkedlen);
|
||||
+ fd->nhash = full_name_hash(fd->name, checkedlen);
|
||||
fd->type = rd->type;
|
||||
jffs2_add_fd_to_list(c, fd, &ic->scan_dents);
|
||||
|
||||
diff
|
||||
@@ -9,18 +9,17 @@
|
||||
*
|
||||
*/
|
||||
|
||||
-#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
|
||||
-
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/sched.h>
|
||||
#include <linux/slab.h>
|
||||
-#include <linux/mtd/mtd.h>
|
||||
#include <linux/pagemap.h>
|
||||
-#include <linux/crc32.h>
|
||||
#include <linux/compiler.h>
|
||||
#include "nodelist.h"
|
||||
#include "summary.h"
|
||||
#include "debug.h"
|
||||
+#include "mtd_dev.h"
|
||||
+#include "los_typedef.h"
|
||||
+#include "los_crc32.h"
|
||||
|
||||
#define DEFAULT_EMPTY_SCAN_SIZE 256
|
||||
|
||||
@@ -74,7 +73,7 @@ static int file_dirty(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb)
|
||||
return ret;
|
||||
if ((ret = jffs2_scan_dirty_space(c, jeb, jeb->free_size)))
|
||||
return ret;
|
||||
- /* Turned wasted size into dirty, since we apparently
|
||||
+ /* Turned wasted size into dirty, since we apparently
|
||||
think it's recoverable now. */
|
||||
jeb->dirty_size += jeb->wasted_size;
|
||||
c->dirty_size += jeb->wasted_size;
|
||||
@@ -95,40 +94,26 @@ int jffs2_scan_medium(struct jffs2_sb_info *c)
|
||||
unsigned char *flashbuf = NULL;
|
||||
uint32_t buf_size = 0;
|
||||
struct jffs2_summary *s = NULL; /* summary info collected by the scan process */
|
||||
-#ifndef __ECOS
|
||||
- size_t pointlen, try_size;
|
||||
-
|
||||
- ret = mtd_point(c->mtd, 0, c->mtd->size, &pointlen,
|
||||
- (void **)&flashbuf, NULL);
|
||||
- if (!ret && pointlen < c->mtd->size) {
|
||||
- /* Don't muck about if it won't let us point to the whole flash */
|
||||
- jffs2_dbg(1, "MTD point returned len too short: 0x%zx\n",
|
||||
- pointlen);
|
||||
- mtd_unpoint(c->mtd, 0, pointlen);
|
||||
- flashbuf = NULL;
|
||||
- }
|
||||
- if (ret && ret != -EOPNOTSUPP)
|
||||
- jffs2_dbg(1, "MTD point failed %d\n", ret);
|
||||
-#endif
|
||||
+ struct super_block *sb = NULL;
|
||||
+ struct MtdNorDev *device = NULL;
|
||||
+
|
||||
if (!flashbuf) {
|
||||
/* For NAND it's quicker to read a whole eraseblock at a time,
|
||||
apparently */
|
||||
if (jffs2_cleanmarker_oob(c))
|
||||
- try_size = c->sector_size;
|
||||
+ buf_size = c->sector_size;
|
||||
else
|
||||
- try_size = PAGE_SIZE;
|
||||
+ buf_size = PAGE_SIZE;
|
||||
|
||||
jffs2_dbg(1, "Trying to allocate readbuf of %zu "
|
||||
- "bytes\n", try_size);
|
||||
+ "bytes\n", buf_size);
|
||||
|
||||
- flashbuf = mtd_kmalloc_up_to(c->mtd, &try_size);
|
||||
+ flashbuf = kmalloc(buf_size, GFP_KERNEL);
|
||||
if (!flashbuf)
|
||||
return -ENOMEM;
|
||||
|
||||
jffs2_dbg(1, "Allocated readbuf of %zu bytes\n",
|
||||
- try_size);
|
||||
-
|
||||
- buf_size = (uint32_t)try_size;
|
||||
+ buf_size);
|
||||
}
|
||||
|
||||
if (jffs2_sum_active()) {
|
||||
@@ -140,7 +125,9 @@ int jffs2_scan_medium(struct jffs2_sb_info *c)
|
||||
}
|
||||
}
|
||||
|
||||
- for (i=0; i<c->nr_blocks; i++) {
|
||||
+ sb = OFNI_BS_2SFFJ(c);
|
||||
+ device = (struct MtdNorDev*)(sb->s_dev);
|
||||
+ for (i=device->blockStart; i<c->nr_blocks + device->blockStart; i++) {
|
||||
struct jffs2_eraseblock *jeb = &c->blocks[i];
|
||||
|
||||
cond_resched();
|
||||
@@ -269,14 +256,10 @@ int jffs2_scan_medium(struct jffs2_sb_info *c)
|
||||
ret = -EIO;
|
||||
goto out;
|
||||
}
|
||||
- spin_lock(&c->erase_completion_lock);
|
||||
- jffs2_garbage_collect_trigger(c);
|
||||
- spin_unlock(&c->erase_completion_lock);
|
||||
}
|
||||
ret = 0;
|
||||
out:
|
||||
- jffs2_sum_reset_collected(s);
|
||||
- kfree(s);
|
||||
+ kfree(flashbuf);
|
||||
out_buf:
|
||||
if (buf_size)
|
||||
kfree(flashbuf);
|
||||
@@ -413,7 +396,7 @@ static int jffs2_scan_xref_node(struct jffs2_sb_info *c, struct jffs2_eraseblock
|
||||
if (!ref)
|
||||
return -ENOMEM;
|
||||
|
||||
- /* BEFORE jffs2_build_xattr_subsystem() called,
|
||||
+ /* BEFORE jffs2_build_xattr_subsystem() called,
|
||||
* and AFTER xattr_ref is marked as a dead xref,
|
||||
* ref->xid is used to store 32bit xid, xd is not used
|
||||
* ref->ino is used to store 32bit inode-number, ic is not used
|
||||
@@ -486,10 +469,10 @@ static int jffs2_scan_eraseblock (struct jffs2_sb_info *c, struct jffs2_eraseblo
|
||||
struct jffs2_sum_marker *sm;
|
||||
void *sumptr = NULL;
|
||||
uint32_t sumlen;
|
||||
-
|
||||
+
|
||||
if (!buf_size) {
|
||||
/* XIP case. Just look, point at the summary if it's there */
|
||||
- sm = (void *)buf + c->sector_size - sizeof(*sm);
|
||||
+ sm = (struct jffs2_sum_marker *)((uint8_t *)buf + c->sector_size - sizeof(*sm));
|
||||
if (je32_to_cpu(sm->magic) == JFFS2_SUM_MAGIC) {
|
||||
sumptr = buf + je32_to_cpu(sm->offset);
|
||||
sumlen = c->sector_size - je32_to_cpu(sm->offset);
|
||||
@@ -502,13 +485,13 @@ static int jffs2_scan_eraseblock (struct jffs2_sb_info *c, struct jffs2_eraseblo
|
||||
buf_len = sizeof(*sm);
|
||||
|
||||
/* Read as much as we want into the _end_ of the preallocated buffer */
|
||||
- err = jffs2_fill_scan_buf(c, buf + buf_size - buf_len,
|
||||
+ err = jffs2_fill_scan_buf(c, buf + buf_size - buf_len,
|
||||
jeb->offset + c->sector_size - buf_len,
|
||||
- buf_len);
|
||||
+ buf_len);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
- sm = (void *)buf + buf_size - sizeof(*sm);
|
||||
+ sm = (struct jffs2_sum_marker *)((uint8_t *)buf + buf_size - sizeof(*sm));
|
||||
if (je32_to_cpu(sm->magic) == JFFS2_SUM_MAGIC) {
|
||||
sumlen = c->sector_size - je32_to_cpu(sm->offset);
|
||||
sumptr = buf + buf_size - sumlen;
|
||||
@@ -523,18 +506,15 @@ static int jffs2_scan_eraseblock (struct jffs2_sb_info *c, struct jffs2_eraseblo
|
||||
sumptr = kmalloc(sumlen, GFP_KERNEL);
|
||||
if (!sumptr)
|
||||
return -ENOMEM;
|
||||
- memcpy(sumptr + sumlen - buf_len, buf + buf_size - buf_len, buf_len);
|
||||
+ memcpy((uint8_t *)sumptr + sumlen - buf_len, buf + buf_size - buf_len, buf_len);
|
||||
}
|
||||
if (buf_len < sumlen) {
|
||||
/* Need to read more so that the entire summary node is present */
|
||||
- err = jffs2_fill_scan_buf(c, sumptr,
|
||||
+ err = jffs2_fill_scan_buf(c, sumptr,
|
||||
jeb->offset + c->sector_size - sumlen,
|
||||
- sumlen - buf_len);
|
||||
- if (err) {
|
||||
- if (sumlen > buf_size)
|
||||
- kfree(sumptr);
|
||||
+ sumlen - buf_len);
|
||||
+ if (err)
|
||||
return err;
|
||||
- }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -545,7 +525,7 @@ static int jffs2_scan_eraseblock (struct jffs2_sb_info *c, struct jffs2_eraseblo
|
||||
|
||||
if (buf_size && sumlen > buf_size)
|
||||
kfree(sumptr);
|
||||
- /* If it returns with a real error, bail.
|
||||
+ /* If it returns with a real error, bail.
|
||||
If it returns positive, that's a block classification
|
||||
(i.e. BLK_STATE_xxx) so return that too.
|
||||
If it returns zero, fall through to full scan. */
|
||||
@@ -607,7 +587,7 @@ static int jffs2_scan_eraseblock (struct jffs2_sb_info *c, struct jffs2_eraseblo
|
||||
/* Now ofs is a complete physical flash offset as it always was... */
|
||||
ofs += jeb->offset;
|
||||
|
||||
- noise = 10;
|
||||
+ noise = 1;
|
||||
|
||||
dbg_summary("no summary found in jeb 0x%08x. Apply original scan.\n",jeb->offset);
|
||||
|
||||
@@ -700,7 +680,7 @@ static int jffs2_scan_eraseblock (struct jffs2_sb_info *c, struct jffs2_eraseblo
|
||||
scan_end = buf_len;
|
||||
goto more_empty;
|
||||
}
|
||||
-
|
||||
+
|
||||
/* See how much more there is to read in this eraseblock... */
|
||||
buf_len = min_t(uint32_t, buf_size, jeb->offset + c->sector_size - ofs);
|
||||
if (!buf_len) {
|
||||
@@ -950,7 +930,7 @@ static int jffs2_scan_eraseblock (struct jffs2_sb_info *c, struct jffs2_eraseblo
|
||||
jffs2_dbg(1, "Block at 0x%08x: free 0x%08x, dirty 0x%08x, unchecked 0x%08x, used 0x%08x, wasted 0x%08x\n",
|
||||
jeb->offset, jeb->free_size, jeb->dirty_size,
|
||||
jeb->unchecked_size, jeb->used_size, jeb->wasted_size);
|
||||
-
|
||||
+
|
||||
/* mark_node_obsolete can add to wasted !! */
|
||||
if (jeb->wasted_size) {
|
||||
jeb->dirty_size += jeb->wasted_size;
|
||||
@@ -978,7 +958,6 @@ struct jffs2_inode_cache *jffs2_scan_make_ino_cache(struct jffs2_sb_info *c, uin
|
||||
pr_notice("%s(): allocation of inode cache failed\n", __func__);
|
||||
return NULL;
|
||||
}
|
||||
- memset(ic, 0, sizeof(*ic));
|
||||
|
||||
ic->ino = ino;
|
||||
ic->nodes = (void *)ic;
|
||||
@@ -1069,7 +1048,7 @@ static int jffs2_scan_dirent_node(struct jffs2_sb_info *c, struct jffs2_eraseblo
|
||||
pseudo_random += je32_to_cpu(rd->version);
|
||||
|
||||
/* Should never happen. Did. (OLPC trac #4184)*/
|
||||
- checkedlen = strnlen(rd->name, rd->nsize);
|
||||
+ checkedlen = strnlen((const char *)rd->name, rd->nsize);
|
||||
if (checkedlen < rd->nsize) {
|
||||
pr_err("Dirent at %08x has zeroes in name. Truncating to %d chars\n",
|
||||
ofs, checkedlen);
|
||||
@@ -1081,7 +1060,7 @@ static int jffs2_scan_dirent_node(struct jffs2_sb_info *c, struct jffs2_eraseblo
|
||||
memcpy(&fd->name, rd->name, checkedlen);
|
||||
fd->name[checkedlen] = 0;
|
||||
|
||||
- crc = crc32(0, fd->name, checkedlen);
|
||||
+ crc = crc32(0, fd->name, rd->nsize);
|
||||
if (crc != je32_to_cpu(rd->name_crc)) {
|
||||
pr_notice("%s(): Name CRC failed on node at 0x%08x: Read 0x%08x, calculated 0x%08x\n",
|
||||
__func__, ofs, je32_to_cpu(rd->name_crc), crc);
|
||||
@@ -1106,7 +1085,7 @@ static int jffs2_scan_dirent_node(struct jffs2_sb_info *c, struct jffs2_eraseblo
|
||||
fd->next = NULL;
|
||||
fd->version = je32_to_cpu(rd->version);
|
||||
fd->ino = je32_to_cpu(rd->ino);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -33,10 +33,6 @@ MODULE_NAME := rootfs
|
||||
|
||||
LOCAL_SRCS := $(wildcard los_rootfs.c los_bootargs.c)
|
||||
|
||||
ifeq ($(LOSCFG_PLATFORM_QEMU_ARM_VIRT_CA7), y)
|
||||
LOCAL_INCLUDE += -I $(LITEOSTOPDIR)/../../device/qemu/drivers/cfiflash
|
||||
endif
|
||||
|
||||
LOCAL_FLAGS := $(LOCAL_INCLUDE)
|
||||
|
||||
include $(MODULE)
|
||||
|
||||
@@ -32,14 +32,10 @@
|
||||
#include "los_base.h"
|
||||
#include "string.h"
|
||||
|
||||
#if defined(LOSCFG_STORAGE_SPINOR) || defined(LOSCFG_STORAGE_SPINAND) || defined(LOSCFG_PLATFORM_QEMU_ARM_VIRT_CA7)
|
||||
#if defined(LOSCFG_STORAGE_SPINOR) || defined(LOSCFG_STORAGE_SPINAND)
|
||||
#include "mtd_list.h"
|
||||
#endif
|
||||
|
||||
#ifdef LOSCFG_PLATFORM_QEMU_ARM_VIRT_CA7
|
||||
#include "cfiflash.h"
|
||||
#endif
|
||||
|
||||
#ifdef LOSCFG_STORAGE_EMMC
|
||||
#include "disk.h"
|
||||
#endif
|
||||
@@ -98,19 +94,6 @@ INT32 LOS_GetCmdLine(VOID)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef LOSCFG_PLATFORM_QEMU_ARM_VIRT_CA7
|
||||
struct MtdDev *mtd = GetCfiMtdDev();
|
||||
if (mtd == NULL) {
|
||||
PRINT_ERR("Get CFI mtd failed!\n");
|
||||
goto ERROUT;
|
||||
}
|
||||
g_alignSize = mtd->eraseSize;
|
||||
ret = mtd->read(mtd, CFIFLASH_BOOTARGS_ADDR, COMMAND_LINE_SIZE, g_cmdLine);
|
||||
if (ret == COMMAND_LINE_SIZE) {
|
||||
return LOS_OK;
|
||||
}
|
||||
#endif
|
||||
|
||||
PRINT_ERR("Read cmdline error!\n");
|
||||
ERROUT:
|
||||
free(g_cmdLine);
|
||||
|
||||
@@ -37,15 +37,11 @@
|
||||
#include "sys/stat.h"
|
||||
#include "sys/types.h"
|
||||
|
||||
#if defined(LOSCFG_STORAGE_SPINOR) || defined(LOSCFG_STORAGE_SPINAND) || defined(LOSCFG_PLATFORM_QEMU_ARM_VIRT_CA7)
|
||||
#if defined(LOSCFG_STORAGE_SPINOR) || defined(LOSCFG_STORAGE_SPINAND)
|
||||
#include "mtd_list.h"
|
||||
#include "mtd_partition.h"
|
||||
#endif
|
||||
|
||||
#ifdef LOSCFG_PLATFORM_QEMU_ARM_VIRT_CA7
|
||||
#include "cfiflash.h"
|
||||
#endif
|
||||
|
||||
#ifdef LOSCFG_STORAGE_EMMC
|
||||
#include "disk.h"
|
||||
#include "ff.h"
|
||||
@@ -128,14 +124,7 @@ STATIC INT32 AddEmmcParts(INT32 rootAddr, INT32 rootSize, INT32 userAddr, INT32
|
||||
|
||||
STATIC INT32 AddPartitions(CHAR *dev, UINT64 rootAddr, UINT64 rootSize, UINT64 userAddr, UINT64 userSize)
|
||||
{
|
||||
#ifdef LOSCFG_PLATFORM_QEMU_ARM_VIRT_CA7
|
||||
if ((strcmp(dev, "cfi-flash") == 0) && (rootAddr != CFIFLASH_ROOT_ADDR)) {
|
||||
PRINT_ERR("Error rootAddr, must be %#0x!\n", CFIFLASH_ROOT_ADDR);
|
||||
return LOS_NOK;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(LOSCFG_STORAGE_SPINOR) || defined(LOSCFG_STORAGE_SPINAND) || defined(LOSCFG_PLATFORM_QEMU_ARM_VIRT_CA7)
|
||||
#if defined(LOSCFG_STORAGE_SPINOR) || defined(LOSCFG_STORAGE_SPINAND)
|
||||
INT32 ret;
|
||||
INT32 blk0 = 0;
|
||||
INT32 blk2 = 2;
|
||||
|
||||
@@ -59,12 +59,6 @@
|
||||
#define ROOTFS_ADDR 0x600000
|
||||
#define ROOTFS_SIZE 0x800000
|
||||
#define USERFS_SIZE 0x80000
|
||||
#elif defined (LOSCFG_PLATFORM_QEMU_ARM_VIRT_CA7)
|
||||
#define ROOT_DEV_NAME "/dev/cfiflash0"
|
||||
#define USER_DEV_NAME "/dev/cfiflash2"
|
||||
#define ROOTFS_ADDR CFIFLASH_ROOT_ADDR
|
||||
#define ROOTFS_SIZE 0x1B00000
|
||||
#define USERFS_SIZE (CFIFLASH_CAPACITY - ROOTFS_ADDR - ROOTFS_SIZE)
|
||||
#elif defined (LOSCFG_STORAGE_EMMC)
|
||||
#define ROOT_DEV_NAME "/dev/mmcblk0p0"
|
||||
#ifdef LOSCFG_PLATFORM_PATCHFS
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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) &&
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -271,7 +271,7 @@ VOID OsLockDepCheckOut(SPIN_LOCK_S *lock)
|
||||
{
|
||||
UINT32 intSave;
|
||||
INT32 depth;
|
||||
enum LockDepErrType checkResult = LOCKDEP_SUCCESS;
|
||||
enum LockDepErrType checkResult;
|
||||
VOID *requestAddr = (VOID *)__builtin_return_address(1);
|
||||
LosTaskCB *current = OsCurrTaskGet();
|
||||
LosTaskCB *owner = NULL;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -604,7 +604,7 @@ INT32 ShmCtl(INT32 shmid, INT32 cmd, struct shmid_ds *buf)
|
||||
{
|
||||
struct shmIDSource *seg = NULL;
|
||||
INT32 ret = 0;
|
||||
struct shm_info shmInfo;
|
||||
struct shm_info shmInfo = { 0 };
|
||||
struct ipc_perm shm_perm;
|
||||
|
||||
cmd = ((UINT32)cmd & ~IPC_64);
|
||||
|
||||
@@ -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);
|
||||
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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) {
|
||||
PRINTK("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();
|
||||
|
||||
@@ -326,7 +326,7 @@ VOID OsLmsLosMallocMark(const VOID *curNodeStart, const VOID *nextNodeStart, UIN
|
||||
}
|
||||
|
||||
OsLmsSetShadowValue(node, curNodeStartAddr, curNodeStartAddr + nodeHeadSize, LMS_SHADOW_REDZONE_U8);
|
||||
OsLmsSetShadowValue(node, curNodeStartAddr + nodeHeadSize, nextNodeStartAddr, LMS_SHADOW_ACCESSABLE_U8);
|
||||
OsLmsSetShadowValue(node, curNodeStartAddr + nodeHeadSize, nextNodeStartAddr, LMS_SHADOW_ACCESSIBLE_U8);
|
||||
OsLmsSetShadowValue(node, nextNodeStartAddr, nextNodeStartAddr + nodeHeadSize, LMS_SHADOW_REDZONE_U8);
|
||||
LMS_UNLOCK(intSave);
|
||||
}
|
||||
@@ -344,7 +344,7 @@ VOID OsLmsCheckValid(UINTPTR checkAddr, BOOL isFreeCheck)
|
||||
|
||||
OsLmsGetShadowValue(node, checkAddr, &shadowValue);
|
||||
LMS_UNLOCK(intSave);
|
||||
if ((shadowValue == LMS_SHADOW_ACCESSABLE) || ((isFreeCheck) && (shadowValue == LMS_SHADOW_PAINT))) {
|
||||
if ((shadowValue == LMS_SHADOW_ACCESSIBLE) || ((isFreeCheck) && (shadowValue == LMS_SHADOW_PAINT))) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -367,7 +367,7 @@ VOID OsLmsLosFreeMark(const VOID *curNodeStart, const VOID *nextNodeStart, UINT3
|
||||
UINTPTR nextNodeStartAddr = (UINTPTR)nextNodeStart;
|
||||
|
||||
OsLmsGetShadowValue(node, curNodeStartAddr + nodeHeadSize, &shadowValue);
|
||||
if ((shadowValue != LMS_SHADOW_ACCESSABLE) && (shadowValue != LMS_SHADOW_PAINT)) {
|
||||
if ((shadowValue != LMS_SHADOW_ACCESSIBLE) && (shadowValue != LMS_SHADOW_PAINT)) {
|
||||
LMS_UNLOCK(intSave);
|
||||
OsLmsReportError(curNodeStartAddr + nodeHeadSize, MEM_REGION_SIZE_1, FREE_ERRORMODE);
|
||||
return;
|
||||
@@ -408,7 +408,7 @@ VOID LOS_LmsAddrDisableProtect(UINTPTR addrStart, UINTPTR addrEnd)
|
||||
LMS_LOCK(intSave);
|
||||
LmsMemListNode *node = OsLmsGetPoolNodeFromAddr(addrStart);
|
||||
if (node != NULL) {
|
||||
OsLmsSetShadowValue(node, addrStart, addrEnd, LMS_SHADOW_ACCESSABLE_U8);
|
||||
OsLmsSetShadowValue(node, addrStart, addrEnd, LMS_SHADOW_ACCESSIBLE_U8);
|
||||
}
|
||||
LMS_UNLOCK(intSave);
|
||||
}
|
||||
@@ -426,7 +426,7 @@ STATIC UINT32 OsLmsCheckAddr(UINTPTR addr)
|
||||
LmsMemListNode *node = OsLmsGetPoolNodeFromAddr(addr);
|
||||
if (node == NULL) {
|
||||
LMS_UNLOCK(intSave);
|
||||
return LMS_SHADOW_ACCESSABLE_U8;
|
||||
return LMS_SHADOW_ACCESSIBLE_U8;
|
||||
}
|
||||
|
||||
OsLmsGetShadowValue(node, addr, &shadowValue);
|
||||
@@ -542,7 +542,7 @@ STATIC VOID OsLmsGetErrorInfo(UINTPTR addr, UINT32 size, LmsAddrInfo *info)
|
||||
{
|
||||
LmsMemListNode *node = OsLmsGetPoolNodeFromAddr(addr);
|
||||
OsLmsGetShadowInfo(node, addr, info);
|
||||
if (info->shadowValue != LMS_SHADOW_ACCESSABLE_U8) {
|
||||
if (info->shadowValue != LMS_SHADOW_ACCESSIBLE_U8) {
|
||||
return;
|
||||
} else {
|
||||
OsLmsGetShadowInfo(node, addr + size - 1, info);
|
||||
@@ -558,7 +558,7 @@ STATIC VOID OsLmsPrintErrInfo(LmsAddrInfo *info, UINT32 errMod)
|
||||
case LMS_SHADOW_REDZONE:
|
||||
PRINT_ERR("Heap buffer overflow error detected\n");
|
||||
break;
|
||||
case LMS_SHADOW_ACCESSABLE:
|
||||
case LMS_SHADOW_ACCESSIBLE:
|
||||
PRINT_ERR("No error\n");
|
||||
break;
|
||||
default:
|
||||
@@ -614,7 +614,7 @@ VOID OsLmsReportError(UINTPTR p, UINT32 size, UINT32 errMod)
|
||||
#ifdef LOSCFG_LMS_STORE_CHECK
|
||||
VOID __asan_store1_noabort(UINTPTR p)
|
||||
{
|
||||
if (OsLmsCheckAddr(p) != LMS_SHADOW_ACCESSABLE_U8) {
|
||||
if (OsLmsCheckAddr(p) != LMS_SHADOW_ACCESSIBLE_U8) {
|
||||
OsLmsReportError(p, MEM_REGION_SIZE_1, STORE_ERRMODE);
|
||||
}
|
||||
}
|
||||
@@ -690,7 +690,7 @@ VOID __asan_storeN_noabort(UINTPTR p, UINT32 size)
|
||||
#ifdef LOSCFG_LMS_LOAD_CHECK
|
||||
VOID __asan_load1_noabort(UINTPTR p)
|
||||
{
|
||||
if (OsLmsCheckAddr(p) != LMS_SHADOW_ACCESSABLE_U8) {
|
||||
if (OsLmsCheckAddr(p) != LMS_SHADOW_ACCESSIBLE_U8) {
|
||||
OsLmsReportError(p, MEM_REGION_SIZE_1, LOAD_ERRMODE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,13 +59,13 @@ extern "C" {
|
||||
#define LMS_POOL_RESIZE(size) ((size) / (LMS_SHADOW_U8_REFER_BYTES + 1) * LMS_SHADOW_U8_REFER_BYTES)
|
||||
#define LMS_ADDR_ALIGN(p) (((UINTPTR)(p) + sizeof(UINTPTR) - 1) & ~((UINTPTR)(sizeof(UINTPTR) - 1)))
|
||||
|
||||
#define LMS_SHADOW_ACCESSABLE 0x00
|
||||
#define LMS_SHADOW_ACCESSIBLE 0x00
|
||||
#define LMS_SHADOW_AFTERFREE 0x03
|
||||
#define LMS_SHADOW_REDZONE 0x02
|
||||
#define LMS_SHADOW_PAINT 0x01
|
||||
#define LMS_SHADOW_MASK 0x03
|
||||
|
||||
#define LMS_SHADOW_ACCESSABLE_U8 0x00
|
||||
#define LMS_SHADOW_ACCESSIBLE_U8 0x00
|
||||
#define LMS_SHADOW_AFTERFREE_U8 0xFF
|
||||
#define LMS_SHADOW_REDZONE_U8 0xAA
|
||||
#define LMS_SHADOW_MASK_U8 0xFF
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ extern "C" {
|
||||
#define SANITIZER_INTERFACE_ATTRIBUTE
|
||||
#define ATTRIBUTE_NO_SANITIZE_ADDRESS __attribute__((no_sanitize_address))
|
||||
|
||||
#define LMS_SHADOW_ACCESSABLE 0x00
|
||||
#define LMS_SHADOW_ACCESSIBLE 0x00
|
||||
#define LMS_SHADOW_AFTERFREE 0x03
|
||||
#define LMS_SHADOW_REDZONE 0x02
|
||||
#define LMS_SHADOW_PAINT 0x01
|
||||
@@ -61,7 +61,7 @@ extern "C" {
|
||||
#define LMS_SHADOW_U8_CELL_NUM 4
|
||||
#define LMS_SHADOW_U8_REFER_BYTES 16
|
||||
|
||||
#define LMS_SHADOW_ACCESSABLE_U8 0x00
|
||||
#define LMS_SHADOW_ACCESSIBLE_U8 0x00
|
||||
#define LMS_SHADOW_AFTERFREE_U8 0xFF
|
||||
#define LMS_SHADOW_REDZONE_U8 0xAA
|
||||
#define LMS_SHADOW_MASK_U8 0xFF
|
||||
|
||||
@@ -45,7 +45,7 @@ ATTRIBUTE_NO_SANITIZE_ADDRESS void LmsFree(void *ptr)
|
||||
if (LmsIsShadowAddrMapped(shadowAddr, shadowAddr) == LMS_OK) {
|
||||
uint32_t acShadowValue;
|
||||
LmsGetShadowValue((uintptr_t)ptr, &acShadowValue);
|
||||
if (acShadowValue != LMS_SHADOW_ACCESSABLE) {
|
||||
if (acShadowValue != LMS_SHADOW_ACCESSIBLE) {
|
||||
char erroMode = (acShadowValue == LMS_SHADOW_AFTERFREE ? FREE_ERRORMODE : UNKNOWN_ERROR);
|
||||
LmsReportError((uintptr_t)ptr, MEM_REGION_SIZE_1, erroMode);
|
||||
goto UNLOCK_OUT;
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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)); \
|
||||
|
||||
@@ -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:
|
||||
@@ -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);
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
@@ -2311,6 +2309,7 @@ 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 at least one packet is received */
|
||||
@@ -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)
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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:
|
||||
@@ -412,7 +412,7 @@ int ip6addr_aton(const char *cp, ip6_addr_t *addr)
|
||||
int squash_pos = ipv6_blocks;
|
||||
int i;
|
||||
const char *s = cp;
|
||||
const char *ss = cp-1;
|
||||
const char *ss = cp - 1;
|
||||
|
||||
for (; ; s++) {
|
||||
if (current_block_index >= ipv6_blocks) {
|
||||
|
||||
@@ -34,8 +34,8 @@
|
||||
|
||||
#if LWIP_PERF
|
||||
|
||||
#define PERF_START do {/* something to do */} while (0)
|
||||
#define PERF_STOP(x) do {/* something to do */} while (0)
|
||||
#define PERF_START do {} while (0) /* something to do */
|
||||
#define PERF_STOP(x) do {} while (0) /* something to do */
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -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:
|
||||
@@ -98,10 +98,10 @@ driverif_output(struct netif *netif, struct pbuf *p)
|
||||
|
||||
#if PF_PKT_SUPPORT
|
||||
if (all_pkt_raw_pcbs != NULL) {
|
||||
p->flags = (u16_t)(p->flags & ~(PBUF_FLAG_LLMCAST | PBUF_FLAG_LLBCAST | PBUF_FLAG_HOST));
|
||||
p->flags |= PBUF_FLAG_OUTGOING;
|
||||
(void)raw_pkt_input(p, netif, NULL);
|
||||
}
|
||||
p->flags = (u16_t)(p->flags & ~(PBUF_FLAG_LLMCAST | PBUF_FLAG_LLBCAST | PBUF_FLAG_HOST));
|
||||
p->flags |= PBUF_FLAG_OUTGOING;
|
||||
(void)raw_pkt_input(p, netif, NULL);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if ETH_PAD_SIZE
|
||||
|
||||
@@ -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:
|
||||
@@ -803,12 +803,10 @@ static u8_t lwip_ioctl_internal_SIOCSIFHWADDR(struct ifreq *ifr)
|
||||
}
|
||||
#endif
|
||||
else {
|
||||
|
||||
/* bring netif down to clear all Neighbor Cache Entry */
|
||||
(void)netif_set_down(netif);
|
||||
|
||||
ret = netif_set_hwaddr(netif, (const unsigned char *)ifr->ifr_hwaddr.sa_data, netif->hwaddr_len);
|
||||
|
||||
if (ret != ERR_OK) {
|
||||
(void)netif_set_up(netif);
|
||||
return err_to_errno(ret);
|
||||
@@ -979,7 +977,6 @@ static u8_t lwip_ioctl_internal_SIOCGIFFLAGS(struct ifreq *ifr)
|
||||
#endif /* LWIP_IGMP || LWIP_IPV6_MLD */
|
||||
|
||||
#if LWIP_DHCP
|
||||
//if ((netif->flags & NETIF_FLAG_DHCP) != 0) {
|
||||
if (dhcp_supplied_address(netif)) {
|
||||
ifr->ifr_flags = (short)((unsigned short)ifr->ifr_flags | IFF_DYNAMIC);
|
||||
} else {
|
||||
@@ -1090,7 +1087,6 @@ static u8_t lwip_ioctl_internal_SIOCSIFNAME(struct ifreq *ifr)
|
||||
#endif
|
||||
|
||||
netif = netif_find(ifr->ifr_name);
|
||||
|
||||
if (netif == NULL) {
|
||||
return ENODEV;
|
||||
} else if (netif->link_layer_type == LOOPBACK_IF) {
|
||||
@@ -1165,7 +1161,6 @@ static u8_t lwip_ioctl_internal_SIOCGIFMTU(struct ifreq *ifr)
|
||||
|
||||
/* get netif hw addr */
|
||||
netif = netif_find(ifr->ifr_name);
|
||||
|
||||
if (netif == NULL) {
|
||||
return ENODEV;
|
||||
} else {
|
||||
|
||||
@@ -116,8 +116,8 @@ static UINT16 GetFreeVid(VOID)
|
||||
for (i = 0; i < mapMaxNum; i++) {
|
||||
num = idMap->bitMap[i];
|
||||
for (j = 0; j < INT_BIT_COUNT; j++) {
|
||||
if ((num & (1 << j)) == 0) {
|
||||
num |= 1 << j;
|
||||
if ((num & (1U << j)) == 0) {
|
||||
num |= 1U << j;
|
||||
idMap->bitMap[i] = num;
|
||||
return (INT_BIT_COUNT * i + j);
|
||||
}
|
||||
@@ -160,7 +160,7 @@ static VOID ReleaseVid(UINT16 vid)
|
||||
a = vid >> INT_BIT_SHIFT;
|
||||
b = vid & (INT_BIT_COUNT - 1);
|
||||
|
||||
idMap->bitMap[a] &= ~(1 << b);
|
||||
idMap->bitMap[a] &= ~(1U << b);
|
||||
|
||||
/* shrink bit map */
|
||||
if (mapMaxNum > 1) {
|
||||
|
||||
@@ -34,9 +34,9 @@
|
||||
#include "los_typedef.h"
|
||||
#include "los_process_pri.h"
|
||||
|
||||
#define INT_BIT_COUNT 32
|
||||
#define INT_BIT_SHIFT 5
|
||||
#define VID_MAP_MAX_NUM 32
|
||||
#define INT_BIT_COUNT 32U
|
||||
#define INT_BIT_SHIFT 5U
|
||||
#define VID_MAP_MAX_NUM 32U
|
||||
|
||||
#define MAX_INVALID_TIMER_VID (VID_MAP_MAX_NUM * INT_BIT_COUNT)
|
||||
|
||||
|
||||
@@ -145,7 +145,7 @@ INT32 CmdLog(INT32 argc, const CHAR **argv)
|
||||
}
|
||||
} else if (!strncmp(argv[0], "module", strlen(argv[0]) + 1)) {
|
||||
module = strtoul(argv[1], &p, 0);
|
||||
if ((*p != 0) || (module > MODULE4) || (module < MODULE0)) {
|
||||
if ((*p != 0) || (module > MODULE4)) {
|
||||
PRINTK("log %s can't access %s\n", argv[0], argv[1]);
|
||||
PRINTK("not support yet\n");
|
||||
return -1;
|
||||
|
||||
@@ -329,7 +329,7 @@ END:
|
||||
LITE_OS_SEC_TEXT_MINOR UINT32 ShellEntry(UINTPTR param)
|
||||
{
|
||||
CHAR ch;
|
||||
INT32 n = 0;
|
||||
INT32 n;
|
||||
ShellCB *shellCB = (ShellCB *)param;
|
||||
|
||||
CONSOLE_CB *consoleCB = OsGetConsoleByID((INT32)shellCB->consoleID);
|
||||
|
||||
@@ -425,7 +425,7 @@ STATIC VOID OsBufFullWrite(const CHAR *dst, UINT32 logLen)
|
||||
|
||||
STATIC VOID OsWriteTailToHead(const CHAR *dst, UINT32 logLen)
|
||||
{
|
||||
UINT32 writeLen = 0;
|
||||
UINT32 writeLen;
|
||||
UINT32 bufSize = g_logBufSize;
|
||||
UINT32 logSize = g_dmesgInfo->logSize;
|
||||
UINT32 tail = g_dmesgInfo->logTail;
|
||||
|
||||
@@ -1520,7 +1520,7 @@ ssize_t SysPread64(int fd, void *buf, size_t nbytes, off64_t offset)
|
||||
if (bufRet == NULL) {
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
(void)memset_s(bufRet, nbytes, 0, nbytes);
|
||||
ret = pread64(fd, (buf ? bufRet : NULL), nbytes, offset);
|
||||
if (ret < 0) {
|
||||
(void)LOS_MemFree(OS_SYS_MEM_ADDR, bufRet);
|
||||
|
||||
@@ -106,7 +106,8 @@ int SysMqNotify(mqd_t personal, const struct sigevent *sigev)
|
||||
int SysMqGetSetAttr(mqd_t mqd, const struct mq_attr *new, struct mq_attr *old)
|
||||
{
|
||||
int ret;
|
||||
struct mq_attr knew, kold;
|
||||
struct mq_attr knew;
|
||||
struct mq_attr kold = { 0 };
|
||||
|
||||
if (new != NULL) {
|
||||
ret = LOS_ArchCopyFromUser(&knew, new, sizeof(struct mq_attr));
|
||||
@@ -256,7 +257,7 @@ int SysSigTimedWait(const sigset_t_l *setl, siginfo_t *info, const struct timesp
|
||||
sigset_t set;
|
||||
unsigned int tick;
|
||||
int retVal, ret;
|
||||
siginfo_t infoIntr;
|
||||
siginfo_t infoIntr = { 0 };
|
||||
struct timespec timeoutIntr;
|
||||
|
||||
retVal = LOS_ArchCopyFromUser(&set, &(setl->sig[0]), sizeof(sigset_t));
|
||||
|
||||
@@ -208,7 +208,7 @@ long SysSysconf(int name)
|
||||
int SysUgetrlimit(int resource, unsigned long long k_rlim[2])
|
||||
{
|
||||
int ret;
|
||||
struct rlimit lim;
|
||||
struct rlimit lim = { 0 };
|
||||
|
||||
ret = getrlimit(resource, &lim);
|
||||
if (ret < 0) {
|
||||
|
||||
@@ -255,7 +255,7 @@ int SysSchedRRGetInterval(int pid, struct timespec *tp)
|
||||
int ret;
|
||||
SchedParam param = { 0 };
|
||||
time_t timeSlice = 0;
|
||||
struct timespec tv;
|
||||
struct timespec tv = { 0 };
|
||||
LosTaskCB *taskCB = NULL;
|
||||
LosProcessCB *processCB = NULL;
|
||||
|
||||
|
||||
@@ -263,7 +263,7 @@ SYSCALL_HAND_DEF(__NR_statx, SysStatx, int, ARG_NUM_5)
|
||||
SYSCALL_HAND_DEF(__NR_pthread_set_detach, SysUserThreadSetDetach, int, ARG_NUM_1)
|
||||
SYSCALL_HAND_DEF(__NR_pthread_join, SysThreadJoin, int, ARG_NUM_1)
|
||||
SYSCALL_HAND_DEF(__NR_pthread_deatch, SysUserThreadDetach, int, ARG_NUM_1)
|
||||
SYSCALL_HAND_DEF(__NR_creat_user_thread, SysCreateUserThread, unsigned int, ARG_NUM_3)
|
||||
SYSCALL_HAND_DEF(__NR_create_user_thread, SysCreateUserThread, unsigned int, ARG_NUM_3)
|
||||
SYSCALL_HAND_DEF(__NR_getrusage, SysGetrusage, int, ARG_NUM_2)
|
||||
SYSCALL_HAND_DEF(__NR_sysconf, SysSysconf, long, ARG_NUM_1)
|
||||
SYSCALL_HAND_DEF(__NR_ugetrlimit, SysUgetrlimit, int, ARG_NUM_2)
|
||||
|
||||
@@ -83,6 +83,10 @@ int GetFullpath(int fd, const char *path, char **fullpath)
|
||||
fd = GetAssociatedSystemFd(fd);
|
||||
}
|
||||
ret = fs_getfilep(fd, &file);
|
||||
if (ret < 0) {
|
||||
ret = -EPERM;
|
||||
goto OUT;
|
||||
}
|
||||
if (file) {
|
||||
ret = stat(file->f_path, &bufRet);
|
||||
if (!ret) {
|
||||
|
||||
@@ -109,7 +109,7 @@ int SysSetiTimer(int which, const struct itimerval *value, struct itimerval *ova
|
||||
{
|
||||
int ret;
|
||||
struct itimerval svalue;
|
||||
struct itimerval sovalue;
|
||||
struct itimerval sovalue = { 0 };
|
||||
|
||||
if (value == NULL) {
|
||||
errno = EINVAL;
|
||||
@@ -137,7 +137,7 @@ int SysSetiTimer(int which, const struct itimerval *value, struct itimerval *ova
|
||||
int SysGetiTimer(int which, struct itimerval *value)
|
||||
{
|
||||
int ret;
|
||||
struct itimerval svalue;
|
||||
struct itimerval svalue = { 0 };
|
||||
|
||||
if (value == NULL) {
|
||||
errno = EINVAL;
|
||||
@@ -189,7 +189,7 @@ int SysTimerCreate(clockid_t clockID, struct ksigevent *evp, timer_t *timerID)
|
||||
int SysTimerGettime(timer_t timerID, struct itimerspec *value)
|
||||
{
|
||||
int ret;
|
||||
struct itimerspec svalue;
|
||||
struct itimerspec svalue = { 0 };
|
||||
|
||||
if (value == NULL) {
|
||||
errno = EINVAL;
|
||||
@@ -213,7 +213,7 @@ int SysTimerSettime(timer_t timerID, int flags, const struct itimerspec *value,
|
||||
{
|
||||
int ret;
|
||||
struct itimerspec svalue;
|
||||
struct itimerspec soldValue;
|
||||
struct itimerspec soldValue = { 0 };
|
||||
|
||||
if (value == NULL) {
|
||||
errno = EINVAL;
|
||||
@@ -285,7 +285,7 @@ int SysClockSettime(clockid_t clockID, const struct timespec *tp)
|
||||
int SysClockGettime(clockid_t clockID, struct timespec *tp)
|
||||
{
|
||||
int ret;
|
||||
struct timespec stp;
|
||||
struct timespec stp = { 0 };
|
||||
|
||||
if (tp == NULL) {
|
||||
errno = EINVAL;
|
||||
@@ -308,7 +308,7 @@ int SysClockGettime(clockid_t clockID, struct timespec *tp)
|
||||
int SysClockGetres(clockid_t clockID, struct timespec *tp)
|
||||
{
|
||||
int ret;
|
||||
struct timespec stp;
|
||||
struct timespec stp = { 0 };
|
||||
|
||||
if (tp == NULL) {
|
||||
errno = EINVAL;
|
||||
@@ -356,7 +356,7 @@ int SysNanoSleep(const struct timespec *rqtp, struct timespec *rmtp)
|
||||
{
|
||||
int ret;
|
||||
struct timespec srqtp;
|
||||
struct timespec srmtp;
|
||||
struct timespec srmtp = { 0 };
|
||||
|
||||
if (!rqtp || LOS_ArchCopyFromUser(&srqtp, rqtp, sizeof(struct timespec))) {
|
||||
errno = EFAULT;
|
||||
@@ -384,7 +384,7 @@ int SysNanoSleep(const struct timespec *rqtp, struct timespec *rmtp)
|
||||
clock_t SysTimes(struct tms *buf)
|
||||
{
|
||||
clock_t ret;
|
||||
struct tms sbuf;
|
||||
struct tms sbuf = { 0 };
|
||||
|
||||
if (buf == NULL) {
|
||||
errno = EFAULT;
|
||||
@@ -436,7 +436,7 @@ int SysClockGettime64(clockid_t clockID, struct timespec64 *tp)
|
||||
{
|
||||
int ret;
|
||||
struct timespec t;
|
||||
struct timespec64 stp;
|
||||
struct timespec64 stp = { 0 };
|
||||
|
||||
if (tp == NULL) {
|
||||
errno = EINVAL;
|
||||
@@ -463,7 +463,7 @@ int SysClockGetres64(clockid_t clockID, struct timespec64 *tp)
|
||||
{
|
||||
int ret;
|
||||
struct timespec t;
|
||||
struct timespec64 stp;
|
||||
struct timespec64 stp = { 0 };
|
||||
|
||||
if (tp == NULL) {
|
||||
errno = EINVAL;
|
||||
@@ -525,7 +525,7 @@ int SysTimerGettime64(timer_t timerID, struct itimerspec64 *value)
|
||||
{
|
||||
int ret;
|
||||
struct itimerspec val;
|
||||
struct itimerspec64 svalue;
|
||||
struct itimerspec64 svalue = { 0 };
|
||||
|
||||
if (value == NULL) {
|
||||
errno = EINVAL;
|
||||
@@ -584,6 +584,7 @@ int SysTimerSettime64(timer_t timerID, int flags, const struct itimerspec64 *val
|
||||
}
|
||||
|
||||
if (oldValue != NULL) {
|
||||
(void)memset_s(&soldValue, sizeof(struct itimerspec64), 0, sizeof(struct itimerspec64));
|
||||
soldValue.it_interval.tv_sec = oldVal.it_interval.tv_sec;
|
||||
soldValue.it_interval.tv_nsec = oldVal.it_interval.tv_nsec;
|
||||
soldValue.it_value.tv_sec = oldVal.it_value.tv_sec;
|
||||
|
||||
@@ -86,14 +86,14 @@ extern "C" {
|
||||
#endif /* __cpluscplus */
|
||||
#endif /* __cpluscplus */
|
||||
|
||||
#define TEST_TASK_PARAM_INIT(testTask, task_name, entry, prio) \
|
||||
do { \
|
||||
memset(&testTask, 0, sizeof(TSK_INIT_PARAM_S)); \
|
||||
testTask.pfnTaskEntry = (TSK_ENTRY_FUNC)entry; \
|
||||
testTask.uwStackSize = 0x1000; \
|
||||
testTask.pcName = task_name; \
|
||||
testTask.usTaskPrio = prio; \
|
||||
testTask.uwResved = LOS_TASK_STATUS_DETACHED; \
|
||||
#define TEST_TASK_PARAM_INIT(testTask, task_name, entry, prio) \
|
||||
do { \
|
||||
(void)memset_s(&(testTask), sizeof(TSK_INIT_PARAM_S), 0, sizeof(TSK_INIT_PARAM_S)); \
|
||||
testTask.pfnTaskEntry = (TSK_ENTRY_FUNC)entry; \
|
||||
testTask.uwStackSize = 0x1000; \
|
||||
testTask.pcName = task_name; \
|
||||
testTask.usTaskPrio = prio; \
|
||||
testTask.uwResved = LOS_TASK_STATUS_DETACHED; \
|
||||
} while (0);
|
||||
|
||||
#ifdef LOSCFG_KERNEL_SMP
|
||||
|
||||
@@ -50,7 +50,7 @@ VOID RecordIntrTrace(INT32 irq, INT32 direction)
|
||||
VOID ResetIntrTrace(VOID)
|
||||
{
|
||||
g_traceIdx = 0;
|
||||
memset(g_intrTrace, 0, RECORD_SIZE);
|
||||
(void)memset_s(g_intrTrace, RECORD_SIZE, 0, RECORD_SIZE);
|
||||
}
|
||||
|
||||
UINT32 CheckIntrTrace(UINT32 *expect, UINT32 num)
|
||||
|
||||
@@ -44,7 +44,7 @@ static VOID NestingPrioHigh(INT32 irq, VOID *data)
|
||||
{
|
||||
g_intrHandleEnd = 1;
|
||||
UINT32 temp[0x100][2] = {0};
|
||||
memset(temp, 1, sizeof(UINT32) * 0x100 * 2); // 2, buffer size.
|
||||
(void)memset_s(temp, sizeof(UINT32) * 0x100 * 2, 1, sizeof(UINT32) * 0x100 * 2); // 2, buffer size.
|
||||
}
|
||||
|
||||
static VOID TaskF01(VOID)
|
||||
|
||||
@@ -49,13 +49,13 @@ static VOID NestingPrioHigh(INT32 irq, VOID *data)
|
||||
UINT64 curTime;
|
||||
curTime = LOS_CurrNanosec();
|
||||
g_recordTime[g_saveIndex] = curTime - g_intPendTime;
|
||||
if (g_saveIndex == MAX_RECORD_SIZE) {
|
||||
g_saveIndex = 0;
|
||||
}
|
||||
dprintf("curTime = %lld, pendTime = %lld \n", curTime, g_intPendTime);
|
||||
dprintf("%lld\n", curTime - g_intPendTime);
|
||||
dprintf("[swtmr] hwi response time : ##%lld \n", g_recordTime[g_saveIndex]);
|
||||
g_saveIndex++;
|
||||
if (g_saveIndex == MAX_RECORD_SIZE) {
|
||||
g_saveIndex = 0;
|
||||
}
|
||||
}
|
||||
|
||||
static VOID DumpResult()
|
||||
|
||||
@@ -58,7 +58,7 @@ static UINT32 Testcase(void)
|
||||
// 32, number of cycles
|
||||
for (index = 0; index < 32; index++) {
|
||||
task1.usTaskPrio = index;
|
||||
snprintf(acName, 10, "Tsk040A%2d", index); // 10, snprintf size.
|
||||
(void)snprintf_s(acName, TASK_NAME_NUM, TASK_NAME_NUM - 1, "Tsk040A%2d", index);
|
||||
task1.pcName = acName;
|
||||
task1.uwResved = LOS_TASK_STATUS_DETACHED;
|
||||
|
||||
|
||||
@@ -58,9 +58,10 @@ EXIT:
|
||||
static UINT32 Testcase(void)
|
||||
{
|
||||
UINT32 ret;
|
||||
TSK_INIT_PARAM_S task1;
|
||||
TSK_INIT_PARAM_S task1 = {0};
|
||||
|
||||
LOS_EventInit(&g_eventCb01);
|
||||
memset(&task1, 0, sizeof(TSK_INIT_PARAM_S));
|
||||
|
||||
task1.pfnTaskEntry = (TSK_ENTRY_FUNC)TaskF01;
|
||||
task1.pcName = "Tsk082A";
|
||||
task1.uwStackSize = TASK_STACK_SIZE_TEST;
|
||||
|
||||
@@ -142,7 +142,8 @@ static UINT32 Testcase(void)
|
||||
ret = LOS_TaskCreate(&g_testTaskID01, &task1);
|
||||
ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret);
|
||||
|
||||
memset(&task1, 0, sizeof(TSK_INIT_PARAM_S));
|
||||
ret = memset_s(&task1, sizeof(TSK_INIT_PARAM_S), 0, sizeof(TSK_INIT_PARAM_S));
|
||||
ICUNIT_ASSERT_EQUAL(ret, 0, ret);
|
||||
task1.pfnTaskEntry = (TSK_ENTRY_FUNC)TaskF02;
|
||||
task1.uwStackSize = TASK_STACK_SIZE_TEST;
|
||||
task1.pcName = "Tsk118B";
|
||||
|
||||
@@ -142,7 +142,8 @@ static UINT32 Testcase(void)
|
||||
ret = LOS_TaskCreate(&g_testTaskID01, &task1);
|
||||
ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret);
|
||||
|
||||
memset(&task1, 0, sizeof(TSK_INIT_PARAM_S));
|
||||
ret = memset_s(&task1, sizeof(TSK_INIT_PARAM_S), 0, sizeof(TSK_INIT_PARAM_S));
|
||||
ICUNIT_ASSERT_EQUAL(ret, 0, ret);
|
||||
task1.pfnTaskEntry = (TSK_ENTRY_FUNC)TaskF02;
|
||||
task1.uwStackSize = TASK_STACK_SIZE_TEST;
|
||||
task1.pcName = "Tsk118B";
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user