linux/include/uapi/asm-generic/siginfo.h

/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
#ifndef _UAPI_ASM_GENERIC_SIGINFO_H
#define _UAPI_ASM_GENERIC_SIGINFO_H

#include <linux/compiler.h>
#include <linux/types.h>

sigval_t;

#define SI_MAX_SIZE

/*
 * The default "si_band" type is "long", as specified by POSIX.
 * However, some architectures want to override this to "int"
 * for historical compatibility reasons, so we allow that.
 */
#ifndef __ARCH_SI_BAND_T
#define __ARCH_SI_BAND_T
#endif

#ifndef __ARCH_SI_CLOCK_T
#define __ARCH_SI_CLOCK_T
#endif

#ifndef __ARCH_SI_ATTRIBUTES
#define __ARCH_SI_ATTRIBUTES
#endif

/*
 * Be careful when extending this union.  On 32bit siginfo_t is 32bit
 * aligned.  Which means that a 64bit field or any other field that
 * would increase the alignment of siginfo_t will break the ABI.
 */
__sifields;

#ifndef __ARCH_HAS_SWAPPED_SIGINFO
#define __SIGINFO
#else
#define __SIGINFO
#endif /* __ARCH_HAS_SWAPPED_SIGINFO */

siginfo_t;

/*
 * How these fields are to be accessed.
 */
#define si_pid
#define si_uid
#define si_tid
#define si_overrun
#define si_sys_private
#define si_status
#define si_utime
#define si_stime
#define si_value
#define si_int
#define si_ptr
#define si_addr
#define si_trapno
#define si_addr_lsb
#define si_lower
#define si_upper
#define si_pkey
#define si_perf_data
#define si_perf_type
#define si_perf_flags
#define si_band
#define si_fd
#define si_call_addr
#define si_syscall
#define si_arch

/*
 * si_code values
 * Digital reserves positive values for kernel-generated signals.
 */
#define SI_USER
#define SI_KERNEL
#define SI_QUEUE
#define SI_TIMER
#define SI_MESGQ
#define SI_ASYNCIO
#define SI_SIGIO
#define SI_TKILL
#define SI_DETHREAD
#define SI_ASYNCNL

#define SI_FROMUSER(siptr)
#define SI_FROMKERNEL(siptr)

/*
 * SIGILL si_codes
 */
#define ILL_ILLOPC
#define ILL_ILLOPN
#define ILL_ILLADR
#define ILL_ILLTRP
#define ILL_PRVOPC
#define ILL_PRVREG
#define ILL_COPROC
#define ILL_BADSTK
#define ILL_BADIADDR
#define __ILL_BREAK
#define __ILL_BNDMOD
#define NSIGILL

/*
 * SIGFPE si_codes
 */
#define FPE_INTDIV
#define FPE_INTOVF
#define FPE_FLTDIV
#define FPE_FLTOVF
#define FPE_FLTUND
#define FPE_FLTRES
#define FPE_FLTINV
#define FPE_FLTSUB
#define __FPE_DECOVF
#define __FPE_DECDIV
#define __FPE_DECERR
#define __FPE_INVASC
#define __FPE_INVDEC
#define FPE_FLTUNK
#define FPE_CONDTRAP
#define NSIGFPE

/*
 * SIGSEGV si_codes
 */
#define SEGV_MAPERR
#define SEGV_ACCERR
#define SEGV_BNDERR
#ifdef __ia64__
#define __SEGV_PSTKOVF
#else
#define SEGV_PKUERR
#endif
#define SEGV_ACCADI
#define SEGV_ADIDERR
#define SEGV_ADIPERR
#define SEGV_MTEAERR
#define SEGV_MTESERR
#define SEGV_CPERR
#define NSIGSEGV

/*
 * SIGBUS si_codes
 */
#define BUS_ADRALN
#define BUS_ADRERR
#define BUS_OBJERR
/* hardware memory error consumed on a machine check: action required */
#define BUS_MCEERR_AR
/* hardware memory error detected in process but not consumed: action optional*/
#define BUS_MCEERR_AO
#define NSIGBUS

/*
 * SIGTRAP si_codes
 */
#define TRAP_BRKPT
#define TRAP_TRACE
#define TRAP_BRANCH
#define TRAP_HWBKPT
#define TRAP_UNK
#define TRAP_PERF
#define NSIGTRAP

/*
 * There is an additional set of SIGTRAP si_codes used by ptrace
 * that are of the form: ((PTRACE_EVENT_XXX << 8) | SIGTRAP)
 */

/*
 * Flags for si_perf_flags if SIGTRAP si_code is TRAP_PERF.
 */
#define TRAP_PERF_FLAG_ASYNC

/*
 * SIGCHLD si_codes
 */
#define CLD_EXITED
#define CLD_KILLED
#define CLD_DUMPED
#define CLD_TRAPPED
#define CLD_STOPPED
#define CLD_CONTINUED
#define NSIGCHLD

/*
 * SIGPOLL (or any other signal without signal specific si_codes) si_codes
 */
#define POLL_IN
#define POLL_OUT
#define POLL_MSG
#define POLL_ERR
#define POLL_PRI
#define POLL_HUP
#define NSIGPOLL

/*
 * SIGSYS si_codes
 */
#define SYS_SECCOMP
#define SYS_USER_DISPATCH
#define NSIGSYS

/*
 * SIGEMT si_codes
 */
#define EMT_TAGOVF
#define NSIGEMT

/*
 * sigevent definitions
 * 
 * It seems likely that SIGEV_THREAD will have to be handled from 
 * userspace, libpthread transmuting it to SIGEV_SIGNAL, which the
 * thread manager then catches and does the appropriate nonsense.
 * However, everything is written out here so as to not get lost.
 */
#define SIGEV_SIGNAL
#define SIGEV_NONE
#define SIGEV_THREAD
#define SIGEV_THREAD_ID

/*
 * This works because the alignment is ok on all current architectures
 * but we leave open this being overridden in the future
 */
#ifndef __ARCH_SIGEV_PREAMBLE_SIZE
#define __ARCH_SIGEV_PREAMBLE_SIZE
#endif

#define SIGEV_MAX_SIZE
#define SIGEV_PAD_SIZE

sigevent_t;

#define sigev_notify_function
#define sigev_notify_attributes
#define sigev_notify_thread_id


#endif /* _UAPI_ASM_GENERIC_SIGINFO_H */