162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
262306a36Sopenharmony_ci/*
362306a36Sopenharmony_ci *  S390 version
462306a36Sopenharmony_ci *
562306a36Sopenharmony_ci *  Derived from "include/asm-i386/signal.h"
662306a36Sopenharmony_ci */
762306a36Sopenharmony_ci
862306a36Sopenharmony_ci#ifndef _UAPI_ASMS390_SIGNAL_H
962306a36Sopenharmony_ci#define _UAPI_ASMS390_SIGNAL_H
1062306a36Sopenharmony_ci
1162306a36Sopenharmony_ci#include <linux/types.h>
1262306a36Sopenharmony_ci#include <linux/time.h>
1362306a36Sopenharmony_ci
1462306a36Sopenharmony_ci/* Avoid too many header ordering problems.  */
1562306a36Sopenharmony_cistruct siginfo;
1662306a36Sopenharmony_cistruct pt_regs;
1762306a36Sopenharmony_ci
1862306a36Sopenharmony_ci#ifndef __KERNEL__
1962306a36Sopenharmony_ci/* Here we must cater to libcs that poke about in kernel headers.  */
2062306a36Sopenharmony_ci
2162306a36Sopenharmony_ci#define NSIG            32
2262306a36Sopenharmony_citypedef unsigned long sigset_t;
2362306a36Sopenharmony_ci
2462306a36Sopenharmony_ci#endif /* __KERNEL__ */
2562306a36Sopenharmony_ci
2662306a36Sopenharmony_ci#define SIGHUP           1
2762306a36Sopenharmony_ci#define SIGINT           2
2862306a36Sopenharmony_ci#define SIGQUIT          3
2962306a36Sopenharmony_ci#define SIGILL           4
3062306a36Sopenharmony_ci#define SIGTRAP          5
3162306a36Sopenharmony_ci#define SIGABRT          6
3262306a36Sopenharmony_ci#define SIGIOT           6
3362306a36Sopenharmony_ci#define SIGBUS           7
3462306a36Sopenharmony_ci#define SIGFPE           8
3562306a36Sopenharmony_ci#define SIGKILL          9
3662306a36Sopenharmony_ci#define SIGUSR1         10
3762306a36Sopenharmony_ci#define SIGSEGV         11
3862306a36Sopenharmony_ci#define SIGUSR2         12
3962306a36Sopenharmony_ci#define SIGPIPE         13
4062306a36Sopenharmony_ci#define SIGALRM         14
4162306a36Sopenharmony_ci#define SIGTERM         15
4262306a36Sopenharmony_ci#define SIGSTKFLT       16
4362306a36Sopenharmony_ci#define SIGCHLD         17
4462306a36Sopenharmony_ci#define SIGCONT         18
4562306a36Sopenharmony_ci#define SIGSTOP         19
4662306a36Sopenharmony_ci#define SIGTSTP         20
4762306a36Sopenharmony_ci#define SIGTTIN         21
4862306a36Sopenharmony_ci#define SIGTTOU         22
4962306a36Sopenharmony_ci#define SIGURG          23
5062306a36Sopenharmony_ci#define SIGXCPU         24
5162306a36Sopenharmony_ci#define SIGXFSZ         25
5262306a36Sopenharmony_ci#define SIGVTALRM       26
5362306a36Sopenharmony_ci#define SIGPROF         27
5462306a36Sopenharmony_ci#define SIGWINCH        28
5562306a36Sopenharmony_ci#define SIGIO           29
5662306a36Sopenharmony_ci#define SIGPOLL         SIGIO
5762306a36Sopenharmony_ci/*
5862306a36Sopenharmony_ci#define SIGLOST         29
5962306a36Sopenharmony_ci*/
6062306a36Sopenharmony_ci#define SIGPWR          30
6162306a36Sopenharmony_ci#define SIGSYS		31
6262306a36Sopenharmony_ci#define SIGUNUSED       31
6362306a36Sopenharmony_ci
6462306a36Sopenharmony_ci/* These should not be considered constants from userland.  */
6562306a36Sopenharmony_ci#define SIGRTMIN        32
6662306a36Sopenharmony_ci#define SIGRTMAX        _NSIG
6762306a36Sopenharmony_ci
6862306a36Sopenharmony_ci#define SA_RESTORER     0x04000000
6962306a36Sopenharmony_ci
7062306a36Sopenharmony_ci#define MINSIGSTKSZ     2048
7162306a36Sopenharmony_ci#define SIGSTKSZ        8192
7262306a36Sopenharmony_ci
7362306a36Sopenharmony_ci#include <asm-generic/signal-defs.h>
7462306a36Sopenharmony_ci
7562306a36Sopenharmony_ci#ifndef __KERNEL__
7662306a36Sopenharmony_ci
7762306a36Sopenharmony_ci/*
7862306a36Sopenharmony_ci * There are two system calls in regard to sigaction, sys_rt_sigaction
7962306a36Sopenharmony_ci * and sys_sigaction. Internally the kernel uses the struct old_sigaction
8062306a36Sopenharmony_ci * for the older sys_sigaction system call, and the kernel version of the
8162306a36Sopenharmony_ci * struct sigaction for the newer sys_rt_sigaction.
8262306a36Sopenharmony_ci *
8362306a36Sopenharmony_ci * The uapi definition for struct sigaction has made a strange distinction
8462306a36Sopenharmony_ci * between 31-bit and 64-bit in the past. For 64-bit the uapi structure
8562306a36Sopenharmony_ci * looks like the kernel struct sigaction, but for 31-bit it used to
8662306a36Sopenharmony_ci * look like the kernel struct old_sigaction. That practically made the
8762306a36Sopenharmony_ci * structure unusable for either system call. To get around this problem
8862306a36Sopenharmony_ci * the glibc always had its own definitions for the sigaction structures.
8962306a36Sopenharmony_ci *
9062306a36Sopenharmony_ci * The current struct sigaction uapi definition below is suitable for the
9162306a36Sopenharmony_ci * sys_rt_sigaction system call only.
9262306a36Sopenharmony_ci */
9362306a36Sopenharmony_cistruct sigaction {
9462306a36Sopenharmony_ci        union {
9562306a36Sopenharmony_ci          __sighandler_t _sa_handler;
9662306a36Sopenharmony_ci          void (*_sa_sigaction)(int, struct siginfo *, void *);
9762306a36Sopenharmony_ci        } _u;
9862306a36Sopenharmony_ci        unsigned long sa_flags;
9962306a36Sopenharmony_ci        void (*sa_restorer)(void);
10062306a36Sopenharmony_ci	sigset_t sa_mask;
10162306a36Sopenharmony_ci};
10262306a36Sopenharmony_ci
10362306a36Sopenharmony_ci#define sa_handler      _u._sa_handler
10462306a36Sopenharmony_ci#define sa_sigaction    _u._sa_sigaction
10562306a36Sopenharmony_ci
10662306a36Sopenharmony_ci#endif /* __KERNEL__ */
10762306a36Sopenharmony_ci
10862306a36Sopenharmony_citypedef struct sigaltstack {
10962306a36Sopenharmony_ci        void __user *ss_sp;
11062306a36Sopenharmony_ci        int ss_flags;
11162306a36Sopenharmony_ci	__kernel_size_t ss_size;
11262306a36Sopenharmony_ci} stack_t;
11362306a36Sopenharmony_ci
11462306a36Sopenharmony_ci
11562306a36Sopenharmony_ci#endif /* _UAPI_ASMS390_SIGNAL_H */
116