1/* $FreeBSD: head/sys/ia64/include/signal.h 105950 2002-10-25 19:10:58Z peter $ */
2/* From: NetBSD: signal.h,v 1.3 1997/04/06 08:47:43 cgd Exp */
3
4/*
5 * Copyright (c) 1994, 1995 Carnegie-Mellon University.
6 * All rights reserved.
7 *
8 * Author: Chris G. Demetriou
9 *
10 * Permission to use, copy, modify and distribute this software and
11 * its documentation is hereby granted, provided that both the copyright
12 * notice and this permission notice appear in all copies of the
13 * software, derivative works or modified versions, and any portions
14 * thereof, and that both notices appear in supporting documentation.
15 *
16 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
17 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
18 * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
19 *
20 * Carnegie Mellon requests users of this software to return to
21 *
22 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
23 * School of Computer Science
24 * Carnegie Mellon University
25 * Pittsburgh PA 15213-3890
26 *
27 * any improvements or extensions that they make and grant Carnegie the
28 * rights to redistribute these changes.
29 */
30
31#ifndef _MACHINE_SIGNAL_H_
32#define _MACHINE_SIGNAL_H_
33
34#include <sys/cdefs.h>
35#include <sys/_sigset.h>
36
37typedef long sig_atomic_t;
38
39#if __BSD_VISIBLE
40/* portable macros for SIGFPE/ARITHTRAP */
41#define FPE_INTOVF 1 /* integer overflow */
42#define FPE_INTDIV 2 /* integer divide by zero */
43#define FPE_FLTDIV 3 /* floating point divide by zero */
44#define FPE_FLTOVF 4 /* floating point overflow */
45#define FPE_FLTUND 5 /* floating point underflow */
46#define FPE_FLTRES 6 /* floating point inexact result */
47#define FPE_FLTINV 7 /* invalid floating point operation */
48#define FPE_FLTSUB 8 /* subscript out of range */
49
50#define BUS_SEGM_FAULT 30 /* segment protection base */
51#endif
52
53#if __XSI_VISIBLE
54/*
55 * Minimum signal stack size. The current signal frame
56 * for IA-64 is 2656 bytes large.
57 */
58#define MINSIGSTKSZ (3072 * 4)
59#endif
60
61#if __BSD_VISIBLE
62#ifndef _IA64_FPREG_DEFINED
63
64struct ia64_fpreg {
65 unsigned long fpr_bits[2];
66} __aligned(16);
67
68#define _IA64_FPREG_DEFINED
69
70#endif
71#endif
72
73
74/*
75 * Information pushed on stack when a signal is delivered.
76 * This is used by the kernel to restore state following
77 * execution of the signal handler. It is also made available
78 * to the handler to allow it to restore state properly if
79 * a non-standard exit is performed.
80 *
81 * Note that sc_regs[] and sc_fpregs[]+sc_fpcr are inline
82 * representations of 'struct reg' and 'struct fpreg', respectively.
83 */
84
85#if __BSD_VISIBLE
86/*
87 * The sequence of the fields should match those in
88 * mcontext_t. Keep them in sync!
89 */
90struct sigcontext {
91 struct __sigset sc_mask; /* signal mask to restore */
92 unsigned long sc_onstack;
93 unsigned long sc_flags;
94 unsigned long sc_nat;
95 unsigned long sc_sp;
96 unsigned long sc_ip;
97 unsigned long sc_cfm;
98 unsigned long sc_um;
99 unsigned long sc_ar_rsc;
100 unsigned long sc_ar_bsp;
101 unsigned long sc_ar_rnat;
102 unsigned long sc_ar_ccv;
103 unsigned long sc_ar_unat;
104 unsigned long sc_ar_fpsr;
105 unsigned long sc_ar_pfs;
106 unsigned long sc_pr;
107 unsigned long sc_br[8];
108 unsigned long sc_gr[32];
109 struct ia64_fpreg sc_fr[128];
110};
111#endif /* __BSD_VISIBLE */
112
113#endif /* !_MACHINE_SIGNAL_H_*/
2/* From: NetBSD: signal.h,v 1.3 1997/04/06 08:47:43 cgd Exp */
3
4/*
5 * Copyright (c) 1994, 1995 Carnegie-Mellon University.
6 * All rights reserved.
7 *
8 * Author: Chris G. Demetriou
9 *
10 * Permission to use, copy, modify and distribute this software and
11 * its documentation is hereby granted, provided that both the copyright
12 * notice and this permission notice appear in all copies of the
13 * software, derivative works or modified versions, and any portions
14 * thereof, and that both notices appear in supporting documentation.
15 *
16 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
17 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
18 * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
19 *
20 * Carnegie Mellon requests users of this software to return to
21 *
22 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
23 * School of Computer Science
24 * Carnegie Mellon University
25 * Pittsburgh PA 15213-3890
26 *
27 * any improvements or extensions that they make and grant Carnegie the
28 * rights to redistribute these changes.
29 */
30
31#ifndef _MACHINE_SIGNAL_H_
32#define _MACHINE_SIGNAL_H_
33
34#include <sys/cdefs.h>
35#include <sys/_sigset.h>
36
37typedef long sig_atomic_t;
38
39#if __BSD_VISIBLE
40/* portable macros for SIGFPE/ARITHTRAP */
41#define FPE_INTOVF 1 /* integer overflow */
42#define FPE_INTDIV 2 /* integer divide by zero */
43#define FPE_FLTDIV 3 /* floating point divide by zero */
44#define FPE_FLTOVF 4 /* floating point overflow */
45#define FPE_FLTUND 5 /* floating point underflow */
46#define FPE_FLTRES 6 /* floating point inexact result */
47#define FPE_FLTINV 7 /* invalid floating point operation */
48#define FPE_FLTSUB 8 /* subscript out of range */
49
50#define BUS_SEGM_FAULT 30 /* segment protection base */
51#endif
52
53#if __XSI_VISIBLE
54/*
55 * Minimum signal stack size. The current signal frame
56 * for IA-64 is 2656 bytes large.
57 */
58#define MINSIGSTKSZ (3072 * 4)
59#endif
60
61#if __BSD_VISIBLE
62#ifndef _IA64_FPREG_DEFINED
63
64struct ia64_fpreg {
65 unsigned long fpr_bits[2];
66} __aligned(16);
67
68#define _IA64_FPREG_DEFINED
69
70#endif
71#endif
72
73
74/*
75 * Information pushed on stack when a signal is delivered.
76 * This is used by the kernel to restore state following
77 * execution of the signal handler. It is also made available
78 * to the handler to allow it to restore state properly if
79 * a non-standard exit is performed.
80 *
81 * Note that sc_regs[] and sc_fpregs[]+sc_fpcr are inline
82 * representations of 'struct reg' and 'struct fpreg', respectively.
83 */
84
85#if __BSD_VISIBLE
86/*
87 * The sequence of the fields should match those in
88 * mcontext_t. Keep them in sync!
89 */
90struct sigcontext {
91 struct __sigset sc_mask; /* signal mask to restore */
92 unsigned long sc_onstack;
93 unsigned long sc_flags;
94 unsigned long sc_nat;
95 unsigned long sc_sp;
96 unsigned long sc_ip;
97 unsigned long sc_cfm;
98 unsigned long sc_um;
99 unsigned long sc_ar_rsc;
100 unsigned long sc_ar_bsp;
101 unsigned long sc_ar_rnat;
102 unsigned long sc_ar_ccv;
103 unsigned long sc_ar_unat;
104 unsigned long sc_ar_fpsr;
105 unsigned long sc_ar_pfs;
106 unsigned long sc_pr;
107 unsigned long sc_br[8];
108 unsigned long sc_gr[32];
109 struct ia64_fpreg sc_fr[128];
110};
111#endif /* __BSD_VISIBLE */
112
113#endif /* !_MACHINE_SIGNAL_H_*/