18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci *  S390 version
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci *  Derived from "include/asm-i386/signal.h"
68c2ecf20Sopenharmony_ci */
78c2ecf20Sopenharmony_ci
88c2ecf20Sopenharmony_ci#ifndef _UAPI_ASMS390_SIGNAL_H
98c2ecf20Sopenharmony_ci#define _UAPI_ASMS390_SIGNAL_H
108c2ecf20Sopenharmony_ci
118c2ecf20Sopenharmony_ci#include <linux/types.h>
128c2ecf20Sopenharmony_ci#include <linux/time.h>
138c2ecf20Sopenharmony_ci
148c2ecf20Sopenharmony_ci/* Avoid too many header ordering problems.  */
158c2ecf20Sopenharmony_cistruct siginfo;
168c2ecf20Sopenharmony_cistruct pt_regs;
178c2ecf20Sopenharmony_ci
188c2ecf20Sopenharmony_ci#ifndef __KERNEL__
198c2ecf20Sopenharmony_ci/* Here we must cater to libcs that poke about in kernel headers.  */
208c2ecf20Sopenharmony_ci
218c2ecf20Sopenharmony_ci#define NSIG            32
228c2ecf20Sopenharmony_citypedef unsigned long sigset_t;
238c2ecf20Sopenharmony_ci
248c2ecf20Sopenharmony_ci#endif /* __KERNEL__ */
258c2ecf20Sopenharmony_ci
268c2ecf20Sopenharmony_ci#define SIGHUP           1
278c2ecf20Sopenharmony_ci#define SIGINT           2
288c2ecf20Sopenharmony_ci#define SIGQUIT          3
298c2ecf20Sopenharmony_ci#define SIGILL           4
308c2ecf20Sopenharmony_ci#define SIGTRAP          5
318c2ecf20Sopenharmony_ci#define SIGABRT          6
328c2ecf20Sopenharmony_ci#define SIGIOT           6
338c2ecf20Sopenharmony_ci#define SIGBUS           7
348c2ecf20Sopenharmony_ci#define SIGFPE           8
358c2ecf20Sopenharmony_ci#define SIGKILL          9
368c2ecf20Sopenharmony_ci#define SIGUSR1         10
378c2ecf20Sopenharmony_ci#define SIGSEGV         11
388c2ecf20Sopenharmony_ci#define SIGUSR2         12
398c2ecf20Sopenharmony_ci#define SIGPIPE         13
408c2ecf20Sopenharmony_ci#define SIGALRM         14
418c2ecf20Sopenharmony_ci#define SIGTERM         15
428c2ecf20Sopenharmony_ci#define SIGSTKFLT       16
438c2ecf20Sopenharmony_ci#define SIGCHLD         17
448c2ecf20Sopenharmony_ci#define SIGCONT         18
458c2ecf20Sopenharmony_ci#define SIGSTOP         19
468c2ecf20Sopenharmony_ci#define SIGTSTP         20
478c2ecf20Sopenharmony_ci#define SIGTTIN         21
488c2ecf20Sopenharmony_ci#define SIGTTOU         22
498c2ecf20Sopenharmony_ci#define SIGURG          23
508c2ecf20Sopenharmony_ci#define SIGXCPU         24
518c2ecf20Sopenharmony_ci#define SIGXFSZ         25
528c2ecf20Sopenharmony_ci#define SIGVTALRM       26
538c2ecf20Sopenharmony_ci#define SIGPROF         27
548c2ecf20Sopenharmony_ci#define SIGWINCH        28
558c2ecf20Sopenharmony_ci#define SIGIO           29
568c2ecf20Sopenharmony_ci#define SIGPOLL         SIGIO
578c2ecf20Sopenharmony_ci/*
588c2ecf20Sopenharmony_ci#define SIGLOST         29
598c2ecf20Sopenharmony_ci*/
608c2ecf20Sopenharmony_ci#define SIGPWR          30
618c2ecf20Sopenharmony_ci#define SIGSYS		31
628c2ecf20Sopenharmony_ci#define SIGUNUSED       31
638c2ecf20Sopenharmony_ci
648c2ecf20Sopenharmony_ci/* These should not be considered constants from userland.  */
658c2ecf20Sopenharmony_ci#define SIGRTMIN        32
668c2ecf20Sopenharmony_ci#define SIGRTMAX        _NSIG
678c2ecf20Sopenharmony_ci
688c2ecf20Sopenharmony_ci/*
698c2ecf20Sopenharmony_ci * SA_FLAGS values:
708c2ecf20Sopenharmony_ci *
718c2ecf20Sopenharmony_ci * SA_ONSTACK indicates that a registered stack_t will be used.
728c2ecf20Sopenharmony_ci * SA_RESTART flag to get restarting signals (which were the default long ago)
738c2ecf20Sopenharmony_ci * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
748c2ecf20Sopenharmony_ci * SA_RESETHAND clears the handler when the signal is delivered.
758c2ecf20Sopenharmony_ci * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies.
768c2ecf20Sopenharmony_ci * SA_NODEFER prevents the current signal from being masked in the handler.
778c2ecf20Sopenharmony_ci *
788c2ecf20Sopenharmony_ci * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single
798c2ecf20Sopenharmony_ci * Unix names RESETHAND and NODEFER respectively.
808c2ecf20Sopenharmony_ci */
818c2ecf20Sopenharmony_ci#define SA_NOCLDSTOP    0x00000001
828c2ecf20Sopenharmony_ci#define SA_NOCLDWAIT    0x00000002
838c2ecf20Sopenharmony_ci#define SA_SIGINFO      0x00000004
848c2ecf20Sopenharmony_ci#define SA_ONSTACK      0x08000000
858c2ecf20Sopenharmony_ci#define SA_RESTART      0x10000000
868c2ecf20Sopenharmony_ci#define SA_NODEFER      0x40000000
878c2ecf20Sopenharmony_ci#define SA_RESETHAND    0x80000000
888c2ecf20Sopenharmony_ci
898c2ecf20Sopenharmony_ci#define SA_NOMASK       SA_NODEFER
908c2ecf20Sopenharmony_ci#define SA_ONESHOT      SA_RESETHAND
918c2ecf20Sopenharmony_ci
928c2ecf20Sopenharmony_ci#define SA_RESTORER     0x04000000
938c2ecf20Sopenharmony_ci
948c2ecf20Sopenharmony_ci#define MINSIGSTKSZ     2048
958c2ecf20Sopenharmony_ci#define SIGSTKSZ        8192
968c2ecf20Sopenharmony_ci
978c2ecf20Sopenharmony_ci#include <asm-generic/signal-defs.h>
988c2ecf20Sopenharmony_ci
998c2ecf20Sopenharmony_ci#ifndef __KERNEL__
1008c2ecf20Sopenharmony_ci
1018c2ecf20Sopenharmony_ci/*
1028c2ecf20Sopenharmony_ci * There are two system calls in regard to sigaction, sys_rt_sigaction
1038c2ecf20Sopenharmony_ci * and sys_sigaction. Internally the kernel uses the struct old_sigaction
1048c2ecf20Sopenharmony_ci * for the older sys_sigaction system call, and the kernel version of the
1058c2ecf20Sopenharmony_ci * struct sigaction for the newer sys_rt_sigaction.
1068c2ecf20Sopenharmony_ci *
1078c2ecf20Sopenharmony_ci * The uapi definition for struct sigaction has made a strange distinction
1088c2ecf20Sopenharmony_ci * between 31-bit and 64-bit in the past. For 64-bit the uapi structure
1098c2ecf20Sopenharmony_ci * looks like the kernel struct sigaction, but for 31-bit it used to
1108c2ecf20Sopenharmony_ci * look like the kernel struct old_sigaction. That practically made the
1118c2ecf20Sopenharmony_ci * structure unusable for either system call. To get around this problem
1128c2ecf20Sopenharmony_ci * the glibc always had its own definitions for the sigaction structures.
1138c2ecf20Sopenharmony_ci *
1148c2ecf20Sopenharmony_ci * The current struct sigaction uapi definition below is suitable for the
1158c2ecf20Sopenharmony_ci * sys_rt_sigaction system call only.
1168c2ecf20Sopenharmony_ci */
1178c2ecf20Sopenharmony_cistruct sigaction {
1188c2ecf20Sopenharmony_ci        union {
1198c2ecf20Sopenharmony_ci          __sighandler_t _sa_handler;
1208c2ecf20Sopenharmony_ci          void (*_sa_sigaction)(int, struct siginfo *, void *);
1218c2ecf20Sopenharmony_ci        } _u;
1228c2ecf20Sopenharmony_ci        unsigned long sa_flags;
1238c2ecf20Sopenharmony_ci        void (*sa_restorer)(void);
1248c2ecf20Sopenharmony_ci	sigset_t sa_mask;
1258c2ecf20Sopenharmony_ci};
1268c2ecf20Sopenharmony_ci
1278c2ecf20Sopenharmony_ci#define sa_handler      _u._sa_handler
1288c2ecf20Sopenharmony_ci#define sa_sigaction    _u._sa_sigaction
1298c2ecf20Sopenharmony_ci
1308c2ecf20Sopenharmony_ci#endif /* __KERNEL__ */
1318c2ecf20Sopenharmony_ci
1328c2ecf20Sopenharmony_citypedef struct sigaltstack {
1338c2ecf20Sopenharmony_ci        void __user *ss_sp;
1348c2ecf20Sopenharmony_ci        int ss_flags;
1358c2ecf20Sopenharmony_ci        size_t ss_size;
1368c2ecf20Sopenharmony_ci} stack_t;
1378c2ecf20Sopenharmony_ci
1388c2ecf20Sopenharmony_ci
1398c2ecf20Sopenharmony_ci#endif /* _UAPI_ASMS390_SIGNAL_H */
140