Commit graph

58775 commits

Author SHA1 Message Date
wangmingrong1
9af2f0ee82 mempool: Support mempool address and size alignment by setting CONFIG_MM_NODE_GUARDSIZE
Setting a reasonable CONFIG_MM_NODE_GUARDSIZE can ensure absolute alignment of usersize

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2025-06-26 20:33:29 +08:00
wangmingrong1
e6f77d7f14 mempool: Use the same magic with mmheap
mmheap magic: #define MM_INIT_MAGIC    0xcc #define MM_ALLOC_MAGIC   0xaa #define MM_FREE_MAGIC    0x55

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2025-06-26 20:33:29 +08:00
wangmingrong1
a98f3f2417 mm: Support CONFIG_MM_NODE_GUARDSIZE configuration
After it is not zero, the preceding member of the next node will no longer belong to the valid area of the previous alloc node.
Due to the existence of precedence, the memory block size of the node can only be aligned with sizeof(mmsize_t).
This configuration will be applied in the following scenarios when set 8:
	ARM64 MTE hardware tag KASan, which requires the tag's memory address to be 16-byte aligned and the memory size must also be 16-byte aligned

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2025-06-26 20:33:29 +08:00
wangjianyu3
5079105e17 boards: net tcp backlog is enabled by default
The configuration NET_TCPBACKLOG is enabled by default.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-06-26 09:32:54 -03:00
wangjianyu3
c1aa625bdb net: enable tcp backlog by default
If the NET_TCPBACKLOG configuration is not enabled, no I/O event will be
triggered for the socket file descriptor in poll/epoll. As a result, the
connection will not be accepted, leading to a failure in the TCP handshake.

The problem is that users may not have noticed this configuration,
no event will be received when polling the socket fd.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-06-26 09:32:54 -03:00
wangmingrong1
3ca0d1e478 fix compile error
Because the location of the macro is moved, other archs cannot find the corresponding macro

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2025-06-26 20:31:19 +08:00
wangmingrong1
e97e33eadc toolchain: Support KASAN compilation above Clang18
1. When the Clang compiler turns on "-fsanitize=kernel-address", inlining, global variables, and stack detection are enabled by default and must be turned off manually.
2. -mllvm is the parameter passing method of Clang, and --param is the parameter passing method of GCC
After the modification, KASan compilation and operation will be supported for Clang 18 and above

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2025-06-26 20:31:19 +08:00
wangmingrong1
7b902caf94 arm: Move some cp15 macros to cp15 header files
Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2025-06-26 20:31:19 +08:00
wangmingrong1
c6a528ef11 spinlock: fix stxr instruction status register requirement
error: unpredictable STXR instruction, status is also a source
   99 |     "stxr     %w0, %1, [%2] \n"
      |      ^
<inline asm>:5:10: note: instantiated into assembly here
    5 | stxr     w10, x10, [x9]
Using w0 to pass the result can cause the "status register is also a source" problem, resulting in unpredictable behavior.

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2025-06-26 20:31:19 +08:00
wangmingrong1
68a1774eae arm64/smc: Support limited compilation
Only el3 arch may need to use it, let's limit it to

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2025-06-26 20:31:19 +08:00
wangmingrong1
5206cc84d8 arm64/armv8r: Support CPUs without hardware floating point
Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2025-06-26 20:31:19 +08:00
wangmingrong1
66260f81f4 UNUSED: UNUSED may be defined elsewhere.
Give priority to using macros defined by third-party libraries

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2025-06-26 20:31:19 +08:00
wangmingrong1
acf0256164 arm64: Support change toolchain to clang
Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2025-06-26 20:31:19 +08:00
wangmingrong1
e219066397 arm64: Used by irrelevant macro switch position
Add unused_code to avoid compilation errors

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2025-06-26 20:31:19 +08:00
wangmingrong1
df3d84b514 arm64: fix compile error
when CONFIG_SMP is disabled, If the cpu parameter is not used, an error will be reported

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2025-06-26 20:31:19 +08:00
wangmingrong1
f445652a35 Delete unused functions
Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2025-06-26 20:31:19 +08:00
wangmingrong1
4c755c7401 arm64: Fix add immediate value irregular behavior
The ARM64 instruction ADD has a 12-bit limit (0 - 4095) for immediate values, but here we try to use a symbolic address (.Linitparms) as an immediate value, which does not comply with the ARM64 instruction set rules.

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2025-06-26 20:31:19 +08:00
wangmingrong1
dd8819e517 arm64: Explicitly specify register type as x in assembly (arm64)
common/arm64_cache.c:305:38: error: value size does not match register size specified by the constraint and modifier [-Werror,-Wasm-operand-widths]

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2025-06-26 20:31:19 +08:00
dongjiuzhu1
7ecfbcdaab fs/fs_files: restore fd before calling fdlist_install
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2025-06-26 09:31:14 -03:00
dongjiuzhu1
224dc48a95 drivers/serial: fix the issue of the refs count for filep being zeroed out by utilizing dup2
file_open will clear filep, include f_refs

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2025-06-26 09:31:14 -03:00
dongjiuzhu1
e85cdac2ed fs/vfs: clear filep when call file_open/file_mq_open to avoid random value
fix crash caused by stack random value

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2025-06-26 09:31:14 -03:00
wangmingrong1
bdd3869d26 debug/0 address: Add 0 address access panic configuration
Implemented using up_debugpoint_add

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2025-06-26 19:25:31 +08:00
simbit18
4270235bfa arch: Fix Kconfig style
Remove spaces from Kconfig
Add TABs
Add comments
2025-06-26 02:30:46 +08:00
simbit18
7d5b9cbb96 drivers/serial: Fix Kconfig style
Remove spaces from Kconfig
Add TABs
2025-06-26 02:30:46 +08:00
simbit18
7c0bda7f9f boards: Fix Kconfig style
Remove spaces from Kconfig
Add TABs
2025-06-26 02:30:46 +08:00
simbit18
22c02963ac drivers/segger/CMakeLists.txt: Aligned Cmake with Make
Segger SysView has been upgraded to version V3.5.6
https://github.com/apache/nuttx/pull/13847

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-06-25 22:20:39 +08:00
ouyangxiangzhen
42ebe289b0 spinlock: Remove atomic.h inclusion in spinlock_type.h
Since the spinlock_type.h is designed to avoid including atomic.h in
the userspace, we should remove `atomic.h` inclusion in spinlock_type.h.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2025-06-25 22:13:00 +08:00
ouyangxiangzhen
d9bbdeb6fe spinlock: Better recursive spinlock implementation.
This commit provided a better recursive spinlock implementation with
less memory-overhead and better performance.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2025-06-25 22:13:00 +08:00
ouyangxiangzhen
0717928b0e spinlock: Fix compilation error with atomic.h.
This commit fixed compilation error with atomic.h included.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2025-06-25 22:13:00 +08:00
Alin Jerpelea
5fee15f4bc AUTHORS: add Rodrigo Sim
Rodrigo Sim submitted the ICLA and should be added to the AUTHORS file

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2025-06-25 21:22:03 +08:00
Alin Jerpelea
74d63d974f AUTHORS: add Filipe do Ó Cavalcanti
Filipe do Ó Cavalcanti submitted the ICLA and should be added to
 the AUTHORS file

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2025-06-25 21:22:03 +08:00
simbit18
1f98d90825 drivers/sensors/CMakeLists.txt: Aligned Cmake with Make
Add:
    Adafruit NAU7802 ADC sensor
    MCP9600 Thermocouple Amplifier
    Maxim MAX31865

Removed repeated addition of the Rohm BH1749NUC Color Sensor

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-06-25 20:40:15 +08:00
halyssonJr
3ecdcf556e add lcd suport 2025-06-24 16:29:00 +08:00
Filipe Cavalcanti
2ddfab618b documentation: update docs on SDMMC for ESP32|S2|S3 2025-06-24 08:08:55 +08:00
Filipe Cavalcanti
02dae3e5eb boards/xtensa: add SDMMC SPI defconfig to ESP32|S2|S3 boards
Adds a defconfig for SDMMC over SPI to the following boards:
esp32-devkitc, esp32s2-saola-1 and esp32s3-devkit.

Renames the defconfig name for:
esp32-lyrat and esp32-wrover-kit.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2025-06-24 08:08:55 +08:00
Filipe Cavalcanti
aedce4c648 boards/xtensa/esp32: use common board source for SDMMC
Deletes board specific sdmmc implementation in favor of a common source and header file.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2025-06-24 08:08:55 +08:00
Filipe Cavalcanti
452292159b boards/xtensa: support SDMMC over SPI on ESP32-S2|S3
Adds support for SDMMC over SPI on ESP32S2 and ESP32S3.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2025-06-24 08:08:55 +08:00
halyssonJr
ba38432a0e Modify type to avoid compilation warning. 2025-06-24 07:49:36 +08:00
Xiang Xiao
c9dc89142c fs: Move inotify.c from fs/notify/ to fs/vfs/
and merge fs/notify/notify.h into fs/vfs/vfs.h

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2025-06-23 18:17:10 -03:00
Xiang Xiao
1ea0ae8073 fs/vfs: Rename lock.h to vfs.h
vfs.h will contain other internal functions in the future

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2025-06-23 18:17:10 -03:00
halyssonJr
4193fe6e2b add support to a new board : esp32s3-8048s043. 2025-06-24 01:10:49 +08:00
nuttxs
26e02700dd netdb/lib_dnsquery.c: In the IPv6 or IPv4 dns_query_callback() block,
if dns_recv_response() fails, dns_bind() is called again at try_stream to
create a new socket. However, the original socket descriptor sd isn't closed

Signed-off-by: nuttxs <zhaoqing.zhang@sony.com>
2025-06-23 11:56:15 -03:00
halyssonJr
21e8bfaab4 Modify types uint32_t to size_t 2025-06-23 20:34:24 +08:00
wangjianyu3
2424b12857 fs/procfs: fix output format of fd info
Refered to PRINTF(3), the [v]snprintf returns the number of characters
printed (excluding the null byte used to end output to strings).

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-06-23 20:31:24 +08:00
kywwilson11
04c4f5d229 Initial commit for STM32G0 dma support. Added DMA mux mappings. Added Kconfig for enabling DMA2. Added basic defines for number of channels and mux channels in dma_v1mux.
Added subclasses of STM32G0 (such as STM32G07X) to Kconfig for use in dmamux driver. Added definitions to stm32g0_dmamux.h. Added configuration of number of dma and dmamux channels.

Added missing dma mappings for stm32g0.

Remove reserved defines.

Formatting fixes.

Added DMA2 IRQ mappings for STM32G0B and STM32G0C. Changed STM32_DMAMUX_BASE to STM32_DMAMUX1_BASE to align with stm32_dma_v1mux.c and C0 defines.

Provide correct mapping for ADC1_DMA_CHAN. Add STM32F0L0G0_HAVE_ADC1_DMA to STM32G0.

Add support for continuous mode to the ADC. Also added support to set smp1 and smp2 in board.h, as well as smpsel.

Removed unnecessary selects of STM32F0L0G0_STM32G0. Changed board level files to properly define A0-A3 on nucleo-g0b1re.

Add new Kconfig changes.

Made combined configs for STM32G0. Ex. STM32G0BX for STM32G0B0 and STM32G0B1.

Fixed defines and references in Kconfig and stm32_dma_v1mux.c

Defined adc_sampletime_write and adc_sampletime_set. Changed adc_sample_time_s structure to be much simpler. Old way made no sense. You can only have 2 sample times, so defining one for each channel makes no sense. The new adc_sample_time_s contains smp1, smp2, and smpsel. Also define ADC_HAVE_SMPR_SMP2 for STM32C0.

Added adc_sampletime_write and adc_sampletime_set. Altered adc_sample_time_s structure to be more appropriate for g0 and c0. Only two sample times can be defined. Added rcc support for DMA2.

Added defconfig for nucleo-g0b1re:adc_dma config.

Restore correct Kconfig from my original branch

Removed redundant ifdefs. If we select for G0 and C0, we know they have SMP2. Fixed formatting.

Formatting feedback. Aligned columns in irq and dma headers.
2025-06-23 15:46:28 +08:00
wushenhui
6a9a835d6f risc-v/mmu: Fix map_region() for incorrect page table setup when vaddr is unaligned
When the vaddr parameter passed to map_region() is not aligned to the page directory,
it causes incorrect address mapping for later regions.

For example, in the sv32 case, `PGPOOL` started at `0x80a00000` with a size of `1024*4096B`,
leading to page table errors for the range `0x80c00000~0x80e00000`.

This patch fixes the issue by ensuring map_region() correctly handles unaligned vaddr cases.

Signed-off-by: wushenhui <wushenhui@xiaomi.com>
2025-06-23 15:44:39 +08:00
halyssonJr
74ce16da5c fix framebuffer config resolution. 2025-06-23 09:49:31 +08:00
Xiang Xiao
bc4041db60 libc: Move stdio/README to Documentation/components/libs/libc/stream.rst
follow up this change:
commit 84dc88730c
Author: Xiang Xiao <xiaoxiang@xiaomi.com>
Date:   Mon Jun 9 14:39:03 2025 +0800

    libc: Move stream printf/scanf from libc/stdio to libc/stream

    to keep all related code in one place

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2025-06-22 17:07:41 -03:00
Tiago Medicci Serrano
b3712797fa Documentation/rv-virt: Add entries for nsbi[|64] defconfigs
This commit adds entries for the `rv-virt:nsbi[|64]` defconfigs in
the `rv-virt` board documentation page.
2025-06-22 14:57:11 +08:00
Tiago Medicci Serrano
14af1c6ef7 boards/risc-v/qemu-rv: Add missing section on ld-nuttsbi.script
Fix an issue regarding the `rv-virt:nsbi` defconfig, which wasn't
booting properly because `sbi_set_mtimecmp` failed to get the
mtimecmp's register address when evaluating `g_mtimecmp`. This
variable, which should be located at the `.noinit` section, wasn't
being set accordingly by the linker script, ending up on `bss
section which is zero-initialized, overwriting its value previously
set by `sbi_init_mtimer`.
2025-06-22 14:57:11 +08:00