1 /* SPARC stack layout Macros and structures,
2 * mainly taken from BCC (the Bare C compiler for
3 * SPARC LEON2/3) sources.
6 * Daniel Hellstrom, Gaisler Research, daniel@gaisler.com.
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License as
10 * published by the Free Software Foundation; either version 2 of
11 * the License, or (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
25 #ifndef __SPARC_STACK_H__
26 #define __SPARC_STACK_H__
28 #include <asm/ptrace.h>
36 #define PT_REGS_SZ sizeof(struct pt_regs)
38 /* A Sparc stack frame */
39 struct sparc_stackframe_regs {
40 unsigned long sf_locals[8];
41 unsigned long sf_ins[6];
42 struct sparc_stackframe_regs *sf_fp;
43 unsigned long sf_callers_pc;
45 unsigned long sf_xargs[6];
46 unsigned long sf_xxargs[1];
48 #define SF_REGS_SZ sizeof(struct sparc_stackframe_regs)
50 /* A register window */
51 struct sparc_regwindow_regs {
52 unsigned long locals[8];
55 #define RW_REGS_SZ sizeof(struct sparc_regwindow_regs)
58 struct sparc_fpuwindow_regs {
59 unsigned long locals[32];
61 unsigned long lastctx;
63 #define FW_REGS_SZ sizeof(struct sparc_fpuwindow_regs)
69 #define PT_REGS_SZ 0x50 /* 20*4 */
70 #define SF_REGS_SZ 0x60 /* 24*4 */
71 #define RW_REGS_SZ 0x20 /* 16*4 */
72 #define FW_REGS_SZ 0x88 /* 34*4 */
75 /* These are for pt_regs. */
99 /* Stack_frame offsets */
117 #define SF_XARG0 0x44
118 #define SF_XARG1 0x48
119 #define SF_XARG2 0x4c
120 #define SF_XARG3 0x50
121 #define SF_XARG4 0x54
122 #define SF_XARG5 0x58
123 #define SF_XXARG 0x5c
125 /* Reg_window offsets */
143 /* Fpu_window offsets */