sigjmp_struct.h revision 7c478bd95313f5f23a4c958a745db2134aa03244
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License").  You may not use this file except in compliance
7 * with the License.
8 *
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
13 *
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
19 *
20 * CDDL HEADER END
21 */
22/*
23 * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
24 * Use is subject to license terms.
25 */
26
27#ifndef _SIGJMP_STRUCT_H
28#define	_SIGJMP_STRUCT_H
29
30#pragma ident	"%Z%%M%	%I%	%E% SMI"
31
32#ifdef	__cplusplus
33extern "C" {
34#endif
35
36#include <sys/types.h>
37#include <sys/stack.h>
38#include <ucontext.h>
39#include <setjmp.h>
40
41#if defined(__sparc)
42
43/*
44 * The following structure MUST match the ABI size specifier _SIGJBLEN.
45 * This is 19 (longs).  The ABI value for _JBLEN is 12 (longs).
46 * A greg_t is a long.  A sigset_t is 4 ints and a stack_t is 3 longs.
47 *
48 * The layout of this structure must match the layout of the same
49 * structures defined in usr/src/lib/libbc/libc/sys/common/ucontext.h
50 * and usr/src/ucblib/libucb/sparc/sys/setjmp.c.  Other than that,
51 * the layout is private, not known to applications.
52 *
53 * We make the first 5 members match the implementations of
54 * setjmp()/longjmp(), so that an application could (stupidly)
55 * do sigsetjmp(env) followed by longjmp(env) (but not setjmp(env)
56 * followed by siglongjmp(env)).
57 */
58typedef struct {
59	int		sjs_flags;	/* JBUF[ 0]	*/
60	greg_t		sjs_sp;		/* JBUF[ 1]	*/
61	greg_t		sjs_pc;		/* JBUF[ 2]	*/
62	greg_t		sjs_fp;		/* JBUF[ 3]	*/
63	greg_t		sjs_i7;		/* JBUF[ 4]	*/
64	ucontext_t	*sjs_uclink;
65	ulong_t		sjs_pad[_JBLEN - 6];
66	sigset_t	sjs_sigmask;
67#if defined(_LP64)
68	ulong_t		sjs_pad1[2];
69#endif
70	stack_t		sjs_stack;
71} sigjmp_struct_t;
72
73#define	JB_SAVEMASK	0x1
74#define	JB_FRAMEPTR	0x2
75
76#endif	/* __sparc */
77
78#ifdef	__cplusplus
79}
80#endif
81
82#endif /* _SIGJMP_STRUCT_H */
83