Commit Graph

198 Commits

Author SHA1 Message Date
Yunjie Gu d49ac097ab
[kernel] 修复 rt_memset 使其 word size independent.
For compatibility with 16bit addressing 32bit CPU (e.g. TI C28x).
2022-08-24 17:12:11 -04:00
Meco Man ef659661d4 [kservice] 增加换行符 2022-08-14 21:49:43 -04:00
dongly 3363586cbb
Fix some compilation warning (#5744)
* Fix some compilation warning

* 补充修正一些数据类型的使用错误

Co-authored-by: Meco Man <920369182@qq.com>
2022-08-02 12:09:49 -04:00
a1012112796 697bf139b2
[enhancement] Add string information for error (#3186)
* [enhancement]Add string information for error

* Update src/kservice.c

* Update src/kservice.c

Co-authored-by: Man, Jianting (Meco) <920369182@qq.com>

* remove %m

Signed-off-by: a1012112796 <1012112796@qq.com>

Co-authored-by: Meco Man <920369182@qq.com>
2022-06-29 14:21:21 +08:00
朱天龙 (Armink) 33be34d8ec [kservice] add NULL check for rt_free and rt_free_align. 2022-06-13 21:14:14 +08:00
Meco Man 99a1c36f02 attach: remove strnlen #6026 2022-06-08 14:45:10 +08:00
Man, Jianting (Meco) 6295ec108e
[kernel] remove the register keyword (#5888) 2022-04-29 06:34:42 +08:00
Meco Man 5e9f525c41 [kernel] enable RT_DEBUG_DEVICE by default and move weak rt_hw_dealy_us in kservice.c 2022-04-19 11:26:41 +08:00
Man, Jianting (Meco) 03823b5016
[kconfig] add 64bit default value for stack size. set tick HZ as 1000 by default (#5778)
* [kconfig] add 64bit default value for stack size. set tick HZ as 1000 by default

* 用RT_KSERVICE_USING_STDLIB_MEMXXX代替RT_KSERVICE_USING_STDLIB_MEMCP/MEMSET
将RT_KSERVICE_USING_STDLIB设置为默认开启

* 优化rt_kprintf支持longlong的能力,默认在64位CPU为开启状态
RT_PRINTF_LONGLONG命名不规范,更改为RT_KPRINTF_USING_LONGLONG

* fix commit error

* fix error

* 优化 system 函数

* RT_KSERVICE_USING_STDLIB_MEMXXX->RT_KSERVICE_USING_STDLIB_MEMORY
2022-04-09 00:40:36 +08:00
Tangyuxin 88de4f726d
[kservice] Fix 64 bit compilation warning (#5649) 2022-03-21 14:07:04 +08:00
Man, Jianting (Meco) 0f6e2bbf27
[kservice] rt_show_version更新年份 (#5552) 2022-01-24 14:20:09 +08:00
Meco Man ebe9fc5771 [kservice] fix the problem of rt_strlen crashed in win32 2022-01-14 23:13:28 +08:00
Gabriel Wang 844f2ef76f
Merge branch 'master' into master 2022-01-08 20:07:54 +00:00
Gabriel Wang 6bb9e546de change all double-empty-lines to single-empty-lines 2022-01-08 20:04:43 +00:00
Meco Man dd62b2b106 [kservice] 增加RT_KSERVICE_USING_STDLIB_MEMSET RT_KSERVICE_USING_STDLIB_MEMCPY 2022-01-09 00:23:18 +08:00
tangyuxin 09f439bcc2 [memheap] Fix 64 bit potential risk 2022-01-08 15:50:14 +08:00
Gabriel Wang d7b8cf81e6 move some __on_rt_xxxxx_hook from rtdef.h to dedicated c soure files 2022-01-07 23:35:44 +00:00
Meco Man 457348e21a [kservice] implement rt_strcpy() 2021-12-22 13:04:45 +08:00
Meco Man 093b9700c8 [kservice] remove RT_USING_ASM_MEMCPY RT_USING_ASM_MEMSET 2021-12-19 08:45:08 -05:00
Tangyuxin d724eed9fc
分离内存分配接口与内存分配算法 (#5175)
* [kernel][mem] Multiple instances of small memory allocation algorithm

* [kernel][mem] Change small memory management algorithm memory header flag

* [kernel][mem] Fix assertion problem

* [kernel][slab] Multiple instances of slab memory management algorithm

* [kernel][memheap] Remove rt_malloc/rt_free/rt_realloc and other related memory interfaces

* [kernel][mem] Clean up memory space of small memory management objects

* [kernel][kservice] Add memory application interface and thread protection interface

* [kernel][kservice] Fix function return value problem

* [kernel][memheap] Optimize memheaptrace print

* [kernel][memheap] Support best mode

* [kernel][memory] Remove semaphore lock

* [kernel][memheap] Add locked flag

* [kernel][memory] Support malloc memory in interrupt

* [kernel][memheap] Add 'memheapcheck' cmd

* [kernel][mem] Fix failure to request full memory

* [kernel][memheap] Fix compilation warning

* [kernel][mem] Fix mem realloc ASSERT

* [examples][testcases] Add small mem testcase

* [examples][mem_tc] Modify test memory size

* [examples][testcases] Add slab memory management algorithm test case

* [examples][testcases] fix small memory management algorithm test case

* [kernel][memory] Adjusting memory allocation algorithm object definition and interface

* [kernel][memory] Fix compilation warning

* [examples][utest] Fix mem test case

* [examples][utest] fix slab test case

* [utest][testcases] Shorten test time

* [kernel][memory] Formatting code

* [examples][utest] Adjust test run time

* [examples][utest] Formatting code

* [bsp] update all rtconfig.h
2021-12-16 16:23:58 +08:00
Meco Man 2d505d8ffd [kservice] 精简RT_PRINTF_PRECISION 2021-11-27 23:52:34 -05:00
Meco Man 6a863ef65c [kservice] 优化RT_PRINTF_LONGLONG,减少重复代码 2021-11-27 18:30:41 -05:00
Meco Man 857428bd23 [kservice] add return value's comment 2021-11-16 18:54:40 -05:00
Meco Man 5e19b71eca 将返回值类型由signed int改为int,符合ISO C标准,防止编译器报错 2021-11-16 03:41:26 -05:00
Jianting (Meco) Man b98539e3f8
Merge branch 'master' into weak 2021-11-11 10:55:44 -05:00
Bernard Xiong 301856ac95
Merge pull request #5063 from Eureka1024/master
[kernel]增加一种新的查找字节最低非0位的算法
2021-11-11 10:18:29 +08:00
杨澄 216cd309ea
Update kservice.c 2021-11-09 23:32:51 +08:00
Meco Man da0bb7f629 [kservice] add RT_WEAK for rt_vsnprintf 2021-11-07 13:24:07 -05:00
杨澄 46fe85e2c2
精简简化版的__rt_ffs()函数 2021-11-07 15:51:24 +08:00
杨澄 e6e9062977
Update kservice.c 2021-11-07 14:57:02 +08:00
guozhanxin 0546b4b524 Merge remote-tracking branch 'remotes/gitee/gitee_master' 2021-10-14 14:07:13 +08:00
mazhiyuan d006905c88 修改size_t为rt_size_t 2021-10-13 16:23:06 +08:00
Meco Man 663991897b fixed bug #5138 2021-10-12 21:47:57 -04:00
nrush 861c579c60 [Kernel] Add build time to the boot printing
When the firmware is built many times in a day, we can not distinguish
them by current boot printing for the lack of compile time. So, it is
necessary to add __TIME__ to rt_show_version().

Signed-off-by: nrush <1741598985@qq.com>
2021-10-11 15:25:26 +00:00
liukangcc d99737d8a9 [update] functions annotation. 2021-09-18 16:56:44 +08:00
杨澄 9d8afc8ede
增加一种新的查找字节最低非0位的算法 2021-09-15 00:07:24 +08:00
Sherman d586417bb7 [kservice] 完善 API 注释 2021-09-14 11:32:11 +08:00
Meco Man b339b5cf33 [src][Kconfig] 增加隐性RT_USING_ASM_MEMCPY定义 2021-08-03 12:05:07 +08:00
xukai c0e48f0417 [components][kernel] 解决多核下 finsh 不能响应串口输入问题 2021-07-09 17:37:46 +08:00
Meco Man 921e606426 将defined(__CC_ARM) || defined(__CLANG_ARM) 改为 ifdef __ARMCC_VERSION 2021-06-13 17:36:42 +08:00
guo b24447a60a
Merge pull request #4785 from mysterywolf/endif
[kernel] 补充endif后缀注释
2021-06-13 09:39:52 +08:00
yangjie fa1f1ef485 [src] add RT_WEAK for rt_malloc_align,rt_free_align 2021-06-11 10:00:23 +08:00
Meco Man e019a57ff3 [kernel] 补充endif后缀注释(2) 2021-06-10 17:58:31 +08:00
geniusgogo ac2c734583 fixed rt_kprintf %s precision print error. 2021-05-07 14:53:48 +08:00
Meco Man e65b2a1c2e add "kservice optimization" option 2021-04-09 13:37:55 +08:00
Bernard Xiong c3978ed9ce
Merge pull request #4396 from mysterywolf/kservice
[kernel] add RT_KSERVICE_USING_STDLIB
2021-04-02 18:24:25 +08:00
杨澄 8836cb7895
Fix code comment error for function rt_memset(). 2021-03-17 23:55:27 +08:00
Meco Man 678306d300 [kernel]auto formatted 2021-03-08 11:25:38 +08:00
Meco Man 58f000bdce 修改拼写错误 2021-03-01 23:58:04 +08:00
Meco Man 00cebaacac add RT_KERVICE_USING_STDLIB 2021-02-28 05:07:02 +08:00
Meco Man b2d3317c6a remove minilibc 2021-02-23 03:21:16 +08:00
Meco Man 949aa71ad4 [kernel][kservice] add RT_WEAK for several functions 2021-01-22 11:04:47 +08:00
iysheng 7a5edbaabd [src/kservice.c] 更新打印提示時間信息 2021-01-04 14:22:58 +08:00
thread-liu ea89767f2c [update] check whether it's a same console device. 2020-11-02 15:00:12 +08:00
Bernard Xiong aa7247eccd
Merge pull request #3764 from ErnestChen1/isdigit0724
[modify] internal function 'isdigit' name to '_isdigit'
2020-08-01 16:51:55 +08:00
chenchaoqun 984e8e5651 [modify] internal function 'isdigit' name to '_ISDIGIT' 2020-07-27 15:46:21 +08:00
chenchaoqun 9f41cbced8 [format] code style of rt_strcmp function 2020-07-27 14:18:16 +08:00
lihui d0ebdc54d4 fix return type error of rt_strcasecmp: rt_uint32_t to rt_int32_t
Signed-off-by: lihui <leehui_hrbeu71102@163.com>
2020-03-24 18:59:31 +08:00
朱天龙 (Armink) a7c590773e
Update show version info. 2020-02-07 13:08:04 +08:00
Bernard Xiong 992d3af3ae [kernel] code and comments cleanup 2019-12-16 13:59:46 +08:00
tyustli d8eb0cfc1e fix kernel and framework no cast type error 2019-06-18 20:09:19 +08:00
HubretXie edccf1c07d
Update kservice.c
修复rt_kprintf输出long long类型数据问题
2019-05-16 10:24:54 +08:00
MurphyZhao 0f673df08a [src/kservice.c] 修复 rt_vsnprintf 格式化后宽度不正确的问题
[src/kservice.c] 修复 rt_vsnprintf 处理 size 和 buf 为 0 极端情况的 bug (对 0 地址写入)

Signed-off-by: MurphyZhao <d2014zjt@163.com>
2019-03-25 16:50:13 +08:00
armink b2c338970f [kservice] Update the rt_strnlen function. 2019-03-09 15:46:56 +08:00
Bernard Xiong 7383269905 [Kernel] Code cleanup for compiling warning. 2019-02-12 14:33:45 +08:00
armink 791c2c89cf [kservice] Update the rt_show_version info to 2019. 2019-01-28 20:12:44 +08:00
MurphyZhao 5c76d3d516 [src][kservice.c] 修复 snprintf 中 `print_number` 函数错误解析 `.0` format 的问题
Signed-off-by: MurphyZhao <d2014zjt@163.com>
2019-01-21 19:28:44 +08:00
Bernard Xiong b31888de49 [Kernel] Fix the rt_memset/memcpy issue under 64bit ARCH. 2018-11-01 09:09:54 +08:00
Bernard Xiong 432210809d [Kernel] Fix the data type issue in kservice.c 2018-10-31 21:32:34 +08:00
Bernard Xiong 484afe9d2c [Kernel] Add 64bit CPU support. 2018-10-26 06:35:42 +08:00
Bernard Xiong ff08faf605 [Kernel] Adjust the copyright information 2018-09-25 11:06:07 +08:00
Bernard Xiong b98a0ba804 [Kernel] Add ARMCC 6.x support. 2018-09-23 12:08:44 +08:00
Bernard Xiong 41f7f2c284 [Kernel] Update to Apache License v2.0
Update license for RT-Thread kernel.
2018-09-14 22:37:43 +08:00
Bernard Xiong efe4523132 [Kernel] move module tolibc/libdl. 2018-08-30 20:27:45 +08:00
Bernard Xiong 6964d623aa [Kernel] Add strdup for armcc 2018-07-15 16:03:40 +08:00
朱天龙 (Armink) 4e54df820b
[kservice] Update show version year info to 2018. 2018-03-02 08:11:17 +08:00
emlslxl 2340408e3c fix code style 2018-02-24 16:10:44 +08:00
bernard ae7237dc53 [BSP] Fix the WIN32 compiling issue.
rename _errno to __rt_errno for conflict in WIN32.
2017-11-30 23:56:52 +08:00
flyingcys f6b71172b5 fix rt_memcpy buf in RT_USING_TINY_SIZE enable 2017-11-02 11:12:55 +08:00
bernard b27c7e4826 [Kernel] Add signal implementation.
1. Add signal implementation;
2. Change the 'rt_uint8_t' of cmd to 'int';
2017-10-15 22:31:53 +08:00
geniusgogo 2aae989f40 Merge branch 'master' into RT_MACRO 2017-09-18 16:27:20 +08:00
xieyangrun 6b06cb83e3 rename WEAK to RT_WEAK 2017-09-18 11:32:13 +08:00
emlslxl e521decf2e 根据documentation/coding_style_cn.txt约定 对内核src和include目录下的文件代码进行格式化 2017-09-15 11:02:24 +08:00
tanek liang 2448b69d02 [kernel] rename RT_TINY_SIZE to RT_USING_TINY_SIZE 2017-07-24 00:28:15 +08:00
朱天龙 (Armink) c3c26baf6f Update kservice.c
Update year info from 2016 to 2017
2017-04-14 14:55:35 +08:00
bernard 2ce7382534 [Kernel] Add rt_kputs routine. 2017-01-31 13:18:20 +08:00
dogandog 4c9bd71f22 Correct comments about doxygen format
chang /*@{*/ to /**@{*/ and /*@}*/ to /**@}*/
2016-08-19 10:10:26 +08:00
zhangjun 65ac4a0810 增加rt_strnlen,lua采用单独的线程 2016-08-12 22:14:07 +08:00
Jason Pan e4b138f810 Fix type size for 16bit cpu 2016-08-01 19:06:34 +08:00
Bernard Xiong c8c4d2edcf [Kernel] Update year information in version info. 2016-04-18 13:58:01 +08:00
GalaIO b886340e67 open and then get the new device
in rt_console_set_device, open new device first and get the new device to _console_device.
我在编写程序时,在device驱动中打印log,但是使用rt_kprintf时,如果_console_device存在非空,那就执行驱动的write函数,但是这是device还没有初始化成功,但是已经提前给_console_device赋值,导致了程序无故fault,以上述修改可避开这样的矛盾。
2015-09-10 22:59:51 +08:00
Bernard Xiong 266496cef3 [Kernel] Use rt_assert_handler() function to handle assertion. 2015-08-03 16:07:30 +08:00
armink 892eac2cce [kservice]add hook for RT_ASSERT 2015-06-11 10:59:25 +08:00
prife 1b1908b35d [kservice] fix rt_strcmp/strncmp/strlen prototype 2015-05-20 20:40:57 +08:00
Bernard Xiong b83b1ee53d [Kernel] Change the copyright date information 2015-01-21 14:19:01 +08:00
Grissiom 57b5c74a71 rt_kprintf: force the open_flag to be RT_DEVICE_FLAG_STREAM
Commit a6251a439e changed the serial device to check open_flag
instead of flag. So we should change the rt_kprintf counterpart as well.
2015-01-04 19:43:33 +08:00
bernard 1f3ea02c5a [Kernel] Use stream mode to open console device. 2014-09-11 12:54:05 +08:00
bernard a1766b6c71 Add WEAK definition; 2014-06-26 14:47:53 +08:00
aozima cad12ee14e update rt_kprintf: make sure the device is in STREAM mode when used by rt_kprintf. 2013-09-24 15:29:08 +08:00
Grissiom 7b0a3afdf9 kservice: export vsnprintf as rt_vsnprintf
vsnprintf is a common string function that could be used in many places.
Using both vsnprintf in libc and vsnprintf in the RTT could make a
bigger image. Moreover, if newlib is not enabled when compiling with
GCC, referencing vsnprintf will lead to link error:

    .../arm-none-eabi/lib/armv7-ar/thumb/softfp/libc.a(lib_a-sbrkr.o):
    In function `_sbrk_r':
    sbrkr.c:(.text._sbrk_r+0xc): undefined reference to `_sbrk'
    collect2: error: ld returned 1 exit status

Using rt_vsnprintf could avoid such problem.
2013-09-23 11:34:13 +08:00