signal: Remove configurable assignment of signal numbers

please reference the issue here for more information:
https://github.com/apache/nuttx/issues/8898

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao 2023-03-25 03:23:46 +08:00 committed by patacongo
parent 2ddc96ff66
commit 5ce5d01d75
6 changed files with 29 additions and 404 deletions

View File

@ -68,14 +68,6 @@ to match the highest priority client.
- ``CONFIG_SCHED_HPWORKSTACKSIZE``. The stack size allocated for
the worker thread in bytes. Default: 2048.
**Common Configuration Options**. These options apply to all work
queues:
- ``CONFIG_SIG_SIGWORK`` The signal number that will be used to
wake-up the worker thread. This same signal is used with various
internal worker threads.
Default: 17
Low Priority Kernel Work Queue
------------------------------

View File

@ -447,7 +447,6 @@ Configurations
CONFIG_LPC54_SDMMC_PWRCTRL=y
CONFIG_LPC54_SDMMC_DMA=y
CONFIG_SIG_SIGWORK=17
CONFIG_SCHED_WORKQUEUE=y
CONFIG_SCHED_HPWORK=y
CONFIG_SCHED_HPWORKPRIORITY=224

View File

@ -73,7 +73,6 @@ CONFIG_SCHED_INSTRUMENTATION_SWITCH=y
CONFIG_SCHED_LPWORK=y
CONFIG_SCHED_LPWORKSTACKSIZE=1800
CONFIG_SCHED_WAITPID=y
CONFIG_SIG_SIGWORK=4
CONFIG_STACK_COLORATION=y
CONFIG_START_DAY=6
CONFIG_START_MONTH=12

View File

@ -57,8 +57,6 @@
* priority worker thread. Default: 224
* CONFIG_SCHED_HPWORKSTACKSIZE - The stack size allocated for the worker
* thread. Default: 2048.
* CONFIG_SIG_SIGWORK - The signal number that will be used to wake-up
* the worker thread. Default: 17
*
* CONFIG_SCHED_LPWORK. If CONFIG_SCHED_LPWORK is selected then a lower-
* priority work queue will be created. This lower priority work queue

View File

@ -129,182 +129,42 @@
* These are the semi-standard signal definitions:
*/
#ifndef CONFIG_SIG_HUP
# define SIGHUP 1
#else
# define SIGHUP CONFIG_SIG_HUP
#endif
#ifndef CONFIG_SIG_INT
# define SIGINT 2
#else
# define SIGINT CONFIG_SIG_INT
#endif
#ifndef CONFIG_SIG_QUIT
# define SIGQUIT 3
#else
# define SIGQUIT CONFIG_SIG_QUIT
#endif
#ifndef CONFIG_SIG_ILL
# define SIGILL 4
#else
# define SIGILL CONFIG_SIG_ILL
#endif
#ifndef CONFIG_SIG_TRAP
# define SIGTRAP 5
#else
# define SIGTRAP CONFIG_SIG_TRAP
#endif
#ifndef CONFIG_SIG_ABRT
# define SIGABRT 6
#else
# define SIGABRT CONFIG_SIG_ABRT
#endif
#ifndef CONFIG_SIG_BUS
# define SIGBUS 7
#else
# define SIGBUS CONFIG_SIG_BUS
#endif
#ifndef CONFIG_SIG_FPE
# define SIGFPE 8
#else
# define SIGFPE CONFIG_SIG_FPE
#endif
#ifndef CONFIG_SIG_KILL
# define SIGKILL 9
#else
# define SIGKILL CONFIG_SIG_KILL
#endif
#ifndef CONFIG_SIG_USR1
# define SIGUSR1 10 /* User signal 1 */
#else
# define SIGUSR1 CONFIG_SIG_USR1
#endif
#ifndef CONFIG_SIG_SEGV
# define SIGSEGV 11
#else
# define SIGSEGV CONFIG_SIG_SEGV
#endif
#ifndef CONFIG_SIG_USR2
# define SIGUSR2 12 /* User signal 2 */
#else
# define SIGUSR2 CONFIG_SIG_USR2
#endif
#ifndef CONFIG_SIG_PIPE
# define SIGPIPE 13
#else
# define SIGPIPE CONFIG_SIG_PIPE
#endif
#ifndef CONFIG_SIG_ALRM
# define SIGALRM 14 /* Default signal used with POSIX timers (used only */
#define SIGHUP 1
#define SIGINT 2
#define SIGQUIT 3
#define SIGILL 4
#define SIGTRAP 5
#define SIGABRT 6
#define SIGBUS 7
#define SIGFPE 8
#define SIGKILL 9
#define SIGUSR1 10 /* User signal 1 */
#define SIGSEGV 11
#define SIGUSR2 12 /* User signal 2 */
#define SIGPIPE 13
#define SIGALRM 14 /* Default signal used with POSIX timers (used only */
/* no other signal is provided) */
#else
# define SIGALRM CONFIG_SIG_ALRM
#endif
#define SIGTERM 15
#define SIGCHLD 17
#define SIGCONT 18
#define SIGSTOP 19
#define SIGTSTP 20
#define SIGTTIN 21
#define SIGTTOU 22
#define SIGURG 23
#define SIGXCPU 24
#define SIGXFSZ 25
#define SIGVTALRM 26
#define SIGPROF 27
#define SIGPOLL 29
#ifndef CONFIG_SIG_TERM
# define SIGTERM 15
#else
# define SIGTERM CONFIG_SIG_TERM
#endif
#ifndef CONFIG_SIG_CHLD
# define SIGCHLD 17
#else
# define SIGCHLD CONFIG_SIG_CHLD
#endif
#ifndef CONFIG_SIG_CONT
# define SIGCONT 18
#else
# define SIGCONT CONFIG_SIG_CONT
#endif
#ifndef CONFIG_SIG_STOP
# define SIGSTOP 19
#else
# define SIGSTOP CONFIG_SIG_STOP
#endif
#ifndef CONFIG_SIG_TSTP
# define SIGTSTP 20
#else
# define SIGTSTP CONFIG_SIG_TSTP
#endif
#ifndef CONFIG_SIG_TTIN
# define SIGTTIN 21
#else
# define SIGTTIN CONFIG_SIG_TTIN
#endif
#ifndef CONFIG_SIG_TTOU
# define SIGTTOU 22
#else
# define SIGTTOU CONFIG_SIG_TTOU
#endif
#ifndef CONFIG_SIG_URG
# define SIGURG 23
#else
# define SIGURG CONFIG_SIG_URG
#endif
#ifndef CONFIG_SIG_XCPU
# define SIGXCPU 24
#else
# define SIGXCPU CONFIG_SIG_XCPU
#endif
#ifndef CONFIG_SIG_XFSZ
# define SIGXFSZ 25
#else
# define SIGXFSZ CONFIG_SIG_XFSZ
#endif
#ifndef CONFIG_SIG_VTALRM
# define SIGVTALRM 26
#else
# define SIGVTALRM CONFIG_SIG_VTALRM
#endif
#ifndef CONFIG_SIG_PROF
# define SIGPROF 27
#else
# define SIGPROF CONFIG_SIG_PROF
#endif
#ifndef CONFIG_SIG_POLL
# define SIGPOLL 29
#else
# define SIGPOLL CONFIG_SIG_POLL
#endif
#define SIGIO SIGPOLL
#define SIGIO SIGPOLL
/* The following are non-standard signal definitions */
/* SIGWORK is used to wake up various internal NuttX worker threads */
#if defined(CONFIG_SCHED_WORKQUEUE) || defined(CONFIG_PAGING)
# ifndef CONFIG_SIG_SIGWORK
# define SIGWORK 31 /* Used to wake up the work queue */
# else
# define SIGWORK CONFIG_SIG_SIGWORK
# endif
#endif
#define SIGWORK 31 /* Used to wake up the work queue */
/* sigprocmask() "how" definitions. Only one of the following can be specified: */

View File

@ -1436,229 +1436,6 @@ config SIG_SIGPOLL_ACTION
endif # SIG_DEFAULT
menu "Signal Numbers"
comment "Standard Signal Numbers"
config SIG_HUP
int "SIGHUP"
default 1
---help---
The SIGHUP would be sent to programs when the serial line was dropped,
often because the connected user terminated the connection by hanging up
the modem. The system would detect the line was dropped via the lost
Data Carrier Detect (DCD) signal.
config SIG_INT
int "SIGINT"
default 2
---help---
The SIGINT signal is sent to cause a task termination event.
SIGINT may be ignored or caught by the receiving task.
config SIG_QUIT
int "SIGQUIT"
default 3
---help---
Similar to SIGINT, but controlled by the QUIT character (usually Ctrl+\).
When a process exits due to a SIGQUIT will generate a core file when it exits,
in the sense that it is similar to a program error signal.
config SIG_ILL
int "SIGILL"
default 4
---help---
The SIGILL executed an illegal instruction. It is usually because of an
error in the executable file itself or an attempt to execute a data segment.
This signal may also be generated when the stack overflows.
config SIG_TRAP
int "SIGTRAP"
default 5
---help---
Trace trap signal, generated by a breakpoint or other trap instruction.
Used by debugger.
config SIG_ABRT
int "SIGABRT"
default 6
---help---
The SIGABRT signal is sent to a process to tell it to abort, i.e. to
terminate. The signal is usually initiated by the process itself when
it calls abort function of the C Standard Library, but it can be sent
to the process from outside like any other signal.
config SIG_BUS
int "SIGBUS"
default 7
---help---
Signal generated by system bus error, illegal address, including memory
address alignment (alignment) error. eg: Accessing an integer four words long,
but its address is not a multiple of 4.
config SIG_FPE
int "SIGFPE"
default 8
---help---
Issued in case of a fatal arithmetic error. This includes not only
floating point errors, but also overflow and all other arithmetic errors such
as division by zero.
config SIG_KILL
int "SIGKILL"
default 9
---help---
A signal that can terminate any process and can only be sent by the administrator;
the signal will not be captured and ignored.
config SIG_USR1
int "SIGUSR1"
default 10
---help---
Value of standard user signal 1 (SIGUSR1). Default: 10
config SIG_SEGV
int "SIGSEGV"
default 11
---help---
Illegal use of memory address signal by attempting to access memory that is not
allocated to you, or attempting to write to a memory address that does not have
write permission.
config SIG_USR2
int "SIGUSR2"
default 12
---help---
Value of standard user signal 2 (SIGUSR2). Default: 12
config SIG_PIPE
int "SIGPIPE"
default 13
---help---
The SIGPIPE signal is sent to a task termination event.
This signal is generated when write on a pipe with no one to read it.
SIGPIPE may be ignored.
config SIG_ALRM
int "SIGALRM"
default 14
---help---
Default the signal number used with POSIX timers (SIGALRM).
Default: 14
config SIG_TERM
int "SIGTERM"
default 15
---help---
The SIGINT signal is sent to cause a task termination event.
SIGTERM may be ignored or caught by the receiving task.
config SIG_CHLD
int "SIGCHLD"
default 17
depends on SCHED_HAVE_PARENT
---help---
The SIGCHLD signal is sent to the parent of a child process when it
exits, is interrupted (stopped), or resumes after being interrupted.
config SIG_CONT
int "SIGCONT"
default 18
---help---
Resume a suspended/paused task. SIGSTOP only has an action when
send to a stopped task. SIGCONT is ignored by other task. SIGCONT
may not be caught or ignored by a stopped task.
config SIG_STOP
int "SIGSTOP"
default 19
---help---
Enable the default action for SIGSTOP and SIGTSTP (suspend the
task) and SIGCONT (resume the task).
config SIG_TSTP
int "SIGTSTP"
default 20
---help---
Suspend pause a task. Unlike SIGSTOP, this signal can be caught or
ignored.
config SIG_TTIN
int "SIGTTIN"
default 21
---help---
A process cannot read from the users terminal while it is running as a
background job. When any process in a background job tries to read from
the terminal, all of the processes in the job are sent a SIGTTIN signal.
The default action for this signal is to stop the process. For more
information about how this interacts with the terminal driver, see Access
to the Controlling Terminal.
config SIG_TTOU
int "SIGTTOU"
default 22
---help---
Similar to SIGTTIN, the signal generated by the interrupt driver when a
background job wants to read data from the user terminal. The signal does
not occur and a read error occurs when the process reading the data blocks
or ignores the signal, or when the process group in which the data is being
read is an isolated process group. errno is set to ETO. The only difference
is that the process can choose to write in the background.
config SIG_URG
int "SIGURG"
default 23
---help---
An emergency situation on the socket is the message sent.
config SIG_XCPU
int "SIGXCPU"
default 24
---help---
Exceeding the CPU time resource limit. This limit can be read/changed by
getrlimit/setrlimit
config SIG_XFSZ
int "SIGXFSZ"
default 25
---help---
Exceed the file size resource limit.
config SIG_VTALRM
int "SIGVTALRM"
default 26
---help---
Virtual clock signal. Similar to SIGALRM, but calculates the CPU time
occupied by the process.
config SIG_PROF
int "SIGPROF"
default 27
---help---
Similar to SIGALRM/SIGVTALRM, but includes the CPU time used by the process
and the time of system calls.
config SIG_POLL
int "SIGPOLL"
default 29
depends on FS_AIO
---help---
The SIGPOLL signal is sent to a process when an asynchronous I/O
event occurs (meaning it has been polled).
comment "Non-standard Signal Numbers"
config SIG_SIGWORK
int "SIGWORK"
default 31
depends on SCHED_WORKQUEUE || LIBC_USRWORK
---help---
SIGWORK is a non-standard signal used to wake up various internal
NuttX worker threads. This setting specifies the signal number
that will be used for SIGWORK. Default: 31
endmenu # Signal Numbers
endmenu # Signal Configuration
menu "Message Queue Options"