s/Linux/.../
[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
AC
23#include "regcache.h"
24
c906108c
SS
25/* Number of traps that happen between exec'ing the shell to run an
26 inferior, and when we finally get to the inferior code. This is 2
27 on most implementations. */
28
29#define START_INFERIOR_TRAPS_EXPECTED 2
30
31/* The following definitions are appropriate when using the ELF
32 format, where floating point values are returned in fp0, pointer
33 values in a0 and other values in d0. */
34
35/* Extract from an array REGBUF containing the (raw) register state a
36 function return value of type TYPE, and copy that, in virtual
37 format, into VALBUF. */
38
39#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
40{ \
41 if (TYPE_CODE (TYPE) == TYPE_CODE_FLT) \
42 { \
43 REGISTER_CONVERT_TO_VIRTUAL (FP0_REGNUM, TYPE, \
44 ((char *) (REGBUF) \
45 + REGISTER_BYTE (FP0_REGNUM)), \
46 VALBUF); \
47 } \
48 else if (TYPE_CODE (TYPE) == TYPE_CODE_PTR) \
49 memcpy (VALBUF, (char *) (REGBUF) + REGISTER_BYTE (A0_REGNUM), \
50 TYPE_LENGTH (TYPE)); \
51 else \
52 memcpy (VALBUF, \
53 ((char *) (REGBUF) \
54 + (TYPE_LENGTH (TYPE) >= 4 ? 0 : 4 - TYPE_LENGTH (TYPE))), \
55 TYPE_LENGTH (TYPE)); \
56}
57
58/* Write into appropriate registers a function return value of type
59 TYPE, given in virtual format. */
60
61#define STORE_RETURN_VALUE(TYPE,VALBUF) \
62{ \
63 if (TYPE_CODE (TYPE) == TYPE_CODE_FLT) \
64 { \
65 char raw_buffer[REGISTER_RAW_SIZE (FP0_REGNUM)]; \
66 REGISTER_CONVERT_TO_RAW (TYPE, FP0_REGNUM, VALBUF, raw_buffer); \
67 write_register_bytes (REGISTER_BYTE (FP0_REGNUM), \
68 raw_buffer, TYPE_LENGTH (TYPE)); \
69 } \
70 else \
71 { \
72 if (TYPE_CODE (TYPE) == TYPE_CODE_PTR) \
73 write_register_bytes (REGISTER_BYTE (A0_REGNUM), VALBUF, \
74 TYPE_LENGTH (TYPE)); \
75 write_register_bytes (0, VALBUF, TYPE_LENGTH (TYPE)); \
76 } \
77}
78
c2d11a7d 79#include "tm-linux.h"
c906108c
SS
80#include "m68k/tm-m68k.h"
81
82/* Extract from an array REGBUF containing the (raw) register state
83 the address in which a function should return its structure value,
84 as a CORE_ADDR (or an expression that can be used as one). */
85
86#undef EXTRACT_STRUCT_VALUE_ADDRESS
87#define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) \
88 (*(CORE_ADDR *)((char *) (REGBUF) + REGISTER_BYTE (A0_REGNUM)))
89
90/* Offsets (in target ints) into jmp_buf. */
91
92#define JB_ELEMENT_SIZE 4
93#define JB_PC 7
94
95/* Figure out where the longjmp will land. Slurp the args out of the stack.
96 We expect the first arg to be a pointer to the jmp_buf structure from which
97 we extract the pc (JB_PC) that we will land at. The pc is copied into ADDR.
98 This routine returns true on success */
99
f4281f55 100#define GET_LONGJMP_TARGET(ADDR) m68k_get_longjmp_target(ADDR)
c906108c
SS
101
102/* Offset to saved PC in sigcontext, from <asm/sigcontext.h>. */
103#define SIGCONTEXT_PC_OFFSET 26
104
105#undef FRAME_SAVED_PC
106#define FRAME_SAVED_PC(FRAME) \
107 (((FRAME)->signal_handler_caller \
108 ? sigtramp_saved_pc (FRAME) \
109 : read_memory_integer ((FRAME)->frame + 4, 4)))
110
a14ed312 111extern CORE_ADDR sigtramp_saved_pc (struct frame_info *);
c906108c
SS
112
113#define IN_SIGTRAMP(pc,name) in_sigtramp (pc)
a14ed312 114extern int in_sigtramp (CORE_ADDR pc);
This page took 0.142964 seconds and 4 git commands to generate.