Commit Graph

4673 Commits

Author SHA1 Message Date
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
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
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
zms123456 accd616e17
[component][sal]delete netdev_lo
netdev_lo无需单独处理,可以根据协议去找对应的网络设备
2024-09-14 01:49:25 -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
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
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
zms123456 b423a6b1e3
[components][lwp]remove extra check in sys_bind 2024-09-11 18:04:05 -04:00
GuEe-GUI f9b632d52d [DM/MISC] Add error no for ptr
When the driver request a API gets RT_NULL which return value is ptr,
they could not know why get a RT_NULL.

some API return RT_NULL, is not error internal maybe, it just not
supported for this platform, but the driver still could work ok,
the API can return (RT_NULL + -RT_EEMPTY) to driver.

on the other hand, the driver can do more behaviors by error no.
When the API return the -RT_EBUSY, driver can wait for a moment and retry.
When the API return the -RT_ENOSYS, driver can try the next mode or request's name.

Signed-off-by: GuEe-GUI <wusongjie@rt-thread.com>
2024-09-11 14:34:13 +08:00
CYFS cb0b5b05ad
[components][sensor]增加电源检测类型 2024-09-10 19:54:03 -04:00
ryancw 9de975fa93 [components][sal][at] _gethostbyname_by_device 添加注释 2024-09-09 18:07:41 -04:00
ryancw e9711d5640 [components][sal][at] netdb添加at_gethostbyname_r 2024-09-09 18:07:41 -04:00
ryancw bac9812cf9 [component][at_socket] udp一个socket跟多个地址通讯bug修复、DNS加锁防止多线程错乱、实现at_gethostbyname_r、稳定性优化 2024-09-09 18:07:41 -04:00
SeliverWang 66dd03f6c2 修复audio_pipe中函数在开启POSIX IPC时与 POSIX PIPE冲突问题 2024-09-06 23:18:09 -04:00
GuEe-GUI 2168ed8e7d [DM/Feature] Basic PCI/PCIe (Peripheral Component Interconnect Express) bus
PCI/PCIe have better performance and more devices support, such as
NVMe, GPU, Powerful NIC (Like RDMA). PCI/PCIe can access control by
IOMMU that the virtualiztion and userspace driver will more safety.
PCI/PCIe device could hot plugging, no design modifications SoC required,
PCI/PCIe on Embedded SoC is popular now.
We make a simple framework to support them.

Feature Lists:
1.PCI INTx: the INT[A-D] pin IRQ for legacy PCI, work with platform PIC.
2.MSI/MSI-X: the message write IRQ for PCIe, work with platform's PIC.
3.PME: we only support the D0, D1, D2, D3HOT, D3COLD init by framework.
4.Endpoint: a simple EP framework for PCI FPGA or NTB function.
5.OFW: we only support work on OFW SoC, ACPI support in the future maybe.

Host controller:
1. Common PCI host controller on ECAM.
2. Generic PCI host controller on ECAM.

Signed-off-by: GuEe-GUI <2991707448@qq.com>
2024-09-06 17:45:03 -04:00
GuEe-GUI 802a6ed2ca [DM] Extended drivers MISC interface
1. RT_FIELD_PREP: prepare a bitfield element.
2. RT_FIELD_GET: extract a bitfield element.
3. rt_offsetof: member offset of a struct
4. rt_upper_32_bits: high 32 bits of value.
5. rt_lower_32_bits: lower 32 bits of value.
6. rt_upper_16_bits: high 16 bits of value.
7. rt_lower_16_bits: lower 16 bits of value.
8. rt_max_t: fix type of max(...).
9. rt_ilog2: integer logarithm base 2.

Signed-off-by: GuEe-GUI <2991707448@qq.com>
2024-09-06 17:45:03 -04:00
RyanCW 188b87f4d8
[components][at_socket] 添加errno设置 2024-09-05 17:54:50 -04:00
GuEe-GUI 175a2ff954 Fixup platform not free device in OFW
Signed-off-by: GuEe-GUI <2991707448@qq.com>
2024-09-03 19:49:47 -04:00
GuEe-GUI 2ec69c3ce4 Fixup bus remove device option
The bus should call driver's `remove` callback not
instead of `shutdown` in rt_bus_remove_device.

Signed-off-by: GuEe-GUI <2991707448@qq.com>
2024-09-03 19:49:47 -04:00
Yaochenger 7469edd165 [fix][device] 修正使用rt_device_create创建设备,使用rt_device_destroy删除失败的问题 2024-09-03 18:24:45 -04:00
yandld 635e16a8d5 [libc] 修复 ctime()死机问题 2024-09-03 18:13:09 -04:00
sakumisu 2d266742e0 fix(cherryusb): fix build error 2024-09-02 21:27:47 +08:00
sakumisu 9511e4bd19 update(cherryusb): fix dfs mem leak, add check for lwip stack size, select elmfat when use msc 2024-09-02 00:37:35 -04:00
Shell 679761983d fixup: ptyfs: CI reported snprintf type issues 2024-09-01 15:12:34 -04:00
zhugengyu b9f4daa97a
[BSP][Phytium] add support for mainbranch cherryusb (xhci host + pusb2 device/host) 2024-08-27 22:06:13 -04:00
sakumisu 669a6822e7 update(cherryusb): update to v1.4.0 2024-08-27 00:48:40 -04:00
zhuzhuzhu 1be24fc7da
【修复】修复link系统调用返回值问题 2024-08-25 10:57:38 -04:00
zhuzhuzhu dc232080a0
【修复】修复rmdir系统调用返回值不符合用户预期问题 2024-08-25 10:57:15 -04:00
zhuzhuzhu d9fac09f71
【修复】 修复dup系统调用对用户态的返回值问题 2024-08-25 10:56:47 -04:00