1*7730d1d9Sderaadt /* $OpenBSD: signal.h,v 1.9 2016/05/10 18:39:47 deraadt Exp $ */ 247bc79e1Srahnds /* $NetBSD: signal.h,v 1.1 1996/09/30 16:34:34 ws Exp $ */ 347bc79e1Srahnds 447bc79e1Srahnds /* 547bc79e1Srahnds * Copyright (C) 1995, 1996 Wolfgang Solfrank. 647bc79e1Srahnds * Copyright (C) 1995, 1996 TooLs GmbH. 747bc79e1Srahnds * All rights reserved. 847bc79e1Srahnds * 947bc79e1Srahnds * Redistribution and use in source and binary forms, with or without 1047bc79e1Srahnds * modification, are permitted provided that the following conditions 1147bc79e1Srahnds * are met: 1247bc79e1Srahnds * 1. Redistributions of source code must retain the above copyright 1347bc79e1Srahnds * notice, this list of conditions and the following disclaimer. 1447bc79e1Srahnds * 2. Redistributions in binary form must reproduce the above copyright 1547bc79e1Srahnds * notice, this list of conditions and the following disclaimer in the 1647bc79e1Srahnds * documentation and/or other materials provided with the distribution. 1747bc79e1Srahnds * 3. All advertising materials mentioning features or use of this software 1847bc79e1Srahnds * must display the following acknowledgement: 1947bc79e1Srahnds * This product includes software developed by TooLs GmbH. 2047bc79e1Srahnds * 4. The name of TooLs GmbH may not be used to endorse or promote products 2147bc79e1Srahnds * derived from this software without specific prior written permission. 2247bc79e1Srahnds * 2347bc79e1Srahnds * THIS SOFTWARE IS PROVIDED BY TOOLS GMBH ``AS IS'' AND ANY EXPRESS OR 2447bc79e1Srahnds * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 2547bc79e1Srahnds * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 2647bc79e1Srahnds * IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 2747bc79e1Srahnds * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 2847bc79e1Srahnds * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 2947bc79e1Srahnds * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 3047bc79e1Srahnds * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 3147bc79e1Srahnds * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 3247bc79e1Srahnds * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 3347bc79e1Srahnds */ 3452c13d20Sdrahn #ifndef _POWERPC_SIGNAL_H_ 3552c13d20Sdrahn #define _POWERPC_SIGNAL_H_ 3647bc79e1Srahnds 377c2ef5d9Smillert #include <sys/cdefs.h> 387c2ef5d9Smillert 3947bc79e1Srahnds typedef int sig_atomic_t; 4047bc79e1Srahnds 419fa6b648Smillert #if __BSD_VISIBLE || __XPG_VISIBLE >= 420 42c916d948Smillert #include <machine/_types.h> 43a6ad91e4Srahnds 44c823858dSrahnds /* 45c823858dSrahnds * We have to save all registers on every trap, because 46c823858dSrahnds * 1. user could attach this process every time 47c823858dSrahnds * 2. we must be able to restore all user registers in case of fork 48c823858dSrahnds * Actually, we do not save the fp registers on trap, since 49c823858dSrahnds * these are not used by the kernel. They are saved only when switching 50c823858dSrahnds * between processes using the FPU. 51c823858dSrahnds * 52c823858dSrahnds */ 53c823858dSrahnds struct trapframe { 54c916d948Smillert __register_t fixreg[32]; 55c916d948Smillert __register_t lr; 56c916d948Smillert __register_t cr; 57c916d948Smillert __register_t xer; 58c916d948Smillert __register_t ctr; 59a6ad91e4Srahnds int srr0; 60a6ad91e4Srahnds int srr1; 61a6ad91e4Srahnds int dar; /* dar & dsisr are only filled on a DSI trap */ 62c823858dSrahnds int dsisr; 63c916d948Smillert __register_t exc; 64c823858dSrahnds }; 65c823858dSrahnds 6647bc79e1Srahnds struct sigcontext { 67*7730d1d9Sderaadt long sc_cookie; 6847bc79e1Srahnds int sc_mask; /* saved signal mask */ 6947bc79e1Srahnds struct trapframe sc_frame; /* saved registers */ 7047bc79e1Srahnds }; 719fa6b648Smillert #endif /* __BSD_VISIBLE || __XPG_VISIBLE >= 420 */ 7252c13d20Sdrahn #endif /* _POWERPC_SIGNAL_H_ */ 73