Index: ChangeLog
[deliverable/binutils-gdb.git] / gdb / config / m68k / tm-linux.h
CommitLineData
92362027
AC
1/* Definitions to target GDB to GNU/Linux on m680x0.
2
3 Copyright 1996, 1998, 1999, 2000, 2002 Free Software Foundation,
4 Inc.
c906108c 5
c5aa993b 6 This file is part of GDB.
c906108c 7
c5aa993b
JM
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
c906108c 12
c5aa993b
JM
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.
c906108c 17
c5aa993b
JM
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,
21 Boston, MA 02111-1307, USA. */
c906108c 22
f88e2c52 23#include "regcache.h"
32eeb91a 24#include "m68k-tdep.h"
f88e2c52 25
c906108c
SS
26/* Number of traps that happen between exec'ing the shell to run an
27 inferior, and when we finally get to the inferior code. This is 2
28 on most implementations. */
29
30#define START_INFERIOR_TRAPS_EXPECTED 2
31
32/* The following definitions are appropriate when using the ELF
33 format, where floating point values are returned in fp0, pointer
34 values in a0 and other values in d0. */
35
36/* Extract from an array REGBUF containing the (raw) register state a
37 function return value of type TYPE, and copy that, in virtual
38 format, into VALBUF. */
39
26e9b323 40#define DEPRECATED_EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
c906108c
SS
41{ \
42 if (TYPE_CODE (TYPE) == TYPE_CODE_FLT) \
43 { \
44 REGISTER_CONVERT_TO_VIRTUAL (FP0_REGNUM, TYPE, \
45 ((char *) (REGBUF) \
46 + REGISTER_BYTE (FP0_REGNUM)), \
47 VALBUF); \
48 } \
49 else if (TYPE_CODE (TYPE) == TYPE_CODE_PTR) \
32eeb91a 50 memcpy (VALBUF, (char *) (REGBUF) + REGISTER_BYTE (M68K_A0_REGNUM), \
c906108c
SS
51 TYPE_LENGTH (TYPE)); \
52 else \
53 memcpy (VALBUF, \
54 ((char *) (REGBUF) \
55 + (TYPE_LENGTH (TYPE) >= 4 ? 0 : 4 - TYPE_LENGTH (TYPE))), \
56 TYPE_LENGTH (TYPE)); \
57}
58
59/* Write into appropriate registers a function return value of type
60 TYPE, given in virtual format. */
61
ebba8386 62#define DEPRECATED_STORE_RETURN_VALUE(TYPE,VALBUF) \
c906108c
SS
63{ \
64 if (TYPE_CODE (TYPE) == TYPE_CODE_FLT) \
65 { \
66 char raw_buffer[REGISTER_RAW_SIZE (FP0_REGNUM)]; \
67 REGISTER_CONVERT_TO_RAW (TYPE, FP0_REGNUM, VALBUF, raw_buffer); \
32eeb91a
AS
68 deprecated_write_register_bytes (REGISTER_BYTE (FP0_REGNUM), \
69 raw_buffer, TYPE_LENGTH (TYPE)); \
c906108c
SS
70 } \
71 else \
72 { \
73 if (TYPE_CODE (TYPE) == TYPE_CODE_PTR) \
32eeb91a
AS
74 deprecated_write_register_bytes (REGISTER_BYTE (M68K_A0_REGNUM), VALBUF, \
75 TYPE_LENGTH (TYPE)); \
76 deprecated_write_register_bytes (0, VALBUF, TYPE_LENGTH (TYPE)); \
c906108c
SS
77 } \
78}
79
4f2e4a4f 80#include "config/tm-linux.h"
c906108c
SS
81#include "m68k/tm-m68k.h"
82
83/* Extract from an array REGBUF containing the (raw) register state
84 the address in which a function should return its structure value,
85 as a CORE_ADDR (or an expression that can be used as one). */
86
26e9b323
AC
87#undef DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS
88#define DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) \
32eeb91a 89 (*(CORE_ADDR *)((char *) (REGBUF) + REGISTER_BYTE (M68K_A0_REGNUM)))
c906108c
SS
90
91/* Offsets (in target ints) into jmp_buf. */
92
93#define JB_ELEMENT_SIZE 4
94#define JB_PC 7
95
96/* Figure out where the longjmp will land. Slurp the args out of the stack.
97 We expect the first arg to be a pointer to the jmp_buf structure from which
98 we extract the pc (JB_PC) that we will land at. The pc is copied into ADDR.
99 This routine returns true on success */
100
f4281f55 101#define GET_LONGJMP_TARGET(ADDR) m68k_get_longjmp_target(ADDR)
c906108c 102
8bedc050
AC
103#undef DEPRECATED_FRAME_SAVED_PC
104#define DEPRECATED_FRAME_SAVED_PC(frame) m68k_linux_frame_saved_pc (frame)
75738c29 105extern CORE_ADDR m68k_linux_frame_saved_pc (struct frame_info *);
c906108c 106
75738c29
AS
107#define IN_SIGTRAMP(pc,name) m68k_linux_in_sigtramp (pc)
108extern int m68k_linux_in_sigtramp (CORE_ADDR pc);
This page took 0.231526 seconds and 4 git commands to generate.