Commit graph

1514 commits

Author SHA1 Message Date
cuiziwei
e9bbf2928b libcxx: porting libcxx test.
porting libcxx test case to nuttx.

Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2026-01-15 13:40:42 -03:00
liqinhui
1d8eab937f simwifi: refactor the interfaces of simwifi and simnet
Fix CMake logic to correctly include sim_wifihost.

Signed-off-by: liqinhui <liqinhui@xiaomi.com>
2026-01-14 09:22:54 +08:00
liqinhui
3843f7b4fe wifi: Support the wifi operations based on the bss file.
Add support for BSS file-based WiFi simulation.

Signed-off-by: liqinhui <liqinhui@xiaomi.com>
2026-01-14 09:22:54 +08:00
liqinhui
dce89e1820 simwifi: Refactor the interfaces of simwifi and simnet
Refactor simwifi to separate host and sim logic.

Signed-off-by: liqinhui <liqinhui@xiaomi.com>
2026-01-14 09:22:54 +08:00
buxiasen
a938926b52 arch/sim: add JB_ALIGN0 for x64 to ensure the align
Or will cause the fork break as call will auto push 1 item.

Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2026-01-13 10:29:24 +08:00
buxiasen
1058397807 arch/sim: save errno when do context switch
Avoid the errno changed after interrupt in sim and make return value
mistake when according to errno.

Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2026-01-13 10:29:24 +08:00
buxiasen
100c9dd20b arch/sim: add host_errno_get/set for sim to backup/restore in "irq"
Avoid the errno changed after interrupt in sim and make return value
mistake when according to errno.
Move host_errno_convert from macro to sim_errno.c.

Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2026-01-13 10:29:24 +08:00
buxiasen
cd2bf49474 arch/sim/rawgadget: remove the host_uninterruptible_errno
We will remove the API in next commit, so remove the errno manual save
API and save errno more commonly.
After whole pull request, should no longer need to care about errno.

Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2026-01-13 10:29:24 +08:00
buxiasen
8d2ef7f43c Revert "arch/sim: avoid host-call being interrupted before getting errno"
This reverts commit ac5b38c9e5.

Keep host_errno_convert as a common interface in sim_internal.h
Keep the up_irq_save & up_irq_restore as common interface

Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2026-01-13 10:29:24 +08:00
zhanghongyu
fa6c8579dd driver/net: replace net_lock with netdev_lock
modify the code of the adapted protocol stack to avoid deadlocks and the
logic that cannot be protected by locks after modification.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2026-01-06 16:08:30 +08:00
yezhonghui
227d7237ab gpiochip: export ioexpander pointer to user
sim gpiochip ioexpander export to user

Signed-off-by: yezhonghui <yezhonghui@xiaomi.com>
2026-01-05 15:10:41 -03:00
yezhonghui
36f91643ae sim/gpiochip: add sim gpiochip for gpio autotest
add sim gpiochip driver

Signed-off-by: yezhonghui <yezhonghui@xiaomi.com>
2026-01-05 15:10:41 -03:00
yangsong8
59f200ac4f arch/sim: Explicitly compare whether transfer is NULL in usbhost
if (!transfer)  ==>  if (transfer == NULL)

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2026-01-05 09:59:06 +08:00
v-tangmeng
2c24420a1c arch/sim: fix the compile error
USB_EP_MAXP_MASK ==> USB_EP_MAX_PACKET_MASK

Signed-off-by: v-tangmeng <v-tangmeng@xiaomi.com>
2026-01-05 09:59:06 +08:00
yangsong8
bc2daa48cc arch/sim: Optimize sim usbhost isoc endpoint transmission
The USB driver framework only implements a single ISOC transfer.
If multiple transfers are needed, the class driver can initiate
multiple urbs to meet the real-time requirements of the ISOC
 endpoint. The class driver's urb record the buf address, length,
and number of packets sent. The callback function calculates the
data location in the buf based on the callback number and length
returned.

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2026-01-05 09:59:06 +08:00
yangsong8
199290c0ee sim/usbhost: modify ctrlin return value
On success, zero (OK) is returned. On a failure, a negated errno value
is returned indicating the nature of the failure.

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2026-01-05 09:59:06 +08:00
yangsong8
96707bd967 sim/usbhost: fix usbhost async sending data exception
If the callback function is empty during asynchronous sending,
an exception will occur.

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2026-01-05 09:59:06 +08:00
yangsong8
9934dcef76 arch/sim: add usb host async function
add sim usb host async function

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2026-01-05 09:59:06 +08:00
yangsong8
216ceb9242 arch/sim: add usb host iso ep trans function
add sim usb host iso ep trans function

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2026-01-05 09:59:06 +08:00
zhanghongyu
ac3a7da8ed sim_netdriver: add addmac/rmmac support
Avoid PACKET_ADD_MEMBERSHIP calls returning errors.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2025-12-25 10:01:43 +08:00
yezhonghui
ba681d3ddf sim_uart: used wd timer to process transmit
used wdt thread process event

Signed-off-by: yezhonghui <yezhonghui@xiaomi.com>
2025-12-24 22:50:24 +08:00
yezhonghui
276095dc77 sim_rptun: used wd timer to process transmit
used wdt thread process event

Signed-off-by: yezhonghui <yezhonghui@xiaomi.com>
2025-12-24 22:50:24 +08:00
yezhonghui
aeda575c5b sim_hcisock: used wd timer to process transmit
used wdt thread to process event

Signed-off-by: yezhonghui <yezhonghui@xiaomi.com>
2025-12-24 22:50:24 +08:00
yezhonghui
93bf613505 sim/loop: delete sim loop theads at bringup
wdt thread replace sim loop thread

Signed-off-by: yezhonghui <yezhonghui@xiaomi.com>
2025-12-24 22:50:24 +08:00
yezhonghui
0e6afae4f2 usbhost: used wd timer to process loop event
used wdt thread process event

Signed-off-by: yezhonghui <yezhonghui@xiaomi.com>
2025-12-24 22:50:24 +08:00
yezhonghui
bb304441db foc: used wd timer to process loop event
used wdt thread process event

Signed-off-by: yezhonghui <yezhonghui@xiaomi.com>
2025-12-24 22:50:24 +08:00
yezhonghui
a536ea8569 usbdev: used wd timer to process loop event
used wdt thread process event

Signed-off-by: yezhonghui <yezhonghui@xiaomi.com>
2025-12-24 22:50:24 +08:00
yezhonghui
e2ca205f12 camera: used wd timer to process loop event
used wdt thread process event

Signed-off-by: yezhonghui <yezhonghui@xiaomi.com>
2025-12-24 22:50:24 +08:00
yezhonghui
954122641a audio: used wd timer to process loop event
used wdt thread process event

Signed-off-by: yezhonghui <yezhonghui@xiaomi.com>
2025-12-24 22:50:24 +08:00
yezhonghui
bbcf8fe30b usrsock: used wd timer to process loop event
used wdt thread process event

Signed-off-by: yezhonghui <yezhonghui@xiaomi.com>
2025-12-24 22:50:24 +08:00
yezhonghui
c594616e99 netdriver: used wd timer to process netdata
used wdt thread to process loop event

Signed-off-by: yezhonghui <yezhonghui@xiaomi.com>
2025-12-24 22:50:24 +08:00
yezhonghui
c385d74669 lcd/fb: sim used wd timer to process loop event
used wdt thread to process event

Signed-off-by: yezhonghui <yezhonghui@xiaomi.com>
2025-12-24 22:50:24 +08:00
yezhonghui
6b1f484bbd input: change wd timer to precoss input device event
used wdt threads process event

Signed-off-by: yezhonghui <yezhonghui@xiaomi.com>
2025-12-24 22:50:24 +08:00
wangchen
d59cf4a91c sim_wifidriver.c:resolve issue in wapi save_config & wapi reconnect command
resolove issue wapi save_config & wapi reconnect command in sim

Signed-off-by: wangchen <wangchen41@xiaomi.com>
2025-12-23 09:06:11 -03:00
anjiahao
0a2b01950c sched:use tcb_s inside of task_tcb_s , remove all cast
Simplify the code and remove different tcb

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2025-12-22 17:55:45 +08:00
yezhonghui
1fe3de379a sim/spi: delete invaild cs change with ioctl transfer
delete invaild cs

Signed-off-by: yezhonghui <yezhonghui@xiaomi.com>
2025-12-21 06:37:39 +08:00
yezhonghui
96db23e7df sim/spi: ioctl stytemcall use host_uninterruptible
syscall use macro host_uninterruptible

Signed-off-by: yezhonghui <yezhonghui@xiaomi.com>
2025-12-21 06:37:39 +08:00
guohao15
635d81a76b cmake:add missing cflag "-D_FILE_OFFSET_BITS=64" of sim
The -D_FILE_OFFSET_BITS=64 parameter is missing
during the CMake compilation of the sim (simulator) build,
which causes incorrect version invocations of interfaces
such as hostfs_stat.

Signed-off-by: guohao15 <guohao15@xiaomi.com>
2025-12-18 22:18:49 +08:00
anjiahao
b623c781c5 arch:use ARCH_64BIT to mark arch is support 64bit
Add ARCH_64BIT macro to indicate architectures with 64-bit support,
improving portability and conditional compilation.

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2025-12-18 22:05:12 +08:00
yangsong8
3a76917058 sim/usbdev: Process all pending data at once
After processing a packet of data, do not exit interrupt, but continues
to check whether there is data to be processed. If there is, continue
processing.

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2025-12-12 09:35:26 +08:00
ligd
6736558d10 sim_usb: fix host function caused up_interrupt_context() failed
use host_uninterruptible to protect some system functions

Signed-off-by: ligd <liguiding1@xiaomi.com>
2025-12-12 09:35:26 +08:00
yangsong8
8bf88945ce sim/usbdev: Supports registering multiple USB devices on a same host
when start multiple sim, the host refuses to recognize multiple USB
devices, and the prompt message is as follows:
[365652.175289] UDC core: USB Raw Gadget: couldn't find an available UDC or it's busy
[365652.175304] misc raw-gadget: fail, usb_gadget_probe_driver returned -16

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2025-12-12 09:35:26 +08:00
yangsong8
3a0d2cbd41 sim_usb: fix dev function caused up_interrupt_context() failed
use host_uninterruptible to protect some system functions.

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2025-12-12 09:35:26 +08:00
chenxiaoyi
6308167c45 arch/sim: fix oneshot driver to work with both signal and sleep
This commit fixed oneshot driver to work with both signal and sleep.

Signed-off-by: chenxiaoyi <chenxiaoyi@xiaomi.com>
Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2025-11-24 19:43:07 +08:00
ouyangxiangzhen
29bf45c371 arch/sim: Add clkdev driver for sim.
This commit added clkdev driver for sim.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2025-11-24 19:43:07 +08:00
ouyangxiangzhen
fc28b93224 timers/oneshot: Remove all callback and args.
This commit remove all callback and args in the APIs.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2025-11-18 13:02:29 +01:00
ouyangxiangzhen
5c113f79b7 timers/oneshot: Remove all private callback.
This commit removed all private callback and handle it on the upperhalf
of oneshot.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2025-11-18 13:02:29 +01:00
guoshengyuan1
5d7ac216f2 arch: optimize up_check_tcbstack for stack overflow detection
Many times, context switching does not occur when the thread stack
memory is almost exhausted, so we need to mofify up_check_tcbstack to
accurately detect it.

Co-authored-by: Chengdong Wang <wangchengdong@lixiang.com>
Signed-off-by: guoshengyuan1 <guoshengyuan1@xiaomi.com>
2025-09-27 12:56:11 +08:00
guoshengyuan1
6a57c56925 arch: replace all nxsched_suspend/resume_*** with nxsched_switch_context
Complete the missing scheduling information in some architectures

In these architectures (riscv, avr, tricor) context switching
can occur in both up_switch_context and xx_doirq

Co-authored-by: yinshengkai <yinshengkai@xiaomi.com>
Signed-off-by: guoshengyuan1 <guoshengyuan1@xiaomi.com>
2025-09-25 16:40:23 +08:00
guoshengyuan1
fc15b8da8a arch: unify the scheduling information of task_exit
Replace all nxsched_suspend/resume_*** with nxsched_switch_context

Delete nxsched_resume_scheduler in up_exit and call it uniformly in task_exit

Co-authored-by: yinshengkai <yinshengkai@xiaomi.com>
Signed-off-by: guoshengyuan1 <guoshengyuan1@xiaomi.com>
2025-09-25 16:40:23 +08:00