Commit Graph

930 Commits

Author SHA1 Message Date
buxiasen 9c8050e068 sched/wdog&wqueue&timer: add bmp support
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2026-04-21 01:31:58 +08:00
guanyi3 2ce99fbbb8 sched/timer: use delayfree instead of mm_free
when timer_free call mm_free(), it may crash because sem_wait in idleloop.

Signed-off-by: guanyi3 <guanyi3@xiaomi.com>
2026-04-21 01:29:09 +08:00
jiangtao16 8e595a5326 sched/timer: Fix MISRA Rule 11.6
Fix MISRA Rule 11.6 timer_t was void * can't convert to arithmetic type.
Signed-off-by: jiangtao16 <jiangtao16@xiaomi.com>
2026-04-21 01:29:09 +08:00
jiangtao16 9474c9dfc6 sched/timer: Fix for MISRA C-2012 Rule 8.9.
Fix for MISRA C-2012 Rule 8.9 by moving define into fuction.
Signed-off-by: jiangtao16 <jiangtao16@xiaomi.com>
2026-04-21 01:27:58 +08:00
hujun5 f951086350 sched/timer: remove critical section in setitimer
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2026-04-21 01:19:38 +08:00
hujun5 9db3afa3da sched: remove all spin_lock_irqsave(NULL)
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2026-04-21 01:19:15 +08:00
Alin Jerpelea 7c11fb97e1 sched: migrate to SPDX identifier
Most tools used for compliance and SBOM generation use SPDX identifiers
This change brings us a step closer to an easy SBOM generation.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
Signed-off-by: ligd <liguiding1@xiaomi.com>
2026-04-21 00:59:40 +08:00
openvela-robot b566da436e sim:support sim elf and dynamic libs package in post build
use the dynamic library .so of the binding compilation environment,
and then modify the dynamic loader of elf at runtime to run sim elf across system versions

1.add post-build for sim build
2.collect dynamic .so and dynamic interpreter
3.add execution script for the entire package sim elf

change text-segment to 0x50000000
because patchelf will modify the .dynamic section in elf,
the upward alignment of elf will be less than 0x3fffffff,
which will cause asan shadow memory overlap error

Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2026-04-21 00:59:38 +08:00
openvela-robot 57e00d628f arch/arm64/src/imx9/imx9_usbdev.c: Clean up cache operations, add DEBUGASSERTS
Correct some of the cache operations:

- EP0 request length was handled incorrectly
- Received data cache invalidate was exceeding the received buffer
- writedtd is also called with no data (EP0 ACK/NACK). Don't touch cache in that case.

Fix trip wire handling to conform with the IMX93 reference manual

Also add DEBUGASSERTS for future to check the validity of pointers and sizes

Co-authored-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2026-04-21 00:59:15 +08:00
openvela-robot 2f6c45cb01 arch/intel64: optimise context switch
We save interrupted TCB state on tcb->xcp.regs not interrupt stack now
which allows us to remove x86_64_savestate() from up_switch_context()
and other places.

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2026-04-21 00:59:09 +08:00
openvela-robot 3d928157d7 build.yml: Undo debug print
Undo the unintended changes for debug printing. I edited the wrong repo, I am deeply sorry about this.
2026-04-21 00:59:01 +08:00
openvela-robot f2d0966e9b arch/intel64/intel64_head.S: align XCP region
align XCP region to match regs allocation in up_initial_state()

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2026-04-21 00:58:55 +08:00
openvela-robot bcd70711f4 pm: pm_idle add support for SMP
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2026-04-21 00:58:46 +08:00
openvela-robot 3c370f84e4 xtensa/Kconfig: Fix dependency for backtrace dump on Xtensas
`CONFIG_XTENSA_INTBACKTRACE` is necessary to enable backtrace dump
for the tasks because exceptions are treated like interrupts (even
when an exception occurs during a normal task execution). It's now
automatically selected when `CONFIG_SCHED_BACKTRACE` is enabled.
This commit also removes outdated Kconfig options.

Signed-off-by: chenxiaoyi <chenxiaoyi@xiaomi.com>
2026-04-21 00:58:41 +08:00
openvela-robot b8d0af587f pci ep support msi/msi-x test
Signed-off-by: yezhonghui <yezhonghui@xiaomi.com>
2026-04-21 00:58:28 +08:00
openvela-robot e32220e3b2 tools/gdb: add utils.get_tid(tcb)
Signed-off-by: huangyin5 <huangyin5@xiaomi.com>
2026-04-21 00:58:22 +08:00
openvela-robot b56c30d859 clock: correct compile failed
LD: nuttx.elf
ld: /home/ligd/platform/mainline/nuttx/staging/libsched.a(mq_sndinternal.o): in function `wd_start_realtime':
/home/ligd/platform/mainline/nuttx/include/nuttx/wdog.h:274: undefined reference to `clock_realtime2absticks'
/home/ligd/platform/mainline/nuttx/include/nuttx/wdog.h:274:(.text+0xad): relocation truncated to fit: R_X86_64_PLT32 against undefined symbol `clock_realtime2absticks'
ld: /home/ligd/platform/mainline/nuttx/staging/libsched.a(mq_rcvinternal.o): in function `wd_start_realtime':
/home/ligd/platform/mainline/nuttx/include/nuttx/wdog.h:274: undefined reference to `clock_realtime2absticks'
/home/ligd/platform/mainline/nuttx/include/nuttx/wdog.h:274:(.text+0xad): relocation truncated to fit: R_X86_64_PLT32 against undefined symbol `clock_realtime2absticks'
make[1]: *** [Makefile:128: nuttx.elf] Error 1
make: *** [tools/Unix.mk:551: nuttx.elf] Error 2

Signed-off-by: ligd <liguiding1@xiaomi.com>
2026-04-21 00:58:16 +08:00
openvela-robot 6710e90b11 misc/rpmsgdev: The private data should be freed only when endpoint is released
A use-after-free problem occurs when there are multiple remotes in the list `g_rpmsg` and the matching remote is not the last item in the list.

Log
  # Export the device "/dev/LOCAL_DEV" to remote "REMOTE_CPU"
  ap> testdev -d 2 -c "REMOTE_CPU" -l "/dev/LOCAL_DEV"
  [ap] kasan_report: kasan detected a read access error, address at 0x3c3d4740,size is 4, return address: 0x2c33620f
  [ap] kasan_show_memory: Shadow bytes around the buggy address:
  [ap] kasan_show_memory:   0x3c3d46f0: cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc
  [ap] kasan_show_memory:   0x3c3d4700: aa aa aa aa cc cc cc cc cc cc cc cc cc cc cc cc
  [ap] kasan_show_memory:   0x3c3d4710: 40 47 3d 3c ed 61 33 2c 00 00 00 00 00 00 00 00
  [ap] kasan_show_memory:   0x3c3d4720: 00 00 00 00 00 00 00 00 00 00 00 00 cc cc cc cc
  [ap] kasan_show_memory:   0x3c3d4730: 55 55 55 55 38 00 00 00 02 2c 00 00 cc cc cc cc
  [ap] kasan_show_memory:   0x3c3d4740:[00 00 00 00]66 e0 42 3c cc cc cc cc cc cc cc cc
  [ap] kasan_show_memory:   0x3c3d4750: cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc
  [ap] kasan_show_memory:   0x3c3d4760: aa aa aa aa 38 00 00 00 01 2c 00 00 cc cc cc cc
  [ap] kasan_show_memory:   0x3c3d4770: 50 57 44 3d 2f 00 cc cc cc cc cc cc cc cc cc cc
  [ap] kasan_show_memory:   0x3c3d4780: cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc
  [ap] dump_assert_info: Current Version: NuttX ****** ***** *** 12.3.0 **********-***** *** ** 2024 **:**:** arm
  [ap] dump_assert_info: Assertion failed panic: at file: kasan/hook.c:187 task: testdev process: testdev 0x2ca20495

  $ addr2line -fe nuttx/nuttx 0x2c33620f
  rpmsgdev_server_created
  /workspace/nuttx/drivers/misc/rpmsgdev_server.c:529
  # Line 529 => strcmp()

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2026-04-21 00:58:11 +08:00
openvela-robot 7d0ed7199c binfmt/modlib: support loading each sections to different memory for Relocate object
The feature depends on ARCH_USE_SEPARATED_SECTION
the different memory area has different access speed and cache
capability, so the arch can custom allocate them based on
section names to achieve performance optimization

test:
sim:elf
sim:sotest

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2026-04-21 00:58:06 +08:00
openvela-robot 1c3ffd2fb6 arm64:svc call use task stack
kernel build if svc call use irq stack the irq maybe touch
svc stack, svc call use task stack can avoid this case

Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2026-04-21 00:58:00 +08:00
openvela-robot e076a236fe arm64 fork: FORK_REG_LR,FORK_REG_SP should save the func local stack
not the last func stack

Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2026-04-21 00:57:55 +08:00
openvela-robot f138669485 Revert "irq: add [enter|leave]_critical_section_nonirq"
This reverts commit 62d3fe9fccc8d5b056f5bc0c7fd715beddfed405.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2026-04-21 00:57:50 +08:00
openvela-robot 70ad088045 lib_fdopendir.c:Fix crash in fdopendir caused by fdsan
Summary:
  Add fdsan check in fdopendir, fdsan can work normally when using fdopendir

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2026-04-21 00:57:44 +08:00
openvela-robot fbd0b2baf6 nuttx/libcxx: Fix clang compilation cannot recognize compilation options error.
Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2026-04-21 00:57:39 +08:00
openvela-robot 490ccb9dd1 arm64/smp: changing the startup of arm64 SMP from serial to parallel
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2026-04-21 00:57:34 +08:00
openvela-robot c2e7969add add dependencies for nuttx_post
nuttx_post depends systemmap and usermap(in protected build mode)

Signed-off-by: pangzhen1 <pangzhen1@xiaomi.com>
2026-04-21 00:57:28 +08:00
openvela-robot 682ac77818 regualtor:adjust the critical area protected
Signed-off-by: dulibo1 <dulibo1@xiaomi.com>
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2026-04-21 00:57:16 +08:00
openvela-robot 34d5aaa92c tools/gdb: register commands gracefully
Report any error and continue to try to register next command.

Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2026-04-21 00:57:10 +08:00
openvela-robot dca2f989f0 drivers/pci/pci.c: fix warning when CONFIG_PCI_ASSIGN_ALL_BUSES=n
pci/pci.c:415:34: warning: variable ‘res’ set but not used [-Wunused-but-set-variable]
  415 |       FAR struct pci_resource_s *res;
      |                                  ^~~
pci/pci.c: In function ‘pci_scan_bus’:
pci/pci.c:663:32: warning: unused variable ‘ctrl’ [-Wunused-variable]
  663 |   FAR struct pci_controller_s *ctrl = bus->ctrl;

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2026-04-21 00:57:03 +08:00
openvela-robot 5dae010f40 gdbstub: add RLE compression
Refer to
https://sourceware.org/gdb/current/onlinedocs/gdb.html/Overview.html

w/o compression, nxgcore command took 41seconds.
w compression, 28second.

If we enable `set trust-readonly-sections on` to read from elf whenever
possible, it furture reduces to 14.9seconds.

Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2026-04-21 00:56:57 +08:00
openvela-robot 527af374e4 add adc_fifo_size when it over 300
Signed-off-by: zhangkai25 <zhangkai25@xiaomi.com>
2026-04-21 00:56:51 +08:00
openvela-robot d65ef952b6 sched: fix hightpc calculation error in sched_profil
In profile_monitor, the scale is calculated using 65536.
There is an inconsistency between the two, which leads to hightpc calculation errors.

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2026-04-21 00:56:46 +08:00
openvela-robot 7df924b71d greenhills: fix the data type align build error
"/home/guoshichao/work_profile/vela_os/vela_car_5/nuttx/include/nuttx/crypto/blake2s.h", line 91: error #2118-D:
          this attribute reduces the alignment of the typedef, and while that
          will be respected for struct/field layout, the compiler will not
          generate code to handle misaligned accesses for objects of this type
  typedef uint32_t uint32_alias_t __attribute__((may_alias)) aligned_data(1);
                                                             ^

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2026-04-21 00:56:35 +08:00
openvela-robot aca49cb24b Revert "Revert "Add reference count configuration""
This reverts commit 7f903ba21462ec2d6aa0e998c3202f29786f9361.

Signed-off-by: zhangshoukui <zhangshoukui@xiaomi.com>
2026-04-21 00:56:29 +08:00
openvela-robot 00133c50fc ci/platforms: linux.sh ubuntu.sh switch Wget to cURL tool
Switch wget to cURL tool for:
arm_gcc_toolchain()
arm64_gcc_toolchain()
riscv_gcc_toolchain()
sparc_gcc_toolchain()
xtensa_esp32_gcc_toolchain()
xtensa_esp32s2_gcc_toolchain()
xtensa_esp32s3_gcc_toolchain()
wasi_sdk()

Used git clone --depth 1 a shallow clone with a history truncated to reduce the clone size for:
kconfig_frontends()
2026-04-21 00:56:23 +08:00
openvela-robot 4a9d48436f nuttxgdb: sq_check no normal print when sq_count
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2026-04-21 00:56:17 +08:00
openvela-robot f546cb68e4 mpfs_mpucfg.h: Add missing MPUCFG registers
Now all registers are defined
2026-04-21 00:56:11 +08:00
openvela-robot 4d38ce5552 mm/mempool: Fix mempool tag kasan error
The address needs to be reset only when comparing addition, subtraction, multiplication and division addresses. Otherwise, the original address is always returned or saved.

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2026-04-21 00:55:56 +08:00
openvela-robot 403f0c7781 drivers/mmcsd/mmcsd_sdio.c: Fix setting SDIO_WIDEBUS for SD cards
This corrects the setting widebus for SD cards, which was recently broken in 4f7f751d2adaa2911d8822fbeee87662257d5a36.

The if checking the priv->caps, priv->buswidth and IS_MMC has been wrong for
some time. The proper logic is that for MMC only the priv->caps is checked.
For SD card, both priv->caps and priv->buswidth need to be checked.

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2026-04-21 00:55:46 +08:00
openvela-robot 3bd2da5e6e libc: Modify the check length
We should not check the length of both strings at the same time.

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2026-04-21 00:55:40 +08:00
openvela-robot dcfc04ee43 CMake/preprocess: fix typo PREPROCES -> PREPROCESS
correct the marco define from PREPROCES to PREPROCESS

Signed-off-by: chao an <anchao@lixiang.com>
2026-04-21 00:55:34 +08:00
openvela-robot eb13cc7681 nuttx/libxx: Simplify compilation warnings for passing CXXFLAGS.
Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2026-04-21 00:55:28 +08:00
openvela-robot c73b1fa1ee cmake/tricore/tasking: add cmake build for tasking toolchain
cmake build for tasking toolchain

Signed-off-by: chao an <anchao@lixiang.com>
2026-04-21 00:55:22 +08:00
openvela-robot 26c3bf17e3 coredump: fix issue that calculated dump region range is
smaller than it should be.

0x21000000    0x210105e8    0x210105f8      0x21044000
  |----------------|-------------|--------------|

If there is already a range of 0x210105e8 - 0x210105f8, adding another
range of 0x21000000 - 0x21044000 would result in an incorrect range of
0x210105e8 - 0x21044000.

Signed-off-by: wanggang26 <wanggang26@xiaomi.com>
2026-04-21 00:55:17 +08:00
openvela-robot 570a68e338 drivers/rpmsg: Using safe list iterating in rpmsg_device_created()
To fix list access after delete error

Test:
  /* Export */
  rpmsgdev_export("SERVER", "/dev/DEVNAME");

  /* Register */
  rpmsgdev_register("CLIENT", "/dev/DEVNAME", "/dev/server-DEVNAME", 0);

Log:
  [ap] kasan_report: kasan detected a read access error, address at 0x40b7ae78,size is 8, return address: 0x402a3c50
  [ap] kasan_show_memory: Shadow bytes around the buggy address:
  [ap] kasan_show_memory:   0x40b7ae20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  [ap] kasan_show_memory:   0x40b7ae30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  [ap] kasan_show_memory:   0x40b7ae40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  [ap] kasan_show_memory:   0x40b7ae50: 20 af b7 40 00 00 00 00 c0 17 2a 40 00 00 00 00
  [ap] kasan_show_memory:   0x40b7ae60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  [ap] kasan_show_memory:   0x40b7ae70: 00 00 00 00 00 00 00 00[b0 f7 b3 40 00 00 00 00]
  [ap] kasan_show_memory:   0x40b7ae80: c8 48 b8 40 00 00 00 00 00 00 00 00 00 00 00 00
  [ap] kasan_show_memory:   0x40b7ae90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  [ap] kasan_show_memory:   0x40b7aea0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  [ap] kasan_show_memory:   0x40b7aeb0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

  $ addr2line -fe nuttx/nuttx 0x402a3c50
  rpmsg_device_created
  /workspace/nuttx/drivers/rpmsg/rpmsg.c:395 (discriminator 2)

Reported by rongyichang@xiaomi.com

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2026-04-21 00:55:11 +08:00
openvela-robot 2e6a4688c6 risc-v: Add a new option to control exception reason
The number of exception for risc-v is 16 (0 ~ 15)
for the machine ISA version 1.12 or earlier, the number of exception is 20
(0 ~ 19) from the ISA version 1.13. And maybe changed in the future.

Using a dedicated option to control the exception number to allow the earlier
version chip with customized exception number (e.g. 16 ~ 19 used) to define
the exception reason string correctly.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2026-04-21 00:55:06 +08:00
openvela-robot 902963a8ed cmake(bugfix):make sure the extra lib only added once
avoid duplicate definitions of target when
`nuttx_add_extra_library` is called between different models at the same time

Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2026-04-21 00:54:59 +08:00
openvela-robot bfaa4e3158 tools/gcov: ignore lcov error
When some coverage files cannot be parsed correctly,
skip the current error file and continue to generate coverage report

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2026-04-21 00:54:46 +08:00
openvela-robot dce3033a66 arch/x86_64:Add FP backtrace function
Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>
2026-04-21 00:54:40 +08:00
openvela-robot 3a85c0ec7a fix build error when CONFIG_PTHREAD_ATFORK=y
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2026-04-21 00:54:35 +08:00