Home | History | Annotate | Line # | Download | only in common
linux_signal.h revision 1.32
      1  1.32    martin /* 	$NetBSD: linux_signal.h,v 1.32 2017/01/02 20:10:44 martin Exp $	*/
      2   1.7  christos 
      3   1.7  christos /*-
      4   1.8      fvdl  * Copyright (c) 1995, 1998 The NetBSD Foundation, Inc.
      5   1.7  christos  * All rights reserved.
      6   1.7  christos  *
      7   1.7  christos  * This code is derived from software contributed to The NetBSD Foundation
      8   1.8      fvdl  * by Frank van der Linden and Eric Haszlakiewicz.
      9   1.7  christos  *
     10   1.7  christos  * Redistribution and use in source and binary forms, with or without
     11   1.7  christos  * modification, are permitted provided that the following conditions
     12   1.7  christos  * are met:
     13   1.7  christos  * 1. Redistributions of source code must retain the above copyright
     14   1.7  christos  *    notice, this list of conditions and the following disclaimer.
     15   1.7  christos  * 2. Redistributions in binary form must reproduce the above copyright
     16   1.7  christos  *    notice, this list of conditions and the following disclaimer in the
     17   1.7  christos  *    documentation and/or other materials provided with the distribution.
     18   1.7  christos  *
     19   1.7  christos  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     20   1.7  christos  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     21   1.7  christos  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     22   1.7  christos  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     23   1.7  christos  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     24   1.7  christos  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     25   1.7  christos  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     26   1.7  christos  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     27   1.7  christos  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     28   1.7  christos  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     29   1.7  christos  * POSSIBILITY OF SUCH DAMAGE.
     30   1.1      fvdl  */
     31   1.1      fvdl 
     32   1.7  christos #ifndef _LINUX_SIGNAL_H
     33   1.7  christos #define _LINUX_SIGNAL_H
     34   1.1      fvdl 
     35   1.7  christos #if defined(__i386__)
     36   1.7  christos #include <compat/linux/arch/i386/linux_signal.h>
     37  1.11     itohy #elif defined(__m68k__)
     38  1.11     itohy #include <compat/linux/arch/m68k/linux_signal.h>
     39   1.7  christos #elif defined(__alpha__)
     40   1.7  christos #include <compat/linux/arch/alpha/linux_signal.h>
     41  1.13      manu #elif defined(__powerpc__)
     42  1.13      manu #include <compat/linux/arch/powerpc/linux_signal.h>
     43  1.14      manu #elif defined(__mips__)
     44  1.14      manu #include <compat/linux/arch/mips/linux_signal.h>
     45  1.15     bjh21 #elif defined(__arm__)
     46  1.15     bjh21 #include <compat/linux/arch/arm/linux_signal.h>
     47  1.22      manu #elif defined(__amd64__)
     48  1.22      manu #include <compat/linux/arch/amd64/linux_signal.h>
     49  1.32    martin #else
     50  1.32    martin typedef void linux_sigset_t;
     51   1.7  christos #endif
     52   1.3   mycroft 
     53  1.31      manu typedef struct {
     54  1.31      manu 	linux_sigset_t *ss;
     55  1.31      manu 	size_t ss_len;
     56  1.31      manu } linux_sized_sigset_t;
     57  1.31      manu 
     58   1.6       erh #ifdef _KERNEL
     59  1.18  christos extern const int native_to_linux_signo[];
     60  1.18  christos extern const int linux_to_native_signo[];
     61   1.6       erh __BEGIN_DECLS
     62  1.27       dsl int linux_sigprocmask1(struct lwp *, int, const linux_old_sigset_t *,
     63  1.27       dsl 						linux_old_sigset_t *);
     64   1.6       erh 
     65  1.11     itohy #if LINUX__NSIG_WORDS > 1
     66  1.27       dsl void linux_old_extra_to_native_sigset(sigset_t *,
     67  1.27       dsl     const linux_old_sigset_t *, const unsigned long *);
     68  1.27       dsl void native_to_linux_old_extra_sigset(linux_old_sigset_t *,
     69  1.27       dsl     unsigned long *, const sigset_t *);
     70  1.11     itohy #define linux_old_to_native_sigset(x,y) \
     71  1.16  christos     linux_old_extra_to_native_sigset(x, y, (const unsigned long *)0)
     72  1.11     itohy #define native_to_linux_old_sigset(x,y) \
     73  1.16  christos     native_to_linux_old_extra_sigset(x, (unsigned long *)0, y)
     74  1.11     itohy 
     75  1.11     itohy #else	/* LINUX__NSIG_WORDS == 1 */
     76  1.11     itohy 
     77  1.22      manu /* XXXmanu (const linux_sigset_t *)(void *) temporary hack to get it building */
     78  1.11     itohy #define linux_old_to_native_sigset(x,y) \
     79  1.23  drochner     linux_to_native_sigset(x, (const linux_sigset_t *)(const void *)y)
     80  1.11     itohy #define native_to_linux_old_sigset(x,y) \
     81  1.22      manu     native_to_linux_sigset((linux_sigset_t *)(void *)x, y)
     82  1.21  christos #endif
     83  1.21  christos 
     84  1.27       dsl void linux_to_native_sigset(sigset_t *, const linux_sigset_t *);
     85  1.27       dsl void native_to_linux_sigset(linux_sigset_t *, const sigset_t *);
     86  1.27       dsl int linux_to_native_sigflags(const unsigned long);
     87  1.27       dsl unsigned int native_to_linux_sigflags(const int);
     88  1.27       dsl 
     89  1.27       dsl void linux_old_to_native_sigaction(struct sigaction *,
     90  1.27       dsl     const struct linux_old_sigaction *);
     91  1.27       dsl void native_to_linux_old_sigaction(struct linux_old_sigaction *,
     92  1.27       dsl     const struct sigaction *);
     93  1.27       dsl 
     94  1.27       dsl void linux_to_native_sigaction(struct sigaction *,
     95  1.27       dsl     const struct linux_sigaction *);
     96  1.27       dsl void native_to_linux_sigaction(struct linux_sigaction *,
     97  1.27       dsl     const struct sigaction *);
     98  1.20     enami 
     99  1.27       dsl void native_to_linux_sigaltstack(struct linux_sigaltstack *,
    100  1.27       dsl     const struct sigaltstack *);
    101   1.6       erh 
    102  1.29     njoly int native_to_linux_si_code(int);
    103  1.30     njoly int native_to_linux_si_status(int, int);
    104  1.29     njoly 
    105   1.6       erh __END_DECLS
    106   1.6       erh #endif /* !_KERNEL */
    107   1.1      fvdl 
    108   1.7  christos #endif /* !_LINUX_SIGNAL_H */
    109