1 /* Common target dependent code for GDB on SPARC systems.
2 Copyright 2002 Free Software Foundation, Inc.
4 This file is part of GDB.
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.
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.
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., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. */
22 * Some local macros that have multi-arch and non-multi-arch versions:
25 #if (GDB_MULTI_ARCH > 0)
27 /* Does the target have Floating Point registers? */
28 #define SPARC_HAS_FPU (gdbarch_tdep (current_gdbarch)->has_fpu)
29 /* Number of bytes devoted to Floating Point registers: */
30 #define FP_REGISTER_BYTES (gdbarch_tdep (current_gdbarch)->fp_register_bytes)
31 /* Highest numbered Floating Point register. */
32 #define FP_MAX_REGNUM (gdbarch_tdep (current_gdbarch)->fp_max_regnum)
33 /* Size of a general (integer) register: */
34 #define SPARC_INTREG_SIZE (gdbarch_tdep (current_gdbarch)->intreg_size)
35 /* Offset within the call dummy stack of the saved registers. */
36 #define DUMMY_REG_SAVE_OFFSET (gdbarch_tdep (current_gdbarch)->reg_save_offset)
38 #else /* non-multi-arch */
40 /* Does the target have Floating Point registers? */
41 #if defined(TARGET_SPARCLET) || defined(TARGET_SPARCLITE)
42 #define SPARC_HAS_FPU 0
44 #define SPARC_HAS_FPU 1
47 /* Number of bytes devoted to Floating Point registers: */
48 #if (GDB_TARGET_IS_SPARC64)
49 #define FP_REGISTER_BYTES (64 * 4)
52 #define FP_REGISTER_BYTES (32 * 4)
54 #define FP_REGISTER_BYTES 0
58 /* Highest numbered Floating Point register. */
59 #if (GDB_TARGET_IS_SPARC64)
60 #define FP_MAX_REGNUM (FP0_REGNUM + 48)
62 #define FP_MAX_REGNUM (FP0_REGNUM + 32)
65 /* Size of a general (integer) register: */
66 #define SPARC_INTREG_SIZE (REGISTER_RAW_SIZE (G0_REGNUM))
68 /* Offset within the call dummy stack of the saved registers. */
69 #if (GDB_TARGET_IS_SPARC64)
70 #define DUMMY_REG_SAVE_OFFSET (128 + 16)
72 #define DUMMY_REG_SAVE_OFFSET 0x60
75 #endif /* GDB_MULTI_ARCH */
77 #ifndef CALL_DUMMY_CALL_OFFSET
78 #define CALL_DUMMY_CALL_OFFSET \
79 (gdbarch_tdep (current_gdbarch)->call_dummy_call_offset)
80 #endif /* CALL_DUMMY_CALL_OFFSET */
86 int fp_register_bytes;
91 int call_dummy_call_offset;
95 /* How a OS variant tells the SPARC generic code that it can handle an ABI
97 extern void sparc_gdbarch_register_os_abi (int os_ident,
98 void (*init_abi)(struct gdbarch_info,