Remove locally duplicated code for calling functions in the inferior. The
[deliverable/binutils-gdb.git] / gdb / tm-news.h
1 /* Parameters for execution on a Sony/NEWS, for GDB, the GNU debugger.
2 Copyright (C) 1987, 1989 Free Software Foundation, Inc.
3
4 This file is part of GDB.
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
19
20 /* See following cpu type determination macro to get the machine type.
21
22 Here is an m-news.h file for gdb. It supports the 68881 registers.
23 by hikichi@srava.sra.junet
24
25 * Support Sun assembly format instead of Motorola one.
26 * Ptrace for handling floating register has a bug(before NEWS OS version 2.2),
27 * After NEWS OS version 3.2, some of ptrace's bug is fixed.
28 But we cannot change the floating register(see adb(1) in OS 3.2) yet. */
29
30 #define HAVE_68881
31
32 /* Define this if the C compiler puts an underscore at the front
33 of external names before giving them to the linker. */
34
35 #define NAMES_HAVE_UNDERSCORE
36
37 /* Symbols on this machine are in DBX format. */
38 #define READ_DBX_FORMAT
39
40 /* Use to compute STACK_END_ADDR. */
41 #define TARGET_UPAGES 2
42 #define TARGET_NBPG 4096
43
44 /* Address of end of stack space. */
45
46 #define STACK_END_ADDR (0x80000000 - TARGET_UPAGES * TARGET_NBPG)
47
48 /* Extract from an array REGBUF containing the (raw) register state
49 a function return value of type TYPE, and copy that, in virtual format,
50 into VALBUF. */
51
52 /* when it return the floating value, use the FP0 in NEWS. */
53 #define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
54 { if (TYPE_CODE (TYPE) == TYPE_CODE_FLT) \
55 { \
56 REGISTER_CONVERT_TO_VIRTUAL (FP0_REGNUM, \
57 &REGBUF[REGISTER_BYTE (FP0_REGNUM)], VALBUF); \
58 } \
59 else \
60 bcopy (REGBUF, VALBUF, TYPE_LENGTH (TYPE)); }
61
62 /* Write into appropriate registers a function return value
63 of type TYPE, given in virtual format. */
64
65 /* when it return the floating value, use the FP0 in NEWS. */
66 #define STORE_RETURN_VALUE(TYPE,VALBUF) \
67 { if (TYPE_CODE (TYPE) == TYPE_CODE_FLT) \
68 { \
69 char raw_buf[REGISTER_RAW_SIZE (FP0_REGNUM)]; \
70 REGISTER_CONVERT_TO_RAW (FP0_REGNUM, VALBUF, raw_buf); \
71 write_register_bytes (FP0_REGNUM, \
72 raw_buf, REGISTER_RAW_SIZE (FP0_REGNUM)); \
73 } \
74 else \
75 write_register_bytes (0, VALBUF, TYPE_LENGTH (TYPE)); }
76
77 /* Return number of args passed to a frame.
78 Can return -1, meaning no way to tell. */
79
80 #define FRAME_NUM_ARGS(val, fi) \
81 { register CORE_ADDR pc = FRAME_SAVED_PC (fi); \
82 register int insn = 0177777 & read_memory_integer (pc, 2); \
83 val = 0; \
84 if (insn == 0047757 || insn == 0157374) /* lea W(sp),sp or addaw #W,sp */ \
85 val = read_memory_integer (pc + 2, 2); \
86 else if ((insn & 0170777) == 0050217 /* addql #N, sp */ \
87 || (insn & 0170777) == 0050117) /* addqw */ \
88 { val = (insn >> 9) & 7; if (val == 0) val = 8; } \
89 else if (insn == 0157774) /* addal #WW, sp */ \
90 val = read_memory_integer (pc + 2, 4); \
91 val >>= 2; }
92
93 #include "tm-68k.h"
This page took 0.032286 seconds and 5 git commands to generate.