Commit Graph

55540 Commits

Author SHA1 Message Date
zhengyu9 bc7114ab16 fs/vfs: result_independent_of_operands
timeout is a type of int
in MSEC2TICK, timeout may be multiplied by USEC_PER_MSEC
and the result may be out of range of int
Besides, this will induce following ERROR while running simulator:
vfs/fs_poll.c:498:38: runtime error: signed integer overflow:
19768268 * 1000 cannot be represented in type 'int'

Signed-off-by: zhengyu9 <zhengyu9@xiaomi.com>
Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-10-11 03:08:05 +08:00
Lup Yuen Lee d637d5b66d CI: Skip the CI Builds that don't match the Board Label
This PR extends the CI Build Rules to eliminate more unnecessary builds. We use the Board Label for PRs:
- Previously: "Arch: arm" will build only `arm-01` to `arm-14`
- Now: "Board: arm" will also build `arm-01` to `arm-14`
- This applies only to Simple PRs: One Arch Label + One Board Label + One Size Label, like "Arch: arm, Board: arm, Size: L"
- If Arch Label and Board Label are both present: They must be the same. Otherwise All Targets shall be built.
- Works with Arm32, Arm64, RISC-V, Simulator, x86_64 and Xtensa

The updated code is explained here: https://github.com/apache/nuttx/issues/13775
2024-10-11 03:02:01 +08:00
hujun5 0519dc0235 sched/task: There is no need to use sched_[un]lock
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-10-11 02:43:11 +08:00
hujun5 451f9372db sched/environ: There is no need to use sched_[un]lock
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-10-11 02:43:11 +08:00
yinshengkai 656baa2a12 tools/Unix.mk: allow defconfig to overwrite old config
When using include command in defconfig, it is necessary to support overwriting the configuration in other files

kconfig-conf only prints warnings, but does not return errors

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-10-11 02:40:58 +08:00
zhanghongyu e4129d7f70 net/local: fix the return address is incorrect when accept
The argument addr is a pointer to a sockaddr structure.
This structure is filled in with the address of the peer socket,
as known to the communications layer.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2024-10-11 01:31:20 +08:00
yinshengkai ec691cc5e4 tools: prasetrace.py supports parsing syslog
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-10-11 01:30:11 +08:00
yinshengkai 211a56910a syslog: support syslog redirection to sched_note
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-10-11 01:30:11 +08:00
ligd e608d5522d syslogmask: add default value Kconfig to syslogmask
Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-10-11 01:30:11 +08:00
wangmingrong1 300ce45365 libc/machine: Fix the error caused by tag kasan
Use address addition and subtraction, no longer as the return value of the address. Tags must be removed before calculation

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-10-11 01:29:56 +08:00
Xu Xingliang f68d594420 arch/arm64: rename register names to align with arm32
Signed-off-by: Xu Xingliang <xuxingliang@xiaomi.com>
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2024-10-11 01:17:24 +08:00
yinshengkai 2fe33f551c assert: change the do-while of assert to a conditional expression
According to the standard definition, assert should return a void expression
https://pubs.opengroup.org/onlinepubs/007904875/basedefs/assert.h.html

This patch involves two changes:

If you define the NDEBUG macro, assert does not use any parameters and directly returns a void expression.
assert should return a void expression and cannot use do-while statements.
If the following code , a compilation error will occur.

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-10-11 00:51:20 +08:00
wangmingrong1 ec3c27df0d makefile/clang: Compare versions for upward compatibility
Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-10-11 00:45:39 +08:00
yinshengkai ba2865f20a sched: support backtrace record
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-10-11 00:37:27 +08:00
yinshengkai 1a00ca3cd7 libc: rename lib_execinfo.c to lib_backtrace.c
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-10-11 00:37:27 +08:00
yinshengkai 02eb280302 arch/perf: modify the return value of up_perf_gettime to clock_t
When using alarm_arch implementation, 64-bit time can be returned. Using unsign long will cause precision loss.

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-10-10 23:17:14 +08:00
yinshengkai cee252174b clock/perf: add critical section protection
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-10-10 23:17:14 +08:00
Neo Xu d598da80e4 Rename group_argvstr to nxtask_argvstr
Now argument vector is stored to TLS, task_argvstr fits better.

Signed-off-by: Neo Xu <neo.xu1990@gmail.com>
2024-10-10 23:13:37 +08:00
Neo Xu c3ed24aec6 Remove check for group to retriev argv string
Now the argument vector is stored in TLS, thus no need to check if group is valid

Signed-off-by: Neo Xu <neo.xu1990@gmail.com>
2024-10-10 23:13:37 +08:00
yinshengkai c158ed2c32 mm/heap: memory alignment before executing kasan_register
The unaligned address is used in kasan_register, but the aligned address is used in kasan_unregister.
The mismatch between the addr value and mm_heapstart will result in a crash due to the inability to unregister correctly.

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-10-10 23:11:37 +08:00
p-szafonimateusz ed71aa810e arch/x86_64/intel64/intel64_irq.c: fix busy irq logic
use correct macro for cpu_set_t busy variable and remove obsolote check

also remove not needed #include <sched.h> and "Public data"

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-10-10 22:57:04 +08:00
yinshengkai fbaa7b29f4 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>
2024-10-10 22:55:46 +08:00
yinshengkai 7516da1650 tools: gcov.sh supports generating device-side code coverage
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-10-10 22:55:46 +08:00
yinshengkai 8abbd3cde5 nuttx-names.in: add feof
When running gcov in sim, nuttx feof is called and causes crash

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-10-10 22:55:04 +08:00
liwenxiang1 fee7e0ce81 arch/x86_64:Add macros related to CPUID
Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>
2024-10-10 15:07:45 +02:00
ouyangxiangzhen d0779e0eef arch/x86_64: Fix up_timer compilation error
This commit fix up_timer compilation error.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2024-10-10 15:07:22 +02:00
ouyangxiangzhen e6548ead20 arch/x86_64: Fix up_timer_start
Fix according to up_alarm_start.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2024-10-10 15:07:22 +02:00
yinshengkai b8670e905a docs: add gprof usage documentation
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>

g 请为您的变更输入提交说明。以 '#' 开始的行将被忽略,而一个空的提交
2024-10-10 18:46:51 +08:00
yinshengkai d375a09c0a libs: add gprof arm64 support
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-10-10 18:46:51 +08:00
yinshengkai 1b42a7bf84 sched: gprof SMP support
In the case of SMP, use smp_call to get other CPU data

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-10-10 18:46:51 +08:00
yinshengkai eb8449cb0c sched/gprof: add gprof support
gprof can analyze code hot spots based on scheduled sampling.
After adding the "-pg" parameter when compiling, you can view the code call graph.

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-10-10 18:46:51 +08:00
Xiang Xiao 4944bfd56c sched: Implement profil function
which is very useful for performance analysis:
https://man7.org/linux/man-pages/man3/profil.3.html

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-10-10 18:46:51 +08:00
Eren Terzioglu f774afb4d9 esp32[s3|s2]: Add temperature sensor thread support 2024-10-10 18:45:01 +08:00
Eren Terzioglu 7556614732 esp32[c3|c6|h2]: Add temperature sensor thread support 2024-10-10 18:45:01 +08:00
Eren Terzioglu 4060f6ba80 esp32[s2|s3]: Add UORB support for internal temperature sensor 2024-10-10 18:45:01 +08:00
Eren Terzioglu 929f9ccfa2 esp32[c3|c6|h2]: Add UORB support for internal temperature sensor 2024-10-10 18:45:01 +08:00
hujun5 7216d566a6 sim: only POSIX implementation (ARCH_HAVE_MULTICPU) is provided
This commit fixes the regression from https://github.com/apache/nuttx/pull/13886

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-10-10 18:38:25 +08:00
liwenxiang1 24f54ba712 arch/x86_64: cache convert all asm() to __asm__()
asm() is not supported by -std=c99, __asm__() is more portable

Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>
2024-10-10 18:36:09 +08:00
hujun5 d26c2380e4 sched: fix omitted merging the pending queue regression
This commit fixes the regression from https://github.com/apache/nuttx/pull/13995

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-10-10 17:59:35 +08:00
zhangyuan29 8acc3b4771 sched/pthread: save pid before task activate
When a high-priority pthread is created,
ptcb may be released after nxtask_activate.

Signed-off-by: zhangyuan29 <zhangyuan29@xiaomi.com>
2024-10-10 17:58:22 +08:00
andi6 2ed88f8813 x64: add acrn ioapic init support
if we two step to set interrupt trigger and disable interrupt,
acrn will inject #GP exception

Signed-off-by: andi6 <andi6@xiaomi.com>
2024-10-10 17:49:40 +08:00
anjiahao f955eda358 uart_16550:fix bug, regincr is used multiple times
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-10-10 17:49:18 +08:00
liwenxiang1 8d2fc5c9ee arch/x86_64:Add nanosecond delay interface to TSC
Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>
2024-10-10 17:13:01 +08:00
cuiziwei f86644141b x86_64:Fix ld error.
LD: nuttx.elf
ld:in function `std::__1::ios_base::imbue(std::__1::locale const&)':
nuttx/libs/libxx/libcxx/src/ios.cpp:129: undefined reference to `_Unwind_Resume'

Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2024-10-10 16:51:38 +08:00
dongjiuzhu1 ae19554c66 boards/sam3u-ek/knsh: disable pthread to reduce flash size
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-10-10 16:42:15 +08:00
dongjiuzhu1 5a29652d2a fs/inode: using read-lock to protect inode_find
inode_find don't need to modify inode tree

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-10-10 16:42:15 +08:00
dongjiuzhu1 2e3a6acaa2 sched/sem_rw: convert read-lock to write-lock when self already holds a write-lock
If the write lock is already held by oneself and sine the write
lock can be recursively held, so, this operation can be converted to a write
lock to avoid deadlock.

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-10-10 16:42:15 +08:00
wangming9 1c2856dfcb arch/arm64: Fixed up_getusrsp getting stack Pointers
Signed-off-by: wangming9 <wangming9@xiaomi.com>
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2024-10-10 15:40:03 +08:00
wangming9 b0ea6840e1 arch/arm64: Use serr to print fatal error messages.
Summary:
sinfo cannot print fatal error messages when CONFIG_DEBUG_SCHED_INFO is turned off.

Signed-off-by: wangming9 <wangming9@xiaomi.com>
2024-10-10 15:40:03 +08:00
wangming9 27d77b1aca arch/arm64: Fixed GIC3 for goldfish platform
Signed-off-by: wangming9 <wangming9@xiaomi.com>
2024-10-10 15:40:03 +08:00