Commit graph

59718 commits

Author SHA1 Message Date
Alin Jerpelea
54b5a8f2c3 LICENSE: update NuttX-PublicDomain SPDX identifier
According to the feedback from SPDX community we should use
LicenseRef-NuttX-PublicDomain because NuttX-PublicDomain
is not a valid SPDX id, so it will fail tests for SPDX spec compliance.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2025-12-26 19:45:34 +08:00
guohao15
cac1be9e74 tmpfs:fix memoryleak of tmpfs_opendir
fix the memory leak in tmpfs_opendir

Signed-off-by: guohao15 <guohao15@xiaomi.com>
2025-12-23 09:25:35 -03:00
Alin Jerpelea
fcee238c86 Documentation: add NuttX-12.12.0 release notes
Add release notes for 12.12.0 release

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2025-12-23 19:32:55 +08:00
Michal Lenc
30300491bc drivers/lcd/st7789.c: fix byte order in st7789_fill for 3 wires
The bytes of color should be sent in an opposite order in st7789_fill
function if the driver operates in 3 wire mode.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2025-12-23 10:49:37 +08:00
zhanghongyu
fdedb5bccd icmp/icmpv6: fix the level parameter type
use a more standard definition

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2025-12-23 10:31:02 +08:00
zhanghongyu
e0d3af4b41 icmp/icmp6: fix errno forgot to add a negative sign
otherwise, errors cannot be returned correctly

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2025-12-23 10:31:02 +08:00
zhanghongyu
82f4b2cbad select: fix too small timeout will be counted as 0
avoiding timeouts less than 1ms may lead to busyloop

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2025-12-23 10:30:53 +08:00
zhanghongyu
4d1b54a1b9 net/netdev/netdev_register.c: skip mld_devinit if Nic can not support mld
avoid unnecessary operations

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2025-12-23 10:30:47 +08:00
raiden00pl
f4b4068027 drivers/can/can.c: fix broken O_NONBLOCK
O_NONBLOCK open mode was broken since
https://github.com/apache/nuttx/pull/17360

MIN() comapres signed value (int) with unsigned value (size_t) which causes
an unexpected return value when ret is negative

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-12-23 10:30:37 +08:00
Alan Carvalho de Assis
82b8becc35 drivers/lpwan: Fix Kconfig SX1276 and SX1262 position
When user was selecting SX1276 the configuration options to this
device was appear below SX1262.

Signed-off-by: Alan C. Assis <acassis@gmail.com>
2025-12-23 10:30:19 +08:00
Petro Karashchenko
e7e40e8249 cxx/cstddef: expose 'max_align_t'
expose 'max_align_t'

Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2025-12-23 10:30:05 +08:00
Petro Karashchenko
7a9a300fa8 cxx/cmath: expose 'nextafter'
expose 'nextafter'

Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2025-12-23 10:30:05 +08:00
Petro Karashchenko
222b6390ac libs/libm: fix typo in Kconfig
fix typo in Kconfig

Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2025-12-23 10:30:05 +08:00
zhang hu
5daab8bba2 Revert: "drivers/i3c: remove extra i3c_dev_register, do_daa has created them"
This reverts commit 694750e8af.

Signed-off-by: octopushu <octopushu@163.com>
2025-12-23 10:29:48 +08:00
chenxiaoyi
2de5c0387f stdio: disable fortify of snprintf/sprintf for clang
clang does not have builtin function `__builtin_va_arg_pack`

Signed-off-by: chenxiaoyi <chenxiaoyi@xiaomi.com>
2025-12-23 10:29:41 +08:00
chenxiaoyi
201560ca1c compiler: fix fortify for clang
The clang compiler has also defined `__GNUC__`, which can't be used to
decide the compiler version.

And the version used to decide whether the builtin function
`__builtin_dynamic_object_size` exist is not correct.

Signed-off-by: chenxiaoyi <chenxiaoyi@xiaomi.com>
2025-12-23 10:29:41 +08:00
yangsong8
af0a384320 binfmt/elf: fix issue of file not closing after being opened.
When opening the file succeeds but reading the file fails in
modlib_initialize, this will result in the open file not be closed.

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2025-12-23 10:29:34 +08:00
yangsong8
a70cc1cca1 usbhost: cdcacm exit wq after copy all received data
Fix issue: When the SIM CDCACM host receives data, the second packet
data reception is incorrect.

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2025-12-23 10:29:26 +08:00
yangsong8
22caa84417 compiler: redefine float and double when disable float compiling
Redefine float and double on devices that do not support floating-point.
float  ==> int
double ==> long

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2025-12-23 10:29:20 +08:00
wangchengdong
e8ec88e2c4 sched/clock: Remove unnecessary preprocessor definition
Remove an unnecessary preprocessor definition in clock_systime_ticks.c.

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2025-12-23 10:29:13 +08:00
Junbo Zheng
6aa8e1dfe7 sched/misc: correct coredump log format
since it has been replaced with
https://github.com/apache/nuttx/blob/master/sched/misc/coredump.c#L763
and `nput` map to `off_t` https://github.com/apache/nuttx/blob/master/include/nuttx/streams.h#L98

align with other prints, reference:
- https://github.com/apache/nuttx/blob/master/drivers/misc/rwbuffer.c#L1121
- https://github.com/apache/nuttx/blob/master/fs/mmap/fs_rammap.c#L84
- https://github.com/apache/nuttx/blob/master/libs/libc/elf/elf_read.c#L85

Signed-off-by: Junbo Zheng <zhengjunbo1@xiaomi.com>
2025-12-23 10:28:34 +08:00
Michal Lenc
1e1185c63e libs/libc/obstack/lib_obstack_free.c: fix object check within chunk
The original condition incorrectly used &h->chunk instead of
h->chunk in the calculation whether the object is in the chunk. This
could lead to the wrong behavior as the first branch gave incorrect
result and thus sometimes the entire obstack was freed even though
object was not NULL.

The commit also simplifies the logic, we can use pointer arithmetic
here and just do h->chunk + 1 as it gives the same result as
(FAR char *)h->chunk + sizeof(struct _obstack_chunk). This saves
unnecessary cast and sizeof.

The second branch should be less than or equal, not just less than.
This ensures the object is correctly located in the chunk even after
previous obstack_finish was called.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
Co-authored-by: Karel Kočí <kkoci@elektroline.cz>
2025-12-23 10:28:25 +08:00
dongjiuzhu1
73232509e8 poll: fix covertify issue about out-of-bound access fds
when i is zero and file_get is failed, num is -1,
it's uint32_max for nfds.
so remove num and simplify code logic.

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2025-12-23 10:28:17 +08:00
dongjiuzhu1
68a4632f5d drivers/battery: fix race condition in event handling
Move mutex lock before checking flist to prevent race condition where
events could be lost when occurring simultaneously with service opening.

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2025-12-23 10:28:08 +08:00
guohao15
7713e88871 bugfix:the inode may have been removed by other core in SMP
The inode may has been unlinked from the tree in other core, but it is not yet freed.

Signed-off-by: guohao15 <guohao15@xiaomi.com>
2025-12-23 10:27:55 +08:00
ouyangxiangzhen
0abe07f3b0 timers/oneshot: Fix converted tv_nsec > NSEC_PER_SEC.
In rare case, the round-nearest behavior in the clkcnt_best_multshift
may result in converted tv_nsec > NSEC_PER_SEC. This commit fixed the
issue.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2025-12-23 10:27:47 +08:00
zhangshuai39
a3c914c50d net/socket: Check on the end of the NIC name when binding device
When using usrsock to pass the network interface name, omitting "\0" will cause the host to parse extra characters. therefore, the tail section should be inspected during device binding.

Signed-off-by: zhangshuai39 <zhangshuai39@xiaomi.com>
2025-12-23 10:27:37 +08:00
yezhonghui
2a57c4818c sim/spi: delete invaild cs change with ioctl transfer
delete invaild cs

Signed-off-by: yezhonghui <yezhonghui@xiaomi.com>
2025-12-23 10:27:30 +08:00
yezhonghui
821299d853 driver/bmi160: bmi160 support exchange mode rw
sim-spi support exchange mode

Signed-off-by: yezhonghui <yezhonghui@xiaomi.com>
2025-12-23 10:27:30 +08:00
yezhonghui
3062dad02f sim/spi: ioctl stytemcall use host_uninterruptible
syscall use macro host_uninterruptible

Signed-off-by: yezhonghui <yezhonghui@xiaomi.com>
2025-12-23 10:27:30 +08:00
rongyichang
3fbe0a16c7 drivers/virtio: Fix DRIVERS_VIRTIO_INPUT configuration dependencies
Changed the DRIVERS_VIRTIO_INPUT dependencies from 'depends on' to 'select'
for INPUT_TOUCHSCREEN, INPUT_KEYBOARD, and INPUT_MOUSE options. This ensures
that when DRIVERS_VIRTIO_INPUT is enabled, all required input subsystems are
automatically selected, fixing the issue where mouse device nodes were not
being created properly.

Signed-off-by: rongyichang <rongyichang@xiaomi.com>
2025-12-23 10:27:24 +08:00
anjiahao
894cf5dc4a libc/libelf:fix bug for libelf_symname
readlen maybe not equal CONFIG_LIBELF_BUFFERINCR

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2025-12-23 10:27:15 +08:00
anjiahao
7017893684 procfs/heapcheck:fix bug,aviod '\n' to 0
The lines will end with \n to prevent atoi('\n') from always being 0. It is recommended to check the first byte directly.

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2025-12-23 10:26:36 +08:00
anjiahao
f8bc513207 rtc_time:set zero rtc_time struct
timegm set struct tm, not set nsec, so rtc_time->nsec will be a random
value, so set it zero.

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2025-12-23 10:26:29 +08:00
anjiahao
b2c1a4e162 mqueue:fix msgq memleak
if first call unlink after call nxmq_file_close
cause i_crefs not 0 will leak msqg, inode will
free in unlink, but forget free msgq

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2025-12-23 10:26:20 +08:00
anjiahao
f614e0c931 sched: assert if call timedwait from interrupt
Nuttx does not allow calling interfaces like TIME_WAIT in interrupts, so we need to directly assert.

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2025-12-23 10:26:12 +08:00
anjiahao
78ebf9b055 mempool:fix bug, Misjudged the condition of interrupt memory release
We don't need to subtract the block size; we only need to determine if it's within the interrupt memory range.

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2025-12-23 10:26:05 +08:00
guohao15
4cf07dd756 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-23 10:24:56 +08:00
raiden00pl
48f5b8f697 boards/nucleo-g431rb/qenco: reduce FLASH
disable ostest from qenco configuration to reduce FLASH.

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-12-23 10:24:50 +08:00
wangzhi16
678f69b32a Revert "sched/group: move task group into task_tcb_s to improve performance"
This reverts commit 29e50ffa73.

reason:
Placing the main thread and the gourd in the same memory block, and allocating and freeing memory simultaneously, presents the following two problems:

When the main thread creates a child thread and performs a detach operation, there is a possibility that the main thread may have exited, but the main thread's TCB (Transaction Control Block) may not have been released.

This could potentially cause the main thread's TCB to be double-freed. The core contradiction in this problem lies in binding the main thread's TCB (Trust Container Registry) and the group together. When releasing the main thread's TCB, an additional check is needed to ensure the main thread was the last to leave the group. If this check and the free operation are atomically guaranteed, the logic is sound, and double freeing won't occur. However, this atomicity cannot be completely guaranteed. If other free operations cause a block, problems still arise.

Signed-off-by: wangzhi16 <wangzhi16@xiaomi.com>
2025-12-23 10:24:42 +08:00
raiden00pl
b05b5eb9d1 include/nuttx/atomic.h: fix C++ definition conflicts
when C++ lib has an atomic implementation, we shouldn't include NuttX defined macros to avoid conflicts

Fix errors like:

build/include/libcxx/__atomic/atomic.h:445:1: error: expected identifier before numeric constant
  445 | atomic_fetch_add(volatile atomic<_Tp>* __o, typename atomic<_Tp>::difference_type __op) _NOEXCEPT
      | ^~~~~~~~~~~~~~~~

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-12-23 10:24:23 +08:00
raiden00pl
fa2d9e555a boards/leds: remove dependency on leds example for some boards
Userled register path shouldn't depend on LED example.
This dependency is broken, kernel code should not depend on apps code.

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-12-23 10:24:00 +08:00
guohao15
4782ee9394 bugfix/fs:write Bad buf addr should return EINVAL
return EINVAL if iov_base == NULL

Signed-off-by: guohao15 <guohao15@xiaomi.com>
2025-12-22 17:37:21 -05:00
raiden00pl
50a7d82d44 boards/nucleo-c0xxx: fix leds handling
Fix LED handling for nucleo-c092rc and nucleo-c071rb.
These boards have two LEDs but one is activated with HIGH the other is activated
with LOW.

Also fix userled registration.

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-12-22 13:14:30 -03:00
simbit18
7c6cb4ffe1 arch/arm: Aligned Cmake with Make
- use chip specific vectors to allow smpcall update regs apache#14363

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-12-22 16:21:31 +01:00
Mathias Duckeck
4a032cb608 arch/arm/samv7: allow all values for count in read
The parameter count of read had to be a multiple of 4, otherwise the
result was truncated. Now all values are possible.

Signed-off-by: Mathias Duckeck <mathias.duckeck@avat.de>
2025-12-22 21:27:54 +08:00
simbit18
930898f4ea workflows/build.yml: fix fatal: write error: No space left on device
Fixed error verified in this PR https://github.com/apache/nuttx/pull/17423

added to the workflow:

- Show Disk Space

- Free Disk Space (Ubuntu)
  Only Android runtime removed

- Post-build Disk Space

We can now monitor disk space.

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-12-22 21:27:50 +08:00
zhanghongyu
51c88a1318 drivers/usbdev/cdcecm.c: fix cdcecm netdev can not enter running state
When the setinterface interface is called, it indicates that the underlying
USB link has been successfully established. At this point, the status of the
network card needs to be updated to RUNNING by calling the netdev_carrier_on
interface. It is similar to the logic after a Wi-Fi network card is
connected to a hotspot. Otherwise, an incorrect network card status may
cause packets to fail to be successfully sent.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2025-12-22 21:27:40 +08:00
simbit18
4539a7b294 boards/risc-v/esp32c3: Corrected the names of #include guards
Corrected the names of #include guards

boards:

- esp32c3-devkit

- esp32c3-legacy

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-12-22 21:19:29 +08:00
anjiahao
fce6e9de5e x86_64:fix syscall type mismatch
/home/ajh/work/vela_system/nuttx/include/arch/syscall.h:181: Error: operand type mismatch for `movq'

`rax`: Used in 64-bit mode, suitable for storing 64 bits of data.

`eax`: In 64-bit mode, typically used for operating on 32-bit data. When writing to `eax`, the high 32 bits of `rax` are automatically cleared to zero.

`nbr` is an unsigned int, is 32-bit.

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2025-12-22 21:09:10 +08:00