Commit Graph

56049 Commits

Author SHA1 Message Date
Lup Yuen Lee 1280ac845a CI: Label `include/*.h` and `include/nuttx/*.h` as "Area: OS Components"
This patch fixes the PR Labeler, such that PRs with modified files in `include/*.h` and `include/nuttx/*.h` are labeled as "Area: OS Components". Previously the PR Labeler ignores files like `include/nuttx/elf.h`, which causes Build Jobs to be skipped incorrectly.
2024-10-15 22:41:30 +08:00
Tim Hardisty bb7dce11a2 SAMA5 fix compiler warning in sam_adc.c 2024-10-15 11:37:54 -03:00
liwenxiang1 7541311ac0 mm/mm_heap: Optimizing heap performance, changing the mm_size2ndx and mm-addfreechunk functions to inline functions can improve by about 7%
Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>
2024-10-15 22:29:17 +08:00
zhangyuan29 57650d841e armv8-m: set fpscr when do exception_direct
In armv8m the FPSCR[18:16] LTPSIZE field must be set to 0b100 for
"Tail predication not applied" as it's reset value.

Signed-off-by: zhangyuan29 <zhangyuan29@xiaomi.com>
2024-10-15 22:16:09 +08:00
anjiahao ef9640c696 armv7-a:adjust gdb register order
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-10-15 21:46:41 +08:00
Bowen Wang 43557c15c8 qemu-armv8a/qemu_bringup: init the pci ecam
Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2024-10-15 21:40:45 +08:00
lipengfei28 054257c36e update defconfig
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2024-10-15 21:40:35 +08:00
ligd f0e12a983d cpuload: add nxsched_update_critmon() to handle thread busyloop
Signed-off-by: ligd <liguiding1@xiaomi.com>
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2024-10-15 21:11:15 +08:00
wangming9 5b14fb75bc arm/fpu: FPU is supported when the TEE is enabled
Summary:
1. Support armv7-a armv7-r armv8-r
2. The NSACR is read-only in Non-secure PL1 and PL2 modes.
3. The NSACR is read/write in Secure PL1 modes.
4. When the NSACR.{CP11,CP10} bit is set to 1,
   Non-secure access to coprocessor 11,10 enable

Signed-off-by: wangming9 <wangming9@xiaomi.com>
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2024-10-15 21:11:15 +08:00
wangming9 f465443f37 cpuinfo: Decouple the fetch cpuinfo from up_perf_getfreq
Summary:
Add the default CPU frequency configuration.

Signed-off-by: wangming9 <wangming9@xiaomi.com>
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2024-10-15 21:11:15 +08:00
chenzhijia 10d0526f3f nuttx/sched:Modify the comment error in sched_resumescheduler.c
Signed-off-by: chenzhijia <chenzhijia@xiaomi.com>
2024-10-15 21:05:36 +08:00
chenzhijia 65fbf4cf64 nuttx/include:Modify the CPU_SET series macro definition in sched.h
Modify the CPU_SET series macro definition to avoid an error when shifting 31 bits to the left.

Signed-off-by: chenzhijia <chenzhijia@xiaomi.com>
2024-10-15 21:05:36 +08:00
chenzhijia aca7552d9c nuttx/include:add #define CPU_SETSIZE in sched.h
add #define CPU_SETSIZE in sched.h to pass tlpi example: https://man7.org/tlpi/code/online/dist/procpri/t_sched_getaffinity.c.html

Signed-off-by: chenzhijia <chenzhijia@xiaomi.com>
2024-10-15 21:05:36 +08:00
zhanghu5 32717ae353 sdio_probe: set voltage use CMD5
reference doc: https://www.infineon.com/dgdl/Infineon-SDIO_platform_support_guide-UserManual-v01_00-EN.pdf?fileId=8ac78c8c8c3de074018c8ba3a9973619

Signed-off-by: zhanghu5 <zhanghu5@xiaomi.com>
2024-10-15 21:04:28 +08:00
wangming9 6ee747a1e6 arm/goldfish: add memory map for DDR region
Signed-off-by: wangming9 <wangming9@xiaomi.com>
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2024-10-15 21:01:47 +08:00
Filipe Cavalcanti 809cdd6595 ci: add Python linter to check 2024-10-15 15:01:07 +02:00
yangsong8 0beceeb745 usb: Fix issue with the calculation descriptor length error
Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2024-10-15 21:00:29 +08:00
wangxiaoxin 366ede9530 add lin status changes the format of the reported frame and add the macros that lin needs
Signed-off-by: wangxiaoxin <wangxiaoxin@xiaomi.com>
2024-10-15 19:45:38 +08:00
wanggang26 d22ad37cd7 elf:fix a ci error
Configuration/Tool: teensy-2.0/nsh
In file included from
/github/workspace/sources/nuttx/include/nuttx/coredump.h:35:0,
                 from
/github/workspace/sources/nuttx/sched/misc/coredump.h:28,
                 from ./init/nx_bringup.c:54:
/github/workspace/sources/nuttx/include/nuttx/elf.h:31:22: fatal error:
arch/elf.h: No such file or directory

Signed-off-by: wanggang26 <wanggang26@xiaomi.com>
2024-10-15 19:41:26 +08:00
yinshengkai 8f3060ed52 boards: Enable LTO option for same70-xplained/mcuboot-loader
Avoid compilation errors due to insufficient flash in CI

Configuration/Tool: same70-xplained/mcuboot-loader,CONFIG_ARM_TOOLCHAIN_GNU_EABI
2024-10-14 16:17:34
arm-none-eabi-ld: /github/workspace/sources/nuttx/nuttx section `.ramfunc' will not fit in region `flash'
arm-none-eabi-ld: region `flash' overflowed by 52 bytes
arm-none-eabi-ld: warning: /github/workspace/sources/nuttx/nuttx has a LOAD segment with RWX permissions
make[1]: *** [Makefile:212: nuttx] Error 1
make: *** [tools/Unix.mk:551: nuttx] Error 2
make: Target 'all' not remade because of errors.

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-10-15 18:13:38 +08:00
likun17 9de0465a8a lib_libvsprintf.c:add option in Kconfig to control "%p*" special format specifier.
Signed-off-by: likun17 <likun17@xiaomi.com>
2024-10-15 15:33:13 +08:00
likun17 83914d5b29 lib_libvsprintf.c: Add support for %pB parameter.
Signed-off-by: likun17 <likun17@xiaomi.com>
2024-10-15 15:33:13 +08:00
hujun5 49b9aa0f33 arm/riscv: remove redundant judgment
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-10-15 15:32:40 +08:00
hujun5 aa0346610b arm64: we need to initialize the percpu register storing the current task more earlier.
A call stack looks like the following:
sched_idletask
syslog_write
nx_vsyslog
syslog
getreg64
gic_validate_redist_version
arm64_gic_init
arm64_gic_secondary_init
arm64_boot_secondary_c_routine

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-10-15 15:25:55 +08:00
hujun5 948ac9b4cc arm64: add up_this_task and up_change_task macro impl
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-10-15 15:25:55 +08:00
hujun5 a567148888 sched: add up_this_task and up_change_task macro stub
reason:
We can utilize percpu storage to hold information about the
current running task. If we intend to implement this feature, we would
need to define two macros that help us manage this percpu information
effectively.

up_this_task: This macro is designed to read the contents of the percpu
              register to retrieve information about the current
              running task.This allows us to quickly access
              task-specific data without having to disable interrupts,
              access global variables and obtain the current cpu index.

up_update_task: This macro is responsible for updating the contents of
                the percpu register.It is typically called during
                initialization or when a context switch occurs to ensure
                that the percpu register reflects the information of the
                newly running task.

Configuring NuttX and compile:
$ ./tools/configure.sh -l qemu-armv8a:nsh_smp
$ make
Running with qemu
$ qemu-system-aarch64 -cpu cortex-a53 -smp 4 -nographic \
   -machine virt,virtualization=on,gic-version=3 \
   -net none -chardev stdio,id=con,mux=on -serial chardev:con \
   -mon chardev=con,mode=readline -kernel ./nuttx

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-10-15 15:25:55 +08:00
xuxin19 0285c0b901 cmake(bugfix):disable proxy and service source in open-amp
since we disable find_package(libmetal) so we need to set
open_amp target include dirs link to metal target

Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-10-15 15:25:20 +08:00
cuiziwei 4253001656 sim/m64:Fix ld error with .rodata can not be used when making a PIE object.
/usr/bin/ld: nuttx.rel: relocation R_X86_64_32S against `.rodata' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: failed to set dynamic section sizes: bad value

Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2024-10-15 14:45:42 +08:00
Bowen Wang 71ee767fe2 vsprintf:fix bug when print int64 0x8000000000000000
stdio/lib_libvsprintf.c:1018:17: runtime error: negation of -9223372036854775808 cannot be
represented in type 'long long int'; cast to an unsigned type to negate this value to itself
    #0 0x3326a86 in vsprintf_internal stdio/lib_libvsprintf.c:1018
    #1 0x332926b in lib_vsprintf stdio/lib_libvsprintf.c:1363
    #2 0x3777978 in vfprintf stdio/lib_vfprintf.c:52
    #3 0x671b3a0 in printf stdio/lib_printf.c:44
    #4 0x37abc0c in hello_main /data/project/code/vela-pt/apps/examples/hello/hello_main.c:38
    #5 0x33201d3 in nxtask_startup sched/task_startup.c:70
    #6 0x3208ecb in nxtask_start task/task_start.c:134
    #7 0x3357a49 in pre_start sim/sim_initialstate.c:52

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2024-10-15 08:14:59 +02:00
cuiziwei bbf60ec685 gnu++20:fix ld error.
LD: nuttx
arm-none-eabi-ld: warning: net_sendfile.o: missing .note.GNU-stack section implies executable stack
arm-none-eabi-ld: NOTE: This behaviour is deprecated and will be removed in a future version of the linker
arm-none-eabi-ld: warning: nuttx/nuttx has a LOAD segment with RWX permissions
arm-none-eabi-ld: apps/staging/libfeature.a(feature_framework.cpp.frameworks.base.feature_1.o): in function `std::__1::__throw_length_error[abi:un170006](char const*)':

Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2024-10-15 12:57:52 +08:00
cuiziwei 68e25dcee6 nuttx/x86_64:Add _sinit and _einit initialization.
Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2024-10-15 12:57:31 +08:00
xuxin19 696e1a3f70 cmake(fix warning):toolchain do not have parent scope
toolchain file variable is global scope
dont need set parent scope

clear warning:
CMake Warning (dev) at /github/workspace/sources/nuttx/arch/arm/src/cmake/gcc.cmake:69 (set):
  Cannot set "GCCVER": current scope has no parent.
Call Stack (most recent call first):
  /github/workspace/sources/nuttx/arch/arm/src/cmake/Toolchain.cmake:56 (include)
  /github/workspace/sources/nuttx/build/CMakeFiles/3.26.0/CMakeSystem.cmake:6 (include)
  /github/workspace/sources/nuttx/build/CMakeFiles/CMakeScratch/TryCompile-ZJVOZO/CMakeLists.txt:5 (project)
This warning is for project developers.  Use -Wno-dev to suppress it.

Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-10-15 12:38:14 +08:00
pangzhen1 7e27eb6460 add dependencies for nuttx_post
nuttx_post depends systemmap and usermap(in protected build mode)

Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-10-15 12:37:58 +08:00
Gao Jiawei 89d6abf3df setjmp: fix setjmp returns 0 when calling longjmp with 0 as the second argument
Signed-off-by: Gao Jiawei <gaojiawei@xiaomi.com>
2024-10-15 12:36:19 +08:00
cuiziwei 036a0674db nuttx/libc:Add _dl_find_object and dl_iterate_phdr function.
Add _dl_find_object() function, because when cxx_exception configuration is enabled, a link error occurs and that function cannot be found.

ld: /usr/lib/gcc/x86_64-linux-gnu/13/libgcc_eh.a(unwind-dw2-fde-dip.o): in function `_Unwind_Find_FDE':
(.text+0x250c): undefined reference to `_dl_find_object'

Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2024-10-15 12:35:54 +08:00
cuiziwei 8d7ee794f4 nuttx/elf.h: Fix build error with unknown type name 'bool'.
nuttx/include/nuttx/elf.h:118:1: error: unknown type name 'bool'
  118 | bool up_checkarch(FAR const Elf_Ehdr *hdr);
      | ^~~~
nuttx/include/nuttx/elf.h:30:1: note: 'bool' is defined in header '<stdbool.h>'; did you forget to '#include <stdbool.h>'?
   29 | #include <arch/elf.h>
  +++ |+#include <stdbool.h>
   30 |

Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2024-10-15 12:35:10 +08:00
wanggang26 ca189ccaf2 boards/same70-xplained: refine config for insufficient flash capacity
Signed-off-by: wanggang26 <wanggang26@xiaomi.com>
2024-10-15 12:34:55 +08:00
cuiziwei 3fdc68ef09 stm32f4discovery/testlibcxx: Enable tls to fix build error.
CXX:  libcxx/src/filesystem/directory_iterator.cpp libcxx/src/thread.cpp:123:2: error: #error "Thread.cpp needs to enable config of CONFIG_TLS_TASK_NELEM," " and CONFIG_TLS_TASK_NELEM > 0, please enable it"
  123 | #error "Thread.cpp needs to enable config of CONFIG_TLS_TASK_NELEM," \
      |  ^~~~~

Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2024-10-15 11:41:10 +08:00
wanggang26 aef584a804 shm:fix build error
nuttx/arch/arm/src/armv7-a/arm_addrenv_shm.c:77:(.text.up_shmat+0x2e):
undefined reference to `shminfo'

Signed-off-by: wanggang26 <wanggang26@xiaomi.com>
2024-10-15 11:40:34 +08:00
wanggang26 7e5fb8450f coredump: add architecture-specific registers dump, including NVIC and MPU
Signed-off-by: wanggang26 <wanggang26@xiaomi.com>
2024-10-15 11:40:05 +08:00
guoshichao 39690a994f mps2-an521: remove the unnecessary -pipe build options
Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2024-10-15 09:46:06 +08:00
Ludovic Vanasse 678d0484b4 Doc: Migrate Versioning and Task Names
Migrate
https://cwiki.apache.org/confluence/display/NUTTX/Versioning+and+Task+Names
to the official wiki

Signed-off-by: Ludovic Vanasse <ludovicvanasse@gmail.com>
2024-10-15 09:45:43 +08:00
dongjiuzhu1 5a38c8bfe3 fs/readlink: fix minor issue
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-10-14 18:08:14 -03:00
dongjiuzhu1 74c9b6f544 drivers/rpmsgdev: support get more battery info by rpmsgdev
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-10-14 18:08:14 -03:00
cuiziwei 6f62ef0b6f nuttx/sim:Remove asan check in up_irq_save().
Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2024-10-15 03:36:55 +08:00
anjiahao 4156eca0c1 modlib:so need export symbol, exec elf not need
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-10-15 03:20:05 +08:00
anjiahao 19b8fdbad6 modlib:allow 64bit elf load
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-10-15 03:20:05 +08:00
Ludovic Vanasse 5e002d99e5 Doc: Migrate Kernel Threads with Custom Stacks
Migrate
https://cwiki.apache.org/confluence/display/NUTTX/Kernel+Threads+with+Custom+Stacks
to official wiki

Signed-off-by: Ludovic Vanasse <ludovicvanasse@gmail.com>
2024-10-15 03:15:55 +08:00
wanggang26 9ee4566b4d mmcsd:add reset card to idle state (CMD0) support
Signed-off-by: wanggang26 <wanggang26@xiaomi.com>
2024-10-15 03:15:24 +08:00
Tomasz 'CeDeROM' CEDRO 863dcbbb45 DOC: Add information on STM32F0 and STM32L4 flashing/debugging.
Signed-off-by: Tomasz 'CeDeROM' CEDRO <tomek@cedro.info>
2024-10-15 03:13:11 +08:00