signal.h revision 1.11
1/* $NetBSD: signal.h,v 1.11 2004/03/26 21:39:57 drochner Exp $ */
2
3/*
4 * Copyright (c) 1994, 1995 Carnegie-Mellon University.
5 * All rights reserved.
6 *
7 * Author: Chris G. Demetriou
8 *
9 * Permission to use, copy, modify and distribute this software and
10 * its documentation is hereby granted, provided that both the copyright
11 * notice and this permission notice appear in all copies of the
12 * software, derivative works or modified versions, and any portions
13 * thereof, and that both notices appear in supporting documentation.
14 *
15 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
16 * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
17 * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
18 *
19 * Carnegie Mellon requests users of this software to return to
20 *
21 *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
22 *  School of Computer Science
23 *  Carnegie Mellon University
24 *  Pittsburgh PA 15213-3890
25 *
26 * any improvements or extensions that they make and grant Carnegie the
27 * rights to redistribute these changes.
28 */
29
30#ifndef _ALPHA_SIGNAL_H_
31#define	_ALPHA_SIGNAL_H_
32
33#include <sys/featuretest.h>
34
35typedef long	sig_atomic_t;
36
37#ifdef COMPAT_16
38#define SIGTRAMP_VALID(vers)	((unsigned)(vers) <= 2)
39#else
40#define SIGTRAMP_VALID(vers)	((vers) == 2)
41#endif
42
43#if defined(_NETBSD_SOURCE)
44/*
45 * Information pushed on stack when a signal is delivered.
46 * This is used by the kernel to restore state following
47 * execution of the signal handler.  It is also made available
48 * to the handler to allow it to restore state properly if
49 * a non-standard exit is performed.
50 *
51 * Note that sc_regs[] and sc_fpregs[]+sc_fpcr are inline
52 * representations of 'struct reg' and 'struct fpreg', respectively.
53 */
54#if defined(__LIBC12_SOURCE__) || defined(_KERNEL)
55struct sigcontext13 {
56	long	sc_onstack;		/* sigstack state to restore */
57	long	sc_mask;		/* signal mask to restore (old style) */
58	long	sc_pc;			/* pc to restore */
59	long	sc_ps;			/* ps to restore */
60	unsigned long sc_regs[32];	/* integer register set (see above) */
61#define	sc_sp	sc_regs[R_SP]
62	long	sc_ownedfp;		/* fp has been used */
63	unsigned long sc_fpregs[32];	/* FP register set (see above) */
64	unsigned long sc_fpcr;		/* FP control register (see above) */
65	unsigned long sc_fp_control;	/* FP software control word */
66	long	sc_reserved[2];		/* XXX */
67	long	sc_xxx[8];		/* XXX */
68};
69#endif /* __LIBC12_SOURCE__ || _KERNEL */
70
71struct sigcontext {
72	long	sc_onstack;		/* sigstack state to restore */
73	long	__sc_mask13;		/* signal mask to restore (old style) */
74	long	sc_pc;			/* pc to restore */
75	long	sc_ps;			/* ps to restore */
76	unsigned long sc_regs[32];	/* integer register set (see above) */
77#define	sc_sp	sc_regs[R_SP]
78	long	sc_ownedfp;		/* fp has been used */
79	unsigned long sc_fpregs[32];	/* FP register set (see above) */
80	unsigned long sc_fpcr;		/* FP control register (see above) */
81	unsigned long sc_fp_control;	/* FP software control word */
82	long	sc_reserved[2];		/* XXX */
83	long	sc_xxx[8];		/* XXX */
84	sigset_t sc_mask;		/* signal mask to restore (new style) */
85};
86
87#endif /* _NETBSD_SOURCE */
88#endif /* !_ALPHA_SIGNAL_H_*/
89