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