Update FSF address.
[deliverable/binutils-gdb.git] / gdb / config / m68k / tm-sun3.h
CommitLineData
5076de82
FF
1/* Parameters for execution on a Sun, for GDB, the GNU debugger.
2 Copyright (C) 1986, 1987, 1989, 1992 Free Software Foundation, Inc.
3
4This file is part of GDB.
5
6This program is free software; you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published by
8the Free Software Foundation; either version 2 of the License, or
9(at your option) any later version.
10
11This program is distributed in the hope that it will be useful,
12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU General Public License for more details.
15
16You should have received a copy of the GNU General Public License
17along with this program; if not, write to the Free Software
6c9638b4 18Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
5076de82 19
9a13e99e
SG
20#ifndef TM_SUN3_H
21#define TM_SUN3_H
5076de82 22
9a13e99e
SG
23/* Sun3 status includes fpflags, which shows whether the FPU has been used
24 by the process, and whether the FPU was done with an instruction or
25 was interrupted in the middle of a long instruction. See
26 <machine/reg.h>. */
27/* a&d, pc,sr, fp, fpstat, fpflags */
28
29#define REGISTER_BYTES (16*4 + 8 + 8*12 + 3*4 + 4)
30
31#define NUM_REGS 31
32
33#define REGISTER_BYTES_OK(b) \
34 ((b) == REGISTER_BYTES \
35 || (b) == REGISTER_BYTES_FP \
36 || (b) == REGISTER_BYTES_NOFP)
37
38/* If PC contains this instruction, then we know what we are in a system
39 call stub, and the return PC is is at SP+4, instead of SP. */
40
41#define SYSCALL_TRAP 0x4e40 /* trap #0 */
42#define SYSCALL_TRAP_OFFSET 0 /* PC points at trap instruction */
5076de82 43
2225eb85 44#include "m68k/tm-m68k.h"
5076de82 45
537eba71
SG
46/* Disable alternate breakpoint mechanism needed by 68k stub. */
47#undef REMOTE_BREAKPOINT
48
5076de82
FF
49/* Offsets (in target ints) into jmp_buf. Not defined by Sun, but at least
50 documented in a comment in <machine/setjmp.h>! */
51
52#define JB_ELEMENT_SIZE 4
53
54#define JB_ONSSTACK 0
55#define JB_SIGMASK 1
56#define JB_SP 2
57#define JB_PC 3
58#define JB_PSL 4
59#define JB_D2 5
60#define JB_D3 6
61#define JB_D4 7
62#define JB_D5 8
63#define JB_D6 9
64#define JB_D7 10
65#define JB_A2 11
66#define JB_A3 12
67#define JB_A4 13
68#define JB_A5 14
69#define JB_A6 15
70
71/* Figure out where the longjmp will land. Slurp the args out of the stack.
72 We expect the first arg to be a pointer to the jmp_buf structure from which
73 we extract the pc (JB_PC) that we will land at. The pc is copied into ADDR.
74 This routine returns true on success */
75
76#define GET_LONGJMP_TARGET(ADDR) get_longjmp_target(ADDR)
77
9a13e99e
SG
78/* If sun3 pcc says that a parameter is a short, it's a short. */
79#define BELIEVE_PCC_PROMOTION_TYPE
bc447a39 80
d568b76a
JK
81/* Can't define BELIEVE_PCC_PROMOTION for SunOS /bin/cc of SunOS 4.1.1.
82 Apparently Sun fixed this for the sparc but not the sun3. */
eed6de01 83
bc447a39
JK
84/* The code which tries to deal with this bug is never harmful on a sun3. */
85#define SUN_FIXED_LBRAC_BUG (0)
c67d08e8
PS
86
87/* On the sun3 the kernel pushes a sigcontext on the user stack and then
88 `calls' _sigtramp in user code. _sigtramp saves the floating point status
89 on the stack and calls the signal handler function. The stack does not
90 contain enough information to allow a normal backtrace, but sigcontext
91 contains the saved user pc/sp. FRAME_CHAIN and friends in tm-m68k.h and
92 m68k_find_saved_regs deal with this situation by manufacturing a fake frame
93 for _sigtramp.
94 SIG_PC_FP_OFFSET is the offset from the signal handler frame to the
95 saved pc in sigcontext.
96 SIG_SP_FP_OFFSET is the offset from the signal handler frame to the end
97 of sigcontext which is identical to the saved sp at SIG_PC_FP_OFFSET - 4.
98
99 Please note that it is impossible to correctly backtrace from a breakpoint
100 in _sigtramp as _sigtramp modifies the stack pointer a few times. */
101
102#undef SIG_PC_FP_OFFSET
103#define SIG_PC_FP_OFFSET 324
104#define SIG_SP_FP_OFFSET 332
9a13e99e
SG
105
106#endif /* TM_SUN3_H */
This page took 0.128059 seconds and 4 git commands to generate.