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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
/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>