xref: /titanic_51/usr/src/head/ucontext.h (revision 24fe0b3bf671e123467ce1df0b67cadd3614c8e4)
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 (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 /*	Copyright (c) 1988 AT&T	*/
22 /*	  All Rights Reserved  	*/
23 
24 
25 /*
26  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
27  * Use is subject to license terms.
28  */
29 
30 #ifndef _UCONTEXT_H
31 #define	_UCONTEXT_H
32 
33 #pragma ident	"%Z%%M%	%I%	%E% SMI"
34 
35 #include <sys/ucontext.h>
36 
37 #if !defined(_XPG4_2) || defined(__EXTENSIONS__)
38 #include <sys/siginfo.h>
39 #endif
40 
41 #ifdef	__cplusplus
42 extern "C" {
43 #endif
44 
45 #ifdef __sparc
46 #ifdef __PRAGMA_REDEFINE_EXTNAME
47 #pragma	redefine_extname	makecontext	__makecontext_v2
48 #else
49 #define	makecontext	__makecontext_v2
50 #endif
51 #endif
52 
53 #if defined(__STDC__)
54 
55 extern int getcontext(ucontext_t *);
56 #pragma unknown_control_flow(getcontext)
57 extern int setcontext(const ucontext_t *) __NORETURN;
58 extern int swapcontext(ucontext_t *_RESTRICT_KYWD,
59 		const ucontext_t *_RESTRICT_KYWD);
60 extern void makecontext(ucontext_t *, void(*)(), int, ...);
61 #if !defined(_XPG4_2) || defined(__EXTENSIONS__)
62 extern int walkcontext(const ucontext_t *, int (*)(uintptr_t, int, void *),
63     void *);
64 extern int printstack(int);
65 extern int addrtosymstr(void *, char *, int);
66 extern int getustack(stack_t **);
67 extern int setustack(stack_t *);
68 
69 extern int stack_getbounds(stack_t *);
70 extern int stack_setbounds(const stack_t *);
71 extern int stack_inbounds(void *);
72 extern int stack_violation(int, const siginfo_t *, const ucontext_t *);
73 
74 extern void *_stack_grow(void *);
75 #endif
76 #else
77 
78 extern int getcontext();
79 #pragma unknown_control_flow(getcontext)
80 extern int setcontext();
81 extern int swapcontext();
82 extern void makecontext();
83 #if !defined(_XPG4_2) || defined(__EXTENSIONS__)
84 extern int walkcontext();
85 extern int printstack();
86 extern int addrtosymstr();
87 extern int getustack();
88 extern int setustack();
89 
90 extern int stack_getbounds();
91 extern int stack_setbounds();
92 extern int stack_inbounds();
93 extern int stack_violation();
94 
95 extern void *_stack_grow();
96 #endif
97 #endif
98 
99 #ifdef	__cplusplus
100 }
101 #endif
102 
103 #endif	/* _UCONTEXT_H */
104