From d404144f928f02cb6882c6f10e12b147965c97d9 Mon Sep 17 00:00:00 2001 From: wangchengdong Date: Sun, 11 Jan 2026 20:44:45 +0800 Subject: [PATCH 01/19] sched/signal: Add support for partially disabling signals 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 --- drivers/syslog/syslog_write.c | 5 +++- include/nuttx/arch.h | 6 ++-- include/nuttx/sched.h | 14 +++++----- include/nuttx/userspace.h | 2 ++ include/sys/syscall_lookup.h | 2 ++ libs/libc/libc.csv | 2 +- libs/libc/signal/CMakeLists.txt | 49 +++++++++++++++++---------------- libs/libc/signal/Make.defs | 10 +++++-- sched/Kconfig | 33 ++++++++++++++++++++++ sched/group/group_leave.c | 2 ++ sched/group/group_signal.c | 4 +++ sched/init/nx_start.c | 2 ++ sched/signal/CMakeLists.txt | 28 +++++++++++-------- sched/signal/Make.defs | 19 +++++++------ sched/signal/sig_dispatch.c | 27 +++++++++++++----- sched/signal/sig_procmask.c | 2 ++ sched/signal/sig_timedwait.c | 4 +++ sched/signal/signal.h | 6 ++++ sched/task/task_exithook.c | 2 ++ sched/task/task_restart.c | 2 ++ syscall/syscall.csv | 6 ++-- 21 files changed, 159 insertions(+), 68 deletions(-) diff --git a/drivers/syslog/syslog_write.c b/drivers/syslog/syslog_write.c index 889086c1b6672..8b3fefda709e8 100644 --- a/drivers/syslog/syslog_write.c +++ b/drivers/syslog/syslog_write.c @@ -56,8 +56,9 @@ static bool syslog_safe_to_block(void) { +#ifdef CONFIG_ENABLE_ALL_SIGNALS FAR const struct tcb_s *rtcb; - +#endif /* It's not safe to block in interrupts or when executing the idle loop */ if (up_interrupt_context() || sched_idletask()) @@ -67,11 +68,13 @@ static bool syslog_safe_to_block(void) /* It's not safe to block if a signal is being delivered */ +#ifdef CONFIG_ENABLE_ALL_SIGNALS rtcb = nxsched_self(); if (rtcb->sigdeliver != NULL) { return false; } +#endif return true; } diff --git a/include/nuttx/arch.h b/include/nuttx/arch.h index 7f5d39a7bab21..67b0d1d49944b 100644 --- a/include/nuttx/arch.h +++ b/include/nuttx/arch.h @@ -609,8 +609,9 @@ int up_backtrace(FAR struct tcb_s *tcb, * handler now. * ****************************************************************************/ - +#ifdef CONFIG_ENABLE_ALL_SIGNALS void up_schedule_sigaction(FAR struct tcb_s *tcb); +#endif /**************************************************************************** * Name: up_task_start @@ -702,7 +703,8 @@ void up_pthread_start(pthread_trampoline_t startup, * ****************************************************************************/ -#if !defined(CONFIG_BUILD_FLAT) && defined(__KERNEL__) +#if !defined(CONFIG_BUILD_FLAT) && defined(__KERNEL__) && \ + defined(CONFIG_ENABLE_ALL_SIGNALS) void up_signal_dispatch(_sa_sigaction_t sighand, int signo, FAR siginfo_t *info, FAR void *ucontext); #endif diff --git a/include/nuttx/sched.h b/include/nuttx/sched.h index facbff4d5c4f2..10766b1a4f6e2 100644 --- a/include/nuttx/sched.h +++ b/include/nuttx/sched.h @@ -514,8 +514,10 @@ struct task_group_s /* POSIX Signal Control Fields ********************************************/ +#ifdef CONFIG_ENABLE_ALL_SIGNALS sq_queue_t tg_sigactionq; /* List of actions for signals */ sq_queue_t tg_sigpendingq; /* List of pending signals */ +#endif /* CONFIG_ENABLE_ALL_SIGNALS */ #ifdef CONFIG_SIG_DEFAULT sigset_t tg_sigdefault; /* Set of signals set to the default action */ #endif @@ -660,10 +662,13 @@ struct tcb_s /* POSIX Signal Control Fields ********************************************/ - sigset_t sigprocmask; /* Signals that are blocked */ - sigset_t sigwaitmask; /* Waiting for pending signals */ +#ifdef CONFIG_ENABLE_ALL_SIGNALS + sig_deliver_t sigdeliver; sq_queue_t sigpendactionq; /* List of pending signal actions */ sq_queue_t sigpostedq; /* List of posted signals */ +#endif /* CONFIG_ENABLE_ALL_SIGNALS*/ + sigset_t sigprocmask; /* Signals that are blocked */ + sigset_t sigwaitmask; /* Waiting for pending signals */ siginfo_t *sigunbinfo; /* Signal info when task unblocked */ /* Robust mutex support ***************************************************/ @@ -707,11 +712,6 @@ struct tcb_s struct xcptcontext xcp; /* Interrupt register save area */ - /* The following function pointer is non-zero if there are pending signals - * to be processed. - */ - - sig_deliver_t sigdeliver; #if CONFIG_TASK_NAME_SIZE > 0 char name[CONFIG_TASK_NAME_SIZE + 1]; /* Task name (with NUL terminator) */ #endif diff --git a/include/nuttx/userspace.h b/include/nuttx/userspace.h index 2166c89e680e8..98ecd35aca0fe 100644 --- a/include/nuttx/userspace.h +++ b/include/nuttx/userspace.h @@ -106,8 +106,10 @@ struct userspace_s /* Signal handler trampoline */ +#ifdef CONFIG_ENABLE_ALL_SIGNALS CODE void (*signal_handler)(_sa_sigaction_t sighand, int signo, FAR siginfo_t *info, FAR void *ucontext); +#endif /* User-space work queue support */ diff --git a/include/sys/syscall_lookup.h b/include/sys/syscall_lookup.h index dd42e41b795f5..2d497b9e1c661 100644 --- a/include/sys/syscall_lookup.h +++ b/include/sys/syscall_lookup.h @@ -154,8 +154,10 @@ SYSCALL_LOOKUP(nxsem_wait_slow, 1) SYSCALL_LOOKUP(kill, 2) SYSCALL_LOOKUP(tgkill, 3) +#ifdef CONFIG_ENABLE_ALL_SIGNALS SYSCALL_LOOKUP(sigaction, 3) SYSCALL_LOOKUP(sigpending, 1) +#endif SYSCALL_LOOKUP(sigprocmask, 3) SYSCALL_LOOKUP(sigqueue, 3) SYSCALL_LOOKUP(sigsuspend, 1) diff --git a/libs/libc/libc.csv b/libs/libc/libc.csv index 8aaf50630f59a..c3c0551521a8d 100644 --- a/libs/libc/libc.csv +++ b/libs/libc/libc.csv @@ -274,7 +274,7 @@ "sigemptyset","signal.h","","int","FAR sigset_t *" "sigfillset","signal.h","","int","FAR sigset_t *" "sigismember","signal.h","","int","FAR const sigset_t *","int" -"signal","signal.h","","_sa_handler_t","int","_sa_handler_t" +"signal","signal.h","defined(CONFIG_ENABLE_ALL_SIGNALS)","_sa_handler_t","int","_sa_handler_t" "sleep","unistd.h","","unsigned int","unsigned int" "snprintf","stdio.h","","int","FAR char *","size_t","FAR const IPTR char *","..." "sprintf","stdio.h","","int","FAR char *","FAR const IPTR char *","..." diff --git a/libs/libc/signal/CMakeLists.txt b/libs/libc/signal/CMakeLists.txt index 00ccefdda7a9f..14ef7372aaadc 100644 --- a/libs/libc/signal/CMakeLists.txt +++ b/libs/libc/signal/CMakeLists.txt @@ -20,27 +20,28 @@ # # ############################################################################## -target_sources( - c - PRIVATE sig_addset.c - sig_delset.c - sig_emptyset.c - sig_fillset.c - sig_nandset.c - sig_andset.c - sig_orset.c - sig_xorset.c - sig_isemptyset.c - sig_killpg.c - sig_altstack.c - sig_interrupt.c - sig_hold.c - sig_ignore.c - sig_ismember.c - sig_pause.c - sig_psignal.c - sig_raise.c - sig_relse.c - sig_set.c - sig_signal.c - sig_wait.c) +set(SRCS + sig_addset.c + sig_delset.c + sig_emptyset.c + sig_fillset.c + sig_nandset.c + sig_andset.c + sig_orset.c + sig_xorset.c + sig_isemptyset.c + sig_killpg.c + sig_altstack.c + sig_hold.c + sig_ismember.c + sig_pause.c + sig_psignal.c + sig_raise.c + sig_relse.c + sig_wait.c) + +if(CONFIG_ENABLE_ALL_SIGNALS) + list(APPEND SRCS sig_ignore.c sig_interrupt.c sig_set.c sig_signal.c) +endif() + +target_sources(c PRIVATE ${SRCS}) diff --git a/libs/libc/signal/Make.defs b/libs/libc/signal/Make.defs index 7d42a239add7b..cd20f64b10997 100644 --- a/libs/libc/signal/Make.defs +++ b/libs/libc/signal/Make.defs @@ -24,9 +24,13 @@ CSRCS += sig_addset.c sig_delset.c sig_emptyset.c sig_fillset.c CSRCS += sig_nandset.c sig_andset.c sig_orset.c sig_xorset.c -CSRCS += sig_isemptyset.c sig_killpg.c sig_altstack.c sig_interrupt.c -CSRCS += sig_hold.c sig_ignore.c sig_ismember.c sig_pause.c sig_psignal.c -CSRCS += sig_raise.c sig_relse.c sig_set.c sig_signal.c sig_wait.c +CSRCS += sig_isemptyset.c sig_killpg.c sig_altstack.c +CSRCS += sig_hold.c sig_ismember.c sig_pause.c sig_psignal.c +CSRCS += sig_raise.c sig_relse.c sig_wait.c + +ifeq ($(CONFIG_ENABLE_ALL_SIGNALS),y) +CSRCS += sig_ignore.c sig_interrupt.c sig_set.c sig_signal.c +endif # Add the signal directory to the build diff --git a/sched/Kconfig b/sched/Kconfig index efa15d24db720..711c4dc377f90 100644 --- a/sched/Kconfig +++ b/sched/Kconfig @@ -1547,6 +1547,39 @@ endmenu # RTOS hooks menu "Signal Configuration" +choice + prompt "Signal support level" + default ENABLE_ALL_SIGNALS if !DEFAULT_SMALL + default ENABLE_PARTIAL_SIGNALS if DEFAULT_SMALL + +config ENABLE_ALL_SIGNALS + bool "Enable full signal support" + ---help--- + Enable full POSIX signal support, including signal handling, + thread cancellation, timers, and process-related notifications. + + This option provides the most complete signal functionality, + but increases code size and resource usage. + + Typical use cases: + - Applications relying on POSIX signals or timers + - Systems where memory and CPU resources are sufficient + +config ENABLE_PARTIAL_SIGNALS + bool "Enable partial signal support" + ---help--- + Disable process-related signal functionality while keeping + basic signal handling support. + + This option provides a balance between reduced resource usage + and limited signal functionality. + + Typical use cases: + - Applications using basic signals without fork/exec + - Resource-constrained real-time systems + +endchoice + config SIG_PREALLOC_ACTIONS int "Number of pre-allocated sigactions" default 4 diff --git a/sched/group/group_leave.c b/sched/group/group_leave.c index 5e69dc2d3499a..4ba91b1af97cc 100644 --- a/sched/group/group_leave.c +++ b/sched/group/group_leave.c @@ -86,7 +86,9 @@ static inline void group_release(FAR struct task_group_s *group) /* Release pending signals */ +#ifdef CONFIG_ENABLE_ALL_SIGNALS nxsig_release(group); +#endif #ifndef CONFIG_DISABLE_PTHREAD /* Release pthread resources */ diff --git a/sched/group/group_signal.c b/sched/group/group_signal.c index a15b364ae862f..f3c734b47a0f1 100644 --- a/sched/group/group_signal.c +++ b/sched/group/group_signal.c @@ -77,7 +77,9 @@ static int group_signal_handler(pid_t pid, FAR void *arg) { FAR struct group_signal_s *info = (FAR struct group_signal_s *)arg; FAR struct tcb_s *tcb; +#ifdef CONFIG_ENABLE_ALL_SIGNALS FAR sigactq_t *sigact; +#endif int ret; /* Get the TCB associated with the group member */ @@ -141,6 +143,7 @@ static int group_signal_handler(pid_t pid, FAR void *arg) /* Is there also a action associated with the task group? */ +#ifdef CONFIG_ENABLE_ALL_SIGNALS sigact = nxsig_find_action(tcb->group, info->siginfo->si_signo); if (sigact) { @@ -164,6 +167,7 @@ static int group_signal_handler(pid_t pid, FAR void *arg) return 1; /* Terminate the search */ } } +#endif } return 0; /* Keep searching */ diff --git a/sched/init/nx_start.c b/sched/init/nx_start.c index be28b4565ca21..1c7b931b05072 100644 --- a/sched/init/nx_start.c +++ b/sched/init/nx_start.c @@ -644,7 +644,9 @@ void nx_start(void) /* Initialize the signal facility (if in link) */ +#ifdef CONFIG_ENABLE_ALL_SIGNALS nxsig_initialize(); +#endif #if !defined(CONFIG_DISABLE_MQUEUE) || !defined(CONFIG_DISABLE_MQUEUE_SYSV) /* Initialize the named message queue facility (if in link) */ diff --git a/sched/signal/CMakeLists.txt b/sched/signal/CMakeLists.txt index 715db0a776baa..e1e2ad910d90f 100644 --- a/sched/signal/CMakeLists.txt +++ b/sched/signal/CMakeLists.txt @@ -21,27 +21,16 @@ # ############################################################################## set(SRCS - sig_initialize.c - sig_action.c sig_procmask.c - sig_pending.c sig_suspend.c sig_kill.c sig_tgkill.c sig_queue.c sig_waitinfo.c sig_timedwait.c - sig_findaction.c - sig_allocpendingsigaction.c - sig_releasependingsigaction.c - sig_unmaskpendingsignal.c - sig_removependingsignal.c - sig_releasependingsignal.c sig_lowest.c sig_notification.c - sig_cleanup.c sig_dispatch.c - sig_deliver.c sig_pause.c sig_nanosleep.c sig_usleep.c @@ -49,6 +38,23 @@ set(SRCS sig_ppoll.c sig_pselect.c) +if(CONFIG_ENABLE_ALL_SIGNALS) + list( + APPEND + SRCS + sig_action.c + sig_allocpendingsigaction.c + sig_cleanup.c + sig_deliver.c + sig_findaction.c + sig_initialize.c + sig_pending.c + sig_releasependingsigaction.c + sig_releasependingsignal.c + sig_removependingsignal.c + sig_unmaskpendingsignal.c) +endif() + if(CONFIG_SIG_DEFAULT) list(APPEND SRCS sig_default.c) endif() diff --git a/sched/signal/Make.defs b/sched/signal/Make.defs index cfb2ddc006080..a9eb9245a1fba 100644 --- a/sched/signal/Make.defs +++ b/sched/signal/Make.defs @@ -20,15 +20,16 @@ # ############################################################################ -CSRCS += sig_initialize.c -CSRCS += sig_action.c sig_procmask.c sig_pending.c sig_suspend.c -CSRCS += sig_kill.c sig_tgkill.c sig_queue.c sig_waitinfo.c sig_timedwait.c -CSRCS += sig_findaction.c sig_allocpendingsigaction.c -CSRCS += sig_releasependingsigaction.c sig_unmaskpendingsignal.c -CSRCS += sig_removependingsignal.c sig_releasependingsignal.c sig_lowest.c -CSRCS += sig_notification.c sig_cleanup.c sig_dispatch.c sig_deliver.c -CSRCS += sig_pause.c sig_nanosleep.c sig_usleep.c sig_sleep.c -CSRCS += sig_ppoll.c sig_pselect.c +CSRCS += sig_dispatch.c sig_kill.c sig_lowest.c sig_nanosleep.c +CSRCS += sig_notification.c sig_pause.c sig_ppoll.c sig_procmask.c +CSRCS += sig_pselect.c sig_queue.c sig_sleep.c sig_suspend.c sig_tgkill.c +CSRCS += sig_timedwait.c sig_usleep.c sig_waitinfo.c + +ifeq ($(CONFIG_ENABLE_ALL_SIGNALS),y) +CSRCS += sig_action.c sig_allocpendingsigaction.c sig_cleanup.c sig_deliver.c +CSRCS += sig_findaction.c sig_initialize.c sig_pending.c sig_releasependingsigaction.c +CSRCS += sig_releasependingsignal.c sig_removependingsignal.c sig_unmaskpendingsignal.c +endif ifeq ($(CONFIG_SIG_DEFAULT),y) CSRCS += sig_default.c diff --git a/sched/signal/sig_dispatch.c b/sched/signal/sig_dispatch.c index 723799c17df14..ab0047472d260 100644 --- a/sched/signal/sig_dispatch.c +++ b/sched/signal/sig_dispatch.c @@ -50,6 +50,7 @@ * Private Types ****************************************************************************/ +#ifdef CONFIG_ENABLE_ALL_SIGNALS struct sig_arg_s { pid_t pid; @@ -428,6 +429,7 @@ static int nxsig_alloc_dyn_pending(FAR irqstate_t *flags) return ret; } +#endif /**************************************************************************** * Public Functions @@ -459,11 +461,13 @@ int nxsig_tcbdispatch(FAR struct tcb_s *stcb, siginfo_t *info, bool group_dispatch) { FAR struct tcb_s *rtcb = this_task(); - FAR sigactq_t *sigact; irqstate_t flags; int masked; int ret = OK; +#ifdef CONFIG_ENABLE_ALL_SIGNALS + FAR sigactq_t *sigact; FAR sigpendq_t *sigpend = NULL; +#endif sinfo("TCB=%p pid=%d signo=%d code=%d value=%d masked=%s\n", stcb, stcb->pid, info->si_signo, info->si_code, @@ -488,10 +492,6 @@ int nxsig_tcbdispatch(FAR struct tcb_s *stcb, siginfo_t *info, /************************** MASKED SIGNAL ACTIONS *************************/ - /* Find if there is a group sigaction associated with this signal */ - - sigact = nxsig_find_action(stcb->group, info->si_signo); - flags = enter_critical_section(); /* Make sure that there is always at least one sigpednq and sigq structure @@ -500,12 +500,14 @@ int nxsig_tcbdispatch(FAR struct tcb_s *stcb, siginfo_t *info, * needs to be done here before using the task state or sigprocmask. */ +#ifdef CONFIG_ENABLE_ALL_SIGNALS ret = nxsig_alloc_dyn_pending(&flags); if (ret < 0) { leave_critical_section(flags); return ret; } +#endif masked = nxsig_ismember(&stcb->sigprocmask, info->si_signo); @@ -573,16 +575,19 @@ int nxsig_tcbdispatch(FAR struct tcb_s *stcb, siginfo_t *info, up_switch_context(this_task(), rtcb); } -#ifdef CONFIG_LIB_SYSCALL +#ifdef CONFIG_ENABLE_ALL_SIGNALS +# ifdef CONFIG_LIB_SYSCALL /* Must also add signal action if in system call */ if (masked == 0) { sigpend = nxsig_add_pendingsignal(stcb, info, group_dispatch); } +# endif #endif } +#ifdef CONFIG_ENABLE_ALL_SIGNALS /* Its not one we are waiting for... Add it to the list of pending * signals. */ @@ -591,16 +596,22 @@ int nxsig_tcbdispatch(FAR struct tcb_s *stcb, siginfo_t *info, { sigpend = nxsig_add_pendingsignal(stcb, info, group_dispatch); } +#endif } /************************* UNMASKED SIGNAL ACTIONS ************************/ else { +#ifdef CONFIG_ENABLE_ALL_SIGNALS + /* Find if there is a group sigaction associated with this signal */ + + sigact = nxsig_find_action(stcb->group, info->si_signo); + /* Queue any sigaction's requested by this task. */ ret = nxsig_queue_action(stcb, sigact, info); - +#endif /* Deliver of the signal must be performed in a critical section */ /* Check if the task is waiting for an unmasked signal. If so, then @@ -697,12 +708,14 @@ int nxsig_tcbdispatch(FAR struct tcb_s *stcb, siginfo_t *info, leave_critical_section(flags); +#ifdef CONFIG_ENABLE_ALL_SIGNALS /* Dispatch kernel action, if needed, in case a pending signal was added */ if (sigpend != NULL) { nxsig_dispatch_kernel_action(stcb, &sigpend->info); } +#endif /* In case nxsig_ismember failed due to an invalid signal number */ diff --git a/sched/signal/sig_procmask.c b/sched/signal/sig_procmask.c index b9a180170cf98..1428877e0865b 100644 --- a/sched/signal/sig_procmask.c +++ b/sched/signal/sig_procmask.c @@ -145,7 +145,9 @@ int nxsig_procmask(int how, FAR const sigset_t *set, FAR sigset_t *oset) /* Now, process any pending signals that were just unmasked */ +#ifdef CONFIG_ENABLE_ALL_SIGNALS nxsig_unmask_pendingsignal(); +#endif } return ret; diff --git a/sched/signal/sig_timedwait.c b/sched/signal/sig_timedwait.c index 096bae1cbaf71..02a8b1131aeb4 100644 --- a/sched/signal/sig_timedwait.c +++ b/sched/signal/sig_timedwait.c @@ -334,8 +334,10 @@ int nxsig_timedwait(FAR const sigset_t *set, FAR struct siginfo *info, FAR const struct timespec *timeout) { FAR struct tcb_s *rtcb; +#ifdef CONFIG_ENABLE_ALL_SIGNALS sigset_t intersection; FAR sigpendq_t *sigpend; +#endif irqstate_t flags; siginfo_t unbinfo; int ret; @@ -351,6 +353,7 @@ int nxsig_timedwait(FAR const sigset_t *set, FAR struct siginfo *info, flags = enter_critical_section(); rtcb = this_task(); +#ifdef CONFIG_ENABLE_ALL_SIGNALS /* Check if there is a pending signal corresponding to one of the * signals in the pending signal set argument. */ @@ -387,6 +390,7 @@ int nxsig_timedwait(FAR const sigset_t *set, FAR struct siginfo *info, /* We will have to wait for a signal to be posted to this task. */ else +#endif { rtcb->sigunbinfo = (info == NULL) ? &unbinfo : info; diff --git a/sched/signal/signal.h b/sched/signal/signal.h index 28fe4a9d02b66..549745c659f1d 100644 --- a/sched/signal/signal.h +++ b/sched/signal/signal.h @@ -120,7 +120,9 @@ typedef struct sigq_s sigq_t; * structures buffers structures. */ +#ifdef CONFIG_ENABLE_ALL_SIGNALS extern sigactq_t g_sigactions[CONFIG_SIG_PREALLOC_ACTIONS]; +#endif /* The g_sigfreeaction data structure is a list of available signal action * structures. @@ -164,7 +166,9 @@ struct task_group_s; /* sig_initializee.c */ +#ifdef CONFIG_ENABLE_ALL_SIGNALS void nxsig_initialize(void); +#endif /* sig_action.c */ @@ -190,8 +194,10 @@ int nxsig_dispatch(pid_t pid, FAR siginfo_t *info, /* sig_cleanup.c */ +#ifdef CONFIG_ENABLE_ALL_SIGNALS void nxsig_cleanup(FAR struct tcb_s *stcb); void nxsig_release(FAR struct task_group_s *group); +#endif /* sig_timedwait.c */ diff --git a/sched/task/task_exithook.c b/sched/task/task_exithook.c index 268931b247df1..4d34ecf002573 100644 --- a/sched/task/task_exithook.c +++ b/sched/task/task_exithook.c @@ -455,7 +455,9 @@ void nxtask_exithook(FAR struct tcb_s *tcb, int status) /* Deallocate anything left in the TCB's queues */ +#ifdef CONFIG_ENABLE_ALL_SIGNALS nxsig_cleanup(tcb); /* Deallocate Signal lists */ +#endif #ifdef CONFIG_SCHED_DUMP_LEAK if ((tcb->flags & TCB_FLAG_TTYPE_MASK) == TCB_FLAG_TTYPE_KERNEL) diff --git a/sched/task/task_restart.c b/sched/task/task_restart.c index 07566a3d99e93..f2dcc4db6289a 100644 --- a/sched/task/task_restart.c +++ b/sched/task/task_restart.c @@ -119,7 +119,9 @@ static void nxtask_reset_task(FAR struct tcb_s *tcb, bool remove) /* Deallocate anything left in the TCB's signal queues */ +#ifdef CONFIG_ENABLE_ALL_SIGNALS nxsig_cleanup(tcb); /* Deallocate Signal lists */ +#endif sigemptyset(&tcb->sigprocmask); /* Reset sigprocmask */ /* Reset the current task priority */ diff --git a/syscall/syscall.csv b/syscall/syscall.csv index 3fe9675905d31..dd4b8ea56d984 100644 --- a/syscall/syscall.csv +++ b/syscall/syscall.csv @@ -173,10 +173,10 @@ "shmdt","sys/shm.h","defined(CONFIG_MM_SHM)","int","FAR const void *" "shmget","sys/shm.h","defined(CONFIG_MM_SHM)","int","key_t","size_t","int" "shutdown","sys/socket.h","defined(CONFIG_NET)","int","int","int" -"sigaction","signal.h","","int","int","FAR const struct sigaction *","FAR struct sigaction *" -"signal","signal.h","","_sa_handler_t","int","_sa_handler_t" +"sigaction","signal.h","defined(CONFIG_ENABLE_ALL_SIGNALS)","int","int","FAR const struct sigaction *","FAR struct sigaction *" +"signal","signal.h","defined(CONFIG_ENABLE_ALL_SIGNALS)","_sa_handler_t","int","_sa_handler_t" "signalfd","sys/signalfd.h","defined(CONFIG_SIGNAL_FD)","int","int","FAR const sigset_t *","int" -"sigpending","signal.h","","int","FAR sigset_t *" +"sigpending","signal.h","defined(CONFIG_ENABLE_ALL_SIGNALS)","int","FAR sigset_t *" "sigprocmask","signal.h","","int","int","FAR const sigset_t *","FAR sigset_t *" "sigqueue","signal.h","","int","int","int","union sigval|FAR void *|sival_ptr" "sigsuspend","signal.h","","int","FAR const sigset_t *" From c2e0310b2db0fd63e86703d828e3051dd5c41344 Mon Sep 17 00:00:00 2001 From: wangchengdong Date: Mon, 12 Jan 2026 09:11:52 +0800 Subject: [PATCH 02/19] sched/signal: Add support for disabling all signal functions 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 --- fs/procfs/fs_procfsproc.c | 3 ++- fs/vfs/Kconfig | 1 + include/nuttx/sched.h | 2 ++ include/sys/syscall_lookup.h | 2 ++ libs/libc/libc.csv | 10 ++++----- libs/libc/signal/CMakeLists.txt | 40 +++++++++++++++++---------------- libs/libc/signal/Make.defs | 2 ++ libs/libc/spawn/lib_psa_init.c | 2 ++ sched/Kconfig | 15 +++++++++++++ sched/group/CMakeLists.txt | 7 ++++-- sched/group/Make.defs | 6 ++++- sched/misc/assert.c | 4 ++++ sched/pthread/pthread_exit.c | 4 ++++ sched/signal/CMakeLists.txt | 36 +++++++++++++++-------------- sched/signal/Make.defs | 3 ++- sched/task/task_restart.c | 2 ++ sched/task/task_setup.c | 2 ++ sched/task/task_spawnparms.c | 2 ++ syscall/syscall.csv | 14 ++++++------ 19 files changed, 104 insertions(+), 53 deletions(-) diff --git a/fs/procfs/fs_procfsproc.c b/fs/procfs/fs_procfsproc.c index 310bd63e5fb0b..a1a58fe1b5ab7 100644 --- a/fs/procfs/fs_procfsproc.c +++ b/fs/procfs/fs_procfsproc.c @@ -640,10 +640,11 @@ static ssize_t proc_status(FAR struct proc_file_s *procfile, } /* Show the signal mask. Note: sigset_t is uint32_t on NuttX. */ - +#ifndef CONFIG_DISABLE_ALL_SIGNALS linesize = procfs_snprintf(procfile->line, STATUS_LINELEN, "%-12s" SIGSET_FMT "\n", "SigMask:", SIGSET_ELEM(&tcb->sigprocmask)); +#endif copysize = procfs_memcpy(procfile->line, linesize, buffer, remaining, &offset); diff --git a/fs/vfs/Kconfig b/fs/vfs/Kconfig index b84b08778b875..ed51ee08391ea 100644 --- a/fs/vfs/Kconfig +++ b/fs/vfs/Kconfig @@ -51,6 +51,7 @@ endif # TIMER_FD config SIGNAL_FD bool "SignalFD" + depends on !DISABLE_ALL_SIGNALS default n ---help--- Create a file descriptor for accepting signals diff --git a/include/nuttx/sched.h b/include/nuttx/sched.h index 10766b1a4f6e2..8a83aefc4350e 100644 --- a/include/nuttx/sched.h +++ b/include/nuttx/sched.h @@ -667,9 +667,11 @@ struct tcb_s sq_queue_t sigpendactionq; /* List of pending signal actions */ sq_queue_t sigpostedq; /* List of posted signals */ #endif /* CONFIG_ENABLE_ALL_SIGNALS*/ +#ifndef CONFIG_DISABLE_ALL_SIGNALS sigset_t sigprocmask; /* Signals that are blocked */ sigset_t sigwaitmask; /* Waiting for pending signals */ siginfo_t *sigunbinfo; /* Signal info when task unblocked */ +#endif /* !CONFIG_DISABLE_ALL_SIGNALS */ /* Robust mutex support ***************************************************/ diff --git a/include/sys/syscall_lookup.h b/include/sys/syscall_lookup.h index 2d497b9e1c661..39ef26c16c41f 100644 --- a/include/sys/syscall_lookup.h +++ b/include/sys/syscall_lookup.h @@ -158,11 +158,13 @@ SYSCALL_LOOKUP(tgkill, 3) SYSCALL_LOOKUP(sigaction, 3) SYSCALL_LOOKUP(sigpending, 1) #endif +#ifndef CONFIG_DISABLE_ALL_SIGNALS SYSCALL_LOOKUP(sigprocmask, 3) SYSCALL_LOOKUP(sigqueue, 3) SYSCALL_LOOKUP(sigsuspend, 1) SYSCALL_LOOKUP(sigtimedwait, 3) SYSCALL_LOOKUP(sigwaitinfo, 2) +#endif SYSCALL_LOOKUP(clock_nanosleep, 4) /* The following are only defined if the system clock is enabled in the diff --git a/libs/libc/libc.csv b/libs/libc/libc.csv index c3c0551521a8d..36627d9a7436a 100644 --- a/libs/libc/libc.csv +++ b/libs/libc/libc.csv @@ -269,11 +269,11 @@ "setlogmask","syslog.h","","int","int" "setpriority","sys/resource.h","","int","int","id_t","int" "shutdown","sys/socket.h","defined(CONFIG_NET)","int","int","int" -"sigaddset","signal.h","","int","FAR sigset_t *","int" -"sigdelset","signal.h","","int","FAR sigset_t *","int" -"sigemptyset","signal.h","","int","FAR sigset_t *" -"sigfillset","signal.h","","int","FAR sigset_t *" -"sigismember","signal.h","","int","FAR const sigset_t *","int" +"sigaddset","signal.h","!defined(CONFIG_DISABLE_ALL_SIGNALS)","int","FAR sigset_t *","int" +"sigdelset","signal.h","!defined(CONFIG_DISABLE_ALL_SIGNALS)","int","FAR sigset_t *","int" +"sigemptyset","signal.h","!defined(CONFIG_DISABLE_ALL_SIGNALS)","int","FAR sigset_t *" +"sigfillset","signal.h","!defined(CONFIG_DISABLE_ALL_SIGNALS)","int","FAR sigset_t *" +"sigismember","signal.h","!defined(CONFIG_DISABLE_ALL_SIGNALS)","int","FAR const sigset_t *","int" "signal","signal.h","defined(CONFIG_ENABLE_ALL_SIGNALS)","_sa_handler_t","int","_sa_handler_t" "sleep","unistd.h","","unsigned int","unsigned int" "snprintf","stdio.h","","int","FAR char *","size_t","FAR const IPTR char *","..." diff --git a/libs/libc/signal/CMakeLists.txt b/libs/libc/signal/CMakeLists.txt index 14ef7372aaadc..7cf52f9c4845c 100644 --- a/libs/libc/signal/CMakeLists.txt +++ b/libs/libc/signal/CMakeLists.txt @@ -20,25 +20,27 @@ # # ############################################################################## -set(SRCS - sig_addset.c - sig_delset.c - sig_emptyset.c - sig_fillset.c - sig_nandset.c - sig_andset.c - sig_orset.c - sig_xorset.c - sig_isemptyset.c - sig_killpg.c - sig_altstack.c - sig_hold.c - sig_ismember.c - sig_pause.c - sig_psignal.c - sig_raise.c - sig_relse.c - sig_wait.c) +if(NOT CONFIG_DISABLE_ALL_SIGNALS) + set(SRCS + sig_addset.c + sig_delset.c + sig_emptyset.c + sig_fillset.c + sig_nandset.c + sig_andset.c + sig_orset.c + sig_xorset.c + sig_isemptyset.c + sig_killpg.c + sig_altstack.c + sig_hold.c + sig_ismember.c + sig_pause.c + sig_psignal.c + sig_raise.c + sig_relse.c + sig_wait.c) +endif() if(CONFIG_ENABLE_ALL_SIGNALS) list(APPEND SRCS sig_ignore.c sig_interrupt.c sig_set.c sig_signal.c) diff --git a/libs/libc/signal/Make.defs b/libs/libc/signal/Make.defs index cd20f64b10997..7c2874c4e11d1 100644 --- a/libs/libc/signal/Make.defs +++ b/libs/libc/signal/Make.defs @@ -22,11 +22,13 @@ # Add the signal C files to the build +ifneq ($(CONFIG_DISABLE_ALL_SIGNALS),y) CSRCS += sig_addset.c sig_delset.c sig_emptyset.c sig_fillset.c CSRCS += sig_nandset.c sig_andset.c sig_orset.c sig_xorset.c CSRCS += sig_isemptyset.c sig_killpg.c sig_altstack.c CSRCS += sig_hold.c sig_ismember.c sig_pause.c sig_psignal.c CSRCS += sig_raise.c sig_relse.c sig_wait.c +endif ifeq ($(CONFIG_ENABLE_ALL_SIGNALS),y) CSRCS += sig_ignore.c sig_interrupt.c sig_set.c sig_signal.c diff --git a/libs/libc/spawn/lib_psa_init.c b/libs/libc/spawn/lib_psa_init.c index 306e68d1a989d..aaff5ea5a9edb 100644 --- a/libs/libc/spawn/lib_psa_init.c +++ b/libs/libc/spawn/lib_psa_init.c @@ -87,7 +87,9 @@ int posix_spawnattr_init(posix_spawnattr_t *attr) /* Empty signal mask */ +#ifndef CONFIG_DISABLE_ALL_SIGNALS sigemptyset(&attr->sigmask); +#endif #ifdef CONFIG_SCHED_SPORADIC /* Sporadic scheduling parameters */ diff --git a/sched/Kconfig b/sched/Kconfig index 711c4dc377f90..21a8f1b38175b 100644 --- a/sched/Kconfig +++ b/sched/Kconfig @@ -1578,6 +1578,21 @@ config ENABLE_PARTIAL_SIGNALS - Applications using basic signals without fork/exec - Resource-constrained real-time systems +config DISABLE_ALL_SIGNALS + bool "Disable all signal support" + select DISABLE_MQUEUE_NOTIFICATION + ---help--- + Disable all signal-related functionality, including signal + handling, thread cancellation, timers, and process-related + notifications. + + This option provides the smallest footprint and maximum + resource savings. + + Typical use cases: + - Hard real-time or safety-critical systems + - Applications that do not use POSIX signals or timers + endchoice config SIG_PREALLOC_ACTIONS diff --git a/sched/group/CMakeLists.txt b/sched/group/CMakeLists.txt index cec78f235132f..6211a2c7c66ab 100644 --- a/sched/group/CMakeLists.txt +++ b/sched/group/CMakeLists.txt @@ -27,8 +27,11 @@ set(SRCS group_setupidlefiles.c group_setuptaskfiles.c group_foreachchild.c - group_killchildren.c - group_signal.c) + group_killchildren.c) + +if(NOT CONFIG_DISABLE_ALL_SIGNALS) + list(APPEND SRCS group_signal.c) +endif() if(CONFIG_SCHED_HAVE_PARENT) if(CONFIG_SCHED_CHILD_STATUS) diff --git a/sched/group/Make.defs b/sched/group/Make.defs index 61f0a03ec9a21..336beda8f211b 100644 --- a/sched/group/Make.defs +++ b/sched/group/Make.defs @@ -22,7 +22,11 @@ CSRCS += group_create.c group_join.c group_leave.c CSRCS += group_setupidlefiles.c group_setuptaskfiles.c -CSRCS += group_foreachchild.c group_killchildren.c group_signal.c +CSRCS += group_foreachchild.c group_killchildren.c + +ifneq ($(CONFIG_DISABLE_ALL_SIGNALS),y) +CSRCS += group_signal.c +endif ifeq ($(CONFIG_SCHED_HAVE_PARENT),y) ifeq ($(CONFIG_SCHED_CHILD_STATUS),y) diff --git a/sched/misc/assert.c b/sched/misc/assert.c index 0c89d62a7dfe6..e541f05d9d9d6 100644 --- a/sched/misc/assert.c +++ b/sched/misc/assert.c @@ -405,7 +405,9 @@ static void dump_task(FAR struct tcb_s *tcb, FAR void *arg) #endif " %3d %-8s %-7s %-3c" " %-18s" +#ifndef CONFIG_DISABLE_ALL_SIGNALS " " SIGSET_FMT +#endif " %p" " %7zu" #ifdef CONFIG_STACK_COLORATION @@ -427,7 +429,9 @@ static void dump_task(FAR struct tcb_s *tcb, FAR void *arg) >> TCB_FLAG_TTYPE_SHIFT] , tcb->flags & TCB_FLAG_EXIT_PROCESSING ? 'P' : '-' , state +#ifndef CONFIG_DISABLE_ALL_SIGNALS , SIGSET_ELEM(&tcb->sigprocmask) +#endif , tcb->stack_base_ptr , tcb->adj_stack_size #ifdef CONFIG_STACK_COLORATION diff --git a/sched/pthread/pthread_exit.c b/sched/pthread/pthread_exit.c index 494a00c3409cd..c1c023672e686 100644 --- a/sched/pthread/pthread_exit.c +++ b/sched/pthread/pthread_exit.c @@ -65,7 +65,9 @@ void nx_pthread_exit(FAR void *exit_value) { FAR struct tcb_s *tcb = this_task(); +#ifndef CONFIG_DISABLE_ALL_SIGNALS sigset_t set; +#endif int status; sinfo("exit_value=%p\n", exit_value); @@ -76,8 +78,10 @@ void nx_pthread_exit(FAR void *exit_value) * are performing the JOIN handshake. */ +#ifndef CONFIG_DISABLE_ALL_SIGNALS sigfillset(&set); nxsig_procmask(SIG_SETMASK, &set, NULL); +#endif /* Complete pending join operations */ diff --git a/sched/signal/CMakeLists.txt b/sched/signal/CMakeLists.txt index e1e2ad910d90f..9db325fec5ed7 100644 --- a/sched/signal/CMakeLists.txt +++ b/sched/signal/CMakeLists.txt @@ -20,23 +20,25 @@ # # ############################################################################## -set(SRCS - sig_procmask.c - sig_suspend.c - sig_kill.c - sig_tgkill.c - sig_queue.c - sig_waitinfo.c - sig_timedwait.c - sig_lowest.c - sig_notification.c - sig_dispatch.c - sig_pause.c - sig_nanosleep.c - sig_usleep.c - sig_sleep.c - sig_ppoll.c - sig_pselect.c) +if(NOT CONFIG_DISABLE_ALL_SIGNALS) + set(SRCS + sig_procmask.c + sig_suspend.c + sig_kill.c + sig_tgkill.c + sig_queue.c + sig_waitinfo.c + sig_timedwait.c + sig_lowest.c + sig_notification.c + sig_dispatch.c + sig_pause.c + sig_nanosleep.c + sig_usleep.c + sig_sleep.c + sig_ppoll.c + sig_pselect.c) +endif() if(CONFIG_ENABLE_ALL_SIGNALS) list( diff --git a/sched/signal/Make.defs b/sched/signal/Make.defs index a9eb9245a1fba..b70ac2a8246f3 100644 --- a/sched/signal/Make.defs +++ b/sched/signal/Make.defs @@ -19,11 +19,12 @@ # under the License. # ############################################################################ - +ifneq ($(CONFIG_DISABLE_ALL_SIGNALS),y) CSRCS += sig_dispatch.c sig_kill.c sig_lowest.c sig_nanosleep.c CSRCS += sig_notification.c sig_pause.c sig_ppoll.c sig_procmask.c CSRCS += sig_pselect.c sig_queue.c sig_sleep.c sig_suspend.c sig_tgkill.c CSRCS += sig_timedwait.c sig_usleep.c sig_waitinfo.c +endif ifeq ($(CONFIG_ENABLE_ALL_SIGNALS),y) CSRCS += sig_action.c sig_allocpendingsigaction.c sig_cleanup.c sig_deliver.c diff --git a/sched/task/task_restart.c b/sched/task/task_restart.c index f2dcc4db6289a..d129945e89d45 100644 --- a/sched/task/task_restart.c +++ b/sched/task/task_restart.c @@ -122,7 +122,9 @@ static void nxtask_reset_task(FAR struct tcb_s *tcb, bool remove) #ifdef CONFIG_ENABLE_ALL_SIGNALS nxsig_cleanup(tcb); /* Deallocate Signal lists */ #endif +#ifndef CONFIG_DISABLE_ALL_SIGNALS sigemptyset(&tcb->sigprocmask); /* Reset sigprocmask */ +#endif /* Reset the current task priority */ diff --git a/sched/task/task_setup.c b/sched/task/task_setup.c index c226bdbc27db1..e6b83da24e5f2 100644 --- a/sched/task/task_setup.c +++ b/sched/task/task_setup.c @@ -461,7 +461,9 @@ static int nxthread_setup_scheduler(FAR struct tcb_s *tcb, int priority, * inherit the signal mask of the parent thread. */ +#ifndef CONFIG_DISABLE_ALL_SIGNALS tcb->sigprocmask = rtcb->sigprocmask; +#endif /* Initialize the task state. It does not get a valid state * until it is activated. diff --git a/sched/task/task_spawnparms.c b/sched/task/task_spawnparms.c index 7022b5d5767bf..b79fc460198f3 100644 --- a/sched/task/task_spawnparms.c +++ b/sched/task/task_spawnparms.c @@ -157,6 +157,7 @@ int spawn_execattrs(pid_t pid, FAR const posix_spawnattr_t *attr) /* Firstly, set the signal mask if requested to do so */ +#ifndef CONFIG_DISABLE_ALL_SIGNALS if ((attr->flags & POSIX_SPAWN_SETSIGMASK) != 0) { FAR struct tcb_s *tcb = nxsched_get_tcb(pid); @@ -165,6 +166,7 @@ int spawn_execattrs(pid_t pid, FAR const posix_spawnattr_t *attr) tcb->sigprocmask = attr->sigmask; } } +#endif /* If we are only setting the priority, then call sched_setparm() * to set the priority of the of the new task. diff --git a/syscall/syscall.csv b/syscall/syscall.csv index dd4b8ea56d984..db198e23d83ef 100644 --- a/syscall/syscall.csv +++ b/syscall/syscall.csv @@ -105,10 +105,10 @@ "pipe2","unistd.h","defined(CONFIG_PIPES) && CONFIG_DEV_PIPE_SIZE > 0","int","int [2]|FAR int *","int" "poll","poll.h","","int","FAR struct pollfd *","nfds_t","int" "posix_spawn","spawn.h","!defined(CONFIG_BINFMT_DISABLE) && defined(CONFIG_LIBC_EXECFUNCS)","int","FAR pid_t *","FAR const char *","FAR const posix_spawn_file_actions_t *","FAR const posix_spawnattr_t *","FAR char * const []|FAR char * const *","FAR char * const []|FAR char * const *" -"ppoll","poll.h","","int","FAR struct pollfd *","nfds_t","FAR const struct timespec *","FAR const sigset_t *" +"ppoll","poll.h","!defined(CONFIG_DISABLE_ALL_SIGNALS)","int","FAR struct pollfd *","nfds_t","FAR const struct timespec *","FAR const sigset_t *" "prctl","sys/prctl.h","","int","int","...","uintptr_t","uintptr_t" "pread","unistd.h","","ssize_t","int","FAR void *","size_t","off_t" -"pselect","sys/select.h","","int","int","FAR fd_set *","FAR fd_set *","FAR fd_set *","FAR const struct timespec *","FAR const sigset_t *" +"pselect","sys/select.h","!defined(CONFIG_DISABLE_ALL_SIGNALS)","int","int","FAR fd_set *","FAR fd_set *","FAR fd_set *","FAR const struct timespec *","FAR const sigset_t *" "pthread_cancel","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","pthread_t" "pthread_cond_broadcast","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","FAR pthread_cond_t *" "pthread_cond_clockwait","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","FAR pthread_cond_t *","FAR pthread_mutex_t *","clockid_t","FAR const struct timespec *" @@ -177,11 +177,11 @@ "signal","signal.h","defined(CONFIG_ENABLE_ALL_SIGNALS)","_sa_handler_t","int","_sa_handler_t" "signalfd","sys/signalfd.h","defined(CONFIG_SIGNAL_FD)","int","int","FAR const sigset_t *","int" "sigpending","signal.h","defined(CONFIG_ENABLE_ALL_SIGNALS)","int","FAR sigset_t *" -"sigprocmask","signal.h","","int","int","FAR const sigset_t *","FAR sigset_t *" -"sigqueue","signal.h","","int","int","int","union sigval|FAR void *|sival_ptr" -"sigsuspend","signal.h","","int","FAR const sigset_t *" -"sigtimedwait","signal.h","","int","FAR const sigset_t *","FAR struct siginfo *","FAR const struct timespec *" -"sigwaitinfo","signal.h","","int","FAR const sigset_t *","FAR struct siginfo *" +"sigprocmask","signal.h","!defined(CONFIG_DISABLE_ALL_SIGNALS)","int","int","FAR const sigset_t *","FAR sigset_t *" +"sigqueue","signal.h","!defined(CONFIG_DISABLE_ALL_SIGNALS)","int","int","int","union sigval|FAR void *|sival_ptr" +"sigsuspend","signal.h","!defined(CONFIG_DISABLE_ALL_SIGNALS)","int","FAR const sigset_t *" +"sigtimedwait","signal.h","!defined(CONFIG_DISABLE_ALL_SIGNALS)","int","FAR const sigset_t *","FAR struct siginfo *","FAR const struct timespec *" +"sigwaitinfo","signal.h","!defined(CONFIG_DISABLE_ALL_SIGNALS)","int","FAR const sigset_t *","FAR struct siginfo *" "socket","sys/socket.h","defined(CONFIG_NET)","int","int","int","int" "socketpair","sys/socket.h","defined(CONFIG_NET)","int","int","int","int","int [2]|FAR int *" "stat","sys/stat.h","","int","FAR const char *","FAR struct stat *" From 0af9bff9790e1f2677e53f7e8ec0fba867b480b4 Mon Sep 17 00:00:00 2001 From: wangchengdong Date: Tue, 23 Dec 2025 10:43:42 +0800 Subject: [PATCH 03/19] arch/arm: Add support to disable signals actions related data struct Add support to disable signals actions related struct Co-authored-by: guoshichao Signed-off-by: Chengdong Wang --- arch/arm/include/arm/irq.h | 2 ++ arch/arm/include/armv6-m/irq.h | 2 ++ arch/arm/include/armv7-a/irq.h | 2 ++ arch/arm/include/armv7-m/irq.h | 2 ++ arch/arm/include/armv7-r/irq.h | 2 ++ arch/arm/include/armv8-m/irq.h | 2 ++ arch/arm/include/armv8-r/irq.h | 2 ++ arch/arm/include/tlsr82/irq.h | 3 ++- arch/arm/src/arm/CMakeLists.txt | 6 ++++-- arch/arm/src/arm/Make.defs | 8 ++++++-- arch/arm/src/arm/arm_vectors.S | 2 +- arch/arm/src/armv6-m/CMakeLists.txt | 6 ++++-- arch/arm/src/armv6-m/Make.defs | 6 +++++- arch/arm/src/armv6-m/arm_doirq.c | 2 ++ arch/arm/src/armv6-m/arm_exception.S | 2 ++ arch/arm/src/armv7-a/CMakeLists.txt | 6 ++++-- arch/arm/src/armv7-a/Make.defs | 5 ++++- arch/arm/src/armv7-a/arm_syscall.c | 6 ++---- arch/arm/src/armv7-a/arm_vectors.S | 5 +++-- arch/arm/src/armv7-m/CMakeLists.txt | 6 ++++-- arch/arm/src/armv7-m/Make.defs | 5 ++++- arch/arm/src/armv7-m/arm_doirq.c | 3 +++ arch/arm/src/armv7-r/CMakeLists.txt | 6 ++++-- arch/arm/src/armv7-r/Make.defs | 5 ++++- arch/arm/src/armv7-r/arm_syscall.c | 6 ++---- arch/arm/src/armv7-r/arm_vectors.S | 4 ++-- arch/arm/src/armv8-m/CMakeLists.txt | 6 ++++-- arch/arm/src/armv8-m/Make.defs | 8 ++++++-- arch/arm/src/armv8-m/arm_doirq.c | 3 +++ arch/arm/src/armv8-m/arm_exception.S | 2 ++ arch/arm/src/armv8-r/CMakeLists.txt | 6 ++++-- arch/arm/src/armv8-r/Make.defs | 5 ++++- arch/arm/src/armv8-r/arm_vectors.S | 4 ++-- arch/arm/src/c5471/c5471_vectors.S | 4 +++- arch/arm/src/common/CMakeLists.txt | 11 +++++++---- arch/arm/src/common/Make.defs | 8 +++++--- arch/arm/src/common/arm_signal_dispatch.c | 4 ++-- arch/arm/src/common/gnu/arm_signal_handler.S | 4 ++-- arch/arm/src/tlsr82/tc32/Make.defs | 6 +++++- 39 files changed, 125 insertions(+), 52 deletions(-) diff --git a/arch/arm/include/arm/irq.h b/arch/arm/include/arm/irq.h index 59acf1aba7e22..61b68a1cae2b4 100644 --- a/arch/arm/include/arm/irq.h +++ b/arch/arm/include/arm/irq.h @@ -129,11 +129,13 @@ #ifndef __ASSEMBLY__ struct xcptcontext { +#ifdef CONFIG_ENABLE_ALL_SIGNALS /* These are saved copies of the context used during * signal processing. */ uint32_t *saved_regs; +#endif /* Register save area with XCPTCONTEXT_SIZE, only valid when: * 1.The task isn't running or diff --git a/arch/arm/include/armv6-m/irq.h b/arch/arm/include/armv6-m/irq.h index 6d75ccf466651..7a83579d1b572 100644 --- a/arch/arm/include/armv6-m/irq.h +++ b/arch/arm/include/armv6-m/irq.h @@ -158,6 +158,7 @@ struct xcpt_syscall_s struct xcptcontext { +#ifdef CONFIG_ENABLE_ALL_SIGNALS /* These are saved copies of the context used during * signal processing. */ @@ -171,6 +172,7 @@ struct xcptcontext uint32_t sigreturn; #endif +#endif /* CONFIG_ENABLE_ALL_SIGNALS */ #ifdef CONFIG_LIB_SYSCALL /* The following array holds the return address and the exc_return value diff --git a/arch/arm/include/armv7-a/irq.h b/arch/arm/include/armv7-a/irq.h index e1fb1ff6f9050..b7b298c22c013 100644 --- a/arch/arm/include/armv7-a/irq.h +++ b/arch/arm/include/armv7-a/irq.h @@ -259,6 +259,7 @@ struct xcpt_syscall_s struct xcptcontext { +#ifdef CONFIG_ENABLE_ALL_SIGNALS /* These are saved copies of the context used during * signal processing. */ @@ -273,6 +274,7 @@ struct xcptcontext uint32_t sigreturn; #endif +#endif /* CONFIG_ENABLE_ALL_SIGNALS */ /* Register save area with XCPTCONTEXT_SIZE, only valid when: * 1.The task isn't running or diff --git a/arch/arm/include/armv7-m/irq.h b/arch/arm/include/armv7-m/irq.h index 8c1cf80368c39..1f37bb6fbb546 100644 --- a/arch/arm/include/armv7-m/irq.h +++ b/arch/arm/include/armv7-m/irq.h @@ -214,6 +214,7 @@ struct xcpt_syscall_s struct xcptcontext { +#ifdef CONFIG_ENABLE_ALL_SIGNALS /* These are saved copies of the context used during * signal processing. */ @@ -228,6 +229,7 @@ struct xcptcontext uint32_t sigreturn; #endif +#endif /* CONFIG_ENABLE_ALL_SIGNALS */ #ifdef CONFIG_LIB_SYSCALL /* The following array holds the return address and the exc_return value diff --git a/arch/arm/include/armv7-r/irq.h b/arch/arm/include/armv7-r/irq.h index d25064c9ed801..6686cbc6a2662 100644 --- a/arch/arm/include/armv7-r/irq.h +++ b/arch/arm/include/armv7-r/irq.h @@ -259,6 +259,7 @@ struct xcpt_syscall_s struct xcptcontext { +#ifdef CONFIG_ENABLE_ALL_SIGNALS /* These are saved copies of the context used during * signal processing. */ @@ -272,6 +273,7 @@ struct xcptcontext uint32_t sigreturn; #endif +#endif /* CONFIG_ENABLE_ALL_SIGNALS */ /* Register save area with XCPTCONTEXT_SIZE, only valid when: * 1.The task isn't running or diff --git a/arch/arm/include/armv8-m/irq.h b/arch/arm/include/armv8-m/irq.h index a9fb63b9c86aa..3d4290eeb7fb2 100644 --- a/arch/arm/include/armv8-m/irq.h +++ b/arch/arm/include/armv8-m/irq.h @@ -225,6 +225,7 @@ struct xcpt_syscall_s struct xcptcontext { +#ifdef CONFIG_ENABLE_ALL_SIGNALS /* These are saved copies of the context used during * signal processing. */ @@ -239,6 +240,7 @@ struct xcptcontext uint32_t sigreturn; #endif +#endif /* CONFIG_ENABLE_ALL_SIGNALS */ #ifdef CONFIG_LIB_SYSCALL /* The following array holds the return address and the exc_return value diff --git a/arch/arm/include/armv8-r/irq.h b/arch/arm/include/armv8-r/irq.h index e08636f1e71f2..8d44efb644213 100644 --- a/arch/arm/include/armv8-r/irq.h +++ b/arch/arm/include/armv8-r/irq.h @@ -259,6 +259,7 @@ struct xcpt_syscall_s struct xcptcontext { +#ifdef CONFIG_ENABLE_ALL_SIGNALS /* These are saved copies of the context used during * signal processing. */ @@ -272,6 +273,7 @@ struct xcptcontext uint32_t sigreturn; #endif +#endif /* CONFIG_ENABLE_ALL_SIGNALS */ /* Register save area with XCPTCONTEXT_SIZE, only valid when: * 1.The task isn't running or diff --git a/arch/arm/include/tlsr82/irq.h b/arch/arm/include/tlsr82/irq.h index 7a89ac77a7e4f..a8a551cbe3eb8 100644 --- a/arch/arm/include/tlsr82/irq.h +++ b/arch/arm/include/tlsr82/irq.h @@ -160,12 +160,13 @@ #ifndef __ASSEMBLY__ struct xcptcontext { +#ifdef CONFIG_ENABLE_ALL_SIGNALS /* These are saved register array pointer used during * signal processing. */ uint32_t *saved_regs; - +#endif /* CONFIG_ENABLE_ALL_SIGNALS */ /* Register save area */ uint32_t *regs; diff --git a/arch/arm/src/arm/CMakeLists.txt b/arch/arm/src/arm/CMakeLists.txt index 7441d85d92724..b0a8f770d3ead 100644 --- a/arch/arm/src/arm/CMakeLists.txt +++ b/arch/arm/src/arm/CMakeLists.txt @@ -29,8 +29,6 @@ list( arm_doirq.c arm_initialstate.c arm_prefetchabort.c - arm_schedulesigaction.c - arm_sigdeliver.c arm_syscall.c arm_tcbinfo.c arm_undefinedinsn.c @@ -39,6 +37,10 @@ list( arm_vectortab.S arm_saveusercontext.S) +if(CONFIG_ENABLE_ALL_SIGNALS) + list(APPEND SRCS arm_schedulesigaction.c arm_sigdeliver.c) +endif() + if(CONFIG_PAGING) list(APPEND SRCS arm_pginitialize.c arm_checkmapping.c arm_allocpage.c arm_va2pte.c) diff --git a/arch/arm/src/arm/Make.defs b/arch/arm/src/arm/Make.defs index faff6009b70f9..43afb28c92003 100644 --- a/arch/arm/src/arm/Make.defs +++ b/arch/arm/src/arm/Make.defs @@ -27,13 +27,17 @@ include common/Make.defs HEAD_ASRC = arm_head.S CMN_CSRCS += arm_dataabort.c arm_doirq.c arm_initialstate.c -CMN_CSRCS += arm_prefetchabort.c arm_schedulesigaction.c -CMN_CSRCS += arm_sigdeliver.c arm_syscall.c arm_tcbinfo.c +CMN_CSRCS += arm_prefetchabort.c +CMN_CSRCS += arm_syscall.c arm_tcbinfo.c CMN_CSRCS += arm_undefinedinsn.c CMN_ASRCS += arm_cache.S arm_vectors.S arm_vectortab.S CMN_ASRCS += arm_saveusercontext.S +ifeq ($(CONFIG_ENABLE_ALL_SIGNALS),y) +CMN_CSRCS += arm_schedulesigaction.c arm_sigdeliver.c +endif + ifeq ($(CONFIG_LEGACY_PAGING),y) CMN_CSRCS += arm_pginitialize.c arm_checkmapping.c arm_allocpage.c arm_va2pte.c endif diff --git a/arch/arm/src/arm/arm_vectors.S b/arch/arm/src/arm/arm_vectors.S index 0b1887cb4cb95..add095fe3d09f 100644 --- a/arch/arm/src/arm/arm_vectors.S +++ b/arch/arm/src/arm/arm_vectors.S @@ -182,7 +182,7 @@ arm_vectorirq: /* Call arm_decodeirq() on the interrupt stack */ ldr sp, .Lirqstacktop /* SP = interrupt stack top */ -#else +#elif defined(CONFIG_ENABLE_ALL_SIGNALS) /* Call arm_decodeirq() on the user stack */ /* If the interrupt stack is disabled, reserve xcpcontext to ensure diff --git a/arch/arm/src/armv6-m/CMakeLists.txt b/arch/arm/src/armv6-m/CMakeLists.txt index 07d997dceb8bd..d5d289a6369d8 100644 --- a/arch/arm/src/armv6-m/CMakeLists.txt +++ b/arch/arm/src/armv6-m/CMakeLists.txt @@ -27,13 +27,15 @@ set(SRCS arm_doirq.c arm_hardfault.c arm_initialstate.c - arm_schedulesigaction.c - arm_sigdeliver.c arm_svcall.c arm_systemreset.c arm_tcbinfo.c arm_trigger_irq.c) +if(CONFIG_ENABLE_ALL_SIGNALS) + list(APPEND SRCS arm_schedulesigaction.c arm_sigdeliver.c) +endif() + if(NOT CONFIG_ARCH_HAVE_CUSTOM_VECTORS) list(APPEND SRCS arm_vectors.c) endif() diff --git a/arch/arm/src/armv6-m/Make.defs b/arch/arm/src/armv6-m/Make.defs index c97fa4ceacd07..666f2f5f307fe 100644 --- a/arch/arm/src/armv6-m/Make.defs +++ b/arch/arm/src/armv6-m/Make.defs @@ -27,10 +27,14 @@ include common/Make.defs CMN_ASRCS += arm_exception.S arm_saveusercontext.S CMN_CSRCS += arm_cpuinfo.c arm_doirq.c arm_hardfault.c arm_initialstate.c -CMN_CSRCS += arm_schedulesigaction.c arm_sigdeliver.c arm_svcall.c +CMN_CSRCS += arm_svcall.c CMN_CSRCS += arm_systemreset.c arm_tcbinfo.c CMN_CSRCS += arm_trigger_irq.c +ifeq ($(CONFIG_ENABLE_ALL_SIGNALS),y) +CMN_CSRCS += arm_schedulesigaction.c arm_sigdeliver.c +endif + ifneq ($(CONFIG_ARCH_HAVE_CUSTOM_VECTORS),y) CMN_CSRCS += arm_vectors.c endif diff --git a/arch/arm/src/armv6-m/arm_doirq.c b/arch/arm/src/armv6-m/arm_doirq.c index 24ef364482f53..4ee54a70bcf60 100644 --- a/arch/arm/src/armv6-m/arm_doirq.c +++ b/arch/arm/src/armv6-m/arm_doirq.c @@ -86,6 +86,7 @@ uint32_t *arm_doirq(int irq, uint32_t *regs) irq_dispatch(irq, regs); #endif +#ifdef CONFIG_ENABLE_ALL_SIGNALS if (tcb->sigdeliver) { /* Pendsv able to access running tcb with no critical section */ @@ -93,6 +94,7 @@ uint32_t *arm_doirq(int irq, uint32_t *regs) up_schedule_sigaction(tcb); } +#endif up_irq_save(); } else diff --git a/arch/arm/src/armv6-m/arm_exception.S b/arch/arm/src/armv6-m/arm_exception.S index 350415ce552a8..6577467d18777 100644 --- a/arch/arm/src/armv6-m/arm_exception.S +++ b/arch/arm/src/armv6-m/arm_exception.S @@ -158,7 +158,9 @@ exception_common: lsls r2, #(31 - EXC_RETURN_THREAD_BITNO) /* Move to bit 31 */ bpl 3f /* Test bit 31 */ mov r2, r1 /* Reserve signal context */ +#ifdef CONFIG_ENABLE_ALL_SIGNALS subs r2, r2, #XCPTCONTEXT_SIZE +#endif msr msp, r2 /* We are using the main stack pointer */ isb sy 3: diff --git a/arch/arm/src/armv7-a/CMakeLists.txt b/arch/arm/src/armv7-a/CMakeLists.txt index dcb6cdad90729..27cfd8bbb82b1 100644 --- a/arch/arm/src/armv7-a/CMakeLists.txt +++ b/arch/arm/src/armv7-a/CMakeLists.txt @@ -43,14 +43,16 @@ list( arm_initialstate.c arm_mmu.c arm_prefetchabort.c - arm_schedulesigaction.c - arm_sigdeliver.c arm_syscall.c arm_tcbinfo.c arm_undefinedinsn.c arm_perf.c cp15_cacheops.c) +if(CONFIG_ENABLE_ALL_SIGNALS) + list(APPEND SRCS arm_schedulesigaction.c arm_sigdeliver.c) +endif() + if(CONFIG_ARMV7A_GICv2M) list(APPEND SRCS arm_gicv2m.c) endif() diff --git a/arch/arm/src/armv7-a/Make.defs b/arch/arm/src/armv7-a/Make.defs index 690226f943f0b..07154bda71209 100644 --- a/arch/arm/src/armv7-a/Make.defs +++ b/arch/arm/src/armv7-a/Make.defs @@ -38,10 +38,13 @@ CMN_ASRCS += arm_cpuhead.S arm_vectors.S arm_saveusercontext.S CMN_CSRCS += arm_cache.c arm_cpuinfo.c arm_dataabort.c CMN_CSRCS += arm_doirq.c arm_gicv2.c arm_gicv2_dump.c CMN_CSRCS += arm_initialstate.c arm_mmu.c arm_prefetchabort.c -CMN_CSRCS += arm_schedulesigaction.c arm_sigdeliver.c CMN_CSRCS += arm_syscall.c arm_tcbinfo.c arm_undefinedinsn.c CMN_CSRCS += arm_perf.c cp15_cacheops.c +ifeq ($(CONFIG_ENABLE_ALL_SIGNALS),y) +CMN_CSRCS += arm_schedulesigaction.c arm_sigdeliver.c +endif + ifeq ($(CONFIG_ARMV7A_GICv2M),y) CMN_CSRCS += arm_gicv2m.c endif diff --git a/arch/arm/src/armv7-a/arm_syscall.c b/arch/arm/src/armv7-a/arm_syscall.c index 9bc9fcc4712dc..f0768cb8ae709 100644 --- a/arch/arm/src/armv7-a/arm_syscall.c +++ b/arch/arm/src/armv7-a/arm_syscall.c @@ -359,7 +359,7 @@ uint32_t *arm_syscall(uint32_t *regs) break; #endif -#ifdef CONFIG_BUILD_KERNEL +#if defined(CONFIG_BUILD_KERNEL) && defined(CONFIG_ENABLE_ALL_SIGNALS) /* R0=SYS_signal_handler: This a user signal handler callback * * void signal_handler(_sa_sigaction_t sighand, int signo, @@ -439,9 +439,7 @@ uint32_t *arm_syscall(uint32_t *regs) #endif } break; -#endif -#ifdef CONFIG_BUILD_KERNEL /* R0=SYS_signal_handler_return: This a user signal handler callback * * void signal_handler_return(void); @@ -480,7 +478,7 @@ uint32_t *arm_syscall(uint32_t *regs) #endif } break; -#endif +#endif /* CONFIG_BUILD_KERNEL && CONFIG_ENABLE_ALL_SIGNALS */ /* This is not an architecture-specific system call. If NuttX is built * as a standalone kernel with a system call interface, then all of the diff --git a/arch/arm/src/armv7-a/arm_vectors.S b/arch/arm/src/armv7-a/arm_vectors.S index e4768144be098..605c8aa97ecf6 100644 --- a/arch/arm/src/armv7-a/arm_vectors.S +++ b/arch/arm/src/armv7-a/arm_vectors.S @@ -219,7 +219,7 @@ arm_vectorirq: /* Call arm_decodeirq() on the interrupt stack */ setirqstack r1, r3 /* SP = interrupt stack top */ -#else +#elif defined(CONFIG_ENABLE_ALL_SIGNALS) /* Call arm_decodeirq() on the user stack */ /* If the interrupt stack is disabled, reserve xcpcontext to ensure @@ -337,7 +337,8 @@ arm_vectorsvc: /* Call arm_syscall() on the interrupt stack */ setirqstack r1, r3 /* SP = interrupt stack top */ -#else + +#elif defined(CONFIG_ENABLE_ALL_SIGNALS) /* Call arm_syscall() on the user stack */ /* If the interrupt stack is disabled, reserve xcpcontext to ensure diff --git a/arch/arm/src/armv7-m/CMakeLists.txt b/arch/arm/src/armv7-m/CMakeLists.txt index e5b3e89561d54..c00fb760c2df5 100644 --- a/arch/arm/src/armv7-m/CMakeLists.txt +++ b/arch/arm/src/armv7-m/CMakeLists.txt @@ -34,8 +34,6 @@ set(SRCS arm_itm.c arm_memfault.c arm_perf.c - arm_schedulesigaction.c - arm_sigdeliver.c arm_svcall.c arm_systemreset.c arm_tcbinfo.c @@ -43,6 +41,10 @@ set(SRCS arm_usagefault.c arm_dbgmonitor.c) +if(CONFIG_ENABLE_ALL_SIGNALS) + list(APPEND SRCS arm_schedulesigaction.c arm_sigdeliver.c) +endif() + if(NOT CONFIG_ARCH_HAVE_CUSTOM_VECTORS) list(APPEND SRCS arm_vectors.c) endif() diff --git a/arch/arm/src/armv7-m/Make.defs b/arch/arm/src/armv7-m/Make.defs index 2c41882903114..21a2067e7cefc 100644 --- a/arch/arm/src/armv7-m/Make.defs +++ b/arch/arm/src/armv7-m/Make.defs @@ -29,10 +29,13 @@ CMN_ASRCS += arm_exception.S arm_saveusercontext.S CMN_CSRCS += arm_busfault.c arm_cache.c arm_cpuinfo.c arm_doirq.c CMN_CSRCS += arm_hardfault.c arm_initialstate.c arm_itm.c CMN_CSRCS += arm_memfault.c arm_perf.c -CMN_CSRCS += arm_schedulesigaction.c arm_sigdeliver.c CMN_CSRCS += arm_svcall.c arm_systemreset.c arm_tcbinfo.c CMN_CSRCS += arm_trigger_irq.c arm_usagefault.c arm_dbgmonitor.c +ifeq ($(CONFIG_ENABLE_ALL_SIGNALS),y) +CMN_CSRCS += arm_schedulesigaction.c arm_sigdeliver.c +endif + ifneq ($(CONFIG_ARCH_HAVE_CUSTOM_VECTORS),y) CMN_CSRCS += arm_vectors.c endif diff --git a/arch/arm/src/armv7-m/arm_doirq.c b/arch/arm/src/armv7-m/arm_doirq.c index c3126341e3360..9d22058ea0a81 100644 --- a/arch/arm/src/armv7-m/arm_doirq.c +++ b/arch/arm/src/armv7-m/arm_doirq.c @@ -86,6 +86,7 @@ uint32_t *arm_doirq(int irq, uint32_t *regs) irq_dispatch(irq, regs); #endif +#ifdef CONFIG_ENABLE_ALL_SIGNALS if (tcb->sigdeliver) { /* Pendsv able to access running tcb with no critical section */ @@ -93,6 +94,8 @@ uint32_t *arm_doirq(int irq, uint32_t *regs) up_schedule_sigaction(tcb); } +#endif + up_irq_save(); } else diff --git a/arch/arm/src/armv7-r/CMakeLists.txt b/arch/arm/src/armv7-r/CMakeLists.txt index 5006f13659f59..f127f628ae4b5 100644 --- a/arch/arm/src/armv7-r/CMakeLists.txt +++ b/arch/arm/src/armv7-r/CMakeLists.txt @@ -39,14 +39,16 @@ list( arm_doirq.c arm_initialstate.c arm_prefetchabort.c - arm_schedulesigaction.c - arm_sigdeliver.c arm_syscall.c arm_tcbinfo.c arm_undefinedinsn.c arm_perf.c cp15_cacheops.c) +if(CONFIG_ENABLE_ALL_SIGNALS) + list(APPEND SRCS arm_schedulesigaction.c arm_sigdeliver.c) +endif() + if(NOT CONFIG_ARCH_CHIP STREQUAL tms570) list(APPEND SRCS arm_gicv2.c arm_gicv2_dump.c) endif() diff --git a/arch/arm/src/armv7-r/Make.defs b/arch/arm/src/armv7-r/Make.defs index a0c29c9d72cc1..70480712b2b00 100644 --- a/arch/arm/src/armv7-r/Make.defs +++ b/arch/arm/src/armv7-r/Make.defs @@ -34,7 +34,6 @@ HEAD_ASRC += arm_vectortab.S CMN_CSRCS += arm_cache.c arm_cpuinfo.c arm_dataabort.c CMN_CSRCS += arm_doirq.c arm_gicv2.c arm_gicv2_dump.c CMN_CSRCS += arm_initialstate.c arm_prefetchabort.c -CMN_CSRCS += arm_schedulesigaction.c arm_sigdeliver.c CMN_CSRCS += arm_syscall.c arm_tcbinfo.c arm_undefinedinsn.c CMN_CSRCS += arm_perf.c cp15_cacheops.c @@ -42,6 +41,10 @@ CMN_CSRCS += arm_perf.c cp15_cacheops.c CMN_ASRCS += arm_head.S arm_vectors.S arm_saveusercontext.S +ifeq ($(CONFIG_ENABLE_ALL_SIGNALS),y) +CMN_CSRCS += arm_schedulesigaction.c arm_sigdeliver.c +endif + ifeq ($(CONFIG_ARMV7R_HAVE_PTM), y) CMN_CSRCS += arm_timer.c endif diff --git a/arch/arm/src/armv7-r/arm_syscall.c b/arch/arm/src/armv7-r/arm_syscall.c index bd2fa08862fed..cbfa5b8f58f70 100644 --- a/arch/arm/src/armv7-r/arm_syscall.c +++ b/arch/arm/src/armv7-r/arm_syscall.c @@ -353,7 +353,7 @@ uint32_t *arm_syscall(uint32_t *regs) break; #endif -#ifdef CONFIG_BUILD_PROTECTED +#if defined(CONFIG_BUILD_PROTECTED) && defined(CONFIG_ENABLE_ALL_SIGNALS) /* R0=SYS_signal_handler: This a user signal handler callback * * void signal_handler(_sa_sigaction_t sighand, int signo, @@ -433,9 +433,7 @@ uint32_t *arm_syscall(uint32_t *regs) #endif } break; -#endif -#ifdef CONFIG_BUILD_PROTECTED /* R0=SYS_signal_handler_return: This a user signal handler callback * * void signal_handler_return(void); @@ -474,7 +472,7 @@ uint32_t *arm_syscall(uint32_t *regs) #endif } break; -#endif +#endif /* CONFIG_BUILD_PROTECTED && CONFIG_ENABLE_ALL_SIGNALS */ /* This is not an architecture-specific system call. If NuttX is built * as a standalone kernel with a system call interface, then all of the diff --git a/arch/arm/src/armv7-r/arm_vectors.S b/arch/arm/src/armv7-r/arm_vectors.S index d34bd98d3b074..648ea41d0e341 100644 --- a/arch/arm/src/armv7-r/arm_vectors.S +++ b/arch/arm/src/armv7-r/arm_vectors.S @@ -201,7 +201,7 @@ arm_vectorirq: /* Call arm_decodeirq() on the interrupt stack */ setirqstack r1, r3 /* SP = interrupt stack top */ -#else +#elif defined(CONFIG_ENABLE_ALL_SIGNALS) /* Call arm_decodeirq() on the user stack */ /* If the interrupt stack is disabled, reserve xcpcontext to ensure @@ -313,7 +313,7 @@ arm_vectorsvc: /* Call arm_syscall() on the interrupt stack */ setirqstack r1, r3 /* SP = interrupt stack top */ -#else +#elif defined(CONFIG_ENABLE_ALL_SIGNALS) /* Call arm_syscall() on the user stack */ /* If the interrupt stack is disabled, reserve xcpcontext to ensure diff --git a/arch/arm/src/armv8-m/CMakeLists.txt b/arch/arm/src/armv8-m/CMakeLists.txt index a954e55c9ed76..e87185659a738 100644 --- a/arch/arm/src/armv8-m/CMakeLists.txt +++ b/arch/arm/src/armv8-m/CMakeLists.txt @@ -34,16 +34,18 @@ set(SRCS arm_memfault.c arm_perf.c arm_sau.c - arm_schedulesigaction.c arm_securefault.c arm_secure_irq.c - arm_sigdeliver.c arm_svcall.c arm_systemreset.c arm_tcbinfo.c arm_trigger_irq.c arm_usagefault.c) +if(CONFIG_ENABLE_ALL_SIGNALS) + list(APPEND SRCS arm_schedulesigaction.c arm_sigdeliver.c) +endif() + if(NOT CONFIG_ARCH_HAVE_CUSTOM_VECTORS) list(APPEND SRCS arm_vectors.c) endif() diff --git a/arch/arm/src/armv8-m/Make.defs b/arch/arm/src/armv8-m/Make.defs index 2b70995c63f6c..326cdff7c087a 100644 --- a/arch/arm/src/armv8-m/Make.defs +++ b/arch/arm/src/armv8-m/Make.defs @@ -29,11 +29,15 @@ CMN_ASRCS += arm_exception.S arm_saveusercontext.S CMN_CSRCS += arm_busfault.c arm_cache.c arm_cpuinfo.c arm_doirq.c CMN_CSRCS += arm_hardfault.c arm_initialstate.c arm_itm.c CMN_CSRCS += arm_memfault.c arm_perf.c arm_sau.c -CMN_CSRCS += arm_schedulesigaction.c arm_securefault.c arm_secure_irq.c -CMN_CSRCS += arm_sigdeliver.c arm_svcall.c +CMN_CSRCS += arm_securefault.c arm_secure_irq.c +CMN_CSRCS += arm_svcall.c CMN_CSRCS += arm_systemreset.c arm_tcbinfo.c CMN_CSRCS += arm_trigger_irq.c arm_usagefault.c arm_dbgmonitor.c +ifeq ($(CONFIG_ENABLE_ALL_SIGNALS),y) +CMN_CSRCS += arm_schedulesigaction.c arm_sigdeliver.c +endif + ifneq ($(CONFIG_ARCH_HAVE_CUSTOM_VECTORS),y) CMN_CSRCS += arm_vectors.c endif diff --git a/arch/arm/src/armv8-m/arm_doirq.c b/arch/arm/src/armv8-m/arm_doirq.c index 5f902b1edacad..a327eeabd7a1d 100644 --- a/arch/arm/src/armv8-m/arm_doirq.c +++ b/arch/arm/src/armv8-m/arm_doirq.c @@ -98,6 +98,7 @@ uint32_t *arm_doirq(int irq, uint32_t *regs) irq_dispatch(irq, regs); #endif +#ifdef CONFIG_ENABLE_ALL_SIGNALS if (tcb->sigdeliver) { /* Pendsv able to access running tcb with no critical section */ @@ -105,6 +106,8 @@ uint32_t *arm_doirq(int irq, uint32_t *regs) up_schedule_sigaction(tcb); } +#endif + up_irq_save(); } else diff --git a/arch/arm/src/armv8-m/arm_exception.S b/arch/arm/src/armv8-m/arm_exception.S index 5c54747c1fff0..8c3f27193f6d9 100644 --- a/arch/arm/src/armv8-m/arm_exception.S +++ b/arch/arm/src/armv8-m/arm_exception.S @@ -205,9 +205,11 @@ exception_common: */ tst r14, #EXC_RETURN_THREAD_MODE /* Nonzero if context on thread mode */ beq 3f /* Branch if context already on the handle mode */ +#ifdef CONFIG_ENABLE_ALL_SIGNALS sub r2, r1, #XCPTCONTEXT_SIZE /* Reserve signal context */ bic r2, r2, #7 /* Get the stack pointer with 8-byte alignment */ mov sp, r2 /* Instantiate the aligned stack */ +#endif 3: #endif mov fp, r1 diff --git a/arch/arm/src/armv8-r/CMakeLists.txt b/arch/arm/src/armv8-r/CMakeLists.txt index 23dcc0fd03320..916f49d833af9 100644 --- a/arch/arm/src/armv8-r/CMakeLists.txt +++ b/arch/arm/src/armv8-r/CMakeLists.txt @@ -41,14 +41,16 @@ list( arm_gicv3.c arm_initialstate.c arm_prefetchabort.c - arm_schedulesigaction.c - arm_sigdeliver.c arm_syscall.c arm_tcbinfo.c arm_undefinedinsn.c arm_perf.c cp15_cacheops.c) +if(CONFIG_ENABLE_ALL_SIGNALS) + list(APPEND SRCS arm_schedulesigaction.c arm_sigdeliver.c) +endif() + if(CONFIG_ARCH_FPU) list(APPEND SRCS arm_fpucmp.c arm_fpuconfig.S) endif() diff --git a/arch/arm/src/armv8-r/Make.defs b/arch/arm/src/armv8-r/Make.defs index 8883d8e55f48c..e1086b8e78598 100644 --- a/arch/arm/src/armv8-r/Make.defs +++ b/arch/arm/src/armv8-r/Make.defs @@ -34,10 +34,13 @@ HEAD_ASRC += arm_vectortab.S CMN_CSRCS += arm_timer.c arm_cache.c arm_cpuinfo.c arm_dataabort.c CMN_CSRCS += arm_doirq.c arm_gicv3.c CMN_CSRCS += arm_initialstate.c arm_prefetchabort.c -CMN_CSRCS += arm_schedulesigaction.c arm_sigdeliver.c CMN_CSRCS += arm_syscall.c arm_tcbinfo.c arm_undefinedinsn.c CMN_CSRCS += arm_perf.c cp15_cacheops.c +ifeq ($(CONFIG_ENABLE_ALL_SIGNALS),y) +CMN_CSRCS += arm_schedulesigaction.c arm_sigdeliver.c +endif + # Common C source files CMN_ASRCS += arm_head.S arm_vectors.S arm_saveusercontext.S diff --git a/arch/arm/src/armv8-r/arm_vectors.S b/arch/arm/src/armv8-r/arm_vectors.S index abe52d606c0fd..8a0ea9d1f0143 100644 --- a/arch/arm/src/armv8-r/arm_vectors.S +++ b/arch/arm/src/armv8-r/arm_vectors.S @@ -262,7 +262,7 @@ arm_vectorirq: /* Call arm_decodeirq() on the interrupt stack */ setirqstack r1, r3 /* SP = interrupt stack top */ -#else +#elif defined(CONFIG_ENABLE_ALL_SIGNALS) /* Call arm_decodeirq() on the user stack */ /* If the interrupt stack is disabled, reserve xcpcontext to ensure @@ -382,7 +382,7 @@ arm_vectorsvc: /* Call arm_syscall() on the interrupt stack */ setirqstack r1, r3 /* SP = interrupt stack top */ -#else +#elif defined(CONFIG_ENABLE_ALL_SIGNALS) /* Call arm_syscall() on the user stack */ /* If the interrupt stack is disabled, reserve xcpcontext to ensure diff --git a/arch/arm/src/c5471/c5471_vectors.S b/arch/arm/src/c5471/c5471_vectors.S index 3a71d938580e9..beb43c51a545d 100644 --- a/arch/arm/src/c5471/c5471_vectors.S +++ b/arch/arm/src/c5471/c5471_vectors.S @@ -151,7 +151,7 @@ arm_vectorirq: str r1, [sp, #-4]! /* Save the xcp address at SP-4 then update SP */ bl arm_doirq /* Call the handler */ ldr sp, [sp] /* Restore the user stack pointer */ -#else +#elif defined(CONFIG_ENABLE_ALL_SIGNALS) /* If the interrupt stack is disabled, reserve xcpcontext to ensure * that signal processing can have a separate xcpcontext to handle * signal context (reference: arm_schedulesigaction.c): @@ -163,9 +163,11 @@ arm_vectorirq: */ sub sp, sp, #XCPTCONTEXT_SIZE /* Reserve signal context */ +#endif bl arm_doirq /* Call the handler */ +#ifdef CONFIG_ENABLE_ALL_SIGNALS add sp, sp, #XCPTCONTEXT_SIZE /* Restore signal context */ #endif diff --git a/arch/arm/src/common/CMakeLists.txt b/arch/arm/src/common/CMakeLists.txt index 4f4a3eeb0ff7e..a47d071a59ec3 100644 --- a/arch/arm/src/common/CMakeLists.txt +++ b/arch/arm/src/common/CMakeLists.txt @@ -52,11 +52,14 @@ if(NOT CONFIG_ARCH_IDLE_CUSTOM) endif() if(CONFIG_BUILD_PROTECTED OR CONFIG_BUILD_KERNEL) - list(APPEND SRCS arm_task_start.c arm_pthread_start.c arm_signal_dispatch.c) + list(APPEND SRCS arm_task_start.c arm_pthread_start.c) - if(CONFIG_BUILD_PROTECTED) - target_sources(arch_interface - PRIVATE ${ARCH_TOOLCHAIN_PATH}/arm_signal_handler.S) + if(CONFIG_ENABLE_ALL_SIGNALS) + list(APPEND SRCS arm_signal_dispatch.c) + if(CONFIG_BUILD_PROTECTED) + target_sources(arch_interface + PRIVATE ${ARCH_TOOLCHAIN_PATH}/arm_signal_handler.S) + endif() endif() endif() diff --git a/arch/arm/src/common/Make.defs b/arch/arm/src/common/Make.defs index 7616bd472de28..bec209f47b643 100644 --- a/arch/arm/src/common/Make.defs +++ b/arch/arm/src/common/Make.defs @@ -40,9 +40,11 @@ endif ifeq ($(CONFIG_BUILD_PROTECTED)$(CONFIG_BUILD_KERNEL),y) CMN_CSRCS += arm_task_start.c arm_pthread_start.c - CMN_CSRCS += arm_signal_dispatch.c - ifeq ($(CONFIG_BUILD_PROTECTED),y) - CMN_UASRCS += arm_signal_handler.S + ifeq ($(CONFIG_ENABLE_ALL_SIGNALS),y) + CMN_CSRCS += arm_signal_dispatch.c + ifeq ($(CONFIG_BUILD_PROTECTED),y) + CMN_UASRCS += arm_signal_handler.S + endif endif endif diff --git a/arch/arm/src/common/arm_signal_dispatch.c b/arch/arm/src/common/arm_signal_dispatch.c index 79ac0e05f108d..97914d9d1749b 100644 --- a/arch/arm/src/common/arm_signal_dispatch.c +++ b/arch/arm/src/common/arm_signal_dispatch.c @@ -31,7 +31,7 @@ #include "arm_internal.h" -#if !defined(CONFIG_BUILD_FLAT) && defined(__KERNEL__) +#ifdef __KERNEL__ /**************************************************************************** * Public Functions @@ -75,4 +75,4 @@ void up_signal_dispatch(_sa_sigaction_t sighand, int signo, (uintptr_t)info, (uintptr_t)ucontext); } -#endif /* !CONFIG_BUILD_FLAT && __KERNEL__ */ +#endif /* __KERNEL__ */ diff --git a/arch/arm/src/common/gnu/arm_signal_handler.S b/arch/arm/src/common/gnu/arm_signal_handler.S index 0f029cc730601..f4286423ee596 100644 --- a/arch/arm/src/common/gnu/arm_signal_handler.S +++ b/arch/arm/src/common/gnu/arm_signal_handler.S @@ -28,7 +28,7 @@ #include -#if defined(CONFIG_BUILD_PROTECTED) && !defined(__KERNEL__) +#ifndef __KERNEL__ /**************************************************************************** * File info @@ -109,4 +109,4 @@ up_signal_handler: .size up_signal_handler, .-up_signal_handler .end -#endif /* CONFIG_BUILD_PROTECTED && !__KERNEL__ */ +#endif /* !__KERNEL__ */ diff --git a/arch/arm/src/tlsr82/tc32/Make.defs b/arch/arm/src/tlsr82/tc32/Make.defs index 8be5e2e032416..60eeaddd1f17c 100644 --- a/arch/arm/src/tlsr82/tc32/Make.defs +++ b/arch/arm/src/tlsr82/tc32/Make.defs @@ -55,9 +55,13 @@ CMN_CSRCS += arm_sigdeliver.c CMN_ASRCS += tc32_fullcontextrestore.S tc32_switchcontext.S CMN_ASRCS += tc32_saveusercontext.S tc32_exception.S -CMN_CSRCS += tc32_doirq.c tc32_initialstate.c tc32_schedulesigaction.c +CMN_CSRCS += tc32_doirq.c tc32_initialstate.c CMN_CSRCS += tc32_syscall.c tc32_udelay.c +ifeq ($(CONFIG_ENABLE_ALL_SIGNALS),y) + CHIP_CSRCS += tc32_schedulesigaction.c +endif + ifeq ($(CONFIG_SCHED_BACKTRACE),y) CMN_CSRCS += tc32_backtrace.c endif From ac90a3c7d51894264f66df5e3fa013c51ff67289 Mon Sep 17 00:00:00 2001 From: wangchengdong Date: Sun, 11 Jan 2026 15:45:37 +0800 Subject: [PATCH 04/19] arch/risc-v: Add support to disable signals actions related data struct Add support to disable signals actions related struct Co-authored-by: guoshichao Signed-off-by: Chengdong Wang --- arch/risc-v/include/irq.h | 2 ++ arch/risc-v/src/common/CMakeLists.txt | 13 +++++++++---- arch/risc-v/src/common/Make.defs | 11 ++++++++--- arch/risc-v/src/common/riscv_exception_common.S | 4 ++++ arch/risc-v/src/common/riscv_signal_dispatch.c | 4 ++-- 5 files changed, 25 insertions(+), 9 deletions(-) diff --git a/arch/risc-v/include/irq.h b/arch/risc-v/include/irq.h index d25089b5da149..3dd83618d03e0 100644 --- a/arch/risc-v/include/irq.h +++ b/arch/risc-v/include/irq.h @@ -569,6 +569,7 @@ struct xcptcontext { +#ifdef CONFIG_ENABLE_ALL_SIGNALS /* These additional register save locations are used to implement the * signal delivery trampoline. * @@ -587,6 +588,7 @@ struct xcptcontext uintptr_t sigreturn; #endif +#endif /* CONFIG_ENABLE_ALL_SIGNALS */ #ifdef CONFIG_ARCH_ADDRENV #ifdef CONFIG_ARCH_KERNEL_STACK diff --git a/arch/risc-v/src/common/CMakeLists.txt b/arch/risc-v/src/common/CMakeLists.txt index cb765c81fa8a1..84a1d43fb47c8 100644 --- a/arch/risc-v/src/common/CMakeLists.txt +++ b/arch/risc-v/src/common/CMakeLists.txt @@ -30,11 +30,14 @@ list(APPEND SRCS riscv_cpuinfo.c riscv_createstack.c riscv_doirq.c list(APPEND SRCS riscv_exit.c riscv_getintstack.c riscv_getnewintctx.c) list(APPEND SRCS riscv_initialize.c riscv_initialstate.c riscv_modifyreg32.c) list(APPEND SRCS riscv_nputs.c riscv_registerdump.c) -list(APPEND SRCS riscv_releasestack.c riscv_schedulesigaction.c - riscv_sigdeliver.c) +list(APPEND SRCS riscv_releasestack.c) list(APPEND SRCS riscv_stackframe.c riscv_tcbinfo.c riscv_swint.c) list(APPEND SRCS riscv_switchcontext.c riscv_usestack.c) +if(CONFIG_ENABLE_ALL_SIGNALS) + list(APPEND SRCS riscv_schedulesigaction.c riscv_sigdeliver.c) +endif() + if(CONFIG_ONESHOT) list(APPEND SRCS riscv_mtimer.c) endif() @@ -66,8 +69,10 @@ if(CONFIG_ARCH_HAVE_DEBUG) endif() if(NOT CONFIG_BUILD_FLAT) - list(APPEND SRCS riscv_task_start.c riscv_pthread_start.c - riscv_signal_dispatch.c) + list(APPEND SRCS riscv_task_start.c riscv_pthread_start.c) + if(CONFIG_ENABLE_ALL_SIGNALS) + list(APPEND SRCS riscv_signal_dispatch.c) + endif() if(CONFIG_BUILD_PROTECTED) target_sources(arch_interface PRIVATE riscv_signal_handler.S) endif() diff --git a/arch/risc-v/src/common/Make.defs b/arch/risc-v/src/common/Make.defs index d39d6a7a3c9dd..d98a828c508e0 100644 --- a/arch/risc-v/src/common/Make.defs +++ b/arch/risc-v/src/common/Make.defs @@ -32,10 +32,13 @@ CMN_CSRCS += riscv_allocateheap.c riscv_createstack.c riscv_cpuinfo.c CMN_CSRCS += riscv_cpuidlestack.c riscv_doirq.c riscv_exit.c riscv_exception.c CMN_CSRCS += riscv_getnewintctx.c riscv_getintstack.c riscv_initialstate.c CMN_CSRCS += riscv_modifyreg32.c riscv_nputs.c riscv_releasestack.c -CMN_CSRCS += riscv_registerdump.c riscv_stackframe.c riscv_schedulesigaction.c -CMN_CSRCS += riscv_sigdeliver.c riscv_switchcontext.c +CMN_CSRCS += riscv_registerdump.c riscv_stackframe.c riscv_switchcontext.c CMN_CSRCS += riscv_usestack.c riscv_tcbinfo.c +ifeq ($(CONFIG_ENABLE_ALL_SIGNALS),y) +CMN_CSRCS += riscv_schedulesigaction.c riscv_sigdeliver.c +endif + ifeq ($(CONFIG_ONESHOT),y) CMN_CSRCS += riscv_mtimer.c endif @@ -69,7 +72,9 @@ endif ifneq ($(CONFIG_BUILD_FLAT),y) CMN_CSRCS += riscv_task_start.c CMN_CSRCS += riscv_pthread_start.c -CMN_CSRCS += riscv_signal_dispatch.c +ifeq ($(CONFIG_ENABLE_ALL_SIGNALS),y) + CMN_CSRCS += riscv_signal_dispatch.c +endif CMN_UASRCS += riscv_signal_handler.S endif diff --git a/arch/risc-v/src/common/riscv_exception_common.S b/arch/risc-v/src/common/riscv_exception_common.S index cae7250be2e6f..7bcc4a5de1661 100644 --- a/arch/risc-v/src/common/riscv_exception_common.S +++ b/arch/risc-v/src/common/riscv_exception_common.S @@ -239,7 +239,9 @@ handle_irq: REGSTORE s0, 0(sp) add s0, sp, (INT_REG_SIZE * 2) +#ifdef CONFIG_ENABLE_ALL_SIGNALS addi sp, sp, -XCPTCONTEXT_SIZE +#endif /* Call interrupt handler in C */ @@ -249,10 +251,12 @@ handle_irq: REGLOAD s0, 0(sp) add sp, sp, (INT_REG_SIZE * 2) +#ifdef CONFIG_ENABLE_ALL_SIGNALS /* Restore sp */ addi sp, sp, XCPTCONTEXT_SIZE #endif +#endif return_from_exception: diff --git a/arch/risc-v/src/common/riscv_signal_dispatch.c b/arch/risc-v/src/common/riscv_signal_dispatch.c index 80416c0694053..85e6d7ae95052 100644 --- a/arch/risc-v/src/common/riscv_signal_dispatch.c +++ b/arch/risc-v/src/common/riscv_signal_dispatch.c @@ -31,7 +31,7 @@ #include "riscv_internal.h" -#if !defined(CONFIG_BUILD_FLAT) && defined(__KERNEL__) +#ifdef __KERNEL__ /**************************************************************************** * Public Functions @@ -75,4 +75,4 @@ void up_signal_dispatch(_sa_sigaction_t sighand, int signo, (uintptr_t)info, (uintptr_t)ucontext); } -#endif /* !CONFIG_BUILD_FLAT && __KERNEL__ */ +#endif /* __KERNEL__ */ From 3da13c35b04fc52a9ab7bf082b8f558997c69380 Mon Sep 17 00:00:00 2001 From: wangchengdong Date: Tue, 23 Dec 2025 10:48:46 +0800 Subject: [PATCH 05/19] arch/arm64: Add support to disable signals actions related data struct Add support to disable signals actions related struct Co-authored-by: guoshichao Signed-off-by: Chengdong Wang --- arch/arm64/include/irq.h | 10 ++++++---- arch/arm64/src/common/CMakeLists.txt | 11 ++++++++--- arch/arm64/src/common/Make.defs | 10 ++++++++-- arch/arm64/src/common/arm64_signal_dispatch.c | 4 ++-- arch/arm64/src/common/arm64_syscall.c | 6 ++---- 5 files changed, 26 insertions(+), 15 deletions(-) diff --git a/arch/arm64/include/irq.h b/arch/arm64/include/irq.h index 773097ff06d07..1779009d9aa12 100644 --- a/arch/arm64/include/irq.h +++ b/arch/arm64/include/irq.h @@ -259,6 +259,11 @@ extern "C" struct xcptcontext { +#ifdef CONFIG_ENABLE_ALL_SIGNALS + /* task context, for signal process */ + + uint64_t *saved_regs; + #ifdef CONFIG_BUILD_KERNEL /* This is the saved address to use when returning from a user-space * signal handler. @@ -267,6 +272,7 @@ struct xcptcontext uintptr_t sigreturn; #endif +#endif /* CONFIG_ENABLE_ALL_SIGNALS */ /* task stack reg context */ uint64_t *regs; @@ -274,10 +280,6 @@ struct xcptcontext uint64_t *initregs; #endif - /* task context, for signal process */ - - uint64_t *saved_regs; - #ifdef CONFIG_ARCH_FPU uint64_t *fpu_regs; uint64_t *saved_fpu_regs; diff --git a/arch/arm64/src/common/CMakeLists.txt b/arch/arm64/src/common/CMakeLists.txt index 4a8c826755bd1..335cf602a48ce 100644 --- a/arch/arm64/src/common/CMakeLists.txt +++ b/arch/arm64/src/common/CMakeLists.txt @@ -32,7 +32,6 @@ list(APPEND SRCS arm64_initialize.c arm64_initialstate.c arm64_boot.c) list(APPEND SRCS arm64_nputs.c arm64_createstack.c) list(APPEND SRCS arm64_releasestack.c arm64_stackframe.c arm64_usestack.c) list(APPEND SRCS arm64_exit.c arm64_fork.c) -list(APPEND SRCS arm64_schedulesigaction.c arm64_sigdeliver.c) list(APPEND SRCS arm64_getintstack.c arm64_registerdump.c) list(APPEND SRCS arm64_perf.c arm64_tcbinfo.c) @@ -44,6 +43,10 @@ list(APPEND SRCS arm64_syscall.c) # Use common heap allocation for now (may need to be customized later) list(APPEND SRCS arm64_allocateheap.c) +if(CONFIG_ENABLE_ALL_SIGNALS) + list(APPEND SRCS arm64_schedulesigaction.c arm64_sigdeliver.c) +endif() + if(NOT CONFIG_ARCH_IDLE_CUSTOM) list(APPEND SRCS arm64_idle.c) endif() @@ -89,8 +92,10 @@ if(CONFIG_SMP) endif() if(CONFIG_BUILD_KERNEL) - list(APPEND SRCS arm64_task_start.c arm64_pthread_start.c - arm64_signal_dispatch.c) + list(APPEND SRCS arm64_task_start.c arm64_pthread_start.c) + if(CONFIG_ENABLE_ALL_SIGNALS) + list(APPEND SRCS arm64_signal_dispatch.c) + endif() endif() if(CONFIG_ARCH_KERNEL_STACK) diff --git a/arch/arm64/src/common/Make.defs b/arch/arm64/src/common/Make.defs index 2d8b1759e5557..7a782b3faa043 100644 --- a/arch/arm64/src/common/Make.defs +++ b/arch/arm64/src/common/Make.defs @@ -39,7 +39,6 @@ CMN_CSRCS = arm64_initialize.c arm64_initialstate.c arm64_boot.c CMN_CSRCS += arm64_nputs.c arm64_createstack.c CMN_CSRCS += arm64_releasestack.c arm64_stackframe.c arm64_usestack.c CMN_CSRCS += arm64_exit.c arm64_fork.c -CMN_CSRCS += arm64_schedulesigaction.c arm64_sigdeliver.c CMN_CSRCS += arm64_getintstack.c arm64_registerdump.c CMN_CSRCS += arm64_perf.c arm64_tcbinfo.c @@ -50,6 +49,10 @@ CMN_CSRCS += arm64_syscall.c CMN_CSRCS += arm64_modifyreg8.c arm64_modifyreg16.c arm64_modifyreg32.c CMN_CSRCS += arm64_hwdebug.c +ifeq ($(CONFIG_ENABLE_ALL_SIGNALS),y) +CMN_CSRCS += arm64_schedulesigaction.c arm64_sigdeliver.c +endif + # Use common heap allocation for now (may need to be customized later) CMN_CSRCS += arm64_allocateheap.c @@ -99,7 +102,10 @@ CMN_CSRCS += arm64_smpcall.c endif ifeq ($(CONFIG_BUILD_KERNEL),y) -CMN_CSRCS += arm64_task_start.c arm64_pthread_start.c arm64_signal_dispatch.c +CMN_CSRCS += arm64_task_start.c arm64_pthread_start.c + ifeq ($(CONFIG_ENABLE_ALL_SIGNALS),y) + CMN_CSRCS += arm64_signal_dispatch.c + endif endif ifeq ($(CONFIG_ARCH_KERNEL_STACK),y) diff --git a/arch/arm64/src/common/arm64_signal_dispatch.c b/arch/arm64/src/common/arm64_signal_dispatch.c index 2c4bdc90a4120..79dcf447582b4 100644 --- a/arch/arm64/src/common/arm64_signal_dispatch.c +++ b/arch/arm64/src/common/arm64_signal_dispatch.c @@ -31,7 +31,7 @@ #include "arm64_internal.h" -#if !defined(CONFIG_BUILD_FLAT) && defined(__KERNEL__) +#ifdef __KERNEL__ /**************************************************************************** * Public Functions @@ -75,4 +75,4 @@ void up_signal_dispatch(_sa_sigaction_t sighand, int signo, (uintptr_t)info, (uintptr_t)ucontext); } -#endif /* !CONFIG_BUILD_FLAT && __KERNEL__ */ +#endif /* __KERNEL__ */ diff --git a/arch/arm64/src/common/arm64_syscall.c b/arch/arm64/src/common/arm64_syscall.c index 166dc8963d051..8994490fd5c8f 100644 --- a/arch/arm64/src/common/arm64_syscall.c +++ b/arch/arm64/src/common/arm64_syscall.c @@ -210,7 +210,7 @@ uint64_t *arm64_syscall(uint64_t *regs) #endif break; -#ifdef CONFIG_BUILD_KERNEL +#if defined(CONFIG_BUILD_KERNEL) && defined(CONFIG_ENABLE_ALL_SIGNALS) /* R0=SYS_signal_handler: This a user signal handler callback * * void signal_handler(_sa_sigaction_t sighand, int signo, @@ -277,9 +277,7 @@ uint64_t *arm64_syscall(uint64_t *regs) #endif } break; -#endif -#ifdef CONFIG_BUILD_KERNEL /* R0=SYS_signal_handler_return: This a user signal handler callback * * void signal_handler_return(void); @@ -309,7 +307,7 @@ uint64_t *arm64_syscall(uint64_t *regs) #endif } break; -#endif +#endif /* CONFIG_BUILD_KERNEL && CONFIG_ENABLE_ALL_SIGNALS */ default: { From c94103c3638ac1c7e4f1150153ecd381bb981de2 Mon Sep 17 00:00:00 2001 From: wangchengdong Date: Tue, 23 Dec 2025 11:05:45 +0800 Subject: [PATCH 06/19] arch/tricore: Add support to disable signals actions related data struct Add support to disable signals actions related struct Co-authored-by: guoshichao Signed-off-by: Chengdong Wang --- arch/tricore/include/tc3xx/irq.h | 3 ++- arch/tricore/src/common/CMakeLists.txt | 6 ++++-- arch/tricore/src/common/Make.defs | 6 ++++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/arch/tricore/include/tc3xx/irq.h b/arch/tricore/include/tc3xx/irq.h index d7b7b399540c4..a4e2bbc1bd7c8 100644 --- a/arch/tricore/include/tc3xx/irq.h +++ b/arch/tricore/include/tc3xx/irq.h @@ -118,12 +118,13 @@ #ifndef __ASSEMBLY__ struct xcptcontext { +#ifdef CONFIG_ENABLE_ALL_SIGNALS /* These are saved copies of the context used during * signal processing. */ uintptr_t *saved_regs; - +#endif /* Register save area with XCPTCONTEXT_SIZE, only valid when: * 1.The task isn't running or * 2.The task is interrupted diff --git a/arch/tricore/src/common/CMakeLists.txt b/arch/tricore/src/common/CMakeLists.txt index c0f55332edb3a..f3023df661b70 100644 --- a/arch/tricore/src/common/CMakeLists.txt +++ b/arch/tricore/src/common/CMakeLists.txt @@ -36,8 +36,6 @@ set(SRCS tricore_registerdump.c tricore_releasestack.c tricore_saveusercontext.c - tricore_schedulesigaction.c - tricore_sigdeliver.c tricore_stackframe.c tricore_svcall.c tricore_tcbinfo.c @@ -45,6 +43,10 @@ set(SRCS tricore_systimer.c tricore_usestack.c) +if(CONFIG_ENABLE_ALL_SIGNALS) + list(APPEND SRCS tricore_schedulesigaction.c tricore_sigdeliver.c) +endif() + if(CONFIG_SPINLOCK) list(APPEND SRCS tricore_testset.c) endif() diff --git a/arch/tricore/src/common/Make.defs b/arch/tricore/src/common/Make.defs index 8dbfbffd42755..5c0f5c8f78500 100644 --- a/arch/tricore/src/common/Make.defs +++ b/arch/tricore/src/common/Make.defs @@ -37,8 +37,6 @@ CMN_CSRCS += tricore_nputs.c CMN_CSRCS += tricore_registerdump.c CMN_CSRCS += tricore_releasestack.c CMN_CSRCS += tricore_saveusercontext.c -CMN_CSRCS += tricore_schedulesigaction.c -CMN_CSRCS += tricore_sigdeliver.c CMN_CSRCS += tricore_stackframe.c CMN_CSRCS += tricore_svcall.c CMN_CSRCS += tricore_tcbinfo.c @@ -46,6 +44,10 @@ CMN_CSRCS += tricore_trapcall.c CMN_CSRCS += tricore_systimer.c CMN_CSRCS += tricore_usestack.c +ifeq ($(CONFIG_ENABLE_ALL_SIGNALS),y) +CMN_CSRCS += tricore_schedulesigaction.c tricore_sigdeliver.c +endif + ifeq ($(CONFIG_SPINLOCK),y) CMN_CSRCS += tricore_testset.c endif From 7574b49f77206b900eceb9d8e9e76f8a6ae63761 Mon Sep 17 00:00:00 2001 From: wangchengdong Date: Tue, 23 Dec 2025 11:08:17 +0800 Subject: [PATCH 07/19] arch/x86: Add support to disable signals actions related data struct Add support to disable signals actions related struct Co-authored-by: guoshichao Signed-off-by: Chengdong Wang --- arch/x86/include/i486/irq.h | 3 ++- arch/x86/src/qemu/Make.defs | 8 ++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/arch/x86/include/i486/irq.h b/arch/x86/include/i486/irq.h index a464d136991f0..20f76da9a196d 100644 --- a/arch/x86/include/i486/irq.h +++ b/arch/x86/include/i486/irq.h @@ -153,6 +153,7 @@ #ifndef __ASSEMBLY__ struct xcptcontext { +#ifdef CONFIG_ENABLE_ALL_SIGNALS /* These are saved copies of instruction pointer and EFLAGS used during * signal processing. * @@ -164,7 +165,7 @@ struct xcptcontext uint32_t saved_eip; uint32_t saved_eflags; - +#endif /* Register save area */ uint32_t regs[XCPTCONTEXT_REGS]; diff --git a/arch/x86/src/qemu/Make.defs b/arch/x86/src/qemu/Make.defs index 893ad50af4b6e..034d5ca5bc8e9 100644 --- a/arch/x86/src/qemu/Make.defs +++ b/arch/x86/src/qemu/Make.defs @@ -34,8 +34,12 @@ CMN_CSRCS += x86_getintstack.c x86_initialize.c CMN_CSRCS += x86_modifyreg8.c x86_modifyreg16.c x86_modifyreg32.c CMN_CSRCS += x86_nputs.c x86_switchcontext.c x86_tcbinfo.c CMN_CSRCS += i486_irq.c i486_regdump.c i486_releasestack.c -CMN_CSRCS += i486_savestate.c i486_sigdeliver.c i486_stackframe.c -CMN_CSRCS += i486_schedulesigaction.c i486_usestack.c +CMN_CSRCS += i486_savestate.c i486_stackframe.c +CMN_CSRCS += i486_usestack.c + +ifeq ($(CONFIG_ENABLE_ALL_SIGNALS),y) +CMN_CSRCS += i486_schedulesigaction.c i486_sigdeliver.c +endif # Required QEMU files From 1d2e23e1f036a0841d8cd99eefc00df07a421d92 Mon Sep 17 00:00:00 2001 From: wangchengdong Date: Tue, 23 Dec 2025 11:11:20 +0800 Subject: [PATCH 08/19] arch/x86_64: Add support to disable signals actions related data struct Add support to disable signals actions related struct Co-authored-by: guoshichao Signed-off-by: Chengdong Wang --- arch/x86_64/include/intel64/irq.h | 2 ++ arch/x86_64/src/common/CMakeLists.txt | 11 ++++------- arch/x86_64/src/common/Make.defs | 4 +++- arch/x86_64/src/common/x86_64_signal_dispatch.c | 4 ++-- arch/x86_64/src/common/x86_64_syscall.c | 2 ++ arch/x86_64/src/intel64/CMakeLists.txt | 6 ++++-- arch/x86_64/src/intel64/Make.defs | 7 +++++-- 7 files changed, 22 insertions(+), 14 deletions(-) diff --git a/arch/x86_64/include/intel64/irq.h b/arch/x86_64/include/intel64/irq.h index af852b141223e..238602ceda20a 100644 --- a/arch/x86_64/include/intel64/irq.h +++ b/arch/x86_64/include/intel64/irq.h @@ -520,6 +520,7 @@ struct xcpt_syscall_s struct xcptcontext { +#ifdef CONFIG_ENABLE_ALL_SIGNALS #ifdef CONFIG_BUILD_KERNEL /* This is the saved address to use when returning from a user-space * signal handler. @@ -535,6 +536,7 @@ struct xcptcontext uint64_t saved_rip; uint64_t saved_rflags; uint64_t saved_rsp; +#endif /* CONFIG_ENABLE_ALL_SIGNALS */ #ifdef CONFIG_ARCH_KERNEL_STACK /* For kernel stack enabled we can't use tcb->xcp.regs[REG_RSP] as it may diff --git a/arch/x86_64/src/common/CMakeLists.txt b/arch/x86_64/src/common/CMakeLists.txt index c797d00619ee4..50899fb5d4544 100644 --- a/arch/x86_64/src/common/CMakeLists.txt +++ b/arch/x86_64/src/common/CMakeLists.txt @@ -63,19 +63,16 @@ if(CONFIG_ARCH_ADDRENV) endif() if(NOT CONFIG_BUILD_FLAT) - list(APPEND SRCS x86_64_task_start.c x86_64_pthread_start.c - x86_64_signal_dispatch.c) + list(APPEND SRCS x86_64_task_start.c x86_64_pthread_start.c) + if(CONFIG_ENABLE_ALL_SIGNALS) + list(APPEND SRCS x86_64_signal_dispatch.c) + endif() endif() if(CONFIG_ARCH_KERNEL_STACK) list(APPEND SRCS x86_64_addrenv_kstack.c) endif() -if(NOT CONFIG_BUILD_FLAT) - list(APPEND SRCS x86_64_task_start.c x86_64_pthread_start.c - x86_64_signal_dispatch.c) -endif() - if(CONFIG_ARCH_HAVE_DEBUG) list(APPEND SRCS x86_64_hwdebug.c) endif() diff --git a/arch/x86_64/src/common/Make.defs b/arch/x86_64/src/common/Make.defs index f63e2cbce822f..5c9ebda5e3b5b 100644 --- a/arch/x86_64/src/common/Make.defs +++ b/arch/x86_64/src/common/Make.defs @@ -65,8 +65,10 @@ endif ifneq ($(CONFIG_BUILD_FLAT),y) CMN_CSRCS += x86_64_task_start.c CMN_CSRCS += x86_64_pthread_start.c -CMN_CSRCS += x86_64_signal_dispatch.c CMN_UASRCS += x86_64_signal_handler.S +ifeq ($(CONFIG_ENABLE_ALL_SIGNALS),y) + CMN_CSRCS += x86_64_signal_dispatch.c +endif endif ifeq ($(CONFIG_ARCH_HAVE_DEBUG),y) diff --git a/arch/x86_64/src/common/x86_64_signal_dispatch.c b/arch/x86_64/src/common/x86_64_signal_dispatch.c index 4101a1498644d..8323fc2e58388 100644 --- a/arch/x86_64/src/common/x86_64_signal_dispatch.c +++ b/arch/x86_64/src/common/x86_64_signal_dispatch.c @@ -31,7 +31,7 @@ #include "x86_64_internal.h" -#if !defined(CONFIG_BUILD_FLAT) && defined(__KERNEL__) +#ifdef __KERNEL__ /**************************************************************************** * Public Functions @@ -75,4 +75,4 @@ void up_signal_dispatch(_sa_sigaction_t sighand, int signo, (uintptr_t)info, (uintptr_t)ucontext); } -#endif /* !CONFIG_BUILD_FLAT && __KERNEL__ */ +#endif diff --git a/arch/x86_64/src/common/x86_64_syscall.c b/arch/x86_64/src/common/x86_64_syscall.c index 960b992bb0210..0e5a5a2ba0eaa 100644 --- a/arch/x86_64/src/common/x86_64_syscall.c +++ b/arch/x86_64/src/common/x86_64_syscall.c @@ -181,6 +181,7 @@ uint64_t *x86_64_syscall(uint64_t *regs) break; } +#ifdef CONFIG_ENABLE_ALL_SIGNALS /* cmd=SYS_signal_handler: This a user signal handler callback * * void signal_handler(_sa_sigaction_t sighand, int signo, @@ -283,6 +284,7 @@ uint64_t *x86_64_syscall(uint64_t *regs) break; } +#endif /* CONFIG_ENABLE_ALL_SIGNALS*/ #endif /* CONFIG_BUILD_KERNEL */ /* This is not an architecture-specific system call. If NuttX is diff --git a/arch/x86_64/src/intel64/CMakeLists.txt b/arch/x86_64/src/intel64/CMakeLists.txt index 3b00bd2f002c9..d42b1890b949b 100644 --- a/arch/x86_64/src/intel64/CMakeLists.txt +++ b/arch/x86_64/src/intel64/CMakeLists.txt @@ -34,8 +34,6 @@ set(SRCS intel64_rtc.c intel64_restore_auxstate.c intel64_stackframe.c - intel64_schedulesigaction.c - intel64_sigdeliver.c intel64_usestack.c intel64_systemreset.c intel64_freq.c @@ -49,6 +47,10 @@ set(SRCS intel64_check_capability.c intel64_cpu.c) +if(CONFIG_ENABLE_ALL_SIGNALS) + list(APPEND SRCS intel64_schedulesigaction.c intel64_sigdeliver.c) +endif() + if(CONFIG_X86_64_UNWINDER_FRAME_POINTER) list(APPEND SRCS intel64_backtrace_fp.c) endif() diff --git a/arch/x86_64/src/intel64/Make.defs b/arch/x86_64/src/intel64/Make.defs index 1dd6fea18f97c..8d7674703e335 100644 --- a/arch/x86_64/src/intel64/Make.defs +++ b/arch/x86_64/src/intel64/Make.defs @@ -25,8 +25,7 @@ include common/Make.defs CMN_CSRCS += intel64_createstack.c intel64_initialstate.c intel64_irq.c CMN_CSRCS += intel64_map_region.c intel64_regdump.c intel64_releasestack.c CMN_CSRCS += intel64_rtc.c intel64_restore_auxstate.c -CMN_CSRCS += intel64_stackframe.c intel64_schedulesigaction.c -CMN_CSRCS += intel64_sigdeliver.c intel64_usestack.c x86_64_tcbinfo.c +CMN_CSRCS += intel64_stackframe.c intel64_usestack.c x86_64_tcbinfo.c CMN_CSRCS += intel64_systemreset.c intel64_freq.c intel64_cache.c # Required Intel64 files @@ -36,6 +35,10 @@ CHIP_CSRCS = intel64_start.c intel64_handlers.c intel64_idle.c intel64_lowsetup CHIP_CSRCS += intel64_serial.c intel64_rng.c intel64_check_capability.c CHIP_CSRCS += intel64_cpu.c +ifeq ($(CONFIG_ENABLE_ALL_SIGNALS),y) +CMN_CSRCS += intel64_schedulesigaction.c intel64_sigdeliver.c +endif + ifeq ($(CONFIG_X86_64_UNWINDER_FRAME_POINTER),y) CMN_CSRCS += intel64_backtrace_fp.c endif From 24ce7c9adfcdf67d67ce7abad0a552cf7341bdbc Mon Sep 17 00:00:00 2001 From: wangchengdong Date: Tue, 23 Dec 2025 11:14:58 +0800 Subject: [PATCH 09/19] arch/xtensa: Add support to disable signals actions related data struct Add support to disable signals actions related struct Co-authored-by: guoshichao Signed-off-by: Chengdong Wang --- arch/xtensa/include/irq.h | 9 +++++---- arch/xtensa/src/common/CMakeLists.txt | 12 ++++++++---- arch/xtensa/src/common/Make.defs | 13 ++++++++++--- arch/xtensa/src/common/xtensa_int_handlers.S | 4 ++-- arch/xtensa/src/common/xtensa_signal_dispatch.c | 4 ++-- 5 files changed, 27 insertions(+), 15 deletions(-) diff --git a/arch/xtensa/include/irq.h b/arch/xtensa/include/irq.h index 5dc3e54b6cae9..39ae9149f03b5 100644 --- a/arch/xtensa/include/irq.h +++ b/arch/xtensa/include/irq.h @@ -189,6 +189,7 @@ struct xcpt_syscall_s struct xcptcontext { +#ifdef CONFIG_ENABLE_ALL_SIGNALS /* These are saved copies of registers used during signal processing. * * REVISIT: Because there is only one copy of these save areas, @@ -199,10 +200,6 @@ struct xcptcontext uint32_t *saved_regs; - /* Register save area */ - - uint32_t *regs; - #ifndef CONFIG_BUILD_FLAT /* This is the saved address to use when returning from a user-space * signal handler. @@ -210,6 +207,10 @@ struct xcptcontext uintptr_t sigreturn; #endif +#endif /* CONFIG_ENABLE_ALL_SIGNALS */ + /* Register save area */ + + uint32_t *regs; #ifdef CONFIG_LIB_SYSCALL /* The following array holds the return address and the exc_return value diff --git a/arch/xtensa/src/common/CMakeLists.txt b/arch/xtensa/src/common/CMakeLists.txt index 089976c79e64f..60042af46f424 100644 --- a/arch/xtensa/src/common/CMakeLists.txt +++ b/arch/xtensa/src/common/CMakeLists.txt @@ -69,14 +69,16 @@ list( xtensa_perf.c xtensa_releasestack.c xtensa_registerdump.c - xtensa_sigdeliver.c xtensa_swint.c xtensa_stackframe.c xtensa_saveusercontext.c - xtensa_schedsigaction.c xtensa_usestack.c xtensa_tcbinfo.c) +if(CONFIG_ENABLE_ALL_SIGNALS) + list(APPEND SRCS xtensa_schedsigaction.c xtensa_sigdeliver.c) +endif() + # Configuration-dependent common Xtensa files if(CONFIG_ARCH_USE_TEXT_HEAP) @@ -106,8 +108,10 @@ endif() if(CONFIG_BUILD_PROTECTED) target_sources(arch_interface PRIVATE xtensa_signal_handler.S) list(APPEND SRCS xtensa_dispatch_syscall.S) - list(APPEND SRCS xtensa_signal_dispatch.c xtensa_task_start.c - xtensa_pthread_start.c) + list(APPEND SRCS xtensa_task_start.c xtensa_pthread_start.c) + if(CONFIG_ENABLE_ALL_SIGNALS) + list(APPEND SRCS xtensa_signal_dispatch.c) + endif() endif() target_sources(arch PRIVATE ${SRCS}) diff --git a/arch/xtensa/src/common/Make.defs b/arch/xtensa/src/common/Make.defs index 7a6fe24ae9cce..3e1ea13a78582 100644 --- a/arch/xtensa/src/common/Make.defs +++ b/arch/xtensa/src/common/Make.defs @@ -37,13 +37,17 @@ CMN_CSRCS += xtensa_getintstack.c xtensa_initialize.c xtensa_initialstate.c CMN_CSRCS += xtensa_irqdispatch.c xtensa_lowputs.c CMN_CSRCS += xtensa_modifyreg8.c xtensa_modifyreg16.c xtensa_modifyreg32.c CMN_CSRCS += xtensa_mpu.c xtensa_nputs.c xtensa_oneshot.c xtensa_perf.c -CMN_CSRCS += xtensa_releasestack.c xtensa_registerdump.c xtensa_sigdeliver.c +CMN_CSRCS += xtensa_releasestack.c xtensa_registerdump.c CMN_CSRCS += xtensa_swint.c xtensa_stackframe.c -CMN_CSRCS += xtensa_saveusercontext.c xtensa_schedsigaction.c +CMN_CSRCS += xtensa_saveusercontext.c CMN_CSRCS += xtensa_usestack.c xtensa_tcbinfo.c # Configuration-dependent common Xtensa files +ifeq ($(CONFIG_ENABLE_ALL_SIGNALS),y) +CMN_CSRCS += xtensa_schedsigaction.c xtensa_sigdeliver.c +endif + ifeq ($(CONFIG_ARCH_USE_TEXT_HEAP),y) CMN_ASRCS += xtensa_loadstore.S endif @@ -80,5 +84,8 @@ endif ifeq ($(CONFIG_BUILD_PROTECTED),y) CMN_UASRCS += xtensa_signal_handler.S CMN_ASRCS += xtensa_dispatch_syscall.S - CMN_CSRCS += xtensa_signal_dispatch.c xtensa_task_start.c xtensa_pthread_start.c + CMN_CSRCS += xtensa_task_start.c xtensa_pthread_start.c +ifeq ($(CONFIG_ENABLE_ALL_SIGNALS),y) + CMN_CSRCS += xtensa_signal_dispatch.c +endif endif diff --git a/arch/xtensa/src/common/xtensa_int_handlers.S b/arch/xtensa/src/common/xtensa_int_handlers.S index 3c4073b478f89..8e60754e8b413 100644 --- a/arch/xtensa/src/common/xtensa_int_handlers.S +++ b/arch/xtensa/src/common/xtensa_int_handlers.S @@ -179,7 +179,7 @@ g_intstacktop: * signal context (ref: xtensa_schedulesigaction.c): */ -#if CONFIG_ARCH_INTERRUPTSTACK < 15 +#if (CONFIG_ARCH_INTERRUPTSTACK < 15) && defined(CONFIG_ENABLE_ALL_SIGNALS) addi sp, sp, -XCPTCONTEXT_SIZE #endif @@ -266,7 +266,7 @@ g_intstacktop: addi sp, sp, XCHAL_NUM_INTERRUPTS / 8 -#if CONFIG_ARCH_INTERRUPTSTACK < 15 +#if (CONFIG_ARCH_INTERRUPTSTACK < 15) && defined(CONFIG_ENABLE_ALL_SIGNALS) addi sp, sp, XCPTCONTEXT_SIZE #endif .endm diff --git a/arch/xtensa/src/common/xtensa_signal_dispatch.c b/arch/xtensa/src/common/xtensa_signal_dispatch.c index dd0fdeb2da536..f446738b76caa 100644 --- a/arch/xtensa/src/common/xtensa_signal_dispatch.c +++ b/arch/xtensa/src/common/xtensa_signal_dispatch.c @@ -30,7 +30,7 @@ #include -#if !defined(CONFIG_BUILD_FLAT) && defined(__KERNEL__) +#ifdef __KERNEL__ /**************************************************************************** * Public Functions @@ -74,4 +74,4 @@ void up_signal_dispatch(_sa_sigaction_t sighand, int signo, (uintptr_t)info, (uintptr_t)ucontext); } -#endif /* !CONFIG_BUILD_FLAT && __KERNEL__ */ +#endif /* __KERNEL__ */ From a41532cfffab8516c72e2b6898a209f665536444 Mon Sep 17 00:00:00 2001 From: wangchengdong Date: Tue, 23 Dec 2025 11:17:34 +0800 Subject: [PATCH 10/19] arch/z16: Add support to disable signals actions related data struct Add support to disable signals actions related struct Co-authored-by: guoshichao Signed-off-by: Chengdong Wang --- arch/z16/include/z16f/irq.h | 2 ++ arch/z16/src/z16f/Make.defs | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/arch/z16/include/z16f/irq.h b/arch/z16/include/z16f/irq.h index f896f65034e61..9ebc90d50579e 100644 --- a/arch/z16/include/z16f/irq.h +++ b/arch/z16/include/z16f/irq.h @@ -167,6 +167,7 @@ struct xcptcontext uint16_t regs[XCPTCONTEXT_REGS]; +#ifdef CONFIG_ENABLE_ALL_SIGNALS /* The following retains that state during signal execution. * * REVISIT: Because there is only one copy of these save areas, @@ -177,6 +178,7 @@ struct xcptcontext uint32_t saved_pc; /* Saved return address */ uint16_t saved_i; /* Saved interrupt state */ +#endif /* CONFIG_ENABLE_ALL_SIGNALS */ }; #endif diff --git a/arch/z16/src/z16f/Make.defs b/arch/z16/src/z16f/Make.defs index 1563e48977c79..5533fe250065d 100644 --- a/arch/z16/src/z16f/Make.defs +++ b/arch/z16/src/z16f/Make.defs @@ -25,12 +25,16 @@ HEAD_SSRC = z16f_head.S CMN_CSRCS = z16_allocateheap.c z16_copystate.c z16_createstack.c z16_doirq.c CMN_CSRCS += z16_exit.c z16_initialstate.c z16_initialize.c z16_idle.c CMN_CSRCS += z16_nputs.c z16_registerdump.c z16_releasestack.c -CMN_CSRCS += z16_schedulesigaction.c z16_sigdeliver.c z16_switchcontext.c +CMN_CSRCS += z16_switchcontext.c CMN_CSRCS += z16_stackframe.c z16_usestack.c CHIP_SSRCS = z16f_lowuart.S z16f_saveusercontext.S z16f_restoreusercontext.S CHIP_CSRCS = z16f_clkinit.c z16f_sysexec.c z16f_irq.c z16f_serial.c +ifeq ($(CONFIG_ENABLE_ALL_SIGNALS),y) +CMN_CSRCS += z16_schedulesigaction.c z16_sigdeliver.c +endif + ifneq ($(CONFIG_SCHED_TICKLESS),y) CHIP_CSRCS += z16f_timerisr.c endif From 85636f90406fd638dceb62e6248771e02836cf2a Mon Sep 17 00:00:00 2001 From: wangchengdong Date: Tue, 23 Dec 2025 11:21:25 +0800 Subject: [PATCH 11/19] arch/z80: Add support to disable signals actions related data struct Add support to disable signals actions related struct Co-authored-by: guoshichao Signed-off-by: Chengdong Wang --- arch/z80/include/ez80/irq.h | 2 ++ arch/z80/include/z180/irq.h | 2 ++ arch/z80/include/z8/irq.h | 2 ++ arch/z80/include/z80/irq.h | 2 ++ arch/z80/src/ez80/Make.defs | 5 ++++- arch/z80/src/z180/Make.defs | 6 +++++- arch/z80/src/z8/Make.defs | 5 ++++- arch/z80/src/z80/Make.defs | 5 ++++- 8 files changed, 25 insertions(+), 4 deletions(-) diff --git a/arch/z80/include/ez80/irq.h b/arch/z80/include/ez80/irq.h index 339eca4e10869..861cc98a91c78 100644 --- a/arch/z80/include/ez80/irq.h +++ b/arch/z80/include/ez80/irq.h @@ -248,6 +248,7 @@ struct xcptcontext chipreg_t regs[XCPTCONTEXT_REGS]; +#ifdef CONFIG_ENABLE_ALL_SIGNALS /* The following retains that state during signal execution * * REVISIT: Because there is only one copy of these save areas, @@ -258,6 +259,7 @@ struct xcptcontext chipreg_t saved_pc; /* Saved return address */ chipreg_t saved_i; /* Saved interrupt state */ +#endif /* CONFIG_ENABLE_ALL_SIGNALS */ }; #endif diff --git a/arch/z80/include/z180/irq.h b/arch/z80/include/z180/irq.h index 3afec6210724d..e121178ffe9a8 100644 --- a/arch/z80/include/z180/irq.h +++ b/arch/z80/include/z180/irq.h @@ -175,6 +175,7 @@ struct xcptcontext chipreg_t regs[XCPTCONTEXT_REGS]; +#ifdef CONFIG_ENABLE_ALL_SIGNALS /* The following retains that state during signal execution * * REVISIT: Because there is only one copy of these save areas, @@ -185,6 +186,7 @@ struct xcptcontext uint16_t saved_pc; /* Saved return address */ uint16_t saved_i; /* Saved interrupt state */ +#endif /* CONFIG_ENABLE_ALL_SIGNALS */ }; #endif diff --git a/arch/z80/include/z8/irq.h b/arch/z80/include/z8/irq.h index 37148633b8f51..454518d18bf8c 100644 --- a/arch/z80/include/z8/irq.h +++ b/arch/z80/include/z8/irq.h @@ -306,6 +306,7 @@ struct xcptcontext chipreg_t regs[XCPTCONTEXT_REGS]; +#ifdef CONFIG_ENABLE_ALL_SIGNALS /* The following retains that state during signal execution * * REVISIT: Because there is only one copy of these save areas, @@ -316,6 +317,7 @@ struct xcptcontext uint16_t saved_pc; /* Saved return address */ uint16_t saved_irqctl; /* Saved interrupt state */ +#endif /* CONFIG_ENABLE_ALL_SIGNALS */ }; #endif diff --git a/arch/z80/include/z80/irq.h b/arch/z80/include/z80/irq.h index 956b2d6461e5c..fcdc58a81eea4 100644 --- a/arch/z80/include/z80/irq.h +++ b/arch/z80/include/z80/irq.h @@ -90,6 +90,7 @@ struct xcptcontext chipreg_t regs[XCPTCONTEXT_REGS]; +#ifdef CONFIG_ENABLE_ALL_SIGNALS /* The following retains that state during signal execution. * * REVISIT: Because there is only one copy of these save areas, @@ -100,6 +101,7 @@ struct xcptcontext uint16_t saved_pc; /* Saved return address */ uint16_t saved_i; /* Saved interrupt state */ +#endif /* CONFIG_ENABLE_ALL_SIGNALS */ }; #endif diff --git a/arch/z80/src/ez80/Make.defs b/arch/z80/src/ez80/Make.defs index 61aa51c3c3caf..30adfacf377a7 100644 --- a/arch/z80/src/ez80/Make.defs +++ b/arch/z80/src/ez80/Make.defs @@ -55,9 +55,12 @@ CHIP_ASRCS += ez80_getsp.asm endif CHIP_CSRCS = ez80_clock.c ez80_initialstate.c ez80_irq.c ez80_copystate.c -CHIP_CSRCS += ez80_schedulesigaction.c ez80_sigdeliver.c CHIP_CSRCS += ez80_timerisr.c ez80_serial.c +ifeq ($(CONFIG_ENABLE_ALL_SIGNALS),y) +CHIP_CSRCS += ez80_schedulesigaction.c ez80_sigdeliver.c +endif + ifeq ($(CONFIG_ARCH_STACKDUMP),y) CHIP_CSRCS += ez80_registerdump.c endif diff --git a/arch/z80/src/z180/Make.defs b/arch/z80/src/z180/Make.defs index 61aab00c95d60..89e773ea03ffd 100644 --- a/arch/z80/src/z180/Make.defs +++ b/arch/z80/src/z180/Make.defs @@ -45,7 +45,11 @@ endif CHIP_CSRCS = z180_copystate.c z180_initialstate.c z180_io.c z180_irq.c CHIP_CSRCS += z180_lowscc.c z180_lowserial.c z180_modifiyreg8.c z180_mmu.c -CHIP_CSRCS += z180_registerdump.c z180_schedulesigaction.c z180_sigdeliver.c +CHIP_CSRCS += z180_registerdump.c + +ifeq ($(CONFIG_ENABLE_ALL_SIGNALS),y) +CHIP_CSRCS += z180_schedulesigaction.c z180_sigdeliver.c +endif ifneq ($(CONFIG_SCHED_TICKLESS),y) CHIP_CSRCS += z180_timerisr.c diff --git a/arch/z80/src/z8/Make.defs b/arch/z80/src/z8/Make.defs index 299b0b9a3e73d..4202496dd248a 100644 --- a/arch/z80/src/z8/Make.defs +++ b/arch/z80/src/z8/Make.defs @@ -30,9 +30,12 @@ CMN_CSRCS += z80_stackframe.c z80_usestack.c CHIP_SSRCS = z8_vector.S z8_saveusercontext.S z8_restorecontext.S CHIP_CSRCS = z8_initialstate.c z8_irq.c z8_saveirqcontext.c -CHIP_CSRCS += z8_schedulesigaction.c z8_sigdeliver.c CHIP_CSRCS += z8_serial.c z8_i2c.c z8_registerdump.c +ifeq ($(CONFIG_ENABLE_ALL_SIGNALS),y) +CMN_CSRCS += z8_schedulesigaction.c z8_sigdeliver.c +endif + ifneq ($(CONFIG_SCHED_TICKLESS),y) CHIP_CSRCS += z8_timerisr.c endif diff --git a/arch/z80/src/z80/Make.defs b/arch/z80/src/z80/Make.defs index 0152299e47aad..fd31b350f65f6 100644 --- a/arch/z80/src/z80/Make.defs +++ b/arch/z80/src/z80/Make.defs @@ -37,5 +37,8 @@ CMN_CSRCS += z80_usestack.c CHIP_ASRCS = z80_saveusercontext.asm z80_restoreusercontext.asm CHIP_CSRCS = z80_initialstate.c z80_io.c z80_irq.c z80_copystate.c -CHIP_CSRCS += z80_schedulesigaction.c z80_sigdeliver.c CHIP_CSRCS += z80_registerdump.c + +ifeq ($(CONFIG_ENABLE_ALL_SIGNALS),y) +CHIP_CSRCS += z80_schedulesigaction.c z80_sigdeliver.c +endif From 8dd09ecffe22c7016e72c6d8c8b5442e8b92a3bf Mon Sep 17 00:00:00 2001 From: wangchengdong Date: Tue, 13 Jan 2026 09:35:32 +0800 Subject: [PATCH 12/19] arch/avr: Add support to disable signals actions related data struct Add support to disable signals actions related struct Co-authored-by: guoshichao Signed-off-by: Chengdong Wang --- arch/avr/include/avr/irq.h | 2 ++ arch/avr/include/avr32/irq.h | 2 ++ arch/avr/src/at32uc3/Make.defs | 6 +++++- arch/avr/src/at90usb/Make.defs | 6 +++++- arch/avr/src/atmega/Make.defs | 6 +++++- 5 files changed, 19 insertions(+), 3 deletions(-) diff --git a/arch/avr/include/avr/irq.h b/arch/avr/include/avr/irq.h index 53c5ab6e7ada7..e9a603b55c1b0 100644 --- a/arch/avr/include/avr/irq.h +++ b/arch/avr/include/avr/irq.h @@ -103,6 +103,7 @@ #ifndef __ASSEMBLY__ struct xcptcontext { +#ifdef CONFIG_ENABLE_ALL_SIGNALS /* These are saved copies of PC and SR used during signal processing. * * REVISIT: Because there is only one copy of these save areas, @@ -120,6 +121,7 @@ struct xcptcontext uint8_t saved_rampz; #endif uint8_t saved_sreg; +#endif /* CONFIG_ENABLE_ALL_SIGNALS */ /* Register save area */ diff --git a/arch/avr/include/avr32/irq.h b/arch/avr/include/avr32/irq.h index a60fa9cda3351..768b9fc3e1c9d 100644 --- a/arch/avr/include/avr32/irq.h +++ b/arch/avr/include/avr32/irq.h @@ -95,6 +95,7 @@ #ifndef __ASSEMBLY__ struct xcptcontext { +#ifdef CONFIG_ENABLE_ALL_SIGNALS /* These are saved copies of PC and SR used during signal processing. * * REVISIT: Because there is only one copy of these save areas, @@ -105,6 +106,7 @@ struct xcptcontext uint32_t saved_pc; uint32_t saved_sr; +#endif /* CONFIG_ENABLE_ALL_SIGNALS */ /* Register save area */ diff --git a/arch/avr/src/at32uc3/Make.defs b/arch/avr/src/at32uc3/Make.defs index ea6485cde7d38..0f7e08317cb91 100644 --- a/arch/avr/src/at32uc3/Make.defs +++ b/arch/avr/src/at32uc3/Make.defs @@ -30,9 +30,13 @@ CMN_ASRCS = avr_exceptions.S avr_fullcontextrestore.S avr_doswitch.S avr_saveus CMN_CSRCS = avr_allocateheap.c avr_copystate.c avr_createstack.c avr_exit.c CMN_CSRCS += avr_initialize.c avr_initialstate.c avr_idle.c CMN_CSRCS += avr_modifyreg8.c avr_modifyreg16.c avr_modifyreg32.c avr_releasestack.c -CMN_CSRCS += avr_schedulesigaction.c avr_sigdeliver.c avr_stackframe.c avr_switchcontext.c +CMN_CSRCS += avr_stackframe.c avr_switchcontext.c CMN_CSRCS += avr_usestack.c avr_doirq.c avr_nputs.c avr_registerdump.c avr_getintstack.c +ifeq ($(CONFIG_ENABLE_ALL_SIGNALS),y) +CMN_CSRCS += avr_schedulesigaction.c avr_sigdeliver.c +endif + # Required AT32UC3 files CHIP_CSRCS = at32uc3_clkinit.c at32uc3_gpio.c at32uc3_irq.c diff --git a/arch/avr/src/at90usb/Make.defs b/arch/avr/src/at90usb/Make.defs index 71138b4f9a94a..3a935f71ca74a 100644 --- a/arch/avr/src/at90usb/Make.defs +++ b/arch/avr/src/at90usb/Make.defs @@ -32,11 +32,15 @@ CMN_CSRCS += avr_doirq.c avr_exit.c avr_idle.c avr_irq.c CMN_CSRCS += avr_initialize.c avr_initialstate.c avr_lowputs.c CMN_CSRCS += avr_modifyreg8.c avr_modifyreg16.c avr_modifyreg32.c CMN_CSRCS += avr_nputs.c avr_releasestack.c avr_registerdump.c -CMN_CSRCS += avr_schedulesigaction.c avr_sigdeliver.c avr_getintstack.c +CMN_CSRCS += avr_getintstack.c CMN_CSRCS += avr_stackframe.c avr_switchcontext.c avr_usestack.c # Configuration-dependent common files +ifeq ($(CONFIG_ENABLE_ALL_SIGNALS),y) +CMN_CSRCS += avr_schedulesigaction.c avr_sigdeliver.c +endif + ifeq ($(CONFIG_AVR_SPI),y) CMN_CSRCS += avr_spi.c endif diff --git a/arch/avr/src/atmega/Make.defs b/arch/avr/src/atmega/Make.defs index d53a0fcddabea..a978a852cb457 100644 --- a/arch/avr/src/atmega/Make.defs +++ b/arch/avr/src/atmega/Make.defs @@ -32,11 +32,15 @@ CMN_CSRCS += avr_doirq.c avr_exit.c avr_idle.c avr_initialize.c CMN_CSRCS += avr_initialstate.c avr_irq.c avr_lowputs.c CMN_CSRCS += avr_modifyreg8.c avr_modifyreg16.c avr_modifyreg32.c CMN_CSRCS += avr_nputs.c avr_releasestack.c avr_registerdump.c -CMN_CSRCS += avr_schedulesigaction.c avr_sigdeliver.c avr_getintstack.c CMN_CSRCS += avr_stackframe.c avr_switchcontext.c avr_usestack.c +CMN_CSRCS += avr_getintstack.c # Configuration-dependent common files +ifeq ($(CONFIG_ENABLE_ALL_SIGNALS),y) +CMN_CSRCS += avr_schedulesigaction.c avr_sigdeliver.c +endif + ifeq ($(CONFIG_AVR_SPI),y) CMN_CSRCS += avr_spi.c endif From 2763a785f8ceaef37205489f9f6c6671d4fba887 Mon Sep 17 00:00:00 2001 From: wangchengdong Date: Tue, 13 Jan 2026 09:38:50 +0800 Subject: [PATCH 13/19] arch/mips: Add support to disable signals actions related data struct Add support to disable signals actions related struct Co-authored-by: guoshichao Signed-off-by: Chengdong Wang --- arch/mips/include/mips32/irq.h | 2 ++ arch/mips/src/pic32mx/Make.defs | 7 +++++-- arch/mips/src/pic32mz/Make.defs | 7 +++++-- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/arch/mips/include/mips32/irq.h b/arch/mips/include/mips32/irq.h index 9cbe1b5c7cf34..1efe20ba78379 100644 --- a/arch/mips/include/mips32/irq.h +++ b/arch/mips/include/mips32/irq.h @@ -323,6 +323,7 @@ struct xcpt_syscall_s struct xcptcontext { +#ifdef CONFIG_ENABLE_ALL_SIGNALS /* These additional register save locations are used to implement the * signal delivery trampoline. * @@ -334,6 +335,7 @@ struct xcptcontext uint32_t saved_epc; /* Trampoline PC */ uint32_t saved_status; /* Status with interrupts disabled. */ +#endif /* CONFIG_ENABLE_ALL_SIGNALS */ #ifdef CONFIG_BUILD_KERNEL /* This is the saved address to use when returning from a user-space diff --git a/arch/mips/src/pic32mx/Make.defs b/arch/mips/src/pic32mx/Make.defs index 9c0c82d5a19e9..d396754ca9884 100644 --- a/arch/mips/src/pic32mx/Make.defs +++ b/arch/mips/src/pic32mx/Make.defs @@ -32,12 +32,15 @@ CMN_CSRCS += mips_doirq.c mips_exit.c mips_getintstack.c mips_initialize.c CMN_CSRCS += mips_initialstate.c mips_irq.c mips_lowputs.c CMN_CSRCS += mips_modifyreg8.c mips_modifyreg16.c mips_modifyreg32.c CMN_CSRCS += mips_nputs.c mips_releasestack.c mips_registerdump.c -CMN_CSRCS += mips_schedulesigaction.c mips_sigdeliver.c mips_swint0.c CMN_CSRCS += mips_stackframe.c mips_switchcontext.c mips_saveusercontext.c -CMN_CSRCS += mips_usestack.c mips_fork.c +CMN_CSRCS += mips_usestack.c mips_fork.c mips_swint0.c # Configuration dependent common files +ifeq ($(CONFIG_ENABLE_ALL_SIGNALS),y) +CMN_CSRCS += mips_schedulesigaction.c mips_sigdeliver.c +endif + ifneq ($(CONFIG_ARCH_IDLE_CUSTOM),y) CMN_CSRCS += mips_idle.c endif diff --git a/arch/mips/src/pic32mz/Make.defs b/arch/mips/src/pic32mz/Make.defs index 0fafb6de69a06..b3af91a8bf7f9 100644 --- a/arch/mips/src/pic32mz/Make.defs +++ b/arch/mips/src/pic32mz/Make.defs @@ -32,12 +32,15 @@ CMN_CSRCS += mips_doirq.c mips_exit.c mips_getintstack.c mips_initialize.c CMN_CSRCS += mips_initialstate.c mips_irq.c mips_lowputs.c CMN_CSRCS += mips_modifyreg8.c mips_modifyreg16.c mips_modifyreg32.c CMN_CSRCS += mips_nputs.c mips_releasestack.c mips_registerdump.c -CMN_CSRCS += mips_schedulesigaction.c mips_sigdeliver.c mips_swint0.c CMN_CSRCS += mips_stackframe.c mips_switchcontext.c mips_saveusercontext.c -CMN_CSRCS += mips_usestack.c mips_fork.c +CMN_CSRCS += mips_usestack.c mips_fork.c mips_swint0.c # Configuration dependent common files +ifeq ($(CONFIG_ENABLE_ALL_SIGNALS),y) +CMN_CSRCS += mips_schedulesigaction.c mips_sigdeliver.c +endif + ifneq ($(CONFIG_ARCH_IDLE_CUSTOM),y) CMN_CSRCS += mips_idle.c endif From 6e00511c9f315d40aa0c5fb02de3b3bcb5d1c057 Mon Sep 17 00:00:00 2001 From: wangchengdong Date: Tue, 13 Jan 2026 09:42:33 +0800 Subject: [PATCH 14/19] arch/misoc: Add support to disable signals actions related data struct Add support to disable signals actions related struct Co-authored-by: guoshichao Signed-off-by: Chengdong Wang --- arch/misoc/include/lm32/irq.h | 2 ++ arch/misoc/include/minerva/irq.h | 2 ++ arch/misoc/src/lm32/Make.defs | 7 +++++-- arch/misoc/src/minerva/Make.defs | 7 +++++-- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/arch/misoc/include/lm32/irq.h b/arch/misoc/include/lm32/irq.h index ee7c687438b23..518ebd7d2346e 100644 --- a/arch/misoc/include/lm32/irq.h +++ b/arch/misoc/include/lm32/irq.h @@ -181,6 +181,7 @@ struct xcptcontext { +#ifdef CONFIG_ENABLE_ALL_SIGNALS /* These additional register save locations are used to implement the * signal delivery trampoline. * @@ -200,6 +201,7 @@ struct xcptcontext uint32_t sigreturn; #endif +#endif /* CONFIG_ENABLE_ALL_SIGNALS */ #ifdef CONFIG_BUILD_KERNEL /* The following array holds information needed to return from each nested diff --git a/arch/misoc/include/minerva/irq.h b/arch/misoc/include/minerva/irq.h index 414a781c0a1ac..465767e552d61 100644 --- a/arch/misoc/include/minerva/irq.h +++ b/arch/misoc/include/minerva/irq.h @@ -263,6 +263,7 @@ struct xcpt_syscall_s struct xcptcontext { +#ifdef CONFIG_ENABLE_ALL_SIGNALS /* These additional register save locations are used to implement the * signal delivery trampoline. */ @@ -277,6 +278,7 @@ struct xcptcontext uint32_t sigreturn; #endif +#endif /* CONFIG_ENABLE_ALL_SIGNALS */ #ifdef CONFIG_BUILD_KERNEL /* The following array holds information needed to return from each nested diff --git a/arch/misoc/src/lm32/Make.defs b/arch/misoc/src/lm32/Make.defs index b2847f7d25f4a..ac383557d85bf 100644 --- a/arch/misoc/src/lm32/Make.defs +++ b/arch/misoc/src/lm32/Make.defs @@ -33,5 +33,8 @@ CHIP_CSRCS = lm32_allocateheap.c lm32_copystate.c lm32_createstack.c CHIP_CSRCS += lm32_decodeirq.c lm32_doirq.c lm32_exit.c lm32_flushcache.c CHIP_CSRCS += lm32_idle.c lm32_initialstate.c lm32_irq.c lm32_usetack.c CHIP_CSRCS += lm32_registerdump.c lm32_releasestack.c lm32_swint.c -CHIP_CSRCS += lm32_stackframe.c lm32_switchcontext.c lm32_sigdeliver.c -CHIP_CSRCS += lm32_schedulesigaction.c lm32_saveusercontext.c +CHIP_CSRCS += lm32_stackframe.c lm32_switchcontext.c lm32_saveusercontext.c + +ifeq ($(CONFIG_ENABLE_ALL_SIGNALS),y) +CHIP_CSRCS += lm32_schedulesigaction.c lm32_sigdeliver.c +endif diff --git a/arch/misoc/src/minerva/Make.defs b/arch/misoc/src/minerva/Make.defs index e7285c01fd71b..2b45142e3f0df 100644 --- a/arch/misoc/src/minerva/Make.defs +++ b/arch/misoc/src/minerva/Make.defs @@ -34,5 +34,8 @@ CHIP_CSRCS += minerva_decodeirq.c minerva_doirq.c minerva_doexceptions.c CHIP_CSRCS += minerva_exit.c minerva_flushcache.c minerva_idle.c minerva_irq.c CHIP_CSRCS += minerva_initialstate.c minerva_registerdump.c minerva_releasestack.c CHIP_CSRCS += minerva_stackframe.c minerva_swint.c minerva_saveusercontext.c -CHIP_CSRCS += minerva_switchcontext.c minerva_schedulesigaction.c minerva_sigdeliver.c -CHIP_CSRCS += minerva_usetack.c +CHIP_CSRCS += minerva_switchcontext.c minerva_usetack.c + +ifeq ($(CONFIG_ENABLE_ALL_SIGNALS),y) +CHIP_CSRCS += minerva_schedulesigaction.c minerva_sigdeliver.c +endif From 2bbc3657059bcf066af9e1ae01f7a64e98915ae0 Mon Sep 17 00:00:00 2001 From: wangchengdong Date: Tue, 13 Jan 2026 09:44:43 +0800 Subject: [PATCH 15/19] arch/or1k: Add support to disable signals actions related data struct Add support to disable signals actions related struct Co-authored-by: guoshichao Signed-off-by: Chengdong Wang --- arch/or1k/include/mor1kx/irq.h | 2 ++ arch/or1k/src/mor1kx/Make.defs | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/arch/or1k/include/mor1kx/irq.h b/arch/or1k/include/mor1kx/irq.h index b49a390e6cfd6..28bd362a5fb72 100644 --- a/arch/or1k/include/mor1kx/irq.h +++ b/arch/or1k/include/mor1kx/irq.h @@ -171,6 +171,7 @@ struct xcptcontext uint32_t regs[XCPTCONTEXT_REGS]; +#ifdef CONFIG_ENABLE_ALL_SIGNALS /* These are saved copies of LR and CPSR used during * signal processing. * @@ -182,6 +183,7 @@ struct xcptcontext uint32_t saved_pc; uint32_t saved_flags; +#endif /* CONFIG_ENABLE_ALL_SIGNALS */ }; #endif diff --git a/arch/or1k/src/mor1kx/Make.defs b/arch/or1k/src/mor1kx/Make.defs index 8278d37f66fbc..a4bf24f9b53ba 100644 --- a/arch/or1k/src/mor1kx/Make.defs +++ b/arch/or1k/src/mor1kx/Make.defs @@ -32,7 +32,6 @@ CMN_CSRCS = or1k_initialize.c \ or1k_stackframe.c \ or1k_initialstate.c \ or1k_switchcontext.c \ - or1k_schedulesigaction.c \ or1k_copyfullstate.c \ or1k_registerdump.c \ or1k_getintstack.c \ @@ -45,6 +44,10 @@ CMN_CSRCS = or1k_initialize.c \ or1k_cpuinfo.c \ mor1kx_start.c +ifeq ($(CONFIG_ENABLE_ALL_SIGNALS),y) +CMN_CSRCS += or1k_schedulesigaction.c +endif + ifeq ($(CONFIG_BUILD_PROTECTED),y) CMN_CSRCS += or1k_task_start.c or1k_pthread_start.c #CMN_CSRCS += or1k_signal_dispatch.c From d6593c761f8e70c309c7884cc667dc0aa501738d Mon Sep 17 00:00:00 2001 From: wangchengdong Date: Tue, 13 Jan 2026 09:47:54 +0800 Subject: [PATCH 16/19] arch/renesas: Add support to disable signals actions related data struct Add support to disable signals actions related struct Co-authored-by: guoshichao Signed-off-by: Chengdong Wang --- arch/renesas/include/m16c/irq.h | 2 ++ arch/renesas/include/rx65n/irq.h | 2 ++ arch/renesas/include/sh1/irq.h | 2 ++ arch/renesas/src/m16c/Make.defs | 5 ++++- arch/renesas/src/rx65n/Make.defs | 6 +++++- arch/renesas/src/sh1/Make.defs | 6 +++++- 6 files changed, 20 insertions(+), 3 deletions(-) diff --git a/arch/renesas/include/m16c/irq.h b/arch/renesas/include/m16c/irq.h index dffdef85a746f..b84e45ea8f559 100644 --- a/arch/renesas/include/m16c/irq.h +++ b/arch/renesas/include/m16c/irq.h @@ -230,6 +230,7 @@ #ifndef __ASSEMBLY__ struct xcptcontext { +#ifdef CONFIG_ENABLE_ALL_SIGNALS /* These are saved copies of LR and SR used during signal processing. * * REVISIT: Because there is only one copy of these save areas, @@ -240,6 +241,7 @@ struct xcptcontext uint8_t saved_pc[2]; uint8_t saved_flg; +#endif /* CONFIG_ENABLE_ALL_SIGNALS */ /* Register save area */ diff --git a/arch/renesas/include/rx65n/irq.h b/arch/renesas/include/rx65n/irq.h index 67f80336a03cd..c3f01de8c82ad 100644 --- a/arch/renesas/include/rx65n/irq.h +++ b/arch/renesas/include/rx65n/irq.h @@ -988,10 +988,12 @@ #ifndef __ASSEMBLY__ struct xcptcontext { +#ifdef CONFIG_ENABLE_ALL_SIGNALS /* These are saved copies of LR and SR used during signal processing. */ uint32_t saved_pc; uint32_t saved_sr; +#endif /* Register save area */ diff --git a/arch/renesas/include/sh1/irq.h b/arch/renesas/include/sh1/irq.h index 1d83ea476bca6..58ae6e96f1a83 100644 --- a/arch/renesas/include/sh1/irq.h +++ b/arch/renesas/include/sh1/irq.h @@ -451,6 +451,7 @@ #ifndef __ASSEMBLY__ struct xcptcontext { +#ifdef CONFIG_ENABLE_ALL_SIGNALS /* These are saved copies of LR and SR used during signal processing. * * REVISIT: Because there is only one copy of these save areas, @@ -461,6 +462,7 @@ struct xcptcontext uint32_t saved_pc; uint32_t saved_sr; +#endif /* Register save area */ diff --git a/arch/renesas/src/m16c/Make.defs b/arch/renesas/src/m16c/Make.defs index 2ca404f53aef3..c8627e4160bc6 100644 --- a/arch/renesas/src/m16c/Make.defs +++ b/arch/renesas/src/m16c/Make.defs @@ -30,9 +30,12 @@ CMN_CSRCS += renesas_switchcontext.c renesas_usestack.c CHIP_ASRCS = m16c_vectors.S CHIP_CSRCS = m16c_initialstate.c m16c_copystate.c m16c_lowputc.c m16c_irq.c -CHIP_CSRCS += m16c_schedulesigaction.c m16c_sigdeliver.c CHIP_CSRCS += m16c_serial.c m16c_registerdump.c +ifeq ($(CONFIG_ENABLE_ALL_SIGNALS),y) +CHIP_CSRCS += m16c_schedulesigaction.c m16c_sigdeliver.c +endif + ifneq ($(CONFIG_SCHED_TICKLESS),y) CHIP_CSRCS += m16c_timerisr.c endif diff --git a/arch/renesas/src/rx65n/Make.defs b/arch/renesas/src/rx65n/Make.defs index ea5004a72ed80..cf00d80150092 100644 --- a/arch/renesas/src/rx65n/Make.defs +++ b/arch/renesas/src/rx65n/Make.defs @@ -30,11 +30,15 @@ CMN_CSRCS += renesas_usestack.c CHIP_ASRCS = rx65n_vector.S CHIP_CSRCS = rx65n_lowputc.c rx65n_serial.c rx65n_copystate.c rx65n_irq.c -CHIP_CSRCS += rx65n_schedulesigaction.c rx65n_sigdeliver.c rx65n_initialstate.c +CHIP_CSRCS += rx65n_initialstate.c CHIP_CSRCS += rx65n_hardware_setup.c rx65n_port.c rx65n_sci.c CHIP_CSRCS += rx65n_cgc.c rx65n_registerdump.c rx65n_vector_table.c CHIP_CSRCS += rx65n_timerisr.c rx65n_sbram.c +ifeq ($(CONFIG_ENABLE_ALL_SIGNALS),y) +CHIP_CSRCS += rx65n_schedulesigaction.c rx65n_sigdeliver.c +endif + ifeq ($(CONFIG_RX65N_EMAC),y) CHIP_CSRCS += rx65n_eth.c rx65n_cmtw0.c endif diff --git a/arch/renesas/src/sh1/Make.defs b/arch/renesas/src/sh1/Make.defs index ecef2adf951b9..dcf496842d967 100644 --- a/arch/renesas/src/sh1/Make.defs +++ b/arch/renesas/src/sh1/Make.defs @@ -27,12 +27,16 @@ CMN_CSRCS += renesas_exit.c renesas_getintstack.c renesas_initialize.c CMN_CSRCS += renesas_idle.c renesas_initialstate.c renesas_lowputs.c CMN_CSRCS += renesas_nputs.c renesas_releasestack.c CMN_CSRCS += renesas_stackframe.c renesas_switchcontext.c -CMN_CSRCS += renesas_usestack.c sh1_schedulesigaction.c sh1_sigdeliver.c +CMN_CSRCS += renesas_usestack.c CHIP_ASRCS = sh1_vector.S sh1_saveusercontext.S CHIP_CSRCS = sh1_lowputc.c sh1_irq.c sh1_serial.c sh1_initialstate.c CHIP_CSRCS += sh1_copystate.c sh1_registerdump.c +ifeq ($(CONFIG_ENABLE_ALL_SIGNALS),y) +CMN_CSRCS += sh1_schedulesigaction.c sh1_sigdeliver.c +endif + ifneq ($(CONFIG_SCHED_TICKLESS),y) CHIP_CSRCS += sh1_timerisr.c endif From 36f0f7491c4b1525f8a786463256278de475ec6c Mon Sep 17 00:00:00 2001 From: wangchengdong Date: Tue, 13 Jan 2026 09:54:34 +0800 Subject: [PATCH 17/19] arch/sim: Add support to disable signals actions related data struct Add support to disable signals actions related struct Co-authored-by: guoshichao Signed-off-by: Chengdong Wang --- arch/sim/src/Makefile | 8 ++++++-- arch/sim/src/sim/CMakeLists.txt | 6 ++++-- arch/sim/src/sim/sim_switchcontext.c | 2 ++ 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/arch/sim/src/Makefile b/arch/sim/src/Makefile index 9c4b42e8e762e..fb4df6432961a 100644 --- a/arch/sim/src/Makefile +++ b/arch/sim/src/Makefile @@ -81,11 +81,15 @@ AOBJS = $(ASRCS:.S=$(OBJEXT)) CSRCS = sim_initialize.c sim_idle.c sim_doirq.c sim_initialstate.c CSRCS += sim_createstack.c sim_usestack.c sim_releasestack.c sim_stackframe.c -CSRCS += sim_exit.c sim_schedulesigaction.c sim_switchcontext.c sim_heap.c -CSRCS += sim_uart.c sim_copyfullstate.c sim_sigdeliver.c sim_tcbinfo.c sim_cpuinfo.c +CSRCS += sim_exit.c sim_switchcontext.c sim_heap.c +CSRCS += sim_uart.c sim_copyfullstate.c sim_tcbinfo.c sim_cpuinfo.c CSRCS += sim_registerdump.c sim_saveusercontext.c sim_sectionheap.c CSRCS += sim_checkhostfstypes.c +ifeq ($(CONFIG_ENABLE_ALL_SIGNALS),y) +CSRCS += sim_schedulesigaction.c sim_sigdeliver.c +endif + ifeq ($(CONFIG_SCHED_BACKTRACE),y) CSRCS += sim_backtrace.c endif diff --git a/arch/sim/src/sim/CMakeLists.txt b/arch/sim/src/sim/CMakeLists.txt index 875040d5ef0aa..0f93510f38f82 100644 --- a/arch/sim/src/sim/CMakeLists.txt +++ b/arch/sim/src/sim/CMakeLists.txt @@ -50,18 +50,20 @@ list( sim_releasestack.c sim_stackframe.c sim_exit.c - sim_schedulesigaction.c sim_switchcontext.c sim_heap.c sim_uart.c sim_copyfullstate.c - sim_sigdeliver.c sim_registerdump.c sim_saveusercontext.c sim_tcbinfo.c sim_sectionheap.c sim_checkhostfstypes.c) +if(CONFIG_ENABLE_ALL_SIGNALS) + list(APPEND SRCS sim_schedulesigaction.c sim_sigdeliver.c) +endif() + if(CONFIG_HOST_X86_64) if(CONFIG_SIM_M32) list(APPEND SRCS sim_fork_x86.S) diff --git a/arch/sim/src/sim/sim_switchcontext.c b/arch/sim/src/sim/sim_switchcontext.c index 5cfe3a8ed4593..4a10d0cd81833 100644 --- a/arch/sim/src/sim/sim_switchcontext.c +++ b/arch/sim/src/sim/sim_switchcontext.c @@ -109,11 +109,13 @@ void up_switch_context(struct tcb_s *tcb, struct tcb_s *rtcb) } else { +#ifdef CONFIG_ENABLE_ALL_SIGNALS /* The way that we handle signals in the simulation is kind of * a kludge. This would be unsafe in a truly multi-threaded, * interrupt driven environment. */ sim_sigdeliver(); +#endif } } From 10f6067e8a54ee95745a2b749cef7a26a611aaeb Mon Sep 17 00:00:00 2001 From: wangchengdong Date: Tue, 13 Jan 2026 09:56:47 +0800 Subject: [PATCH 18/19] arch/sparc: Add support to disable signals actions related data struct Add support to disable signals actions related struct Co-authored-by: guoshichao Signed-off-by: Chengdong Wang --- arch/sparc/include/sparc_v8/irq.h | 2 ++ arch/sparc/src/sparc_v8/Make.defs | 8 ++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/arch/sparc/include/sparc_v8/irq.h b/arch/sparc/include/sparc_v8/irq.h index 701df770f3410..eb61189f889ea 100644 --- a/arch/sparc/include/sparc_v8/irq.h +++ b/arch/sparc/include/sparc_v8/irq.h @@ -429,6 +429,7 @@ struct xcpt_syscall_s struct xcptcontext { +#ifdef CONFIG_ENABLE_ALL_SIGNALS /* These additional register save locations are used to implement the * signal delivery trampoline. * @@ -450,6 +451,7 @@ struct xcptcontext uint32_t sigreturn; #endif +#endif /* CONFIG_ENABLE_ALL_SIGNALS */ #ifdef CONFIG_BUILD_KERNEL /* The following array holds information needed to return from each nested diff --git a/arch/sparc/src/sparc_v8/Make.defs b/arch/sparc/src/sparc_v8/Make.defs index fb5adaa745658..f7315f34ce374 100644 --- a/arch/sparc/src/sparc_v8/Make.defs +++ b/arch/sparc/src/sparc_v8/Make.defs @@ -27,6 +27,10 @@ include common/Make.defs CMN_ASRCS += sparc_v8_syscall.S CMN_CSRCS += sparc_v8_copystate.c sparc_v8_doirq.c CMN_CSRCS += sparc_v8_initialstate.c sparc_v8_irq.c -CMN_CSRCS += sparc_v8_schedulesigaction.c sparc_v8_saveusercontext.c -CMN_CSRCS += sparc_v8_sigdeliver.c sparc_v8_swint1.c sparc_v8_systemreset.c +CMN_CSRCS += sparc_v8_saveusercontext.c +CMN_CSRCS += sparc_v8_swint1.c sparc_v8_systemreset.c CMN_CSRCS += sparc_v8_switchcontext.c sparc_v8_registerdump.c + +ifeq ($(CONFIG_ENABLE_ALL_SIGNALS),y) + CMN_CSRCS += sparc_v8_schedulesigaction.c sparc_v8_sigdeliver.c +endif From 43ee2fb4110cd9e7c2d6399d1bbac8aa2802ebf1 Mon Sep 17 00:00:00 2001 From: wangchengdong Date: Tue, 13 Jan 2026 18:11:40 +0800 Subject: [PATCH 19/19] boards: enable CONFIG_ENABLE_ALL_SIGNAL Enable CONFIG_ENABLE_ALL_SIGNAL to fix build errors Signed-off-by: Chengdong Wang --- boards/arm/mps/mps3-an547/configs/ap/defconfig | 1 + boards/arm/mps/mps3-an547/configs/bl/defconfig | 1 + boards/arm/nrf53/nrf5340-dk/configs/sdc_nimble_cpunet/defconfig | 1 + boards/arm/stm32/nucleo-f302r8/configs/cansock/defconfig | 1 + boards/arm/stm32/stm32f103-minimum/configs/adb/defconfig | 1 + boards/arm/stm32/stm32f103-minimum/configs/sensors/defconfig | 1 + boards/arm/stm32/stm32f103-minimum/configs/userled/defconfig | 1 + boards/arm/stm32/stm32ldiscovery/configs/chrono/defconfig | 1 + boards/arm/tlsr82/tlsr8278adk80d/configs/nsh/defconfig | 1 + boards/risc-v/bl602/bl602evb/configs/elf/defconfig | 1 + boards/risc-v/bl602/bl602evb/configs/fpu/defconfig | 1 + boards/risc-v/bl602/bl602evb/configs/gpio/defconfig | 1 + boards/risc-v/bl602/bl602evb/configs/i2c/defconfig | 1 + boards/risc-v/bl602/bl602evb/configs/nsh/defconfig | 1 + boards/risc-v/bl602/bl602evb/configs/spi/defconfig | 1 + boards/risc-v/bl602/bl602evb/configs/spiflash/defconfig | 1 + boards/risc-v/bl602/bl602evb/configs/timer/defconfig | 1 + 17 files changed, 17 insertions(+) diff --git a/boards/arm/mps/mps3-an547/configs/ap/defconfig b/boards/arm/mps/mps3-an547/configs/ap/defconfig index 5736938256a2f..55363ba75fe99 100644 --- a/boards/arm/mps/mps3-an547/configs/ap/defconfig +++ b/boards/arm/mps/mps3-an547/configs/ap/defconfig @@ -93,6 +93,7 @@ CONFIG_DEBUG_SYMBOLS=y CONFIG_DEFAULT_SMALL=y CONFIG_DEFAULT_TASK_STACKSIZE=4096 CONFIG_DEV_NULL=y +CONFIG_ENABLE_ALL_SIGNALS=y CONFIG_EXAMPLES_HELLO=y CONFIG_EXPERIMENTAL=y CONFIG_FILE_STREAM=y diff --git a/boards/arm/mps/mps3-an547/configs/bl/defconfig b/boards/arm/mps/mps3-an547/configs/bl/defconfig index bf70f997fbe4a..108804aae12e0 100644 --- a/boards/arm/mps/mps3-an547/configs/bl/defconfig +++ b/boards/arm/mps/mps3-an547/configs/bl/defconfig @@ -112,6 +112,7 @@ CONFIG_DEBUG_SYMBOLS=y CONFIG_DEFAULT_SMALL=y CONFIG_DEFAULT_TASK_STACKSIZE=4096 CONFIG_DEV_NULL=y +CONFIG_ENABLE_ALL_SIGNALS=y CONFIG_EXAMPLES_HELLO=y CONFIG_EXPERIMENTAL=y CONFIG_FILE_STREAM=y diff --git a/boards/arm/nrf53/nrf5340-dk/configs/sdc_nimble_cpunet/defconfig b/boards/arm/nrf53/nrf5340-dk/configs/sdc_nimble_cpunet/defconfig index d351b06c94641..0b19475883a15 100644 --- a/boards/arm/nrf53/nrf5340-dk/configs/sdc_nimble_cpunet/defconfig +++ b/boards/arm/nrf53/nrf5340-dk/configs/sdc_nimble_cpunet/defconfig @@ -34,6 +34,7 @@ CONFIG_BOARDCTL_MKRD=y CONFIG_BOARD_LOOPSPERMSEC=5500 CONFIG_DEFAULT_SMALL=y CONFIG_DISABLE_MQUEUE_SYSV=y +CONFIG_ENABLE_ALL_SIGNALS=y CONFIG_EXAMPLES_NIMBLE=y CONFIG_EXPERIMENTAL=y CONFIG_FILE_STREAM=y diff --git a/boards/arm/stm32/nucleo-f302r8/configs/cansock/defconfig b/boards/arm/stm32/nucleo-f302r8/configs/cansock/defconfig index d41228ca9b6c6..211723ccd330d 100644 --- a/boards/arm/stm32/nucleo-f302r8/configs/cansock/defconfig +++ b/boards/arm/stm32/nucleo-f302r8/configs/cansock/defconfig @@ -28,6 +28,7 @@ CONFIG_CANUTILS_LIBCANUTILS=y CONFIG_DEBUG_FULLOPT=y CONFIG_DEBUG_SYMBOLS=y CONFIG_DEFAULT_SMALL=y +CONFIG_ENABLE_ALL_SIGNALS=y CONFIG_FILE_STREAM=y CONFIG_INIT_ENTRYPOINT="nsh_main" CONFIG_INTELHEX_BINARY=y diff --git a/boards/arm/stm32/stm32f103-minimum/configs/adb/defconfig b/boards/arm/stm32/stm32f103-minimum/configs/adb/defconfig index 8b940789fe3d5..2f879106d26a0 100644 --- a/boards/arm/stm32/stm32f103-minimum/configs/adb/defconfig +++ b/boards/arm/stm32/stm32f103-minimum/configs/adb/defconfig @@ -41,6 +41,7 @@ CONFIG_BOARDCTL_RESET=y CONFIG_BOARD_LOOPSPERMSEC=5483 CONFIG_BUILTIN=y CONFIG_DEFAULT_SMALL=y +CONFIG_ENABLE_ALL_SIGNALS=y CONFIG_EXAMPLES_HELLO=y CONFIG_FILE_STREAM=y CONFIG_FS_PROCFS=y diff --git a/boards/arm/stm32/stm32f103-minimum/configs/sensors/defconfig b/boards/arm/stm32/stm32f103-minimum/configs/sensors/defconfig index c8c10fe6ab828..ed0d72641de6f 100644 --- a/boards/arm/stm32/stm32f103-minimum/configs/sensors/defconfig +++ b/boards/arm/stm32/stm32f103-minimum/configs/sensors/defconfig @@ -30,6 +30,7 @@ CONFIG_CDCACM_CONSOLE=y CONFIG_CDCACM_RXBUFSIZE=256 CONFIG_CDCACM_TXBUFSIZE=256 CONFIG_DEFAULT_SMALL=y +CONFIG_ENABLE_ALL_SIGNALS=y CONFIG_I2C=y CONFIG_I2C_DRIVER=y CONFIG_I2C_RESET=y diff --git a/boards/arm/stm32/stm32f103-minimum/configs/userled/defconfig b/boards/arm/stm32/stm32f103-minimum/configs/userled/defconfig index c06f8a447e466..1912332b6b787 100644 --- a/boards/arm/stm32/stm32f103-minimum/configs/userled/defconfig +++ b/boards/arm/stm32/stm32f103-minimum/configs/userled/defconfig @@ -28,6 +28,7 @@ CONFIG_BOARD_LATE_INITIALIZE=y CONFIG_BOARD_LOOPSPERMSEC=5483 CONFIG_BUILTIN=y CONFIG_DEFAULT_SMALL=y +CONFIG_ENABLE_ALL_SIGNALS=y CONFIG_EXAMPLES_LEDS=y CONFIG_FILE_STREAM=y CONFIG_INIT_ENTRYPOINT="nsh_main" diff --git a/boards/arm/stm32/stm32ldiscovery/configs/chrono/defconfig b/boards/arm/stm32/stm32ldiscovery/configs/chrono/defconfig index 37246a30eca34..b94f6a4eabae8 100644 --- a/boards/arm/stm32/stm32ldiscovery/configs/chrono/defconfig +++ b/boards/arm/stm32/stm32ldiscovery/configs/chrono/defconfig @@ -25,6 +25,7 @@ CONFIG_BOARD_LOOPSPERMSEC=2796 CONFIG_BUILTIN=y CONFIG_DEFAULT_SMALL=y CONFIG_DISABLE_MOUNTPOINT=y +CONFIG_ENABLE_ALL_SIGNALS=y CONFIG_EXAMPLES_CHRONO=y CONFIG_EXAMPLES_SLCD=y CONFIG_FILE_STREAM=y diff --git a/boards/arm/tlsr82/tlsr8278adk80d/configs/nsh/defconfig b/boards/arm/tlsr82/tlsr8278adk80d/configs/nsh/defconfig index a0dadb6ce1cc4..b5a38c2d853f5 100644 --- a/boards/arm/tlsr82/tlsr8278adk80d/configs/nsh/defconfig +++ b/boards/arm/tlsr82/tlsr8278adk80d/configs/nsh/defconfig @@ -54,6 +54,7 @@ CONFIG_DEBUG_SYMBOLS=y CONFIG_DEFAULT_SMALL=y CONFIG_DEV_GPIO=y CONFIG_DRVR_MKRD=y +CONFIG_ENABLE_ALL_SIGNALS=y CONFIG_EXAMPLES_HELLO=y CONFIG_FILE_STREAM=y CONFIG_FS_PROCFS=y diff --git a/boards/risc-v/bl602/bl602evb/configs/elf/defconfig b/boards/risc-v/bl602/bl602evb/configs/elf/defconfig index f88350292f096..6e65a97d1037e 100644 --- a/boards/risc-v/bl602/bl602evb/configs/elf/defconfig +++ b/boards/risc-v/bl602/bl602evb/configs/elf/defconfig @@ -42,6 +42,7 @@ CONFIG_DEBUG_SYMBOLS=y CONFIG_DEFAULT_SMALL=y CONFIG_DEV_ZERO=y CONFIG_ELF=y +CONFIG_ENABLE_ALL_SIGNALS=y CONFIG_EXAMPLES_ELF=y CONFIG_EXAMPLES_HELLO=y CONFIG_EXAMPLES_HELLO_STACKSIZE=8192 diff --git a/boards/risc-v/bl602/bl602evb/configs/fpu/defconfig b/boards/risc-v/bl602/bl602evb/configs/fpu/defconfig index 2a4a3c6382c2e..aef984115daa9 100644 --- a/boards/risc-v/bl602/bl602evb/configs/fpu/defconfig +++ b/boards/risc-v/bl602/bl602evb/configs/fpu/defconfig @@ -36,6 +36,7 @@ CONFIG_DEBUG_FULLOPT=y CONFIG_DEBUG_SYMBOLS=y CONFIG_DEFAULT_SMALL=y CONFIG_DEV_ZERO=y +CONFIG_ENABLE_ALL_SIGNALS=y CONFIG_EXAMPLES_HELLO=y CONFIG_EXAMPLES_HELLO_STACKSIZE=8192 CONFIG_EXAMPLES_TIMER=y diff --git a/boards/risc-v/bl602/bl602evb/configs/gpio/defconfig b/boards/risc-v/bl602/bl602evb/configs/gpio/defconfig index d1148a058fa1b..a9eb7a8821761 100644 --- a/boards/risc-v/bl602/bl602evb/configs/gpio/defconfig +++ b/boards/risc-v/bl602/bl602evb/configs/gpio/defconfig @@ -37,6 +37,7 @@ CONFIG_DEBUG_SYMBOLS=y CONFIG_DEFAULT_SMALL=y CONFIG_DEV_GPIO=y CONFIG_DEV_ZERO=y +CONFIG_ENABLE_ALL_SIGNALS=y CONFIG_EXAMPLES_GPIO=y CONFIG_EXAMPLES_HELLO=y CONFIG_EXAMPLES_HELLO_STACKSIZE=8192 diff --git a/boards/risc-v/bl602/bl602evb/configs/i2c/defconfig b/boards/risc-v/bl602/bl602evb/configs/i2c/defconfig index a4a81d1f95a8e..28f36a4579f9e 100644 --- a/boards/risc-v/bl602/bl602evb/configs/i2c/defconfig +++ b/boards/risc-v/bl602/bl602evb/configs/i2c/defconfig @@ -37,6 +37,7 @@ CONFIG_DEBUG_FULLOPT=y CONFIG_DEBUG_SYMBOLS=y CONFIG_DEFAULT_SMALL=y CONFIG_DEV_ZERO=y +CONFIG_ENABLE_ALL_SIGNALS=y CONFIG_EXAMPLES_HELLO=y CONFIG_EXAMPLES_HELLO_STACKSIZE=8192 CONFIG_EXAMPLES_TIMER=y diff --git a/boards/risc-v/bl602/bl602evb/configs/nsh/defconfig b/boards/risc-v/bl602/bl602evb/configs/nsh/defconfig index 4d14d3a5de909..c7c30d72ef46b 100644 --- a/boards/risc-v/bl602/bl602evb/configs/nsh/defconfig +++ b/boards/risc-v/bl602/bl602evb/configs/nsh/defconfig @@ -36,6 +36,7 @@ CONFIG_DEBUG_FULLOPT=y CONFIG_DEBUG_SYMBOLS=y CONFIG_DEFAULT_SMALL=y CONFIG_DEV_ZERO=y +CONFIG_ENABLE_ALL_SIGNALS=y CONFIG_EXAMPLES_HELLO=y CONFIG_EXAMPLES_HELLO_STACKSIZE=8192 CONFIG_EXAMPLES_TIMER=y diff --git a/boards/risc-v/bl602/bl602evb/configs/spi/defconfig b/boards/risc-v/bl602/bl602evb/configs/spi/defconfig index 36d1b09b0e65f..6330432b7fce2 100644 --- a/boards/risc-v/bl602/bl602evb/configs/spi/defconfig +++ b/boards/risc-v/bl602/bl602evb/configs/spi/defconfig @@ -37,6 +37,7 @@ CONFIG_DEBUG_FULLOPT=y CONFIG_DEBUG_SYMBOLS=y CONFIG_DEFAULT_SMALL=y CONFIG_DEV_ZERO=y +CONFIG_ENABLE_ALL_SIGNALS=y CONFIG_EXAMPLES_HELLO=y CONFIG_EXAMPLES_HELLO_STACKSIZE=8192 CONFIG_EXAMPLES_TIMER=y diff --git a/boards/risc-v/bl602/bl602evb/configs/spiflash/defconfig b/boards/risc-v/bl602/bl602evb/configs/spiflash/defconfig index 142405dc9906b..f567b4af69ea7 100644 --- a/boards/risc-v/bl602/bl602evb/configs/spiflash/defconfig +++ b/boards/risc-v/bl602/bl602evb/configs/spiflash/defconfig @@ -38,6 +38,7 @@ CONFIG_DEBUG_FULLOPT=y CONFIG_DEBUG_SYMBOLS=y CONFIG_DEFAULT_SMALL=y CONFIG_DEV_ZERO=y +CONFIG_ENABLE_ALL_SIGNALS=y CONFIG_EXAMPLES_HELLO=y CONFIG_EXAMPLES_HELLO_STACKSIZE=8192 CONFIG_EXAMPLES_TIMER=y diff --git a/boards/risc-v/bl602/bl602evb/configs/timer/defconfig b/boards/risc-v/bl602/bl602evb/configs/timer/defconfig index 198ad9e46b561..34046affedf30 100644 --- a/boards/risc-v/bl602/bl602evb/configs/timer/defconfig +++ b/boards/risc-v/bl602/bl602evb/configs/timer/defconfig @@ -38,6 +38,7 @@ CONFIG_DEBUG_FULLOPT=y CONFIG_DEBUG_SYMBOLS=y CONFIG_DEFAULT_SMALL=y CONFIG_DEV_ZERO=y +CONFIG_ENABLE_ALL_SIGNALS=y CONFIG_EXAMPLES_HELLO=y CONFIG_EXAMPLES_HELLO_STACKSIZE=8192 CONFIG_EXAMPLES_PWM=y