1 /* @(#)setfp.c	1.13 06/10/05 Copyright 1988, 1995-2003 J. Schilling */
2 /*
3  *	Set frame pointer
4  *
5  *	Copyright (c) 1988, 1995-2003 J. Schilling
6  */
7 /*
8  * The contents of this file are subject to the terms of the
9  * Common Development and Distribution License, Version 1.0 only
10  * (the "License").  You may not use this file except in compliance
11  * with the License.
12  *
13  * See the file CDDL.Schily.txt in this distribution for details.
14  * A copy of the CDDL is also available via the Internet at
15  * http://www.opensource.org/licenses/cddl1.txt
16  *
17  * When distributing Covered Code, include this CDDL HEADER in each
18  * file and include the License file CDDL.Schily.txt from this distribution.
19  */
20 
21 #include <schily/mconfig.h>
22 #include <schily/standard.h>
23 #include <schily/avoffset.h>
24 #include <schily/schily.h>
25 
26 #if	!defined(AV_OFFSET) || !defined(FP_INDIR)
27 #	ifdef	HAVE_SCANSTACK
28 #	undef	HAVE_SCANSTACK
29 #	endif
30 #endif
31 
32 #	ifdef	HAVE_SCANSTACK
33 #include <schily/stkframe.h>
34 
35 #define	MAXWINDOWS	32
36 #define	NWINDOWS	7
37 
38 extern	void	**___fpoff	__PR((char *cp));
39 
40 EXPORT void
setfp(fp)41 setfp(fp)
42 	void	* const *fp;
43 {
44 		long	**dummy[1];
45 
46 #ifdef	sparc
47 	flush_reg_windows(MAXWINDOWS-2);
48 #endif
49 	*(long ***)(&((struct frame *)___fpoff((char *)&dummy[0]))->fr_savfp) =
50 								(long **)fp;
51 #ifdef	sparc
52 	flush_reg_windows(MAXWINDOWS-2);
53 #endif
54 }
55 
56 #else
57 
58 EXPORT void
setfp(fp)59 setfp(fp)
60 	void	* const *fp;
61 {
62 	raisecond("setfp_not_implemented", 0L);
63 }
64 
65 #endif
66