GDB (API)
/home/stan/gdb/src/gdb/sparc64-tdep.h
Go to the documentation of this file.
00001 /* Target-dependent code for UltraSPARC.
00002 
00003    Copyright (C) 2003-2013 Free Software Foundation, Inc.
00004 
00005    This file is part of GDB.
00006 
00007    This program is free software; you can redistribute it and/or modify
00008    it under the terms of the GNU General Public License as published by
00009    the Free Software Foundation; either version 3 of the License, or
00010    (at your option) any later version.
00011 
00012    This program is distributed in the hope that it will be useful,
00013    but WITHOUT ANY WARRANTY; without even the implied warranty of
00014    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015    GNU General Public License for more details.
00016 
00017    You should have received a copy of the GNU General Public License
00018    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
00019 
00020 #ifndef SPARC64_TDEP_H
00021 #define SPARC64_TDEP_H 1
00022 
00023 struct frame_info;
00024 struct gdbarch;
00025 struct regcache;
00026 struct sparc_gregset;
00027 struct trad_frame_saved_reg;
00028 
00029 #include "sparc-tdep.h"
00030 
00031 /* The stack pointer is offset from the stack frame by a BIAS of 2047
00032    (0x7ff) for 64-bit code.  BIAS is likely to be defined on SPARC
00033    hosts, so undefine it first.  */
00034 #undef BIAS
00035 #define BIAS 2047
00036 
00037 /* Register offsets for the general-purpose register set.  */
00038 
00039 /* UltraSPARC doesn't have %psr.  */
00040 #define r_tstate_offset r_psr_offset
00041 
00042 /* UltraSPARC doesn't have %wim either.  */
00043 #define r_fprs_offset r_wim_offset
00044 
00045 /* Register numbers of various important registers.  */
00046 
00047 enum sparc64_regnum
00048 {
00049   SPARC64_F32_REGNUM            /* %f32 */
00050   = SPARC_F0_REGNUM + 32,
00051   SPARC64_F62_REGNUM            /* %f62 */
00052   = SPARC64_F32_REGNUM + 15,
00053   SPARC64_PC_REGNUM,            /* %pc */
00054   SPARC64_NPC_REGNUM,           /* %npc */
00055   SPARC64_STATE_REGNUM,
00056   SPARC64_FSR_REGNUM,           /* %fsr */
00057   SPARC64_FPRS_REGNUM,          /* %fprs */
00058   SPARC64_Y_REGNUM,             /* %y */
00059 
00060   /* Pseudo registers.  */
00061   SPARC64_CWP_REGNUM,           /* %cwp */
00062   SPARC64_PSTATE_REGNUM,        /* %pstate */
00063   SPARC64_ASI_REGNUM,           /* %asi */
00064   SPARC64_CCR_REGNUM,           /* %ccr */
00065   SPARC64_D0_REGNUM,            /* %d0 */
00066   SPARC64_D10_REGNUM            /* %d10 */
00067   = SPARC64_D0_REGNUM + 5,
00068   SPARC64_D30_REGNUM            /* %d30 */
00069   = SPARC64_D0_REGNUM + 15,
00070   SPARC64_D32_REGNUM            /* %d32 */
00071   = SPARC64_D0_REGNUM + 16,
00072   SPARC64_D62_REGNUM            /* %d62 */
00073   = SPARC64_D0_REGNUM + 31,
00074   SPARC64_Q0_REGNUM,            /* %q0 */
00075   SPARC64_Q8_REGNUM             /* %q8 */
00076   = SPARC64_Q0_REGNUM + 2,
00077   SPARC64_Q28_REGNUM            /* %q28 */
00078   = SPARC64_Q0_REGNUM + 7,
00079   SPARC64_Q32_REGNUM            /* %q32 */
00080   = SPARC64_Q0_REGNUM + 8,
00081   SPARC64_Q60_REGNUM            /* %q60 */
00082   = SPARC64_Q0_REGNUM + 15
00083 };
00084 
00085 /* Processor state bits.  */
00086 #define SPARC64_PSTATE_AG       0x001
00087 #define SPARC64_PSTATE_IE       0x002
00088 #define SPARC64_PSTATE_PRIV     0x004
00089 #define SPARC64_PSTATE_AM       0x008
00090 #define SPARC64_PSTATE_PEF      0x010
00091 #define SPARC64_PSTATE_RED      0x020
00092 #define SPARC64_PSTATE_TLE      0x100
00093 #define SPARC64_PSTATE_CLE      0x200
00094 #define SPARC64_PSTATE_PID0     0x400
00095 #define SPARC64_PSTATE_PID1     0x800
00096 
00097 extern void sparc64_init_abi (struct gdbarch_info info,
00098                               struct gdbarch *gdbarch);
00099 
00100 extern void sparc64_supply_gregset (const struct sparc_gregset *gregset,
00101                                     struct regcache *regcache,
00102                                     int regnum, const void *gregs);
00103 extern void sparc64_collect_gregset (const struct sparc_gregset *gregset,
00104                                      const struct regcache *regcache,
00105                                      int regnum, void *gregs);
00106 extern void sparc64_supply_fpregset (const struct sparc_fpregset *fpregset,
00107                                      struct regcache *regcache,
00108                                      int regnum, const void *fpregs);
00109 extern void sparc64_collect_fpregset (const struct sparc_fpregset *fpregset,
00110                                       const struct regcache *regcache,
00111                                       int regnum, void *fpregs);
00112 
00113 /* Functions and variables exported from sparc64-sol2-tdep.c.  */
00114 
00115 /* Register offsets for Solaris 2.  */
00116 extern const struct sparc_gregset sparc64_sol2_gregset;
00117 extern const struct sparc_fpregset sparc64_sol2_fpregset;
00118 
00119 extern void sparc64_sol2_init_abi (struct gdbarch_info info,
00120                                    struct gdbarch *gdbarch);
00121 
00122 /* Variables exported from sparc64fbsd-tdep.c.  */
00123 
00124 /* Register offsets for FreeBSD/sparc64.  */
00125 extern const struct sparc_gregset sparc64fbsd_gregset;
00126 
00127 /* Functions and variables exported from sparc64nbsd-tdep.c.  */
00128 
00129 /* Register offsets for NetBSD/sparc64.  */
00130 extern const struct sparc_gregset sparc64nbsd_gregset;
00131 
00132 extern struct trad_frame_saved_reg *
00133   sparc64nbsd_sigcontext_saved_regs (CORE_ADDR sigcontext_addr,
00134                                      struct frame_info *next_frame);
00135 
00136 extern const struct sparc_fpregset sparc64_bsd_fpregset;
00137 
00138 #endif /* sparc64-tdep.h */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines