xref: /illumos-gate/usr/src/head/ucontext.h (revision fd75ca8de430ee0ba5ce650efee0ac0b85ed43e9)
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 2014 Garrett D'Amore <garrett@damore.org>
27  *
28  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
29  * Use is subject to license terms.
30  */
31 
32 #ifndef _UCONTEXT_H
33 #define	_UCONTEXT_H
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 extern int getcontext(ucontext_t *) __RETURNS_TWICE;
54 #pragma unknown_control_flow(getcontext)
55 extern int setcontext(const ucontext_t *) __NORETURN;
56 extern int swapcontext(ucontext_t *_RESTRICT_KYWD,
57 		const ucontext_t *_RESTRICT_KYWD);
58 extern void makecontext(ucontext_t *, void(*)(), int, ...);
59 
60 #if !defined(_XPG4_2) || defined(__EXTENSIONS__)
61 extern int walkcontext(const ucontext_t *, int (*)(uintptr_t, int, void *),
62     void *);
63 extern int printstack(int);
64 extern int addrtosymstr(void *, char *, int);
65 extern int getustack(stack_t **);
66 extern int setustack(stack_t *);
67 
68 extern int stack_getbounds(stack_t *);
69 extern int stack_setbounds(const stack_t *);
70 extern int stack_inbounds(void *);
71 extern int stack_violation(int, const siginfo_t *, const ucontext_t *);
72 
73 extern void *_stack_grow(void *);
74 #endif	/* !_XPG4_2 || __EXTENSIONS__ */
75 
76 #ifdef	__cplusplus
77 }
78 #endif
79 
80 #endif	/* _UCONTEXT_H */
81