Home | History | Annotate | Line # | Download | only in common
linux32_siginfo.h revision 1.2
      1  1.2       ryo /* 	$NetBSD: linux32_siginfo.h,v 1.2 2021/11/25 03:08:04 ryo Exp $	*/
      2  1.1  christos 
      3  1.1  christos /*-
      4  1.1  christos  * Copyright (c) 1998 The NetBSD Foundation, Inc.
      5  1.1  christos  * All rights reserved.
      6  1.1  christos  *
      7  1.1  christos  * This code is derived from software contributed to The NetBSD Foundation
      8  1.1  christos  * by Eric Haszlakiewicz.
      9  1.1  christos  *
     10  1.1  christos  * Redistribution and use in source and binary forms, with or without
     11  1.1  christos  * modification, are permitted provided that the following conditions
     12  1.1  christos  * are met:
     13  1.1  christos  * 1. Redistributions of source code must retain the above copyright
     14  1.1  christos  *    notice, this list of conditions and the following disclaimer.
     15  1.1  christos  * 2. Redistributions in binary form must reproduce the above copyright
     16  1.1  christos  *    notice, this list of conditions and the following disclaimer in the
     17  1.1  christos  *    documentation and/or other materials provided with the distribution.
     18  1.1  christos  *
     19  1.1  christos  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     20  1.1  christos  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     21  1.1  christos  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     22  1.1  christos  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     23  1.1  christos  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     24  1.1  christos  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     25  1.1  christos  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     26  1.1  christos  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     27  1.1  christos  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     28  1.1  christos  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     29  1.1  christos  * POSSIBILITY OF SUCH DAMAGE.
     30  1.1  christos  */
     31  1.1  christos 
     32  1.1  christos #ifndef _LINUX32_SIGINFO_H
     33  1.1  christos #define _LINUX32_SIGINFO_H
     34  1.1  christos 
     35  1.2       ryo #if defined(__aarch64__)
     36  1.2       ryo #include <compat/linux32/arch/aarch64/linux32_siginfo.h>
     37  1.2       ryo #elif defined(__amd64__)
     38  1.1  christos #include <compat/linux32/arch/amd64/linux32_siginfo.h>
     39  1.2       ryo #else
     40  1.2       ryo #error Undefined linux32_siginfo.h machine type.
     41  1.1  christos #endif
     42  1.1  christos 
     43  1.1  christos /* si_code values for non signal */
     44  1.1  christos #define	LINUX32_SI_USER		0
     45  1.1  christos #define	LINUX32_SI_KERNEL		0x80
     46  1.1  christos #define	LINUX32_SI_QUEUE		-1
     47  1.1  christos #ifndef LINUX32_SI_TIMER /* all except mips */
     48  1.1  christos #define	LINUX32_SI_TIMER		-2
     49  1.1  christos #define	LINUX32_SI_MESGQ		-3
     50  1.1  christos #define	LINUX32_SI_ASYNCIO	-4
     51  1.1  christos #endif /* LINUX32_SI_TIMER */
     52  1.1  christos #define	LINUX32_SI_SIGIO		-5
     53  1.1  christos #define	LINUX32_SI_TKILL		-6
     54  1.1  christos #define	LINUX32_SI_DETHREAD	-7
     55  1.1  christos 
     56  1.1  christos /* si_code values for SIGILL */
     57  1.1  christos #define	LINUX32_ILL_ILLOPC	1
     58  1.1  christos #define	LINUX32_ILL_ILLOPN	2
     59  1.1  christos #define	LINUX32_ILL_ILLADR	3
     60  1.1  christos #define	LINUX32_ILL_ILLTRP	4
     61  1.1  christos #define	LINUX32_ILL_PRVOPC	5
     62  1.1  christos #define	LINUX32_ILL_PRVREG	6
     63  1.1  christos #define	LINUX32_ILL_COPROC	7
     64  1.1  christos #define	LINUX32_ILL_BADSTK	8
     65  1.1  christos 
     66  1.1  christos /* si_code values for SIGFPE */
     67  1.1  christos #define	LINUX32_FPE_INTDIV	1
     68  1.1  christos #define	LINUX32_FPE_INTOVF	2
     69  1.1  christos #define	LINUX32_FPE_FLTDIV	3
     70  1.1  christos #define	LINUX32_FPE_FLTOVF	4
     71  1.1  christos #define	LINUX32_FPE_FLTUND	5
     72  1.1  christos #define	LINUX32_FPE_FLTRES	6
     73  1.1  christos #define	LINUX32_FPE_FLTINV	7
     74  1.1  christos #define	LINUX32_FPE_FLTSUB	8
     75  1.1  christos 
     76  1.1  christos /* si_code values for SIGSEGV */
     77  1.1  christos #define	LINUX32_SEGV_MAPERR	1
     78  1.1  christos #define	LINUX32_SEGV_ACCERR	2
     79  1.1  christos 
     80  1.1  christos /* si_code values for SIGBUS */
     81  1.1  christos #define	LINUX32_BUS_ADRALN	1
     82  1.1  christos #define	LINUX32_BUS_ADRERR	2
     83  1.1  christos #define	LINUX32_BUS_OBJERR	3
     84  1.1  christos 
     85  1.1  christos /* si_code values for SIGTRAP */
     86  1.1  christos #define	LINUX32_TRAP_BRKPT	1
     87  1.1  christos #define	LINUX32_TRAP_TRACE	2
     88  1.1  christos 
     89  1.1  christos /* si_code values for SIGCHLD */
     90  1.1  christos #define	LINUX32_CLD_EXITED	1
     91  1.1  christos #define	LINUX32_CLD_KILLED	2
     92  1.1  christos #define	LINUX32_CLD_DUMPED	3
     93  1.1  christos #define	LINUX32_CLD_TRAPPED	4
     94  1.1  christos #define	LINUX32_CLD_STOPPED	5
     95  1.1  christos #define	LINUX32_CLD_CONTINUED	6
     96  1.1  christos 
     97  1.1  christos /* si_code values for SIGPOLL */
     98  1.1  christos #define	LINUX32_POLL_IN		1
     99  1.1  christos #define	LINUX32_POLL_OUT		2
    100  1.1  christos #define	LINUX32_POLL_MSG		3
    101  1.1  christos #define	LINUX32_POLL_ERR		4
    102  1.1  christos #define	LINUX32_POLL_PRI		5
    103  1.1  christos #define	LINUX32_POLL_HUP		6
    104  1.1  christos 
    105  1.1  christos #define	LINUX32_SI_FROMUSER(sp)	((sp)->si_code <= 0)
    106  1.1  christos #define	LINUX32_SI_FROMKERNEL(sp)	((sp)->si_code > 0)
    107  1.1  christos 
    108  1.1  christos #define lsi_pid		_sidata._kill._pid
    109  1.1  christos #define lsi_uid		_sidata._kill._uid
    110  1.1  christos #define lsi_status      _sidata._sigchld._status
    111  1.1  christos #define lsi_utime       _sidata._sigchld._utime
    112  1.1  christos #define lsi_stime       _sidata._sigchld._stime
    113  1.1  christos #define lsi_value       _sidata._rt._sigval
    114  1.1  christos #define lsi_sival_int   _sidata._rt._sigval.sival_int
    115  1.1  christos #define lsi_sival_ptr   _sidata._rt._sigval.sival_ptr
    116  1.1  christos #define lsi_addr        _sidata._sigfault._addr
    117  1.1  christos #define lsi_band        _sidata._sigpoll._band
    118  1.1  christos #define lsi_fd          _sidata._sigpoll._fd
    119  1.1  christos 
    120  1.1  christos void native_to_linux32_siginfo(linux32_siginfo_t *, const struct _ksiginfo *);
    121  1.1  christos 
    122  1.1  christos #endif /* !_LINUX32_SIGINFO_H */
    123