Commit Graph

56230 Commits

Author SHA1 Message Date
xuxin19 92dddcda8a tools/refresh.sh:skip config check on debug configs
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-10-30 22:14:40 +08:00
xuxin19 4595f9388f tools/Unix.mk:make incdir precedence over other targets
Make.defs need incdir at the very beginning.
fix error such as `make menuconfig` `make oldconfig` etc.

Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-10-30 22:14:40 +08:00
xuxin19 e60c60b691 cmake(sync):fix cmake SIM build error build nuttx upstream
/usr/lib/x86_64-linux-gnu/libSM.so  /usr/lib/x86_64-linux-gnu/libICE.so  /usr/lib/x86_64-linux-gnu/libX11.so  /usr/lib/x86_64-linux-gnu/libXext.so  -lpthread  -lrt  -lm  -lasound  -lmad  -lv4l2 && :
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libSM.so: error adding symbols: file in wrong format

Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-10-30 22:14:40 +08:00
xuxin19 c60b980968 cmake(bugfix):fix robot openlibm cmake build missing source error
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-10-30 22:14:40 +08:00
Ville Juven 9d4218666c mpfs/smp: Add riscv_macros to mpfs_shead
To get definition for riscv_set_inital_sp macro
2024-10-30 22:09:01 +08:00
chenrun1 759b77b975 nuttx/atomic.h:Add use condition for using stdatomic.h
Summary:
  add check !defined(__STDC_NO_ATOMICS__)
  If the macro constant __STDC_NO_ATOMICS__(C11) is defined by the compiler, the header <stdatomic.h>, the keyword _Atomic, and all of the names listed here are not provided.

  refer to:https://en.cppreference.com/w/c/atomic

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-10-30 21:29:04 +08:00
zhanghongyu c11752e59f arp.h: make struct arpreq four-byte aligned
avoid memory waste in 64-bit architectures.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2024-10-30 21:10:46 +08:00
wangmingrong1 8461f0ea54 clang: Support compiling rt.profile library
1. Since the implementation of gcov has changed since clang17, versions before clang17 need to use the libunwind.a file

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-10-30 17:10:23 +08:00
YAMAMOTO Takashi 761ee81956 move readv/writev to the kernel
currently, nuttx implements readv/writev on the top of read/write.
while it might work for the simplest cases, it's broken by design.
for example, it's impossible to make it work correctly for files
which need to preserve data boundaries without allocating a single
contiguous buffer. (udp socket, some character devices, etc)

this change is a start of the migration to a better design.
that is, implement read/write on the top of readv/writev.

to avoid a single huge change, following things will NOT be done in
this commit:

* fix actual bugs caused by the original readv-based-on-read design.
  (cf. https://github.com/apache/nuttx/pull/12674)

* adapt filesystems/drivers to actually benefit from the new interface.
  (except a few trivial examples)

* eventually retire the old interface.

* retire read/write syscalls. implement them in libc instead.

* pread/pwrite/preadv/pwritev (except the introduction of struct uio,
  which is a preparation to back these variations with the new
  interface.)
2024-10-30 17:07:54 +08:00
wangmingrong1 e3d7d23618 gcov: Fix typographical errors
1. CONFIG_ARCH_COVERAGE has been replaced by CONFIG_SCHED_GCOV
2. Delete the SIM-specific GCOV_ALL configuration and change it to a universal configuration for all architectures

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-10-30 14:45:23 +08:00
yezhonghui 27685aa179 Fix config repeat define in include deconfig mode
Signed-off-by: yezhonghui <yezhonghui@xiaomi.com>
2024-10-30 12:29:56 +08:00
anjiahao 2dcd300a3c coredump.py:bug fix python file not have rename
tmpfile.rename(args.output)
    ^^^^^^^^^^^^^^
AttributeError: '_io.BufferedRandom' object has no attribute 'rename'. Did you mean: 'name'?

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-10-30 12:29:22 +08:00
Yanfeng Liu f6facf7602 mm/mm_memalign: add debugging log
This adds debugging log support for mm_memalign to help track memory
issues via logs.

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
2024-10-30 08:40:32 +08:00
zhangyuan29 befe29801f sem: change sem wait to atomic operation
Add sem_wait fast operations, use atomic to ensure
atomicity of semcount operations, and do not depend
on critical section.

Test with robot:
before modify:
nxmutex_lock cost: 78 ns
nxmutex_unlock cost: 82 ns

after modify:
nxmutex_lock cost: 28 ns
nxmutex_unlock cost: 14 ns

Signed-off-by: zhangyuan29 <zhangyuan29@xiaomi.com>
2024-10-30 01:38:45 +08:00
nuttxs 0c5381a0a1 xtensa/esp32s3: add esp32s3 reset reasons interface 2024-10-29 23:03:37 +08:00
Gao Feng 782ab3b248 xtensa/esp32s3: enable encrypted flag based on partition and device
If device encryption is not enabled by eFuse, and partiton mark as
encrypted flag, then encrypted MTD is used.

That is no problem in write and read operation, but failed while
using spi_flash_mmap(...) since de-encrypt is not processed.

So, back to use non-encrypted MTD following API Guide:
If flash encryption is not enabled, the flag "encrypted" has no effect
2024-10-29 23:02:35 +08:00
ligd 4541132035 Revert "shced:sem: replace mutex with spinlock"
Cause we can't do sem_post/wait within spinlock

This reverts commit 23d65cb97f.

Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-10-29 23:01:39 +08:00
cuiziwei d42f16939e nuttx: Fix build warning with can't found xt-g++
Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2024-10-29 22:27:58 +08:00
Jukka Laitinen 62194400f9 imx9/serial: Take proper use of RX/TX FIFOs, clean up interrupt service routine
- i.MX93 LPUARTs have 16-byte RX and TX FIFOs. Take those into use and correct some related register definitions
- There is no reason to loop inside interrupt handler, remove the looping

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2024-10-29 22:24:48 +08:00
Jukka Laitinen 44d1811ebb imx9/serial: Clean up the flow control code
- Remove GPIO (SW) based flow control. It didn't work, and pure HW flow control seems to work fine
- Remove some unneeded ifdefs and change bit-field flags to booleans to clean up the code

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2024-10-29 22:24:48 +08:00
wangmingrong1 083f9d162e clang/ld.lld: clang17 and above support the option --print-memory-usage
1. cmake uses clang++ as a connector, and does not currently support:
	clang++: error: unknown argument: '-wl,--print-memory-usage'
	clang++: error: no input files

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-10-29 20:43:35 +08:00
zhanghongyu c22b39d8d7 arp.h: make struct arpreq four-byte aligned
current sizeof(struct sockaddr_in) is 66

arp/arp_table.c:241:28: runtime error: member access within misaligned address 0xe5f134e6 for type 'struct sockaddr_in', which requires 4 byte alignment
0xe5f134e6: note: pointer points here
 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00
             ^
    #0 0x543287c1 in arp_get_arpreq arp/arp_table.c:241
    #1 0x5432a11f in arp_snapshot arp/arp_table.c:574
    #2 0x5435f0be in netlink_fill_arptable netlink/netlink_route.c:547
    #3 0x5435ffca in netlink_get_neighbor netlink/netlink_route.c:715
    #4 0x54360116 in netlink_get_neighborlist netlink/netlink_route.c:743
    #5 0x54363b20 in netlink_route_sendto netlink/netlink_route.c:1382
    #6 0x542ef1b1 in netlink_sendmsg netlink/netlink_sockif.c:625
    #7 0x542be94d in psock_sendmsg socket/sendmsg.c:96
    #8 0x542bc94b in psock_sendto socket/sendto.c:134
    #9 0x542bcb28 in sendto socket/sendto.c:247
    #10 0x542bc5ea in send socket/send.c:163
    #11 0x542aa715 in netlib_get_arptable /home/mi/gaofengzhi/code/dev1025/apps/netutils/netlib/netlib_getarptab.c:152
    #12 0x54279109 in cmd_arp /home/mi/gaofengzhi/code/dev1025/apps/nshlib/nsh_netcmds.c:1197
    #13 0x54257faf in nsh_command /home/mi/gaofengzhi/code/dev1025/apps/nshlib/nsh_command.c:1263
    #14 0x54231982 in nsh_execute /home/mi/gaofengzhi/code/dev1025/apps/nshlib/nsh_parse.c:718
    #15 0x5423da42 in nsh_parse_command /home/mi/gaofengzhi/code/dev1025/apps/nshlib/nsh_parse.c:2619
    #16 0x5423e12a in nsh_parse /home/mi/gaofengzhi/code/dev1025/apps/nshlib/nsh_parse.c:2706
    #17 0x5424088f in nsh_session /home/mi/gaofengzhi/code/dev1025/apps/nshlib/nsh_session.c:245
    #18 0x5422efc9 in nsh_consolemain /home/mi/gaofengzhi/code/dev1025/apps/nshlib/nsh_consolemain.c:75
    #19 0x5419e89f in nsh_main /home/mi/gaofengzhi/code/dev1025/apps/system/nsh/nsh_main.c:74
    #20 0x54067ee1 in nxtask_startup sched/task_startup.c:70
    #21 0x53f366c6 in nxtask_start task/task_start.c:116
    #22 0x5409e1a4 in pre_start sim/sim_initialstate.c:52

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2024-10-29 20:43:15 +08:00
zhanghongyu 306cb3301b include/netinet/if_ether.h: add ethhdr definition.
adapts to third-party code compilation. in the process of porting EtherCAT,
we encounter some situations where the structure is not defined, or the
returned data types do not match the expectations. Refer to the EtherCAT
implementation of other systems and add relevant definitions.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2024-10-29 18:13:35 +08:00
zhangshoukui 198dd93713 shmfs: return EINVAL if group null
Signed-off-by: zhangshoukui <zhangshoukui@xiaomi.com>
2024-10-29 18:11:33 +08:00
zhangshoukui 646bf48ed2 shmfs: Assign a variable when object is not null
Signed-off-by: zhangshoukui <zhangshoukui@xiaomi.com>
2024-10-29 18:11:33 +08:00
chao an 20e03f50cf toolchain/tasking: fix build break on tasking toolchain
1. Tasking only support preprocess link script on linker phase
2. Remove executable suffix (.elf)

Signed-off-by: chao an <anchao@lixiang.com>
2024-10-29 18:11:04 +08:00
chao an e3689cbb2f CMake/preprocess: fix typo PREPROCES -> PREPROCESS
correct the marco define from PREPROCES to PREPROCESS

Signed-off-by: chao an <anchao@lixiang.com>
2024-10-29 17:41:01 +08:00
Saurav Pal 17bca89f07 fs/mnemofs: Fix mkdir for depth > 3 bug, better logs
- Fix bug which prevents mkdir for depth > 3.
- Better logs for mnemofs

Signed-off-by: Saurav Pal <resyfer.dev@gmail.com>
2024-10-29 02:23:58 +08:00
raiden00pl 716d898dda arch/arm/stm32/stm32_dumpgpio.c: fix print warnings
fix print warnings for stm32_dumpgpio.c
2024-10-29 02:23:36 +08:00
wangmingrong1 240dc3d5e1 mps/clang: Add a defconfig for mps to support clang compilation
1. Enable compiler_rt library builtin function

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-10-28 22:19:58 +08:00
wangmingrong1 20e33ed84a libbuitlin: distclean should delete all files
Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-10-28 22:19:58 +08:00
zhanghongyu 583ff3b962 net/usrsock: usrsock supports offload netlink
supports the usrsock client to subscribe netlink events,
so that it can detect events such as link connection changes.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2024-10-28 19:42:05 +08:00
Alejandro Aguirre 0095009076 fs/nfs: fix offset in append mode and attributes after create
- When opening a NFS file in append mode, its file pointer was at offset
  0 instead of the end of file.

- When creating a NFS file, the response read pointer wasn't advanced
  after reading the attributes_follows bool, which caused the attributes
  to be off by 4 bytes. For example, the file size read the GID.

Signed-off-by: Alejandro Aguirre <alejandro.aguirre@midokura.com>
2024-10-28 19:40:30 +08:00
raiden00pl 7ebb8af454 arch/arm/stm32/Kconfig: fix Kconfig error
fix Kconfig error related to STM32_HAVE_HRTIM1_PLLCLK
2024-10-28 19:36:17 +08:00
wangmingrong1 e174d73cd9 clang:libclang_rt.builtins-xxx.a supports builtin
1. enable CONFIG_BUILTIN_COMPILER_RT  to built libclang_rt.builtins-xxx.a and no longer use the compiler's built-in
2. Modify clang version acquisition to get two decimal points
3. It has been ported to support four architectures: ARM, ARM64, RISCV, and x86_64, among which ARM has been validated

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-10-28 16:38:45 +08:00
Xiang Xiao 69100ef0e4 arch: Fix minor style issue
not real behaviour change

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-10-28 09:24:55 +01:00
Xiang Xiao 992c8dded5 libc: Fix lib_arc4random.c:111:(.text.arc4random_buf+0x26): undefined reference to `clock_systime_ticks'
by replacing clock_systime_ticks to clock

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-10-28 09:23:19 +01:00
Haiyue Wang c08e1bafb3 .gitignore: Add the .cache directory generated by clangd
Use VSCode + clangd plugin to develop the code, the clangd will save the
metadata into .cache directory, it is about the compile_commands.json:
  cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=True

Add the .cache into .gitignore for friendly clangd development environment.

Signed-off-by: Haiyue Wang <haiyue.wang@outlook.com>
2024-10-28 16:16:16 +08:00
Ludovic Vanasse 2c2a794240 Doc: Migrate Smaller Vector Tables
Migrate
https://cwiki.apache.org/confluence/display/NUTTX/Smaller+Vector+Tables
to official wiki

Signed-off-by: Ludovic Vanasse <ludovicvanasse@gmail.com>
2024-10-28 09:35:07 +08:00
Ludovic Vanasse 2e2ec9afa4 Doc: Replace link from old wiki to new wiki in signaling events from int
Signed-off-by: Ludovic Vanasse <ludovicvanasse@gmail.com>
2024-10-28 09:35:07 +08:00
Ludovic Vanasse 2532a79c13 Doc: Migration Signaling Semaphores and priority inheritance
Migrate
https://cwiki.apache.org/confluence/display/NUTTX/Signaling+Semaphores+and+Priority+Inheritance
to official wiki

Signed-off-by: Ludovic Vanasse <ludovicvanasse@gmail.com>
2024-10-28 09:35:07 +08:00
Ludovic Vanasse a5e714a71e Doc: Migrate Signaling Events from Interrupt Handlers doc
Migrate
https://cwiki.apache.org/confluence/display/NUTTX/Signaling+Events+from+Interrupt+Handlers
to official wiki

Signed-off-by: Ludovic Vanasse <ludovicvanasse@gmail.com>
2024-10-28 09:35:07 +08:00
raiden00pl efac056dee board: refresh boards after update LIBCANUTILS dependency
refresh boards after update LIBCANUTILS dependency
2024-10-27 19:46:43 +08:00
raiden00pl a099c6328e Documentation: update notes about nrf52840 and Renode
update notes about nrf52840 and Renode
2024-10-27 17:24:17 +08:00
Neo Xu 8a70377fc4 fs/shm: align memory size to cache line size
Make sure the share memory takes the full cache line.

Signed-off-by: Neo Xu <neo.xu1990@gmail.com>
2024-10-27 10:38:58 +08:00
xuxingliang 9af5fc5d09 fs/shm: alloc aligned memory if CPU has cache
For kernel builds, shared memory is automatically aligned to page size.
For flat and protected builds, we align the memory size to the CPU cache
line size.

Failure to align memory properly could result in partial data read/write
by the CPU and peripherals, potentially causing data corruption during
cache flushes or invalidations.

Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-10-27 10:38:58 +08:00
xuxingliang 22bcb88687 fs_heap: add memalign interface
So the share memory can use it to malloc aligned memory.
Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-10-27 10:38:58 +08:00
Xiang Xiao 32784b0898 libc: Refine the arc4random_buf implementation
fill the buffer with getrandom instead random pool
and move the implementation to from crypto to libc

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-10-26 18:04:21 -03:00
raiden00pl b5e5cdd851 arch/arm/stm32h7: add workaround for Renode
Add an option to disable busy wait PWR_CSR1_ACTVOSRDY during boot
which doesn't work with Renode simulation
2024-10-26 20:49:49 +08:00
raiden00pl 8b9337fb52 Documentation: add some notes about running NuttX on Renode
add some notes about running NuttX on Renode
2024-10-26 19:37:10 +08:00