| 1 | /* Target-dependent code for UltraSPARC. |
| 2 | |
| 3 | Copyright (C) 2003, 2004 Free Software Foundation, Inc. |
| 4 | |
| 5 | This file is part of GDB. |
| 6 | |
| 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. |
| 11 | |
| 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. |
| 16 | |
| 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., 51 Franklin Street, Fifth Floor, |
| 20 | Boston, MA 02110-1301, USA. */ |
| 21 | |
| 22 | #ifndef SPARC64_TDEP_H |
| 23 | #define SPARC64_TDEP_H 1 |
| 24 | |
| 25 | struct frame_info; |
| 26 | struct gdbarch; |
| 27 | struct regcache; |
| 28 | struct sparc_gregset; |
| 29 | struct trad_frame_saved_reg; |
| 30 | |
| 31 | #include "sparc-tdep.h" |
| 32 | |
| 33 | /* The stack pointer is offset from the stack frame by a BIAS of 2047 |
| 34 | (0x7ff) for 64-bit code. BIAS is likely to be defined on SPARC |
| 35 | hosts, so undefine it first. */ |
| 36 | #undef BIAS |
| 37 | #define BIAS 2047 |
| 38 | |
| 39 | /* Register offsets for the general-purpose register set. */ |
| 40 | |
| 41 | /* UltraSPARC doesn't have %psr. */ |
| 42 | #define r_tstate_offset r_psr_offset |
| 43 | |
| 44 | /* UltraSPARC doesn't have %wim either. */ |
| 45 | #define r_fprs_offset r_wim_offset |
| 46 | |
| 47 | /* Register numbers of various important registers. */ |
| 48 | |
| 49 | enum sparc64_regnum |
| 50 | { |
| 51 | SPARC64_F32_REGNUM /* %f32 */ |
| 52 | = SPARC_F0_REGNUM + 32, |
| 53 | SPARC64_F62_REGNUM /* %f62 */ |
| 54 | = SPARC64_F32_REGNUM + 15, |
| 55 | SPARC64_PC_REGNUM, /* %pc */ |
| 56 | SPARC64_NPC_REGNUM, /* %npc */ |
| 57 | SPARC64_STATE_REGNUM, |
| 58 | SPARC64_FSR_REGNUM, /* %fsr */ |
| 59 | SPARC64_FPRS_REGNUM, /* %fprs */ |
| 60 | SPARC64_Y_REGNUM, /* %y */ |
| 61 | |
| 62 | /* Pseudo registers. */ |
| 63 | SPARC64_CWP_REGNUM, /* %cwp */ |
| 64 | SPARC64_PSTATE_REGNUM, /* %pstate */ |
| 65 | SPARC64_ASI_REGNUM, /* %asi */ |
| 66 | SPARC64_CCR_REGNUM, /* %ccr */ |
| 67 | SPARC64_D0_REGNUM, /* %d0 */ |
| 68 | SPARC64_D10_REGNUM /* %d10 */ |
| 69 | = SPARC64_D0_REGNUM + 5, |
| 70 | SPARC64_D30_REGNUM /* %d30 */ |
| 71 | = SPARC64_D0_REGNUM + 15, |
| 72 | SPARC64_D32_REGNUM /* %d32 */ |
| 73 | = SPARC64_D0_REGNUM + 16, |
| 74 | SPARC64_D62_REGNUM /* %d62 */ |
| 75 | = SPARC64_D0_REGNUM + 31, |
| 76 | SPARC64_Q0_REGNUM, /* %q0 */ |
| 77 | SPARC64_Q8_REGNUM /* %q8 */ |
| 78 | = SPARC64_Q0_REGNUM + 2, |
| 79 | SPARC64_Q28_REGNUM /* %q28 */ |
| 80 | = SPARC64_Q0_REGNUM + 7, |
| 81 | SPARC64_Q32_REGNUM /* %q32 */ |
| 82 | = SPARC64_Q0_REGNUM + 8, |
| 83 | SPARC64_Q60_REGNUM /* %q60 */ |
| 84 | = SPARC64_Q0_REGNUM + 15 |
| 85 | }; |
| 86 | |
| 87 | extern void sparc64_init_abi (struct gdbarch_info info, |
| 88 | struct gdbarch *gdbarch); |
| 89 | |
| 90 | extern void sparc64_supply_gregset (const struct sparc_gregset *gregset, |
| 91 | struct regcache *regcache, |
| 92 | int regnum, const void *gregs); |
| 93 | extern void sparc64_collect_gregset (const struct sparc_gregset *gregset, |
| 94 | const struct regcache *regcache, |
| 95 | int regnum, void *gregs); |
| 96 | extern void sparc64_supply_fpregset (struct regcache *regcache, |
| 97 | int regnum, const void *fpregs); |
| 98 | extern void sparc64_collect_fpregset (const struct regcache *regcache, |
| 99 | int regnum, void *fpregs); |
| 100 | |
| 101 | /* Functions and variables exported from sparc64-sol2-tdep.c. */ |
| 102 | |
| 103 | /* Register offsets for Solaris 2. */ |
| 104 | extern const struct sparc_gregset sparc64_sol2_gregset; |
| 105 | |
| 106 | extern void sparc64_sol2_init_abi (struct gdbarch_info info, |
| 107 | struct gdbarch *gdbarch); |
| 108 | |
| 109 | /* Variables exported from sparc64fbsd-tdep.c. */ |
| 110 | |
| 111 | /* Register offsets for FreeBSD/sparc64. */ |
| 112 | extern const struct sparc_gregset sparc64fbsd_gregset; |
| 113 | |
| 114 | /* Functions and variables exported from sparc64nbsd-tdep.c. */ |
| 115 | |
| 116 | /* Register offsets for NetBSD/sparc64. */ |
| 117 | extern const struct sparc_gregset sparc64nbsd_gregset; |
| 118 | |
| 119 | extern struct trad_frame_saved_reg * |
| 120 | sparc64nbsd_sigcontext_saved_regs (CORE_ADDR sigcontext_addr, |
| 121 | struct frame_info *next_frame); |
| 122 | |
| 123 | #endif /* sparc64-tdep.h */ |