Compare commits
256 Commits
feature_ID
...
weekly_202
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bcb4dea119 | ||
|
|
333045d11f | ||
|
|
04d5405d3f | ||
|
|
7028f96f9c | ||
|
|
f34362730a | ||
|
|
bc1a352935 | ||
|
|
39391d12e4 | ||
|
|
41b73359a4 | ||
|
|
6babf78a8d | ||
|
|
18d07a809a | ||
|
|
6d2dbdf0e8 | ||
|
|
ee9d5daeca | ||
|
|
556c10121b | ||
|
|
fe69c9dd65 | ||
|
|
2374c01bb9 | ||
|
|
66278102ca | ||
|
|
ecdd47f0c5 | ||
|
|
7dbae99194 | ||
|
|
81784f1c6b | ||
|
|
20693c9424 | ||
|
|
5fa299b4aa | ||
|
|
b02c64dc42 | ||
|
|
c5a39437f7 | ||
|
|
f211029b12 | ||
|
|
36d55955ef | ||
|
|
12f6c5d628 | ||
|
|
17309e232a | ||
|
|
af1afcec6a | ||
|
|
9cef4da850 | ||
|
|
d058b640e2 | ||
|
|
4431b587f8 | ||
|
|
809db71acc | ||
|
|
b1a7711e15 | ||
|
|
3e83ce79c2 | ||
|
|
2cadd65301 | ||
|
|
f038492dbc | ||
|
|
e74deedba3 | ||
|
|
24f52e0259 | ||
|
|
d4df4d1e54 | ||
|
|
2d1e7e8c29 | ||
|
|
a96f535cd3 | ||
|
|
1669455ba9 | ||
|
|
b637b1d979 | ||
|
|
c6d021bede | ||
|
|
d7f3aef326 | ||
|
|
db32ad90bf | ||
|
|
59fbe91d8b | ||
|
|
c7088f4d0f | ||
|
|
705bfbdc76 | ||
|
|
9a4e9677bd | ||
|
|
6134d4bd22 | ||
|
|
c119b7e9e2 | ||
|
|
dbf0498bab | ||
|
|
68b142cf78 | ||
|
|
22b7eb87ca | ||
|
|
ed50f7e373 | ||
|
|
2f2a0b7a75 | ||
|
|
1ae62ebf2e | ||
|
|
25278a02eb | ||
|
|
52bc16c3db | ||
|
|
733b6e6c6c | ||
|
|
6562536db7 | ||
|
|
ddf3dc8237 | ||
|
|
399e7647bb | ||
|
|
f7af2cdf9b | ||
|
|
07091c5a75 | ||
|
|
6633aabf89 | ||
|
|
2a4282f912 | ||
|
|
685688b21c | ||
|
|
67ee38e1e3 | ||
|
|
6cd48f6f90 | ||
|
|
662aefb700 | ||
|
|
83fc93cc84 | ||
|
|
b817c490ba | ||
|
|
705e4c323a | ||
|
|
b7f906ef8a | ||
|
|
f9c59d361f | ||
|
|
fa142daffb | ||
|
|
4bd0e73512 | ||
|
|
0a03a4d875 | ||
|
|
2a70466456 | ||
|
|
b30349d8ed | ||
|
|
59ecf4cae8 | ||
|
|
9038b6522e | ||
|
|
abb83fd23b | ||
|
|
98da8bbdfb | ||
|
|
c7da881469 | ||
|
|
9cbddd412d | ||
|
|
b50b5e7cba | ||
|
|
974182d50c | ||
|
|
a3ce436841 | ||
|
|
588abc0645 | ||
|
|
7657aadc20 | ||
|
|
0d1c77c1e0 | ||
|
|
795c2db917 | ||
|
|
2f334bed21 | ||
|
|
9e4978f57f | ||
|
|
a859329f28 | ||
|
|
68b8deea89 | ||
|
|
a288718c2c | ||
|
|
2e7b59b659 | ||
|
|
0c577f3e7f | ||
|
|
019dab8db4 | ||
|
|
af6863f436 | ||
|
|
f190275664 | ||
|
|
1bdee9f58e | ||
|
|
97a638bc1c | ||
|
|
55238c805a | ||
|
|
0841ece718 | ||
|
|
a4087a6537 | ||
|
|
9f19fd2e7a | ||
|
|
c10037d379 | ||
|
|
b483627ec7 | ||
|
|
d120f1e57a | ||
|
|
765add9660 | ||
|
|
a650df0575 | ||
|
|
08436dec9e | ||
|
|
0818b28aa7 | ||
|
|
2dc3998956 | ||
|
|
266a49fb88 | ||
|
|
fa6f0c393d | ||
|
|
3019311435 | ||
|
|
b25148107b | ||
|
|
aee957bb1f | ||
|
|
64d15df9ea | ||
|
|
8e58b984ea | ||
|
|
be1267fafa | ||
|
|
6cb544b158 | ||
|
|
5e8225273f | ||
|
|
aec7a45411 | ||
|
|
2806c4af75 | ||
|
|
7e442ddd61 | ||
|
|
527cec6e27 | ||
|
|
d68b5f0ab3 | ||
|
|
1cd2ae7b4e | ||
|
|
27ed27eb89 | ||
|
|
098c5ea24d | ||
|
|
914913fab6 | ||
|
|
2f08268983 | ||
|
|
807c7e64cb | ||
|
|
fc87e459d1 | ||
|
|
c3d75f64b1 | ||
|
|
f447d15e78 | ||
|
|
642d5ef709 | ||
|
|
74bbfa4893 | ||
|
|
fe5a091ca2 | ||
|
|
c83b98ecbf | ||
|
|
c9a96bc4b3 | ||
|
|
62cd8fec46 | ||
|
|
8b54493665 | ||
|
|
a940dda69a | ||
|
|
1bc63d743b | ||
|
|
474201593d | ||
|
|
3f54fdc898 | ||
|
|
8ac6771e0d | ||
|
|
7101ddbeb8 | ||
|
|
abbed4430e | ||
|
|
98d20e90ed | ||
|
|
9767191392 | ||
|
|
e540254ed9 | ||
|
|
ad4ef11410 | ||
|
|
20ffd89865 | ||
|
|
ae8d4fd275 | ||
|
|
972d765c6e | ||
|
|
47f883c11a | ||
|
|
478b41b457 | ||
|
|
69d17d522c | ||
|
|
d4bfb577ef | ||
|
|
6e6cbe5de6 | ||
|
|
383a1d23e9 | ||
|
|
b24353cf4b | ||
|
|
f1ad086665 | ||
|
|
8fff50f59f | ||
|
|
373d4f5649 | ||
|
|
3c8d20a89e | ||
|
|
e268ef95a9 | ||
|
|
296a546bcd | ||
|
|
a7135e252d | ||
|
|
e76dd685c2 | ||
|
|
54a5365a25 | ||
|
|
2d1160fdc4 | ||
|
|
f3d606b6dd | ||
|
|
392e4c2cec | ||
|
|
b334658723 | ||
|
|
a502a0917c | ||
|
|
2b1f2d554e | ||
|
|
2cf290bb7c | ||
|
|
8fc9852e34 | ||
|
|
816d03f5c1 | ||
|
|
61877ec97a | ||
|
|
0f952132c0 | ||
|
|
f94d3ee119 | ||
|
|
784429d0dc | ||
|
|
1a764df92a | ||
|
|
cf50cde1b7 | ||
|
|
bfef7bfb2e | ||
|
|
5bae8b58c6 | ||
|
|
044cf59583 | ||
|
|
0adbafb9c2 | ||
|
|
3398937b1b | ||
|
|
3c010b4717 | ||
|
|
c237ff63fa | ||
|
|
3508110f6d | ||
|
|
ffa868a81c | ||
|
|
7d391c9bbf | ||
|
|
e4a1c18d40 | ||
|
|
83790f4f9b | ||
|
|
6377f98e9e | ||
|
|
b8f8ab5a36 | ||
|
|
a0b776a709 | ||
|
|
f5f18ca669 | ||
|
|
5756d45e84 | ||
|
|
8a25f31aa4 | ||
|
|
f7cc6ff14e | ||
|
|
bf9e0c9e2b | ||
|
|
e9de74a94a | ||
|
|
b38f135242 | ||
|
|
0cb50baa55 | ||
|
|
565049f1eb | ||
|
|
9add4b4b92 | ||
|
|
5992506c75 | ||
|
|
d4db5a5a75 | ||
|
|
fe8b68826a | ||
|
|
99640e9977 | ||
|
|
0dc3c7ae9e | ||
|
|
699bb81fc3 | ||
|
|
f2c4b59773 | ||
|
|
b656553c5c | ||
|
|
7653bd8da1 | ||
|
|
1275ecbc8a | ||
|
|
ebc57397f0 | ||
|
|
cce6365f4f | ||
|
|
04f391d814 | ||
|
|
14e64fc89b | ||
|
|
2ce5ce9397 | ||
|
|
eb40e4a068 | ||
|
|
dc5feb9e19 | ||
|
|
7a61f8d836 | ||
|
|
330760dbb3 | ||
|
|
2739a00c55 | ||
|
|
7f14b060d4 | ||
|
|
8be6e129fc | ||
|
|
f465c15d7a | ||
|
|
0af2577498 | ||
|
|
238ff396b8 | ||
|
|
5917c4b01b | ||
|
|
5c4edb9b1a | ||
|
|
ce176e77e6 | ||
|
|
8ef012bdad | ||
|
|
933efffba7 | ||
|
|
ae692bfbc4 | ||
|
|
ab46b9c836 | ||
|
|
b83d17039e | ||
|
|
08404f3252 | ||
|
|
8b19c3cbe4 | ||
|
|
192a2a6e61 |
@@ -10,6 +10,12 @@
|
||||
### 测试用例(新增、改动、可能影响的功能)
|
||||
|
||||
|
||||
### 是否涉及对外变更(典型的如:对外API规格变更、新增对外接口等等)
|
||||
|
||||
必须选择一项(在MarkDown模式下用[x]替换[ ]即可勾选对应选项):
|
||||
- [ ] 是,涉及对外变更: 需要在commit message中按【[模板要求](https://gitee.com/openharmony/kernel_liteos_m/wikis/Commit%20message%E8%A7%84%E8%8C%83)】描述变更点
|
||||
- [ ] 否,不涉及对外变更
|
||||
|
||||
### 是否需要同步至release(如:3.0LTS ... )分支?
|
||||
|
||||
必须选择一项(在MarkDown模式下用[x]替换[ ]即可勾选对应选项):
|
||||
|
||||
10
BUILD.gn
10
BUILD.gn
@@ -91,8 +91,9 @@ config("dialect_config") {
|
||||
}
|
||||
|
||||
config("misc_config") {
|
||||
defines = []
|
||||
if (!defined(LOSCFG_COMPILER_ICCARM)) {
|
||||
defines = [ "__LITEOS__" ]
|
||||
defines += [ "__LITEOS__" ]
|
||||
defines += [ "__LITEOS_M__" ]
|
||||
}
|
||||
if (!defined(LOSCFG_DEBUG_VERSION)) {
|
||||
@@ -120,8 +121,11 @@ config("los_config") {
|
||||
cmd = "if [ -f $device_path/BUILD.gn ]; then echo true; else echo false; fi"
|
||||
HAVE_DEVICE_SDK = exec_script("//build/lite/run_shell_cmd.py", [ cmd ], "value")
|
||||
|
||||
# board and soc decoupling feature, device_path should contains board
|
||||
BOARD_SOC_FEATURE = device_path != string_replace(device_path, "/board/", "")
|
||||
# If device_path points to vendor, use device_path directly,
|
||||
# otherwise board is decoupled from soc, device_path should contain board
|
||||
BOARD_SOC_FEATURE =
|
||||
device_path == string_replace(device_path, "/vendor/", "") &&
|
||||
device_path != string_replace(device_path, "/board/", "")
|
||||
|
||||
config("public") {
|
||||
configs = [
|
||||
|
||||
465
CHANGELOG.md
Normal file
465
CHANGELOG.md
Normal file
@@ -0,0 +1,465 @@
|
||||
# (2022-03-30)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* c-sky等芯片架构的BUILD.gn优化 ([3311d73](https://gitee.com/openharmony/kernel_liteos_m/commits/3311d73406b68d289b6f715a099e90f62c86abd1)), closes [#I4D129](https://gitee.com/openharmony/kernel_liteos_m/issues/I4D129)
|
||||
* change the sensitive words ([8e2248c](https://gitee.com/openharmony/kernel_liteos_m/commits/8e2248c062aaca2444cc1001873fe8e8d8cdd3c6)), closes [#I4K7LL](https://gitee.com/openharmony/kernel_liteos_m/issues/I4K7LL)
|
||||
* cortex-m55栈优化 ([59e9c6e](https://gitee.com/openharmony/kernel_liteos_m/commits/59e9c6ed73caeeed56081a768198eccc7448df6c)), closes [#I4SQIQ](https://gitee.com/openharmony/kernel_liteos_m/issues/I4SQIQ)
|
||||
* csky等新增模块的HalTickStart函数定义和实现不一致 ([07ab6a5](https://gitee.com/openharmony/kernel_liteos_m/commits/07ab6a5b77c6955f6093beeab976bdc1b32d1db9)), closes [#I4D1HY](https://gitee.com/openharmony/kernel_liteos_m/issues/I4D1HY)
|
||||
* FD_SETSIZE compatible newlibc ([82c6d5f](https://gitee.com/openharmony/kernel_liteos_m/commits/82c6d5f17478fb47ea5977a32fb76d783ee3e815))
|
||||
* fix compile warning saying dereference void * pointer ([29126a9](https://gitee.com/openharmony/kernel_liteos_m/commits/29126a98fe7a8f75695910bdf8fa1ccc6ff67288))
|
||||
* gcc编译testsuite编译问题修复 ([f7d26b8](https://gitee.com/openharmony/kernel_liteos_m/commits/f7d26b8e12fb1ba4bebe6c0fc9ca9e392537419f)), closes [#I4DAOU](https://gitee.com/openharmony/kernel_liteos_m/issues/I4DAOU)
|
||||
* Kconfig中打开littlefs选项默认关联打开LOSCFG_SUPPORT_LITTLEFS宏 ([b2bcab3](https://gitee.com/openharmony/kernel_liteos_m/commits/b2bcab3a5bd794c86dd4d93b1b5aeca2d097289b)), closes [#I4ENQ1](https://gitee.com/openharmony/kernel_liteos_m/issues/I4ENQ1)
|
||||
* kernel接口融合,添加/修改kernel函数 ([cee9714](https://gitee.com/openharmony/kernel_liteos_m/commits/cee9714a90f2660a0b4455f4f5a2fc42870a6aa5))
|
||||
* L0 pthread_cond_timedwait接口实现存在的几个问题 ([2219c32](https://gitee.com/openharmony/kernel_liteos_m/commits/2219c32784071b6c37ea57185382e3228ed4b0a7)), closes [#I4N9P8](https://gitee.com/openharmony/kernel_liteos_m/issues/I4N9P8)
|
||||
* liteos_kernel_only=true编译内核报错 ([adc2105](https://gitee.com/openharmony/kernel_liteos_m/commits/adc21052b2b9b55de9fc493cf74645f470edf9b5)), closes [#I4O204](https://gitee.com/openharmony/kernel_liteos_m/issues/I4O204)
|
||||
* los_exc.S中_ExcInMsp主栈中异常处理函数中异常返回类型错误 ([c51df7a](https://gitee.com/openharmony/kernel_liteos_m/commits/c51df7a94c1f21803db25f46a73a7fb291588eda)), closes [#I4EJI4](https://gitee.com/openharmony/kernel_liteos_m/issues/I4EJI4)
|
||||
* los_interrupt.c存在未使用的参数编译出错 ([5af4c2e](https://gitee.com/openharmony/kernel_liteos_m/commits/5af4c2e2139cabe49049283f7a4280460bbf353a)), closes [#I4SJPZ](https://gitee.com/openharmony/kernel_liteos_m/issues/I4SJPZ)
|
||||
* LOS_Panic接口中增加需要增加LOS_BackTrace(),方便定位主动异常位置 ([f51d675](https://gitee.com/openharmony/kernel_liteos_m/commits/f51d675fee217e0ad519f2fa79f70b033f313dce)), closes [#I4IGGY](https://gitee.com/openharmony/kernel_liteos_m/issues/I4IGGY)
|
||||
* los_trace.h接口注释错误修正 ([693468e](https://gitee.com/openharmony/kernel_liteos_m/commits/693468e5274af310721f5962602a915d701a7bf0)), closes #I4CYPZ
|
||||
* m4核在任务中异常时backtrace使用的是MSP所在的栈,而不是PSP所在的栈 ([3e8aea2](https://gitee.com/openharmony/kernel_liteos_m/commits/3e8aea224e481322efef9397e4aafc3450a09d28)), closes [#I4D7GE](https://gitee.com/openharmony/kernel_liteos_m/issues/I4D7GE)
|
||||
* M核posix接口fs模块用例完善 ([ee380fb](https://gitee.com/openharmony/kernel_liteos_m/commits/ee380fb9be45ef033979ec3b8875d980b7f13198)), closes [#I4L7BF](https://gitee.com/openharmony/kernel_liteos_m/issues/I4L7BF)
|
||||
* optimize default configuration ([b2e3849](https://gitee.com/openharmony/kernel_liteos_m/commits/b2e3849bfbd470981602b0dc02f47bffb38bfe11)), closes [#I4FSC9](https://gitee.com/openharmony/kernel_liteos_m/issues/I4FSC9)
|
||||
* OsGetAllTskInfo调用和异常时无任务回调函数地址 ([1c605a3](https://gitee.com/openharmony/kernel_liteos_m/commits/1c605a338ad2317aeb464bdac85df5b9a79c99fd)), closes [#I4MG2T](https://gitee.com/openharmony/kernel_liteos_m/issues/I4MG2T)
|
||||
* pm codex告警清零 ([9666380](https://gitee.com/openharmony/kernel_liteos_m/commits/96663805ecfd3248e33b4deb877c8d55cc4e8eec)), closes [#I4OWPE](https://gitee.com/openharmony/kernel_liteos_m/issues/I4OWPE)
|
||||
* pm模块解冻线程时存在删除空链表且时间片频繁唤醒系统 ([9f185b5](https://gitee.com/openharmony/kernel_liteos_m/commits/9f185b5b52ed9506a4913f233c9ddfe45452ec05)), closes [#I4AKUS](https://gitee.com/openharmony/kernel_liteos_m/issues/I4AKUS)
|
||||
* **posix unittest:** posix unittest 融合 ([ad6f249](https://gitee.com/openharmony/kernel_liteos_m/commits/ad6f249d1ea878f06864d79bdbed772b21eeac49))
|
||||
* **posix:** posix兼容回退 ([207efc1](https://gitee.com/openharmony/kernel_liteos_m/commits/207efc15b859fe18d8b1dac2a3da9d7a5831aa6e))
|
||||
* **posix:** posix接口融合,接口规范兼容性修改 ([e0b1275](https://gitee.com/openharmony/kernel_liteos_m/commits/e0b12758da4a25e42110ba32da25b6d18ebed8ef))
|
||||
* **posix接口融合:** posix接口融合,接口规范兼容性修改 ([4b607fd](https://gitee.com/openharmony/kernel_liteos_m/commits/4b607fd0740a5379cd373890482235845d782b62))
|
||||
* posix线程和LOS_TaskCreate任务不兼容,补齐接口防护,防止访问野指针 ([60805e1](https://gitee.com/openharmony/kernel_liteos_m/commits/60805e1a7c3736db86695ed86cd03cfaab70a427))
|
||||
* pr模板补充说明 ([7b86f69](https://gitee.com/openharmony/kernel_liteos_m/commits/7b86f69cc0ccd5512b69fd3a1181b3440747ddb2))
|
||||
* ReadMe中无对动态加载模块待加载的共享库的限制说明。 ([f86b971](https://gitee.com/openharmony/kernel_liteos_m/commits/f86b97180f97903bb2def271b7b11fc1ae1bf9bb)), closes [#I4ICK8](https://gitee.com/openharmony/kernel_liteos_m/issues/I4ICK8)
|
||||
* shell 输入不识别命令时内存泄漏 ([0245b1a](https://gitee.com/openharmony/kernel_liteos_m/commits/0245b1a7b24fd36d23f9602d0755b274581a84ce)), closes [#I4UR9P](https://gitee.com/openharmony/kernel_liteos_m/issues/I4UR9P)
|
||||
* **shell:** cat针对大文件无法工作 ([d518bad](https://gitee.com/openharmony/kernel_liteos_m/commits/d518bad0dc7dd9e3fbb45423a7db5cb8c1c922dc)), closes [#I4J4TK](https://gitee.com/openharmony/kernel_liteos_m/issues/I4J4TK)
|
||||
* shell模块task命令踩内存问题修改 ([6ffd55d](https://gitee.com/openharmony/kernel_liteos_m/commits/6ffd55dcd07ce17b693a97bb678668f763480e4d)), closes [#I4A70V](https://gitee.com/openharmony/kernel_liteos_m/issues/I4A70V)
|
||||
* switch inet_addr to a function ([b30e913](https://gitee.com/openharmony/kernel_liteos_m/commits/b30e9139d5502acab8c36ae9a56d4cd640786c44)), closes [#I4G4I4](https://gitee.com/openharmony/kernel_liteos_m/issues/I4G4I4)
|
||||
* **testsuites:** cpup和测试套解耦 ([692651f](https://gitee.com/openharmony/kernel_liteos_m/commits/692651fe40f668f19b479186e52fea34d092b458))
|
||||
* tick timer时钟频率赋值修改为运行时赋值 ([ae02afc](https://gitee.com/openharmony/kernel_liteos_m/commits/ae02afc8504f64ff6bc09828f55e9602bcbcae56)), closes [#I4PGUR](https://gitee.com/openharmony/kernel_liteos_m/issues/I4PGUR)
|
||||
* tick中断处理时,无挂起任务时应更新当前运行任务的时间片, 并触发一次调度 ([ea12d40](https://gitee.com/openharmony/kernel_liteos_m/commits/ea12d40caf1301b4a7b6d60a2c599ceff4746c90)), closes [#I4LRZG](https://gitee.com/openharmony/kernel_liteos_m/issues/I4LRZG)
|
||||
* **time_func_test_01.c:** 修复testTimes测试单板配置LOSCFG_BASE_CORE_TICK_PER_SECOND = 1000的问题 ([5c982f1](https://gitee.com/openharmony/kernel_liteos_m/commits/5c982f1087f95174f2836c72648eab58adf37fd7))
|
||||
* 中断向量表对齐大小支持可配置 ([cf9c838](https://gitee.com/openharmony/kernel_liteos_m/commits/cf9c8387e3785d994aacf948b7c1b61324a3dd63)), closes [#I4M20E](https://gitee.com/openharmony/kernel_liteos_m/issues/I4M20E)
|
||||
* 优化trace buffer初始化,删除swtmr 桩中的无效参数 ([afbc9a5](https://gitee.com/openharmony/kernel_liteos_m/commits/afbc9a593b61461072556cb5531d90b30ce2e394)), closes [#I4DPR7](https://gitee.com/openharmony/kernel_liteos_m/issues/I4DPR7)
|
||||
* 优化低功耗流程 ([c6600d9](https://gitee.com/openharmony/kernel_liteos_m/commits/c6600d9dddb666f397ba659d47d64f334691af6b)), closes [#I46VXK](https://gitee.com/openharmony/kernel_liteos_m/issues/I46VXK)
|
||||
* 修复arch目录调整影响到的target目录下的文件 ([d5725b2](https://gitee.com/openharmony/kernel_liteos_m/commits/d5725b22644da8ab3e719169230303e44c7d8750)), closes [#I4JM7Z](https://gitee.com/openharmony/kernel_liteos_m/issues/I4JM7Z)
|
||||
* 修复cortex-m系列系统提供的timer在低频下时间不准的问题 ([3e569ba](https://gitee.com/openharmony/kernel_liteos_m/commits/3e569bac587d90dcd21aff7d8ec53216dfbb8f1c)), closes [#I4HBGR](https://gitee.com/openharmony/kernel_liteos_m/issues/I4HBGR)
|
||||
* 修复hook层LOS_HOOK_TYPE_SEM_PEND的runningTask入参可能为空 ([3fd22ac](https://gitee.com/openharmony/kernel_liteos_m/commits/3fd22ac2b0b4c690669a659246aba099fd4311ec)), closes [#I4BU4P](https://gitee.com/openharmony/kernel_liteos_m/issues/I4BU4P)
|
||||
* 修复irqNum = HwiNumGet()编译错误的问题 ([16e87d7](https://gitee.com/openharmony/kernel_liteos_m/commits/16e87d78d89bec7d85c076fc738ed4ad0614b865)), closes [#I4S81B](https://gitee.com/openharmony/kernel_liteos_m/issues/I4S81B)
|
||||
* 修复Kconfig信息错误 ([bb04582](https://gitee.com/openharmony/kernel_liteos_m/commits/bb045829104211522cd12a7273d5853400c1ea26)), closes [#I4MZ1F](https://gitee.com/openharmony/kernel_liteos_m/issues/I4MZ1F)
|
||||
* 修复L0_Emulator 门禁高概率失败的问题 ([7ad2f62](https://gitee.com/openharmony/kernel_liteos_m/commits/7ad2f62a03481a3919fef1f1e46e4c9677b1e65c)), closes [#I4NB0N](https://gitee.com/openharmony/kernel_liteos_m/issues/I4NB0N)
|
||||
* 修复liteos-m在iar环境下的编译问题 ([4c4784e](https://gitee.com/openharmony/kernel_liteos_m/commits/4c4784e33d7944e7850009be192375aaa6e2b125)), closes [#I4Q5Q5](https://gitee.com/openharmony/kernel_liteos_m/issues/I4Q5Q5)
|
||||
* 修复los_interrupt.c文件中HalHwiInit函数里未使能未对齐异常问题 ([d32e25f](https://gitee.com/openharmony/kernel_liteos_m/commits/d32e25f3ae8e8e5ec24effa98dc8f0b3ba94d0c1)), closes [#I4EJGR](https://gitee.com/openharmony/kernel_liteos_m/issues/I4EJGR)
|
||||
* 修复newlib缺省PTHREAD_KEYS_MAX 问题 ([65f04bf](https://gitee.com/openharmony/kernel_liteos_m/commits/65f04bf093376a478e9585dadfc1238158cc3641)), closes [#I4OX47](https://gitee.com/openharmony/kernel_liteos_m/issues/I4OX47)
|
||||
* 修复OsQueueMailFree提早释放内存的问题 ([ec88d16](https://gitee.com/openharmony/kernel_liteos_m/commits/ec88d1628937b3def6dd613246116f6bfa4141eb))
|
||||
* 修复pm编译告警导致内核编译失败 ([18b0524](https://gitee.com/openharmony/kernel_liteos_m/commits/18b052458e1cea113df7a6bb4798a6d5e1eb751e)), closes [#I49MIN](https://gitee.com/openharmony/kernel_liteos_m/issues/I49MIN)
|
||||
* 修复pthread 编译告警 ([cc57f81](https://gitee.com/openharmony/kernel_liteos_m/commits/cc57f81ab85a5eb9bb4be9bd7d2863978996bcf3)), closes [#I4U16U](https://gitee.com/openharmony/kernel_liteos_m/issues/I4U16U)
|
||||
* 修复pthread_create相关问题 ([cd949dd](https://gitee.com/openharmony/kernel_liteos_m/commits/cd949ddae0aa4e7291b0b7f6ba83c2034cdf1301)), closes [#I4P78J](https://gitee.com/openharmony/kernel_liteos_m/issues/I4P78J)
|
||||
* 修复pthread_create行为与posix不一致问题 ([2b1e5a7](https://gitee.com/openharmony/kernel_liteos_m/commits/2b1e5a7a130fbca1b86a787b54f474e183541d6d)), closes [#I49W9F](https://gitee.com/openharmony/kernel_liteos_m/issues/I49W9F)
|
||||
* 修复readme中文档链接错误 ([8ee70a0](https://gitee.com/openharmony/kernel_liteos_m/commits/8ee70a0f8f856da29139a36ba6f8589201cdb109)), closes [#I4FD5G](https://gitee.com/openharmony/kernel_liteos_m/issues/I4FD5G)
|
||||
* 修复risc-v异常时,异常信息混乱且backtrace无法输出的问题 ([0fb49d4](https://gitee.com/openharmony/kernel_liteos_m/commits/0fb49d4422245e83c2435468eb7f2690f2e2c6e4)), closes #I4BPHX
|
||||
* 修复shcmd.h需要用宏包起来的问题 ([a7a8a62](https://gitee.com/openharmony/kernel_liteos_m/commits/a7a8a62bcb7398b4194b37f62098da9cb1ce717e)), closes [#I45FU2](https://gitee.com/openharmony/kernel_liteos_m/issues/I45FU2)
|
||||
* 修复shell 模块存在大量的编译告警及codeCheck。 ([e0d8b53](https://gitee.com/openharmony/kernel_liteos_m/commits/e0d8b5328f53dcef9427a34e8b0462250bb6a40f)), closes [#I48V2J](https://gitee.com/openharmony/kernel_liteos_m/issues/I48V2J)
|
||||
* 修复任务栈对齐问题及补充posix和cmsis测试用例 ([ed863e9](https://gitee.com/openharmony/kernel_liteos_m/commits/ed863e90dd9aceb5d3b6d92b0a94703101b83f80))
|
||||
* 修复公版gcc编译内核,调用calloc崩溃 ([8d0ced2](https://gitee.com/openharmony/kernel_liteos_m/commits/8d0ced206951f35d5caab61969344b0ab259e5fb)), closes [#I4OFG6](https://gitee.com/openharmony/kernel_liteos_m/issues/I4OFG6)
|
||||
* 修复未使用的参数和类型比较编译报错问题 ([21b46e8](https://gitee.com/openharmony/kernel_liteos_m/commits/21b46e82f31030703d052369701f4d6d736a4a86))
|
||||
* 修复调度时间最大值不一致问题 ([9f393bc](https://gitee.com/openharmony/kernel_liteos_m/commits/9f393bcc6df592efb6940e9864ff93e932ae59ad))
|
||||
* 修正liteos-m内核README不准确信息 ([0e067b2](https://gitee.com/openharmony/kernel_liteos_m/commits/0e067b239354c28e16b05489274b33051d002508)), closes [#I4PLWP](https://gitee.com/openharmony/kernel_liteos_m/issues/I4PLWP)
|
||||
* 修正部分编码风格问题 ([91903a3](https://gitee.com/openharmony/kernel_liteos_m/commits/91903a37165ef364750916104be4f7dfd1d8f9a6)), closes [#I4K8M7](https://gitee.com/openharmony/kernel_liteos_m/issues/I4K8M7)
|
||||
* 内核ERR打印,线程信息,不方便问题定位。 ([232fec2](https://gitee.com/openharmony/kernel_liteos_m/commits/232fec27ac8cd2f46b5a2f5cfbe4677d0e287314)), closes #I4DAKM
|
||||
* 内源检视问题修复 ([c24363b](https://gitee.com/openharmony/kernel_liteos_m/commits/c24363bc50364b0be1fba3b993a83c6936fc3d08))
|
||||
* 删除C文件中无用的__cplusplus ([7fe3aad](https://gitee.com/openharmony/kernel_liteos_m/commits/7fe3aaddf56b300ffcb2b186ae01ed64bef1c069)), closes [#I4D0YK](https://gitee.com/openharmony/kernel_liteos_m/issues/I4D0YK)
|
||||
* 删除OsMemboxExcInfoGetSub内存调测方法中多余的赋值语句。 ([94db0fe](https://gitee.com/openharmony/kernel_liteos_m/commits/94db0fe7a30edaa10786101f1ef662987a27734a)), closes [#I4CFNX](https://gitee.com/openharmony/kernel_liteos_m/issues/I4CFNX)
|
||||
* 去掉没有使用的入参consoleid。 ([a627953](https://gitee.com/openharmony/kernel_liteos_m/commits/a62795304da31e13021ea2c675d124afd2594102)), closes [#I43CVE](https://gitee.com/openharmony/kernel_liteos_m/issues/I43CVE)
|
||||
* 去掉编译选项-fno-short-enums ([b542aab](https://gitee.com/openharmony/kernel_liteos_m/commits/b542aab09dd92397f8c1305ac656ef14a012b5f8)), closes [#I4JY32](https://gitee.com/openharmony/kernel_liteos_m/issues/I4JY32)
|
||||
* 取消cpu进入低功耗前开中断操作 ([bd39e9e](https://gitee.com/openharmony/kernel_liteos_m/commits/bd39e9e6d67310222c363e132141bb7fee1213f1)), closes [#I4KDP8](https://gitee.com/openharmony/kernel_liteos_m/issues/I4KDP8)
|
||||
* 告警修复 ([7d2fd01](https://gitee.com/openharmony/kernel_liteos_m/commits/7d2fd01c2d7d6d4c653a307a1419bc094f5332f0))
|
||||
* 告警修复 ([2d7bf3b](https://gitee.com/openharmony/kernel_liteos_m/commits/2d7bf3b7d8ea84961e802c366899aca891f38377))
|
||||
* 在头文件中补充LOSCFG_MEM_FREE_BY_TASKID函数的声明 ([ad18026](https://gitee.com/openharmony/kernel_liteos_m/commits/ad18026a59fc2853c9580e040f959f9f42082640)), closes [#I4JBOV](https://gitee.com/openharmony/kernel_liteos_m/issues/I4JBOV)
|
||||
* 将curl依赖的函数新增至newlib库 ([bd04d9f](https://gitee.com/openharmony/kernel_liteos_m/commits/bd04d9f29a0b77445a71378f88b01ffdae24554f)), closes [#I4RG71](https://gitee.com/openharmony/kernel_liteos_m/issues/I4RG71)
|
||||
* 将未定义小写"true","false"改为"TRUE","FALSE"。 ([9819eb5](https://gitee.com/openharmony/kernel_liteos_m/commits/9819eb567636adf1774de9fd6039d274bee8f69b)), closes [#I43D20](https://gitee.com/openharmony/kernel_liteos_m/issues/I43D20)
|
||||
* 当前仓代码编译告警的问题 ([194ac58](https://gitee.com/openharmony/kernel_liteos_m/commits/194ac5898d1e2ffaa17f6dca405614b73da6f8bb)), closes #I4N50W
|
||||
* 支持硬浮点编译 ([988fd85](https://gitee.com/openharmony/kernel_liteos_m/commits/988fd85fae454a0d9fe01ef1c921b4f3667d5ac8)), closes [#I48KJP](https://gitee.com/openharmony/kernel_liteos_m/issues/I48KJP)
|
||||
* 测试用例任务栈的宏定义重复定义,导致在osTest.h中修改不生效 ([ce6cf68](https://gitee.com/openharmony/kernel_liteos_m/commits/ce6cf6879f4564393765a24c4d65448e0fddc3eb))
|
||||
* 添加L0 测试门禁 ([5c168fc](https://gitee.com/openharmony/kernel_liteos_m/commits/5c168fc3e0d08dd4a8924696e17a498eb444fa70)), closes #I4C5R4
|
||||
* 添加newlib对ipv6的支持 ([f7400fb](https://gitee.com/openharmony/kernel_liteos_m/commits/f7400fbcb275cbb3b75f1aef2af1459b794432de)), closes [#I4M1DB](https://gitee.com/openharmony/kernel_liteos_m/issues/I4M1DB)
|
||||
* 添加文件版权头等信息 ([cf4e017](https://gitee.com/openharmony/kernel_liteos_m/commits/cf4e017970f8a3113bc8b6028d75775f747512c6)), closes [#I4BXBH](https://gitee.com/openharmony/kernel_liteos_m/issues/I4BXBH)
|
||||
* 清除因g_tm变量没有使用引入的编译告警 ([9689522](https://gitee.com/openharmony/kernel_liteos_m/commits/9689522a8e08b79244ad339dc24074843b99d33b)), closes [#I4LW3H](https://gitee.com/openharmony/kernel_liteos_m/issues/I4LW3H)
|
||||
* 移除los_arch_interrupt.h文件中冗余声明的函数VOID OsExcInit(VOID) ([136952f](https://gitee.com/openharmony/kernel_liteos_m/commits/136952f193fe97cfd6a88932e71811e12edfa7a5)), closes [#I4D9OO](https://gitee.com/openharmony/kernel_liteos_m/issues/I4D9OO)
|
||||
* 补充net相关头文件 ([93f616b](https://gitee.com/openharmony/kernel_liteos_m/commits/93f616b64e961013be5c5267e50d58a40b5cc6c9))
|
||||
* 解决gmtime和localtime接口由于g_tm全局变量导致的竞态问题 ([1454b76](https://gitee.com/openharmony/kernel_liteos_m/commits/1454b76482d42e78c1904028de55d82261e5ecaa)), closes [#I4LW3H](https://gitee.com/openharmony/kernel_liteos_m/issues/I4LW3H)
|
||||
* 解决los_pm.c:743:19: warning 编译告警 ([0c72c8b](https://gitee.com/openharmony/kernel_liteos_m/commits/0c72c8bf94b053ff90bbf2019006c52adf1eb8df)), closes [#I4D4L8](https://gitee.com/openharmony/kernel_liteos_m/issues/I4D4L8)
|
||||
* 解决定时器超时但还在队列中无法删除的问题 ([ecce17e](https://gitee.com/openharmony/kernel_liteos_m/commits/ecce17ea4878c7bdf7d7de9a6848e6bf871563de)), closes [#I4LFVD](https://gitee.com/openharmony/kernel_liteos_m/issues/I4LFVD)
|
||||
* 解除net对cmsis的依赖,net属于内核模块,不应该依赖内核对外接口 ([9982624](https://gitee.com/openharmony/kernel_liteos_m/commits/99826240d979c3aa820ab2aace62e3338978e6d1))
|
||||
* 调度中将pm相关的部分用LOSCFG_KERNEL_PM包含 ([d7c0059](https://gitee.com/openharmony/kernel_liteos_m/commits/d7c0059dc4fcca3f85d2cad1012353892ce28021)), closes [#I4L00F](https://gitee.com/openharmony/kernel_liteos_m/issues/I4L00F)
|
||||
* 调用LOS_TaskDetach操作已退出的joinable的任务时,未正确回收该任务 ([49c93b3](https://gitee.com/openharmony/kernel_liteos_m/commits/49c93b37c5e215612bbeb4619e73c809f9eb1cac)), closes [#I4DZL7](https://gitee.com/openharmony/kernel_liteos_m/issues/I4DZL7)
|
||||
* 针对pr是否同步至release分支,增加原因说明规则 ([1ee543d](https://gitee.com/openharmony/kernel_liteos_m/commits/1ee543d5d31524d543ffb297b121224dedf8602f))
|
||||
* 队列相关的API实现中,参数的校验不完全,导致程序异常 ([eef7c80](https://gitee.com/openharmony/kernel_liteos_m/commits/eef7c80a725d68af254ae55091bd36f978cf4284))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* adapt net ([8594ee4](https://gitee.com/openharmony/kernel_liteos_m/commits/8594ee469ad2d40a363e5d77f94f292ab3cb8c21))
|
||||
* add option for ioctl ([5e8ac4b](https://gitee.com/openharmony/kernel_liteos_m/commits/5e8ac4b8883f64bbffa5bb3f063a601112058396)), closes [#I4I3W5](https://gitee.com/openharmony/kernel_liteos_m/issues/I4I3W5)
|
||||
* add option SIOCGIFBRDADDR for ioctl ([33ee492](https://gitee.com/openharmony/kernel_liteos_m/commits/33ee49295329e3c394d1cc7b16f77a23ac2255a8)), closes [#I4EGNG](https://gitee.com/openharmony/kernel_liteos_m/issues/I4EGNG)
|
||||
* added assembly atomic interface ([1513f50](https://gitee.com/openharmony/kernel_liteos_m/commits/1513f50a474d1227a83fb655ad18c19cd792f235))
|
||||
* backtrace for arm9 ([03de7f3](https://gitee.com/openharmony/kernel_liteos_m/commits/03de7f37450a8821ea05e60e94a5d1dd359c4f99)), closes [#I4BMLG](https://gitee.com/openharmony/kernel_liteos_m/issues/I4BMLG)
|
||||
* Board 和 SoC分离,编译适配 ([3f1c04d](https://gitee.com/openharmony/kernel_liteos_m/commits/3f1c04dd57bca0379ce37162d9d824801e7d880f))
|
||||
* **build:** add module_group and comment out arch_cflags ([e5636f7](https://gitee.com/openharmony/kernel_liteos_m/commits/e5636f7acaf7e8b7d14dc07930b2a16c86e63c85))
|
||||
* **build:** support Kconfig ([7e67343](https://gitee.com/openharmony/kernel_liteos_m/commits/7e673430dc42c55b3a0a6d955ba8fea21d6d58ea))
|
||||
* **cmsis:** support max_count for osSemaphoreNew ([d478152](https://gitee.com/openharmony/kernel_liteos_m/commits/d478152762013975551e1af154df42987596c9a6))
|
||||
* cortex-m55支持psplimit ([db7d641](https://gitee.com/openharmony/kernel_liteos_m/commits/db7d641c223db8ab25501d79c2a6331f743d830b)), closes [#I4T7R3](https://gitee.com/openharmony/kernel_liteos_m/issues/I4T7R3)
|
||||
* littlefs最大打开文件个数修改为可通过menuconfig配置 ([9bc9f3a](https://gitee.com/openharmony/kernel_liteos_m/commits/9bc9f3aa53be7bf392d3da09adcb184dec8e3da2))
|
||||
* newlib支持pthread_equal ([ce5357e](https://gitee.com/openharmony/kernel_liteos_m/commits/ce5357eee1daf1c1b3a3aa7bdeaef0cc5a8901bf)), closes [#I4QERS](https://gitee.com/openharmony/kernel_liteos_m/issues/I4QERS)
|
||||
* provide read write for socket by #define ([d044eda](https://gitee.com/openharmony/kernel_liteos_m/commits/d044eda3c3640ae135ef528739d0c9609f40c822)), closes [#I4H8TL](https://gitee.com/openharmony/kernel_liteos_m/issues/I4H8TL)
|
||||
* synchronizing arch api ([04bf3a6](https://gitee.com/openharmony/kernel_liteos_m/commits/04bf3a682f149482d8ebdbb9ff96d6889edb487a)), closes [#I4N7XV](https://gitee.com/openharmony/kernel_liteos_m/issues/I4N7XV)
|
||||
* synchronous los_hwicreate interface ([6c68ada](https://gitee.com/openharmony/kernel_liteos_m/commits/6c68adad4db7f6112990764eafe6a3bd5f8759a5))
|
||||
* 低内存资源回收low memory killer ([ab886d8](https://gitee.com/openharmony/kernel_liteos_m/commits/ab886d848ab809942c11d0e408b8ff76c41b92b2)), closes [#I4ID0M](https://gitee.com/openharmony/kernel_liteos_m/issues/I4ID0M)
|
||||
* 低功耗支持冻结线程等需求 ([9b5739a](https://gitee.com/openharmony/kernel_liteos_m/commits/9b5739ab11ae7a89d35ba6f54fc62137ddc6d897)), closes [#I49FJF](https://gitee.com/openharmony/kernel_liteos_m/issues/I49FJF)
|
||||
* 内核提供Interrupt框架,支持多架构多平台通用化 ([e8538d0](https://gitee.com/openharmony/kernel_liteos_m/commits/e8538d041a93817cea4ae3914afcfdc6182483e7))
|
||||
* 内核提供tick timer框架,支持多架构多平台通用化 ([f635450](https://gitee.com/openharmony/kernel_liteos_m/commits/f635450d7cf7f674de3803b5eb9d759b6e4d005b)), closes [#I4N7XV](https://gitee.com/openharmony/kernel_liteos_m/issues/I4N7XV)
|
||||
* 同步调度部分优化至liteos_m ([fb11ab1](https://gitee.com/openharmony/kernel_liteos_m/commits/fb11ab181e69289f7a2edfd5857595b89f1d5d67))
|
||||
* 支持cortex-m55 ([6e17805](https://gitee.com/openharmony/kernel_liteos_m/commits/6e1780546c173365262c7a50b81896f5b3c46389)), closes [#I4Q9OQ](https://gitee.com/openharmony/kernel_liteos_m/issues/I4Q9OQ)
|
||||
* 支持Lms ([7b838e8](https://gitee.com/openharmony/kernel_liteos_m/commits/7b838e8a7b8e9f7fb34ca495e5cb46d70d12722b)), closes [#I4HYBG](https://gitee.com/openharmony/kernel_liteos_m/issues/I4HYBG)
|
||||
* 支持posix 和 cmsis join能力 ([ecfdf7f](https://gitee.com/openharmony/kernel_liteos_m/commits/ecfdf7ff9bf1adf06835968dc6f06b7c45e04862)), closes [#I44V26](https://gitee.com/openharmony/kernel_liteos_m/issues/I44V26)
|
||||
* 支持posix线程私有数据能力 ([a856303](https://gitee.com/openharmony/kernel_liteos_m/commits/a856303b9cdadcfade33de0d3a335db0332f5761)), closes [#I4ODEB](https://gitee.com/openharmony/kernel_liteos_m/issues/I4ODEB)
|
||||
* 支持pthread_condattr_setclock ([68dad2c](https://gitee.com/openharmony/kernel_liteos_m/commits/68dad2ccc9856dc2c1ac112bc8f30a703c1af5d9)), closes [#I4ETLN](https://gitee.com/openharmony/kernel_liteos_m/issues/I4ETLN)
|
||||
* 支持pthread_mutex属性相关接口 ([d2be4d7](https://gitee.com/openharmony/kernel_liteos_m/commits/d2be4d7a460365844a7732df8a3eb59e6bb64897)), closes [#I4G4RQ](https://gitee.com/openharmony/kernel_liteos_m/issues/I4G4RQ)
|
||||
* 支持select.h的FD_SETSIZE宏配置 ([05642f0](https://gitee.com/openharmony/kernel_liteos_m/commits/05642f05ae6b220df977f4402bc31f396bf08603)), closes [#I4RYK4](https://gitee.com/openharmony/kernel_liteos_m/issues/I4RYK4)
|
||||
* 支持任务栈可配置 ([96cc92d](https://gitee.com/openharmony/kernel_liteos_m/commits/96cc92d03561e1a9f1030c71916068584b349626))
|
||||
* 调度、任务及pm解耦 ([cc8a794](https://gitee.com/openharmony/kernel_liteos_m/commits/cc8a794229f4236a1611183fd482740b3badbcd7)), closes [#I4JTN6](https://gitee.com/openharmony/kernel_liteos_m/issues/I4JTN6)
|
||||
* 适配三方库FatFs升级至r0.14a版本 ([92ea355](https://gitee.com/openharmony/kernel_liteos_m/commits/92ea355756ebd92b8809ecb638ffb5355d89c5e9))
|
||||
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
* pthread_create 支持任务栈设置
|
||||
osThreadNew 支持任务栈设置
|
||||
TSK_INIT_PARAM_S 结构体添加stackAddr 字段
|
||||
|
||||
* 涉及接口修改:
|
||||
LOS_HwiCreate LOS_HwiDelete
|
||||
|
||||
改动内容:
|
||||
中断处理函数参数类型由HWI_ARG_T统一改为HwiIrqParam,封装原有arg参数及riscv部分实际使用变量pDevId, 这样一方面统一LiteOS接口,也统一了中断处理函数的arg参数
|
||||
同步LOS_HwiDelete接口入参,新增HWI_IRQ_PARAM_S *irqParam参数,为后续共享中断功能的添加预留
|
||||
|
||||
* 新增接口:
|
||||
LOS_TaskResRecycle
|
||||
LOS_CurrNanosec
|
||||
LOS_MDelay
|
||||
|
||||
接口修改:
|
||||
LOS_QueueCreate:第一个入参添加const修饰并增加一种异常情况处理
|
||||
los_memory.c中 OS_ERROR 修改为LOS_NOK,重定义LOS_NOK为(UINT32)-1。
|
||||
|
||||
接口位置转移:
|
||||
LOS_UDelay 由los_task.h/.c 转移到los_tick.h/.c
|
||||
|
||||
宏修改:
|
||||
LOS_ERRNO_MUX_PEND_INTERR 改名为 LOS_ERRNO_MUX_IN_INTERR
|
||||
|
||||
* **posix接口融合:**
|
||||
|
||||
接口修改:
|
||||
calloc
|
||||
pthread_mutex_init
|
||||
mq_unlink
|
||||
pthread_join
|
||||
pthread_exit
|
||||
pthread_attr_init
|
||||
pthread_attr_destroy
|
||||
pthread_condattr_destroy
|
||||
pthread_cond_timedwait
|
||||
pthread_mutexattr_init
|
||||
pthread_mutexattr_settype
|
||||
pthread_mutex_destroy
|
||||
pthread_mutex_timedlock
|
||||
pthread_mutex_trylockk
|
||||
pthread_mutex_unlock
|
||||
sem_getvalue
|
||||
sem_timedwait
|
||||
pthread_cond_timedwait
|
||||
nanosleep
|
||||
timer_create
|
||||
timer_settime
|
||||
timer_gettime
|
||||
testStdlibStrtoull005
|
||||
testStdlibStrtol011
|
||||
testStdlibStrtoul007
|
||||
testPthread004
|
||||
|
||||
新增接口:
|
||||
CheckForCancel
|
||||
pthread_setcancelstate
|
||||
pthread_setcanceltype
|
||||
pthread_once
|
||||
pthread_setschedprio
|
||||
pthread_attr_setstack
|
||||
pthread_attr_getstack
|
||||
pthread_condattr_getpshared
|
||||
pthread_condattr_setpshared
|
||||
pthread_condattr_getclock
|
||||
pthread_mutexattr_gettype
|
||||
CheckMutexAttr
|
||||
OsMuxPreCheck
|
||||
sem_trywait
|
||||
MuxPendForPosix
|
||||
MuxPostForPosix
|
||||
增加overrun功能
|
||||
|
||||
接口变化:
|
||||
mq_getsetattr 改为内部接口MqGetSetAttr
|
||||
GetTickTimeFromNow->OsGetTickTimeFromNow
|
||||
|
||||
接口位置转移:
|
||||
pthread_equal接口由newlib下转移到kal/posix/src/pthread.c中
|
||||
|
||||
* **posix:** 接口修改:
|
||||
calloc
|
||||
pthread_mutex_init
|
||||
mq_unlink
|
||||
pthread_join
|
||||
pthread_exit
|
||||
pthread_attr_init
|
||||
pthread_attr_destroy
|
||||
pthread_condattr_destroy
|
||||
pthread_cond_timedwait
|
||||
pthread_mutexattr_init
|
||||
pthread_mutexattr_settype
|
||||
pthread_mutex_destroy
|
||||
pthread_mutex_timedlock
|
||||
pthread_mutex_trylockk
|
||||
pthread_mutex_unlock
|
||||
sem_getvalue
|
||||
|
||||
新增接口:
|
||||
CheckForCancel
|
||||
pthread_setcancelstate
|
||||
pthread_setcanceltype
|
||||
pthread_once
|
||||
pthread_setschedprio
|
||||
pthread_attr_setstack
|
||||
pthread_attr_getstack
|
||||
pthread_condattr_getpshared
|
||||
pthread_condattr_setpshared
|
||||
pthread_condattr_getclock
|
||||
pthread_mutexattr_gettype
|
||||
CheckMutexAttr
|
||||
OsMuxPreCheck
|
||||
sem_trywait
|
||||
|
||||
接口变化:
|
||||
mq_getsetattr 改为内部接口OsMqGetSetAttr
|
||||
|
||||
接口位置转移:
|
||||
pthread_equal接口由newlib下转移到kal/posix/src/pthread.c中
|
||||
|
||||
* 新增接口:
|
||||
LOS_HwiTrigger ArchIntTrigger
|
||||
LOS_HwiEnable ArchIntEnable
|
||||
LOS_HwiDisable ArchIntDisable
|
||||
LOS_HwiClear ArchIntClear
|
||||
LOS_HwiSetPriority ArchIntSetPriority
|
||||
|
||||
* Assembly implementation:
|
||||
ArchAtomicRead
|
||||
ArchAtomicSet
|
||||
ArchAtomicAdd
|
||||
ArchAtomicSub
|
||||
ArchAtomicInc
|
||||
ArchAtomicIncRet
|
||||
ArchAtomicDec
|
||||
ArchAtomicDecRet
|
||||
|
||||
* 原来版本中每个架构下提供的tick timer相关操作函数为弱函数:
|
||||
WEAK UINT32 HalTickStart(OS_TICK_HANDLER handler);
|
||||
WEAK VOID HalSysTickReload(UINT64 nextResponseTime);
|
||||
WEAK UINT64 HalGetTickCycle(UINT32 *period);
|
||||
WEAK VOID HalTickLock(VOID);
|
||||
WEAK VOID HalTickUnlock(VOID);
|
||||
用户如果需要启用自己的tick timer需要自己实现相关接口(强属性),在 "内核初始化之前" 通过调用:
|
||||
LOS_TickTimerRegister 接口替换系统默认提供的tick timer相关接口。
|
||||
无论用户提供的tick timer 还是系统默认提供的,均在内核初始化时启动。
|
||||
* int pthread_key_create(pthread_key_t *k, void (*dtor)(void *))
|
||||
int pthread_key_delete(pthread_key_t k)
|
||||
int pthread_setspecific(pthread_key_t k, const void *x)
|
||||
void *pthread_getspecific(pthread_key_t k)
|
||||
* 1.修改arch/include下接口,以ArchXX命名函数
|
||||
2.提取公共函数声明:ArchAtomicXchg32bits、ArchAtomicDecRet、ArchAtomicCmpXchg32bits
|
||||
3.新增部分原子操作c内联实现
|
||||
* 增加低内存资源回收注册相关接口LOS_LmkOpsNodeRegister、LOS_LmkOpsNodeUnregister和内存资源释放和任务恢复接口LOS_LmkTasksKill和LOS_LmkTasksRestore.
|
||||
* SwtmrHandlerItem结构体新增swtmrID字段,用于标识超时队列中软件定时器id
|
||||
* 新增支持API:
|
||||
|
||||
LOS_LmsCheckPoolAdd使能检测指定内存池
|
||||
LOS_LmsCheckPoolDel不检测指定内存池
|
||||
LOS_LmsAddrProtect为指定内存段上锁,不允许访问
|
||||
LOS_LmsAddrDisableProtect去能指定内存段的访问保护
|
||||
|
||||
|
||||
# (2021-09-30)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* M核代码告警清零 ([cb5f862](https://gitee.com/openharmony/kernel_liteos_m/commits/cb5f862eafd91675bf53d0320616cc8f707a6e5a)), closes [#I4386N](https://gitee.com/openharmony/kernel_liteos_m/issues/I4386N)
|
||||
* M核告警消除 ([5a9d53b](https://gitee.com/openharmony/kernel_liteos_m/commits/5a9d53b6444a3bbe084f575ef079f0da36c27c2a)), closes [#I46LHG](https://gitee.com/openharmony/kernel_liteos_m/issues/I46LHG)
|
||||
* M核编译配置修改 ([deff7c9](https://gitee.com/openharmony/kernel_liteos_m/commits/deff7c921f606ed85663f91d21c12163c15aa7f8)), closes [#I46XEA](https://gitee.com/openharmony/kernel_liteos_m/issues/I46XEA)
|
||||
* shell模块task命令踩内存问题修改 ([b5e84d5](https://gitee.com/openharmony/kernel_liteos_m/commits/b5e84d5516b599257151f88b5a830d6fe9e0e188)), closes #II4
|
||||
* trustzone 中断适配 ([15a2c17](https://gitee.com/openharmony/kernel_liteos_m/commits/15a2c17f791b7d6703863718d92fa35402c41067)), closes [#I42TFV](https://gitee.com/openharmony/kernel_liteos_m/issues/I42TFV)
|
||||
* add API LOS_HwiCreate and LOS_HwDelete ([eb668eb](https://gitee.com/openharmony/kernel_liteos_m/commits/eb668eb9e0021961230858f9bfa1599646da9a8f)), closes [#I3R75F](https://gitee.com/openharmony/kernel_liteos_m/issues/I3R75F)
|
||||
* add liteos_m vfs ([5479dd6](https://gitee.com/openharmony/kernel_liteos_m/commits/5479dd66d7ec96d2206a9890586fe5f07d50fbb9)), closes [#I3R493](https://gitee.com/openharmony/kernel_liteos_m/issues/I3R493)
|
||||
* backtrace代码段判断函数定义成弱函数,如果有多个代码段,那么可根据实际情况重定义 ([8692ed3](https://gitee.com/openharmony/kernel_liteos_m/commits/8692ed33a3b975bac7aa5b6ce3c40a84e281f6c5)), closes [#I420PQ](https://gitee.com/openharmony/kernel_liteos_m/issues/I420PQ)
|
||||
* change cpup retval range ([d00a35b](https://gitee.com/openharmony/kernel_liteos_m/commits/d00a35ba9288047e9eaba06a8ed1d15806bfca40))
|
||||
* change description according to review ([a38365e](https://gitee.com/openharmony/kernel_liteos_m/commits/a38365ed097fb398f922a5d1a72305933ae3e7b3))
|
||||
* change queuePosion to queuePosition ([e772ccb](https://gitee.com/openharmony/kernel_liteos_m/commits/e772ccb3ccd3b31269066fa59a434a23af98ce51))
|
||||
* change to OpenHarmony LiteOS-M ([259fb54](https://gitee.com/openharmony/kernel_liteos_m/commits/259fb54b3c1a208c5672f1f6551ba0424505e4b2))
|
||||
* comment error ([a37b73d](https://gitee.com/openharmony/kernel_liteos_m/commits/a37b73d7599a62a728dbf564de9d9927f995ec1b))
|
||||
* compile warning fix ([8dea15c](https://gitee.com/openharmony/kernel_liteos_m/commits/8dea15c4fcaff2957c60351781180f964c0a882d)), closes #I4330
|
||||
* compile warnings ([75f6187](https://gitee.com/openharmony/kernel_liteos_m/commits/75f61870a002e238385bc9a7632d42b0b2488c9a)), closes [#I3Y57X](https://gitee.com/openharmony/kernel_liteos_m/issues/I3Y57X)
|
||||
* correct ECB in comment ([e2aeb1f](https://gitee.com/openharmony/kernel_liteos_m/commits/e2aeb1ff1d4cd54a752c9f6ef976ee8e353da620))
|
||||
* correct spelling ([dd5cefb](https://gitee.com/openharmony/kernel_liteos_m/commits/dd5cefb0dace4b7a7276c880e45d5520950e9844))
|
||||
* correct spelling ([e7ea50f](https://gitee.com/openharmony/kernel_liteos_m/commits/e7ea50f13142e34a9860e75be051538fe91e234e))
|
||||
* correct the counter of exception type ([bff6587](https://gitee.com/openharmony/kernel_liteos_m/commits/bff65877a281ac1cdcbefd325dcd3ad4933edac9))
|
||||
* correct typo ([3ceface](https://gitee.com/openharmony/kernel_liteos_m/commits/3ceface13e1c15d107bc3c8460c17b9dd4c95e26))
|
||||
* cpup funciton repair ([c842251](https://gitee.com/openharmony/kernel_liteos_m/commits/c842251bab7ea6365f2bee8ae880e6efb60f0c73))
|
||||
* delete unused symbols for default config ([7ad3a22](https://gitee.com/openharmony/kernel_liteos_m/commits/7ad3a22b4d62c8b00876ff338c4ce8d1e3f3cbe2)), closes [#I45HN3](https://gitee.com/openharmony/kernel_liteos_m/issues/I45HN3)
|
||||
* fix __cplusplus typo ([c3eb3e5](https://gitee.com/openharmony/kernel_liteos_m/commits/c3eb3e59e692371f67a4e21e4b38004195ce5e10))
|
||||
* fix backtrace check issue ([b6664e6](https://gitee.com/openharmony/kernel_liteos_m/commits/b6664e66f14d432b02101c883a53cb333dc4c195))
|
||||
* fix bad params def in HalTickStart ([4443b74](https://gitee.com/openharmony/kernel_liteos_m/commits/4443b74ea63d2e458af69723a7198bbbaeb856ea)), closes [#I48YWT](https://gitee.com/openharmony/kernel_liteos_m/issues/I48YWT)
|
||||
* fix comment typo issue ([0c2a675](https://gitee.com/openharmony/kernel_liteos_m/commits/0c2a675e2d163eaf05aff7df226404888d78ca37))
|
||||
* fix destroy typo ([4ba6259](https://gitee.com/openharmony/kernel_liteos_m/commits/4ba6259e94bd677764922b0470fddc2590f6efa5))
|
||||
* fix function name ([f7d50d0](https://gitee.com/openharmony/kernel_liteos_m/commits/f7d50d0fbf53cdd352e94a387cf707083f1641bb))
|
||||
* fix length typo ([98d6580](https://gitee.com/openharmony/kernel_liteos_m/commits/98d65801de9e37199b5df9c8734ebcb6ff5d853d))
|
||||
* fix LOS_MEMBOX_ALIGNED macro name ([fced899](https://gitee.com/openharmony/kernel_liteos_m/commits/fced8992cf4fbc26c9722d528d642a7afe479170))
|
||||
* fix LOS_TaskNameGet comment ([c70b28b](https://gitee.com/openharmony/kernel_liteos_m/commits/c70b28bf785da12fd60ecc92a5a63fb54e52c22a))
|
||||
* fix macro typo ([1600360](https://gitee.com/openharmony/kernel_liteos_m/commits/16003604a948d081151ca4fcf0cfeea91c9e1960))
|
||||
* fix misspell in comments ([4572814](https://gitee.com/openharmony/kernel_liteos_m/commits/457281427ba286e24386d7916c4bc81f112f1c60))
|
||||
* fix NULL UNUSED redefined issue ([765bd55](https://gitee.com/openharmony/kernel_liteos_m/commits/765bd551990e906f457ec1145aea4f2bf5856547))
|
||||
* fix OS_TASK_STACK_PROTECT_SIZE undeclared error ([2a5a515](https://gitee.com/openharmony/kernel_liteos_m/commits/2a5a515f50a0f344d416218046bf0880facfb97c)), closes [#I4C5RW](https://gitee.com/openharmony/kernel_liteos_m/issues/I4C5RW)
|
||||
* fix print format compilation warning ([ef12c89](https://gitee.com/openharmony/kernel_liteos_m/commits/ef12c89c7a79791665125a0b7391f9e533a06a0f))
|
||||
* fix readme link issue ([9e332c6](https://gitee.com/openharmony/kernel_liteos_m/commits/9e332c69a5813027575786424b78f0ae2f9a4c5a))
|
||||
* fix some typo issues ([f6b8cab](https://gitee.com/openharmony/kernel_liteos_m/commits/f6b8cab2539e4d1ee9e47ab8e3eb12f1630f7393))
|
||||
* fix typo in comment ([811d3fa](https://gitee.com/openharmony/kernel_liteos_m/commits/811d3fae8a39686a1c66dfd61c897b7fd3fac2ac))
|
||||
* fix typos ([191644e](https://gitee.com/openharmony/kernel_liteos_m/commits/191644e4412fccb7142cfcd34316ad8e2d24fcdf))
|
||||
* Fixed a spelling error in FS_LOCK_TIMEOUT_SEC. ([42dc308](https://gitee.com/openharmony/kernel_liteos_m/commits/42dc3083693be13c5fa8f2ad8213245465e28adf)), closes [#I3TL66](https://gitee.com/openharmony/kernel_liteos_m/issues/I3TL66)
|
||||
* include file log_config.h in los_mpu.c ([1932d71](https://gitee.com/openharmony/kernel_liteos_m/commits/1932d714a589c9e87258d7c8ed647b6110bde543))
|
||||
* L0 GN compilation problem ([2f9bfcc](https://gitee.com/openharmony/kernel_liteos_m/commits/2f9bfcc6ee436ee3568d0c8158a8e43c9ef02623)), closes [I3ORHS](https://gitee.com/openharmony/kernel_liteos_m/issues/I3ORHS)
|
||||
* l0 shell adapt new master ([fd2227e](https://gitee.com/openharmony/kernel_liteos_m/commits/fd2227e5c858c840f63629c27e559580e1cbdf2f))
|
||||
* littlefs inappropriate return value and errno ([452f364](https://gitee.com/openharmony/kernel_liteos_m/commits/452f36403dd4376572d8b52352d0d8129a4617e4)), closes [I3YIVT](https://gitee.com/openharmony/kernel_liteos_m/issues/I3YIVT)
|
||||
* littlefs三方源码采用GN编译修改上库 ([bdb614b](https://gitee.com/openharmony/kernel_liteos_m/commits/bdb614bc2b82011d77c7c8ffb95e415d2640d19d))
|
||||
* LOS_QueueInfoGet函数统计等待读写任务有误 ([215a1f6](https://gitee.com/openharmony/kernel_liteos_m/commits/215a1f6dc06cf2348c5875f7b05193b26ec17dde)), closes [#I4C6P2](https://gitee.com/openharmony/kernel_liteos_m/issues/I4C6P2)
|
||||
* los_swtmr.h不满足自包含要求对los_config.h存在依赖,但未包含los_config.h ([ad8e96a](https://gitee.com/openharmony/kernel_liteos_m/commits/ad8e96a00f2fcaebe57feae4e3f23f99d7f1d066)), closes [#I40DHM](https://gitee.com/openharmony/kernel_liteos_m/issues/I40DHM)
|
||||
* **mbedtls:** mbedtls l0 support ([761b860](https://gitee.com/openharmony/kernel_liteos_m/commits/761b86096c3cf5642c95e556c11a45a3d5f413e4))
|
||||
* misspell ([30578a6](https://gitee.com/openharmony/kernel_liteos_m/commits/30578a6a68a0d3a203b9a00e7bd1a946356d13d2))
|
||||
* modify event API description ([9481f1d](https://gitee.com/openharmony/kernel_liteos_m/commits/9481f1d8406960b8b859cc5a84b3831eadaf040c))
|
||||
* modify the return type of LOS_IntLock from UINTPTR to UINT32. ([bcc34e2](https://gitee.com/openharmony/kernel_liteos_m/commits/bcc34e22ede5aeccea63aba9f9ce3cb9aa92cbeb))
|
||||
* modify type INLNIE ([294a6d2](https://gitee.com/openharmony/kernel_liteos_m/commits/294a6d246b6a1f7cba8ce1bc4eeb9ae11f17a003))
|
||||
* Mutex锁释放后,无任务持有的情况下,owner未清空 ([c136cfd](https://gitee.com/openharmony/kernel_liteos_m/commits/c136cfdf973ae0068154606afa3a23858822c347)), closes [#I40OC8](https://gitee.com/openharmony/kernel_liteos_m/issues/I40OC8)
|
||||
* M核littlefs当文件open失败时,需要回收fd,否则会有fd泄露 ([b458e12](https://gitee.com/openharmony/kernel_liteos_m/commits/b458e12ed54905db6667f9d5db1410f94a3d6c71)), closes [#I3XU6R](https://gitee.com/openharmony/kernel_liteos_m/issues/I3XU6R)
|
||||
* m核上littlefs新增错误码功能 ([a062378](https://gitee.com/openharmony/kernel_liteos_m/commits/a06237863121816fa6421aed233446a3fa4e2665)), closes [#I3UVMQ](https://gitee.com/openharmony/kernel_liteos_m/issues/#I3UVMQ)
|
||||
* net compile fix ([299813c](https://gitee.com/openharmony/kernel_liteos_m/commits/299813cdb43ae1e24200f0a6b006e04e4d4fcb05))
|
||||
* open shell & fix qemu compile ([911a767](https://gitee.com/openharmony/kernel_liteos_m/commits/911a767992ee540a96ee9f67e0b87195656c3eab))
|
||||
* ping cmd compile fail ([ae05de3](https://gitee.com/openharmony/kernel_liteos_m/commits/ae05de3ffda86d312d33b2e38f237dd76daf4949))
|
||||
* protect from accssing NULL pointer, access g_handle after fslock ([bc7a914](https://gitee.com/openharmony/kernel_liteos_m/commits/bc7a914bce1b227a4f57265d5ecc3f82d78533e7)), closes [#I3UCX3](https://gitee.com/openharmony/kernel_liteos_m/issues/I3UCX3)
|
||||
* remove changelog in README ([37ef8ca](https://gitee.com/openharmony/kernel_liteos_m/commits/37ef8ca7ae73bf78f56dfef36c48bcd790afb6ff)), closes [#I3ZECY](https://gitee.com/openharmony/kernel_liteos_m/issues/I3ZECY)
|
||||
* remove libsec_kernel ([1144b75](https://gitee.com/openharmony/kernel_liteos_m/commits/1144b75f3ff9ce9e8fa114cf614d3deade8ac7c2))
|
||||
* remove project files ([4ad01ce](https://gitee.com/openharmony/kernel_liteos_m/commits/4ad01ced93684e5c7ba144ca267f8fcc2fe03105))
|
||||
* remove targets project files ([f39da5a](https://gitee.com/openharmony/kernel_liteos_m/commits/f39da5a6da59a3b1291c6b9ef7c50e6185df5ea1))
|
||||
* risc-v 锁中断在调度后失效 ([70f3aa1](https://gitee.com/openharmony/kernel_liteos_m/commits/70f3aa1c112e949d9af8e0245af5879140adefba)), closes [#I42OLJ](https://gitee.com/openharmony/kernel_liteos_m/issues/I42OLJ)
|
||||
* riscv_nuclei 编译失败 ([d3fb23c](https://gitee.com/openharmony/kernel_liteos_m/commits/d3fb23cca06580b6e447a9476a9c16643c4ea8fe)), closes [#I41PQJ](https://gitee.com/openharmony/kernel_liteos_m/issues/I41PQJ)
|
||||
* rollback resources when opendir failed ([82fad6c](https://gitee.com/openharmony/kernel_liteos_m/commits/82fad6c36f183de93d936dd2007b899c2932bcee)), closes [#I3Y577](https://gitee.com/openharmony/kernel_liteos_m/issues/I3Y577)
|
||||
* Scheduling module code to join GN compilation. ([8bf166b](https://gitee.com/openharmony/kernel_liteos_m/commits/8bf166b418ce1a6c027dc304d45fc9431923764c)), closes [#I3OA95](https://gitee.com/openharmony/kernel_liteos_m/issues/I3OA95)
|
||||
* The hook module fails to compile under the c99 compilation standard. ([a078c30](https://gitee.com/openharmony/kernel_liteos_m/commits/a078c3086fa47e05e3ffdc4e94ca202284a1487b)), closes [#I3S4ME](https://gitee.com/openharmony/kernel_liteos_m/issues/I3S4ME)
|
||||
* tick 动态化计算优化,减小中断执行时间对系统总体时间的影响,保证软件定时器的响应精度。 ([2118c84](https://gitee.com/openharmony/kernel_liteos_m/commits/2118c84616cce5b5d4569d5a82a4d5de02af1e1c)), closes [#I3YGP1](https://gitee.com/openharmony/kernel_liteos_m/issues/I3YGP1)
|
||||
* timer qemu 头文件缺失 ([12fed74](https://gitee.com/openharmony/kernel_liteos_m/commits/12fed747226c377c656b8acb8346154627845b6f))
|
||||
* update according to review comments ([4dc0d31](https://gitee.com/openharmony/kernel_liteos_m/commits/4dc0d313d1b4a39ebb62156d0bb6429ebb8b996d))
|
||||
* update arch_spec.md ([cf43988](https://gitee.com/openharmony/kernel_liteos_m/commits/cf439885234e0955bab09834b3b876d627c81605))
|
||||
* update doc usage ([5c19fd4](https://gitee.com/openharmony/kernel_liteos_m/commits/5c19fd4beca15a8b7faad847a13943a9abfe3c8c))
|
||||
* update document description ([954c2fc](https://gitee.com/openharmony/kernel_liteos_m/commits/954c2fcfb531d0da1dcc6354a0c0b14335566ed7))
|
||||
* update macro to config item ([be57ece](https://gitee.com/openharmony/kernel_liteos_m/commits/be57ece9ce6200c8868164bc0bb2f26e3062cd37))
|
||||
* 以g_sysSchedStartTime是否为0判断时间轴是否生效存在极限场景导致调度时间不生效 ([509cf59](https://gitee.com/openharmony/kernel_liteos_m/commits/509cf59befb40839a376be31958d615f066c66fd)), closes [#I45HP5](https://gitee.com/openharmony/kernel_liteos_m/issues/I45HP5)
|
||||
* 修复littlefs的多分区挂载时,对pathname的处理逻辑异常 ([b55cfc1](https://gitee.com/openharmony/kernel_liteos_m/commits/b55cfc1ba7fc470b876c555ac7d3be0aa1d3d363)), closes [#I3WWFA](https://gitee.com/openharmony/kernel_liteos_m/issues/I3WWFA)
|
||||
* 修复littlefs编译fs.c缺少头文件件依赖配置+若干musl库的缺失问题+多分区规格宏配置问题 ([7259289](https://gitee.com/openharmony/kernel_liteos_m/commits/7259289bd98a743f596060bc607f77ab8f149129)), closes [#I3VT11](https://gitee.com/openharmony/kernel_liteos_m/issues/I3VT11)
|
||||
* 修复M核littlefs GN编译的若干错误 ([d77828e](https://gitee.com/openharmony/kernel_liteos_m/commits/d77828e206f3324424c3b1372332828a0afb84c2))
|
||||
* 修复M核上musl库缺失strdup,c的问题 ([139f83a](https://gitee.com/openharmony/kernel_liteos_m/commits/139f83af391a4f5e64ab0fccbd783dd651b87e6a)), closes [#I3VZSI](https://gitee.com/openharmony/kernel_liteos_m/issues/I3VZSI)
|
||||
* 修复QUEUE_INFO_S中waitReadTask无法保存大于32的任务编号 ([704cca9](https://gitee.com/openharmony/kernel_liteos_m/commits/704cca97b17972d1640fd33b1fa0b5917bb92b19)), closes [#I41N78](https://gitee.com/openharmony/kernel_liteos_m/issues/I41N78)
|
||||
* 修复task命令格式错误,增加copyright ([ad15bbd](https://gitee.com/openharmony/kernel_liteos_m/commits/ad15bbd6a4d298aabc05b26d7838de6425dbc5c5))
|
||||
* 修复timer_settime只设置第一次到期时间时,到期时间不准的缺陷 ([a5f4e37](https://gitee.com/openharmony/kernel_liteos_m/commits/a5f4e37e535bff39a333c469e2f1bf1817216fe8)), closes [#I3TCHA](https://gitee.com/openharmony/kernel_liteos_m/issues/I3TCHA)
|
||||
* 修复timer_settime只设置第一次到期时间时,到期时间不准的缺陷 ([e4b5d4e](https://gitee.com/openharmony/kernel_liteos_m/commits/e4b5d4ebe9677d49d490fe74e5ac33c4a29435a2)), closes [#I3TCHA](https://gitee.com/openharmony/kernel_liteos_m/issues/I3TCHA)
|
||||
* 修复不规范的copyright ([2d9bbd2](https://gitee.com/openharmony/kernel_liteos_m/commits/2d9bbd2769e71e7b464bd22fc335999dd8000682)), closes [#I3SPJ1](https://gitee.com/openharmony/kernel_liteos_m/issues/I3SPJ1)
|
||||
* 修复中断操作接口头文件位置变更,导致的编译错误 ([013a953](https://gitee.com/openharmony/kernel_liteos_m/commits/013a953926ca7cefd8a2f7c74d23c36c49765b59)), closes [#I4665Z](https://gitee.com/openharmony/kernel_liteos_m/issues/I4665Z)
|
||||
* 修复文档链接失效问题 ([5d53c84](https://gitee.com/openharmony/kernel_liteos_m/commits/5d53c848124319a95f509b56ba001357c6dd8b05)), closes [#I4529I](https://gitee.com/openharmony/kernel_liteos_m/issues/I4529I)
|
||||
* 内核模块编译增加-Werror编译选项,且清除内核编译告警 ([3798091](https://gitee.com/openharmony/kernel_liteos_m/commits/3798091d87441ea445ec642de57e036dbbc8370e)), closes [#I46E6S](https://gitee.com/openharmony/kernel_liteos_m/issues/I46E6S)
|
||||
* 删除MQ内冗余的重复宏定义 ([6d72916](https://gitee.com/openharmony/kernel_liteos_m/commits/6d7291660ad04682f05850876f81dfd0cba8ea6b)), closes [#I3U5QQ](https://gitee.com/openharmony/kernel_liteos_m/issues/I3U5QQ)
|
||||
* 删除延时节点后,存在时间无法有效刷新的场景 ([0a87c04](https://gitee.com/openharmony/kernel_liteos_m/commits/0a87c04d58d11da2082470698de0760d72259533)), closes [#I45I9Y](https://gitee.com/openharmony/kernel_liteos_m/issues/I45I9Y)
|
||||
* 在内核初始化前期启动tick timer ([b3841ed](https://gitee.com/openharmony/kernel_liteos_m/commits/b3841ed1ddbfb3359c7a0ceca04fc0f645d440c3)), closes [#I410F0](https://gitee.com/openharmony/kernel_liteos_m/issues/I410F0)
|
||||
* 增加MPU功能的开关宏,默认关闭 ([9709d29](https://gitee.com/openharmony/kernel_liteos_m/commits/9709d29b87a3888412ffda586e16eba86adccfe7)), closes [#I3WE0S](https://gitee.com/openharmony/kernel_liteos_m/issues/I3WE0S)
|
||||
* 宏LOSCFG_SUPPORT_FATFS在fs.c中存在使用问题,导致无fatfs的情况下,编译出错 ([c1614ce](https://gitee.com/openharmony/kernel_liteos_m/commits/c1614ce2b4d4dfcda9532cbeeff25ad7a6558196)), closes [#I44XNR](https://gitee.com/openharmony/kernel_liteos_m/issues/I44XNR)
|
||||
* 延时队列为NULL时,返回的响应时间为64位最大值,导致无法更新tick timer的响应周期 ([bcec32e](https://gitee.com/openharmony/kernel_liteos_m/commits/bcec32e389634097102a203ee7e937ed3193c984)), closes [#I3W1LF](https://gitee.com/openharmony/kernel_liteos_m/issues/I3W1LF)
|
||||
* 支持smoke 测试用例 ([3ad5942](https://gitee.com/openharmony/kernel_liteos_m/commits/3ad5942301a1094a2c6b6ffee280cf09cfdb2a88)), closes [#I424RX](https://gitee.com/openharmony/kernel_liteos_m/issues/I424RX)
|
||||
* 新增函数regcomp,regfree和regexec支持 ([86d5544](https://gitee.com/openharmony/kernel_liteos_m/commits/86d5544a3fd5f41f7f2abe3b143e9f1dc9b430f8)), closes [#I3U9LE](https://gitee.com/openharmony/kernel_liteos_m/issues/I3U9LE)
|
||||
* 清理残留无效的trace代码 ([3c48951](https://gitee.com/openharmony/kernel_liteos_m/commits/3c489518576583ab6bf0d581810ef0a02b6ccd51)), closes [#I3ZMB4](https://gitee.com/openharmony/kernel_liteos_m/issues/I3ZMB4)
|
||||
* 解决arm9编译冲突问题 ([c1a6245](https://gitee.com/openharmony/kernel_liteos_m/commits/c1a624536887fef44fed37134638bf40191b9aae)), closes [#I420PQ](https://gitee.com/openharmony/kernel_liteos_m/issues/I420PQ)
|
||||
* 调度过程低概率触发OsSchedTaskEnQueue断言,导致系统异常 ([e5e9289](https://gitee.com/openharmony/kernel_liteos_m/commits/e5e9289a08cf1db71c09647b71a864f5a1f8a4a2)), closes [#I3VX9Y](https://gitee.com/openharmony/kernel_liteos_m/issues/I3VX9Y)
|
||||
* 调整hook类型和位置,方便调试 ([369320d](https://gitee.com/openharmony/kernel_liteos_m/commits/369320de3710486f252c55c522e8c06e19541b77)), closes [#I3TGZS](https://gitee.com/openharmony/kernel_liteos_m/issues/I3TGZS)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* add cmsis ThreadFlags support ([cea551e](https://gitee.com/openharmony/kernel_liteos_m/commits/cea551e99ea0da8eefbaa826de2f68813252fb83))
|
||||
* add deps to musl and securec ([bfa25fc](https://gitee.com/openharmony/kernel_liteos_m/commits/bfa25fcaa355c28a6139f683c4453f677e23abd7))
|
||||
* add file type support for LfsStat ([ceaed2d](https://gitee.com/openharmony/kernel_liteos_m/commits/ceaed2dc86de2ed242aab4dd02c1f34e064583b3)), closes [#I3ZCDR](https://gitee.com/openharmony/kernel_liteos_m/issues/I3ZCDR)
|
||||
* add interface of dhcp_is_bound ([84a180d](https://gitee.com/openharmony/kernel_liteos_m/commits/84a180d585686cda693bf8c6ed6b86f7c5dd5eee)), closes [#I46W08](https://gitee.com/openharmony/kernel_liteos_m/issues/I46W08)
|
||||
* add L0 shell function ([97283b7](https://gitee.com/openharmony/kernel_liteos_m/commits/97283b7c5dd44b266e94fcf0f5d21e63ee1ec7e0))
|
||||
* add LOS_ListHeadInsert function ([430b186](https://gitee.com/openharmony/kernel_liteos_m/commits/430b186be7ec1554a29a6d509188eb877d796a7e)), closes [#I3TAQA](https://gitee.com/openharmony/kernel_liteos_m/issues/I3TAQA)
|
||||
* **kernel:** 补充获取最高、最低优先级接口 ([c24c38b](https://gitee.com/openharmony/kernel_liteos_m/commits/c24c38b084c13a2cdc5616f88bb5f63153600c28)), closes [#I42HM7](https://gitee.com/openharmony/kernel_liteos_m/issues/I42HM7)
|
||||
* L0 armquem 剥离工具链 ([67d7455](https://gitee.com/openharmony/kernel_liteos_m/commits/67d74559d1bb3820bd51da2e2bf43e41e1224314))
|
||||
* L0 支持Trace ([56c93a6](https://gitee.com/openharmony/kernel_liteos_m/commits/56c93a641b3c7a3d1ef9293ee3c95cccb559191f)), closes [#I41Y9Y](https://gitee.com/openharmony/kernel_liteos_m/issues/I41Y9Y)
|
||||
* L0 支持低功耗框架 ([558ce14](https://gitee.com/openharmony/kernel_liteos_m/commits/558ce14becab05102497afca90a43d89abaf5531)), closes [#I3UDNV](https://gitee.com/openharmony/kernel_liteos_m/issues/I3UDNV)
|
||||
* L0 测试用例支持risc-v qemu 编译运行 ([2dd6c08](https://gitee.com/openharmony/kernel_liteos_m/commits/2dd6c080daab52eaf61e5eefe7b581190670e8a7)), closes [#I3YILG](https://gitee.com/openharmony/kernel_liteos_m/issues/I3YILG)
|
||||
* **liteos_m:** support backtrace for riscv ([ca1792a](https://gitee.com/openharmony/kernel_liteos_m/commits/ca1792aa4b5a85ca4ea6e41b265858c6b24a6897)), closes [#I3RVXY](https://gitee.com/openharmony/kernel_liteos_m/issues/I3RVXY)
|
||||
* los_memory.c代码重复率处理 ([475db62](https://gitee.com/openharmony/kernel_liteos_m/commits/475db62db1ac285fc6cab91f09af618870269580)), closes [#I44WNU](https://gitee.com/openharmony/kernel_liteos_m/issues/I44WNU)
|
||||
* M33平台支持GCC环境的Trustzone ([d469da2](https://gitee.com/openharmony/kernel_liteos_m/commits/d469da29c6d316640eaa7865f98ad8d6e2eb6d44)), closes [#I3Y85I](https://gitee.com/openharmony/kernel_liteos_m/issues/I3Y85I)
|
||||
* provide getifaddrs for liteos_m ([948501a](https://gitee.com/openharmony/kernel_liteos_m/commits/948501ac73e7887f4585eca156ad760acc2a3b1f)), closes [#I400S5](https://gitee.com/openharmony/kernel_liteos_m/issues/I400S5)
|
||||
* risc-v gn 编译框架添加汇编编译选项 ([76dc343](https://gitee.com/openharmony/kernel_liteos_m/commits/76dc343c888ec4e65eba43feb49921111b144640)), closes [#I3YS5Y](https://gitee.com/openharmony/kernel_liteos_m/issues/I3YS5Y)
|
||||
* Support arm9 ([6d7c9df](https://gitee.com/openharmony/kernel_liteos_m/commits/6d7c9dfe597affb260e8bd74fa606b6d68c2b49a)), closes [#I3WLCN](https://gitee.com/openharmony/kernel_liteos_m/issues/I3WLCN)
|
||||
* Support arm9 fiq swi mode and using system mode. ([97b5b08](https://gitee.com/openharmony/kernel_liteos_m/commits/97b5b0837be4b8df1381af29a6f650f243322840)), closes [#I3WLCN](https://gitee.com/openharmony/kernel_liteos_m/issues/I3WLCN)
|
||||
* support non-continuous memory regions ([0facb0c](https://gitee.com/openharmony/kernel_liteos_m/commits/0facb0c0179f29a08b037655bbe691c98384dc84)), closes [#I43XOP](https://gitee.com/openharmony/kernel_liteos_m/issues/I43XOP)
|
||||
* 完善m核qemu串口驱动,支持shell输入 ([c4dc5ab](https://gitee.com/openharmony/kernel_liteos_m/commits/c4dc5ab0f8b5caae55efdbedf59ab07f5006f6c2)), closes [#I46N7F](https://gitee.com/openharmony/kernel_liteos_m/issues/I46N7F)
|
||||
* 按任务统计已经alloc的内存大小 ([53117f9](https://gitee.com/openharmony/kernel_liteos_m/commits/53117f9f47a8dd3023e83dc0cc0de224eab9719f)), closes [#I44WNU](https://gitee.com/openharmony/kernel_liteos_m/issues/I44WNU)
|
||||
* 支持native动态加载组件 ([d753834](https://gitee.com/openharmony/kernel_liteos_m/commits/d75383400efe5d9ca0ae4093e4f2e65fee03024b)), closes [#I418HJ](https://gitee.com/openharmony/kernel_liteos_m/issues/I418HJ)
|
||||
* 新增LOSCFG_BASE_CORE_TSK_SWITCH_HOOK 宏定义配置 ([39efd6f](https://gitee.com/openharmony/kernel_liteos_m/commits/39efd6fb30ee7dc9159811f5d37dffcdfe81bae0)), closes [#I40Q9O](https://gitee.com/openharmony/kernel_liteos_m/issues/I40Q9O)
|
||||
* 新增ROM/RAM分析工具 ([ee3403d](https://gitee.com/openharmony/kernel_liteos_m/commits/ee3403deaf24dc612b51354f31f795fb0b9a49b5))
|
||||
* 补充fs相关函数用例 ([2a95af5](https://gitee.com/openharmony/kernel_liteos_m/commits/2a95af5bf1b412de27b4518d0abf7c335366d4d7)), closes [#I3UQ4F](https://gitee.com/openharmony/kernel_liteos_m/issues/I3UQ4F)
|
||||
* 解决fclose等函数工具链重定义问题 ([b244ad4](https://gitee.com/openharmony/kernel_liteos_m/commits/b244ad4ad0da8d151b69071fdd6db808c91f85a5)), closes [#I3UG6O](https://gitee.com/openharmony/kernel_liteos_m/issues/I3UG6O)
|
||||
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
* 新增4个对外接口,声明在los_dynlink.h文件中,分别为:
|
||||
(1) LOS_DynlinkInit: 动态加载模块初始化。
|
||||
(2) LOS_SoLoad: 加载指定路径的共享库。
|
||||
(3) LOS_FindSym: 根据共享库句柄查找指定符号。
|
||||
(4) LOS_SoUnload: 卸载共享库。
|
||||
* 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注册过滤特定中断号事件的钩子函数
|
||||
* 1.原调度中基于tick timer的低功耗扩展和当前的pm模块合并,删除原对外接口LOS_SchedSleepInit,
|
||||
变为pm模块统一提供的LOS_PmRegistered接口.
|
||||
2.原来在arch los_timer.h下提供的低功耗模式为枚举LOS_SysSleepEnum,其中OS_SYS_NORMAL_SLEEP
|
||||
和OS_SYS_DEEP_SLEEP不符合对外定义,统一修改为LOS_SYS_NORMAL_SLEEP和LOS_SYS_DEEP_SLEEP,
|
||||
并移至los_pm.h中.
|
||||
3.VOID HalEnterSleep(LOS_SysSleepEnum sleep) 变更为UINT32 HalEnterSleep(VOID).
|
||||
|
||||
|
||||
|
||||
18
Kconfig
18
Kconfig
@@ -335,6 +335,14 @@ config KERNEL_PM
|
||||
Configuration item for low power frame tailoring.
|
||||
If you wish to build LiteOS with support for power management.
|
||||
|
||||
config KERNEL_PM_IDLE
|
||||
bool "Enable Power Management Idle"
|
||||
default n
|
||||
depends on KERNEL_PM
|
||||
help
|
||||
Configuration item for low power frame tailoring.
|
||||
If you wish to build LiteOS with support for power management idle.
|
||||
|
||||
config KERNEL_PM_TASK_PTIORITY
|
||||
int "Power Management Task Priority"
|
||||
default 1
|
||||
@@ -513,6 +521,14 @@ config DEBUG_QUEUE
|
||||
help
|
||||
Answer Y to enable debug queue.
|
||||
|
||||
config MUTEX_CREATE_TRACE
|
||||
bool "Enable Mutex Trace Debugging"
|
||||
default n
|
||||
depends on ARCH_ARM
|
||||
depends on DEBUG_KERNEL
|
||||
help
|
||||
Answer Y to enable debug mutex trace.
|
||||
|
||||
config DEBUG_DEADLOCK
|
||||
bool "Enable Mutex Deadlock Debugging"
|
||||
default n
|
||||
@@ -601,7 +617,7 @@ config VM_OVERLAP_CHECK
|
||||
depends on DEBUG_VERSION && MEM_DEBUG
|
||||
help
|
||||
Answer Y to enable vm overlap check.
|
||||
|
||||
|
||||
config TASK_MEM_USED
|
||||
bool "Enable show task mem used or not"
|
||||
default n
|
||||
|
||||
10
README.md
10
README.md
@@ -78,7 +78,7 @@ The OpenHarmony LiteOS-M kernel build system is a modular build system based on
|
||||
|
||||
### Setting Up the Environment
|
||||
|
||||
Before setting up the environment for a development board, you must set up the basic system environment for OpenHarmony first. The basic system environment includes the OpenHarmony build environment and development environment. For details, see [Setting Up Development Environment](https://gitee.com/openharmony/docs/blob/HEAD/en/device-dev/quick-start/quickstart-lite-env-setup.md).
|
||||
Before setting up the environment for a development board, you must set up the basic system environment for OpenHarmony first. The basic system environment includes the OpenHarmony build environment and development environment. For details, see [Setting Up Development Environment](https://gitee.com/openharmony/docs/blob/master/en/device-dev/quick-start/Readme-EN.md).
|
||||
|
||||
### Obtaining the OpenHarmony Source Code
|
||||
|
||||
@@ -108,7 +108,7 @@ The LiteOS-M kernel porting projects for specific development boards are provide
|
||||
|
||||
## Contribution<a name="section1371123476307"></a>
|
||||
|
||||
[How to involve](https://gitee.com/openharmony/docs/blob/HEAD/en/contribute/contribution.md)
|
||||
[How to involve](https://gitee.com/openharmony/docs/blob/master/en/contribute/how-to-contribute.md)
|
||||
|
||||
[Commit message spec](https://gitee.com/openharmony/kernel_liteos_m/wikis/Commit%20message%E8%A7%84%E8%8C%83)
|
||||
|
||||
@@ -116,12 +116,10 @@ The LiteOS-M kernel porting projects for specific development boards are provide
|
||||
|
||||
How to contribute a chip based on Liteos-M kernel:
|
||||
|
||||
[ Board-Level Directory Specifications](https://gitee.com/openharmony/docs/blob/HEAD/en/device-dev/porting/porting-chip-board-overview.md)
|
||||
|
||||
[Mini System SoC Porting Guide](https://gitee.com/openharmony/docs/blob/HEAD/en/device-dev/porting/porting-minichip.md)
|
||||
[Mini System SoC Porting Guide](https://gitee.com/openharmony/docs/blob/master/en/device-dev/porting/Readme-EN.md)
|
||||
|
||||
## Repositories Involved<a name="section1371113476307"></a>
|
||||
|
||||
[Kernel Subsystem](https://gitee.com/openharmony/docs/blob/HEAD/en/readme/kernel-subsystem.md)
|
||||
[Kernel Subsystem](https://gitee.com/openharmony/docs/blob/master/en/readme/kernel.md)
|
||||
|
||||
[kernel\_liteos\_m](https://gitee.com/openharmony/kernel_liteos_m/blob/master/README.md)
|
||||
|
||||
10
README_zh.md
10
README_zh.md
@@ -11,7 +11,7 @@
|
||||
|
||||
OpenHarmony LiteOS-M内核是面向IoT领域构建的轻量级物联网操作系统内核,具有小体积、低功耗、高性能的特点,其代码结构简单,主要包括内核最小功能集、内核抽象层、可选组件以及工程目录等,分为硬件相关层以及硬件无关层,硬件相关层提供统一的HAL(Hardware Abstraction Layer)接口,提升硬件易适配性,不同编译工具链和芯片架构的组合分类,满足AIoT类型丰富的硬件和编译工具链的拓展。其架构图如图1所示:
|
||||
|
||||
**图 1** OpenHarmony LiteOS-M核内核架构图<a name="fig0865152210223"></a>
|
||||
**图 1** OpenHarmony LiteOS-M核内核架构图<a name="fig0865152210223"></a>
|
||||

|
||||
|
||||
## 目录<a name="section161941989596"></a>
|
||||
@@ -77,7 +77,7 @@ LiteOS-M内核的编译构建系统是一个基于gn和ninja的组件化构建
|
||||
|
||||
### 搭建系统基础环境
|
||||
|
||||
在搭建各个开发板环境前,需要完成OpenHarmony系统基础环境搭建。系统基础环境主要是指OpenHarmony的编译环境和开发环境,详细介绍请参考官方站点[开发环境准备](https://gitee.com/openharmony/docs/blob/HEAD/zh-cn/device-dev/quick-start/quickstart-lite-env-setup.md)。开发者需要根据环境搭建文档完成环境搭建。
|
||||
在搭建各个开发板环境前,需要完成OpenHarmony系统基础环境搭建。系统基础环境主要是指OpenHarmony的编译环境和开发环境,详细介绍请参考官方站点[开发环境准备](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/Readme-CN.md)。开发者需要根据环境搭建文档完成环境搭建。
|
||||
|
||||
### 获取OpenHarmony源码
|
||||
|
||||
@@ -115,11 +115,7 @@ LiteOS-M内核移植的具体开发板的工程由社区开发者提供,可以
|
||||
|
||||
如何基于Liteos-M内核贡献一款芯片:
|
||||
|
||||
[板级目录规范](https://gitee.com/openharmony/docs/blob/HEAD/zh-cn/device-dev/porting/porting-chip-board-overview.md)
|
||||
|
||||
[轻量系统芯片移植指导](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/porting/porting-minichip.md)
|
||||
|
||||
[轻量系统芯片移植案例](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/porting/porting-minichip-cases.md)
|
||||
[轻量系统芯片移植指导](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/porting/Readme-CN.md)
|
||||
|
||||
## 相关仓<a name="section1371113476307"></a>
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ LITE_OS_SEC_TEXT_INIT VOID ArchInit(VOID)
|
||||
**************************************************************************** */
|
||||
LITE_OS_SEC_TEXT_MINOR VOID ArchSysExit(VOID)
|
||||
{
|
||||
LOS_IntLock();
|
||||
(VOID)LOS_IntLock();
|
||||
while (1) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ LITE_OS_SEC_TEXT_INIT VOID ArchInit(VOID)
|
||||
**************************************************************************** */
|
||||
LITE_OS_SEC_TEXT_MINOR VOID ArchSysExit(VOID)
|
||||
{
|
||||
LOS_IntLock();
|
||||
(VOID)LOS_IntLock();
|
||||
while (1) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ LITE_OS_SEC_TEXT_INIT VOID ArchInit(VOID)
|
||||
**************************************************************************** */
|
||||
LITE_OS_SEC_TEXT_MINOR VOID ArchSysExit(VOID)
|
||||
{
|
||||
LOS_IntLock();
|
||||
(VOID)LOS_IntLock();
|
||||
while (1) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ LITE_OS_SEC_TEXT_INIT VOID ArchInit(VOID)
|
||||
**************************************************************************** */
|
||||
LITE_OS_SEC_TEXT_MINOR VOID ArchSysExit(VOID)
|
||||
{
|
||||
LOS_IntLock();
|
||||
(VOID)LOS_IntLock();
|
||||
while (1) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -91,7 +91,7 @@ STATIC UINT64 SysTickReload(UINT64 nextResponseTime)
|
||||
|
||||
STATIC UINT64 SysTickCycleGet(UINT32 *period)
|
||||
{
|
||||
UINT32 hwCycle = 0;
|
||||
UINT32 hwCycle = 0;
|
||||
UINT32 intSave = LOS_IntLock();
|
||||
UINT32 val = SysTick->VAL;
|
||||
*period = SysTick->LOAD;
|
||||
|
||||
@@ -51,6 +51,7 @@ VOID HalSecureSVCHandler(UINT32 svcID, UINTPTR arg)
|
||||
HalSecureContextLoad(g_secureContext);
|
||||
break;
|
||||
case OS_SVC_FREE_SECURE_CONTEXT:
|
||||
LOS_ASSERT(g_secureContext != NULL);
|
||||
HalSecureContextFree(g_secureContext);
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -59,7 +59,7 @@ LITE_OS_SEC_TEXT_INIT VOID ArchInit(VOID)
|
||||
**************************************************************************** */
|
||||
LITE_OS_SEC_TEXT_MINOR VOID ArchSysExit(VOID)
|
||||
{
|
||||
LOS_IntLock();
|
||||
(VOID)LOS_IntLock();
|
||||
while (1) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ LITE_OS_SEC_TEXT_INIT VOID ArchInit(VOID)
|
||||
**************************************************************************** */
|
||||
LITE_OS_SEC_TEXT_MINOR VOID ArchSysExit(VOID)
|
||||
{
|
||||
LOS_IntLock();
|
||||
(VOID)LOS_IntLock();
|
||||
while (1) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,6 +51,7 @@ VOID HalSecureSVCHandler(UINT32 svcID, UINTPTR arg)
|
||||
HalSecureContextLoad(g_secureContext);
|
||||
break;
|
||||
case OS_SVC_FREE_SECURE_CONTEXT:
|
||||
LOS_ASSERT(g_secureContext != NULL);
|
||||
HalSecureContextFree(g_secureContext);
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -58,7 +58,7 @@ LITE_OS_SEC_TEXT_INIT VOID ArchInit(VOID)
|
||||
**************************************************************************** */
|
||||
LITE_OS_SEC_TEXT_MINOR VOID ArchSysExit(VOID)
|
||||
{
|
||||
LOS_IntLock();
|
||||
(VOID)LOS_IntLock();
|
||||
while (1) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
||||
# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
||||
# Copyright (c) 2020-2022 Huawei Device Co., Ltd. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without modification,
|
||||
# are permitted provided that the following conditions are met:
|
||||
@@ -27,13 +27,21 @@
|
||||
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
if LIBC_MUSL
|
||||
import("//kernel/liteos_m/liteos.gni")
|
||||
|
||||
config LIBC_MUSL_FS
|
||||
bool "Enable POSIX file system API support"
|
||||
default y
|
||||
depends on FS_VFS
|
||||
help
|
||||
This enables POSIX style file system related APIs.
|
||||
module_name = "arch"
|
||||
kernel_module(module_name) {
|
||||
sources = [
|
||||
"los_context.c",
|
||||
"los_dispatch.S",
|
||||
"los_exc.S",
|
||||
"los_interrupt.c",
|
||||
"los_mpu.c",
|
||||
"los_timer.c",
|
||||
]
|
||||
configs += [ "$LITEOSTOPDIR:warn_config" ]
|
||||
}
|
||||
|
||||
endif # LIBC_MUSL
|
||||
config("public") {
|
||||
include_dirs = [ "." ]
|
||||
}
|
||||
@@ -61,7 +61,7 @@ LITE_OS_SEC_TEXT_INIT VOID ArchInit(VOID)
|
||||
**************************************************************************** */
|
||||
LITE_OS_SEC_TEXT_MINOR VOID ArchSysExit(VOID)
|
||||
{
|
||||
LOS_IntLock();
|
||||
(VOID)LOS_IntLock();
|
||||
while (1) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ LITE_OS_SEC_TEXT_INIT VOID ArchInit(VOID)
|
||||
**************************************************************************** */
|
||||
LITE_OS_SEC_TEXT_MINOR VOID ArchSysExit(VOID)
|
||||
{
|
||||
LOS_IntLock();
|
||||
(VOID)LOS_IntLock();
|
||||
while (1) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ LITE_OS_SEC_TEXT_INIT VOID ArchInit(VOID)
|
||||
**************************************************************************** */
|
||||
LITE_OS_SEC_TEXT_MINOR VOID ArchSysExit(VOID)
|
||||
{
|
||||
LOS_IntLock();
|
||||
(VOID)LOS_IntLock();
|
||||
while (1) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -91,7 +91,7 @@ STATIC UINT64 SysTickReload(UINT64 nextResponseTime)
|
||||
|
||||
STATIC UINT64 SysTickCycleGet(UINT32 *period)
|
||||
{
|
||||
UINT32 hwCycle = 0;
|
||||
UINT32 hwCycle = 0;
|
||||
UINT32 intSave = LOS_IntLock();
|
||||
UINT32 val = SysTick->VAL;
|
||||
*period = SysTick->LOAD;
|
||||
|
||||
@@ -51,6 +51,7 @@ VOID HalSecureSVCHandler(UINT32 svcID, UINTPTR arg)
|
||||
HalSecureContextLoad(g_secureContext);
|
||||
break;
|
||||
case OS_SVC_FREE_SECURE_CONTEXT:
|
||||
LOS_ASSERT(g_secureContext != NULL);
|
||||
HalSecureContextFree(g_secureContext);
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -59,7 +59,7 @@ LITE_OS_SEC_TEXT_INIT VOID ArchInit(VOID)
|
||||
**************************************************************************** */
|
||||
LITE_OS_SEC_TEXT_MINOR VOID ArchSysExit(VOID)
|
||||
{
|
||||
LOS_IntLock();
|
||||
(VOID)LOS_IntLock();
|
||||
while (1) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ LITE_OS_SEC_TEXT_INIT VOID ArchInit(VOID)
|
||||
**************************************************************************** */
|
||||
LITE_OS_SEC_TEXT_MINOR VOID ArchSysExit(VOID)
|
||||
{
|
||||
LOS_IntLock();
|
||||
(VOID)LOS_IntLock();
|
||||
while (1) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,6 +51,7 @@ VOID HalSecureSVCHandler(UINT32 svcID, UINTPTR arg)
|
||||
HalSecureContextLoad(g_secureContext);
|
||||
break;
|
||||
case OS_SVC_FREE_SECURE_CONTEXT:
|
||||
LOS_ASSERT(g_secureContext != NULL);
|
||||
HalSecureContextFree(g_secureContext);
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -59,7 +59,7 @@ LITE_OS_SEC_TEXT_INIT VOID ArchInit(VOID)
|
||||
**************************************************************************** */
|
||||
LITE_OS_SEC_TEXT_MINOR VOID ArchSysExit(VOID)
|
||||
{
|
||||
LOS_IntLock();
|
||||
(VOID)LOS_IntLock();
|
||||
while (1) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ LITE_OS_SEC_TEXT_INIT VOID ArchInit(VOID)
|
||||
**************************************************************************** */
|
||||
LITE_OS_SEC_TEXT_MINOR VOID ArchSysExit(VOID)
|
||||
{
|
||||
LOS_IntLock();
|
||||
(VOID)LOS_IntLock();
|
||||
while (1) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ LITE_OS_SEC_TEXT_INIT VOID ArchInit(VOID)
|
||||
**************************************************************************** */
|
||||
LITE_OS_SEC_TEXT_MINOR VOID ArchSysExit(VOID)
|
||||
{
|
||||
LOS_IntLock();
|
||||
(VOID)LOS_IntLock();
|
||||
while (1) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -612,7 +612,7 @@ LITE_OS_SEC_TEXT_INIT VOID HalHwiInit(VOID)
|
||||
HalHwiHandleReInit((UINT32)&g_hwiForm);
|
||||
|
||||
HalSetVbr((UINT32)&g_hwiForm);
|
||||
for (int i = 0; i < BYTES_OF_128_INT; i++) {
|
||||
for (i = 0; i < BYTES_OF_128_INT; i++) {
|
||||
VIC_REG->IABR[i] = 0x0;
|
||||
VIC_REG->ICPR[i] = MASK_32_BITS;
|
||||
}
|
||||
|
||||
@@ -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-2023 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,6 +62,14 @@ STATIC INLINE UINTPTR ArchMspGet(VOID)
|
||||
__asm("mrs %0, msp" : "=r" (msp));
|
||||
return msp;
|
||||
}
|
||||
|
||||
#define ARCH_LR_GET() \
|
||||
({ \
|
||||
UINTPTR lr; \
|
||||
__asm("mov %0, lr" : "=r" (lr)); \
|
||||
(lr); \
|
||||
})
|
||||
#define ArchLRGet ARCH_LR_GET
|
||||
#elif defined(__CLANG_ARM) || defined(__GNUC__)
|
||||
STATIC INLINE UINTPTR ArchSpGet(VOID)
|
||||
{
|
||||
@@ -83,6 +91,14 @@ STATIC INLINE UINTPTR ArchMspGet(VOID)
|
||||
__asm volatile("mrs %0, msp" : "=r" (msp));
|
||||
return msp;
|
||||
}
|
||||
|
||||
#define ARCH_LR_GET() \
|
||||
({ \
|
||||
UINTPTR lr; \
|
||||
__asm volatile("mov %0, lr" : "=r" (lr)); \
|
||||
(lr); \
|
||||
})
|
||||
#define ArchLRGet ARCH_LR_GET
|
||||
#else
|
||||
/* Other platforms to be improved */
|
||||
#endif
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright (c) 2013-2020, 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:
|
||||
@@ -63,6 +63,9 @@
|
||||
#define RISCV_MIE_MEIE 0x000000800
|
||||
|
||||
/************************** mcause ***********************/
|
||||
#ifndef MCAUSE_INT_ID_MASK
|
||||
#define MCAUSE_INT_ID_MASK 0x7FFFFFF
|
||||
#endif
|
||||
#define RISCV_MCAUSE_ECALL_U 8
|
||||
|
||||
#define RISCV_USER_SOFT_IRQ 0
|
||||
@@ -72,7 +75,6 @@
|
||||
#define RISCV_USER_EXT_IRQ 8
|
||||
#define RISCV_MACH_EXT_IRQ 11
|
||||
|
||||
|
||||
#define READ_CSR(reg) ({ \
|
||||
UINT32 _tmp; \
|
||||
__asm__ volatile("csrr %0, " #reg : "=r"(_tmp) : : "memory"); \
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright (c) 2013-2020, Huawei Technologies Co., Ltd. All rights reserved.
|
||||
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
||||
* Copyright (c) 2020-2023 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:
|
||||
@@ -43,6 +43,10 @@ extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#if (LOSCFG_PLATFORM_HWI_WITH_ARG == 0)
|
||||
#error "LOSCFG_PLATFORM_HWI_WITH_ARG must be set to 1 !!!"
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @ingroup los_arch_interrupt
|
||||
* Define the type of a hardware interrupt vector table function.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright (c) 2013-2020, 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:
|
||||
@@ -35,7 +35,7 @@
|
||||
#include "los_task.h"
|
||||
#include "los_sched.h"
|
||||
#include "los_memory.h"
|
||||
#include "soc.h"
|
||||
#include "soc_common.h"
|
||||
|
||||
STATIC UINT32 g_sysNeedSched = FALSE;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright (c) 2013-2020, Huawei Technologies Co., Ltd. All rights reserved.
|
||||
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
||||
* Copyright (c) 2020-2022 Huawei Device Co., Ltd. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
@@ -29,7 +29,7 @@
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "soc.h"
|
||||
#include "soc_common.h"
|
||||
|
||||
.global HalEnableIRQ
|
||||
.global HalDisableIRQ
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright (c) 2013-2020, 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:
|
||||
@@ -31,7 +31,7 @@
|
||||
|
||||
#ifndef _LOS_EXC_S
|
||||
#define _LOS_EXC_S
|
||||
#include "soc.h"
|
||||
#include "soc_common.h"
|
||||
|
||||
.macro PUSH_CALLER_REG
|
||||
addi sp, sp, -(32 * REGBYTES)
|
||||
@@ -139,8 +139,7 @@ HalTrapEntry:
|
||||
sw a0, 0 * REGBYTES(sp)
|
||||
csrr t0, mtval
|
||||
sw t0, 1 * REGBYTES(sp)
|
||||
csrr t0, medeleg
|
||||
sw t0, 2 * REGBYTES(sp)
|
||||
sw zero, 2 * REGBYTES(sp)
|
||||
sw gp, 3 * REGBYTES(sp)
|
||||
mv a0, sp
|
||||
csrw mscratch, sp
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright (c) 2013-2020, Huawei Technologies Co., Ltd. All rights reserved.
|
||||
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
||||
* Copyright (c) 2020-2023 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:
|
||||
@@ -167,6 +167,7 @@ LITE_OS_SEC_TEXT UINT32 ArchHwiCreate(HWI_HANDLE_T hwiNum,
|
||||
HWI_PROC_FUNC hwiHandler,
|
||||
HwiIrqParam *irqParam)
|
||||
{
|
||||
(VOID)hwiMode;
|
||||
UINT32 intSave;
|
||||
|
||||
if (hwiHandler == NULL) {
|
||||
@@ -283,7 +284,7 @@ STATIC VOID ExcInfoDisplayContext(const LosExcInfo *exc)
|
||||
ExcBackTrace(taskContext->s0);
|
||||
}
|
||||
|
||||
STATIC VOID ExcInfoDisplay(const LosExcContext *excBufAddr)
|
||||
STATIC VOID ExcInfoDisplay(VOID)
|
||||
{
|
||||
PRINTK("\nException Information \n");
|
||||
|
||||
@@ -305,6 +306,11 @@ STATIC VOID ExcInfoDisplay(const LosExcContext *excBufAddr)
|
||||
|
||||
WEAK UINT32 HalUnalignedAccessFix(UINTPTR mcause, UINTPTR mepc, UINTPTR mtval, VOID *sp)
|
||||
{
|
||||
(VOID)mcause;
|
||||
(VOID)mepc;
|
||||
(VOID)mtval;
|
||||
(VOID)sp;
|
||||
|
||||
/* Unaligned access fixes are not supported by default */
|
||||
PRINTK("Unaligned access fixes are not supported by default!\n");
|
||||
return LOS_NOK;
|
||||
@@ -329,7 +335,7 @@ VOID HalExcEntry(const LosExcContext *excBufAddr)
|
||||
}
|
||||
}
|
||||
|
||||
ExcInfoDisplay(excBufAddr);
|
||||
ExcInfoDisplay();
|
||||
|
||||
if (LOS_TaskIsRunning()) {
|
||||
PRINTK("----------------All Task information ------------\n");
|
||||
|
||||
@@ -103,7 +103,7 @@ LITE_OS_SEC_TEXT_INIT VOID ArchInit(VOID)
|
||||
|
||||
LITE_OS_SEC_TEXT_MINOR VOID ArchSysExit(VOID)
|
||||
{
|
||||
LOS_IntLock();
|
||||
(VOID)LOS_IntLock();
|
||||
while (1) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
judgment condition to support multiple code sections. */
|
||||
WEAK BOOL OsStackDataIsCodeAddr(UINTPTR value)
|
||||
{
|
||||
if ((value >= CODE_START_ADDR) && (value < CODE_END_ADDR)) {
|
||||
if ((value > CODE_START_ADDR) && (value < CODE_END_ADDR)) {
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
|
||||
@@ -58,6 +58,9 @@
|
||||
|
||||
#define OS_CPUP_RECORD_PERIOD (g_sysClock)
|
||||
|
||||
#define OS_SYS_CYCLE_TO_US(cycle) ((cycle) / (g_sysClock)) * OS_SYS_US_PER_SECOND + \
|
||||
((cycle) % (g_sysClock) * OS_SYS_US_PER_SECOND / (g_sysClock))
|
||||
|
||||
LITE_OS_SEC_BSS UINT16 g_cpupInitFlg = 0;
|
||||
LITE_OS_SEC_BSS OsCpupCB *g_cpup = NULL;
|
||||
LITE_OS_SEC_BSS UINT64 g_lastRecordTime;
|
||||
@@ -167,6 +170,15 @@ LITE_OS_SEC_TEXT_INIT UINT32 OsCpupInit()
|
||||
return LOS_OK;
|
||||
}
|
||||
|
||||
/* The calculation time unit is changed to us to decouple the influence of
|
||||
* system frequency modulation on CPUP
|
||||
*/
|
||||
STATIC UINT64 CpupTimeUsGet(VOID)
|
||||
{
|
||||
UINT64 time = LOS_SysCycleGet();
|
||||
return OS_SYS_CYCLE_TO_US(time);
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
Function : OsTskCycleStart
|
||||
Description: start task to get cycles count in current task beginning
|
||||
@@ -183,10 +195,11 @@ LITE_OS_SEC_TEXT_MINOR VOID OsTskCycleStart(VOID)
|
||||
|
||||
taskID = g_losTask.newTask->taskID;
|
||||
g_cpup[taskID].cpupID = taskID;
|
||||
g_cpup[taskID].startTime = LOS_SysCycleGet();
|
||||
g_cpup[taskID].startTime = CpupTimeUsGet();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
Function : OsTskCycleEnd
|
||||
Description: quit task and get cycle count
|
||||
@@ -196,7 +209,7 @@ Return : None
|
||||
LITE_OS_SEC_TEXT_MINOR VOID OsTskCycleEnd(VOID)
|
||||
{
|
||||
UINT32 taskID;
|
||||
UINT64 cpuCycle;
|
||||
UINT64 cpuTime;
|
||||
|
||||
if (g_cpupInitFlg == 0) {
|
||||
return;
|
||||
@@ -208,16 +221,17 @@ LITE_OS_SEC_TEXT_MINOR VOID OsTskCycleEnd(VOID)
|
||||
return;
|
||||
}
|
||||
|
||||
cpuCycle = LOS_SysCycleGet();
|
||||
if (cpuCycle < g_cpup[taskID].startTime) {
|
||||
cpuCycle += g_cyclesPerTick;
|
||||
cpuTime = CpupTimeUsGet();
|
||||
if (cpuTime < g_cpup[taskID].startTime) {
|
||||
cpuTime += OS_US_PER_TICK;
|
||||
}
|
||||
|
||||
g_cpup[taskID].allTime += (cpuCycle - g_cpup[taskID].startTime);
|
||||
g_cpup[taskID].allTime += (cpuTime - g_cpup[taskID].startTime);
|
||||
g_cpup[taskID].startTime = 0;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
Function : OsTskCycleEndStart
|
||||
Description: start task to get cycles count in current task ending
|
||||
@@ -227,7 +241,7 @@ Return : None
|
||||
LITE_OS_SEC_TEXT_MINOR VOID OsTskCycleEndStart(VOID)
|
||||
{
|
||||
UINT32 taskID;
|
||||
UINT64 cpuCycle;
|
||||
UINT64 cpuTime;
|
||||
UINT16 loopNum;
|
||||
|
||||
if (g_cpupInitFlg == 0) {
|
||||
@@ -235,23 +249,23 @@ LITE_OS_SEC_TEXT_MINOR VOID OsTskCycleEndStart(VOID)
|
||||
}
|
||||
|
||||
taskID = g_losTask.runTask->taskID;
|
||||
cpuCycle = LOS_SysCycleGet();
|
||||
cpuTime = CpupTimeUsGet();
|
||||
|
||||
if (g_cpup[taskID].startTime != 0) {
|
||||
if (cpuCycle < g_cpup[taskID].startTime) {
|
||||
cpuCycle += g_cyclesPerTick;
|
||||
if (cpuTime < g_cpup[taskID].startTime) {
|
||||
cpuTime += OS_US_PER_TICK;
|
||||
}
|
||||
|
||||
g_cpup[taskID].allTime += (cpuCycle - g_cpup[taskID].startTime);
|
||||
g_cpup[taskID].allTime += (cpuTime - g_cpup[taskID].startTime);
|
||||
g_cpup[taskID].startTime = 0;
|
||||
}
|
||||
|
||||
taskID = g_losTask.newTask->taskID;
|
||||
g_cpup[taskID].cpupID = taskID;
|
||||
g_cpup[taskID].startTime = cpuCycle;
|
||||
g_cpup[taskID].startTime = cpuTime;
|
||||
|
||||
if ((cpuCycle - g_lastRecordTime) > OS_CPUP_RECORD_PERIOD) {
|
||||
g_lastRecordTime = cpuCycle;
|
||||
if ((cpuTime - g_lastRecordTime) > OS_CPUP_RECORD_PERIOD) {
|
||||
g_lastRecordTime = cpuTime;
|
||||
|
||||
for (loopNum = 0; loopNum < g_taskMaxNum; loopNum++) {
|
||||
g_cpup[loopNum].historyTime[g_hisPos] = g_cpup[loopNum].allTime;
|
||||
@@ -267,12 +281,12 @@ LITE_OS_SEC_TEXT_MINOR VOID OsTskCycleEndStart(VOID)
|
||||
return;
|
||||
}
|
||||
|
||||
LITE_OS_SEC_TEXT_MINOR static inline UINT16 OsGetPrePos(UINT16 curPos)
|
||||
LITE_OS_SEC_TEXT_MINOR STATIC INLINE UINT16 OsGetPrePos(UINT16 curPos)
|
||||
{
|
||||
return (curPos == 0) ? (OS_CPUP_HISTORY_RECORD_NUM - 1) : (curPos - 1);
|
||||
}
|
||||
|
||||
LITE_OS_SEC_TEXT_MINOR static VOID OsGetPositions(UINT16 mode, UINT16* curPosAddr, UINT16* prePosAddr)
|
||||
LITE_OS_SEC_TEXT_MINOR STATIC VOID OsGetPositions(UINT16 mode, UINT16* curPosAddr, UINT16* prePosAddr)
|
||||
{
|
||||
UINT16 curPos;
|
||||
UINT16 prePos = 0;
|
||||
@@ -298,7 +312,7 @@ Return : cpupRet:current CPU usage
|
||||
*****************************************************************************/
|
||||
LITE_OS_SEC_TEXT_MINOR UINT32 LOS_SysCpuUsage(VOID)
|
||||
{
|
||||
UINT64 cpuCycleAll = 0;
|
||||
UINT64 cpuTimeAll = 0;
|
||||
UINT32 cpupRet = 0;
|
||||
UINT16 loopNum;
|
||||
UINT32 intSave;
|
||||
@@ -312,12 +326,12 @@ LITE_OS_SEC_TEXT_MINOR UINT32 LOS_SysCpuUsage(VOID)
|
||||
OsTskCycleEnd();
|
||||
|
||||
for (loopNum = 0; loopNum < g_taskMaxNum; loopNum++) {
|
||||
cpuCycleAll += g_cpup[loopNum].allTime;
|
||||
cpuTimeAll += g_cpup[loopNum].allTime;
|
||||
}
|
||||
|
||||
if (cpuCycleAll) {
|
||||
if (cpuTimeAll) {
|
||||
cpupRet = LOS_CPUP_PRECISION - (UINT32)((LOS_CPUP_PRECISION *
|
||||
g_cpup[g_idleTaskID].allTime) / cpuCycleAll);
|
||||
g_cpup[g_idleTaskID].allTime) / cpuTimeAll);
|
||||
}
|
||||
|
||||
OsTskCycleStart();
|
||||
@@ -334,7 +348,7 @@ Return : cpupRet:CPU usage history
|
||||
*****************************************************************************/
|
||||
LITE_OS_SEC_TEXT_MINOR UINT32 LOS_HistorySysCpuUsage(UINT16 mode)
|
||||
{
|
||||
UINT64 cpuCycleAll = 0;
|
||||
UINT64 cpuTimeAll = 0;
|
||||
UINT64 idleCycleAll = 0;
|
||||
UINT32 cpupRet = 0;
|
||||
UINT16 loopNum;
|
||||
@@ -354,9 +368,9 @@ LITE_OS_SEC_TEXT_MINOR UINT32 LOS_HistorySysCpuUsage(UINT16 mode)
|
||||
|
||||
for (loopNum = 0; loopNum < g_taskMaxNum; loopNum++) {
|
||||
if (mode == CPUP_IN_1S) {
|
||||
cpuCycleAll += g_cpup[loopNum].historyTime[curPos] - g_cpup[loopNum].historyTime[prePos];
|
||||
cpuTimeAll += g_cpup[loopNum].historyTime[curPos] - g_cpup[loopNum].historyTime[prePos];
|
||||
} else {
|
||||
cpuCycleAll += g_cpup[loopNum].allTime - g_cpup[loopNum].historyTime[curPos];
|
||||
cpuTimeAll += g_cpup[loopNum].allTime - g_cpup[loopNum].historyTime[curPos];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -367,8 +381,8 @@ LITE_OS_SEC_TEXT_MINOR UINT32 LOS_HistorySysCpuUsage(UINT16 mode)
|
||||
idleCycleAll += g_cpup[g_idleTaskID].allTime - g_cpup[g_idleTaskID].historyTime[curPos];
|
||||
}
|
||||
|
||||
if (cpuCycleAll) {
|
||||
cpupRet = (LOS_CPUP_PRECISION - (UINT32)((LOS_CPUP_PRECISION * idleCycleAll) / cpuCycleAll));
|
||||
if (cpuTimeAll) {
|
||||
cpupRet = (LOS_CPUP_PRECISION - (UINT32)((LOS_CPUP_PRECISION * idleCycleAll) / cpuTimeAll));
|
||||
}
|
||||
|
||||
OsTskCycleStart();
|
||||
@@ -385,7 +399,7 @@ Return : cpupRet:CPU usage of certain task
|
||||
*****************************************************************************/
|
||||
LITE_OS_SEC_TEXT_MINOR UINT32 LOS_TaskCpuUsage(UINT32 taskID)
|
||||
{
|
||||
UINT64 cpuCycleAll = 0;
|
||||
UINT64 cpuTimeAll = 0;
|
||||
UINT16 loopNum;
|
||||
UINT32 intSave;
|
||||
UINT32 cpupRet = 0;
|
||||
@@ -410,11 +424,11 @@ LITE_OS_SEC_TEXT_MINOR UINT32 LOS_TaskCpuUsage(UINT32 taskID)
|
||||
if ((g_cpup[loopNum].status & OS_TASK_STATUS_UNUSED) || (g_cpup[loopNum].status == 0)) {
|
||||
continue;
|
||||
}
|
||||
cpuCycleAll += g_cpup[loopNum].allTime;
|
||||
cpuTimeAll += g_cpup[loopNum].allTime;
|
||||
}
|
||||
|
||||
if (cpuCycleAll) {
|
||||
cpupRet = (UINT32)((LOS_CPUP_PRECISION * g_cpup[taskID].allTime) / cpuCycleAll);
|
||||
if (cpuTimeAll) {
|
||||
cpupRet = (UINT32)((LOS_CPUP_PRECISION * g_cpup[taskID].allTime) / cpuTimeAll);
|
||||
}
|
||||
|
||||
OsTskCycleStart();
|
||||
@@ -432,8 +446,8 @@ Return : cpupRet:CPU usage history of task
|
||||
*****************************************************************************/
|
||||
LITE_OS_SEC_TEXT_MINOR UINT32 LOS_HistoryTaskCpuUsage(UINT32 taskID, UINT16 mode)
|
||||
{
|
||||
UINT64 cpuCycleAll = 0;
|
||||
UINT64 cpuCycleCurTsk = 0;
|
||||
UINT64 cpuTimeAll = 0;
|
||||
UINT64 cpuTimeCurTsk = 0;
|
||||
UINT16 loopNum, curPos;
|
||||
UINT16 prePos = 0;
|
||||
UINT32 intSave;
|
||||
@@ -463,19 +477,19 @@ LITE_OS_SEC_TEXT_MINOR UINT32 LOS_HistoryTaskCpuUsage(UINT32 taskID, UINT16 mode
|
||||
}
|
||||
|
||||
if (mode == CPUP_IN_1S) {
|
||||
cpuCycleAll += g_cpup[loopNum].historyTime[curPos] - g_cpup[loopNum].historyTime[prePos];
|
||||
cpuTimeAll += g_cpup[loopNum].historyTime[curPos] - g_cpup[loopNum].historyTime[prePos];
|
||||
} else {
|
||||
cpuCycleAll += g_cpup[loopNum].allTime - g_cpup[loopNum].historyTime[curPos];
|
||||
cpuTimeAll += g_cpup[loopNum].allTime - g_cpup[loopNum].historyTime[curPos];
|
||||
}
|
||||
}
|
||||
|
||||
if (mode == CPUP_IN_1S) {
|
||||
cpuCycleCurTsk += g_cpup[taskID].historyTime[curPos] - g_cpup[taskID].historyTime[prePos];
|
||||
cpuTimeCurTsk += g_cpup[taskID].historyTime[curPos] - g_cpup[taskID].historyTime[prePos];
|
||||
} else {
|
||||
cpuCycleCurTsk += g_cpup[taskID].allTime - g_cpup[taskID].historyTime[curPos];
|
||||
cpuTimeCurTsk += g_cpup[taskID].allTime - g_cpup[taskID].historyTime[curPos];
|
||||
}
|
||||
if (cpuCycleAll) {
|
||||
cpupRet = (UINT32)((LOS_CPUP_PRECISION * cpuCycleCurTsk) / cpuCycleAll);
|
||||
if (cpuTimeAll) {
|
||||
cpupRet = (UINT32)((LOS_CPUP_PRECISION * cpuTimeCurTsk) / cpuTimeAll);
|
||||
}
|
||||
|
||||
OsTskCycleStart();
|
||||
@@ -490,8 +504,8 @@ LITE_OS_SEC_TEXT_MINOR UINT32 LOS_AllTaskCpuUsage(CPUP_INFO_S *cpupInfo, UINT16
|
||||
UINT16 curPos;
|
||||
UINT16 prePos = 0;
|
||||
UINT32 intSave;
|
||||
UINT64 cpuCycleAll = 0;
|
||||
UINT64 cpuCycleCurTsk = 0;
|
||||
UINT64 cpuTimeAll = 0;
|
||||
UINT64 cpuTimeCurTsk = 0;
|
||||
|
||||
if (g_cpupInitFlg == 0) {
|
||||
return LOS_ERRNO_CPUP_NO_INIT;
|
||||
@@ -513,9 +527,9 @@ LITE_OS_SEC_TEXT_MINOR UINT32 LOS_AllTaskCpuUsage(CPUP_INFO_S *cpupInfo, UINT16
|
||||
}
|
||||
|
||||
if (mode == CPUP_IN_1S) {
|
||||
cpuCycleAll += g_cpup[loopNum].historyTime[curPos] - g_cpup[loopNum].historyTime[prePos];
|
||||
cpuTimeAll += g_cpup[loopNum].historyTime[curPos] - g_cpup[loopNum].historyTime[prePos];
|
||||
} else {
|
||||
cpuCycleAll += g_cpup[loopNum].allTime - g_cpup[loopNum].historyTime[curPos];
|
||||
cpuTimeAll += g_cpup[loopNum].allTime - g_cpup[loopNum].historyTime[curPos];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -526,16 +540,16 @@ LITE_OS_SEC_TEXT_MINOR UINT32 LOS_AllTaskCpuUsage(CPUP_INFO_S *cpupInfo, UINT16
|
||||
}
|
||||
|
||||
if (mode == CPUP_IN_1S) {
|
||||
cpuCycleCurTsk += g_cpup[loopNum].historyTime[curPos] - g_cpup[loopNum].historyTime[prePos];
|
||||
cpuTimeCurTsk += g_cpup[loopNum].historyTime[curPos] - g_cpup[loopNum].historyTime[prePos];
|
||||
} else {
|
||||
cpuCycleCurTsk += g_cpup[loopNum].allTime - g_cpup[loopNum].historyTime[curPos];
|
||||
cpuTimeCurTsk += g_cpup[loopNum].allTime - g_cpup[loopNum].historyTime[curPos];
|
||||
}
|
||||
cpupInfo[loopNum].usStatus = g_cpup[loopNum].status;
|
||||
if (cpuCycleAll) {
|
||||
cpupInfo[loopNum].uwUsage = (UINT32)((LOS_CPUP_PRECISION * cpuCycleCurTsk) / cpuCycleAll);
|
||||
if (cpuTimeAll) {
|
||||
cpupInfo[loopNum].uwUsage = (UINT32)((LOS_CPUP_PRECISION * cpuTimeCurTsk) / cpuTimeAll);
|
||||
}
|
||||
|
||||
cpuCycleCurTsk = 0;
|
||||
cpuTimeCurTsk = 0;
|
||||
}
|
||||
|
||||
OsTskCycleStart();
|
||||
@@ -606,13 +620,13 @@ LITE_OS_SEC_TEXT_MINOR VOID OsCpupIrqStart(UINT32 intNum)
|
||||
return;
|
||||
}
|
||||
|
||||
g_irqCpup[intNum].startTime = LOS_SysCycleGet();
|
||||
g_irqCpup[intNum].startTime = CpupTimeUsGet();
|
||||
return;
|
||||
}
|
||||
|
||||
LITE_OS_SEC_TEXT_MINOR VOID OsCpupIrqEnd(UINT32 intNum)
|
||||
{
|
||||
UINT64 cpuCycle;
|
||||
UINT64 cpuTime;
|
||||
UINT64 usedTime;
|
||||
|
||||
if (g_irqCpupInitFlg == 0) {
|
||||
@@ -623,14 +637,14 @@ LITE_OS_SEC_TEXT_MINOR VOID OsCpupIrqEnd(UINT32 intNum)
|
||||
return;
|
||||
}
|
||||
|
||||
cpuCycle = LOS_SysCycleGet();
|
||||
if (cpuCycle < g_irqCpup[intNum].startTime) {
|
||||
cpuCycle += g_cyclesPerTick;
|
||||
cpuTime = CpupTimeUsGet();
|
||||
if (cpuTime < g_irqCpup[intNum].startTime) {
|
||||
cpuTime += OS_US_PER_TICK;
|
||||
}
|
||||
|
||||
g_irqCpup[intNum].cpupID = intNum;
|
||||
g_irqCpup[intNum].status = OS_CPUP_USED;
|
||||
usedTime = cpuCycle - g_irqCpup[intNum].startTime;
|
||||
usedTime = cpuTime - g_irqCpup[intNum].startTime;
|
||||
|
||||
if (g_irqCpup[intNum].count <= 1000) { /* 1000, Take 1000 samples */
|
||||
g_irqCpup[intNum].allTime += usedTime;
|
||||
@@ -672,12 +686,12 @@ LITE_OS_SEC_TEXT_MINOR STATIC VOID OsGetIrqPositions(UINT16 mode, UINT16* curPos
|
||||
LITE_OS_SEC_TEXT_MINOR STATIC UINT64 OsGetIrqAllTime(VOID)
|
||||
{
|
||||
INT32 i;
|
||||
UINT64 cpuCycleAll = 0;
|
||||
UINT64 cpuTimeAll = 0;
|
||||
for (i = 0; i < OS_CPUP_HISTORY_RECORD_NUM; i++) {
|
||||
cpuCycleAll += g_cpuHistoryTime[i];
|
||||
cpuTimeAll += g_cpuHistoryTime[i];
|
||||
}
|
||||
|
||||
return cpuCycleAll;
|
||||
return cpuTimeAll;
|
||||
}
|
||||
|
||||
LITE_OS_SEC_TEXT_MINOR STATIC UINT64 OsGetIrqAllHisTime(UINT32 num)
|
||||
@@ -697,8 +711,8 @@ LITE_OS_SEC_TEXT_MINOR UINT32 LOS_GetAllIrqCpuUsage(UINT16 mode, CPUP_INFO_S *cp
|
||||
UINT16 curPos;
|
||||
UINT16 prePos = 0;
|
||||
UINT32 intSave;
|
||||
UINT64 cpuCycleAll;
|
||||
UINT64 cpuCycleCurIrq;
|
||||
UINT64 cpuTimeAll;
|
||||
UINT64 cpuTimeCurIrq;
|
||||
|
||||
if (g_irqCpupInitFlg == 0) {
|
||||
return LOS_ERRNO_CPUP_NO_INIT;
|
||||
@@ -712,9 +726,9 @@ LITE_OS_SEC_TEXT_MINOR UINT32 LOS_GetAllIrqCpuUsage(UINT16 mode, CPUP_INFO_S *cp
|
||||
|
||||
OsGetIrqPositions(mode, &curPos, &prePos);
|
||||
if (mode == CPUP_IN_10S) {
|
||||
cpuCycleAll = OsGetIrqAllTime();
|
||||
cpuTimeAll = OsGetIrqAllTime();
|
||||
} else {
|
||||
cpuCycleAll = g_cpuHistoryTime[curPos] - g_cpuHistoryTime[prePos];
|
||||
cpuTimeAll = g_cpuHistoryTime[curPos] - g_cpuHistoryTime[prePos];
|
||||
}
|
||||
|
||||
for (loopNum = 0; loopNum < LOSCFG_PLATFORM_HWI_LIMIT; loopNum++) {
|
||||
@@ -725,13 +739,13 @@ LITE_OS_SEC_TEXT_MINOR UINT32 LOS_GetAllIrqCpuUsage(UINT16 mode, CPUP_INFO_S *cp
|
||||
cpupInfo[loopNum].usStatus = g_irqCpup[loopNum].status;
|
||||
|
||||
if (mode == CPUP_IN_10S) {
|
||||
cpuCycleCurIrq = OsGetIrqAllHisTime(loopNum);
|
||||
cpuTimeCurIrq = OsGetIrqAllHisTime(loopNum);
|
||||
} else {
|
||||
cpuCycleCurIrq = g_irqCpup[loopNum].historyTime[curPos] - g_irqCpup[loopNum].historyTime[prePos];
|
||||
cpuTimeCurIrq = g_irqCpup[loopNum].historyTime[curPos] - g_irqCpup[loopNum].historyTime[prePos];
|
||||
}
|
||||
|
||||
if (cpuCycleAll != 0) {
|
||||
cpupInfo[loopNum].uwUsage = (UINT32)((LOS_CPUP_PRECISION * cpuCycleCurIrq) / cpuCycleAll);
|
||||
if (cpuTimeAll != 0) {
|
||||
cpupInfo[loopNum].uwUsage = (UINT32)((LOS_CPUP_PRECISION * cpuTimeCurIrq) / cpuTimeAll);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -41,12 +41,6 @@
|
||||
#include "los_debug.h"
|
||||
#include "los_mux.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#if (LOSCFG_DYNLINK == 1)
|
||||
|
||||
#if defined(__ICCARM__) || defined(__CC_ARM)
|
||||
@@ -279,7 +273,7 @@ STATIC DynSharedObj *OsLoadInit(const CHAR *fileName, VOID *pool)
|
||||
goto ERR2;
|
||||
}
|
||||
|
||||
strcpy(dso->buf, fileName);
|
||||
(void)strcpy_s(dso->buf, nameLen + 1, fileName);
|
||||
dso->fileName = dso->buf;
|
||||
dso->ref = 1;
|
||||
dso->pool = (pool ? pool : OS_SYS_MEM_ADDR);
|
||||
@@ -929,10 +923,3 @@ INT32 LOS_DynlinkInit(VOID)
|
||||
}
|
||||
|
||||
#endif /* LOSCFG_DYNLINK */
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
#endif /* __cplusplus */
|
||||
|
||||
|
||||
@@ -32,7 +32,6 @@ config FS_FAT
|
||||
default n
|
||||
depends on FS_VFS
|
||||
select SUPPORT_FATFS
|
||||
select KAL_CMSIS
|
||||
help
|
||||
Answer Y to enable LiteOS support fat filesystem.
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -32,15 +32,82 @@
|
||||
#define _GNU_SOURCE 1
|
||||
#include "lfs_adapter.h"
|
||||
#include "los_config.h"
|
||||
#include "los_fs.h"
|
||||
#include "vfs_files.h"
|
||||
#include "vfs_operations.h"
|
||||
#include "vfs_partition.h"
|
||||
#include "vfs_maps.h"
|
||||
#include "vfs_mount.h"
|
||||
#include "securec.h"
|
||||
#include "los_fs.h"
|
||||
|
||||
struct dirent g_nameValue;
|
||||
static pthread_mutex_t g_FslocalMutex = PTHREAD_MUTEX_INITIALIZER;
|
||||
static struct PartitionCfg g_partitionCfg;
|
||||
static struct DeviceDesc *g_lfsDevice = NULL;
|
||||
|
||||
static uint32_t LfsGetStartAddr(int partition)
|
||||
{
|
||||
if (g_lfsDevice == NULL) {
|
||||
struct DeviceDesc *device = NULL;
|
||||
for (device = getDeviceList(); device != NULL; device = device->dNext) {
|
||||
if (strcmp(device->dFsType, "littlefs") == 0) {
|
||||
g_lfsDevice = device;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ((g_lfsDevice == NULL) || (partition >= g_lfsDevice->dPartNum)) {
|
||||
return INVALID_DEVICE_ADDR;
|
||||
}
|
||||
|
||||
return (uint32_t)g_lfsDevice->dAddrArray[partition];
|
||||
}
|
||||
|
||||
WEAK int littlefs_block_read(const struct lfs_config *c, lfs_block_t block,
|
||||
lfs_off_t off, void *dst, lfs_size_t size)
|
||||
{
|
||||
UINT32 addr = c->block_size * block + off;
|
||||
UINT32 startaddr = LfsGetStartAddr((int)c->context);
|
||||
if (startaddr == INVALID_DEVICE_ADDR) {
|
||||
return -1;
|
||||
}
|
||||
addr += startaddr;
|
||||
|
||||
return (g_partitionCfg.readFunc)((int)c->context, &addr, dst, size);
|
||||
}
|
||||
|
||||
WEAK int littlefs_block_write(const struct lfs_config *c, lfs_block_t block,
|
||||
lfs_off_t off, const void *dst, lfs_size_t size)
|
||||
{
|
||||
UINT32 addr = c->block_size * block + off;
|
||||
UINT32 startaddr = LfsGetStartAddr((int)c->context);
|
||||
if (startaddr == INVALID_DEVICE_ADDR) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
addr += startaddr;
|
||||
|
||||
return (g_partitionCfg.writeFunc)((int)c->context, &addr, dst, size);
|
||||
}
|
||||
|
||||
WEAK int littlefs_block_erase(const struct lfs_config *c, lfs_block_t block)
|
||||
{
|
||||
UINT32 addr = c->block_size * block;
|
||||
UINT32 startaddr = LfsGetStartAddr((int)c->context);
|
||||
if (startaddr == INVALID_DEVICE_ADDR) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
addr += startaddr;
|
||||
|
||||
return (g_partitionCfg.eraseFunc)((int)c->context, addr, c->block_size);
|
||||
}
|
||||
|
||||
WEAK int littlefs_block_sync(const struct lfs_config *c)
|
||||
{
|
||||
(void)c;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int ConvertFlagToLfsOpenFlag (int oflags)
|
||||
{
|
||||
@@ -82,10 +149,33 @@ static int LittlefsErrno(int result)
|
||||
return (result < 0) ? -result : result;
|
||||
}
|
||||
|
||||
void LfsConfigAdapter(struct PartitionCfg *pCfg, struct lfs_config *lfsCfg)
|
||||
{
|
||||
lfsCfg->context = (void *)pCfg->partNo;
|
||||
|
||||
lfsCfg->read_size = pCfg->readSize;
|
||||
lfsCfg->prog_size = pCfg->writeSize;
|
||||
lfsCfg->cache_size = pCfg->cacheSize;
|
||||
lfsCfg->block_cycles = pCfg->blockCycles;
|
||||
lfsCfg->lookahead_size = pCfg->lookaheadSize;
|
||||
lfsCfg->block_size = pCfg->blockSize;
|
||||
lfsCfg->block_count = pCfg->blockCount;
|
||||
|
||||
lfsCfg->read = littlefs_block_read;
|
||||
lfsCfg->prog = littlefs_block_write;
|
||||
lfsCfg->erase = littlefs_block_erase;
|
||||
lfsCfg->sync = littlefs_block_sync;
|
||||
|
||||
g_partitionCfg.readFunc = pCfg->readFunc;
|
||||
g_partitionCfg.writeFunc = pCfg->writeFunc;
|
||||
g_partitionCfg.eraseFunc = pCfg->eraseFunc;
|
||||
}
|
||||
|
||||
int LfsMount(struct MountPoint *mp, unsigned long mountflags, const void *data)
|
||||
{
|
||||
int ret;
|
||||
lfs_t *mountHdl = NULL;
|
||||
struct lfs_config *cfg = NULL;
|
||||
|
||||
if ((mp == NULL) || (mp->mPath == NULL) || (data == NULL)) {
|
||||
errno = EFAULT;
|
||||
@@ -93,25 +183,33 @@ int LfsMount(struct MountPoint *mp, unsigned long mountflags, const void *data)
|
||||
goto errout;
|
||||
}
|
||||
|
||||
mountHdl = (lfs_t *)malloc(sizeof(lfs_t));
|
||||
if (mountflags & MS_REMOUNT) {
|
||||
errno = ENOSYS;
|
||||
ret = (int)LOS_NOK;
|
||||
goto errout;
|
||||
}
|
||||
|
||||
mountHdl = (lfs_t *)LOSCFG_FS_MALLOC_HOOK(sizeof(lfs_t) + sizeof(struct lfs_config));
|
||||
if (mountHdl == NULL) {
|
||||
errno = ENODEV;
|
||||
ret = (int)LOS_NOK;
|
||||
goto errout;
|
||||
}
|
||||
(void)memset_s(mountHdl, sizeof(lfs_t), 0, sizeof(lfs_t));
|
||||
(void)memset_s(mountHdl, sizeof(lfs_t) + sizeof(struct lfs_config), 0, sizeof(lfs_t) + sizeof(struct lfs_config));
|
||||
mp->mData = (void *)mountHdl;
|
||||
cfg = (void *)((UINTPTR)mountHdl + sizeof(lfs_t));
|
||||
|
||||
ret = lfs_mount((lfs_t *)mp->mData, (struct lfs_config *)data);
|
||||
LfsConfigAdapter((struct PartitionCfg *)data, cfg);
|
||||
|
||||
ret = lfs_mount((lfs_t *)mp->mData, cfg);
|
||||
if (ret != 0) {
|
||||
ret = lfs_format((lfs_t *)mp->mData, (struct lfs_config*)data);
|
||||
ret = lfs_format((lfs_t *)mp->mData, cfg);
|
||||
if (ret == 0) {
|
||||
ret = lfs_mount((lfs_t *)mp->mData, (struct lfs_config*)data);
|
||||
ret = lfs_mount((lfs_t *)mp->mData, cfg);
|
||||
}
|
||||
}
|
||||
|
||||
if (ret != 0) {
|
||||
free(mountHdl);
|
||||
LOSCFG_FS_FREE_HOOK(mountHdl);
|
||||
errno = LittlefsErrno(ret);
|
||||
ret = (int)LOS_NOK;
|
||||
}
|
||||
@@ -140,7 +238,7 @@ int LfsUmount(struct MountPoint *mp)
|
||||
ret = (int)LOS_NOK;
|
||||
}
|
||||
|
||||
free(mp->mData);
|
||||
LOSCFG_FS_FREE_HOOK(mp->mData);
|
||||
mp->mData = NULL;
|
||||
return ret;
|
||||
}
|
||||
@@ -234,7 +332,7 @@ int LfsOpendir(struct Dir *dir, const char *dirName)
|
||||
}
|
||||
|
||||
lfs_t *lfs = (lfs_t *)dir->dMp->mData;
|
||||
lfs_dir_t *dirInfo = (lfs_dir_t *)malloc(sizeof(lfs_dir_t));
|
||||
lfs_dir_t *dirInfo = (lfs_dir_t *)LOSCFG_FS_MALLOC_HOOK(sizeof(lfs_dir_t));
|
||||
if (dirInfo == NULL) {
|
||||
errno = ENOMEM;
|
||||
return (int)LOS_NOK;
|
||||
@@ -243,7 +341,7 @@ int LfsOpendir(struct Dir *dir, const char *dirName)
|
||||
(void)memset_s(dirInfo, sizeof(lfs_dir_t), 0, sizeof(lfs_dir_t));
|
||||
ret = lfs_dir_open(lfs, dirInfo, dirName);
|
||||
if (ret != 0) {
|
||||
free(dirInfo);
|
||||
LOSCFG_FS_FREE_HOOK(dirInfo);
|
||||
errno = LittlefsErrno(ret);
|
||||
goto errout;
|
||||
}
|
||||
@@ -278,7 +376,6 @@ int LfsReaddir(struct Dir *dir, struct dirent *dent)
|
||||
|
||||
ret = lfs_dir_read(lfs, dirInfo, &lfsInfo);
|
||||
if (ret == TRUE) {
|
||||
pthread_mutex_lock(&g_FslocalMutex);
|
||||
(void)strncpy_s(dent->d_name, sizeof(dent->d_name), lfsInfo.name, strlen(lfsInfo.name) + 1);
|
||||
if (lfsInfo.type == LFS_TYPE_DIR) {
|
||||
dent->d_type = DT_DIR;
|
||||
@@ -287,7 +384,6 @@ int LfsReaddir(struct Dir *dir, struct dirent *dent)
|
||||
}
|
||||
|
||||
dent->d_reclen = lfsInfo.size;
|
||||
pthread_mutex_unlock(&g_FslocalMutex);
|
||||
|
||||
return LOS_OK;
|
||||
}
|
||||
@@ -322,7 +418,7 @@ int LfsClosedir(struct Dir *dir)
|
||||
ret = (int)LOS_NOK;
|
||||
}
|
||||
|
||||
free(dirInfo);
|
||||
LOSCFG_FS_FREE_HOOK(dirInfo);
|
||||
dir->dData = NULL;
|
||||
|
||||
return ret;
|
||||
@@ -339,7 +435,7 @@ int LfsOpen(struct File *file, const char *pathName, int openFlag)
|
||||
return (int)LOS_NOK;
|
||||
}
|
||||
|
||||
lfsHandle = (lfs_file_t *)malloc(sizeof(lfs_file_t));
|
||||
lfsHandle = (lfs_file_t *)LOSCFG_FS_MALLOC_HOOK(sizeof(lfs_file_t));
|
||||
if (lfsHandle == NULL) {
|
||||
errno = ENOMEM;
|
||||
return (int)LOS_NOK;
|
||||
@@ -348,7 +444,7 @@ int LfsOpen(struct File *file, const char *pathName, int openFlag)
|
||||
int lfsOpenFlag = ConvertFlagToLfsOpenFlag(openFlag);
|
||||
ret = lfs_file_open((lfs_t *)file->fMp->mData, lfsHandle, pathName, lfsOpenFlag);
|
||||
if (ret != 0) {
|
||||
free(lfsHandle);
|
||||
LOSCFG_FS_FREE_HOOK(lfsHandle);
|
||||
errno = LittlefsErrno(ret);
|
||||
goto errout;
|
||||
}
|
||||
@@ -467,16 +563,13 @@ int LfsClose(struct File *file)
|
||||
return (int)LOS_NOK;
|
||||
}
|
||||
|
||||
pthread_mutex_lock(&g_FslocalMutex);
|
||||
ret = lfs_file_close((lfs_t *)mp->mData, lfsHandle);
|
||||
pthread_mutex_unlock(&g_FslocalMutex);
|
||||
|
||||
if (ret != 0) {
|
||||
errno = LittlefsErrno(ret);
|
||||
ret = (int)LOS_NOK;
|
||||
}
|
||||
|
||||
free(file->fData);
|
||||
LOSCFG_FS_FREE_HOOK(file->fData);
|
||||
file->fData = NULL;
|
||||
return ret;
|
||||
}
|
||||
@@ -559,6 +652,24 @@ int LfsSync(struct File *file)
|
||||
return ret;
|
||||
}
|
||||
|
||||
int LfsFormat(const char *partName, void *privData)
|
||||
{
|
||||
int ret;
|
||||
lfs_t lfs = {0};
|
||||
struct lfs_config cfg = {0};
|
||||
|
||||
(void)partName;
|
||||
|
||||
LfsConfigAdapter((struct PartitionCfg *)privData, &cfg);
|
||||
|
||||
ret = lfs_format(&lfs, &cfg);
|
||||
if (ret != 0) {
|
||||
errno = LittlefsErrno(ret);
|
||||
ret = (int)LOS_NOK;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
static struct MountOps g_lfsMnt = {
|
||||
.mount = LfsMount,
|
||||
.umount = LfsUmount,
|
||||
@@ -587,7 +698,7 @@ static struct FileOps g_lfsFops = {
|
||||
|
||||
static struct FsManagement g_lfsMgt = {
|
||||
.fdisk = NULL,
|
||||
.format = NULL,
|
||||
.format = LfsFormat,
|
||||
};
|
||||
|
||||
void LfsInit(void)
|
||||
|
||||
@@ -45,6 +45,6 @@
|
||||
#include "pthread.h"
|
||||
|
||||
#define INVALID_FD (-1)
|
||||
|
||||
#define INVALID_DEVICE_ADDR ((uint32_t)-1)
|
||||
void LfsInit(void);
|
||||
#endif /* _LFS_ADAPTER_H_ */
|
||||
|
||||
@@ -30,6 +30,23 @@
|
||||
config FS_VFS
|
||||
bool "Enable FS VFS"
|
||||
default y
|
||||
select POSIX_FS_API
|
||||
|
||||
help
|
||||
Answer Y to enable LiteOS support VFS.
|
||||
|
||||
if FS_VFS
|
||||
config FS_LOCK_TIMEOUT
|
||||
int "Filesystem global lock timeout value in tick. -1 for waiting forever"
|
||||
default -1
|
||||
help
|
||||
The timeout value of getting filesystem lock in tick. -1 for waiting forever
|
||||
|
||||
config FS_SUPPORT_MOUNT_TARGET_RECURSIVE
|
||||
bool "Mount target can be recursive"
|
||||
default n
|
||||
depends on FS_VFS
|
||||
|
||||
help
|
||||
Answer Y to enable LiteOS support VFS mount recursively. For example, "/system/bin".
|
||||
endif
|
||||
|
||||
@@ -38,12 +38,15 @@
|
||||
#define _LOS_FS_H_
|
||||
|
||||
#include "los_config.h"
|
||||
#include "los_memory.h"
|
||||
#include "dirent.h"
|
||||
#include "sys/mount.h"
|
||||
#include "sys/statfs.h"
|
||||
#include "sys/stat.h"
|
||||
#include "sys/uio.h"
|
||||
#include "unistd.h"
|
||||
#include <stdarg.h>
|
||||
#include "vfs_maps.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
@@ -51,37 +54,33 @@ extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
#endif /* __cplusplus */
|
||||
|
||||
int LOS_Open(const char *path, int flags, ...);
|
||||
int LOS_Close(int fd);
|
||||
ssize_t LOS_Read(int fd, void *buff, size_t bytes);
|
||||
ssize_t LOS_Write(int fd, const void *buff, size_t bytes);
|
||||
off_t LOS_Lseek(int fd, off_t off, int whence);
|
||||
int LOS_Stat(const char *path, struct stat *stat);
|
||||
int LOS_Statfs(const char *path, struct statfs *buf);
|
||||
int LOS_Unlink(const char *path);
|
||||
int LOS_Rename(const char *oldpath, const char *newpath);
|
||||
int LOS_Fsync(int fd);
|
||||
DIR *LOS_Opendir(const char *path);
|
||||
struct dirent *LOS_Readdir(DIR *dir);
|
||||
int LOS_Closedir(DIR *dir);
|
||||
int LOS_Mkdir(const char *path, mode_t mode);
|
||||
int LOS_Rmdir(const char *path);
|
||||
int LOS_Lstat(const char *path, struct stat *buffer);
|
||||
int LOS_Fstat(int fd, struct stat *buf);
|
||||
int LOS_Fcntl(int fd, int cmd, ...);
|
||||
int LOS_Ioctl(int fd, int req, ...);
|
||||
ssize_t LOS_Readv(int fd, const struct iovec *iovBuf, int iovcnt);
|
||||
ssize_t LOS_Writev(int fd, const struct iovec *iovBuf, int iovcnt);
|
||||
ssize_t LOS_Pread(int fd, void *buff, size_t bytes, off_t off);
|
||||
ssize_t LOS_Pwrite(int fd, const void *buff, size_t bytes, off_t off);
|
||||
int LOS_Isatty(int fd);
|
||||
int LOS_Access(const char *path, int amode);
|
||||
int LOS_Ftruncate(int fd, off_t length);
|
||||
int LOS_FsUmount(const char *target);
|
||||
int LOS_FsUmount2(const char *target, int flag);
|
||||
int LOS_FsMount(const char *source, const char *target,
|
||||
const char *fsType, unsigned long mountflags,
|
||||
const void *data);
|
||||
#ifndef LOSCFG_FS_MALLOC_HOOK
|
||||
#define LOSCFG_FS_MALLOC_HOOK(size) LOS_MemAlloc((VOID *)OS_SYS_MEM_ADDR, size)
|
||||
#endif
|
||||
|
||||
#ifndef LOSCFG_FS_FREE_HOOK
|
||||
#define LOSCFG_FS_FREE_HOOK(ptr) LOS_MemFree((VOID *)OS_SYS_MEM_ADDR, ptr)
|
||||
#endif
|
||||
|
||||
struct PartitionCfg {
|
||||
/* partition low-level read func */
|
||||
int (*readFunc)(int partition, UINT32 *offset, void *buf, UINT32 size);
|
||||
/* partition low-level write func */
|
||||
int (*writeFunc)(int partition, UINT32 *offset, const void *buf, UINT32 size);
|
||||
/* partition low-level erase func */
|
||||
int (*eraseFunc)(int partition, UINT32 offset, UINT32 size);
|
||||
|
||||
int readSize; /* size of a block read */
|
||||
int writeSize; /* size of a block write */
|
||||
int blockSize; /* size of an erasable block */
|
||||
int blockCount; /* number of partition blocks */
|
||||
int cacheSize; /* size of block caches */
|
||||
|
||||
int partNo; /* partition number */
|
||||
int lookaheadSize; /* lookahead size */
|
||||
int blockCycles; /* block cycles */
|
||||
};
|
||||
|
||||
/*
|
||||
* @brief Divide the device into partitions.
|
||||
*
|
||||
@@ -93,6 +92,7 @@ int LOS_FsMount(const char *source, const char *target,
|
||||
* @param lengthArray List of partition size. For example:
|
||||
* [0x10000000, 0x2000000], 256M and 512M partitions will be created and
|
||||
* left all will not allocated.
|
||||
* @param addrArray List of partition start addr, partition num same as lengthArray
|
||||
* @param partNum Length of 'lengthArray'.
|
||||
*
|
||||
* @return Return LOS_NOK if error. Return LOS_OK if success.
|
||||
@@ -103,8 +103,8 @@ int LOS_FsMount(const char *source, const char *target,
|
||||
* The name is a combination of: 'deviceName'+'p'+'partitionId',
|
||||
* such as "emmc0p0", "emmc0p1", "emmc0p2"...
|
||||
*/
|
||||
int LOS_DiskPartition(const char *dev, const char *fsType, int *lengthArray,
|
||||
int partnum);
|
||||
int LOS_DiskPartition(const char *dev, const char *fsType, int *lengthArray, int *addrArray,
|
||||
int partNum);
|
||||
|
||||
/*
|
||||
* @brief Format a partition.
|
||||
@@ -118,6 +118,39 @@ int LOS_DiskPartition(const char *dev, const char *fsType, int *lengthArray,
|
||||
*/
|
||||
int LOS_PartitionFormat(const char *partName, char *fsType, void *data);
|
||||
|
||||
/*
|
||||
* @brief new file system callbacks register.
|
||||
* These callback functions are the adaptation layer implemented by the developer,
|
||||
* used to interconnect the vfs with the new file system.
|
||||
*
|
||||
* LOS_FsRegister must be called after kernel initialization is complete.
|
||||
*
|
||||
* @param fsType file system type, don't register the same type fs more than once.
|
||||
* @param fsMops mount operation of the fs.
|
||||
* @param fsFops file operation of the fs.
|
||||
* @param fsMgt management operation of the fs.
|
||||
*
|
||||
* @return Return LOS_OK if success.
|
||||
* Return LOS_NOK if error.
|
||||
* errno EINVAL: input errors, such as null pointers.
|
||||
* errno ENOMEM: memory may malloc failed.
|
||||
*
|
||||
*/
|
||||
int LOS_FsRegister(const char *fsType, const struct MountOps *fsMops,
|
||||
const struct FileOps *fsFops, const struct FsManagement *fsMgt);
|
||||
|
||||
/*
|
||||
* @brief Lock the whole filesystem to forbid filesystem access.
|
||||
*
|
||||
* @return Return LOS_NOK if error. Return LOS_OK if seccess.
|
||||
*/
|
||||
int LOS_FsLock(void);
|
||||
|
||||
/*
|
||||
* @brief Unlock the whole filesystem to allow filesystem access.
|
||||
*/
|
||||
void LOS_FsUnlock(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
extern "C" {
|
||||
|
||||
@@ -49,21 +49,17 @@
|
||||
|
||||
#ifdef LOSCFG_FS_FAT
|
||||
#include "fatfs_conf.h"
|
||||
#define __FAT_NFILE FAT_MAX_OPEN_FILES
|
||||
#else
|
||||
#define __FAT_NFILE 0
|
||||
#endif
|
||||
|
||||
#ifdef LOSCFG_FS_LITTLEFS
|
||||
#include "lfs_conf.h"
|
||||
#define __LFS_NFILE LOSCFG_LFS_MAX_OPEN_FILES
|
||||
#else
|
||||
#define __LFS_NFILE 0
|
||||
#endif
|
||||
|
||||
#define CONFIG_NFILE_DESCRIPTORS (__FAT_NFILE + __LFS_NFILE)
|
||||
#ifndef CONFIG_NFILE_DESCRIPTORS
|
||||
#define CONFIG_NFILE_DESCRIPTORS 256
|
||||
#endif
|
||||
|
||||
#define NR_OPEN_DEFAULT CONFIG_NFILE_DESCRIPTORS
|
||||
#define NR_OPEN_DEFAULT (CONFIG_NFILE_DESCRIPTORS - MIN_START_FD)
|
||||
|
||||
/* time configure */
|
||||
|
||||
@@ -88,4 +84,9 @@
|
||||
|
||||
#define MAX_DIRENT_NUM 14 // 14 means 4096 length buffer can store 14 dirent, see struct DIR
|
||||
|
||||
/* max number of open directories */
|
||||
#ifndef LOSCFG_MAX_OPEN_DIRS
|
||||
#define LOSCFG_MAX_OPEN_DIRS 10
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
|
||||
static struct File g_files[NR_OPEN_DEFAULT];
|
||||
|
||||
int FileToFd(struct File *file)
|
||||
int FileToFd(const struct File *file)
|
||||
{
|
||||
if (file == NULL) {
|
||||
return (int)LOS_NOK;
|
||||
|
||||
@@ -89,7 +89,7 @@ struct Dir {
|
||||
void *dData;
|
||||
};
|
||||
|
||||
int FileToFd(struct File *file);
|
||||
int FileToFd(const struct File *file);
|
||||
struct File *FdToFile(int fd);
|
||||
struct File *VfsFileGet(void);
|
||||
struct File *VfsFileGetSpec(int fd);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -33,6 +33,7 @@
|
||||
#include "securec.h"
|
||||
#include "los_debug.h"
|
||||
#include "los_compiler.h"
|
||||
#include "los_fs.h"
|
||||
|
||||
struct FsMap *g_fsMap = NULL;
|
||||
|
||||
@@ -40,49 +41,67 @@ struct FsMap *VfsFsMapGet(const char *fsType)
|
||||
{
|
||||
struct FsMap *curr = g_fsMap;
|
||||
|
||||
(void)VfsLock();
|
||||
(void)LOS_FsLock();
|
||||
while (curr != NULL) {
|
||||
if ((curr->fsType != NULL) && (fsType != NULL) &&
|
||||
(strcmp(curr->fsType, fsType) == 0)) {
|
||||
(void)VfsUnlock();
|
||||
LOS_FsUnlock();
|
||||
return curr;
|
||||
}
|
||||
curr = curr->next;
|
||||
}
|
||||
|
||||
VfsUnlock();
|
||||
LOS_FsUnlock();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int OsFsRegister(const char *fsType, struct MountOps *fsMops,
|
||||
struct FileOps *fsFops, struct FsManagement *fsMgt)
|
||||
int OsFsRegister(const char *fsType, const struct MountOps *fsMops,
|
||||
const struct FileOps *fsFops, const struct FsManagement *fsMgt)
|
||||
{
|
||||
size_t len;
|
||||
if ((fsMops == NULL) || (fsFops == NULL)) {
|
||||
VFS_ERRNO_SET(EINVAL);
|
||||
return (int)LOS_NOK;
|
||||
}
|
||||
|
||||
struct FsMap *newfs = (struct FsMap *)malloc(sizeof(struct FsMap));
|
||||
struct FsMap *newfs = (struct FsMap *)LOSCFG_FS_MALLOC_HOOK(sizeof(struct FsMap));
|
||||
if (newfs == NULL) {
|
||||
PRINT_ERR("Fs register malloc failed, fsType %s.\n", fsType);
|
||||
VFS_ERRNO_SET(ENOMEM);
|
||||
return (int)LOS_NOK;
|
||||
}
|
||||
(void)memset_s(newfs, sizeof(struct FsMap), 0, sizeof(struct FsMap));
|
||||
|
||||
newfs->fsType = strdup(fsType);
|
||||
len = strlen(fsType) + 1;
|
||||
newfs->fsType = LOSCFG_FS_MALLOC_HOOK(len);
|
||||
if (newfs->fsType == NULL) {
|
||||
free(newfs);
|
||||
LOSCFG_FS_FREE_HOOK(newfs);
|
||||
VFS_ERRNO_SET(ENOMEM);
|
||||
return (int)LOS_NOK;
|
||||
}
|
||||
(void)strcpy_s((char *)newfs->fsType, len, fsType);
|
||||
|
||||
newfs->fsMops = fsMops;
|
||||
newfs->fsFops = fsFops;
|
||||
newfs->fsMgt = fsMgt;
|
||||
newfs->fsRefs = 0;
|
||||
|
||||
(void)VfsLock();
|
||||
(void)LOS_FsLock();
|
||||
newfs->next = g_fsMap;
|
||||
g_fsMap = newfs;
|
||||
|
||||
VfsUnlock();
|
||||
LOS_FsUnlock();
|
||||
return LOS_OK;
|
||||
}
|
||||
|
||||
int LOS_FsRegister(const char *fsType, const struct MountOps *fsMops,
|
||||
const struct FileOps *fsFops, const struct FsManagement *fsMgt)
|
||||
{
|
||||
if (VfsFsMapGet(fsType) != NULL) {
|
||||
PRINT_ERR("fsType has been registered or fsType error\n");
|
||||
VFS_ERRNO_SET(EINVAL);
|
||||
return (int)LOS_NOK;
|
||||
}
|
||||
|
||||
return OsFsRegister(fsType, fsMops, fsFops, fsMgt);
|
||||
}
|
||||
|
||||
@@ -56,8 +56,8 @@ struct FsMap {
|
||||
struct FsMap *next;
|
||||
};
|
||||
|
||||
int OsFsRegister(const char *fsType, struct MountOps *fsMops,
|
||||
struct FileOps *fsFops, struct FsManagement *fsMgt);
|
||||
int OsFsRegister(const char *fsType, const struct MountOps *fsMops,
|
||||
const struct FileOps *fsFops, const struct FsManagement *fsMgt);
|
||||
struct FsMap *VfsFsMapGet(const char *fsType);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -33,6 +33,9 @@
|
||||
#include "vfs_config.h"
|
||||
#include "stdlib.h"
|
||||
#include "string.h"
|
||||
#include "limits.h"
|
||||
#include "errno.h"
|
||||
#include "securec.h"
|
||||
#include "vfs_operations.h"
|
||||
#include "los_compiler.h"
|
||||
#include "los_debug.h"
|
||||
@@ -60,14 +63,13 @@ static void MpDeleteFromList(struct MountPoint *mp)
|
||||
}
|
||||
}
|
||||
|
||||
#if (LOSCFG_FS_SUPPORT_MOUNT_TARGET_RECURSIVE == 1)
|
||||
struct MountPoint *VfsMpFind(const char *path, const char **pathInMp)
|
||||
{
|
||||
struct MountPoint *mp = g_mountPoints;
|
||||
struct MountPoint *bestMp = NULL;
|
||||
int bestMatches = 0;
|
||||
if (path == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (pathInMp != NULL) {
|
||||
*pathInMp = NULL;
|
||||
}
|
||||
@@ -119,53 +121,171 @@ struct MountPoint *VfsMpFind(const char *path, const char **pathInMp)
|
||||
next:
|
||||
mp = mp->mNext;
|
||||
}
|
||||
|
||||
return bestMp;
|
||||
}
|
||||
|
||||
int LOS_FsMount(const char *source, const char *target,
|
||||
const char *fsType, unsigned long mountflags,
|
||||
const void *data)
|
||||
#else
|
||||
struct MountPoint *VfsMpFind(const char *path, const char **pathInMp)
|
||||
{
|
||||
int ret;
|
||||
struct MountPoint *mp = NULL;
|
||||
struct FsMap *mFs = NULL;
|
||||
const char *pathInMp = NULL;
|
||||
struct MountPoint *mp = g_mountPoints;
|
||||
const char *iPath = path;
|
||||
const char *mPath = NULL;
|
||||
const char *target = NULL;
|
||||
|
||||
/* target must begin with '/', for example /system, /data, etc. */
|
||||
if ((target == NULL) || (target[0] != '/')) {
|
||||
return (int)LOS_NOK;
|
||||
if (pathInMp != NULL) {
|
||||
*pathInMp = NULL;
|
||||
}
|
||||
while (*iPath == '/') {
|
||||
++iPath;
|
||||
}
|
||||
|
||||
(void)VfsLock();
|
||||
while ((mp != NULL) && (mp->mPath != NULL)) {
|
||||
mPath = mp->mPath;
|
||||
target = iPath;
|
||||
|
||||
while (*mPath == '/') {
|
||||
++mPath;
|
||||
}
|
||||
|
||||
while ((*mPath != '\0') && (*mPath != '/') &&
|
||||
(*target != '\0') && (*target != '/')) {
|
||||
if (*mPath != *target) {
|
||||
break;
|
||||
}
|
||||
++mPath;
|
||||
++target;
|
||||
}
|
||||
if (((*mPath == '\0') || (*mPath == '/')) &&
|
||||
((*target == '\0') || (*target == '/'))) {
|
||||
if (pathInMp != NULL) {
|
||||
*pathInMp = path;
|
||||
}
|
||||
return mp;
|
||||
}
|
||||
mp = mp->mNext;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
STATIC struct MountPoint *VfsMountPointInit(const char *source, const char *target,
|
||||
const char *fsType, unsigned long mountflags)
|
||||
{
|
||||
struct MountPoint *mp = NULL;
|
||||
const char *pathInMp = NULL;
|
||||
struct FsMap *mFs = NULL;
|
||||
size_t ssize = 0;
|
||||
size_t tsize;
|
||||
|
||||
/* find mp by target, to see if it was mounted */
|
||||
mp = VfsMpFind(target, &pathInMp);
|
||||
if (mp != NULL && pathInMp != NULL) {
|
||||
goto errout;
|
||||
errno = EINVAL;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Find fsMap coresponding to the fsType */
|
||||
mFs = VfsFsMapGet(fsType);
|
||||
if ((mFs == NULL) || (mFs->fsMops == NULL) || (mFs->fsMops->mount == NULL)) {
|
||||
goto errout;
|
||||
errno = ENODEV;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
mp = (struct MountPoint *)malloc(sizeof(struct MountPoint));
|
||||
if (source != NULL) {
|
||||
ssize = strlen(source) + 1;
|
||||
}
|
||||
|
||||
tsize = strlen(target) + 1;
|
||||
|
||||
mp = (struct MountPoint *)LOSCFG_FS_MALLOC_HOOK(sizeof(struct MountPoint) + ssize + tsize);
|
||||
if (mp == NULL) {
|
||||
goto errout;
|
||||
errno = ENOMEM;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
mp->mFs = mFs;
|
||||
mp->mDev = NULL;
|
||||
if (source != NULL) {
|
||||
mp->mDev = strdup(source);
|
||||
if (mp->mDev == NULL) {
|
||||
goto errout;
|
||||
}
|
||||
mp->mRefs = 0;
|
||||
mp->mWriteEnable = (mountflags & MS_RDONLY) ? FALSE : TRUE;
|
||||
mp->mFs->fsRefs++;
|
||||
|
||||
if (source != NULL && strcpy_s((char *)mp + sizeof(struct MountPoint), ssize, source) != EOK) {
|
||||
LOSCFG_FS_FREE_HOOK(mp);
|
||||
errno = ENOMEM;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
mp->mPath = strdup(target);
|
||||
if (mp->mPath == NULL) {
|
||||
goto errout;
|
||||
if (strcpy_s((char *)mp + sizeof(struct MountPoint) + ssize, tsize, target) != EOK) {
|
||||
LOSCFG_FS_FREE_HOOK(mp);
|
||||
errno = ENOMEM;
|
||||
return NULL;
|
||||
}
|
||||
mp->mDev = source ? (char *)mp + sizeof(struct MountPoint) : NULL;
|
||||
mp->mPath = (char *)mp + sizeof(struct MountPoint) + ssize;
|
||||
|
||||
return mp;
|
||||
}
|
||||
|
||||
STATIC int VfsRemount(const char *source, const char *target,
|
||||
const char *fsType, unsigned long mountflags,
|
||||
const void *data)
|
||||
{
|
||||
(VOID)source;
|
||||
(VOID)fsType;
|
||||
struct MountPoint *mp;
|
||||
|
||||
mp = VfsMpFind(target, NULL);
|
||||
if (mp == NULL) {
|
||||
errno = EINVAL;
|
||||
return (int)LOS_NOK;
|
||||
}
|
||||
|
||||
LOS_ASSERT(mp->mFs != NULL);
|
||||
LOS_ASSERT(mp->mFs->fsMops != NULL);
|
||||
LOS_ASSERT(mp->mFs->fsMops->mount != NULL);
|
||||
|
||||
return mp->mFs->fsMops->mount(mp, mountflags, data);
|
||||
}
|
||||
|
||||
STATIC int VfsMountPathCheck(const char *target)
|
||||
{
|
||||
/* target must begin with '/', for example /system, /data, etc. */
|
||||
if ((target == NULL) || (target[0] != '/')) {
|
||||
errno = EINVAL;
|
||||
return (int)LOS_NOK;
|
||||
}
|
||||
|
||||
if (strlen(target) >= PATH_MAX) {
|
||||
errno = ENAMETOOLONG;
|
||||
return (int)LOS_NOK;
|
||||
}
|
||||
|
||||
return LOS_OK;
|
||||
}
|
||||
|
||||
int mount(const char *source, const char *target,
|
||||
const char *fsType, unsigned long mountflags,
|
||||
const void *data)
|
||||
{
|
||||
int ret;
|
||||
struct MountPoint *mp = NULL;
|
||||
|
||||
if (VfsMountPathCheck(target) != LOS_OK) {
|
||||
return (int)LOS_NOK;
|
||||
}
|
||||
|
||||
(void)LOS_FsLock();
|
||||
|
||||
if (mountflags & MS_REMOUNT) {
|
||||
ret = VfsRemount(source, target, fsType, mountflags, data);
|
||||
LOS_FsUnlock();
|
||||
return ret;
|
||||
}
|
||||
|
||||
mp = VfsMountPointInit(source, target, fsType, mountflags);
|
||||
if (mp == NULL) {
|
||||
LOS_FsUnlock();
|
||||
return (int)LOS_NOK;
|
||||
}
|
||||
|
||||
ret = mp->mFs->fsMops->mount(mp, mountflags, data);
|
||||
@@ -174,34 +294,29 @@ int LOS_FsMount(const char *source, const char *target,
|
||||
PRINT_ERR("mount failed, target %s.\n", target);
|
||||
goto errout;
|
||||
}
|
||||
mp->mRefs = 0;
|
||||
mp->mWriteEnable = (mountflags & MS_RDONLY) ? FALSE : TRUE;
|
||||
mp->mFs->fsRefs++;
|
||||
|
||||
mp->mNext = g_mountPoints;
|
||||
g_mountPoints = mp;
|
||||
VfsUnlock();
|
||||
LOS_FsUnlock();
|
||||
return LOS_OK;
|
||||
|
||||
errout:
|
||||
free((void *)mp->mPath);
|
||||
free((void *)mp->mDev);
|
||||
free(mp);
|
||||
VfsUnlock();
|
||||
LOSCFG_FS_FREE_HOOK(mp);
|
||||
LOS_FsUnlock();
|
||||
return (int)LOS_NOK;
|
||||
}
|
||||
|
||||
int LOS_FsUmount(const char *target)
|
||||
int umount(const char *target)
|
||||
{
|
||||
struct MountPoint *mp = NULL;
|
||||
const char *pathInMp = NULL;
|
||||
int ret = (int)LOS_NOK;
|
||||
|
||||
(void)VfsLock();
|
||||
if (target == NULL) {
|
||||
(void)LOS_FsLock();
|
||||
if (VfsMountPathCheck(target) != LOS_OK) {
|
||||
goto errout;
|
||||
}
|
||||
|
||||
mp = VfsMpFind(target, &pathInMp);
|
||||
mp = VfsMpFind(target, NULL);
|
||||
if ((mp == NULL) || (mp->mRefs != 0)) {
|
||||
goto errout;
|
||||
}
|
||||
@@ -220,20 +335,18 @@ int LOS_FsUmount(const char *target)
|
||||
/* delete mp from mount list */
|
||||
MpDeleteFromList(mp);
|
||||
mp->mFs->fsRefs--;
|
||||
free((void *)mp->mPath);
|
||||
free((void *)mp->mDev);
|
||||
free(mp);
|
||||
LOSCFG_FS_FREE_HOOK(mp);
|
||||
|
||||
VfsUnlock();
|
||||
LOS_FsUnlock();
|
||||
return LOS_OK;
|
||||
|
||||
errout:
|
||||
PRINT_ERR("umount2 failed, target %s.\n", target);
|
||||
VfsUnlock();
|
||||
LOS_FsUnlock();
|
||||
return (int)LOS_NOK;
|
||||
}
|
||||
|
||||
static void CloseFdsInMp(struct MountPoint *mp)
|
||||
static void CloseFdsInMp(const struct MountPoint *mp)
|
||||
{
|
||||
for (int fd = 0; fd < NR_OPEN_DEFAULT; fd++) {
|
||||
struct File *f = FdToFile(fd);
|
||||
@@ -248,18 +361,17 @@ static void CloseFdsInMp(struct MountPoint *mp)
|
||||
}
|
||||
}
|
||||
|
||||
int LOS_FsUmount2(const char *target, int flag)
|
||||
int umount2(const char *target, int flag)
|
||||
{
|
||||
struct MountPoint *mp = NULL;
|
||||
const char *pathInMp = NULL;
|
||||
int ret = (int)LOS_NOK;
|
||||
|
||||
(void)VfsLock();
|
||||
if (target == NULL) {
|
||||
(void)LOS_FsLock();
|
||||
if (VfsMountPathCheck(target) != LOS_OK) {
|
||||
goto errout;
|
||||
}
|
||||
|
||||
mp = VfsMpFind(target, &pathInMp);
|
||||
mp = VfsMpFind(target, NULL);
|
||||
if ((mp == NULL) || (mp->mRefs != 0) ||
|
||||
(mp->mFs == NULL) || (mp->mFs->fsMops == NULL) ||
|
||||
(mp->mFs->fsMops->umount2 == NULL)) {
|
||||
@@ -280,15 +392,13 @@ int LOS_FsUmount2(const char *target, int flag)
|
||||
/* delete mp from mount list */
|
||||
MpDeleteFromList(mp);
|
||||
mp->mFs->fsRefs--;
|
||||
free((void *)mp->mPath);
|
||||
free((void *)mp->mDev);
|
||||
free(mp);
|
||||
LOSCFG_FS_FREE_HOOK(mp);
|
||||
|
||||
VfsUnlock();
|
||||
LOS_FsUnlock();
|
||||
return LOS_OK;
|
||||
|
||||
errout:
|
||||
PRINT_ERR("umount2 failed, target %s.\n", target);
|
||||
VfsUnlock();
|
||||
LOS_FsUnlock();
|
||||
return (int)LOS_NOK;
|
||||
}
|
||||
|
||||
@@ -52,8 +52,6 @@ extern "C" {
|
||||
extern UINT32 g_fsMutex;
|
||||
|
||||
int OsVfsInit(void);
|
||||
int VfsLock(void);
|
||||
void VfsUnlock(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
|
||||
@@ -37,6 +37,8 @@
|
||||
#include "stdlib.h"
|
||||
#include "string.h"
|
||||
|
||||
static struct DeviceDesc *g_deviceList = NULL;
|
||||
|
||||
int GetPartIdByPartName(const char *partName)
|
||||
{
|
||||
if (partName == NULL) {
|
||||
@@ -45,7 +47,7 @@ int GetPartIdByPartName(const char *partName)
|
||||
|
||||
/* the character next to p is the partId */
|
||||
char *p = strrchr(partName, 'p');
|
||||
if (p + 1 != NULL) {
|
||||
if (p != NULL) {
|
||||
return atoi(p + 1);
|
||||
}
|
||||
|
||||
@@ -67,16 +69,89 @@ int GetDevIdByDevName(const char *dev)
|
||||
return (int)LOS_NOK;
|
||||
}
|
||||
|
||||
int LOS_DiskPartition(const char *dev, const char *fsType, int *lengthArray,
|
||||
int partnum)
|
||||
struct DeviceDesc *getDeviceList(VOID)
|
||||
{
|
||||
return g_deviceList;
|
||||
}
|
||||
|
||||
static int AddDevice(const char *dev, const char *fsType, int *lengthArray, int *addrArray,
|
||||
int partNum)
|
||||
{
|
||||
size_t len;
|
||||
struct DeviceDesc *prev = NULL;
|
||||
for (prev = g_deviceList; prev != NULL; prev = prev->dNext) {
|
||||
if (strcmp(prev->dDev, dev) == 0) {
|
||||
errno = -EEXIST;
|
||||
return (int)LOS_NOK;
|
||||
}
|
||||
}
|
||||
|
||||
if (addrArray == NULL) {
|
||||
errno = -EFAULT;
|
||||
return (int)LOS_NOK;
|
||||
}
|
||||
|
||||
prev = (struct DeviceDesc *)LOSCFG_FS_MALLOC_HOOK(sizeof(struct DeviceDesc));
|
||||
if (prev == NULL) {
|
||||
errno = -ENOMEM;
|
||||
return (int)LOS_NOK;
|
||||
}
|
||||
len = strlen(dev) + 1;
|
||||
prev->dDev = LOSCFG_FS_MALLOC_HOOK(len);
|
||||
len = strlen(fsType) + 1;
|
||||
prev->dFsType = LOSCFG_FS_MALLOC_HOOK(len);
|
||||
prev->dAddrArray = (int *)LOSCFG_FS_MALLOC_HOOK(partNum * sizeof(int));
|
||||
if (prev->dDev == NULL || prev->dFsType == NULL || prev->dAddrArray == NULL) {
|
||||
goto errout;
|
||||
}
|
||||
(void)strcpy_s((char *)prev->dDev, len, dev);
|
||||
(void)strcpy_s((char *)prev->dFsType, len, fsType);
|
||||
(void)memcpy_s(prev->dAddrArray, partNum * sizeof(int), addrArray, partNum * sizeof(int));
|
||||
|
||||
if (lengthArray != NULL) {
|
||||
prev->dLengthArray = (int *)LOSCFG_FS_MALLOC_HOOK(partNum * sizeof(int));
|
||||
if (prev->dLengthArray == NULL) {
|
||||
goto errout;
|
||||
}
|
||||
(void)memcpy_s(prev->dLengthArray, partNum * sizeof(int), lengthArray, partNum * sizeof(int));
|
||||
}
|
||||
|
||||
prev->dNext = g_deviceList;
|
||||
prev->dPartNum = partNum;
|
||||
g_deviceList = prev;
|
||||
return LOS_OK;
|
||||
errout:
|
||||
if (prev->dDev != NULL) {
|
||||
LOSCFG_FS_FREE_HOOK((void *)prev->dDev);
|
||||
}
|
||||
if (prev->dFsType != NULL) {
|
||||
LOSCFG_FS_FREE_HOOK((void *)prev->dFsType);
|
||||
}
|
||||
if (prev->dAddrArray != NULL) {
|
||||
LOSCFG_FS_FREE_HOOK((void *)prev->dAddrArray);
|
||||
}
|
||||
if (prev->dLengthArray != NULL) {
|
||||
LOSCFG_FS_FREE_HOOK((void *)prev->dLengthArray);
|
||||
}
|
||||
|
||||
LOSCFG_FS_FREE_HOOK(prev);
|
||||
errno = -ENOMEM;
|
||||
return (int)LOS_NOK;
|
||||
}
|
||||
|
||||
|
||||
int LOS_DiskPartition(const char *dev, const char *fsType, int *lengthArray, int *addrArray,
|
||||
int partNum)
|
||||
{
|
||||
int ret = (int)LOS_NOK;
|
||||
struct FsMap *fMap = VfsFsMapGet(fsType);
|
||||
if ((fMap != NULL) && (fMap->fsMgt != NULL) &&
|
||||
(fMap->fsMgt->fdisk != NULL)) {
|
||||
ret = fMap->fsMgt->fdisk(dev, lengthArray, partnum);
|
||||
ret = fMap->fsMgt->fdisk(dev, lengthArray, partNum);
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = AddDevice(dev, fsType, lengthArray, addrArray, partNum);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -88,8 +163,7 @@ int LOS_PartitionFormat(const char *partName, char *fsType, void *data)
|
||||
format is not allowed when the device has been mounted. */
|
||||
struct MountPoint *iter = NULL;
|
||||
LOS_MP_FOR_EACH_ENTRY(iter) {
|
||||
if ((iter->mFs != NULL) && (iter->mFs->fsType != NULL) &&
|
||||
strcmp(iter->mFs->fsType, fsType) == 0) {
|
||||
if ((iter->mPath != NULL) && (strcmp(iter->mPath, partName) == 0)) {
|
||||
errno = EBUSY;
|
||||
return (int)LOS_NOK;
|
||||
}
|
||||
@@ -100,5 +174,6 @@ int LOS_PartitionFormat(const char *partName, char *fsType, void *data)
|
||||
(fMap->fsMgt->format != NULL)) {
|
||||
ret = fMap->fsMgt->format(partName, data);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -31,6 +31,8 @@
|
||||
#ifndef _VFS_PARTITION_H_
|
||||
#define _VFS_PARTITION_H_
|
||||
|
||||
#include "los_compiler.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
extern "C" {
|
||||
@@ -41,6 +43,19 @@ extern "C" {
|
||||
|
||||
int GetPartIdByPartName(const char *partName);
|
||||
int GetDevIdByDevName(const char *dev);
|
||||
struct DeviceDesc *getDeviceList(void);
|
||||
|
||||
struct DeviceDesc {
|
||||
struct FsMap *dFs; /* file system info */
|
||||
struct DeviceDesc *dNext; /* point to next mount point */
|
||||
const char *dPath; /* target path, /system, /usr, etc. */
|
||||
const char *dDev; /* device, "emmc0p0", "emmc0p1", etc. */
|
||||
void *dData; /* specific file system handle */
|
||||
const char *dFsType; /* file system type */
|
||||
int *dLengthArray; /* point to device partitions length array */
|
||||
int *dAddrArray; /* point to device partitions address array */
|
||||
int dPartNum; /* number of device partitions */
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
|
||||
@@ -93,20 +93,25 @@ EXIT:
|
||||
STATIC LmsMemListNode *OsLmsGetPoolNodeFromAddr(UINTPTR addr)
|
||||
{
|
||||
LmsMemListNode *current = NULL;
|
||||
LmsMemListNode *previous = NULL;
|
||||
LOS_DL_LIST *listHead = &g_lmsCheckPoolList;
|
||||
|
||||
if (LOS_ListEmpty(&g_lmsCheckPoolList)) {
|
||||
goto EXIT;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
LOS_DL_LIST_FOR_EACH_ENTRY(current, listHead, LmsMemListNode, node) {
|
||||
if ((addr >= current->poolAddr) && (addr < current->poolAddr + current->poolSize)) {
|
||||
return current;
|
||||
if ((addr < current->poolAddr) || (addr >= (current->poolAddr + current->poolSize))) {
|
||||
continue;
|
||||
}
|
||||
if ((previous == NULL) ||
|
||||
((previous->poolAddr <= current->poolAddr) &&
|
||||
((current->poolAddr + current->poolSize) <= (previous->poolAddr + previous->poolSize)))) {
|
||||
previous = current;
|
||||
}
|
||||
}
|
||||
|
||||
EXIT:
|
||||
return NULL;
|
||||
return previous;
|
||||
}
|
||||
|
||||
STATIC LmsMemListNode *OsLmsCheckPoolCreate(VOID)
|
||||
@@ -136,18 +141,12 @@ UINT32 LOS_LmsCheckPoolAdd(const VOID *pool, UINT32 size)
|
||||
|
||||
LMS_LOCK(intSave);
|
||||
|
||||
lmsPoolNode = OsLmsGetPoolNodeFromAddr((UINTPTR)pool);
|
||||
if (lmsPoolNode != NULL) { /* if pool range already on checklist */
|
||||
if (lmsPoolNode->poolAddr != (UINTPTR)pool) { /* pool is a subset of lmsPoolNode->poolAddr */
|
||||
/* do not add it again, just return */
|
||||
PRINT_DEBUG("[LMS]pool %p already on lms checklist !\n", pool);
|
||||
LMS_UNLOCK(intSave);
|
||||
return size; /* return size indicate the shadow memory init successful */
|
||||
} else { /* Re-initialize the same pool, maybe with different size */
|
||||
/* delete the old node, then add a new one */
|
||||
lmsPoolNode->used = LMS_POOL_UNUSED;
|
||||
LOS_ListDelete(&(lmsPoolNode->node));
|
||||
}
|
||||
lmsPoolNode = OsLmsGetPoolNode(pool);
|
||||
if (lmsPoolNode != NULL) { /* if pool already on checklist */
|
||||
/* Re-initialize the same pool, maybe with different size */
|
||||
/* delete the old node, then add a new one */
|
||||
lmsPoolNode->used = LMS_POOL_UNUSED;
|
||||
LOS_ListDelete(&(lmsPoolNode->node));
|
||||
}
|
||||
|
||||
lmsPoolNode = OsLmsCheckPoolCreate();
|
||||
@@ -163,7 +162,7 @@ UINT32 LOS_LmsCheckPoolAdd(const VOID *pool, UINT32 size)
|
||||
lmsPoolNode->shadowStart = (UINTPTR)poolAddr + realSize;
|
||||
lmsPoolNode->shadowSize = poolAddr + size - lmsPoolNode->shadowStart;
|
||||
/* init shadow value */
|
||||
(VOID)memset((VOID *)lmsPoolNode->shadowStart, LMS_SHADOW_AFTERFREE_U8, lmsPoolNode->shadowSize);
|
||||
(VOID)memset_s((VOID *)lmsPoolNode->shadowStart, lmsPoolNode->shadowSize, LMS_SHADOW_AFTERFREE_U8, lmsPoolNode->shadowSize);
|
||||
|
||||
LOS_ListAdd(&g_lmsCheckPoolList, &(lmsPoolNode->node));
|
||||
|
||||
@@ -182,21 +181,22 @@ VOID LOS_LmsCheckPoolDel(const VOID *pool)
|
||||
LmsMemListNode *delNode = OsLmsGetPoolNode(pool);
|
||||
if (delNode == NULL) {
|
||||
PRINT_ERR("[LMS]pool %p is not on lms checklist !\n", pool);
|
||||
goto REALEASE;
|
||||
goto RELEASE;
|
||||
}
|
||||
delNode->used = LMS_POOL_UNUSED;
|
||||
LOS_ListDelete(&(delNode->node));
|
||||
|
||||
REALEASE:
|
||||
RELEASE:
|
||||
LMS_UNLOCK(intSave);
|
||||
}
|
||||
|
||||
VOID OsLmsInit(VOID)
|
||||
{
|
||||
memset(g_lmsCheckPoolArray, 0, sizeof(g_lmsCheckPoolArray));
|
||||
(VOID)memset_s(g_lmsCheckPoolArray, sizeof(g_lmsCheckPoolArray), 0, sizeof(g_lmsCheckPoolArray));
|
||||
LOS_ListInit(&g_lmsCheckPoolList);
|
||||
static LmsHook hook = {
|
||||
.init = LOS_LmsCheckPoolAdd,
|
||||
.deInit = LOS_LmsCheckPoolDel,
|
||||
.mallocMark = OsLmsLosMallocMark,
|
||||
.freeMark = OsLmsLosFreeMark,
|
||||
.simpleMark = OsLmsSimpleMark,
|
||||
@@ -284,7 +284,7 @@ VOID OsLmsSetShadowValue(LmsMemListNode *node, UINTPTR startAddr, UINTPTR endAdd
|
||||
}
|
||||
|
||||
if (shadowEnd + 1 > shadowStart) {
|
||||
memset((VOID *)shadowStart, value & LMS_SHADOW_MASK_U8, shadowEnd + 1 - shadowStart);
|
||||
(VOID)memset((VOID *)shadowStart, value & LMS_SHADOW_MASK_U8, shadowEnd + 1 - shadowStart);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -609,7 +609,7 @@ VOID OsLmsReportError(UINTPTR p, UINT32 size, UINT32 errMod)
|
||||
|
||||
LMS_LOCK(intSave);
|
||||
g_checkDepth += 1;
|
||||
memset(&info, 0, sizeof(LmsAddrInfo));
|
||||
(VOID)memset_s(&info, sizeof(LmsAddrInfo), 0, sizeof(LmsAddrInfo));
|
||||
|
||||
PRINT_ERR("***** Kernel Address Sanitizer Error Detected Start *****\n");
|
||||
|
||||
|
||||
@@ -95,6 +95,7 @@ typedef struct {
|
||||
|
||||
typedef struct {
|
||||
UINT32 (*init)(const VOID *pool, UINT32 size);
|
||||
VOID (*deInit)(const VOID *pool);
|
||||
VOID (*mallocMark)(const VOID *curNodeStart, const VOID *nextNodeStart, UINT32 nodeHeadSize);
|
||||
VOID (*freeMark)(const VOID *curNodeStart, const VOID *nextNodeStart, UINT32 nodeHeadSize);
|
||||
VOID (*simpleMark)(UINTPTR startAddr, UINTPTR endAddr, UINT32 value);
|
||||
@@ -133,4 +134,4 @@ extern SANITIZER_INTERFACE_ATTRIBUTE VOID __asan_handle_no_return(VOID);
|
||||
#endif /* __cplusplus */
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* _LOS_LMS_PRI_H */
|
||||
#endif /* _LOS_LMS_PRI_H */
|
||||
|
||||
@@ -34,7 +34,7 @@ module_switch = defined(LOSCFG_NET_LWIP_SACK)
|
||||
module_name = "lwip"
|
||||
kernel_module(module_name) {
|
||||
sources = LWIP_PORTING_FILES + LWIPNOAPPSFILES - [ "$LWIPDIR/api/sockets.c" ]
|
||||
include_dirs = [ "//utils/native/lite/include" ]
|
||||
include_dirs = [ "//commonlibrary/utils_lite/include" ]
|
||||
}
|
||||
|
||||
config("public") {
|
||||
|
||||
@@ -125,7 +125,7 @@ int ip6addr_aton(const char *cp, ip6_addr_t *addr)
|
||||
int squash_pos = ipv6_blocks;
|
||||
int i;
|
||||
const unsigned char *sc = (const unsigned char *)cp;
|
||||
const char *ss = cp-1;
|
||||
const unsigned char *ss = (const unsigned char *)(cp - 1);
|
||||
|
||||
for (; ; sc++) {
|
||||
if (current_block_index >= ipv6_blocks) {
|
||||
@@ -142,7 +142,7 @@ int ip6addr_aton(const char *cp, ip6_addr_t *addr)
|
||||
break;
|
||||
} else if (*sc == ':') {
|
||||
if (sc - ss == 1) {
|
||||
if (sc != cp || sc[1] != ':') {
|
||||
if (sc != (const unsigned char *)cp || sc[1] != ':') {
|
||||
return 0; // address begins with a single ':' or contains ":::"
|
||||
} // else address begins with one valid "::"
|
||||
} else {
|
||||
@@ -163,7 +163,7 @@ int ip6addr_aton(const char *cp, ip6_addr_t *addr)
|
||||
#if LWIP_IPV4
|
||||
} else if (*sc == '.' && current_block_index < ipv6_blocks - 1) {
|
||||
ip4_addr_t ip4;
|
||||
int ret = ip4addr_aton(ss+1, &ip4);
|
||||
int ret = ip4addr_aton((const char *)(ss + 1), &ip4);
|
||||
if (!ret) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -240,4 +240,7 @@
|
||||
#define LWIP_SOCKET_OFFSET CONFIG_NFILE_DESCRIPTORS
|
||||
#endif
|
||||
|
||||
#define LWIP_SOCKET_IOCTL 0
|
||||
#define LWIP_SOCKET_FCNTL 0
|
||||
|
||||
#endif /* _LWIP_PORTING_LWIPOPTS_H_ */
|
||||
|
||||
@@ -79,7 +79,7 @@ struct ifconfig_option {
|
||||
unsigned char ethaddr[6];
|
||||
u16_t mtu;
|
||||
/* when using telnet, print to the telnet socket will result in system */
|
||||
/* deadlock. So we cahe the prinf data to a buf, and when the tcpip */
|
||||
/* deadlock. So we cache the prinf data to a buf, and when the tcpip */
|
||||
/* callback returns, then print the data out to the telnet socket */
|
||||
sys_sem_t cb_completed;
|
||||
char cb_print_buf[PRINT_BUF_LEN];
|
||||
@@ -319,7 +319,7 @@ LWIP_STATIC int OsPingFunc(u32_t *parg)
|
||||
u32_t succ_cnt = 0;
|
||||
u32_t failed_cnt = 0;
|
||||
struct timespec start, end;
|
||||
long timout_ms;
|
||||
long timeout_ms;
|
||||
struct pollfd pfd;
|
||||
long rtt;
|
||||
int ret = 0;
|
||||
@@ -373,7 +373,10 @@ LWIP_STATIC int OsPingFunc(u32_t *parg)
|
||||
while (!ping_kill && (forever || (i < cnt))) {
|
||||
iecho->seqno = htons((u16_t)i);
|
||||
iecho->chksum = 0;
|
||||
|
||||
#if (CHECKSUM_GEN_ICMP > 0)
|
||||
iecho->chksum = inet_chksum((void *)iecho, iecho_len);
|
||||
#endif
|
||||
|
||||
ret = sendto(sfd, iecho, iecho_len, 0, (struct sockaddr *)&to, (socklen_t)sizeof(to));
|
||||
if (ret < 0) {
|
||||
@@ -428,17 +431,17 @@ LWIP_STATIC int OsPingFunc(u32_t *parg)
|
||||
((ICMPH_TYPE(iecho_resp) == ICMP_ECHO) && (iphdr_resp->src.addr == to.sin_addr.s_addr))) {
|
||||
/* second type timeout event */
|
||||
(void)clock_gettime(CLOCK_MONOTONIC_RAW, &end);
|
||||
timout_ms = ((end.tv_sec - start.tv_sec) * OS_SYS_MS_PER_SECOND + \
|
||||
timeout_ms = ((end.tv_sec - start.tv_sec) * OS_SYS_MS_PER_SECOND + \
|
||||
(end.tv_nsec - start.tv_nsec) / OS_SYS_NS_PER_MS);
|
||||
timout_ms = LWIP_SHELL_CMD_PING_TIMEOUT - timout_ms;
|
||||
timeout_ms = LWIP_SHELL_CMD_PING_TIMEOUT - timeout_ms;
|
||||
} else {
|
||||
timout_ms = 0;
|
||||
timeout_ms = 0;
|
||||
break;
|
||||
}
|
||||
} while (timout_ms >= 0);
|
||||
} while (timeout_ms >= 0);
|
||||
|
||||
/* all timeout events are true timeout */
|
||||
if ((timout_ms < 0) || (timeout_flag == TRUE)) {
|
||||
if ((timeout_ms < 0) || (timeout_flag == TRUE)) {
|
||||
failed_cnt++;
|
||||
i++;
|
||||
PRINTK("\nPing: destination unreachable ...");
|
||||
@@ -469,8 +472,9 @@ LWIP_STATIC int OsPingFunc(u32_t *parg)
|
||||
}
|
||||
intrvl -= 1000; /* 1000: 1000ms = 1s */
|
||||
sys_msleep(1000); /* 1000: 1000ms = 1s */
|
||||
if (ping_kill == 1)
|
||||
if (ping_kill == 1) {
|
||||
break;
|
||||
}
|
||||
} while (intrvl > 0);
|
||||
succ_cnt++;
|
||||
break;
|
||||
@@ -528,7 +532,7 @@ u32_t OsShellPing(int argc, const char **argv)
|
||||
{
|
||||
int ret;
|
||||
u32_t i = 0;
|
||||
u32_t count = 0;
|
||||
u32_t count;
|
||||
int count_set = 0;
|
||||
u32_t interval = 1000; /* default ping interval */
|
||||
u32_t data_len = 48; /* default data length */
|
||||
|
||||
@@ -33,7 +33,8 @@
|
||||
#include <stdlib.h>
|
||||
#include "lwip/tcpip.h"
|
||||
#include "ohos_init.h"
|
||||
void TcpIpPortingInit()
|
||||
|
||||
void TcpIpPortingInit(void)
|
||||
{
|
||||
tcpip_init(NULL, NULL);
|
||||
}
|
||||
|
||||
@@ -211,6 +211,7 @@ int close(int fd)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if LWIP_SOCKET_IOCTL
|
||||
#ifdef LWIP_SOCKET_IOCTL_FUNC
|
||||
int ioctl(int fd, int req, ...)
|
||||
{
|
||||
@@ -222,7 +223,9 @@ int ioctl(int fd, int req, ...)
|
||||
return lwip_ioctl(fd, (long)req, (void *)arg);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if LWIP_SOCKET_FCNTL
|
||||
#ifdef LWIP_SOCKET_FCNTL_FUNC
|
||||
int fcntl(int fd, int cmd, ...)
|
||||
{
|
||||
@@ -234,6 +237,7 @@ int fcntl(int fd, int cmd, ...)
|
||||
return lwip_fcntl(fd, cmd, val);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if LWIP_SOCKET_SELECT
|
||||
#ifdef LWIP_SOCKET_SELECT_FUNC
|
||||
|
||||
@@ -101,21 +101,27 @@ STATIC VOID OsPmTickTimerStart(LosPmCB *pm)
|
||||
}
|
||||
|
||||
#if (LOSCFG_BASE_CORE_TICK_WTIMER == 0)
|
||||
if ((tickTimer->timerStop != NULL) && (pm->enterSleepTime != 0)) {
|
||||
/* Restore the main CPU frequency */
|
||||
sleepTime = tickTimer->timerCycleGet();
|
||||
tickTimer->timerStop();
|
||||
if (tickTimer->timerStop != NULL) {
|
||||
if (pm->enterSleepTime != 0) {
|
||||
/* Restore the main CPU frequency */
|
||||
sleepTime = tickTimer->timerCycleGet();
|
||||
tickTimer->timerStop();
|
||||
|
||||
realSleepTime = OS_SYS_CYCLE_TO_NS(sleepTime, tickTimer->freq);
|
||||
realSleepTime = OS_SYS_NS_TO_CYCLE(realSleepTime, g_sysClock);
|
||||
currTime = pm->enterSleepTime + realSleepTime;
|
||||
pm->enterSleepTime = 0;
|
||||
realSleepTime = OS_SYS_CYCLE_TO_NS(sleepTime, tickTimer->freq);
|
||||
realSleepTime = OS_SYS_NS_TO_CYCLE(realSleepTime, g_sysClock);
|
||||
currTime = pm->enterSleepTime + realSleepTime;
|
||||
pm->enterSleepTime = 0;
|
||||
|
||||
OsTickTimerBaseReset(currTime);
|
||||
OsSchedResetSchedResponseTime(0);
|
||||
OsTickTimerBaseReset(currTime);
|
||||
OsSchedResetSchedResponseTime(0);
|
||||
/* Restart the system tick timer */
|
||||
tickTimer->tickUnlock();
|
||||
}
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Restore the system tick timer */
|
||||
tickTimer->tickUnlock();
|
||||
return;
|
||||
}
|
||||
@@ -129,7 +135,8 @@ STATIC BOOL OsPmTickTimerStop(LosPmCB *pm)
|
||||
#endif
|
||||
LosPmTickTimer *tickTimer = pm->tickTimer;
|
||||
|
||||
if ((tickTimer == NULL) || (tickTimer->tickLock == NULL)) {
|
||||
if ((tickTimer == NULL) || (tickTimer->tickLock == NULL) ||
|
||||
(pm->sysMode == LOS_SYS_NORMAL_SLEEP)) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -141,14 +148,21 @@ STATIC BOOL OsPmTickTimerStop(LosPmCB *pm)
|
||||
sleepCycle = OS_SYS_CYCLE_TO_NS(realSleepTime, g_sysClock);
|
||||
sleepCycle = OS_SYS_NS_TO_CYCLE(sleepCycle, tickTimer->freq);
|
||||
|
||||
if (sleepCycle == 0) {
|
||||
pm->sysMode = LOS_SYS_NORMAL_SLEEP;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* The main CPU reduces the frequency */
|
||||
pm->enterSleepTime = LOS_SysCycleGet();
|
||||
/* Turn off the system tick timer and clear the count value to zero */
|
||||
tickTimer->tickLock();
|
||||
tickTimer->timerStart(sleepCycle);
|
||||
return TRUE;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Pause the system tick timer */
|
||||
tickTimer->tickLock();
|
||||
return TRUE;
|
||||
}
|
||||
@@ -166,8 +180,7 @@ STATIC VOID OsPmCpuResume(LosPmCB *pm)
|
||||
|
||||
STATIC VOID OsPmCpuSuspend(LosPmCB *pm)
|
||||
{
|
||||
/* cpu enter low power mode */
|
||||
LOS_ASSERT(pm->sysctrl != NULL);
|
||||
/* cpu enter low-power mode */
|
||||
|
||||
if (pm->sysMode == LOS_SYS_NORMAL_SLEEP) {
|
||||
pm->sysctrl->normalSuspend();
|
||||
@@ -226,6 +239,8 @@ STATIC UINT32 OsPmSuspendCheck(LosPmCB *pm, Suspend *sysSuspendEarly, Suspend *d
|
||||
return LOS_NOK;
|
||||
}
|
||||
|
||||
LOS_ASSERT(pm->sysctrl != NULL);
|
||||
|
||||
pm->isWake = FALSE;
|
||||
*mode = pm->sysMode;
|
||||
*sysSuspendEarly = pm->sysctrl->early;
|
||||
@@ -260,6 +275,11 @@ STATIC UINT32 OsPmSuspendSleep(LosPmCB *pm)
|
||||
goto EXIT;
|
||||
}
|
||||
|
||||
if (pm->sysctrl->suspendCheck != NULL) {
|
||||
pm->sysctrl->suspendCheck(mode);
|
||||
pm->sysMode = pm->pmMode;
|
||||
}
|
||||
|
||||
tickTimerStop = OsPmTickTimerStop(pm);
|
||||
if (!tickTimerStop) {
|
||||
OsSchedResetSchedResponseTime(0);
|
||||
@@ -283,6 +303,9 @@ EXIT:
|
||||
|
||||
STATIC VOID OsPmNormalSleep(VOID)
|
||||
{
|
||||
#if (LOSCFG_KERNEL_PM_IDLE == 1)
|
||||
(VOID)LOS_PmSuspend(0);
|
||||
#else
|
||||
UINT32 intSave;
|
||||
LosPmCB *pm = &g_pmCB;
|
||||
|
||||
@@ -293,6 +316,7 @@ STATIC VOID OsPmNormalSleep(VOID)
|
||||
OsPmCpuResume(pm);
|
||||
|
||||
LOS_IntRestore(intSave);
|
||||
#endif
|
||||
}
|
||||
|
||||
STATIC UINT32 OsPmDeviceRegister(LosPmCB *pm, LosPmDevice *device)
|
||||
@@ -343,6 +367,9 @@ STATIC UINT32 OsPmSysctrlRegister(LosPmCB *pm, LosPmSysctrl *sysctrl)
|
||||
if (sysctrl->late != NULL) {
|
||||
pm->sysctrl->late = sysctrl->late;
|
||||
}
|
||||
if (sysctrl->suspendCheck != NULL) {
|
||||
pm->sysctrl->suspendCheck = sysctrl->suspendCheck;
|
||||
}
|
||||
if (sysctrl->normalSuspend != NULL) {
|
||||
pm->sysctrl->normalSuspend = sysctrl->normalSuspend;
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
|
||||
/**
|
||||
* @ingroup los_pm
|
||||
* Pm error code: Invalid low power mode.
|
||||
* Pm error code: Invalid low-power mode.
|
||||
*
|
||||
* Value: 0x02002001
|
||||
*
|
||||
@@ -141,21 +141,33 @@ typedef enum {
|
||||
} LOS_PmNodeType;
|
||||
|
||||
typedef struct {
|
||||
UINT32 (*suspend)(UINT32 mode); /* The device enters low power consumption, Unlocked task scheduling. */
|
||||
VOID (*resume)(UINT32 mode); /* The device exits from low power consumption, Unlocked task scheduling. */
|
||||
UINT32 (*suspend)(UINT32 mode); /* The device enters low-power consumption, Unlocked task scheduling. */
|
||||
VOID (*resume)(UINT32 mode); /* The device exits from low-power consumption, Unlocked task scheduling. */
|
||||
} LosPmDevice;
|
||||
|
||||
typedef struct {
|
||||
UINT32 freq; /* The frequency of the low power timer */
|
||||
VOID (*timerStart)(UINT64); /* Start the low power timer */
|
||||
VOID (*timerStop)(VOID); /* Stop the low power timer */
|
||||
UINT64 (*timerCycleGet)(VOID); /* Gets the running time of the low power timer in unit cycle */
|
||||
VOID (*tickLock)(VOID); /* Pause the system tick timer */
|
||||
VOID (*tickUnlock)(VOID); /* Restore the system tick timer */
|
||||
/* Low-power timer related implementation functions.
|
||||
* The function is not NULL, the low-power timer is enabled.
|
||||
*/
|
||||
UINT32 freq; /* The frequency of the low-power timer */
|
||||
VOID (*timerStart)(UINT64); /* Start the low-power timer and set the response period */
|
||||
VOID (*timerStop)(VOID); /* Turn off the low-power timer */
|
||||
UINT64 (*timerCycleGet)(VOID); /* Gets the time the system sleeps */
|
||||
|
||||
/* When the low-power timer is enabled, the function of tickLock is to turn off the system tick timer and
|
||||
* clear the timer's count value to zero.
|
||||
* When the low-power timer is disabled, the function of tickLock is to pause the system timer.
|
||||
*/
|
||||
VOID (*tickLock)(VOID);
|
||||
|
||||
/* When the low-power timer is enabled, the function of tickUnlock is to restart the system tick timer.
|
||||
* When the low-power timer is disabled, the function of tickUnlock is to restore the system tick timer.
|
||||
*/
|
||||
VOID (*tickUnlock)(VOID);
|
||||
} LosPmTickTimer;
|
||||
|
||||
typedef struct {
|
||||
/* Preparations before the CPU enters low power consumption.
|
||||
/* Preparations before the CPU enters low-power consumption.
|
||||
* All modes except normal mode are invoked.
|
||||
* Unlocked task scheduling.
|
||||
*/
|
||||
@@ -165,6 +177,8 @@ typedef struct {
|
||||
* Unlocked task scheduling.
|
||||
*/
|
||||
VOID (*late)(UINT32 mode);
|
||||
/* Final check before low-power consumption. */
|
||||
VOID (*suspendCheck)(UINT32 mode);
|
||||
/* The system enters the Normal sleep mode.
|
||||
* In normal mode, the value cannot be NULL.
|
||||
*/
|
||||
@@ -201,10 +215,10 @@ typedef struct {
|
||||
|
||||
/**
|
||||
* @ingroup los_pm
|
||||
* @brief Initialize system low power frame.
|
||||
* @brief Initialize system low-power frame.
|
||||
*
|
||||
* @par Description:
|
||||
* This API is used to initialize the system low power frame.
|
||||
* This API is used to initialize the system low-power frame.
|
||||
*
|
||||
* @attention None.
|
||||
*
|
||||
@@ -219,10 +233,10 @@ UINT32 OsPmInit(VOID);
|
||||
|
||||
/**
|
||||
* @ingroup los_pm
|
||||
* @brief Whether the low power consumption condition is met.
|
||||
* @brief Whether the low-power consumption condition is met.
|
||||
*
|
||||
* @par Description:
|
||||
* This API is used to check whether low power consumption is met.
|
||||
* This API is used to check whether low-power consumption is met.
|
||||
*
|
||||
* @attention None.
|
||||
*
|
||||
@@ -300,10 +314,10 @@ VOID LOS_PmWakeSet(VOID);
|
||||
|
||||
/**
|
||||
* @ingroup los_pm
|
||||
* @brief Get the low power mode of the current system.
|
||||
* @brief Get the low-power mode of the current system.
|
||||
*
|
||||
* @par Description:
|
||||
* This API is used to get the low power mode of the current system.
|
||||
* This API is used to get the low-power mode of the current system.
|
||||
*
|
||||
* @attention None.
|
||||
*
|
||||
@@ -318,14 +332,14 @@ LOS_SysSleepEnum LOS_PmModeGet(VOID);
|
||||
|
||||
/**
|
||||
* @ingroup los_pm
|
||||
* @brief Set low power mode.
|
||||
* @brief Set low-power mode.
|
||||
*
|
||||
* @par Description:
|
||||
* This API is used to set low power mode.
|
||||
* This API is used to set low-power mode.
|
||||
*
|
||||
* @attention None.
|
||||
*
|
||||
* @param mode [IN] low power mode.
|
||||
* @param mode [IN] low-power mode.
|
||||
*
|
||||
* @retval error code, LOS_OK means success.
|
||||
* @par Dependency:
|
||||
|
||||
@@ -67,7 +67,7 @@ int SysUserTaskCreate(unsigned long entry, unsigned long userArea, unsigned long
|
||||
|
||||
int SysSchedSetScheduler(unsigned int tid, int policy, int priority)
|
||||
{
|
||||
if ((tid <= 0) || (tid > LOSCFG_BASE_CORE_TSK_LIMIT)) {
|
||||
if ((tid == 0) || (tid > LOSCFG_BASE_CORE_TSK_LIMIT)) {
|
||||
return EINVAL;
|
||||
}
|
||||
|
||||
@@ -92,7 +92,7 @@ int *SysSchedGetArea(unsigned int tid)
|
||||
unsigned int intSave;
|
||||
int *area = NULL;
|
||||
|
||||
if ((tid <= 0) || (tid > LOSCFG_BASE_CORE_TSK_LIMIT)) {
|
||||
if ((tid == 0) || (tid > LOSCFG_BASE_CORE_TSK_LIMIT)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -19,6 +19,11 @@ config SHELL_PRIO
|
||||
range 1 31
|
||||
depends on SHELL
|
||||
|
||||
config SHELL_STACK_SIZE
|
||||
int "Shell Task Stack Size"
|
||||
default 4096
|
||||
depends on SHELL
|
||||
|
||||
config SHELL_LK
|
||||
bool "Enable Shell lk"
|
||||
default y
|
||||
|
||||
@@ -43,6 +43,10 @@
|
||||
#include "los_debugtools.h"
|
||||
#endif
|
||||
|
||||
#if (LOSCFG_KERNEL_TRACE == 1)
|
||||
#include "los_trace_pri.h"
|
||||
#endif
|
||||
|
||||
#define SHELL_INIT_MAGIC_FLAG 0xABABABAB
|
||||
|
||||
STATIC CmdModInfo cmdInfo;
|
||||
@@ -75,6 +79,13 @@ CmdItem g_shellcmdAll[] = {
|
||||
{CMD_TYPE_EX, "st", 1, (CmdCallBackFunc)OsShellCmdSchedTrace},
|
||||
#endif
|
||||
{CMD_TYPE_EX, "help", 0, (CmdCallBackFunc)OsShellCmdHelp},
|
||||
#if (LOSCFG_KERNEL_TRACE == 1)
|
||||
{CMD_TYPE_EX, "trace_start", 0, (CmdCallBackFunc)LOS_TraceStart},
|
||||
{CMD_TYPE_EX, "trace_stop", 0, (CmdCallBackFunc)LOS_TraceStop},
|
||||
{CMD_TYPE_EX, "trace_mask", 1, (CmdCallBackFunc)OsShellCmdTraceSetMask},
|
||||
{CMD_TYPE_EX, "trace_reset", 0, (CmdCallBackFunc)LOS_TraceReset},
|
||||
{CMD_TYPE_EX, "trace_dump", 1, (CmdCallBackFunc)OsShellCmdTraceDump},
|
||||
#endif
|
||||
};
|
||||
|
||||
CmdModInfo *OsCmdInfoGet(VOID)
|
||||
|
||||
@@ -258,7 +258,7 @@ LITE_OS_SEC_TEXT_MINOR UINT32 LosShellInit(VOID)
|
||||
}
|
||||
|
||||
task1.pfnTaskEntry = (TSK_ENTRY_FUNC)ShellTaskEntry;
|
||||
task1.uwStackSize = 0x1000;
|
||||
task1.uwStackSize = LOSCFG_SHELL_STACK_SIZE;
|
||||
task1.pcName = "ShellTaskEntry";
|
||||
task1.usTaskPrio = LOSCFG_SHELL_PRIO;
|
||||
ret = LOS_TaskCreate(&taskID1, &task1);
|
||||
|
||||
@@ -82,7 +82,6 @@ LITE_OS_SEC_TEXT_MINOR UINT32 OsShellCmdFree(INT32 argc, const CHAR *argv[])
|
||||
#if (LOSCFG_MEM_WATERLINE == 1)
|
||||
LITE_OS_SEC_TEXT_MINOR UINT32 OsShellCmdWaterLine(INT32 argc, const CHAR *argv[])
|
||||
{
|
||||
UINT32 ret;
|
||||
LOS_MEM_POOL_STATUS poolStatus;
|
||||
|
||||
if (argc > 1) {
|
||||
|
||||
@@ -181,6 +181,7 @@ VOID OsLs(const CHAR *pathname)
|
||||
d = opendir(path);
|
||||
if (d == NULL) {
|
||||
PRINT_ERR("No such directory = %s\n", path);
|
||||
free(path);
|
||||
} else {
|
||||
PRINTK("Directory %s:\n", path);
|
||||
do {
|
||||
@@ -544,11 +545,6 @@ STATIC INT32 OsShellCmdDoRmdir(const CHAR *pathname)
|
||||
}
|
||||
if (strcmp(dirent->d_name, "..") && strcmp(dirent->d_name, ".")) {
|
||||
size_t fullPathBufSize = strlen(pathname) + strlen(dirent->d_name) + SEPARATOR_EOF_LEN;
|
||||
if (fullPathBufSize <= 0) {
|
||||
PRINTK("buffer size is invalid!\n");
|
||||
(VOID)closedir(d);
|
||||
return -1;
|
||||
}
|
||||
fullpath = (CHAR *)malloc(fullPathBufSize);
|
||||
if (fullpath == NULL) {
|
||||
PRINTK("malloc failure!\n");
|
||||
@@ -630,6 +626,24 @@ STATIC INT32 OsIsContainersWildcard(const CHAR *filename)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Delete a non directory file */
|
||||
STATIC INT32 OsRmFileOnly(const CHAR *fullpath)
|
||||
{
|
||||
struct stat statInfo = {0};
|
||||
INT32 ret = stat(fullpath, &statInfo);
|
||||
if (ret == 0) {
|
||||
if (!S_ISDIR(statInfo.st_mode)) {
|
||||
ret = unlink(fullpath);
|
||||
} else {
|
||||
ret = 0;
|
||||
PRINTK("rm: cannot remove '%s': Is a directory\n", fullpath);
|
||||
}
|
||||
} else {
|
||||
PRINTK("stat: get '%s' statInfo fail!\n", fullpath);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Delete a matching file or directory */
|
||||
|
||||
STATIC INT32 OsWildcardDeleteFileOrDir(const CHAR *fullpath, wildcard_type mark)
|
||||
@@ -641,7 +655,7 @@ STATIC INT32 OsWildcardDeleteFileOrDir(const CHAR *fullpath, wildcard_type mark)
|
||||
ret = OsShellCmdDoRmdir(fullpath);
|
||||
break;
|
||||
case RM_FILE:
|
||||
ret = unlink(fullpath);
|
||||
ret = OsRmFileOnly(fullpath);
|
||||
break;
|
||||
case RM_DIR:
|
||||
ret = rmdir(fullpath);
|
||||
@@ -654,8 +668,6 @@ STATIC INT32 OsWildcardDeleteFileOrDir(const CHAR *fullpath, wildcard_type mark)
|
||||
perror("rm/rmdir error!");
|
||||
return ret;
|
||||
}
|
||||
|
||||
PRINTK("%s match successful!delete!\n", fullpath);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -733,6 +745,10 @@ STATIC INT32 OsWildcardExtractDirectory(CHAR *fullpath, VOID *dst, wildcard_type
|
||||
break;
|
||||
}
|
||||
|
||||
if (!strcmp(dirent->d_name, ".") || !strcmp(dirent->d_name, "..")) {
|
||||
continue;
|
||||
}
|
||||
|
||||
ret = strcpy_s(src, PATH_MAX, f);
|
||||
if (ret != EOK) {
|
||||
goto closedir_out;
|
||||
@@ -915,7 +931,7 @@ INT32 OsShellCmdRm(INT32 argc, const CHAR **argv)
|
||||
if (OsIsContainersWildcard(fullpath)) {
|
||||
ret = OsWildcardExtractDirectory(fullpath, NULL, RM_FILE);
|
||||
} else {
|
||||
ret = unlink(fullpath);
|
||||
ret = OsRmFileOnly(fullpath);
|
||||
}
|
||||
}
|
||||
if (ret == -1) {
|
||||
|
||||
@@ -64,3 +64,11 @@ kernel_module(module_name) {
|
||||
include_dirs += [ "pipeline/serial" ]
|
||||
}
|
||||
}
|
||||
|
||||
config("public") {
|
||||
include_dirs = [
|
||||
".",
|
||||
"cnv",
|
||||
"pipeline",
|
||||
]
|
||||
}
|
||||
|
||||
@@ -39,12 +39,6 @@
|
||||
#include "los_swtmr.h"
|
||||
#include "los_hook.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
#endif /* __cplusplus */
|
||||
|
||||
STATIC VOID LOS_TraceMemInit(VOID *pool, UINT32 size)
|
||||
{
|
||||
LOS_TRACE(MEM_INFO_REQ, pool);
|
||||
@@ -241,7 +235,9 @@ VOID OsTraceCnvInit(VOID)
|
||||
LOS_HookReg(LOS_HOOK_TYPE_QUEUE_CREATE, LOS_TraceQueueCreate);
|
||||
LOS_HookReg(LOS_HOOK_TYPE_QUEUE_DELETE, LOS_TraceQueueDelete);
|
||||
LOS_HookReg(LOS_HOOK_TYPE_QUEUE_READ, LOS_TraceQueueRW);
|
||||
LOS_HookReg(LOS_HOOK_TYPE_QUEUE_READ_COPY, LOS_TraceQueueRW);
|
||||
LOS_HookReg(LOS_HOOK_TYPE_QUEUE_WRITE, LOS_TraceQueueRW);
|
||||
LOS_HookReg(LOS_HOOK_TYPE_QUEUE_WRITE_COPY, LOS_TraceQueueRW);
|
||||
LOS_HookReg(LOS_HOOK_TYPE_SEM_CREATE, LOS_TraceSemCreate);
|
||||
LOS_HookReg(LOS_HOOK_TYPE_SEM_DELETE, LOS_TraceSemDelete);
|
||||
LOS_HookReg(LOS_HOOK_TYPE_SEM_POST, LOS_TraceSemPost);
|
||||
@@ -264,9 +260,3 @@ VOID OsTraceCnvInit(VOID)
|
||||
LOS_HookReg(LOS_HOOK_TYPE_SWTMR_START, LOS_TraceSwtmrStart);
|
||||
LOS_HookReg(LOS_HOOK_TYPE_SWTMR_STOP, LOS_TraceSwtmrStop);
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
#endif /* __cplusplus */
|
||||
|
||||
@@ -45,12 +45,6 @@
|
||||
#include "shell.h"
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#if (LOSCFG_KERNEL_TRACE == 1)
|
||||
LITE_OS_SEC_BSS STATIC UINT32 g_traceEventCount;
|
||||
LITE_OS_SEC_BSS STATIC volatile enum TraceState g_traceState = TRACE_UNINIT;
|
||||
@@ -417,18 +411,6 @@ LITE_OS_SEC_TEXT_MINOR UINT32 OsShellCmdTraceDump(INT32 argc, const CHAR **argv)
|
||||
LOS_TraceRecordDump(toClient);
|
||||
return LOS_OK;
|
||||
}
|
||||
|
||||
SHELLCMD_ENTRY(tracestart_shellcmd, CMD_TYPE_EX, "trace_start", 0, (CmdCallBackFunc)LOS_TraceStart);
|
||||
SHELLCMD_ENTRY(tracestop_shellcmd, CMD_TYPE_EX, "trace_stop", 0, (CmdCallBackFunc)LOS_TraceStop);
|
||||
SHELLCMD_ENTRY(tracesetmask_shellcmd, CMD_TYPE_EX, "trace_mask", 1, (CmdCallBackFunc)OsShellCmdTraceSetMask);
|
||||
SHELLCMD_ENTRY(tracereset_shellcmd, CMD_TYPE_EX, "trace_reset", 0, (CmdCallBackFunc)LOS_TraceReset);
|
||||
SHELLCMD_ENTRY(tracedump_shellcmd, CMD_TYPE_EX, "trace_dump", 1, (CmdCallBackFunc)OsShellCmdTraceDump);
|
||||
#endif
|
||||
|
||||
#endif /* LOSCFG_KERNEL_TRACE == 1 */
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
#endif /* __cplusplus */
|
||||
|
||||
@@ -152,6 +152,11 @@ extern VOID OsTraceRecordDump(BOOL toClient);
|
||||
#define OsTraceNotifyStop()
|
||||
#endif
|
||||
|
||||
#if (LOSCFG_SHELL == 1)
|
||||
extern UINT32 OsShellCmdTraceSetMask(INT32 argc, const CHAR **argv);
|
||||
extern UINT32 OsShellCmdTraceDump(INT32 argc, const CHAR **argv);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
}
|
||||
|
||||
@@ -32,12 +32,6 @@
|
||||
#include "trace_pipeline_serial.h"
|
||||
#include "trace_pipeline.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#if (LOSCFG_TRACE_CONTROL_AGENT == 1)
|
||||
UINT32 SerialPipelineInit(VOID)
|
||||
{
|
||||
@@ -93,9 +87,3 @@ UINT32 OsTracePipelineInit(VOID)
|
||||
OsTracePipelineReg(&g_serialOps);
|
||||
return g_serialOps.init();
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
#endif /* __cplusplus */
|
||||
|
||||
@@ -33,12 +33,6 @@
|
||||
#include "trace_tlv.h"
|
||||
#include "los_trace_pri.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#if (LOSCFG_KERNEL_SMP == 1)
|
||||
LITE_OS_SEC_BSS SPIN_LOCK_INIT(g_pipeSpin);
|
||||
#define PIPE_LOCK(state) LOS_SpinLockSave(&g_pipeSpin, &(state))
|
||||
@@ -154,9 +148,3 @@ UINT32 OsTraceDataWait(VOID)
|
||||
{
|
||||
return g_tracePipelineOps->wait();
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
#endif /* __cplusplus */
|
||||
|
||||
@@ -32,12 +32,6 @@
|
||||
#include "trace_tlv.h"
|
||||
#include "securec.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#define CRC_WIDTH 8
|
||||
#define CRC_POLY 0x1021
|
||||
#define CRC_TOPBIT 0x8000
|
||||
@@ -114,9 +108,3 @@ UINT32 OsTraceDataEncode(UINT8 type, const TlvTable *table, UINT8 *src, UINT8 *d
|
||||
head->crc = crc;
|
||||
return len + sizeof(TraceMsgTlvHead);
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
#endif /* __cplusplus */
|
||||
|
||||
@@ -31,12 +31,8 @@
|
||||
|
||||
#include "los_trace_pri.h"
|
||||
#include "trace_pipeline.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
#endif /* __cplusplus */
|
||||
#include "los_memory.h"
|
||||
#include "securec.h"
|
||||
|
||||
#if (LOSCFG_RECORDER_MODE_OFFLINE == 1)
|
||||
#define BITS_NUM_FOR_TASK_ID 16
|
||||
@@ -257,9 +253,3 @@ OfflineHead *OsTraceRecordGet(VOID)
|
||||
}
|
||||
|
||||
#endif /* LOSCFG_RECORDER_MODE_OFFLINE == 1 */
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
#endif /* __cplusplus */
|
||||
|
||||
@@ -32,12 +32,6 @@
|
||||
#include "los_trace_pri.h"
|
||||
#include "trace_pipeline.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#if (LOSCFG_RECORDER_MODE_ONLINE == 1)
|
||||
UINT32 OsTraceGetMaskTid(UINT32 taskId)
|
||||
{
|
||||
@@ -105,9 +99,3 @@ OfflineHead *OsTraceRecordGet(VOID)
|
||||
}
|
||||
|
||||
#endif /* LOSCFG_RECORDER_MODE_ONLINE == 1 */
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
#endif /* __cplusplus */
|
||||
|
||||
@@ -86,10 +86,6 @@ optimize_config_cflags = []
|
||||
optimize_config_asmflags = []
|
||||
|
||||
if (defined(LOSCFG_COMPILE_DEBUG)) {
|
||||
optimize_config_cflags += [
|
||||
"-g",
|
||||
"-gdwarf-2",
|
||||
]
|
||||
optimize_config_cflags += [ "-On" ]
|
||||
} else {
|
||||
if (defined(LOSCFG_COMPILE_OPTIMIZE)) {
|
||||
@@ -118,12 +114,14 @@ kconfig_config_cflags += [
|
||||
warn_config_cflags = []
|
||||
warn_config_asmflags = []
|
||||
|
||||
warn_config_cflags += [
|
||||
"--warnings_affect_exit_code",
|
||||
"--warnings_are_errors",
|
||||
"--warn_about_c_style_casts",
|
||||
"--warn_about_incomplete_constructors",
|
||||
]
|
||||
if (!defined(LOSCFG_TEST)) {
|
||||
warn_config_cflags += [
|
||||
"--warnings_affect_exit_code",
|
||||
"--warnings_are_errors",
|
||||
"--warn_about_c_style_casts",
|
||||
"--warn_about_incomplete_constructors",
|
||||
]
|
||||
}
|
||||
|
||||
#
|
||||
# dialect_config
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 101 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 97 KiB |
@@ -42,6 +42,9 @@
|
||||
#include "los_task.h"
|
||||
#include "los_timer.h"
|
||||
#include "los_debug.h"
|
||||
#if (LOSCFG_MUTEX_CREATE_TRACE == 1)
|
||||
#include "los_arch.h"
|
||||
#endif
|
||||
|
||||
#include "string.h"
|
||||
#include "securec.h"
|
||||
@@ -978,21 +981,17 @@ osStatus_t osEventFlagsDelete(osEventFlagsId_t ef_id)
|
||||
{
|
||||
PEVENT_CB_S pstEventCB = (PEVENT_CB_S)ef_id;
|
||||
UINT32 intSave;
|
||||
osStatus_t ret;
|
||||
osStatus_t ret = osOK;
|
||||
if (OS_INT_ACTIVE) {
|
||||
return osErrorISR;
|
||||
}
|
||||
intSave = LOS_IntLock();
|
||||
if (LOS_EventDestroy(pstEventCB) == LOS_OK) {
|
||||
ret = osOK;
|
||||
} else {
|
||||
if (LOS_EventDestroy(pstEventCB) != LOS_OK) {
|
||||
ret = osErrorParameter;
|
||||
}
|
||||
LOS_IntRestore(intSave);
|
||||
|
||||
if (LOS_MemFree(m_aucSysMem0, (void *)pstEventCB) == LOS_OK) {
|
||||
ret = osOK;
|
||||
} else {
|
||||
if (LOS_MemFree(m_aucSysMem0, (void *)pstEventCB) != LOS_OK) {
|
||||
ret = osErrorParameter;
|
||||
}
|
||||
|
||||
@@ -1006,6 +1005,10 @@ osMutexId_t osMutexNew(const osMutexAttr_t *attr)
|
||||
UINT32 ret;
|
||||
UINT32 muxId;
|
||||
|
||||
#if (LOSCFG_MUTEX_CREATE_TRACE == 1)
|
||||
UINTPTR regLR = ArchLRGet();
|
||||
#endif
|
||||
|
||||
UNUSED(attr);
|
||||
|
||||
if (OS_INT_ACTIVE) {
|
||||
@@ -1014,6 +1017,9 @@ osMutexId_t osMutexNew(const osMutexAttr_t *attr)
|
||||
|
||||
ret = LOS_MuxCreate(&muxId);
|
||||
if (ret == LOS_OK) {
|
||||
#if (LOSCFG_MUTEX_CREATE_TRACE == 1)
|
||||
OsSetMutexCreateInfo(GET_MUX(muxId), regLR);
|
||||
#endif
|
||||
return (osMutexId_t)(GET_MUX(muxId));
|
||||
} else {
|
||||
return (osMutexId_t)NULL;
|
||||
@@ -1255,7 +1261,7 @@ osMessageQueueId_t osMessageQueueNew(uint32_t msg_count, uint32_t msg_size, cons
|
||||
#if (LOSCFG_BASE_IPC_QUEUE_STATIC == 1)
|
||||
queueSize = attr->mq_size;
|
||||
staticMem = attr->mq_mem;
|
||||
if ((queueSize == 0 || staticMem == NULL)) {
|
||||
if (((queueSize == 0) && (staticMem != NULL)) || ((queueSize != 0) && (staticMem == NULL))) {
|
||||
return (osMessageQueueId_t)NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
||||
# Copyright (c) 2020-2022 Huawei Device Co., Ltd. All rights reserved.
|
||||
# Copyright (c) 2020-2023 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:
|
||||
@@ -35,14 +35,12 @@ choice
|
||||
|
||||
config LIBC_MUSL
|
||||
bool "musl libc"
|
||||
rsource "musl/Kconfig"
|
||||
|
||||
config LIBC_NEWLIB
|
||||
bool "newlibc"
|
||||
rsource "newlib/Kconfig"
|
||||
|
||||
config LIBC_ICCARM
|
||||
bool "iar libc"
|
||||
rsource "iccarm/Kconfig"
|
||||
depends on COMPILER_ICCARM
|
||||
|
||||
endchoice
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
||||
# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
||||
# Copyright (c) 2020-2023 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:
|
||||
@@ -33,10 +33,6 @@ import("//third_party/musl/porting/liteos_m/kernel/musl.gni")
|
||||
module_switch = defined(LOSCFG_LIBC_MUSL)
|
||||
module_name = get_path_info(rebase_path("."), "name")
|
||||
kernel_module(module_name) {
|
||||
sources = [
|
||||
"fs.c",
|
||||
"malloc.c",
|
||||
]
|
||||
configs += [ "$LITEOSTOPDIR:warn_config" ]
|
||||
|
||||
deps = [ "//third_party/musl/porting/liteos_m/kernel" ]
|
||||
|
||||
@@ -1,278 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
||||
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
||||
* to endorse or promote products derived from this software without specific prior written
|
||||
* permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "los_config.h"
|
||||
#include "stdarg.h"
|
||||
#include "dirent.h"
|
||||
#include "sys/mount.h"
|
||||
#include "sys/statfs.h"
|
||||
#include "sys/stat.h"
|
||||
#include "unistd.h"
|
||||
|
||||
#ifdef LOSCFG_LIBC_MUSL_FS
|
||||
#include "los_fs.h"
|
||||
#else
|
||||
#include "sys/stat.h"
|
||||
#endif
|
||||
|
||||
#ifdef LOSCFG_LIBC_MUSL_FS
|
||||
int mount(const char *source, const char *target,
|
||||
const char *filesystemtype, unsigned long mountflags,
|
||||
const void *data)
|
||||
{
|
||||
return LOS_FsMount(source, target, filesystemtype, mountflags, data);
|
||||
}
|
||||
|
||||
int umount(const char *target)
|
||||
{
|
||||
return LOS_FsUmount(target);
|
||||
}
|
||||
|
||||
int umount2(const char *target, int flag)
|
||||
{
|
||||
return LOS_FsUmount2(target, flag);
|
||||
}
|
||||
|
||||
int open(const char *path, int oflag, ...)
|
||||
{
|
||||
va_list vaList;
|
||||
va_start(vaList, oflag);
|
||||
int ret;
|
||||
ret = LOS_Open(path, oflag, vaList);
|
||||
va_end(vaList);
|
||||
return ret;
|
||||
}
|
||||
|
||||
int close(int fd)
|
||||
{
|
||||
return LOS_Close(fd);
|
||||
}
|
||||
|
||||
ssize_t read(int fd, void *buf, size_t nbyte)
|
||||
{
|
||||
return LOS_Read(fd, buf, nbyte);
|
||||
}
|
||||
|
||||
ssize_t write(int fd, const void *buf, size_t nbyte)
|
||||
{
|
||||
return LOS_Write(fd, buf, nbyte);
|
||||
}
|
||||
|
||||
off_t lseek(int fd, off_t offset, int whence)
|
||||
{
|
||||
return LOS_Lseek(fd, offset, whence);
|
||||
}
|
||||
|
||||
int unlink(const char *path)
|
||||
{
|
||||
return LOS_Unlink(path);
|
||||
}
|
||||
|
||||
int fstat(int fd, struct stat *buf)
|
||||
{
|
||||
return LOS_Fstat(fd, buf);
|
||||
}
|
||||
|
||||
int stat(const char *path, struct stat *buf)
|
||||
{
|
||||
return LOS_Stat(path, buf);
|
||||
}
|
||||
|
||||
int fsync(int fd)
|
||||
{
|
||||
return LOS_Fsync(fd);
|
||||
}
|
||||
|
||||
int mkdir(const char *path, mode_t mode)
|
||||
{
|
||||
return LOS_Mkdir(path, mode);
|
||||
}
|
||||
|
||||
DIR *opendir(const char *dirName)
|
||||
{
|
||||
return LOS_Opendir(dirName);
|
||||
}
|
||||
|
||||
struct dirent *readdir(DIR *dir)
|
||||
{
|
||||
return LOS_Readdir(dir);
|
||||
}
|
||||
|
||||
int closedir(DIR *dir)
|
||||
{
|
||||
return LOS_Closedir(dir);
|
||||
}
|
||||
|
||||
int rmdir(const char *path)
|
||||
{
|
||||
return LOS_Unlink(path);
|
||||
}
|
||||
|
||||
int rename(const char *oldName, const char *newName)
|
||||
{
|
||||
return LOS_Rename(oldName, newName);
|
||||
}
|
||||
|
||||
int statfs(const char *path, struct statfs *buf)
|
||||
{
|
||||
return LOS_Statfs(path, buf);
|
||||
}
|
||||
|
||||
int ftruncate(int fd, off_t length)
|
||||
{
|
||||
return LOS_Ftruncate(fd, length);
|
||||
}
|
||||
|
||||
ssize_t pread(int fd, void *buf, size_t nbyte, off_t offset)
|
||||
{
|
||||
return LOS_Pread(fd, buf, nbyte, offset);
|
||||
}
|
||||
|
||||
ssize_t pwrite(int fd, const void *buf, size_t nbyte, off_t offset)
|
||||
{
|
||||
return LOS_Pwrite(fd, buf, nbyte, offset);
|
||||
}
|
||||
|
||||
#else /* #ifdef LOSCFG_FS_VFS */
|
||||
|
||||
int mount(const char *source, const char *target,
|
||||
const char *filesystemtype, unsigned long mountflags,
|
||||
const void *data)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
int umount(const char *target)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
int umount2(const char *target, int flag)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
int open(const char *path, int oflag, ...)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
int close(int fd)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
ssize_t read(int fd, void *buf, size_t nbyte)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
ssize_t write(int fd, const void *buf, size_t nbyte)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
off_t lseek(int fd, off_t offset, int whence)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
int unlink(const char *path)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
int fstat(int fd, struct stat *buf)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
int stat(const char *path, struct stat *buf)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
int fsync(int fd)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
int mkdir(const char *path, mode_t mode)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
DIR *opendir(const char *dirName)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
struct dirent *readdir(DIR *dir)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int closedir(DIR *dir)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
int rmdir(const char *path)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
int rename(const char *oldName, const char *newName)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
int statfs(const char *path, struct statfs *buf)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
int ftruncate(int fd, off_t length)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
ssize_t pread(int fd, void *buf, size_t nbyte, off_t offset)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
ssize_t pwrite(int fd, const void *buf, size_t nbyte, off_t offset)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1,5 +1,5 @@
|
||||
# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
||||
# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
||||
# Copyright (c) 2020-2023 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:
|
||||
@@ -33,18 +33,15 @@ module_switch = defined(LOSCFG_LIBC_NEWLIB)
|
||||
module_name = get_path_info(rebase_path("."), "name")
|
||||
kernel_module(module_name) {
|
||||
sources = [
|
||||
"porting/src/fs.c",
|
||||
"porting/src/malloc.c",
|
||||
"porting/src/hook_adapt.c",
|
||||
"porting/src/network/htonl.c",
|
||||
"porting/src/network/htons.c",
|
||||
"porting/src/network/ntohl.c",
|
||||
"porting/src/network/ntohs.c",
|
||||
"porting/src/other_adapt.c",
|
||||
"porting/src/time.c",
|
||||
]
|
||||
configs += [ "$LITEOSTOPDIR:warn_config" ]
|
||||
|
||||
if (defined(LOSCFG_LIBC_NEWLIB_FS)) {
|
||||
if (defined(LOSCFG_FS_VFS)) {
|
||||
sources +=
|
||||
[ "//third_party/musl/porting/liteos_m/kernel/src/misc/realpath.c" ]
|
||||
}
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
||||
# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without modification,
|
||||
# are permitted provided that the following conditions are met:
|
||||
#
|
||||
# 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
# conditions and the following disclaimer.
|
||||
#
|
||||
# 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
# of conditions and the following disclaimer in the documentation and/or other materials
|
||||
# provided with the distribution.
|
||||
#
|
||||
# 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
||||
# to endorse or promote products derived from this software without specific prior written
|
||||
# permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
||||
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
if LIBC_NEWLIB
|
||||
|
||||
config LIBC_NEWLIB_FS
|
||||
bool "Enable POSIX file system API support"
|
||||
default y
|
||||
depends on FS_VFS
|
||||
help
|
||||
This enables POSIX style file system related APIs.
|
||||
|
||||
endif # LIBC_NEWLIB
|
||||
@@ -49,6 +49,7 @@ typedef struct {
|
||||
int sem_init(sem_t *sem, int shared, unsigned value);
|
||||
int sem_destroy(sem_t *sem);
|
||||
int sem_wait(sem_t *sem);
|
||||
int sem_trywait(sem_t *sem);
|
||||
int sem_post(sem_t *sem);
|
||||
int sem_timedwait(sem_t *__restrict sem, const struct timespec *__restrict timeout);
|
||||
int sem_getvalue(sem_t *__restrict sem, int *__restrict currVal);
|
||||
|
||||
@@ -50,6 +50,7 @@
|
||||
#define _POSIX_THREAD_PRIORITY_SCHEDULING
|
||||
#define _UNIX98_THREAD_MUTEX_ATTRIBUTES
|
||||
#define _POSIX_THREAD_PROCESS_SHARED
|
||||
#define _POSIX_PRIORITY_SCHEDULING
|
||||
|
||||
#include_next <sys/features.h>
|
||||
|
||||
|
||||
@@ -1,123 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2021-2021 Huawei Device Co., Ltd. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
||||
* to endorse or promote products derived from this software without specific prior written
|
||||
* permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef _ADAPT_SYS_STAT_H
|
||||
#define _ADAPT_SYS_STAT_H
|
||||
|
||||
#include <sys/features.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
#define S_IFMT 0170000
|
||||
|
||||
#define S_IFDIR 0040000
|
||||
#define S_IFCHR 0020000
|
||||
#define S_IFBLK 0060000
|
||||
#define S_IFREG 0100000
|
||||
#define S_IFIFO 0010000
|
||||
#define S_IFLNK 0120000
|
||||
#define S_IFSOCK 0140000
|
||||
|
||||
#define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR)
|
||||
#define S_ISCHR(mode) (((mode) & S_IFMT) == S_IFCHR)
|
||||
#define S_ISBLK(mode) (((mode) & S_IFMT) == S_IFBLK)
|
||||
#define S_ISREG(mode) (((mode) & S_IFMT) == S_IFREG)
|
||||
#define S_ISFIFO(mode) (((mode) & S_IFMT) == S_IFIFO)
|
||||
#define S_ISLNK(mode) (((mode) & S_IFMT) == S_IFLNK)
|
||||
#define S_ISSOCK(mode) (((mode) & S_IFMT) == S_IFSOCK)
|
||||
|
||||
#ifndef S_IRUSR
|
||||
#define S_ISUID 04000
|
||||
#define S_ISGID 02000
|
||||
#define S_ISVTX 01000
|
||||
#define S_IRUSR 0400
|
||||
#define S_IWUSR 0200
|
||||
#define S_IXUSR 0100
|
||||
#define S_IRWXU 0700
|
||||
#define S_IRGRP 0040
|
||||
#define S_IWGRP 0020
|
||||
#define S_IXGRP 0010
|
||||
#define S_IRWXG 0070
|
||||
#define S_IROTH 0004
|
||||
#define S_IWOTH 0002
|
||||
#define S_IXOTH 0001
|
||||
#define S_IRWXO 0007
|
||||
#endif
|
||||
|
||||
#define st_atime st_atim.tv_sec
|
||||
#define st_mtime st_mtim.tv_sec
|
||||
#define st_ctime st_ctim.tv_sec
|
||||
|
||||
struct stat {
|
||||
dev_t st_dev;
|
||||
int __st_dev_padding;
|
||||
long __st_ino_truncated;
|
||||
mode_t st_mode;
|
||||
nlink_t st_nlink;
|
||||
uid_t st_uid;
|
||||
gid_t st_gid;
|
||||
dev_t st_rdev;
|
||||
int __st_rdev_padding;
|
||||
off_t st_size;
|
||||
blksize_t st_blksize;
|
||||
blkcnt_t st_blocks;
|
||||
struct {
|
||||
long tv_sec;
|
||||
long tv_nsec;
|
||||
} __st_atim32, __st_mtim32, __st_ctim32;
|
||||
ino_t st_ino;
|
||||
struct timespec st_atim;
|
||||
struct timespec st_mtim;
|
||||
struct timespec st_ctim;
|
||||
};
|
||||
|
||||
int stat(const char *__restrict, struct stat *__restrict);
|
||||
int fstat(int, struct stat *);
|
||||
int mkdir(const char *, mode_t);
|
||||
|
||||
#if defined(_GNU_SOURCE)
|
||||
#define stat64 stat
|
||||
#define fstat64 fstat
|
||||
#define blkcnt64_t blkcnt_t
|
||||
#define fsblkcnt64_t fsblkcnt_t
|
||||
#define fsfilcnt64_t fsfilcnt_t
|
||||
#define ino64_t ino_t
|
||||
#define off64_t off_t
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* !_ADAPT_SYS_STAT_H */
|
||||
@@ -1,212 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2021-2021 Huawei Device Co., Ltd. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
||||
* to endorse or promote products derived from this software without specific prior written
|
||||
* permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "los_config.h"
|
||||
#include "stdio.h"
|
||||
#include "stdarg.h"
|
||||
#include <sys/ioctl.h>
|
||||
|
||||
#ifdef LOSCFG_LIBC_NEWLIB_FS
|
||||
#include "los_fs.h"
|
||||
#else
|
||||
#include "sys/stat.h"
|
||||
#endif
|
||||
|
||||
#ifdef LOSCFG_LIBC_NEWLIB_FS
|
||||
int mount(const char *source, const char *target,
|
||||
const char *filesystemtype, unsigned long mountflags,
|
||||
const void *data)
|
||||
{
|
||||
return LOS_FsMount(source, target, filesystemtype, mountflags, data);
|
||||
}
|
||||
|
||||
int umount(const char *target)
|
||||
{
|
||||
return LOS_FsUmount(target);
|
||||
}
|
||||
|
||||
int umount2(const char *target, int flag)
|
||||
{
|
||||
return LOS_FsUmount2(target, flag);
|
||||
}
|
||||
|
||||
int _open(const char *path, int oflag, ...)
|
||||
{
|
||||
va_list vaList;
|
||||
va_start(vaList, oflag);
|
||||
int ret;
|
||||
ret = LOS_Open(path, oflag);
|
||||
va_end(vaList);
|
||||
return ret;
|
||||
}
|
||||
|
||||
int _close(int fd)
|
||||
{
|
||||
return LOS_Close(fd);
|
||||
}
|
||||
|
||||
ssize_t _read(int fd, void *buf, size_t nbyte)
|
||||
{
|
||||
return LOS_Read(fd, buf, nbyte);
|
||||
}
|
||||
|
||||
ssize_t _write(int fd, const void *buf, size_t nbyte)
|
||||
{
|
||||
return LOS_Write(fd, buf, nbyte);
|
||||
}
|
||||
|
||||
off_t _lseek(int fd, off_t offset, int whence)
|
||||
{
|
||||
return LOS_Lseek(fd, offset, whence);
|
||||
}
|
||||
|
||||
int _unlink(const char *path)
|
||||
{
|
||||
return LOS_Unlink(path);
|
||||
}
|
||||
|
||||
int _fstat(int fd, struct stat *buf)
|
||||
{
|
||||
return LOS_Fstat(fd, buf);
|
||||
}
|
||||
|
||||
int _stat(const char *path, struct stat *buf)
|
||||
{
|
||||
return LOS_Stat(path, buf);
|
||||
}
|
||||
|
||||
int fsync(int fd)
|
||||
{
|
||||
return LOS_Fsync(fd);
|
||||
}
|
||||
|
||||
int mkdir(const char *path, mode_t mode)
|
||||
{
|
||||
return LOS_Mkdir(path, mode);
|
||||
}
|
||||
|
||||
DIR *opendir(const char *dirName)
|
||||
{
|
||||
return LOS_Opendir(dirName);
|
||||
}
|
||||
|
||||
struct dirent *readdir(DIR *dir)
|
||||
{
|
||||
return LOS_Readdir(dir);
|
||||
}
|
||||
|
||||
int closedir(DIR *dir)
|
||||
{
|
||||
return LOS_Closedir(dir);
|
||||
}
|
||||
|
||||
int rmdir(const char *path)
|
||||
{
|
||||
return LOS_Unlink(path);
|
||||
}
|
||||
|
||||
int rename(const char *oldName, const char *newName)
|
||||
{
|
||||
return LOS_Rename(oldName, newName);
|
||||
}
|
||||
|
||||
int statfs(const char *path, struct statfs *buf)
|
||||
{
|
||||
return LOS_Statfs(path, buf);
|
||||
}
|
||||
|
||||
int ftruncate(int fd, off_t length)
|
||||
{
|
||||
return LOS_Ftruncate(fd, length);
|
||||
}
|
||||
|
||||
int ioctl(int fd, int req, ...)
|
||||
{
|
||||
va_list ap;
|
||||
va_start(ap, req);
|
||||
int ret;
|
||||
ret = LOS_Ioctl(fd, req, ap);
|
||||
va_end(ap);
|
||||
return ret;
|
||||
}
|
||||
|
||||
ssize_t pread(int fd, void *buf, size_t nbyte, off_t offset)
|
||||
{
|
||||
return LOS_Pread(fd, buf, nbyte, offset);
|
||||
}
|
||||
|
||||
ssize_t pwrite(int fd, const void *buf, size_t nbyte, off_t offset)
|
||||
{
|
||||
return LOS_Pwrite(fd, buf, nbyte, offset);
|
||||
}
|
||||
|
||||
#else /* #ifdef LOSCFG_FS_VFS */
|
||||
|
||||
int _open(const char *path, int oflag, ...)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
int _close(int fd)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
ssize_t _read(int fd, void *buf, size_t nbyte)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
ssize_t _write(int fd, const void *buf, size_t nbyte)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
off_t _lseek(int fd, off_t offset, int whence)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
int _unlink(const char *path)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
int _fstat(int fd, struct stat *buf)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
int _stat(const char *path, struct stat *buf)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2021-2022 Huawei Device Co., Ltd. All rights reserved.
|
||||
* Copyright (c) 2021-2023 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:
|
||||
@@ -35,6 +35,12 @@
|
||||
#include <unistd.h>
|
||||
#include <pthread.h>
|
||||
|
||||
/*
|
||||
* fs adapter interface, such as _read, see component/fs
|
||||
* time adapter interface, such as _gettimeofday, see posix/src/time.c
|
||||
* malloc adapter interface, such as _malloc_r, see posix/src/malloc.c
|
||||
*/
|
||||
|
||||
int _isatty(int file)
|
||||
{
|
||||
return (int)(file <= 2); // 2: stderr
|
||||
@@ -57,4 +63,3 @@ void _exit(int status)
|
||||
while (1) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,113 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
||||
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
||||
* to endorse or promote products derived from this software without specific prior written
|
||||
* permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "securec.h"
|
||||
#include "los_config.h"
|
||||
#include "los_memory.h"
|
||||
#include <malloc.h>
|
||||
|
||||
void *zalloc(size_t size)
|
||||
{
|
||||
void *ptr = NULL;
|
||||
|
||||
if (size == 0) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ptr = LOS_MemAlloc(OS_SYS_MEM_ADDR, size);
|
||||
if (ptr != NULL) {
|
||||
(void)memset_s(ptr, size, 0, size);
|
||||
}
|
||||
return ptr;
|
||||
}
|
||||
|
||||
void __wrap__free_r(struct _reent *reent, void *aptr)
|
||||
{
|
||||
if (aptr == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
LOS_MemFree(OS_SYS_MEM_ADDR, aptr);
|
||||
}
|
||||
|
||||
size_t __wrap__malloc_usable_size_r(struct _reent *reent, void *aptr)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void *__wrap__malloc_r(struct _reent *reent, size_t nbytes)
|
||||
{
|
||||
if (nbytes == 0) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return LOS_MemAlloc(OS_SYS_MEM_ADDR, nbytes);
|
||||
}
|
||||
|
||||
void *__wrap__memalign_r(struct _reent *reent, size_t align, size_t nbytes)
|
||||
{
|
||||
if (nbytes == 0) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return LOS_MemAllocAlign(OS_SYS_MEM_ADDR, nbytes, align);
|
||||
}
|
||||
|
||||
void *__wrap__realloc_r(struct _reent *reent, void *aptr, size_t nbytes)
|
||||
{
|
||||
if (aptr == NULL) {
|
||||
return malloc(nbytes);
|
||||
}
|
||||
|
||||
if (nbytes == 0) {
|
||||
free(aptr);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return LOS_MemRealloc(OS_SYS_MEM_ADDR, aptr, nbytes);
|
||||
}
|
||||
|
||||
void *__wrap__calloc_r(struct _reent *reent, size_t nitems, size_t size)
|
||||
{
|
||||
size_t real_size;
|
||||
void *ptr = NULL;
|
||||
|
||||
if (nitems == 0 || size == 0) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
real_size = (size_t)(nitems * size);
|
||||
ptr = LOS_MemAlloc(OS_SYS_MEM_ADDR, real_size);
|
||||
if (ptr != NULL) {
|
||||
(void)memset_s(ptr, real_size, 0, real_size);
|
||||
}
|
||||
return ptr;
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
||||
# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
||||
# Copyright (c) 2020-2023 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:
|
||||
@@ -35,6 +35,7 @@ kernel_module(module_name) {
|
||||
sources = [
|
||||
"src/errno.c",
|
||||
"src/libc.c",
|
||||
"src/map_error.c",
|
||||
]
|
||||
configs += [ "$LITEOSTOPDIR:warn_config" ]
|
||||
|
||||
@@ -67,6 +68,10 @@ kernel_module(module_name) {
|
||||
if (defined(LOSCFG_POSIX_SIGNAL_API)) {
|
||||
sources += [ "src/signal.c" ]
|
||||
}
|
||||
|
||||
if (defined(LOSCFG_POSIX_MALLOC_API)) {
|
||||
sources += [ "src/malloc.c" ]
|
||||
}
|
||||
}
|
||||
|
||||
config("public") {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
||||
# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
||||
# Copyright (c) 2020-2023 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:
|
||||
@@ -73,4 +73,17 @@ config POSIX_SIGNAL_API
|
||||
help
|
||||
Answer Y to enable LiteOS support POSIX Signal API.
|
||||
|
||||
config POSIX_FS_API
|
||||
bool "Enable POSIX FS API"
|
||||
default y
|
||||
depends on FS_VFS
|
||||
help
|
||||
Answer Y to enable LiteOS support POSIX FS API.
|
||||
|
||||
config POSIX_MALLOC_API
|
||||
bool "Enable POSIX MALLOC API"
|
||||
default y
|
||||
help
|
||||
Answer Y to enable LiteOS support POSIX MALLOC API.
|
||||
|
||||
endif # POSIX_API
|
||||
|
||||
@@ -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-2023 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:
|
||||
@@ -34,9 +34,15 @@
|
||||
#include "los_config.h"
|
||||
#include "los_memory.h"
|
||||
|
||||
|
||||
#if (LOSCFG_LIBC_NEWLIB == 1)
|
||||
void *__wrap__calloc_r(struct _reent *reent, size_t nitems, size_t size)
|
||||
#else
|
||||
void *calloc(size_t nitems, size_t size)
|
||||
#endif
|
||||
{
|
||||
#if (LOSCFG_LIBC_NEWLIB == 1)
|
||||
(void)reent;
|
||||
#endif
|
||||
size_t real_size;
|
||||
void *ptr = NULL;
|
||||
|
||||
@@ -52,8 +58,15 @@ void *calloc(size_t nitems, size_t size)
|
||||
return ptr;
|
||||
}
|
||||
|
||||
#if (LOSCFG_LIBC_NEWLIB == 1)
|
||||
void __wrap__free_r(struct _reent *reent, void *ptr)
|
||||
#else
|
||||
void free(void *ptr)
|
||||
#endif
|
||||
{
|
||||
#if (LOSCFG_LIBC_NEWLIB == 1)
|
||||
(void)reent;
|
||||
#endif
|
||||
if (ptr == NULL) {
|
||||
return;
|
||||
}
|
||||
@@ -61,8 +74,24 @@ void free(void *ptr)
|
||||
LOS_MemFree(OS_SYS_MEM_ADDR, ptr);
|
||||
}
|
||||
|
||||
void *malloc(size_t size)
|
||||
#if (LOSCFG_LIBC_NEWLIB == 1)
|
||||
size_t __wrap__malloc_usable_size_r(struct _reent *reent, void *aptr)
|
||||
{
|
||||
(void)reent;
|
||||
(void)aptr;
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if (LOSCFG_LIBC_NEWLIB == 1)
|
||||
void *__wrap__malloc_r(struct _reent *reent, size_t size)
|
||||
#else
|
||||
void *malloc(size_t size)
|
||||
#endif
|
||||
{
|
||||
#if (LOSCFG_LIBC_NEWLIB == 1)
|
||||
(void)reent;
|
||||
#endif
|
||||
if (size == 0) {
|
||||
return NULL;
|
||||
}
|
||||
@@ -85,8 +114,15 @@ void *zalloc(size_t size)
|
||||
return ptr;
|
||||
}
|
||||
|
||||
#if (LOSCFG_LIBC_NEWLIB == 1)
|
||||
void *__wrap__memalign_r(struct _reent *reent, size_t boundary, size_t size)
|
||||
#else
|
||||
void *memalign(size_t boundary, size_t size)
|
||||
#endif
|
||||
{
|
||||
#if (LOSCFG_LIBC_NEWLIB == 1)
|
||||
(void)reent;
|
||||
#endif
|
||||
if (size == 0) {
|
||||
return NULL;
|
||||
}
|
||||
@@ -94,8 +130,15 @@ void *memalign(size_t boundary, size_t size)
|
||||
return LOS_MemAllocAlign(OS_SYS_MEM_ADDR, size, boundary);
|
||||
}
|
||||
|
||||
#if (LOSCFG_LIBC_NEWLIB == 1)
|
||||
void *__wrap__realloc_r(struct _reent *reent, void *ptr, size_t size)
|
||||
#else
|
||||
void *realloc(void *ptr, size_t size)
|
||||
#endif
|
||||
{
|
||||
#if (LOSCFG_LIBC_NEWLIB == 1)
|
||||
(void)reent;
|
||||
#endif
|
||||
if (ptr == NULL) {
|
||||
return malloc(size);
|
||||
}
|
||||
@@ -107,4 +150,3 @@ void *realloc(void *ptr, size_t size)
|
||||
|
||||
return LOS_MemRealloc(OS_SYS_MEM_ADDR, ptr, size);
|
||||
}
|
||||
|
||||
100
kal/posix/src/map_error.c
Normal file
100
kal/posix/src/map_error.c
Normal file
@@ -0,0 +1,100 @@
|
||||
/*
|
||||
* Copyright (c) 2023-2023 Huawei Device Co., Ltd. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
||||
* to endorse or promote products derived from this software without specific prior written
|
||||
* permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "los_mux.h"
|
||||
#include "los_queue.h"
|
||||
#include "los_sem.h"
|
||||
#include "los_task.h"
|
||||
#include <errno.h>
|
||||
|
||||
INT32 map_errno(UINT32 err)
|
||||
{
|
||||
if (err == LOS_OK) {
|
||||
return 0;
|
||||
}
|
||||
switch (err) {
|
||||
case LOS_ERRNO_QUEUE_INVALID:
|
||||
case LOS_ERRNO_QUEUE_WRITE_PTR_NULL:
|
||||
case LOS_ERRNO_QUEUE_WRITESIZE_ISZERO:
|
||||
case LOS_ERRNO_QUEUE_SIZE_TOO_BIG:
|
||||
case LOS_ERRNO_QUEUE_CREAT_PTR_NULL:
|
||||
case LOS_ERRNO_QUEUE_PARA_ISZERO:
|
||||
case LOS_ERRNO_QUEUE_WRITE_SIZE_TOO_BIG:
|
||||
case LOS_ERRNO_TSK_ID_INVALID:
|
||||
case LOS_ERRNO_TSK_PTR_NULL:
|
||||
case LOS_ERRNO_TSK_NAME_EMPTY:
|
||||
case LOS_ERRNO_TSK_ENTRY_NULL:
|
||||
case LOS_ERRNO_TSK_PRIOR_ERROR:
|
||||
case LOS_ERRNO_TSK_STKSZ_TOO_LARGE:
|
||||
case LOS_ERRNO_TSK_STKSZ_TOO_SMALL:
|
||||
case LOS_ERRNO_TSK_NOT_CREATED:
|
||||
case OS_ERROR:
|
||||
case LOS_ERRNO_SEM_INVALID:
|
||||
case LOS_ERRNO_SEM_UNAVAILABLE:
|
||||
errno = EINVAL;
|
||||
break;
|
||||
case LOS_ERRNO_QUEUE_ISFULL:
|
||||
case LOS_ERRNO_QUEUE_ISEMPTY:
|
||||
errno = EAGAIN;
|
||||
break;
|
||||
case LOS_ERRNO_QUEUE_CREATE_NO_MEMORY:
|
||||
case LOS_ERRNO_TSK_TCB_UNAVAILABLE:
|
||||
case LOS_ERRNO_SEM_ALL_BUSY:
|
||||
errno = ENOSPC;
|
||||
break;
|
||||
case LOS_ERRNO_QUEUE_TIMEOUT:
|
||||
case LOS_ERRNO_SEM_TIMEOUT:
|
||||
errno = ETIMEDOUT;
|
||||
break;
|
||||
case LOS_ERRNO_QUEUE_CB_UNAVAILABLE:
|
||||
errno = ENFILE;
|
||||
break;
|
||||
case LOS_ERRNO_QUEUE_READ_IN_INTERRUPT:
|
||||
case LOS_ERRNO_QUEUE_WRITE_IN_INTERRUPT:
|
||||
case LOS_ERRNO_SEM_PEND_INTERR:
|
||||
errno = EINTR;
|
||||
break;
|
||||
case LOS_ERRNO_TSK_NO_MEMORY:
|
||||
case LOS_ERRNO_SEM_OVERFLOW:
|
||||
errno = ENOMEM;
|
||||
break;
|
||||
case LOS_ERRNO_SEM_PENDED:
|
||||
errno = EBUSY;
|
||||
break;
|
||||
case LOS_ERRNO_SEM_PEND_IN_LOCK:
|
||||
errno = EPERM;
|
||||
break;
|
||||
default:
|
||||
errno = EINVAL;
|
||||
break;
|
||||
}
|
||||
return errno;
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user