Add support to disable signals actions related struct
Co-authored-by: guoshichao <guoshichao@xiaomi.com>
Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
Add support to disable signals actions related struct
Co-authored-by: guoshichao <guoshichao@xiaomi.com>
Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
Add support to disable signals actions related struct
Co-authored-by: guoshichao <guoshichao@xiaomi.com>
Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
Add support to disable signals actions related struct
Co-authored-by: guoshichao <guoshichao@xiaomi.com>
Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
Add support to disable signals actions related struct
Co-authored-by: guoshichao <guoshichao@xiaomi.com>
Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
Add support to disable signals actions related struct
Co-authored-by: guoshichao <guoshichao@xiaomi.com>
Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
Add support to disable signals actions related struct
Co-authored-by: guoshichao <guoshichao@xiaomi.com>
Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
Add support to disable signals actions related struct
Co-authored-by: guoshichao <guoshichao@xiaomi.com>
Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
Add support to disable signals actions related struct
Co-authored-by: guoshichao <guoshichao@xiaomi.com>
Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
Add support to disable signals actions related struct
Co-authored-by: guoshichao <guoshichao@xiaomi.com>
Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
Add support to disable signals actions related struct
Co-authored-by: guoshichao <guoshichao@xiaomi.com>
Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
Add support to disable signals actions related struct
Co-authored-by: guoshichao <guoshichao@xiaomi.com>
Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
Add support to disable signals actions related struct
Co-authored-by: guoshichao <guoshichao@xiaomi.com>
Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
Add support to disable signals actions related struct
Co-authored-by: guoshichao <guoshichao@xiaomi.com>
Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
Add support to disable signals actions related struct
Co-authored-by: guoshichao <guoshichao@xiaomi.com>
Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
Add support to disable signals actions related struct
Co-authored-by: guoshichao <guoshichao@xiaomi.com>
Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
Signals in NuttX serve two primary purposes:
1. Synchronization and wake-up:
Signals can be used to block threads on specific signal sets and later
wake them up by delivering the corresponding signals to those threads.
2. Asynchronous notification:
Signals can also be used to install callback handlers for specific signals, allowing threads to
asynchronously invoke those handlers when the signals are delivered.
This change introduces the ability to disable all signal functionality to reduce footprint for NuttX.
Signed-off-by: Chengdong Wang wangchengdong@lixiang.com
Signals in NuttX serve two primary purposes:
1. Synchronization and wake-up:
Signals can be used to block threads on specific signal sets and later
wake them up by delivering the corresponding signals to those threads.
2. Asynchronous notification:
Signals can also be used to install callback handlers for specific signals, allowing threads to
asynchronously invoke those handlers when the signals are delivered.
This change introduces the ability to partially disable signal functionality: to disable only signal functions for
Asynchronous notification, keeping functions for Synchronization and wake-up.
This enables finer-grained control over signal usage while preserving existing behavior for supported use cases.
Co-authored-by: Guo Shichao guoshichao@xiaomi.com
Signed-off-by: Chengdong Wang wangchengdong@lixiang.com
Documentation mentioned xiao-esp32c3 which is incorrect. The actual board name in the codebase is esp32c3-xiao. This commit fixes the board name in the documentation to match the directory structure.
Fix: Some STM32 chips don't support GTIM_CCER_CC1NP; use HAVE_GTIM_CCXNP guards to exclude it. Adds/updates #ifdef HAVE_GTIM_CCXNP guards so GTIM_CCER_CC1NP is only included when supported, preventing register writes on chips without it.
Signed-off-by: Alexey Matveev <tippet@yandex.ru>
Modify ARM64 architecture configuration to disable fork support in protected
build mode (BUILD_PROTECTED). Update ARCH_HAVE_FORK condition from
"!BUILD_KERNEL" to "!BUILD_KERNEL && !BUILD_PROTECTED", ensuring fork is
only available in flat/monolithic builds, not in protected kernel builds.
Signed-off-by: hujun5 <hujun5@xiaomi.com>
Replace global critical section with fine-grained spinlock protection for
signal action queue (tg_sigactionq) and signal pending queue (tg_sigpendingq).
Use spin_lock_irqsave/spin_unlock_irqrestore with group->tg_lock for proper
synchronization, reducing interrupt latency and improving SMP scalability.
Signed-off-by: hujun5 <hujun5@xiaomi.com>
After addrenv_switch(), the current running task (this_task) may change due to
deferred work execution. Update all architecture interrupt, syscall, and exit
handlers to re-fetch tcb = this_task() after addrenv_switch(). Ensures scheduler
and context operations use the correct TCB, preventing context corruption and
exceptions across SMP and memory-protected builds.
Signed-off-by: hujun5 <hujun5@xiaomi.com>
Add stack dump functionality when tasks exit, which helps with
debugging and understanding task termination conditions.
Signed-off-by: ligd <liguiding1@xiaomi.com>
In SMP mode, running tasks are in g_assignedtasks[cpu], not the
ready-to-run list, so tcb->flink is NULL. When a round-robin timeslice
expires, checking tcb->flink fails to find the next task.
Fix by calling nxsched_switch_running() directly in SMP mode when the
timeslice expires, which properly finds the next eligible task from the
ready-to-run list.
Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
Move addrenv_join() call after group_initialize() in nxtask_setup_fork() to fix
null pointer dereference. addrenv_join() accesses child->group which is
initialized by group_initialize(), so the operations must be sequenced
correctly. Reorder initialization to ensure child task group is set up before
address environment join operations.
Signed-off-by: hujun5 <hujun5@xiaomi.com>
The rwcnt (read word count) field in ctucanfd_frame_fmt_s was previously
limited to 4 bits, allowing a maximum value of 15. This is insufficient
to correctly represent the frame size (excluding the FRAME_FORMAT word)
for larger CAN FD frames as required by the CTU CAN FD hardware.
Increase the rwcnt bitfield width to support a larger range and adjust
the structure layout so that ctucanfd_frame_fmt_s has a size that is a
multiple of 4 bytes, as required by the hardware interface.
This change improves correctness and robustness when handling larger
CAN FD frames without affecting existing users.
Signed-off-by: xucheng5 <xucheng5@xiaomi.com>
This patch introduces support for generating a linker map file during
the build process for the x86_64 configuration.
Signed-off-by: xucheng5 <xucheng5@xiaomi.com>
Add REG_SCTLR_EL1 system register initialization in arm64_init_signal_process
when setting up register context for signal handlers. Initialize with current
sctlr_el1 value and apply CONFIG_ARM64_MTE settings if enabled. Fixes regression
where signal handler context was missing critical system control register setup.
Signed-off-by: hujun5 <hujun5@xiaomi.com>
Replace global enter_critical_section() with lightweight spinlock in
gethostname() and sethostname() to reduce interrupt latency while protecting
access to the shared hostname string.
Signed-off-by: hujun5 <hujun5@xiaomi.com>
Replace global critical section with mutex in environment
variable operations. Use nxrmutex_lock/unlock(&group->tg_mutex)
instead of enter/leave_critical_section() to protect
environment access, reducing interrupt latency and
improving SMP responsiveness. Clean up unused
irqstate_t flags variables in env_dup,
env_getenv, env_setenv, and env_unsetenv.
Signed-off-by: hujun5 <hujun5@xiaomi.com>
Add key management interfaces and support for generating key pairs in RSA and ECDSA cryptographic processes to the cryptodev module.
Signed-off-by: makejian <makejian@xiaomi.com>
Replace direct labels for CPU startup routines with indirection through global
variables. Export cpu1_start, cpu2_start, cpu3_start as global objects containing
addresses to __cpu1_start, __cpu2_start, __cpu3_start respectively. Use load-then-
branch-exchange (ldr r1, =cpu*_start; ldr r1, [r1]; bxeq r1) instead of direct beq
jumps. Enables flexible control of CPU startup positions and supports future AMP/
dynamic loading scenarios.
Signed-off-by: hujun5 <hujun5@xiaomi.com>
Add new CONFIG_NCPUS configuration option to support both SMP and AMP modes.
Replace SMP-specific CONFIG_SMP_NCPUS checks with generic CONFIG_NCPUS in ARM
boot code (ARMv7-A, ARMv7-R, ARMv8-R). CONFIG_NCPUS defaults to SMP_NCPUS when
SMP is enabled, or 1 otherwise, enabling multi-CPU support regardless of SMP mode.
Signed-off-by: hujun5 <hujun5@xiaomi.com>
Enable SGI (Software Generated Interrupts) usage in AMP mode for inter-core
communication. Modify arm_cpu_sgi() to use SGI_TGTFILTER_LIST for both SMP and
AMP modes instead of requiring CONFIG_SMP. Add CPU0-only guard checks using
sched_getcpu() to ensure arm_gic0_initialize() executes only once on CPU0 during
initialization in both SMP and AMP configurations.
Signed-off-by: hujun5 <hujun5@xiaomi.com>
We need IFF_IS_RUNNING(dev->d_flags) to be true for ethernet device to
work properly. However, dev->d_flags are not set anywhere in the
Kinetis' ethernet code.
This change updates kinetis_ifup and kinetis_ifdown procedures to call
netdev_carrier_on and netdev_carrier_off to set dev->d_flags.
Signed-off-by: Jiri Vlasak <jvlasak@elektroline.cz>
CC: mm_heap/mm_mallinfo.c chip/bcm2711_serial.c: In function 'bcm2711_miniuart_attach':
chip/bcm2711_serial.c:571:3: error: implicit declaration of function 'up_prioritize_irq' [-Werror=implicit-function-declaration]
571 | up_prioritize_irq(BCM_IRQ_VC_AUX, 0);
| ^~~~~~~~~~~~~~~~~
CC: mm_heap/mm_memalign.c chip/bcm2711_gpio.c: In function 'bcm2711_gpio_irqs_init':
chip/bcm2711_gpio.c:275:7: error: implicit declaration of function 'up_prioritize_irq' [-Werror=implicit-function-declaration]
275 | up_prioritize_irq(g_gpio_irqs[i], 0);
| ^~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
Signed-off-by: ligd <liguiding1@xiaomi.com>
Use regs[REG_SP_EL0] from register context instead of direct sp_el0 system
register read/write operations in arm64_syscall(). Replace read_sysreg(sp_el0)
with regs[REG_SP_EL0] and write_sysreg(usp, sp_el0) with direct assignment to
regs[REG_SP_EL0]. Ensures userspace stack pointer is correctly maintained from
register context during signal delivery, preventing userspace SP corruption on
syscall return.
Signed-off-by: hujun5 <hujun5@xiaomi.com>
Update the can_sendmsg() signature from "struct msghdr *msg" to
"const struct msghdr *msg" to match the updated sendmsg() prototype
and resolve compilation errors due to parameter type inconsistency.
Signed-off-by: guoshichao <guoshichao@xiaomi.com>
To ensure consistency, in all places where the "sendmsg" function is used
either directly or indirectly, the type of the "struct msghdr *msg" parameter
needs to be modified to "const struct msghdr *msg".
Signed-off-by: guoshichao <guoshichao@xiaomi.com>
Since the directory structure of the examples/elf project
has been reorganized, the corresponding ROMFS_IMAGEFILE path
also needs to be adjusted.
Signed-off-by: guoshichao <guoshichao@xiaomi.com>
We have added a defconfig configuration to set the page size of the flash.
According to the CFI protocol, the flash supports a single write operation
with a data volume ranging from byte size up to the maximum number of bytes.
However, the MTD device structure requires defining a page size, which serves
as the minimum write unit of the flash. Hence, this configuration is introduced.
Any page size within the range of 1 to the maximum number of bytes is considered
valid.
Signed-off-by: jingfei <jingfei@xiaomi.com>
Convert g_mpu_region from single-CPU global variable to per-CPU array indexed
by this_cpu(). Change declaration from "unsigned int g_mpu_region" to
"unsigned int g_mpu_region[CONFIG_SMP_NCPUS]". Update all accesses in
mpu_allocregion(), mpu_freeregion(), and mpu_modify_region() to use
g_mpu_region[this_cpu()] for proper per-CPU MPU region tracking in multi-core
configurations.
Signed-off-by: hujun5 <hujun5@xiaomi.com>
Add FIQ bit (DAIF_FIQ_BIT) initialization to SPSR register when creating new
ARM64 tasks. By default, FIQ interrupts are masked unless CONFIG_ARM64_DECODEFIQ
is enabled. Ensures consistent FIQ masking behavior across all task contexts.
Signed-off-by: hujun5 <hujun5@xiaomi.com>