Home | History | Annotate | Line # | Download | only in aarch64
      1 /*	$NetBSD: linux32_signal.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_SIGNAL_H_
     33 #define _AARCH64_LINUX32_SIGNAL_H_
     34 
     35 #define native_to_linux32_signo native_to_linux_signo
     36 #define linux32_to_native_signo linux_to_native_signo
     37 
     38 typedef netbsd32_pointer_t	linux32_handlerp_t;
     39 typedef netbsd32_pointer_t	linux32_restorer_t;
     40 typedef netbsd32_pointer_t	linux32_siginfop_t;
     41 typedef netbsd32_pointer_t	linux32_ucontextp_t;
     42 typedef netbsd32_pointer_t	linux32_sigcontextp_t;
     43 typedef netbsd32_pointer_t	linux32_fpstatep_t;
     44 typedef u_int32_t		linux32_old_sigset_t;
     45 
     46 #define LINUX32__NSIG		64
     47 #define LINUX32__NSIG_BPW	32
     48 #define LINUX32__NSIG_WORDS	(LINUX32__NSIG / LINUX32__NSIG_BPW)
     49 
     50 #define LINUX32_SIG_BLOCK	0
     51 #define LINUX32_SIG_UNBLOCK	1
     52 #define LINUX32_SIG_SETMASK	2
     53 
     54 #define LINUX32_SA_NOCLDSTOP	0x00000001
     55 #define LINUX32_SA_NOCLDWAIT	0x00000002
     56 #define LINUX32_SA_SIGINFO	0x00000004
     57 #define LINUX32_SA_ONSTACK	0x08000000
     58 #define LINUX32_SA_RESTART	0x10000000
     59 #define LINUX32_SA_INTERRUPT	0x20000000
     60 #define LINUX32_SA_NOMASK	0x40000000
     61 #define LINUX32_SA_ONESHOT	0x80000000
     62 #define LINUX32_SA_ALLBITS	0xf8000007
     63 
     64 #define LINUX32_SS_ONSTACK	1
     65 #define LINUX32_SS_DISABLE	2
     66 
     67 #define LINUX32_SIGILL		LINUX_SIGILL
     68 #define LINUX32_SIGFPE		LINUX_SIGFPE
     69 #define LINUX32_SIGSEGV		LINUX_SIGSEGV
     70 #define LINUX32_SIGBUS		LINUX_SIGBUS
     71 #define LINUX32_SIGTRAP		LINUX_SIGTRAP
     72 #define LINUX32_SIGCHLD		LINUX_SIGCHLD
     73 #define LINUX32_SIGIO		LINUX_SIGIO
     74 #define LINUX32_SIGALRM		LINUX_SIGALRM
     75 #define LINUX32_SIGRTMIN	LINUX_SIGRTMIN
     76 
     77 typedef struct {
     78 	uint32_t sig[LINUX32__NSIG_WORDS];
     79 } linux32_sigset_t;
     80 
     81 struct linux32_sigaction {
     82 	linux32_handlerp_t linux_sa_handler;
     83 	int linux_sa_flags;
     84 	linux32_sigset_t linux_sa_mask;
     85 	linux32_restorer_t linux_sa_restorer;
     86 };
     87 
     88 typedef struct linux32_sigaltstack {
     89 	netbsd32_voidp ss_sp;
     90 	int ss_flags;
     91 	netbsd32_size_t ss_size;
     92 } linux32_stack_t;
     93 
     94 #endif /* _AARCH64_LINUX32_SIGNAL_H_ */
     95