xref: /onnv-gate/usr/src/lib/libc/inc/sigjmp_struct.h (revision 12061:36363ca8fb06)
10Sstevel@tonic-gate /*
20Sstevel@tonic-gate  * CDDL HEADER START
30Sstevel@tonic-gate  *
40Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*12061SRoger.Faulkner@Oracle.COM  * Common Development and Distribution License (the "License").
6*12061SRoger.Faulkner@Oracle.COM  * You may not use this file except in compliance with the License.
70Sstevel@tonic-gate  *
80Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
90Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
100Sstevel@tonic-gate  * See the License for the specific language governing permissions
110Sstevel@tonic-gate  * and limitations under the License.
120Sstevel@tonic-gate  *
130Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
140Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
150Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
160Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
170Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
180Sstevel@tonic-gate  *
190Sstevel@tonic-gate  * CDDL HEADER END
200Sstevel@tonic-gate  */
21*12061SRoger.Faulkner@Oracle.COM 
220Sstevel@tonic-gate /*
23*12061SRoger.Faulkner@Oracle.COM  * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
240Sstevel@tonic-gate  */
250Sstevel@tonic-gate 
260Sstevel@tonic-gate #ifndef _SIGJMP_STRUCT_H
270Sstevel@tonic-gate #define	_SIGJMP_STRUCT_H
280Sstevel@tonic-gate 
290Sstevel@tonic-gate #ifdef	__cplusplus
300Sstevel@tonic-gate extern "C" {
310Sstevel@tonic-gate #endif
320Sstevel@tonic-gate 
330Sstevel@tonic-gate #include <sys/types.h>
340Sstevel@tonic-gate #include <sys/stack.h>
350Sstevel@tonic-gate #include <ucontext.h>
360Sstevel@tonic-gate #include <setjmp.h>
370Sstevel@tonic-gate 
380Sstevel@tonic-gate #if defined(__sparc)
390Sstevel@tonic-gate 
400Sstevel@tonic-gate /*
410Sstevel@tonic-gate  * The following structure MUST match the ABI size specifier _SIGJBLEN.
420Sstevel@tonic-gate  * This is 19 (longs).  The ABI value for _JBLEN is 12 (longs).
430Sstevel@tonic-gate  * A greg_t is a long.  A sigset_t is 4 ints and a stack_t is 3 longs.
440Sstevel@tonic-gate  *
450Sstevel@tonic-gate  * The layout of this structure must match the layout of the same
460Sstevel@tonic-gate  * structures defined in usr/src/lib/libbc/libc/sys/common/ucontext.h
470Sstevel@tonic-gate  * and usr/src/ucblib/libucb/sparc/sys/setjmp.c.  Other than that,
480Sstevel@tonic-gate  * the layout is private, not known to applications.
490Sstevel@tonic-gate  *
500Sstevel@tonic-gate  * We make the first 5 members match the implementations of
510Sstevel@tonic-gate  * setjmp()/longjmp(), so that an application could (stupidly)
520Sstevel@tonic-gate  * do sigsetjmp(env) followed by longjmp(env) (but not setjmp(env)
530Sstevel@tonic-gate  * followed by siglongjmp(env)).
540Sstevel@tonic-gate  */
550Sstevel@tonic-gate typedef struct {
560Sstevel@tonic-gate 	int		sjs_flags;	/* JBUF[ 0]	*/
570Sstevel@tonic-gate 	greg_t		sjs_sp;		/* JBUF[ 1]	*/
580Sstevel@tonic-gate 	greg_t		sjs_pc;		/* JBUF[ 2]	*/
590Sstevel@tonic-gate 	greg_t		sjs_fp;		/* JBUF[ 3]	*/
600Sstevel@tonic-gate 	greg_t		sjs_i7;		/* JBUF[ 4]	*/
610Sstevel@tonic-gate 	ucontext_t	*sjs_uclink;
620Sstevel@tonic-gate 	ulong_t		sjs_pad[_JBLEN - 6];
630Sstevel@tonic-gate 	sigset_t	sjs_sigmask;
640Sstevel@tonic-gate #if defined(_LP64)
65*12061SRoger.Faulkner@Oracle.COM 	greg_t		sjs_asi;
66*12061SRoger.Faulkner@Oracle.COM 	greg_t		sjs_fprs;
670Sstevel@tonic-gate #endif
680Sstevel@tonic-gate 	stack_t		sjs_stack;
690Sstevel@tonic-gate } sigjmp_struct_t;
700Sstevel@tonic-gate 
710Sstevel@tonic-gate #define	JB_SAVEMASK	0x1
720Sstevel@tonic-gate #define	JB_FRAMEPTR	0x2
730Sstevel@tonic-gate 
740Sstevel@tonic-gate #endif	/* __sparc */
750Sstevel@tonic-gate 
760Sstevel@tonic-gate #ifdef	__cplusplus
770Sstevel@tonic-gate }
780Sstevel@tonic-gate #endif
790Sstevel@tonic-gate 
800Sstevel@tonic-gate #endif /* _SIGJMP_STRUCT_H */
81