Commit graph

58997 commits

Author SHA1 Message Date
Côme VINCENT
bebcfa0f46 docs(h743zi/capture): add capture driver docs
Add documentation for changes made in #16809.
Add an example defconfig for a nsh build with the capture example.
Replace the STM32H7_CAP option with just CAPTURE as the guard for the
lower half driver.

Signed-off-by: Côme VINCENT <44554692+comejv@users.noreply.github.com>
2025-08-14 20:46:37 +08:00
Niccolò Maggioni
7ea3f8e333 arch/arm/rp2040: Support non-sequential ADC channels and standardize internal function names
Enabling a higher channel of the internal ADC had the effect of
initializing the lower ones as well. Now that happens only if
actively requested.

Also, the functions for handling the internal ADC did not follow
the typical naming used by comparable modules for the same arch
and were renamed for coherence. Informational logging calls were
also made slightly more useful and discernible in case of having
multiple ADCs.

Signed-off-by: Niccolò Maggioni <nicco.maggioni+nuttx@gmail.com>
2025-08-13 23:23:17 +08:00
Niccolò Maggioni
fa9f771a0f arch/arm/rp2040: Implement GPIO output override functionality
Add support for the RP2040's GPIO output override capabilities.
Implementation inspired by the uniqueid functions for the same arch.

Signed-off-by: Niccolò Maggioni <nicco.maggioni+nuttx@gmail.com>
2025-08-13 23:21:35 +08:00
Jukka Laitinen
8a157d7514 arch/arm64_schedulesigaction.c: Fix signal delivery in EL1 when MMU is enabled
When delivering a signal to a kernel task, or in CONFIG_BUILD_FLAT with MMU
enabled, the REG_SCTLR_EL1 needs to be stored for exception return.

Otherwise 0 is restored to the register at exception return, MMU is switched off
and the  system crashes.

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
2025-08-13 23:12:30 +08:00
Niccolò Maggioni
83dd57a488 crypto/hmac: Fix typo in function implementation names
"hmac" was mistyped as "hmca", breaking linking to some prototype
functions. Also, a couple of includes were missing.

Signed-off-by: Niccolò Maggioni <nicco.maggioni+nuttx@gmail.com>
2025-08-13 23:11:02 +08:00
Ari Kimari
6f38806a5d arch/arm64/imx9: Fix first trace
Swap board init and uart init.
Reason is that trace might be used on board init.

Signed-off-by: Ari Kimari <ari.kimari@tii.ae>
2025-08-13 10:59:46 -03:00
Niccolò Maggioni
1dfe1f16c6 arch/arm/rp2040: Fix Kconfig ADC options names
The string "RPC2040", presumably a typo, was used in place of "RP2040".

Signed-off-by: Niccolò Maggioni <nicco.maggioni+nuttx@gmail.com>
2025-08-13 13:18:32 +02:00
Niccolò Maggioni
be71e3d019 arch/arm/rp2040: Fix typos in ADC and GPIO macros usage
The strings "RPC2040" and "RP2040_IO_BANK0_GPIO0", presumably typos,
were used in place of respectively "RP2040" and "RP2040_IO_BANK0_GPIO".

Signed-off-by: Niccolò Maggioni <nicco.maggioni+nuttx@gmail.com>
2025-08-13 13:18:32 +02:00
Andrew Scheller
3c313a316b Documentation/platforms: RP2350 doesn't contain an RTC.
Signed-off-by: Andrew Scheller <andrew.scheller@raspberrypi.com>
2025-08-13 01:47:49 +08:00
Andrew Scheller
c46282bb6c Documentation/platforms: RP2040, RP2350 and Pico products are made by Raspberry Pi, not Raspberry Pi Foundation.
Signed-off-by: Andrew Scheller <andrew.scheller@raspberrypi.com>
2025-08-13 01:47:49 +08:00
Côme
25fe6b0749 Update capture.c 2025-08-12 20:21:14 +08:00
Côme VINCENT
a4b17a2d14 arch/stm32h7: Fix timer capture
This patch fixes an incorrect call to stm32_cap_initialize() in
stm32_bringup.c: the call was made without the channel parameter.
Instead of adding the channel in the call, the channel is selected by
stm32_cap_gpio() (first available channel).

This patch also fixes incorrect driver registration in
drivers/timers/capture.c: the driver was registered with the wrong
name (/dev/cap -> /dev/capture). Also added more error checking in
cap_register_multiple().

Signed-off-by: Côme VINCENT <44554692+comejv@users.noreply.github.com>
2025-08-12 20:21:14 +08:00
Zhe Weng
e33a4c71b3 board/arm/qemu: Change config name of input tool
Change config name of input tool after moving it to apps/graphics

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2025-08-12 20:20:24 +08:00
Côme VINCENT
bd90132cd6 tools/nix: split flake into root and Documentation
Root flake now only contains dependencies needed for building the NuttX
firmware. The Documentation flake contains the dependencies needed for
running `make html`.

Updated the documentation accordingly.

Signed-off-by: Côme VINCENT <44554692+comejv@users.noreply.github.com>
2025-08-12 20:17:23 +08:00
Zhe Weng
61c8240458 fs/lock: Allow driver lock
Sometimes we need to flock a driver node, which we can support easily.

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2025-08-12 20:17:06 +08:00
lipengfei28
5bba78ef85 arch/arm64: imx9 add pci dma space and pci outbound space
pci dma space used for pci inbound addr
pci outbound and outbound space need create page table

Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2025-08-11 23:24:04 +08:00
dependabot[bot]
0dc5e670a4 build(deps): bump actions/download-artifact from 4 to 5
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 4 to 5.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-11 08:39:04 -03:00
Alan Carvalho de Assis
92db85fecf boards/imxrt/arcx-socket-grid: Remove debug symbols
Remove the debug symbols from "usbdisk" board profile and change
the optimization level from "-Os" to "-O2" to fix ehci error.

Signed-off-by: Alan C. Assis <acassis@gmail.com>
2025-08-11 09:42:13 +08:00
Serg Podtynnyi
2e7f75f6e0 arch/risc-v/rp23xx-riscv: Add rp23xx RISC-V cores support (Hazard3)
Chip name   : rp23xx-rv
Board name  : raspberrypi-pico-2-rv
Arch        : risc-v

Changes from ARM rp23xx impl

- Linker script update
- ASM head start
- Update chip start
- New Hazard3 registers
- Remove rp23xx chip hw spinlocks/testset
- New irq handling (external IRQ interrupt Hazard3)
- New timerisr based on RISC-V std MTIME and alarm arch
- No SMP yet
- Tickless option
- Double size for idle, irq and main stacks
- Board reset via watchdog trigger

Signed-off-by: Serg Podtynnyi <serg@podtynnyi.com>
2025-08-11 08:56:27 +08:00
Alan Carvalho de Assis
d218334baa boards/arcx-socket-grid: Add support to USBHOST and USBDISK
This PR add support to USBHOST on iMXRT1052 ARCX-Socket-Grid board
and add a USBDISK board config example.

Signed-off-by: Alan C. Assis <acassis@gmail.com>
2025-08-09 17:12:48 -03:00
Alan Carvalho de Assis
33e25738e5 arch/imxrt: Removed not defined imxrtimxrt_virtramaddr_async_setup
This function prototype was defined as static but the function
never was created or used.

Signed-off-by: Alan C. Assis <acassis@gmail.com>
2025-08-09 17:12:48 -03:00
Alan Carvalho de Assis
732a31c2bf arch/arm/imxrt: Fix incorrect symbol on imxtrt_ehci
Signed-off-by: Alan C. Assis <acassis@gmail.com>
2025-08-09 17:12:48 -03:00
Alan Carvalho de Assis
e26936b262 arch/arm/imxrt: Fix missing symbols on Kconfig
Signed-off-by: Alan C. Assis <acassis@gmail.com>
2025-08-09 17:12:48 -03:00
Matteo Golin
41eaa50a58 drivers/sensors/lis2mdl: Increase buffer size
The ODR of this sensor is too high to have a buffer size of 1.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2025-08-08 14:50:19 -04:00
Matteo Golin
7d9d59f069 drivers/sensors/lsm6dso32: Increase buffer size
The ODR of this device is too high to only have a buffer size of 1.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2025-08-08 14:50:19 -04:00
Matteo Golin
4845eadaa9 drivers/l86xxx: Mutex fixes & performance improvements
Fix mutex locking bugs and improve performance. Fix interval no longer
set statically since it is available via `set_interval` uORB function.
Activation/deactivation no longer triggers standby/hotstart since this
functionality was very unstable.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2025-08-08 14:49:49 -04:00
kywwilson11
821b067a60 arch/arm/stm32h5: Fix STM32H5 FDCAN Driver and Add Test Files
Primary Changes
1. Add Kconfig options to select FDCAN1 and FDCAN2.
2. Fix Make.defs to use CONFIG_STM32H5_FDCAN_CHARDRIVER
3. Add FDCAN clock seleection code to stm32h5xx_rcc.c
4. Add fdcan1 config for nucleo-h563zi board.
5. Add FDCAN clock configuration and GPIOs to nucleo-h563zi board.h.
6. Added supporting code (stm32_can.c, stm32_bringup.c changes)
   for fdcan1 config.

Changed can device to start at 0. FDCAN1  = /dev/can0, FDCAN2 = /dev/can1. Enable FDCAN mode for nucleo-h563zi:fdcan1 config.

Removed ampersand from comment block
2025-08-08 19:50:28 +02:00
Matteo Golin
28cd98c561 docs/littlefs: Improve documentation about littelfs on NuttX
Describes some of the quirks of using littlefs on NuttX and links to an
issue discussing the sync semantics.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2025-08-08 02:09:18 +08:00
Jukka Laitinen
2fa607796d include/nuttx/atomic.h: Fix C++ compilation with -nostdinc++
Without c++ standard includes, the <atomic> library is not available.
GCC may use __auto_type for the C-style atomic oprations, and this
is not available for C++. Just define the __auto_type to auto for C++.

Also, the built-in _atomic functions for GCC expect "volatile" parameters
in C, but don't allow that in C++. So selecting the atomic_t and atomic64_t
types according to that.

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
2025-08-08 01:09:34 +08:00
Côme VINCENT
2771df6250 arch/arm/stm32h7: Port timer capture driver from stm32
This commit introduces a timer capture driver for the STM32H7 series
ported from the STM32 F series.

The main changes include:
- A new generic timer capture driver for STM32H7.
- A lower-half driver to integrate with the NuttX capture subsystem.
- Kconfig options to enable and configure capture for various timers.
- Pin definitions for TIM1-4 capture inputs on the nucleo-h743zi.
- An update to `cap_register_multiple` to handle multiple device registration.
- An update to `stm32_bringup` to register the capture drivers.

The current implementation is based on a driver originally for PWM input,
and as such, it calculates duty cycle and frequency. It is also limited
to a single capture channel per timer.

The original implementation's `stm32_cap_init` in
`arch/arm/src/stm32h7/stm32_capture.c` has been modified to accept a
channel number instead of using a hardcoded 0 through
`STM32_CAP_CHANNEL_COUNTER`.

This serves as a foundation for future development of more comprehensive
input capture capabilities on STM32H7 platforms.

Tested by polling and reading `/dev/cap0-4` with
`ioctl(fds[i], CAPIOC_FREQUENCE, freq)` while sending a square wave signal to
appropriate pins and checking frequency.

Also tested by bypassing upper half driver and setting up capture on
TIM4 channels 1-4 as explained in #16762.

Signed-off-by: Côme VINCENT <44554692+comejv@users.noreply.github.com>
2025-08-07 10:46:39 -03:00
Michal Lenc
1c1b814a9a drivers/syslog/syslog_channel.c: fix incompatible-pointer-types compile errors
Use typedef syslog_channel_t instead of struct syslog_channel_s.

CC:  dirent/lib_telldir.c syslog/syslog_channel.c:151:3: error: initialization of ‘int (*)(const syslog_channel_t *, int)’ {aka ‘int (*)(const struct syslog_channel_s *, int)’} from incompatible pointer type ‘int (*)(struct syslog_channel_s *, int)’ [-Wincompatible-pointer-types]
  151 |   syslog_cdcacm_putc,
      |   ^~~~~~~~~~~~~~~~~~
syslog/syslog_channel.c:151:3: note: (near initialization for ‘g_cdcacm_channel_ops.sc_putc’)
syslog/syslog_channel.c:152:3: error: initialization of ‘int (*)(const syslog_channel_t *, int)’ {aka ‘int (*)(const struct syslog_channel_s *, int)’} from incompatible pointer type ‘int (*)(struct syslog_channel_s *, int)’ [-Wincompatible-pointer-types]
  152 |   syslog_cdcacm_putc,
      |   ^~~~~~~~~~~~~~~~~~
syslog/syslog_channel.c:152:3: note: (near initialization for ‘g_cdcacm_channel_ops.sc_force’)
syslog/syslog_channel.c:154:3: error: initialization of ‘ssize_t (*)(const syslog_channel_t *, const char *, size_t)’ {aka ‘int (*)(const struct syslog_channel_s *, const char *, unsigned int)’} from incompatible pointer type ‘ssize_t (*)(struct syslog_channel_s *, const char *, size_t)’ {aka ‘int (*)(struct syslog_channel_s *, const char *, unsigned int)’} [-Wincompatible-pointer-types]
  154 |   syslog_cdcacm_write,
      |   ^~~~~~~~~~~~~~~~~~~
syslog/syslog_channel.c:154:3: note: (near initialization for ‘g_cdcacm_channel_ops.sc_write’)
syslog/syslog_channel.c:155:3: error: initialization of ‘ssize_t (*)(const syslog_channel_t *, const char *, size_t)’ {aka ‘int (*)(const struct syslog_channel_s *, const char *, unsigned int)’} from incompatible pointer type ‘ssize_t (*)(struct syslog_channel_s *, const char *, size_t)’ {aka ‘int (*)(struct syslog_channel_s *, const char *, unsigned int)’} [-Wincompatible-pointer-types]
  155 |   syslog_cdcacm_write
      |   ^~~~~~~~~~~~~~~~~~~
syslog/syslog_channel.c:155:3: note: (near initialization for ‘g_cdcacm_channel_ops.sc_write_force’)
syslog/syslog_channel.c:243:3: warning: excess elements in array initializer
  243 |   &g_cdcacm_channel
      |   ^
syslog/syslog_channel.c:243:3: note: (near initialization for ‘g_syslog_channel’)

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2025-08-07 10:16:20 -03:00
Matteo Golin
c152f178f9 docs/unity: Improved documentation for using Unity testing framework
The documentation for using the Unity testing framework previously just
linked to the official Unity website. In using Unity, I noticed there
were much more extensive docs on the actual GitHub page. This PR
includes references to those docs and also provides a short-winded
explanation of how to make a Unity test suite on NuttX.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2025-08-07 16:11:29 +08:00
Matteo Golin
ddd8d81874 docs/gnss_lowerhalf: Documentation for the lower-half GNSS uORB driver
The GNSS lower-half driver for facilitating the implementation of uORB
GPS/GNSS device drivers was lacking documentation. Contributors cannot
be expected to implement their drivers correctly with this framework if
it is undocumented. This change adds documentation for how to use the
lower-half GNSS driver, provides an example and also adds a notice for
users to use this framework if implementing their own GNSS driver.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2025-08-06 16:28:57 +02:00
Theodore Karatapanis
9970e6a54e drivers/misc/optee: Add error conversion from errno to TEE errors
This commit simplifies sending errors back to OP-TEE and avoids
code duplication when handling errno values.

Signed-off-by: Theodore Karatapanis <tkaratapanis@census-labs.com>
2025-08-06 02:29:33 +08:00
Theodore Karatapanis
707cdaf42e drivers/misc/optee: Expanded RPC support.
This commit expands RPC support for the OP-TEE driver using 2 files:
1) drivers/misc/optee_rpc.c
   * Add support for RPCs that can be handled directly by the kernel.
   * Can delegate RPC handling to optee_supplicant.c for RPCs that
     need userspace interaction.
2) drivers/misc/optee_supplicant.c
   * Enable communication between the userspace TEE supplicant and the
     kernel driver.

Additional changes were needed to the following files:
1) drivers/misc/optee.c
   * Add ioctls used SOLELY by the userspace TEE supplicant.
   * Register /dev/teepriv0 if the supplicant is enabled in Kconfig
   * Add OPTEE_ROLE_CA and OPTEE_ROLE_SUPPLICANT conditionals to
     differentiate paths, between a normal Client Application (CA)
     and the TEE supplicant.
   * Change some functions from static to "public" to reuse them
     in other C files.
   * Adjust optee_to/from_msg_param() to work with RPCs.

2) drivers/misc/optee_smc.c
   * Call the RPC handler from optee_rpc.c

3) drivers/misc/optee_msg.h
   * Add definition needed for RPCs

4) drivers/misc/tee.h
   * Add ioctl definitions
   * Add TEE_SHM_SUPP flag, checked when unregistering supplicant
     memory.

5) Documentation/guides/optee.rs
   * Add documentation for RPCs and the supplicant.

6) drivers/misc/{CMakeLists.txt, Make.defs}
   * Account for the new files.

7) drivers/misc/Kconfig
   * Add DEV_OPTEE_SUPPLICANT option to enable/disable the supplicant
     driver.

Signed-off-by: Theodore Karatapanis <tkaratapanis@census-labs.com>
2025-08-06 02:29:33 +08:00
Theodore Karatapanis
95ca3e7ca5 drivers/misc/optee: Add mmap shm op + remove memfd
The previous approach with memfd has 3 problems:
1) The close operation on the memfd isn't tied with optee_shm_close,
   therefore close(fd) doesn't free the optee_shm struct allocated
   by the kernel.

2) The kernel unnecessarily maps the file descriptor to its memory,
   however only userspace should need to do that.

3) Since the kernel doesn't need to map the file descriptor we
   don't need to unmap it.

To use anonymous mapping, the prototype of map_anonymous() was
moved from fs/mmap/fs_anonmap.h to include/nuttx/fs/fs.h. Since
fs_anonmap.h didn't contain any other information it is deleted.

A type from fs/mmap/fs_rammap.h was moved to the public :
include/nuttx/fs/fs.h as well.

Signed-off-by: Theodore Karatapanis <tkaratapanis@census-labs.com>
2025-08-06 02:29:33 +08:00
Theodore Karatapanis
cbdd3ac39b drivers/misc/optee: Add virtual and physical address to sturct optee_shm
The VA -> PA translation must be performed once, at allocation time,
while the caller's virtual address space is known. If a second process
later tries to translate the same VA from a different mapping, the
calculated physical address can be wrong.

Signed-off-by: Theodore Karatapanis <tkaratapanis@census-labs.com>
2025-08-06 02:29:33 +08:00
nuttxs
7b3913da60 libs/libc/netdb: Optimize the timeout calculation logic:
1. Adopt an exponential backoff strategy () to dynamically adjust the timeout
   duration, which is suitable for retry scenarios.
2. Optimize the default configuration to set the initial timeout to 5 seconds.
3. Support dynamic modification of the maximum timeout limit to adapt
   to different scenarios.
Reference: RFC 1536 (section on retransmission implementation recommendations)

Signed-off-by: nuttxs <zhaoqing.zhang@sony.com>
2025-08-06 01:58:05 +08:00
Laczen JMS
c506c25f19 drivers/mtd: introduce nvblk
NVBLK provides a block device that operates on top of a non volatile
memory (as a mtd device) that enables wear levelling for non volatile
memory. It's operation is similar to the dhara wear levelling library,
but nvblk is meant to be used on smaller (nor, mram, rram) memory.

I am also the author and maintainer of the nvblk library.

A block device can be created during startup by using:
```
nvblk_initialize(0, mtd, CONFIG_MTD_NVBLK_DEFAULT_LBS,
                         CONFIG_MTD_NVBLK_DEFAULT_IOBS,
                         CONFIG_MTD_NVBLK_DEFAULT_SPEB);
```
and a fat filesystem on top of this as:
```
nsh> mkfatfs /dev/mtdblock0
nsh> mount -t vfat /dev/mtdblock0 /mnt
```
this fat filesystem can then be used:
```
nsh> echo "test" > /mnt/test.txt
nsh> cat test.txt
test
nsh>
```

Signed-off-by: Laczen JMS <laczenjms@gmail.com>
2025-08-06 01:53:56 +08:00
Eren Terzioglu
1c0e1698cd bugix/risc-v/esp32c6: Fix build error of LP_I2C
Fix build error of LP_I2C for esp32c6

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2025-08-05 08:00:12 -03:00
Konstantin Tyurin
85923c1797 arch/arm/stm32f0l0g0/: Fix I2C IRQ numbers
This patch sets a correct interrupt vector number
for each I2C controller.

Signed-off-by: Konstantin Tyurin <konstantin@pluraf.com>
2025-08-05 12:18:14 +02:00
Jukka Laitinen
9cda3ce216 arch/*/*_sigdeliver.c: Fix a race condition is signal delivery for SMP
This fixes the same issue for other targets, which was already fixed for
xtensa in commit 50d94863.

After the signals have been delivered, the local irqs need to be
disabled until the context switch. But just calling
leave_critical_section(regs[xx]) will enable them if they were
enabled in the context.

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
2025-08-04 21:11:13 +08:00
George Poulios
ddf74ae059 boards/imx93-evk: Add a flat build config with OP-TEE
Mostly for CI purposes to validate OP-TEE changes
against a flat build. It has not been runtime-tested
with any specific setup involving an actual OP-TEE.

Signed-off-by: George Poulios <gpoulios@census-labs.com>
2025-08-03 13:00:47 -03:00
George Poulios
c78e5b983a drivers/misc/optee_smc: Fix sched_yield() on flat builds
Previous change that introduced yielding upon OP-TEE
return with reason foreign interrupt, omitted to include
<sched.h>. This worked on kernel builds, but not on flat
builds. Include it.

Signed-off-by: George Poulios <gpoulios@census-labs.com>
2025-08-03 13:00:47 -03:00
wangjianyu3
8c32bed29e drivers/sensors/gnss: Skip copying extended satellite flags
The extended member `flags` of `info` of `struct sensor_gnss_satellite` is not parsed from GSV.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-08-03 10:41:06 +08:00
wangjianyu3
508418917e drivers/sensor: Add flags for GNSS satellite
Some applications require satellite information for positioning using the flag USED_IN_FIX.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-08-03 10:41:06 +08:00
kywwilson11
163bf0a906 arch/arm/stm32h5: Use double-buffer for ADC DMA in Circular Mode
Clear dma interrupt flags as before.

Change HTEF to HTF, fixes typo.

Remove ALL_FLAGS define. Clear CXFCR with all 1s like other instances do.

Handle half-transfer interrupt only if in circular mode.

Add ADC_HAVE_DMA guard around adc_rstart_dma. It is needed because priv->circular is guarded by ADC_HAVE_DMA.
2025-08-01 22:57:31 +08:00
lipengfei28
4fa6d4b791 drivers/pci: epc add dma heap
The PCI inbound address space and the CPU cache need to maintain cache coherence

Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2025-08-01 20:47:43 +08:00
Jukka Laitinen
50d94863f2 arch/xtensa: Fix a race condition in xtensa_sig_deliver for SMP
After the signals have been delivered, the local irqs need to be
disabled until the context switch. But just calling
leave_critical_section(regs[REG_PS]) will enable them if they were
enabled in the context.

Any interrupt on this cpu before xtensa_context_restore() would set
the rtcb->xcp.regs to NULL, causing a crash in context restore.

Fix this by calling leave_critical_section(up_irq_save()) instead.

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
2025-08-01 08:54:39 -03:00
Shanmin Zhang
73cf02d63a Revert "libs/libc/stdlib/lib_exit.c: fix multiple definition of __dso_handle in msys2"
This reverts commit 8f96e59aee.

The implementation of __dso_handle is independent of the HOST OS but dependent on the specific compiler.
Therefore, this patch will cause compilation failures for other cross-compilers on the Windows platform, such as arm-none-eabi-gcc and aarch64-none-elf-gcc.
Constraints should be applied to compiler target rather than compiler host.
2025-07-31 22:10:36 +08:00