1*f72d02ffSchristos /* $NetBSD: linux_siginfo.h,v 1.7 2011/11/18 04:07:44 christos Exp $ */ 20f65ff9aSmanu 30f65ff9aSmanu /*- 40f65ff9aSmanu * Copyright (c) 1998, 2001 The NetBSD Foundation, Inc. 50f65ff9aSmanu * All rights reserved. 60f65ff9aSmanu * 70f65ff9aSmanu * This code is derived from software contributed to The NetBSD Foundation 80f65ff9aSmanu * by Eric Haszlakiewicz and Emmanuel Dreyfus. 90f65ff9aSmanu * 100f65ff9aSmanu * Redistribution and use in source and binary forms, with or without 110f65ff9aSmanu * modification, are permitted provided that the following conditions 120f65ff9aSmanu * are met: 130f65ff9aSmanu * 1. Redistributions of source code must retain the above copyright 140f65ff9aSmanu * notice, this list of conditions and the following disclaimer. 150f65ff9aSmanu * 2. Redistributions in binary form must reproduce the above copyright 160f65ff9aSmanu * notice, this list of conditions and the following disclaimer in the 170f65ff9aSmanu * documentation and/or other materials provided with the distribution. 180f65ff9aSmanu * 190f65ff9aSmanu * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 200f65ff9aSmanu * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 210f65ff9aSmanu * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 220f65ff9aSmanu * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 230f65ff9aSmanu * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 240f65ff9aSmanu * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 250f65ff9aSmanu * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 260f65ff9aSmanu * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 270f65ff9aSmanu * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 280f65ff9aSmanu * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 290f65ff9aSmanu * POSSIBILITY OF SUCH DAMAGE. 300f65ff9aSmanu */ 310f65ff9aSmanu 320f65ff9aSmanu #ifndef _MIPS_LINUX_SIGINFO_H 330f65ff9aSmanu #define _MIPS_LINUX_SIGINFO_H 340f65ff9aSmanu 350f65ff9aSmanu /* 360f65ff9aSmanu * Everything is from Linux's include/asm-mips/siginfo.h 370f65ff9aSmanu */ 380f65ff9aSmanu typedef union linux_sigval { 390f65ff9aSmanu int sival_int; 400f65ff9aSmanu void *sival_ptr; 410f65ff9aSmanu } linux_sigval_t; 420f65ff9aSmanu 430f65ff9aSmanu #define SI_MAX_SIZE 128 440f65ff9aSmanu #define SI_PAD_SIZE ((SI_MAX_SIZE/sizeof(int)) - 3) 450f65ff9aSmanu 460f65ff9aSmanu typedef struct linux_siginfo { 470f65ff9aSmanu int lsi_signo; 480f65ff9aSmanu int lsi_code; 490f65ff9aSmanu int lsi_errno; 500f65ff9aSmanu union { 510f65ff9aSmanu int _pad[SI_PAD_SIZE]; 520f65ff9aSmanu 530f65ff9aSmanu /* kill() */ 540f65ff9aSmanu struct { 550f65ff9aSmanu linux_pid_t _pid; 560f65ff9aSmanu linux_uid_t _uid; 570f65ff9aSmanu } _kill; 580f65ff9aSmanu 590f65ff9aSmanu /* SIGCHLD */ 600f65ff9aSmanu struct { 610f65ff9aSmanu linux_pid_t _pid; 620f65ff9aSmanu linux_uid_t _uid; 630f65ff9aSmanu linux_clock_t _utime; 640f65ff9aSmanu int _status; 650f65ff9aSmanu linux_clock_t _stime; 660f65ff9aSmanu } _sigchld; 670f65ff9aSmanu 680f65ff9aSmanu /* IRIX SIGCHLD */ 690f65ff9aSmanu struct { 700f65ff9aSmanu pid_t _pid; 710f65ff9aSmanu linux_clock_t _utime; 720f65ff9aSmanu int _status; 730f65ff9aSmanu linux_clock_t _stime; 740f65ff9aSmanu } _irix_sigchld; 750f65ff9aSmanu 760f65ff9aSmanu /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */ 770f65ff9aSmanu struct { 780f65ff9aSmanu void *_addr; 790f65ff9aSmanu } _sigfault; 800f65ff9aSmanu 810f65ff9aSmanu /* SIGPOLL, SIGXFSZ (To do ...) */ 820f65ff9aSmanu struct { 830f65ff9aSmanu int _band; 840f65ff9aSmanu int _fd; 850f65ff9aSmanu } _sigpoll; 860f65ff9aSmanu 870f65ff9aSmanu /* POSIX.1b timers */ 880f65ff9aSmanu struct { 890f65ff9aSmanu unsigned int _timer1; 900f65ff9aSmanu unsigned int _timer2; 910f65ff9aSmanu } _timer; 920f65ff9aSmanu 930f65ff9aSmanu /* POSIX.1b signals */ 940f65ff9aSmanu struct { 950f65ff9aSmanu linux_pid_t _pid; 960f65ff9aSmanu linux_uid_t _uid; 970f65ff9aSmanu linux_sigval_t _sigval; 980f65ff9aSmanu } _rt; 990f65ff9aSmanu 1000f65ff9aSmanu } _sidata; /* This is _sifields for Linux/mips */ 1010f65ff9aSmanu } linux_siginfo_t; 1020f65ff9aSmanu 1036709281dSnjoly /* si_code specific values (IRIX compatible) */ 1040f65ff9aSmanu #define LINUX_SI_ASYNCIO -2 1056709281dSnjoly #define LINUX_SI_TIMER -3 1060f65ff9aSmanu #define LINUX_SI_MESGQ -4 1070f65ff9aSmanu 1080f65ff9aSmanu #endif /* !_MIPS_LINUX_SIGINFO_H */ 109