blob: b9c136718b643e0df66784cd23f63409ba52614b [file] [log] [blame]
Chris Dearman645d0312014-02-05 18:51:43 -08001/* $OpenBSD: signal.h,v 1.8 2006/01/09 18:18:37 millert Exp $ */
2
3/*
4 * Copyright (c) 1992, 1993
5 * The Regents of the University of California. All rights reserved.
6 *
7 * This code is derived from software contributed to Berkeley by
8 * Ralph Campbell.
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
18 * 3. Neither the name of the University nor the names of its contributors
19 * may be used to endorse or promote products derived from this software
20 * without specific prior written permission.
21 *
22 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
23 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 * SUCH DAMAGE.
33 *
34 * @(#)signal.h 8.1 (Berkeley) 6/10/93
35 */
36
37#ifndef _MIPS_SIGNAL_H_
38#define _MIPS_SIGNAL_H_
39
Duane Sand3a478632014-11-25 17:33:10 -080040/* On Mips32, jmpbuf begins with optional 4-byte filler so that
41 * all saved FP regs are aligned on 8-byte boundary, despite this whole
42 * struct being mis-declared to users as an array of (4-byte) longs.
43 * All the following offsets are then from the rounded-up base addr
44 */
45
46/* Fields of same size on all MIPS abis: */
47#define SC_MAGIC (0*4) /* 4 bytes, identify jmpbuf */
48#define SC_MASK (1*4) /* 4 bytes, saved signal mask */
49#define SC_FPSR (2*4) /* 4 bytes, floating point control/status reg */
50/* filler2 (3*4) 4 bytes, pad to 8-byte boundary */
51
52/* Registers that are 4-byte on mips32 o32, and 8-byte on mips64 n64 abi */
53#define SC_REGS_SAVED 12 /* ra,gp,sp,s0-s8 */
54#define SC_REGS (4*4) /* SC_REGS_SAVED*REGSZ bytes */
55
56/* Floating pt registers are 8-bytes on all abis,
57 * but the number of saved fp regs varies for o32/n32 versus n64 abis:
58 */
59
60#ifdef __LP64__
61#define SC_FPREGS_SAVED 8 /* all fp regs f24,f25,f26,f27,f28,f29,f30,f31 */
62#else
63#define SC_FPREGS_SAVED 6 /* even fp regs f20,f22,f24,f26,f28,f30 */
64#endif
65
66#define SC_FPREGS (SC_REGS + SC_REGS_SAVED*REGSZ) /* SC_FPREGS_SAVED*REGSZ_FP bytes */
67
68#define SC_BYTES (SC_FPREGS + SC_FPREGS_SAVED*REGSZ_FP)
69#define SC_LONGS (SC_BYTES/REGSZ)
70
71#ifdef __LP64__
72/* SC_LONGS is 22, so _JBLEN should be 22 or larger */
73#else
74/* SC_LONGS is 28, but must also allocate dynamic-roundup filler.
75 so _JBLEN should be 29 or larger */
76#endif
Chris Dearman645d0312014-02-05 18:51:43 -080077
78#endif /* !_MIPS_SIGNAL_H_ */