Commit graph

57061 commits

Author SHA1 Message Date
Tiago Medicci Serrano
5456668ae8 libm/newlib: Add arch-specific source code first to CSRCS
Source code under `newlib/newlib/newlib/libm/machine/$(ARCH)/*.c`
should be added before common source code from `../../common/*.c`.
Take `newlib/newlib/newlib/libm/machine/riscv/s_fma.c` as an
example:

```

double
fma (double x, double y, double z)
{
        double result;
        asm ("fmadd.d %0, %1, %2, %3" : "=f" (result) : "f" (x), "f" (y), "f" (z));
        return result;
}

```

Note that the common `s_fma.c` will be included by the source file
directly. The order of adding the files to CSRCS matters here.

Although the CMake-based build system does not have the same build
problem of including the a source-file with the same in the wrong
order, this commit also changes the order of inclusion for CMake
too to keep it consistent.
2024-12-04 02:10:41 +08:00
Tiago Medicci Serrano
80dd961f23 libm: Do not link the toolchain's libm unless explicitly selected
Fix CMake-based build system to include the toolchain's libm only
when `CONFIG_LIBM_TOOLCHAIN` is selected. Before this commit, if
the user selected `CONFIG_LIBM_NEWLIB`, for instance, the build
system would still link the toolchain's libm functions instead of
the ones provided by newlib.
2024-12-04 02:06:17 +08:00
hujun5
d5fba177b1 cxd56xx: use small lock in arch/arm/src/cxd56xx/cxd56_nxaudio_src.c
reason:
We hope to remove all instances of spin_lock_irqsave(NULL).

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-03 23:51:47 +08:00
wangmingrong1
893e67745b gcc/gcov: Add instrumentation function
Some functions will insert these functions:
void __gcov_execve(void)
{
}
void __gcov_execv(void)
{
}
void __gcov_fork(void)
{
}

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-12-03 23:51:12 +08:00
hujun5
4f3f9751c1 fix compile error
lcd/st7565.c:107:4: warning: #warning "Optimal setting of CONFIG_LCD_MAXCONTRAST is 255" [-Wcpp]
  107 | #  warning "Optimal setting of CONFIG_LCD_MAXCONTRAST is 255"
      |    ^~~~~~~
chip/lc823450_cpuindex.c:36: warning: "CORE_COREID" redefined
   36 | #define CORE_COREID (LC823450_CORE_BASE + 0x0)
      |
In file included from /home/hujun5/downloads1/vela_sim/nuttx/arch/arm/src/common/arm_internal.h:37,
                 from chip/lc823450_cpuindex.c:29:
/home/hujun5/downloads1/vela_sim/nuttx/arch/arm/src/chip/chip.h:48: note: this is the location of the previous definition
   48 | #define CORE_COREID         (LC823450_CORE_BASE + 0)
      |
chip/lc823450_cpuindex.c:37: warning: "CORE_COREID_ID" redefined
   37 | #define   CORE_COREID_ID  (0x1 << 0)
      |
/home/hujun5/downloads1/vela_sim/nuttx/arch/arm/src/chip/chip.h:49: note: this is the location of the previous definition
   49 | #define CORE_COREID_ID      (1 << 0)

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-03 18:27:54 +08:00
hujun5
2b22ee03d6 arm: remove g_running_tasks[this_cpu()] = NULL
reason:
We hope to keep g_running_tasks valid forever.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-03 18:27:54 +08:00
hujun5
03af486d68 arm: remove up_set_current_regs/up_current_regs
reason:
up_set_current_regs initially had two functions:

1: To mark the entry into an interrupt state.
2: To record the context before an interrupt/exception. If we switch to
   a new task, we need to store the upcoming context regs by calling up_set_current_regs(regs).

Currently, we record the context in other ways, so the second function is obsolete.
Therefore, we need to rename up_set_current_regs to better reflect its actual meaning,
which is solely to mark an interrupt.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-03 18:27:54 +08:00
wangmingrong1
95ed02ec22 arm64/qemu: Add 9pfs configuration
Convenient for qemu debugging and adding ci check
We can learn to use the following command to mount 9pfs on qemu64:

qemu-system-aarch64 -cpu max -nographic \
        -machine virt,virtualization=on,gic-version=3,mte=on \
        -fsdev local,security_model=none,id=fsdev0,path=/xxxx -device virtio-9p-device,id=fs0,fsdev=fsdev0,mount_tag=host \
        -chardev stdio,id=con,mux=on, -serial chardev:con \
        -mon chardev=con,mode=readline  -kernel ./nuttx/nutt

mkdir mnt
mount -t v9fs -o trans=virtio,tag=host mnt

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-12-03 18:19:09 +08:00
wangmingrong1
77d993623c boards/mte: Dependencies changed, so need to delete it now
Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-12-03 15:45:53 +08:00
stbenn
9b52710691 board/nucleo-h563zi: Add HSE option
Add an option to use HSE on the Nucleo-H563ZI with board modification. This is enabled through board Kconfig.
It supplies the same PLL output frequencies using the HSE instead of HSI, for significantly more precise clocks.
2024-12-03 09:39:13 +08:00
chao an
5cd3eed323 arm64/imx8: fix build break
Error: chip/imx8qm_lowputc.S:23:1: error: "/*" within comment [-Werror=comment]
   23 | /****************************************************************************
      |
Signed-off-by: chao an <anchao@lixiang.com>
2024-12-03 09:38:35 +08:00
gaohedong
9fb84700a8 com/can: Remove unnecessary judgment logic
The feature of preventing the same ID frame rotation should be done in the lowerhalf, not in the upperhalf.

Signed-off-by: gaohedong <gaohedong@xiaomi.com>
2024-12-03 08:48:18 +08:00
Tiago Medicci Serrano
1dd8178bdc float.h: Define FLT_ROUNDS if not defined by toolchain previously
This value is necessary to build third-party applications on NuttX.
If not defined previously by the toolchain, define it at NuttX's
`lib/float.h`.
2024-12-03 08:38:58 +08:00
Kyle Wilson
e1e1d534af Add STM32H5 FDCAN Hardware File
Adding the STM32H5 FDCAN Hardware definitions. The register set is identical to the STM32G4. No major changes other than changing G4 to H5 and removing ifdef requirement for STM32G4.

Fixed style issues
2024-12-03 08:33:31 +08:00
Kyle Wilson
d417e1525b First commit of STM32H5 SPI Hardware file.
This file is heavily based on the STM32H7 implementation. CFG1_BPASS and UDRCFG were the main differences.
2024-12-03 08:32:50 +08:00
hujun5
3a4b8edf2c riscv: remove up_set_current_regs/up_current_regs
reason:
up_set_current_regs initially had two functions:

1: To mark the entry into an interrupt state.
2: To record the context before an interrupt/exception. If we switch to a new task, we need to store the upcoming context regs by calling up_set_current_regs(regs).

Currently, we record the context in other ways, so the second function is obsolete. Therefore, we need to rename up_set_current_regs to better reflect its actual meaning, which is solely to mark an interrupt.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-02 22:46:04 +08:00
cuiziwei
7bc4671a76 libcxx/CMakeLists.txt: Remove unnecessary flags.
Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2024-12-02 22:44:41 +08:00
wangjianyu3
d59e6d98d5 include/usbdev_trace: Fix argument and return value of macro usbtrace_enumerate()
Errors

  1. Not return int value

     usbmsc_main.c: In function 'msconn_main':
     usbmsc_main.c:645:55: error: expected expression before ';' token
       645 |       ret = usbtrace_enumerate(usbmsc_enumerate, NULL);

  2. Error argument number

     CC:  usbmsc_main.c usbmsc_main.c: In function 'msconn_main':
     usbmsc_main.c:645:54: error: macro "usbtrace_enumerate" passed 2 arguments, but takes just 1
       645 |       ret = usbtrace_enumerate(usbmsc_enumerate, NULL);

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-12-02 22:43:51 +08:00
Alin Jerpelea
879d38d511 arch/arm64: 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>
2024-12-02 22:43:23 +08:00
Alin Jerpelea
7428644711 arch/avr: 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>
2024-12-02 22:43:23 +08:00
Alin Jerpelea
6e268f3c45 arch/ceva: 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>
2024-12-02 22:43:23 +08:00
Alin Jerpelea
d2b24c8e3a arch/hc: 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>
2024-12-02 22:43:23 +08:00
Alin Jerpelea
d69ac54147 arch/misps: 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>
2024-12-02 22:43:23 +08:00
Alin Jerpelea
7693764f34 arch/misoc: 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>
2024-12-02 22:43:23 +08:00
Alin Jerpelea
35ff0d834e arch/or1k: 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>
2024-12-02 22:43:23 +08:00
wangmingrong1
9555f9ff55 arm64/mte: Add support for arm64 mte
For details, please refer to the kernel's introduction to this at "https://docs.kernel.org/arch/arm64/memory-tagging-extension.html" and Android's introduction to this at "https://source.android.com/docs/security/test/memory-safety/arm-mte"

Of course, there is also the following detailed principle introduction
https://developer.arm.com/-/media/Arm%20Developer%20Community/PDF/Arm_Memory_Tagging_Extension_Whitepaper.pdf

The modification of this patch is only to merge the simplest MTE function support. In the future, the MTE function will be integrated into the kernel to a greater extent, for example, hardware MTE Kasan will be supported in the future.

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-12-02 11:04:11 -03:00
wangmingrong1
360c053eca arm64/qemu: Add arm64 mte defconfig support
Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-12-02 11:04:11 -03:00
wangmingrong1
1e32122709 arm64/qemu: Add support for arm64 qemu's maximum feature cpu
Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-12-02 11:04:11 -03:00
hujun5
64c3e972a0 fix compile error
CC:  mqueue.c common/riscv_exit.c: In function 'up_exit':
common/riscv_exit.c:65:33: error: 'tcb' undeclared (first use in this function); did you mean 'tcb_s'?
   65 |   g_running_tasks[this_cpu()] = tcb;
      |                                 ^~~
      |                                 tcb_s

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-02 20:50:21 +08:00
hujun5
cc96289e2d xtensa: syscall SYS_switch_context and SYS_restore_context use 0 para
reason:
simplify context switch
sys_call0(SYS_switch_context)
sys_call0(SYS_restore_context)

size nuttx

before
   text    data     bss     dec     hex filename
 187620    1436  169296  358352   577d0 nuttx
after
   text    data     bss     dec     hex filename
 187576    1452  169280  358308   577a4 nuttx

size reduce -44

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-02 20:05:05 +08:00
xuxin19
dc8bde8dd5 cmake(enhance):Enhance romfs so that RAWS files can be added in any location
1.make the generation sequence of etc romfs no longer bound to the board
2.RCRAWS RCSRCS can be added from any directory
3.enable dynamic files, files generated during the compilation process,
    and ensure the correct time order

Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-12-02 19:59:02 +08:00
wangmingrong1
208f31c27f boards/qemu64: Due to dependency changes, the test program of kasantest is deleted.
Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-12-02 19:49:22 +08:00
Michal Lenc
9fbb81e8a4 samv7: fix bytes to words calculation in user signature read
EEFC read sequence requires read length in words instead of bytes,
therefore bytes given by the user has to be recalculated to words.
The calculation however had a mistake in brackets and was just adding
1 to buflen instead of recalculating it to 4 byte words. This caused
global array g_page_buffer to overflow for some reads.

This fixes the calculation.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2024-12-02 19:47:43 +08:00
Jukka Laitinen
140b3080c5 drivers/audio/wm8994.c: Include nuttx/arch.h to fix compilation (up_mdelay prototype)
Fix the compilation error:

  audio/wm8994.c: In function 'wm8994_audio_output':
  Error: audio/wm8994.c:1898:3: error: implicit declaration of function 'up_mdelay' [-Werror=implicit-function-declaration]
   1898 |   up_mdelay(40);
        |   ^~~~~~~~~

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2024-12-02 13:14:22 +02:00
hujun5
400239877d risc-v: remove g_running_tasks[this_cpu()] = NULL
reason:
We hope to keep g_running_tasks valid forever.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-02 17:41:16 +08:00
Alin Jerpelea
19e42a8978 arch/tricore: 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>
2024-12-02 17:23:25 +08:00
Alin Jerpelea
3013ff9ba9 arch/renesas: 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>
2024-12-02 17:23:25 +08:00
Alin Jerpelea
3dde10adaa arch/risk-v: 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>
2024-12-02 17:23:25 +08:00
Alin Jerpelea
eea3d77a6e arch/sim: 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>
2024-12-02 17:23:25 +08:00
Alin Jerpelea
7d3fe64a6a arch/sparc: 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>
2024-12-02 17:23:25 +08:00
Alin Jerpelea
b6a32301ee arch/x86: 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>
2024-12-02 17:23:25 +08:00
Alin Jerpelea
5e0347b20a arch/x86_64: 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>
2024-12-02 17:23:25 +08:00
Alin Jerpelea
8d50457dfc arch/xtensa: 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>
2024-12-02 17:23:25 +08:00
Alin Jerpelea
b3e1e21c65 arch/z16: 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.
2024-12-02 17:23:25 +08:00
Alin Jerpelea
99d8641cdd arch/z80: 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.
2024-12-02 17:23:25 +08:00
chao an
9127d8f59b sim/tflm: enable tflm hello world
tflm hello world is a basic test program to verify whether the tflm function works properly
refrash defconfig and enable tflm hello world:

Test on sim/tflm

$ cmake -B build -DBOARD_CONFIG=sim/tflm -GNinja
$ cmake --build build
$ ./build/nuttx

NuttShell (NSH) NuttX-10.4.0
nsh> tflm_hello
0 (id=0): size=16, offset=0, first_used=0 last_used=1
1 (id=1): size=64, offset=64, first_used=1 last_used=2
2 (id=2): size=64, offset=0, first_used=2 last_used=3
3 (id=3): size=16, offset=64, first_used=3 last_used=3
 0: 0000000000...................................................................... (1k)
 1: 0000000000..............................1111111111111111111111111111111111111111 (1k)
 2: 22222222222222222222222222222222222222221111111111111111111111111111111111111111 (1k)
 3: 22222222222222222222222222222222222222223333333333.............................. (1k)

"Unique Tag","Total ticks across all events with that tag."
FULLY_CONNECTED, 0
"total number of ticks", 0

[RecordingMicroAllocator] Arena allocation total 2344 bytes
[RecordingMicroAllocator] Arena allocation head 128 bytes
[RecordingMicroAllocator] Arena allocation tail 2216 bytes
[RecordingMicroAllocator] 'TfLiteEvalTensor data' used 240 bytes with alignment overhead (requested 240 bytes for 10 allocations)
[RecordingMicroAllocator] 'Persistent TfLiteTensor data' used 128 bytes with alignment overhead (requested 128 bytes for 2 tensors)
[RecordingMicroAllocator] 'Persistent buffer data' used 1152 bytes with alignment overhead (requested 1100 bytes for 7 allocations)
[RecordingMicroAllocator] 'NodeAndRegistration struct' used 192 bytes with alignment overhead (requested 192 bytes for 3 NodeAndRegistration structs)
0 (id=0): size=16, offset=0, first_used=0 last_used=1
1 (id=1): size=64, offset=64, first_used=1 last_used=2
2 (id=2): size=64, offset=0, first_used=2 last_used=3
3 (id=3): size=16, offset=64, first_used=3 last_used=3
 0: 0000000000...................................................................... (1k)
 1: 0000000000..............................1111111111111111111111111111111111111111 (1k)
 2: 22222222222222222222222222222222222222221111111111111111111111111111111111111111 (1k)
 3: 22222222222222222222222222222222222222223333333333.............................. (1k)
0 (id=0): size=16, offset=16, first_used=0 last_used=1
1 (id=1): size=16, offset=0, first_used=1 last_used=2
2 (id=2): size=16, offset=16, first_used=2 last_used=3
3 (id=3): size=16, offset=0, first_used=3 last_used=3
 0: ................0000000000000000................................................ (1k)
 1: 11111111111111110000000000000000................................................ (1k)
 2: 11111111111111112222222222222222................................................ (1k)
 3: 33333333333333332222222222222222................................................ (1k)
~~~ALL TESTS PASSED~~~

Signed-off-by: chao an <anchao@lixiang.com>
2024-12-02 15:27:47 +08:00
hujun5
3c32517b94 riscv: syscall SYS_switch_context and SYS_restore_context use 0 para
reason:
simplify context switch
sys_call0(SYS_switch_context)
sys_call0(SYS_restore_context)

size nuttx
before
   text    data     bss     dec     hex filename
 148021     921   26944  175886   2af0e nuttx

after
   text    data     bss     dec     hex filename
 147995     921   26928  175844   2aee4 nuttx

size reduce -42

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-02 14:44:37 +08:00
xuxingliang
08139fb1db nxgdb/thread: fix ps command
Fix ps command reports wrong running stack corruption.
To get running tcb registers, need to read from frame register not the tcb context.

Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-12-02 13:43:52 +08:00
xuxingliang
1d55f111f3 gdb: check if pid is valid
Add check to make sure pid is valid.
Remove stack check for interrupt context.

Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-12-02 13:43:52 +08:00
xuxingliang
1f2435641d nuttxgdb: fix memdump busyloop when nodesize is 0
Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-12-02 13:43:52 +08:00