Commit Graph

16470 Commits

Author SHA1 Message Date
Meco Man cee64a41a4 [klibc] format comments after #9459 2024-09-22 18:25:47 -04:00
wdfk-prog 5ec20c4289
fix:[kstdio]Disable "-Wimplicit-fallthrough" below GNUC V7 (#9459)
fix:Disable "-Wimplicit-fallthrough" below GNUC V7
2024-09-22 09:49:59 +08:00
Shell 9a27de92ae feat: smart: user space context optimization
This patch optimizes the user-space context handling in the ARM64
architecture, specifically improving how the context is saved and
restored during system calls and interrupts. The changes make the
code more efficient and easier to maintain, while ensuring proper
preservation of user context during system transitions.

Changes:
- Introduced a parameter for context saving to improve flexibility.
- Replaced hardcoded stack pointer operations with frame-relative
  references for better readability and code reuse.
- Simplified context restoration, removing redundant operations like
  loading/storing floating-point registers.

Signed-off-by: Shell <smokewood@qq.com>
2024-09-19 23:02:39 -04:00
Shell 210cd71128 fixup: pty: possible memory leaking on close()
The ref_count of the vnode is NOT bound to the resource reference counts
of the ptm device created by opening `dev/ptmx`, so the conditional
release of resource may end up by memory leaking if the multiple user
have open the `dev/ptmx`.

Changes:

- Removed conditional branch on recycling resource

Signed-off-by: Shell <smokewood@qq.com>
2024-09-19 23:02:25 -04:00
GuEe-GUI 87906499a3 [DM/FDT] Fixup memory address reserved and translate in early
1.Fixup `fdt_reserved_memory_reg` loop time.
2.Fixup `rt_fdt_translate_address` cells value reader.

Signed-off-by: GuEe-GUI <2991707448@qq.com>
2024-09-19 21:16:56 +08:00
zhao maosheng 992e79a0f8 optimize sal_bind 2024-09-19 21:15:52 +08:00
GuEe-GUI 3d503e931b [DRIVER/PIC] Add ARM GICv2/v3 V2M, ITS support.
Fix some code style and init for V2M, ITS.

V2M is the PCI MSI/MSI-X for GICv2.
ITS is the PCI MSI/MSI-X for GICv3/v4.

Signed-off-by: GuEe-GUI <2991707448@qq.com>
2024-09-19 21:14:42 +08:00
GuEe-GUI 94e49755af [FEATURE/PIC] support PIC cancel (only in debug)
PIC may free because some wrongs in debug.
We should remove in PIC list or there are
some undefined behavior will happen.

Signed-off-by: GuEe-GUI <2991707448@qq.com>
2024-09-19 21:14:42 +08:00
GuEe-GUI 04cdbc647c [FIXUP/PIC] pirq's child handler should lock less
When call the child handler, the PIC ops needn't
lock again.
Critical zone protection by PIC implementers.

Signed-off-by: GuEe-GUI <2991707448@qq.com>
2024-09-19 21:14:42 +08:00
GuEe-GUI 55b40b5164 [FIXUP/PIC] set interrupt status when do traps
Signed-off-by: GuEe-GUI <2991707448@qq.com>
2024-09-19 21:14:42 +08:00
GuEe-GUI 584f4b869d [PIC/FIXUP] pirq reinit fail
don't reinit pirq's list if cascade

Signed-off-by: GuEe-GUI <2991707448@qq.com>
2024-09-19 21:14:42 +08:00
milo 2a8aba4c8b
[fix]:fix log format and reopen with a different oflag issue (#9452)
fix log format and reopen with a different oflag issue
2024-09-19 18:15:55 +08:00
heyuanjie87 29c0357ff8 [libcpu]优化rv构建脚本中选择vendor目录的判断条件 2024-09-18 22:00:35 -04:00
Supper Thomas c9d18c444a
[action/ci] Add toolchain stup script (#9453)
* [action] add toolchain install script
2024-09-16 11:13:30 +08:00
Shell d45e13c471 fixup: dfs_v2: Correct device mode permissions in devfs
The mode permissions for character, block, and pipe devices were
previously set to 0777, which is overly permissive and not in line
with standard practice. This change reduces the permissions to 0666,
restricting execute permissions while still allowing read/write access.

Changes:
- Adjusted permissions for character/block/pipe devices from 0777 to 0666.

Signed-off-by: Shell <smokewood@qq.com>
2024-09-15 13:29:43 -04:00
Yuqiang Wang beb7bc42de
[bsp][renesas] Add a new BSP: RZN2L-RSK 2024-09-15 13:29:20 -04:00
Supper Thomas 6320f184f5
[doxygen] add driver example for doxygen (#9446) 2024-09-15 08:22:44 +08:00
zms123456 379aece6dc
[components][sal]delay getting sal_proto_family in sal_ioctlsocket 2024-09-14 13:52:40 -04:00
Shell 3ca6126efc fixup: smart: remove unnecessary Kconfig option
The `LWP_CONSOLE_INPUT_BUFFER_SIZE` is a legacy config option for TTY
driver used in smart. Since the driver is updated, there's no dependency
of this option any more.

Changes:

- Removed unused Kconfig option `LWP_CONSOLE_INPUT_BUFFER_SIZE`

Signed-off-by: Shell <smokewood@qq.com>
2024-09-14 13:50:36 -04:00
Shell 2cbd5889d1 fixup: dfsv2: seq: aligned proto of lseek to manual
In manual, the prototype of lseek is

`off_t lseek(int fd, off_t offset, int whence);`

where the return type is `off_t` but not ssize_t.

Signed-off-by: Shell <smokewood@qq.com>
2024-09-14 13:30:53 -04:00
Rbb666 cadcd81104 [ci]修正#9441-label路径设置错误问题 2024-09-14 19:54:37 +08:00
zms123456 accd616e17
[component][sal]delete netdev_lo
netdev_lo无需单独处理,可以根据协议去找对应的网络设备
2024-09-14 01:49:25 -04:00
Meco Man f17a71c2e4 [action][format] rename format check file name 2024-09-14 11:40:28 +08:00
Meco Man 91f11aa325 [action][spell] remove spell check when pushing 2024-09-14 11:40:28 +08:00
Rbb666 45952caab0 [ci]完善组件中的ci-labels 2024-09-13 23:39:16 -04:00
CXSforHPU bb91502465
[drivers] Specifies the name of the drivers driver file
https://github.com/RT-Thread/rt-thread/pull/9420
2024-09-13 17:40:40 -04:00
Shell 57d002b25e feat: remove redundant codes under virt64, c906
Changes:

- create new folder name `common64` and save all common codes of rv64
  inside

Signed-off-by: Shell <smokewood@qq.com>
2024-09-13 17:35:00 -04:00
GuEe-GUI 2d026a316a [FEATURE/OFW] add address reverse/translate for DMA/CPU's address
DMA and CPU address view is different, we need to convert them:

    +--------+    +--------+  +---------+          +--------+
    |        |    |        |  |         |          |        |
    |  CPUs  |    |  DEV0  |  |  IOMMU  <----+     |  DEV1  |
    |        |    |        |  |         |    |     |        |
    +----+---+    +----+---+  +----+----+    |     +----+---+
         |             |           |         |          |
0x200000 |      0x1000 |    0x1000 |         |   0x8000 |
         |             |           |         |          |
         +-------------+-----------+         +----------+
         |
         |
+--------v----------------------------------------------------+
|                                                             |
|                          Address BUS                        |
|                                                             |
+-------------------------------------------------------------+

Signed-off-by: GuEe-GUI <2991707448@qq.com>
2024-09-13 17:33:29 -04:00
GuEe-GUI 117e6ed347 [FEATURE/FDT] Add bootargs select in early
Maybe use for memory/DMA buffer init before
ofw_node unflatten.

Signed-off-by: GuEe-GUI <2991707448@qq.com>
2024-09-13 17:33:29 -04:00
GuEe-GUI cb665f932e [FIXUP/OFW] ofw_parse_object fail
The ofw parse should:
1. Check obj_name EQU the current node's rt_data.
2. Find the next object name.
3. goto "2" until obj_name EQU the cmp_cell's obj_name.

Signed-off-by: GuEe-GUI <2991707448@qq.com>
2024-09-13 17:33:29 -04:00
GuEe-GUI 8c456c5e33 [FIXUP/OFW] remove the last empty string for bootargs
Signed-off-by: GuEe-GUI <2991707448@qq.com>
2024-09-13 17:33:29 -04:00
GuEe-GUI 06211b8be1 [FIXUP/OFW] DTS version header always v1.0
Signed-off-by: GuEe-GUI <2991707448@qq.com>
2024-09-13 17:33:29 -04:00
GuEe-GUI 43701ea1ed [FIXUP/OFW] Increase append child node's ref_count
rt_ofw_append_child append a new child node and return,
ref_get is necessary.

Signed-off-by: GuEe-GUI <2991707448@qq.com>
2024-09-13 17:33:29 -04:00
GuEe-GUI 9fd9c1ee45 [FIXUP/OFW] rt_ofw_foreach_node_by_compatible args
Signed-off-by: GuEe-GUI <2991707448@qq.com>
2024-09-13 17:33:29 -04:00
zms123456 140ca0d2ff
[components][sal]replace netdev's spin_lock_irqsave to spin_lock
netdev的函数不会在中断中调用,无需关中断
2024-09-13 17:32:35 -04:00
zms123456 fb02e7934d
[component][net]add more socket flag 2024-09-13 17:30:24 -04:00
Rbb666 49c39d4a8d [bsp][gd32]Fix the problem that uartv2 does not enable dma compilation error. 2024-09-13 17:29:23 -04:00
zms123456 f2dc4f13cb
[components][lwip]fix lwip poll macro conflict 2024-09-13 17:29:08 -04:00
heyuanjie87 6d39cdf836 [lwp] 取消脚本中限制rv的具体cpu类别
此目录中为rv64通用代码
2024-09-13 17:28:47 -04:00
Yilin Sun 779547d708 bsp: nxp/mcx/mcxc/mcxc444: Add SPI driver support.
Signed-off-by: Yilin Sun <imi415@imi.moe>
2024-09-12 18:15:32 -04:00
Supper Thomas a0e1f954c8
[action][cppcheck] add summary (#9426)
* [action][cppcheck] add summary

添加summary 方便查看出错信息
2024-09-12 09:41:22 +08:00
Supper Thomas c154c24319 [action][ci] add cppcheck new feature
'--check-level=exhaustive'
这个选项可以更深入的在分支中检测,但是会耗时比较久一些。
2024-09-11 20:55:55 -04:00
Shell c78a19ed26 feat: libcpu/risc-v: unify low-level bringups
This patch consolidates the separated architecture-specific code for
rv64 (virt64 and c906) under a more unified approach. The changes
aim to enhance maintainability and code reuse, reducing duplication
between these two architectures while adding small improvements in
porting compatibility.

Changes:
- Modified build scripts (SConscript) for both virt64 and c906 to
  remove ASID and vector dependencies when not required.
- Updated c906's sbi.c and sbi.h to use standard integer types
  (uint32_t) and include the missing <stdint.h> header.
- Unified inline function declaration for `sbi_call` across both
  c906 and virt64 using `rt_inline`.
- Disabled FPU and vector in c906's startup assembly file, aligning it
  with the virt64 handling.
- Corrected syscall handler type definitions in c906 for consistency.

Signed-off-by: Shell <smokewood@qq.com>
2024-09-11 18:06:51 -04:00
Shell e244c196c4 feat: libcpu/risc-v: unify interrupt & IO on rv64
This patch aims to unify the two currently separated RISC-V 64-bit
architecture ports, 'virt64' and 'c906', into a single generic
'common64' port. The changes include renaming files and updating
includes to use a unified 'interrupt.h' header, as well as making
adjustments to IO and trap handling to be more consistent between the
two architectures.

Changes:
- Renamed 'rt_interrupt.h' to 'interrupt.h' and updated includes accordingly.
- Unified IO register access functions in 'riscv_io.h'.
- Added 'opcode.h' for portable assembly support.
- Updated 'plic.c' and 'plic.h' to handle interrupts in a unified manner.
- Modified 'trap.c' to handle exceptions and interrupts consistently for 'rv64'.

Signed-off-by: Shell <smokewood@qq.com>
2024-09-11 18:06:51 -04:00
Shell a00aaab2ba feat: libcpu/risc-v: unify mmu related works
These changes are designed to standardize the memory management across
'virt64' and 'c906', ensuring efficient handling of address spaces and
page tables.

Changes:
- Creation of ASID management files (`asid.c`) for both 'c906' and
  'virt64' architectures, which is essential for maintaining stability.
- Extensive updates to the MMU configuration and handling in `mmu.c` and `mmu.h` files.
- Addition of functions to manage ASID allocation and switching of page tables.
- For c906, accommodated the early memory setup to the one from virt64.

Signed-off-by: Shell <smokewood@qq.com>
2024-09-11 18:06:51 -04:00
Shell 7528645f59 feat: libcpu/risc-v: unify context on c906, virt64
Changes:
- added config for NEW_CTX_SWITCH
- used new context on c906 sched switch routine
- update _rt_hw_stack_init to fit into NEW_CTX_SWITCH
- separated vector ctx from the generic

Signed-off-by: Shell <smokewood@qq.com>
2024-09-11 18:06:51 -04:00
Shell adbbd24ad7 feat: bsp: qemu risc-v64: fit into common64 2024-09-11 18:06:51 -04:00
zms123456 0edd2e7766
[utest]fix race in mutex tc & add recurse lock tc 2024-09-11 18:04:41 -04:00
zms123456 b423a6b1e3
[components][lwp]remove extra check in sys_bind 2024-09-11 18:04:05 -04:00
zms123456 08221b54d0
[kernel][mutex] fix bug of thread exit without releasing mutex & add error check log 2024-09-11 18:03:43 -04:00