Commit Graph

2302 Commits

Author SHA1 Message Date
daichuan 4609c68422 add ip struct for support wpa_supplicant
Signed-off-by: daichuan <daichuan@xiaomi.com>
2026-04-21 01:31:42 +08:00
daichuan bb908baf29 add macro ETH_P_802_3 with nuttx
Signed-off-by: daichuan <daichuan@xiaomi.com>
2026-04-21 01:31:36 +08:00
v-tangmeng bde37fed0b libs/libc: fix the compilation error
/nuttx/staging/libc.a(exec_symtab.o):(.rodata.g_symtab+0x25c):
undefined reference to `ether_ntoa'
03:20:21  make[1]: *** [Makefile:221: nuttx] Error 1

`ether_ntoa` is implemented in `lib_etheraton.c`, and the compilation
of `lib_etheraton.c` is controlled by the CONFIG_NET.

Signed-off-by: v-tangmeng <v-tangmeng@xiaomi.com>
2026-04-21 01:30:06 +08:00
zhanghongyu 713febceb3 tcp.h: add TCP_CORK definition
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2026-04-21 01:25:34 +08:00
zhanghongyu fe3b5f9fbe include/netinet/arp.h: change the type of arp_dev from uint8_t to char
the same variable type in linux is char, in order to avoid modifying
the third-party library code when porting the third-party library code.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2026-04-21 01:25:34 +08:00
zhanghongyu c37531d03b if_ether.h: add the definition of ETH_P_TSN
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2026-04-21 01:23:50 +08:00
Zhe Weng 76d3e6a064 net/pkt: Support filtering protocol in AF_PACKET
Ref: https://man7.org/linux/man-pages/man7/packet.7.html

1. For `socket(AF_PACKET, int socket_type, int protocol)`: When `protocol` is set to `htons(ETH_P_ALL)`, then all protocols are received. If `protocol` is set to zero, no packets are received.
2. For `bind`: `bind` can optionally be called with a nonzero `sll_protocol` to start receiving packets for the protocols specified.

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2026-04-21 01:19:29 +08:00
daichuan c79a1f69ed replace imr_interface to imr_address in struct ip_mreqn as same as linux
Signed-off-by: daichuan <daichuan@xiaomi.com>
2026-04-21 01:18:32 +08:00
daichuan 2bb877512e After enabling the `CONFIG_CM_SOCKET_TEST` configuration, a compilation error occurs: `IFF_PROMISC` undeclared.
Signed-off-by: daichuan<daichuan@xiaomi.com>
2026-04-21 01:17:34 +08:00
meijian e276de6389 netinet/in.h: fix LINKLOCAL macro bug
Signed-off-by: meijian <meijian@xiaomi.com>
2026-04-21 01:15:57 +08:00
meijian 3c0c2b0f63 netinet/in.h: add IN6_IS_ADDR_GLOBAL macro
Signed-off-by: meijian <meijian@xiaomi.com>
2026-04-21 01:15:30 +08:00
zhanghongyu ac06c91c7c netinet/if_ether.h: move #define ETH_XXX into if_ether.h
consistent with other operating systems

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2026-04-21 01:13:31 +08:00
zhanghongyu 78bc63e16f arp.h: make struct arpreq four-byte aligned
avoid memory waste in 64-bit architectures.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2026-04-21 01:12:52 +08:00
zhanghongyu deb9c7b475 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>
2026-04-21 01:12:51 +08:00
zhanghongyu 588e6e5b57 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>
2026-04-21 01:12:51 +08:00
Alin Jerpelea 1c4ebed9a4 include: migrate to SPDX identifier
Most tools used for compliance and SBOM generation use SPDX identifiers
This change brings us a step closer to an easy SBOM generation.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
Signed-off-by: ligd <liguiding1@xiaomi.com>
2026-04-21 00:59:40 +08:00
openvela-robot b566da436e sim:support sim elf and dynamic libs package in post build
use the dynamic library .so of the binding compilation environment,
and then modify the dynamic loader of elf at runtime to run sim elf across system versions

1.add post-build for sim build
2.collect dynamic .so and dynamic interpreter
3.add execution script for the entire package sim elf

change text-segment to 0x50000000
because patchelf will modify the .dynamic section in elf,
the upward alignment of elf will be less than 0x3fffffff,
which will cause asan shadow memory overlap error

Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2026-04-21 00:59:38 +08:00
Alin Jerpelea 8a3b7f63ca include: migrate to SPDX identifier
Most tools used for compliance and SBOM generation use SPDX identifiers
This change brings us a step closer to an easy SBOM generation.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2026-04-21 00:59:19 +08:00
wangyingdong 1f36bf2b48 Expose IPTOS_xxx to the application layer
Signed-off-by: wangyingdong <wangyingdong@xiaomi.com>
2026-04-21 00:48:39 +08:00
openvela-robot c92d7713b4 ipfrag:fix warnig
Signed-off-by: wangyingdong <wangyingdong@xiaomi.com>
2026-04-21 00:48:38 +08:00
openvela-robot 5ed6276448 rpmsgdev: get battery info by rpmsgdev
cp read battery info register by sensor

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2026-04-21 00:48:32 +08:00
openvela-robot 7f592803c2 arch/risc-v/common: provide architecture specific perfmon bindings.
Provides two implementations:
 - CSR_CYCLE: Cores which implement hardware performance monitoring.
 - CSR_TIME: Uses the machine time registers.

Using the up_perf_xx bindings directory is more efficient than performing a nanosecond conversion on every gettime event.
2026-04-21 00:48:28 +08:00
openvela-robot 0c36e60ea5 arch/risc-v/riscv_mtimer: Update the mtimecmp value once per interrupt event.
Cache the next timeout value in the drivers instance and update the mtimecmp value once. This is advantageous as the opensbi ecall to set the timer is expensive in systems which don't have the supervisor mode timer extension.
2026-04-21 00:48:20 +08:00
openvela-robot 92ea644ffe sched: migrate to SPDX identifier
Most tools used for compliance and SBOM generation use SPDX identifiers
This change brings us a step closer to an easy SBOM generation.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2026-04-21 00:48:15 +08:00
openvela-robot 49d2af7861 riscv: Unify the extended context save/restore
This patch unifies the extended context save/restore for RISC-V,
allowing the customized context save/restore to be used, for example,
the extended context in rv32m1.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2026-04-21 00:48:09 +08:00
openvela-robot ccb8384022 driver/usbdev: support userspace to access ep0
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2026-04-21 00:48:04 +08:00
openvela-robot 3d24db5798 rptun/rptun_ivshmem:add recive stop cmd and reboot slave func
Signed-off-by: mazhuang <mazhuang@xiaomi.com>
2026-04-21 00:47:59 +08:00
openvela-robot 8b6183c705 arm64/crt0.c: Fix stack alignment when executing signal trampoline
The stack alignment requirement is 16-bytes, not 8-bytes.
2026-04-21 00:47:54 +08:00
openvela-robot d5c3b65b38 net/udp: Fixed the issue of sending ICMP error when the destination address is broadcast/multicast.
According to rfc1112, section 7.2:
"An ICMP error message (Destination Unreachable, Time Exceeded, Parameter Problem, Source Quench, or Redirect) is
never generated in response to a datagram destined to an IP host group."

Signed-off-by: zhangshuai39 <zhangshuai39@xiaomi.com>
2026-04-21 00:47:48 +08:00
openvela-robot 6f12a6fef2 irq: simplify code by using OSINIT_TASK_READY
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2026-04-21 00:47:42 +08:00
openvela-robot 0f6b46a641 boards/qemu: Open kasan on qemu
1. Open Kasan and open Kasantest
2. Add software tag kasan configuration for arm64
Modified and tested Kasan, all tests passed

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2026-04-21 00:47:36 +08:00
openvela-robot ce7a992587 arm64_vector_table.S: Remove unnecessary instruction
The expression "sub    x0,  x0, #8 * XCPTCONTEXT_GP_REGS" is void,
as the next instruction overwrites x0 anyway.
2026-04-21 00:47:28 +08:00
openvela-robot bf84adb68a gdb/memdump:fixed the problem of inaccurate statistics
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2026-04-21 00:47:22 +08:00
openvela-robot 6b896b7832 .gitignore: Update .gitignore to include .aider* and fix newline issue
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2026-04-21 00:47:18 +08:00
openvela-robot 18a0f658b0 arch/x86_64: Resolve weak symbol compilation relocation errors
Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>
2026-04-21 00:47:12 +08:00
openvela-robot a72f6b41bc sim:Remove -lmad cause it has been ported to the apps/audioutils directory.
Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2026-04-21 00:47:06 +08:00
openvela-robot 1adb75b205 cmake: fix the nuttx_add_extra_library handle bug on non-unix platform
On non-unix platform(Windows), the "IS_ABSOLUTE" will fail to work, in
order to work on these platform, we need to remove the "IS_ABSOLUTE"
check

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2026-04-21 00:47:01 +08:00
openvela-robot f330e4549c build: fix memory manager compile options for CMake
This enables CMake based build for sim:ostest. Flags which
are set by set_source_files_properties are not reflected in
final build. Changing these to target_compile_options makes
CMake build runnable.

Signed-off-by: Daniel Jasinski <jasinskidaniel95szcz@gmail.com>
2026-04-21 00:46:55 +08:00
openvela-robot bbf5656236 drivers/segger: add heap data plot
Add heap current used to note.
Plot it in segger sysview data plot.

Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2026-04-21 00:46:50 +08:00
openvela-robot e368e6f33e fs/inode: add reference to protect filelist of group
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2026-04-21 00:46:44 +08:00
openvela-robot ff73d3a057 mm/kasan: Fix the issue where Kasan Global cannot be used
1. The shadow area of global variables is different from heap
2. This modification has little impact on performance under O3 optimization

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2026-04-21 00:46:39 +08:00
openvela-robot ebeb15000f Dockerfile: add subversion to final images
Add subversion to install list ensure linux docker
can use svn command to download source code.

Signed-off-by: shizhenghui <shizhenghui@xiaomi.com>
2026-04-21 00:46:32 +08:00
openvela-robot b44df413c3 clock: fix clock_timespec_subtract() error when use TIME32
Signed-off-by: ligd <liguiding1@xiaomi.com>
2026-04-21 00:46:27 +08:00
openvela-robot 79705ae285 Revert "Fix unwanted flush in the SPI slave driver"
because if priv->rx_length is zero , need to call SPIS_CTRLR_QPOLL to
receive new data from lower half and update priv->rx_length.

This reverts commit 6cb649ecf6d537383eadb71a8a7ce780959ee8ad.
2026-04-21 00:46:20 +08:00
openvela-robot defd81bf6d coredump: do not dump non-writeable memory segment
Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2026-04-21 00:46:15 +08:00
openvela-robot a37d2878bd sched/group/setuptask_file: duplicate idle task fd for kernel thread
The file descriptors of kernel threads should be clean and should
not be generated based on user threads. Instead, an idle thread
hould be chosen.

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2026-04-21 00:46:10 +08:00
openvela-robot d2dca54ee1 task: use get_task_name where possible
Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2026-04-21 00:46:02 +08:00
openvela-robot 7520208563 irq: add [enter|leave]_critical_section_nonirq
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

reason:
In some non-irq scenarios, we can simplify
the implementation of critical sections to improve performance.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2026-04-21 00:45:45 +08:00
openvela-robot d493525be3 greenhills: fix the ghs exlr .syscall section link warning
the libsys.a will introduce an extra ".syscall" section, and the
".syscall" is mainly used for syscall actions that provided by
greenhills compiler.
but since vela has syscall implementation, so we choose to not depend
on the greenhills's libsys.a lib.
the following are the detailed warning info:

[elxr] (warning #283) section .syscall from libsys.a(ind_dots.o) isn't included by the section map;
  appending after last section.
  add to section map or use -append to append without warning

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2026-04-21 00:45:39 +08:00
openvela-robot 0310098bd9 include/nuttx/net/netfilter/ip6_tables.h: fix gcc 14 errors
fix gcc 14 errors for ip6_tables.h

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2026-04-21 00:45:32 +08:00