1/*	$NetBSD: linux32_siginfo.h,v 1.1 2021/11/25 03:08:04 ryo Exp $	*/
2
3/*-
4 * Copyright (c) 2021 The NetBSD Foundation, Inc.
5 * All rights reserved.
6 *
7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Ryo Shimizu.
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:
13 * 1. Redistributions of source code must retain the above copyright
14 *    notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 *    notice, this list of conditions and the following disclaimer in the
17 *    documentation and/or other materials provided with the distribution.
18 *
19 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE.
30 */
31
32#ifndef _AARCH64_LINUX32_SIGINFO_H_
33#define _AARCH64_LINUX32_SIGINFO_H_
34
35#include <compat/linux32/common/linux32_sigevent.h>
36
37#define SI_MAX_SIZE	128
38#define SI_PAD_SIZE	((SI_MAX_SIZE/sizeof(int)) - 3)	/* 3=signo,errno,pad */
39
40typedef struct linux32_siginfo {
41	int lsi_signo;
42	int lsi_errno;
43	int lsi_code;
44	union {
45		int _pad[SI_PAD_SIZE];
46
47		/* kill() */
48		struct {
49			linux32_pid_t	_pid;
50			linux32_uid_t	_uid;
51		} _kill;
52
53		/* POSIX.1b timers */
54		struct {
55			int _tid;
56			int _overrun;
57			linux32_sigval_t _sigval;
58			int _sys_private;
59		} _timer;
60
61		/* POSIX.1b signals */
62		struct {
63			linux32_pid_t _pid;
64			linux32_uid_t _uid;
65			linux32_sigval_t _sigval;
66		} _rt;
67
68		/* SIGCHLD */
69		struct {
70			linux32_pid_t _pid;
71			linux32_uid_t _uid;
72			int _status;
73			linux32_clock_t _utime;
74			linux32_clock_t _stime;
75		} _sigchld;
76
77		/* SIGILL, SIGFPE, SIGSEGV, SIGBUS, SIGTRAP, SIGEMT */
78		struct {
79			netbsd32_voidp _addr;
80			/* ... */
81		} _sigfault;
82
83		/* SIGPOLL */
84		struct {
85			int _band;
86			int _fd;
87		} _sigpoll;
88
89		/* SIGSYS */
90		struct {
91			netbsd32_voidp _call_addr;
92			int _syscall;
93			unsigned int _arch;
94		} _sigsys;
95	} _sidata;
96} linux32_siginfo_t;
97
98#endif /* _AARCH64_LINUX32_SIGINFO_H_ */
99