Commit graph

60278 commits

Author SHA1 Message Date
guoshichao
cd6a978ba9 arm64_head.S: fix the asm code build error
Add __ASSEMBLY__ protection in stddef.h and stdint.h to prevent assembly
files from attempting to parse C typedef statements, which causes
"unknown mnemonic" errors when assembly source includes these headers.

the following are the detailed build error:
/home/guoshichao/work_profile/vela_os/vela_open_source_trunk4/nuttx/include/stdint.h:167: Error: unknown mnemonic `typedef' -- `typedef _int8_t int8_t'
/home/guoshichao/work_profile/vela_os/vela_open_source_trunk4/nuttx/include/stdint.h:168: Error: unknown mnemonic `typedef' -- `typedef _uint8_t uint8_t'
/home/guoshichao/work_profile/vela_os/vela_open_source_trunk4/nuttx/include/stdint.h:170: Error: unknown mnemonic `typedef' -- `typedef _int16_t int16_t'
/home/guoshichao/work_profile/vela_os/vela_open_source_trunk4/nuttx/include/stdint.h:171: Error: unknown mnemonic `typedef' -- `typedef _uint16_t uint16_t'
/home/guoshichao/work_profile/vela_os/vela_open_source_trunk4/nuttx/include/stdint.h:178: Error: unknown mnemonic `typedef' -- `typedef _int32_t int32_t'
/home/guoshichao/work_profile/vela_os/vela_open_source_trunk4/nuttx/include/stdint.h:179: Error: unknown mnemonic `typedef' -- `typedef _uint32_t uint32_t'
/home/guoshichao/work_profile/vela_os/vela_open_source_trunk4/nuttx/include/stdint.h:193: Error: unknown mnemonic `typedef' -- `typedef _int8_t int_least8_t'
/home/guoshichao/work_profile/vela_os/vela_open_source_trunk4/nuttx/include/stdint.h:194: Error: unknown mnemonic `typedef' -- `typedef _uint8_t uint_least8_t'
/home/guoshichao/work_profile/vela_os/vela_open_source_trunk4/nuttx/include/stdint.h:196: Error: unknown mnemonic `typedef' -- `typedef _int16_t int_least16_t'
/home/guoshichao/work_profile/vela_os/vela_open_source_trunk4/nuttx/include/stdint.h:197: Error: unknown mnemonic `typedef' -- `typedef _uint16_t uint_least16_t'
/home/guoshichao/work_profile/vela_os/vela_open_source_trunk4/nuttx/include/stdint.h:203: Error: unknown mnemonic `typedef' -- `typedef _int32_t int_least24_t'

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2026-01-13 21:20:52 +08:00
guoshichao
38e5cbead0 ghs: move the -fmacro-prefix-map compile option to compiler specific
the -fmacro-prefix-map compile option is gcc/clang/armclang specific
compile option, and greenhills do not recognize this compile option, if
we add this option is CMakeLists.txt, the following warning will be
reported when each file is being compiled:

ccarm: Warning: Unknown option "-fmacro-prefix-map=/home/guoshichao/work_profile/vela_os/vela_car_5/nuttx=" passed to linker
ccarm: Warning: Unknown option "-fmacro-prefix-map=/home/guoshichao/work_profile/vela_os/vela_car_5/apps=" passed to linker
ccarm: Warning: Unknown option "-fmacro-prefix-map=/home/guoshichao/work_profile/vela_os/vela_car_5/vendor/flagchip/boards/mann/dcu/fc4150f1m-labm_a1=" passed to linker
ccarm: Warning: Unknown option "-fmacro-prefix-map=/home/guoshichao/work_profile/vela_os/vela_car_5/vendor/flagchip/chips/fc4150=" passed to linker
ccarm: Warning: Unknown option "-fmacro-prefix-map=/home/guoshichao/work_profile/vela_os/vela_car_5/nuttx=" passed to linker
ccarm: Warning: Unknown option "-fmacro-prefix-map=/home/guoshichao/work_profile/vela_os/vela_car_5/apps=" passed to linker
ccarm: Warning: Unknown option "-fmacro-prefix-map=/home/guoshichao/work_profile/vela_os/vela_car_5/vendor/flagchip/boards/mann/dcu/fc4150f1m-labm_a1=" passed to linker
ccarm: Warning: Unknown option "-fmacro-prefix-map=/home/guoshichao/work_profile/vela_os/vela_car_5/vendor/flagchip/chips/fc4150=" passed to linker

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2026-01-13 21:20:21 +08:00
chenzihan1
513673c11a drivers/ioexpander: add enable & disable macro for gpio SETDEBOUNCE and SETMASK
IOEXPANDER_DEBOUNCE_DISABLE (0): Disable debounce filtering
IOEXPANDER_DEBOUNCE_ENABLE (1): Enable debounce filtering
IOEXPANDER_MASK_DISABLE (0): Unmask the interrupter
IOEXPANDER_MASK_ENABLE (1): Mask the interrupter

Signed-off-by: chenzihan1 <chenzihan1@xiaomi.com>
2026-01-13 09:27:52 -03: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
raiden00pl
88c048b48b .github/build.yml: fix python venv installation
install venv package in one command to avoid issues with ubuntu mirrors

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-01-13 03:10:37 +08:00
zhanghongyu
3bb8749672 drivers/net/igc.c: fix build error
otherwise, enable CONFIG_NETDEV_STATISTICS will result in a compile error

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2026-01-13 02:17:15 +08:00
zhanghongyu
cbc13cc8aa if_ether.h: add the definition of ETH_P_TSN
add macro definitions used by third-party libraries to resolve
compilation errors.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2026-01-13 02:17:06 +08:00
buxiasen
38378149ed libs/libc/ftok: fix sizeof(char *), after tempbuffer
Catched by coverity, we change full path from stack variable to ptr.

Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2026-01-13 01:59:58 +08:00
wangchengdong
51bcec53c4 nuttx/sched: rename nxsched_timer_expiration
rename nxsched_timer_expiration to nxsched_tick_expiration
    to align with nxsched_process_tick()

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2026-01-12 16:20:42 +08:00
wangchengdong
813ab962f5 nuttx/drivers: merge tickless and tick process
merge nxsched_timer_expiration() into nxsched_process_timer()
    to improve code efficient

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2026-01-12 16:20:42 +08:00
wangchengdong
15f6e399b8 nuttx/arch: merge tickless and tick process
merge nxsched_timer_expiration() into nxsched_process_timer()
    to improve code efficient

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2026-01-12 16:20:42 +08:00
wangchengdong
9f44bff3cc sched/sched:merge tickless and tick process together
Merge tickless and tick process into  nxsched_process_timer
    to improve code level efficient

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2026-01-12 16:20:42 +08:00
Matteo Golin
a22e26924d cmocka/defconfig: Update defconfigs to include cmocka application
The cmocka test framework is compiled as a library by default in
(apache/nuttx-apps#3270), and does not include the cmocka application
binary unless CONFIG_TESTING_CMOCKA_PROG=y. This commit updates the
defconfigs which include cmocka to also compile the cmocka binary, which
is the behaviour they were created with.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2026-01-12 10:15:00 +08:00
shichunma
52e67d167a net/route: need clear old cached route info when do reset cache
When do net_flushcache_ip4/6, it may have old info at that time.

Signed-off-by: Jerry Ma <masc2008@gmail.com>
2026-01-11 23:23:34 +08:00
hujun5
46ec836e56 sched: binfmt remove csection
use small lock to replace big lock

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2026-01-11 20:44:35 +08:00
liamHowatt
081c2337b7 fs/userfs: keep lock while reading iobuffer
Fix a race on userfs_state_s iobuffer.

1. Task 1 takes the mutex and does a userfs operation.
2. A higher priority task 2 blocks on the mutex.
3. Task 1 releases the mutex when finished. The iobuffer response has not
   been processed by task 1 yet, but task 2 is higher priority
   and control switches to it.
4. Task 2 does a userfs operation and releases the mutex.
   The iobuffer now contains task 2's response.
5. Control returns to task 1 for it to check the iobuffer
   response. It contains task 2's response, not its own.

Fix it by releasing the mutex only after the exclusive iobuffer
usage lifecycle is complete.

Signed-off-by: liamHowatt <liamjmh0@gmail.com>
2026-01-11 09:01:45 -03:00
Huang Qi
8b3862d19b style: Fix case statement formatting in power management callbacks.
Remove unnecessary parentheses around case labels in switch statements
for power management callback functions. This fixes checkpatch style
violations for case statement formatting.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2026-01-10 12:59:14 -03:00
chenzihan1
664d2d7213 drivers/sensors: add get_info interface for gnss_uorb
Implement gnss_get_info callback function to support device information query for GNSS sensor devices through the sensor framework.

Signed-off-by: chenzihan1 <chenzihan1@xiaomi.com>
2026-01-10 17:30:33 +08:00
ouyangxiangzhen
4c1228059f sched/sched: Fix comments in sched_timerexpiration.
This commit fixed comments in sched_timerexpiration.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2026-01-10 17:30:25 +08:00
ouyangxiangzhen
c69cf36b7c sched/wdog: Simplify the wdog expiration handling.
This commit simplified the wdog expiration handling by introducing the
`g_sched_event` timer.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2026-01-10 17:30:25 +08:00
ouyangxiangzhen
7b47b9de17 sched/wdog: Simplify the wd_gettime.
This commit simplified the wd_gettime.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2026-01-10 17:30:25 +08:00
ouyangxiangzhen
df74d0c5b2 sched/wdog: Remove wd_restart API.
According to the test results, the restart interface offers no
performance improvement and requires additional state to encode the
non-pending state. This commit removed the wd_restart API to simplify
the wdog module.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2026-01-10 17:30:25 +08:00
guoshengyuan1
fac76746ea arch/arm: Fix TLS initialization to account for padding between sections
The TLS initialization logic needs to be updated to match the modified
linker script section definitions. The previous implementation assumed
that _END_TDATA and _START_TBSS were contiguous, but there may be
padding between these sections for alignment purposes.

This commit updates up_tls_initialize() to explicitly account for the
padding gap between _END_TDATA and _START_TBSS when zeroing the .tbss
section. The size calculation in up_tls_size() is also updated to use
_END_TBSS instead of the previous _END_TXXX definition to match the
current linker script layout.

Changes:
- Calculate padding gap: (_START_TBSS - _END_TDATA)
- Zero .tbss at correct offset accounting for padding
- Update size calculation to use proper section boundaries

Signed-off-by: guoshengyuan1 <guoshengyuan1@xiaomi.com>
2026-01-09 21:48:28 +08:00
guoshengyuan1
dd9f666ad2 arch/arm: Refactor __aeabi_read_tp to ensure EABI compliance
Reimplement __aeabi_read_tp using naked function with inline assembly
to strictly follow ARM EABI TLS helper specification.

The ARM EABI specifies that __aeabi_read_tp may only modify r0, and
compilers rely on this guarantee by NOT saving r1-r3 registers when
calling this function. The previous simple C implementation could
potentially clobber these registers through compiler optimizations,
violating the ABI contract and causing subtle bugs.

Changes:
- Add __aeabi_read_tp_core() helper to allow tls_get_info() macro
  expansion in C context
- Explicitly preserve r1-r3 registers per EABI requirement

This ensures proper register usage compliance for all calling contexts
while maintaining the ability to use tls_get_info() macro correctly.

Reference: ARM EABI TLS Helper Specification
https://github.com/ARM-software/abi-aa/blob/main/rtabi32/rtabi32.rst#thread-local-storage-new-in-v2-01

Signed-off-by: guoshengyuan1 <guoshengyuan1@xiaomi.com>
2026-01-09 21:48:28 +08:00
wangchen
96fcc8bb1d net:modify check condition from IFF_UP to IFF_RUNNING in the sending process
Modify check condition from IFF_UP  to IFF_RUNNING in the sending process

Signed-off-by: wangchen <wangchen41@xiaomi.com>
2026-01-09 21:48:18 +08:00
dongjiuzhu1
148f0ce7dd fs/inode: use file_allocate,file_dup to avoid racecondition to allocate fd
issue description:
task A:                                            NSH:
1.open->                                           reboot->sync->task_fsfsync
2.nx_vopen->               context switch
3.fdlist_allocate:            ---->                4.fsync->file_sync->assert(inode or priv is empty)
(new fd with empty filep)
5.file_vopen:
(init empty filep)
6.return fd

Task A allocates a new fd with an empty filep in fdlist_allocate. Before
it can fully initialize the filep in file_vopen, the NSH task triggers a
file - system sync operation. The sync operation encounters the empty
filep associated with the newly allocated fd, causing the assertion to
fail and the system to crash.

To resolve this race condition, we should modify the fd allocation
process. Instead of allocating a new fd with an empty filep first and
then initializing it later, we should use the file_allocate_from_inode
function. This function allows us to initialize the file structure first
and then bind it to the new filep when allocating the fd. By doing so,
we ensure that the filep is always properly initialized before it is
used in any file - system operations, thus preventing the assertion
failure and the subsequent system crash.

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2026-01-09 17:11:25 +08:00
zhangshuai39
4b5bd23957 netlib: Supplement the netlib_check_httpconnectivity documentation
A brief introduction to the interface functions, parameters, and return values.

Signed-off-by: zhangshuai39 <zhangshuai39@xiaomi.com>
2026-01-09 17:11:04 +08:00
xucheng5
f989860c4a timer: add timer operation support
Add basic timer operations to the kernel, including registration,
start/stop, and callback handling. This provides a consistent timer
interface for use by kernel components and drivers.

Signed-off-by: zhaohaiyang1 <zhaohaiyang1@xiaomi.com>
2026-01-09 17:10:43 +08:00
Bowen Wang
2a8acac159 rpmsg/rpmsg_port_uart: drop all the packets when reconnect to peer
1. move drop packets function from port spi to port;
2. add drop packets logic when reconnect to peer;

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
Signed-off-by: liaoao <liaoao@xiaomi.com>
2026-01-09 09:48:18 +08:00
Bowen Wang
3d764939c8 rpmsg/rpmsg_port_uart: set the signals based on the suspend/reusme state
Now peer's state can be get by the rpmsg_get_signals() api

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2026-01-09 09:48:18 +08:00
Bowen Wang
b8ad562fcb rpmsg/rpmsg_port_uart: add poweroff support
Peer can send poweroff command and local will shutdown the uart
device and wait for the next connect

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2026-01-09 09:48:18 +08:00
Bowen Wang
8ba084329d rpmsg/rpmsg_port_uart: add wakeup feauture for rpmsg_port_uart
Wakeup peer when peer is in low power mode

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2026-01-09 09:48:18 +08:00
simbit18
ef1cee2f44 arch/arm/xmc4: Aligned Cmake with Make
- Add tickless support #11737

- Add XMC4 flash command sequence API #11728

- Add EtherCAT support on xmc4800-relax #11659

Signed-off-by: simbit18 <simbit18@gmail.com>
2026-01-09 07:34:53 +08:00
simbit18
3015b87e97 boards/arm/xmc4: CMake added XMC4500 Relax and XMC4700 Relax
CMake added boards:

- XMC4500 Relax

- XMC4700 Relax

Signed-off-by: simbit18 <simbit18@gmail.com>

Update CMakeLists.txt
2026-01-09 07:34:53 +08:00
wangxiaoxin
87d74d141a LIN:adjust the LIN flag
Fix incorrect and non-existent flag usage in LIN handling:

- Replace undefined CANFD_FLAGS_BITS usage with valid bit definitions.
- Reassign CAN_TCF_FLAG to an available flag bit, as it is not defined in can.h.
- Add an identifier for LIN noise error frames.

Signed-off-by: wangxiaoxin <wangxiaoxin@xiaomi.com>
2026-01-08 23:15:31 +08:00
wangchengdong
96e8fce4de [EXPERIMENTAL] sched/hrtimer: add SYSTEM_TIME64 dependency
The hrtimer infrastructure only works with 64-bit system timers.
  Add a dependency on SYSTEM_TIME64 in the hrtimer Kconfig.

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2026-01-08 22:47:16 +08:00
wangchengdong
6bffad62de [EXPERIMENTAL] sched/hrtimer: separate SMP logic from hrtimer
Separate SMP-specific logic from the hrtimer core to improve
    performance and maintainability.

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2026-01-08 22:47:16 +08:00
Jiri Vlasak
7fa4a7f3b4 net/netdev: Fix best prefix in findby
When comparing with netmask, the best prefix len is netmask.

Signed-off-by: Jiri Vlasak <jvlasak@elektroline.cz>
2026-01-08 22:45:16 +08:00
mazhuang
45f6d86f37 drivers/rpmsg: add rpmsg_test to test rpmsg hold/release rx buffer
rpmsg_test is a rpmsg api test service inside the kernel, and user
can use ioctl to start this test.

Signed-off-by: mazhuang <mazhuang@xiaomi.com>
Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
Signed-off-by: wangshaoxin <wangshaoxin@xiaomi.com>
2026-01-08 22:44:35 +08:00
Yongrong Wang
8eb4e46c8c sim rpserver/rpproxy: enable CONFIG_RPMSG_PING config
Be convenient to test the rpmsg feature

Signed-off-by: Yongrong Wang <wangyongrong@xiaomi.com>
2026-01-08 22:44:35 +08:00
ouyangxiangzhen
254df1721a sched/hrtimer: Fix functional correctness issue.
This commit added dependency on CONFIG_SYSTEM_TIME64 for the hrtimer, sin
ce the hrtimer use `clock_compare` to compare 64-bit time.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2026-01-08 22:26:11 +08:00
ouyangxiangzhen
6bd9ef6992 sched/hrtimer: Rename the callback type to hrtimer_entry_t.
This commit renamed the callback type to `hrtimer_entry_t`, aligning with
the `wdentry_t` in wdog..

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2026-01-08 22:26:11 +08:00
ouyangxiangzhen
8db732afb1 sched/hrtimer: Fix functional correctness issue.
The expired field can not be used to indicate the cancelled state. Because
the `UINT64_MAX` is valid expired time. A periodic hrtimer started with
the hrtimer_start_absolute(hrtimer, period_func, UINT64_MAX) can
not be cancelled via `hrtimer_cancel`.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2026-01-08 22:26:11 +08:00
ouyangxiangzhen
3fa62118f1 sched/hrtimer: Fix hrtimer compilation.
This commit fixed hrtimer compilation issue.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2026-01-08 22:26:11 +08:00
ouyangxiangzhen
740f518083 sched/hrtimer: Add const for hrtimer argument.
The callback function can not modify the hrtimer.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2026-01-08 22:26:11 +08:00
Zhe Weng
1d6068f6fb drivers/virtio-gpu: Use macro to indicate blocking cmd
Improving readability, because using bit without name makes people confused.

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2026-01-08 22:01:09 +08:00