Commit graph

23114 commits

Author SHA1 Message Date
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
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
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
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
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
hujun5
8b46a4d916 lc823450_usbdev: use small lock in arch/arm/src/lc823450/lc823450_usbdev.c
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-02 13:35:14 +08:00
hujun5
c116b6578a max32660_wdt: use small lock in arch/arm/src/max326xx/max32660/max32660_wdt.c
reason:
we plan to remove all instances of spin_lock_irqsave(NULL)

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-02 13:34:53 +08:00
hujun5
a0420df332 xtensa: 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 13:29:59 +08:00
hujun5
30940d9251 imxrt_serial: use small lock in arch/arm/src/imxrt/imxrt_serial.c
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-12-01 18:02:10 +08:00
wangjianyu3
074c494f8f nrf91: Support using different nbuffer for each topic
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-11-30 14:10:57 +08:00
hujun5
ab0fb80e2b arm64: change some format
fix the comment in https://github.com/apache/nuttx/pull/14980

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-11-30 03:15:54 +08:00
hujun5
74dfcdfbd6 cxd56xx: use small lock in arch/arm/src/cxd56xx/cxd56_clock.c
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-11-30 03:15:02 +08:00
Eero Nurkkala
53f4216977 risc-v/mpfs: clear IPIs at boot
Inter-processor interrupts (IPIs) are not cleared via mie/mip registers but
rather, at the MPFS_CLINT_BASE + mhartid * 4 (a word or 4-byte offset for
each hart).

If there's an IPI waiting, the system will continue to boot altough it's
expected to stay at the wfi loop waiting for the IPI.

Signed-off-by: Eero Nurkkala <eero.nurkkala@offcode.fi>
2024-11-30 03:14:10 +08:00
Eero Nurkkala
e111c9a256 risc-v/mpfs: introduce CONFIG_MPFS_CLKINIT flag
This CONFIG_MPFS_CLKINIT is set with bootloaders by default. However,
this gives an option to have it unset. In some cases, the clocks
may be already set so it becomes unnecessary to re-initialize them.

Signed-off-by: Eero Nurkkala <eero.nurkkala@offcode.fi>
2024-11-30 03:14:10 +08:00
buxiasen
7a4fac0df6 coredump: add BOARD_CRASHDUMP_CUSTOM support
For only board specific crashdump and no syslog/blk/mtd coredump

Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2024-11-30 03:08:35 +08:00
hujun5
321419491e missing update running_task
This commit fixes the regression from https://github.com/apache/nuttx/pull/14865

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-11-30 02:48:58 +08:00
hujun5
635da96bae xtensa: 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-11-30 02:48:58 +08:00
wangmingrong1
137ca05249 arm64/toolchain: Cmake alignment makefile writing
They should be a relationship of choice:
ifeq ($(CONFIG_ARCH_CORTEX_A53),y)
  ARCHCPUFLAGS += -mcpu=cortex-a53
else ifeq ($(CONFIG_ARCH_CORTEX_A55),y)
  ARCHCPUFLAGS += -mcpu=cortex-a55
else ifeq ($(CONFIG_ARCH_CORTEX_A57),y)
  ARCHCPUFLAGS += -mcpu=cortex-a57
else ifeq ($(CONFIG_ARCH_CORTEX_A72),y)
  ARCHCPUFLAGS += -mcpu=cortex-a72
else ifeq ($(CONFIG_ARCH_CORTEX_R82),y)
  ARCHCPUFLAGS += -mcpu=cortex-r82
else ifeq ($(CONFIG_ARCH_ARMV8A),y)
  ARCHCPUFLAGS += -march=armv8-a
else ifeq ($(CONFIG_ARCH_ARMV8R),y)
  ARCHCPUFLAGS += -march=armv8-r
endif

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-11-29 18:37:21 +08:00
chao an
8257b11944 arm/isr: move up_set_interrupt_context() to chip define
up_set_interrupt_context() is chip specific implement, move this function to correct place

Signed-off-by: chao an <anchao@lixiang.com>
2024-11-29 18:37:08 +08:00
hujun5
d89f22eb98 arm64: 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-11-29 10:04:50 +01:00
Jouni Ukkonen
1bfe8bcf71 arch/arm64/imx9: Boot, move mmu init to correct place
MMU init must be after ddrinit.

Signed-off-by: Jouni Ukkonen <jouni.ukkonen@unikie.com>
2024-11-29 10:03:28 +01:00
simbit18
9c9b945876 fix nxstyle
Removed extra spaces from .h and .c files
2024-11-28 20:40:13 +08:00
YAMAMOTO Takashi
388ab6c2db esp32s3: don't clear pending interrupts on eg. up_putc
Fixes https://github.com/apache/nuttx/issues/14872
2024-11-28 19:00:21 +08:00
hujun5
0bba53ce12 remove redundant scheduling records
reason:
Since the scheduling records have already been moved to the interrupt exit in this submission,
we need to delete the original records' locations.
This commit fixes the regression from https://github.com/apache/nuttx/pull/13651

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-11-28 18:56:13 +08:00
guoshichao
a2fcd9862c nuttx/arch: remove the custom board check in up_testset implementation
the up_testset implementation is common code, should not add custom
board check

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2024-11-28 15:06:57 +08:00
Jouni Ukkonen
6b38b83331 arch/arm64/imx9: Clear DMA channel interrupts on init
Avoid spurious interrupts on reboot

Signed-off-by: Jouni Ukkonen <jouni.ukkonen@unikie.com>
2024-11-28 15:02:15 +08:00
Jouni Ukkonen
1d23baaa63 arch/arm64/imx9/imx9_flexspi: Replace memcpy by while loop
libc memcpy cannot access fspi memory space correctly
remove unnecessary debugassert and cache operations

Signed-off-by: Jouni Ukkonen <jouni.ukkonen@unikie.com>
2024-11-28 15:00:33 +08:00
simbit18
0476895c0d fix nxstyle
Remove TABs
2024-11-28 09:14:49 +08:00
Ville Juven
51171d66f2 riscv/riscv_ipi.h: Do not write to CSR_MIP.MSIP as it is read-only
From the RISV-V Privileged Spec v1.10 (3.1.14 MIP/MIE):

Only the bits corresponding to lower-privilege software interrupts
(USIP, SSIP), timer interrupts (UTIP, STIP), and external interrupts
(UEIP, SEIP) in mip are writable through this CSR address; the
remaining bits are read-only.

Thus, it is futile to write to the M-mode status bit via the CSR, only
access via RISCV_IPI is valid.
2024-11-28 09:14:07 +08:00
p-szafonimateusz
eca40ff053 arch/x86_64/intel64: re-enable interrupts before syscall handle
arch/x86_64/intel64: re-enable interrupts before syscall handle
2024-11-27 13:32:23 -03:00
p-szafonimateusz
908ac756ea arch/x86_64/intel64: remove unnecessary nested syscalls logic
remove unnecessary nested syscalls logic, it's already handled different way
2024-11-27 13:32:23 -03:00
p-szafonimateusz
e7d6f2c044 arch/x86_64/intel64_irq.c: remove some magic numbers
arch/x86_64/intel64_irq.c: remove some magic numbers

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-11-27 13:32:23 -03:00
p-szafonimateusz
e95ea6fbc4 arch/x86_64: handle TLB shootdown
arch/x86_64: handle TLB shootdown

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-11-27 13:32:23 -03:00
p-szafonimateusz
ce22c28e88 arch/x86_64: add kernel stack support
arch/x86_64: add kernel stack support

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-11-27 13:32:23 -03:00
p-szafonimateusz
712e8d9cc7 arch/x86_64: add kernel build support
arch/x86_64: add kernel build support

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-11-27 13:32:23 -03:00
p-szafonimateusz
8702fbef8d arch/x86_64/include/intel64/arch.h: align definitions
arch/x86_64/include/intel64/arch.h: align definitions

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-11-27 13:32:23 -03:00
p-szafonimateusz
d51ceccd7b arch/x86_64: add syscalls support
arch/x86_64: add syscalls support

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-11-27 13:32:23 -03:00
p-szafonimateusz
7f4279b8af arch/x86_64/: fix broken set_cr3()
arch/x86_64/: fix broken set_cr3()

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-11-27 13:32:23 -03:00
Jinliang Li
37a0445ddb armv8-r/gicv3: support fiq
1. support fiq decoding and dispatch
2. replace CONFIG_ARMV8R_DECODEFIQ with CONFIG_ARCH_HIPRI_INTERRUPT

Signed-off-by: Jinliang Li <lijinliang1@lixiang.com>
2024-11-27 14:28:27 +08:00
p-szafonimateusz
825ba8ed7b arch/x86_64/intel64: fix revoke_low_memory
fix revoke_low_memory, problem found by Xiangzhen Ouyang.

g_pt_low mapping is removed during revoke_low_memory so we can't access this memory area with 1:1 mapping.
This logic has been broken for a long time, but for some reason it worked without any crash at boot.

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-11-27 03:28:37 +08:00
p-szafonimateusz
894b0f956b arch/x86_64/intel64: up_disable_irq should work from any CPU
simplify interrupt logic and allow any CPU
to disable interrupt, not only CPU that enabled it.

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-11-27 03:03:05 +08:00
hujun5
ef313755e7 sched: replace up_cpu_index with this_cpu
Make this_cpu is arch independent and up_cpu_index do that.
In AMP mode, up_cpu_index() may return the index of the physical core.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-11-27 03:00:32 +08:00
simbit18
430c2ecf46 arch/risc-v/src/cmake/Toolchain.cmake: Msys2 Cmake fixed nuttx/config.h: No such file or directory
fixed
/qemu-rv/qemu_rv_head.S:25:10: fatal error: nuttx/config.h: No such file or directory
   25 | #include <nuttx/config.h>
      |          ^~~~~~~~~~~~~~~~
compilation terminated.

added

# override the responsible file flag

if(CMAKE_GENERATOR MATCHES "Ninja")
  set(CMAKE_C_RESPONSE_FILE_FLAG "$DEFINES $INCLUDES $FLAGS @")
  set(CMAKE_CXX_RESPONSE_FILE_FLAG "$DEFINES $INCLUDES $FLAGS @")
  set(CMAKE_ASM_RESPONSE_FILE_FLAG "$DEFINES $INCLUDES $FLAGS @")
endif()
2024-11-27 02:35:48 +08:00
hujun5
610efc8f1a 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-11-26 20:04:54 +08:00
chao an
4dda9800b4 espressif/mcpwm: fix compile error
continue work of PR #14938

Signed-off-by: chao an <anchao@lixiang.com>
2024-11-26 16:34:19 +08:00
hujun5
111a0746c2 arm64: change name saved_reg to saved_regs
reason:
saved_regs is more meaningful and used by all other arch

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-11-26 10:09:31 +08:00
hujun5
53548509b1 fix build error
common/espressif/esp_rmt.c: In function 'rmt_set_tx_thr_intr_en':
common/espressif/esp_rmt.c:654:48: error: passing argument 1 of 'spin_lock_irqsave' makes pointer from integer without a cast [-Werror=int-conversion]
  654 |       flags = spin_lock_irqsave(g_rmtdev_common.rmt_spinlock);
      |                                 ~~~~~~~~~~~~~~~^~~~~~~~~~~~~
      |                                                |
      |                                                spinlock_t {aka unsigned char}
/home/hujun5/downloads1/vela_sim/nuttx/include/nuttx/spinlock.h:617:55: note: expected 'volatile spinlock_t *' {aka 'volatile unsigned char *'} but argument is of type 'spinlock_t' {aka 'unsigned char'}
  617 | irqstate_t spin_lock_irqsave(FAR volatile spinlock_t *lock)
      |                                  ~~~~~~~~~~~~~~~~~~~~~^~~~
CC:  nsh_script.c common/espressif/esp_rmt.c:662:48: error: passing argument 1 of 'spin_lock_irqsave' makes pointer from integer without a cast [-Werror=int-conversion]
  662 |       flags = spin_lock_irqsave(g_rmtdev_common.rmt_spinlock);
      |                                 ~~~~~~~~~~~~~~~^~~~~~~~~~~~~
      |                                                |
      |                                                spinlock_t {aka unsigned char}
/home/hujun5/downloads1/vela_sim/nuttx/include/nuttx/spinlock.h:617:55: note: expected '

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-11-26 09:03:29 +08:00
hujun5
34e79f9618 spinlock: use spin_lock_init replace spin_initialize
reason:
1: spin_lock_init and spin_initialize have similar functionalities.
2: spin_lock and spin_unlock should be called in matching pairs.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-11-26 00:02:44 +08:00
hujun5
03f430edf7 fix some build error
hujun5@hujun5-OptiPlex-7070:~/downloads1/vela_sim/nuttx$ make -j12
chip/qemu_boot.c: In function 'up_cpu_start':
chip/qemu_boot.c:102:3: warning: implicit declaration of function 'sched_note_cpu_start' [-Wimplicit-function-declaration]
  102 |   sched_note_cpu_start(this_task(), cpu);
      |   ^~~~~~~~~~~~~~~~~~~~
chip/qemu_boot.c:102:24: warning: implicit declaration of function 'this_task' [-Wimplicit-function-declaration]
  102 |   sched_note_cpu_start(this_task(), cpu);
      |                        ^~~~~~~~~

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-11-25 17:10:50 +08:00
hujun5
fccd908114 arch/arm64: 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)

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-11-23 12:22:21 +08:00
hujun5
f4d212fd6d arm64: 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-11-23 02:05:56 +02:00
cuiziwei
8e58245524 sim: Fix sim m32 start up crash issue.
After compilation, when starting nsh, the following crash occurs.
==2500151==Shadow memory range interleaves with an existing memory mapping. ASan cannot proceed correctly. ABORTING.
==2500151==ASan shadow was supposed to be located in the [0x1ffff000-0x3fffffff] range.
==2500151==Process memory map follows:
0x30000000-0x33dd4000 /nuttx/nuttx

To avoid overlaps, change the starting address of the text segment.

Using Ttext-segment=0x30000000 causes a crash when starting the 32-bit SIM.
Using -Ttext-segment=0x50000000 causes a crash when starting the 64-bit SIM.
Setting -Ttext-segment=0x40000000 resolves all issues perfectly.

Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2024-11-23 01:47:34 +08:00
yinshengkai
0194c2f88a gcov: update gcov compilation parameters
profile-generate is used to generate compilation feedback optimization data, not just code coverage data

It will rely on the toolchain library:
nuttx/libs/libc/misc/lib_utsname.c:94:(.text.uname+0x2c): undefined reference to `__gcov_indirect_call_profiler_v4'
arm-none-eabi-ld: nuttx/libs/libc/misc/lib_utsname.c:113:(.text.uname+0x178): undefined reference to `__gcov_indirect_call'
arm-none-eabi-ld: nuttx/libs/libc/misc/lib_utsname.c:113:(.text.uname+0x188): undefined reference to `__gcov_time_profiler_counter'
arm-none-eabi-ld: nuttx/staging/libc.a(lib_utsname.o):(.data..LPBX0+0x30): undefined reference to `__gcov_merge_time_profile'

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-11-22 19:08:08 +08:00
wangmingrong1
1f2d1e97e8 x86-64: Added KASan compilation options
Sorry for this commit: 6cd43777c3
This is the real x86-64 modification, and this patch is x86
Fortunately, except for the error in the previous modification, the actual architecture is supported

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-11-22 15:06:02 +08:00
simbit18
d16de91e39 [MSYS2] CMake+Ninja Fix arm-none-eabi-ar: Argument list too long
This issue is related to the Arm toolchain for Windows which is available for x86 host architecture only (compatible with x86_64)

Windows (mingw-w64-i686) hosted cross toolchains
AArch32 bare-metal target (arm-none-eabi)

Issue
/bin/sh: line 1: /home/nuttx/nuttxnew/tools/gcc-arm-none-eabi/bin/arm-none-eabi-ar: Argument list too long

On Windows, arm-none-eabi-ar can only accept strings up to a maximum length of 32,768 characters.

We could suppress the 32K include string limitation by setting the CMake variable CMAKE_NINJA_FORCE_RESPONSE_FILE to ON.

This is unfortunately not enough!!! ): In the build phase this error comes out

$ cmake --build build
[2/1025] Building ASM object arch/CMakeFiles/arch.dir/arm/src/armv7-m/arm_exception.S.obj
FAILED: arch/CMakeFiles/arch.dir/arm/src/armv7-m/arm_exception.S.obj
/home/nuttx/nuttxnew/tools/gcc-arm-none-eabi/bin/arm-none-eabi-gcc.exe @arch/CMakeFiles/arch.dir/arm/src/armv7-m/arm_exception.S.obj.rsp -MD -MT arch/CMakeFiles/arch.dir/arm/src/armv7-m/arm_exception.S.obj -MF arch/CMakeFiles/arch.dir/arm/src/armv7-m/arm_exception.S.obj.d -o arch/CMakeFiles/arch.dir/arm/src/armv7-m/arm_exception.S.obj -c /home/nuttx/nxninja/nuttx/arch/arm/src/armv7-m/arm_exception.S
C:/msys64/home/nuttx/nxninja/nuttx/arch/arm/src/armv7-m/arm_exception.S:42:10: fatal error: nuttx/config.h: No such file or directory
   42 | #include <nuttx/config.h>
      |          ^~~~~~~~~~~~~~~~
compilation terminated.

The Workround I found to solve this problem is to overwrite
the responsible file flag CMAKE_${lang}_RESPONSE_FILE_FLAG with $DEFINES $INCLUDES $FLAGS

Maybe there is a better solution but this one it works. :)
2024-11-21 19:18:38 -03:00
wangmingrong1
6cd43777c3 x86-64: Support symbol table and kasan global variables cross-border detection
1. Add kasan compilation options
2. Modify the link process to support symbol tables and kasan global variables cross-border detection

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-11-22 00:01:36 +08:00
Jouni Ukkonen
085830612c arch/arm64/imx9: Fix cntfrq_el0 to correct value
Read base frequency from system counter0 and write it
to arm core register. This corrects timers to work properly
Then enable counting.

Signed-off-by: Jouni Ukkonen <jouni.ukkonen@unikie.com>
2024-11-21 11:26:45 -03:00
guoshichao
f6cfcfa39f armv6-m: fix the incorrect stub-function entry address of svc call
the stub-function entry address is stored in r4, we should branch to the
stub-function with blx r4, not r5

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2024-11-21 20:08:42 +08:00
Peter Bee
3e6913775d fix(rp2350): should copy data before init clock
Signed-off-by: Peter Bee <peter@PeterdeMac-mini.local>
2024-11-21 20:00:17 +08:00
cuiziwei
f0e03f6c3c Unify the linking options for 32-bit and 64-bit to text-segment=0x30000000.
In order to be compatible with 32-bit and 64-bit compilation, set the text-segment to 0x30000000.

Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2024-11-21 16:13:52 +08:00
cuiziwei
feb38c43f2 sim/m64: Fix ld error.
/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-11-21 12:13:14 +08:00
stbenn
9cd0ea32ea arch/stm32h5: Add timer register hardware file
This commit adds register definitions for advanced, basic, and general purpose timers. Formatting convention was taken from the H7 hardware timer header.
2024-11-21 10:54:10 +08:00
simbit18
7df0e945ad Fix Kconfig style
Remove spaces from Kconfig files
Add TABs
Replace help => ---help---
Remove extra TABs
Add comments
2024-11-20 16:45:40 -03:00
Peter Bee
c0f776dbc3 follow upstream change & fix minor things
Signed-off-by: Peter Bee <pbjd97@gmail.com>
2024-11-20 16:32:05 -03:00
Peter Bee
48ded21e30 refine driver
Signed-off-by: Peter Bee <pbjd97@gmail.com>
2024-11-20 16:32:05 -03:00
Marco Casaroli
c5b81401d8 arch(rp23xx): add files 2024-11-20 16:32:05 -03:00
Marco Casaroli
047b832f24 rp23xx: add pico-sdk files
These files were copied from a config of pico-sdk 2.0.0.

They provide struct address mapped access to peripherals, along
with register definitions. It also provides some compiler helpers
that are partially used by the port.
2024-11-20 16:32:05 -03:00
Jouni Ukkonen
9aa9ee28cd arch/arm64/imx9/lspi: improve spi initialization
Hardware initialization is based refcount, not
spi enable bit and add interface to unitialize bus

Signed-off-by: Jouni Ukkonen <jouni.ukkonen@unikie.com>
2024-11-20 12:49:12 -03:00
Huang Qi
fb92b60000 arch/risc-v: Minor document improvement
Add function description for function prototype of `riscv_jump_to_user`
to make it easier to read, and fix some inconsistent comment style in
`riscv_internal.h`.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2024-11-20 20:40:09 +08:00
Huang Qi
3a6de58904 riscv/syscall.h: Update comment for syscall
Change RV64GC to RISC-V since this file is for all RISC-V based platform.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2024-11-20 10:50:50 +01:00
YAMAMOTO Takashi
788f8fc495 esp32s3_partition.c: Appease a compiler warning (-Wdiscarded-qualifiers) 2024-11-20 17:43:12 +08:00
Jukka Laitinen
b088369014 arch/arm64/src/imx9/imx9_lpi2c.c: Clear NACK properly on last RX byte
Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2024-11-20 17:36:00 +08:00
Jukka Laitinen
02a3437289 arch/arm64/src/imx9/imx9_lpi2c.c: Add error recovery on timeout
Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2024-11-20 17:36:00 +08:00
Jukka Laitinen
3afa58cdda arch/arm64/src/imx9/imx9_lpi2c.c: Clean up the irq handling logic
Both RX and TX interrupts can be enabled after the setup of the transfer; the TX interrupt
must be enabled after queuing the first byte as done before. It is not possible to miss the
RX interrupts, as it pends as long as the byte gets read from the FIFO

When starting the TX, the first byte can be queued instantly, it won't be sent out to the
bus if there is NACK to the address. This also prevents spurious TX interrupts in error
cases, since the TX queue is not empty after initiating a transfer.

In some error cases controller sends STOP by itself even if AUTOSTOP is disabled.
It is better to tell the controller to ABORT, which will also generate STOP only when needed.

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2024-11-20 17:36:00 +08:00
wangmingrong1
d41e3da911 Fix ALIGN_UP duplicate definition error
ALIGN_UP has been defined in nuttx.h

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-11-20 14:51:54 +08:00
Ville Juven
3146ea04b8 risc-v/up_testset: Implement test-and-set with AMOSWAP
It should be a bit more efficient to do compared to the LR/SC pair.
2024-11-20 13:27:40 +08:00
stbenn
8def1764a4 arch/stm32h5: add basic ADC support
Adds ADC support with minimal feature set (no DMA or Timers etc). A new nucleo-h563zi configuration was added to
provide easy testing with the adc example NSH addon.

Fix Kconfig spacing to tabs
2024-11-20 08:51:27 +08:00
BitBender334
bd7074460c arch/risc-v/src/mpfs/mpfs_irq.c: Default global interrupt priorities 2024-11-19 22:24:39 +08:00
liamHowatt
27e587b179 arch/esp32s3: fb add pandisplay
Signed-off-by: liamHowatt <liamjmh0@gmail.com>
2024-11-19 20:51:50 +08:00
chao an
f8ccfc3f7f arm/efm32: fix regression by PR#14810
itm syslog should use syslog_write() not up_putc()

Signed-off-by: chao an <anchao@lixiang.com>
2024-11-19 20:50:33 +08:00
chao an
c328650aa5 arm/cortex-m: itm syslog should select SYSLOG_REGISTER
Signed-off-by: chao an <anchao@lixiang.com>
2024-11-19 20:50:33 +08:00