xref: /linux/arch/s390/include/uapi/asm/signal.h (revision cdd38c5f1ce4398ec58fec95904b75824daab7b5)
16f52b16cSGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
29807f759SDavid Howells /*
39807f759SDavid Howells  *  S390 version
49807f759SDavid Howells  *
59807f759SDavid Howells  *  Derived from "include/asm-i386/signal.h"
69807f759SDavid Howells  */
79807f759SDavid Howells 
89807f759SDavid Howells #ifndef _UAPI_ASMS390_SIGNAL_H
99807f759SDavid Howells #define _UAPI_ASMS390_SIGNAL_H
109807f759SDavid Howells 
119807f759SDavid Howells #include <linux/types.h>
129807f759SDavid Howells #include <linux/time.h>
139807f759SDavid Howells 
149807f759SDavid Howells /* Avoid too many header ordering problems.  */
159807f759SDavid Howells struct siginfo;
169807f759SDavid Howells struct pt_regs;
179807f759SDavid Howells 
189807f759SDavid Howells #ifndef __KERNEL__
199807f759SDavid Howells /* Here we must cater to libcs that poke about in kernel headers.  */
209807f759SDavid Howells 
219807f759SDavid Howells #define NSIG            32
229807f759SDavid Howells typedef unsigned long sigset_t;
239807f759SDavid Howells 
249807f759SDavid Howells #endif /* __KERNEL__ */
259807f759SDavid Howells 
269807f759SDavid Howells #define SIGHUP           1
279807f759SDavid Howells #define SIGINT           2
289807f759SDavid Howells #define SIGQUIT          3
299807f759SDavid Howells #define SIGILL           4
309807f759SDavid Howells #define SIGTRAP          5
319807f759SDavid Howells #define SIGABRT          6
329807f759SDavid Howells #define SIGIOT           6
339807f759SDavid Howells #define SIGBUS           7
349807f759SDavid Howells #define SIGFPE           8
359807f759SDavid Howells #define SIGKILL          9
369807f759SDavid Howells #define SIGUSR1         10
379807f759SDavid Howells #define SIGSEGV         11
389807f759SDavid Howells #define SIGUSR2         12
399807f759SDavid Howells #define SIGPIPE         13
409807f759SDavid Howells #define SIGALRM         14
419807f759SDavid Howells #define SIGTERM         15
429807f759SDavid Howells #define SIGSTKFLT       16
439807f759SDavid Howells #define SIGCHLD         17
449807f759SDavid Howells #define SIGCONT         18
459807f759SDavid Howells #define SIGSTOP         19
469807f759SDavid Howells #define SIGTSTP         20
479807f759SDavid Howells #define SIGTTIN         21
489807f759SDavid Howells #define SIGTTOU         22
499807f759SDavid Howells #define SIGURG          23
509807f759SDavid Howells #define SIGXCPU         24
519807f759SDavid Howells #define SIGXFSZ         25
529807f759SDavid Howells #define SIGVTALRM       26
539807f759SDavid Howells #define SIGPROF         27
549807f759SDavid Howells #define SIGWINCH        28
559807f759SDavid Howells #define SIGIO           29
569807f759SDavid Howells #define SIGPOLL         SIGIO
579807f759SDavid Howells /*
589807f759SDavid Howells #define SIGLOST         29
599807f759SDavid Howells */
609807f759SDavid Howells #define SIGPWR          30
619807f759SDavid Howells #define SIGSYS		31
629807f759SDavid Howells #define SIGUNUSED       31
639807f759SDavid Howells 
649807f759SDavid Howells /* These should not be considered constants from userland.  */
659807f759SDavid Howells #define SIGRTMIN        32
669807f759SDavid Howells #define SIGRTMAX        _NSIG
679807f759SDavid Howells 
689807f759SDavid Howells #define SA_RESTORER     0x04000000
699807f759SDavid Howells 
709807f759SDavid Howells #define MINSIGSTKSZ     2048
719807f759SDavid Howells #define SIGSTKSZ        8192
729807f759SDavid Howells 
739807f759SDavid Howells #include <asm-generic/signal-defs.h>
749807f759SDavid Howells 
759807f759SDavid Howells #ifndef __KERNEL__
769807f759SDavid Howells 
77*fae76491SMartin Schwidefsky /*
78*fae76491SMartin Schwidefsky  * There are two system calls in regard to sigaction, sys_rt_sigaction
79*fae76491SMartin Schwidefsky  * and sys_sigaction. Internally the kernel uses the struct old_sigaction
80*fae76491SMartin Schwidefsky  * for the older sys_sigaction system call, and the kernel version of the
81*fae76491SMartin Schwidefsky  * struct sigaction for the newer sys_rt_sigaction.
82*fae76491SMartin Schwidefsky  *
83*fae76491SMartin Schwidefsky  * The uapi definition for struct sigaction has made a strange distinction
84*fae76491SMartin Schwidefsky  * between 31-bit and 64-bit in the past. For 64-bit the uapi structure
85*fae76491SMartin Schwidefsky  * looks like the kernel struct sigaction, but for 31-bit it used to
86*fae76491SMartin Schwidefsky  * look like the kernel struct old_sigaction. That practically made the
87*fae76491SMartin Schwidefsky  * structure unusable for either system call. To get around this problem
88*fae76491SMartin Schwidefsky  * the glibc always had its own definitions for the sigaction structures.
89*fae76491SMartin Schwidefsky  *
90*fae76491SMartin Schwidefsky  * The current struct sigaction uapi definition below is suitable for the
91*fae76491SMartin Schwidefsky  * sys_rt_sigaction system call only.
92*fae76491SMartin Schwidefsky  */
939807f759SDavid Howells struct sigaction {
949807f759SDavid Howells         union {
959807f759SDavid Howells           __sighandler_t _sa_handler;
969807f759SDavid Howells           void (*_sa_sigaction)(int, struct siginfo *, void *);
979807f759SDavid Howells         } _u;
989807f759SDavid Howells         unsigned long sa_flags;
999807f759SDavid Howells         void (*sa_restorer)(void);
1009807f759SDavid Howells 	sigset_t sa_mask;
1019807f759SDavid Howells };
1029807f759SDavid Howells 
1039807f759SDavid Howells #define sa_handler      _u._sa_handler
1049807f759SDavid Howells #define sa_sigaction    _u._sa_sigaction
1059807f759SDavid Howells 
1069807f759SDavid Howells #endif /* __KERNEL__ */
1079807f759SDavid Howells 
1089807f759SDavid Howells typedef struct sigaltstack {
1099807f759SDavid Howells         void __user *ss_sp;
1109807f759SDavid Howells         int ss_flags;
1119807f759SDavid Howells         size_t ss_size;
1129807f759SDavid Howells } stack_t;
1139807f759SDavid Howells 
1149807f759SDavid Howells 
1159807f759SDavid Howells #endif /* _UAPI_ASMS390_SIGNAL_H */
116