Commit Graph

4872 Commits

Author SHA1 Message Date
Chen Wang 14cfc72fb8
doxygen: finsh: Normalize macro definitions (#10006)
Regular macro definitions according to [1].

Note: for variadic macros such as MSH_CMD_EXPORT, we can
not use normal @param command, otherwise doxygen will
report "@param is not found in the argument list of ...".
So I just write the parameters by manual.

Link: https://rt-thread.github.io/rt-thread/page_howto_macro.html [1]

Signed-off-by: Chen Wang <unicorn_wang@outlook.com>
2025-02-19 21:06:45 +08:00
Guorui Li 6a792c9df2
[lwp]add comments for lwp system calls. (#9934) 2025-02-18 19:51:10 +08:00
heyuanjie87 4b25b5ed9a
[lwp]检查killpg的signo参数的有效性 (#9981)
* [lwp]对检查killpg的signo参数的有效性
2025-02-18 14:33:56 +08:00
Rbb666 91beec4239 [ulog]Fix the problem of file_buf being released incorrectly 2025-02-18 14:31:03 +08:00
Supper Thomas 5b3320624d
[src/ktime] fix the bug when use keil AC6 and open RT_USING_HOOKLIST … (#9993)
* [src/ktime] fix the bug when use keil AC6 and open RT_USING_HOOKLIST and RT_USING_KTIME
2025-02-16 22:02:42 +08:00
Chen Wang c40b79037c
doxygen: add prefix for groups (#9991)
* doxygen: add prefix for groups

Add "group_" prefix to doxygen group names. This makes
it easier to grep with group name later.

This patch only modifies the groups defined in the pathes
of INPUT of documentation/Doxyfile:

INPUT = . \
        ../src \
        ../include \
        ../components/finsh \
        ../components/drivers/include/drivers \
        ../components/drivers/clk \
        ../components/dfs/dfs_v2/src \
        ../components/dfs/dfs_v2/include

Other groups are not touched.

Signed-off-by: Chen Wang <unicorn_wang@outlook.com>

* ci: fixed error report when run file_check.py

Such as:
- "please delete extra space at the end of this line."
- "the RT-Thread error code should return negative value. e.g. return
  -RT_ERROR"

Signed-off-by: Chen Wang <unicorn_wang@outlook.com>

---------

Signed-off-by: Chen Wang <unicorn_wang@outlook.com>
2025-02-15 12:15:19 +08:00
GuEe-GUI 74f43edd6c [DM/THERMAL] Remove unused code in update poll
Signed-off-by: GuEe-GUI <2991707448@qq.com>
2025-02-11 14:58:18 +08:00
GuEe-GUI aaf18e497c [DM/LED] Rename LED register/unregister
rt_hw_* is use for DM and not DM, but LED only use in DM.

Signed-off-by: GuEe-GUI <2991707448@qq.com>
2025-02-11 14:58:18 +08:00
GuEe-GUI f506076281 [DM] Replace spinlock static init by RT_DEFINE_SPINLOCK
Signed-off-by: GuEe-GUI <2991707448@qq.com>
2025-02-11 14:58:18 +08:00
GuEe-GUI f20e8973be [DFS/ISO9660] Remove warning for ops
Signed-off-by: GuEe-GUI <2991707448@qq.com>
2025-02-11 14:58:18 +08:00
GuEe-GUI 5a455cb615 [DM/PIN] Reset the value of PIN_NONE
PIN_NONE is '-1', is similar to '-RT_ERROR',
'-RT_EEMPTY' is better.

Signed-off-by: GuEe-GUI <2991707448@qq.com>
2025-02-11 14:58:18 +08:00
GuEe-GUI 578cfc0b2a [DM/CORE] Add IDA init in runtime
Signed-off-by: GuEe-GUI <2991707448@qq.com>
2025-02-11 14:58:18 +08:00
GUI 1564735b5c
[DM/SPI] Make CS pin config fixed in system (#9977)
Make a max CS pin value (16) for SPI, that will not
alloc `*cs_pins` by malloc, because drivers call
`rt_device_unregister` may not free item.

Fixup the QSPI init configure member in DM mode.

Make SoC Kconfig import easy.

Signed-off-by: GuEe-GUI <2991707448@qq.com>
2025-02-11 14:54:59 +08:00
Rbb666 f820c1948a
[drivers/spi]修复spi configure会执行两次的问题 (#9972)
* [drivers/spi]修复spi configure会执行两次的问题
2025-02-11 13:04:31 +08:00
GuEe-GUI 12fded19f5 [DM/FDT] Fixup earlycon loss old messages.
The `rt_fdt_scan_chosen_stdout` will init fdt_earlycon data
without `msg` only, the `msg_idx` should not clean, too.
Because we check if have old messages by `msg_idx`

Signed-off-by: GuEe-GUI <2991707448@qq.com>
2025-02-10 15:55:54 +08:00
heyuanjie87 d3d33ff983
[dfs]mmap的文件在关闭后释放file指针 (#9917)
* [dfs]mmap的文件在关闭后释放file指针
2025-02-09 15:55:30 +08:00
Rbb666 d83d71cc05 [drivers/spi]统一软件SPI配置 2025-02-09 15:48:49 +08:00
heyuanjie87 6e3c9acd39 [lwp]修正kill(pid < -1)时的返回值错误 2025-02-08 14:32:20 +08:00
Supper Thomas 0cc4dc4a3d
[action] add ci menuconfig check (#9961) 2025-02-01 12:39:22 +08:00
wumingzi 6481633ec6
[doxygen] add doxygen comment for clk.c and clk.h (#9950)
Accroding to #9947 and #9424, adding doxygen comment for function in .c files and data structure, macro in .h file is a solution.For this pr, I encountered problem following situations.
    - rt_clk_unprepare function return value type is different from rt_clk_ops so I change type of rt_clk_unprepare and its dependencies.
    - clk_get function may be similar as rt_clk_unprepare but I'm not sure so not modify.
    - clk_release implements may be incomplete, so I just marked in comment.

Signed-off-by: 1078249029 <1078249029@qq.com>
2025-01-27 15:54:13 +08:00
CYFS 599cefe834
[components][drivers]:fix spi bug and add software spi (#9944)
* fix:spi bus issue

* [components][drivers]add software SPI bus support
2025-01-27 08:35:11 +08:00
hydevcode 2a18d6873b
[bsp][nrf5x]added the cherryusb adapter for nrf52840 (#9939) 2025-01-24 23:12:25 +08:00
wumingzi 4d4c9660ce
[doxygen] add doxygen comment for blk.h (#9947)
Signed-off-by: 1078249029 <1078249029@qq.com>
2025-01-24 14:14:43 +08:00
heyuanjie87 ed3222c2f8
[lwp]修正无法通过文件名查找pid的问题 (#9935) 2025-01-21 13:01:58 +08:00
Evlers 45bb1ddac9 [components][netdev] add statistics and more inupt parameters to ping command 2025-01-20 16:55:40 +08:00
zhujiale 9c164882e8 fix when open samrt but using msh after run elf file the msh will down 2025-01-20 15:09:02 +08:00
Chen Wang d3841c3109
lwp: Kconfig: LWP_DEBUG default as n (#9921)
LWP_DEBUG is debugging related, should be disabled
by default.

Signed-off-by: Chen Wang <unicorn_wang@outlook.com>
2025-01-16 19:56:44 +08:00
Meco Man da6c62c293 [utest] fix twice operation of uassert 2025-01-15 10:26:40 +08:00
zms123456 4343d32df4
[components][fs]sync procfs (#9206)
* add procfs

* fix ref count check error
2025-01-14 14:18:39 +08:00
zms123456 0ae537e531
[components][dfs]separate dfs fs data structure ops (#9205)
separate dfs fs data structure ops
2025-01-14 14:17:00 +08:00
Meco Man bdd9447d70 [utest] make RT_USING_CI_ACTION to be clear
RT_USING_CI_ACTION will select RT_UTEST_USING_AUTO_RUN and RT_UTEST_USING_ALL_CASES
2025-01-09 17:45:15 -05:00
wycwyhwyq 53bd56ccf9 [components][dfs_v2]: Fix dfs_devfs_open memory leak 2025-01-09 19:07:56 +08:00
kurisaw 1b76eccb37 [drivers] merge the software i2c driver 2025-01-08 22:07:03 -05:00
Meco Man 97b9cc5000 fix: add \n for addr2line hint 2025-01-08 17:54:46 -05:00
Meco Man 88920fd814 [utest] 修复UTEST_UNIT_RUN嵌套宏时将宏直接输出的问题 2025-01-07 20:44:29 -05:00
Meco Man 0a25fcffab [utest] add float operators
uassert_float_equal and uassert_float_not_equal
2025-01-07 20:44:29 -05:00
Shell 6c6c5f5d35 feat: Kconfig: collecting some config to sub-menu
To improve the readability of the menuconfig.

Signed-off-by: Shell <smokewood@qq.com>
2025-01-06 19:34:16 +08:00
Shell 8507c38222 fixup: umount: set errno according to POSIX
According to the POSIX.1, we should give a EBUSY on umount(2) of busy
filesystem.

Signed-off-by: Shell <smokewood@qq.com>
2025-01-06 19:34:16 +08:00
Shell b63b388d1f feat: add support for dfs remount functionality
This patch introduces a remount feature for the DFS, allowing for the
modification of mount parameters without unmounting the filesystem,
the remount functionality helps modify certain mount flags (like `MS_RDONLY`) without
requiring an unmount, providing more control over mounted filesystems in the system.

The updates is essential for user space init proc to cleanup the runtime
resource, ensuring clean handling of cached data and enhancing system
robustness during power down processing.

Changes:
- Defined new constants for remount flags in `dfs_fs.h`.
- Added the `dfs_remount()` function in `dfs_fs.c` to handle remount operations.
- Introduced a check for unsupported flags and handle error conditions such as invalid paths
  or non-directory targets.
- Updated the `dfs_mnt` structure in `dfs_mnt.h` to include a read-only flag (`MNT_RDONLY`).
- The `dfs_remount()` function allows changing the read-only status of a mounted filesystem.
- Added `MNT_LAZY_UMNT` and `MNT_RDONLY` flags to `dfs_mnt` structure.
- Introduced `dfs_mnt_setflags` function for dynamic flag management.
- Updated `dfs_remount` to utilize `dfs_mnt_setflags` for flag setting.
- Enhanced unmount operations with `dfs_mnt_umount_iter` and lazy unmounting.
- Added `dfs_pcache_clean` to handle cache cleanup for read-only mounts.
- Improved error reporting in `dfs_umount` for better user feedback.
- Refactored `sys_mount` to streamline parameter handling and support remounts.
- Introduced `_cp_from_usr_string` helper for user-space string operations.
- Updated internal APIs to ensure consistency in reference count management.

Signed-off-by: Shell <smokewood@qq.com>
2025-01-06 19:34:16 +08:00
Shell 944f3d05b5 feat: add system reboot and process teardown support
The patch introduces support for system reboot functionality and process teardown,
allowing for a clean shutdown and unmounting of the root filesystem. This is
necessary for ensuring a proper system shutdown process, especially when dealing
with resource cleanup and ensuring that all processes have exited before system
shutdown.

Changes:
- Added `lwp_teardown()` function to handle process cleanup and system teardown.
- Introduced `lwp_pid_wait_for_empty()` to wait for process ID table emptiness
  before proceeding with shutdown.
- Updated `dfs_mnt_unref()` to trigger callbacks when unmounting a filesystem.
- Added new reboot types (`RB_AUTOBOOT`, `RB_POWER_OFF`) and implemented their
  corresponding actions, including cleanup of processes and unmounting root
  filesystem.
- Extended `sys_reboot()` to handle reboot and power off types with appropriate
  callbacks for process and filesystem teardown.
- Introduced callback mechanism for root filesystem unmount notifications.

Signed-off-by: Shell <smokewood@qq.com>
2025-01-06 19:34:16 +08:00
Shell 972931c991 feat: add universal process runtime service
This change introduces the `lwp_runtime.c` component, which provides the
necessary runtime environment for the init process, including boot scripts,
shutdown, and poweroff functionalities. The initialization logic has been
moved from `lwp.c` to this new file, enhancing modularity and flexibility
in handling LWP runtime tasks.

Changes:
- Moved the `lwp_startup` function from `lwp.c` to `lwp_runtime.c` to handle
  system initialization and runtime environment setup.
- Added `lwp_teardown` placeholder for system shutdown and cleanup tasks in
  the future (though not yet implemented).
- Introduced the `LWP_USING_RUNTIME` configuration option in `Kconfig` to
  conditionally enable the runtime environment.
- Updated the `SConscript` to conditionally include `lwp_runtime.c` based on
  the `LWP_USING_RUNTIME` configuration.
- Removed the old `lwp_startup` code from `lwp.c`, simplifying the file.

Signed-off-by: Shell <smokewood@qq.com>
2025-01-06 19:34:16 +08:00
Shell dc3270f14e feat: add signal kill all functionality
This change introduces the `lwp_signal_kill_all` function, which allows a
signal to be sent to all processes in the system. The function iterates
over all PIDs and sends the specified signal to each process, except those
that are protected from signals. This enhancement provides a convenient way
to broadcast signals across all processes in the system.

Changes:
- Added `lwp_signal_kill_all` function in `lwp_signal.c` to broadcast a
  signal to all processes by iterating over all PIDs using the existing
  `lwp_pid_for_each` function.
- Introduced a new `kill_all_param` structure to encapsulate the signal
  information needed for killing processes.
- Added internal `_kill_each` helper function for sending the signal to each
  PID.
- Updated `lwp_signal.h` with the new function prototype for `lwp_signal_kill_all`.
- Modified `sys_kill` in `lwp_syscall.c` to call `lwp_signal_kill_all` when
  a process is not specified.

Signed-off-by: Shell <smokewood@qq.com>
2025-01-06 19:34:16 +08:00
Shell c0b0838892 feat: support PID iteration
This change introduces the `lwp_pid_for_each` function, which provides a
convenient and thread-safe method for iterating over PIDs with a user-
defined callback. This addition is necessary to support cases where
operations must be performed on each PID in the balanced tree, enhancing
flexibility and modularity for PID management.

Changes:
- Added `lwp_pid_for_each` function in `lwp_pid.c` to allow iteration
  over PIDs using a callback function and optional data parameter.
- Defined a new internal `pid_foreach_param` structure to encapsulate
  the callback and data for the iteration.
- Added `_before_cb` helper function for executing the callback on each
  PID node during AVL traversal.
- Ensured thread safety by acquiring and releasing the PID lock around
  the AVL traversal within `lwp_pid_for_each`.
- Updated `lwp_pid.h` with the `lwp_pid_for_each` function prototype and
  included `rtthread.h` for necessary types.

Signed-off-by: Shell <smokewood@qq.com>
2025-01-06 19:34:16 +08:00
Rbb666 2ab5827704 [wq][fix]工作队列默认使用C99标准实现遍历 2025-01-05 08:03:05 -05:00
Evlers c8b0a9dbd9 [wlan] add ap_get_info api for more ap information 2025-01-05 19:29:18 +08:00
Meco Man d583615afe [utest] add rt_memset test case 2025-01-03 13:42:21 +08:00
yuqingli a343e1d7a0 [romfs/dfs_romfs.c] _rom_fops add ioctl 2025-01-03 00:39:54 -05:00
dongly b81a44bf74
[AT] AT_Device 适配 SERIAL_V2 (#9860)
AT_Device 适配 SERIAL_V2
2025-01-03 13:00:33 +08:00
yuqingli 73ea6dab02 删除 RT_EBUSY 返回值注释 2025-01-02 14:54:53 +08:00
yuqingli 2a4e9e902d [ipc/workqueue.c] 删除无用的判断 2025-01-02 14:54:53 +08:00