signal.h revision 1.13
11.13Sdrochner/* $NetBSD: signal.h,v 1.13 2005/01/20 21:03:26 drochner Exp $ */
21.1Scgd
31.1Scgd/*
41.1Scgd * Copyright (c) 1994, 1995 Carnegie-Mellon University.
51.1Scgd * All rights reserved.
61.1Scgd *
71.1Scgd * Author: Chris G. Demetriou
81.1Scgd *
91.1Scgd * Permission to use, copy, modify and distribute this software and
101.1Scgd * its documentation is hereby granted, provided that both the copyright
111.1Scgd * notice and this permission notice appear in all copies of the
121.1Scgd * software, derivative works or modified versions, and any portions
131.1Scgd * thereof, and that both notices appear in supporting documentation.
141.1Scgd *
151.1Scgd * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
161.1Scgd * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
171.1Scgd * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
181.1Scgd *
191.1Scgd * Carnegie Mellon requests users of this software to return to
201.1Scgd *
211.1Scgd *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
221.1Scgd *  School of Computer Science
231.1Scgd *  Carnegie Mellon University
241.1Scgd *  Pittsburgh PA 15213-3890
251.1Scgd *
261.1Scgd * any improvements or extensions that they make and grant Carnegie the
271.1Scgd * rights to redistribute these changes.
281.1Scgd */
291.1Scgd
301.1Scgd#ifndef _ALPHA_SIGNAL_H_
311.1Scgd#define	_ALPHA_SIGNAL_H_
321.1Scgd
331.7Sbjh21#include <sys/featuretest.h>
341.7Sbjh21
351.1Scgdtypedef long	sig_atomic_t;
361.8Sskd
371.12Sdrochner#ifdef _KERNEL
381.13Sdrochner#ifdef _KERNEL_OPT
391.13Sdrochner#include "opt_compat_netbsd.h"
401.13Sdrochner#include "opt_compat_osf1.h"
411.13Sdrochner#endif
421.9Schristos#ifdef COMPAT_16
431.9Schristos#define SIGTRAMP_VALID(vers)	((unsigned)(vers) <= 2)
441.9Schristos#else
451.9Schristos#define SIGTRAMP_VALID(vers)	((vers) == 2)
461.9Schristos#endif
471.12Sdrochner#endif
481.1Scgd
491.1Scgd/*
501.1Scgd * Information pushed on stack when a signal is delivered.
511.1Scgd * This is used by the kernel to restore state following
521.1Scgd * execution of the signal handler.  It is also made available
531.1Scgd * to the handler to allow it to restore state properly if
541.1Scgd * a non-standard exit is performed.
551.1Scgd *
561.1Scgd * Note that sc_regs[] and sc_fpregs[]+sc_fpcr are inline
571.1Scgd * representations of 'struct reg' and 'struct fpreg', respectively.
581.1Scgd */
591.13Sdrochner#if defined(_KERNEL) && (defined(COMPAT_13) || defined(COMPAT_OSF1))
601.5Sthorpejstruct sigcontext13 {
611.5Sthorpej	long	sc_onstack;		/* sigstack state to restore */
621.5Sthorpej	long	sc_mask;		/* signal mask to restore (old style) */
631.5Sthorpej	long	sc_pc;			/* pc to restore */
641.1Scgd	long	sc_ps;			/* ps to restore */
651.1Scgd	unsigned long sc_regs[32];	/* integer register set (see above) */
661.1Scgd#define	sc_sp	sc_regs[R_SP]
671.1Scgd	long	sc_ownedfp;		/* fp has been used */
681.1Scgd	unsigned long sc_fpregs[32];	/* FP register set (see above) */
691.1Scgd	unsigned long sc_fpcr;		/* FP control register (see above) */
701.1Scgd	unsigned long sc_fp_control;	/* FP software control word */
711.1Scgd	long	sc_reserved[2];		/* XXX */
721.1Scgd	long	sc_xxx[8];		/* XXX */
731.5Sthorpej};
741.13Sdrochner#endif /* _KERNEL && (COMPAT_13 || COMPAT_OSF1) */
751.5Sthorpej
761.13Sdrochner#if defined(_LIBC) || (defined(_KERNEL) && (defined(COMPAT_16) || defined(COMPAT_OSF1)))
771.5Sthorpejstruct sigcontext {
781.5Sthorpej	long	sc_onstack;		/* sigstack state to restore */
791.5Sthorpej	long	__sc_mask13;		/* signal mask to restore (old style) */
801.5Sthorpej	long	sc_pc;			/* pc to restore */
811.5Sthorpej	long	sc_ps;			/* ps to restore */
821.5Sthorpej	unsigned long sc_regs[32];	/* integer register set (see above) */
831.5Sthorpej#define	sc_sp	sc_regs[R_SP]
841.5Sthorpej	long	sc_ownedfp;		/* fp has been used */
851.5Sthorpej	unsigned long sc_fpregs[32];	/* FP register set (see above) */
861.5Sthorpej	unsigned long sc_fpcr;		/* FP control register (see above) */
871.5Sthorpej	unsigned long sc_fp_control;	/* FP software control word */
881.5Sthorpej	long	sc_reserved[2];		/* XXX */
891.5Sthorpej	long	sc_xxx[8];		/* XXX */
901.5Sthorpej	sigset_t sc_mask;		/* signal mask to restore (new style) */
911.1Scgd};
921.13Sdrochner#endif /* _LIBC || _KERNEL */
931.1Scgd
941.1Scgd#endif /* !_ALPHA_SIGNAL_H_*/
95