Home | History | Annotate | Line # | Download | only in include
signal.h revision 1.2
      1 /*	$NetBSD: signal.h,v 1.2 2003/04/28 23:16:19 bjh21 Exp $	*/
      2 
      3 /*	$OpenBSD: signal.h,v 1.1 1998/06/23 19:45:27 mickey Exp $	*/
      4 
      5 /*
      6  * Copyright (c) 1994, The University of Utah and
      7  * the Computer Systems Laboratory at the University of Utah (CSL).
      8  * All rights reserved.
      9  *
     10  * Permission to use, copy, modify and distribute this software is hereby
     11  * granted provided that (1) source code retains these copyright, permission,
     12  * and disclaimer notices, and (2) redistributions including binaries
     13  * reproduce the notices in supporting documentation, and (3) all advertising
     14  * materials mentioning features or use of this software display the following
     15  * acknowledgement: ``This product includes software developed by the
     16  * Computer Systems Laboratory at the University of Utah.''
     17  *
     18  * THE UNIVERSITY OF UTAH AND CSL ALLOW FREE USE OF THIS SOFTWARE IN ITS "AS
     19  * IS" CONDITION.  THE UNIVERSITY OF UTAH AND CSL DISCLAIM ANY LIABILITY OF
     20  * ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
     21  *
     22  * CSL requests users of this software to return to csl-dist (at) cs.utah.edu any
     23  * improvements that they make and grant CSL redistribution rights.
     24  *
     25  * 	Utah $Hdr: signal.h 1.3 94/12/16$
     26  */
     27 
     28 /*
     29  * Machine-dependent signal definitions
     30  */
     31 
     32 #include <sys/featuretest.h>
     33 
     34 typedef int sig_atomic_t;
     35 
     36 #if defined(_XOPEN_SOURCE) || defined(_NETBSD_SOURCE)
     37 #include <machine/trap.h>	/* codes for SIGILL, SIGFPE */
     38 #endif
     39 
     40 /*
     41  * Information pushed on stack when a signal is delivered.
     42  * This is used by the kernel to restore state following
     43  * execution of the signal handler.  It is also made available
     44  * to the handler to allow it to restore state properly if
     45  * a non-standard exit is performed.
     46  */
     47 struct	sigcontext {
     48 	int	sc_onstack;		/* sigstack state to restore */
     49 	int	__sc_mask13;		/* signal mask to restore (old style) */
     50 	int	sc_sp;			/* sp to restore */
     51 	int	sc_fp;			/* fp to restore */
     52 	int	sc_ap;			/* ap to restore */
     53 	int	sc_pcsqh;		/* pc space queue (head) to restore */
     54 	int	sc_pcoqh;		/* pc offset queue (head) to restore */
     55 	int	sc_pcsqt;		/* pc space queue (tail) to restore */
     56 	int	sc_pcoqt;		/* pc offset queue (tail) to restore */
     57 	int	sc_ps;			/* psl to restore */
     58 	sigset_t sc_mask;		/* signal mask to restore (new style) */
     59 };
     60 
     61 #if defined(_KERNEL)
     62 #include <hppa/frame.h>
     63 
     64 /*
     65  * Register state saved while kernel delivers a signal.
     66  */
     67 struct sigstate {
     68 	int	ss_flags;		/* which of the following are valid */
     69 	struct trapframe ss_frame;	/* original exception frame */
     70 };
     71 
     72 #define	SS_FPSTATE	0x01
     73 #define	SS_USERREGS	0x02
     74 
     75 /*
     76  * Stack frame layout when delivering a signal.
     77  */
     78 struct sigframe {
     79 	struct sigcontext sf_sc;	/* actual context */
     80 	struct sigstate sf_state;	/* state of the hardware */
     81 	/*
     82 	 * Everything below here must match the calling convention.
     83 	 * Per that convention, sendsig must initialize very little;
     84 	 * only sf_psp, sf_clup, sf_sl, and sf_edp must be set.
     85 	 * Note that this layout matches the HPPA_FRAME_ macros
     86 	 * in frame.h.
     87 	 */
     88 	u_int	sf_arg3;
     89 	u_int	sf_arg2;
     90 	u_int	sf_arg1;
     91 	u_int	sf_arg0;
     92 	u_int	sf_edp;
     93 	u_int	sf_esr4;
     94 	u_int	sf_erp;
     95 	u_int	sf_crp;
     96 	u_int	sf_sl;
     97 	u_int	sf_clup;
     98 	u_int	sf_ep;
     99 	u_int	sf_psp;
    100 };
    101 
    102 #endif /* _KERNEL */
    103