Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 #ifndef _LINUX_SIGNAL_TYPES_H
0003 #define _LINUX_SIGNAL_TYPES_H
0004 
0005 /*
0006  * Basic signal handling related data type definitions:
0007  */
0008 
0009 #include <linux/list.h>
0010 #include <uapi/linux/signal.h>
0011 
0012 typedef struct kernel_siginfo {
0013     __SIGINFO;
0014 } kernel_siginfo_t;
0015 
0016 struct ucounts;
0017 
0018 /*
0019  * Real Time signals may be queued.
0020  */
0021 
0022 struct sigqueue {
0023     struct list_head list;
0024     int flags;
0025     kernel_siginfo_t info;
0026     struct ucounts *ucounts;
0027 };
0028 
0029 /* flags values. */
0030 #define SIGQUEUE_PREALLOC   1
0031 
0032 struct sigpending {
0033     struct list_head list;
0034     sigset_t signal;
0035 };
0036 
0037 struct sigaction {
0038 #ifndef __ARCH_HAS_IRIX_SIGACTION
0039     __sighandler_t  sa_handler;
0040     unsigned long   sa_flags;
0041 #else
0042     unsigned int    sa_flags;
0043     __sighandler_t  sa_handler;
0044 #endif
0045 #ifdef __ARCH_HAS_SA_RESTORER
0046     __sigrestore_t sa_restorer;
0047 #endif
0048     sigset_t    sa_mask;    /* mask last for extensibility */
0049 };
0050 
0051 struct k_sigaction {
0052     struct sigaction sa;
0053 #ifdef __ARCH_HAS_KA_RESTORER
0054     __sigrestore_t ka_restorer;
0055 #endif
0056 };
0057 
0058 #ifdef CONFIG_OLD_SIGACTION
0059 struct old_sigaction {
0060     __sighandler_t sa_handler;
0061     old_sigset_t sa_mask;
0062     unsigned long sa_flags;
0063     __sigrestore_t sa_restorer;
0064 };
0065 #endif
0066 
0067 struct ksignal {
0068     struct k_sigaction ka;
0069     kernel_siginfo_t info;
0070     int sig;
0071 };
0072 
0073 /* Used to kill the race between sigaction and forced signals */
0074 #define SA_IMMUTABLE        0x00800000
0075 
0076 #ifndef __ARCH_UAPI_SA_FLAGS
0077 #ifdef SA_RESTORER
0078 #define __ARCH_UAPI_SA_FLAGS    SA_RESTORER
0079 #else
0080 #define __ARCH_UAPI_SA_FLAGS    0
0081 #endif
0082 #endif
0083 
0084 #define UAPI_SA_FLAGS                                                          \
0085     (SA_NOCLDSTOP | SA_NOCLDWAIT | SA_SIGINFO | SA_ONSTACK | SA_RESTART |  \
0086      SA_NODEFER | SA_RESETHAND | SA_EXPOSE_TAGBITS | __ARCH_UAPI_SA_FLAGS)
0087 
0088 #endif /* _LINUX_SIGNAL_TYPES_H */