]> CyberLeo.Net >> Repos - FreeBSD/releng/9.2.git/blob - contrib/gdb/gdb/amd64-tdep.h
- Copy stable/9 to releng/9.2 as part of the 9.2-RELEASE cycle.
[FreeBSD/releng/9.2.git] / contrib / gdb / gdb / amd64-tdep.h
1 /* Target-dependent definitions for AMD64.
2
3    Copyright 2001, 2003, 2004 Free Software Foundation, Inc.
4    Contributed by Jiri Smid, SuSE Labs.
5
6    This file is part of GDB.
7
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.
12
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.
17
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.  */
22
23 #ifndef AMD64_TDEP_H
24 #define AMD64_TDEP_H
25
26 struct gdbarch;
27 struct frame_info;
28 struct regcache;
29
30 #include "i386-tdep.h"
31
32 /* Register numbers of various important registers.  */
33
34 enum amd64_regnum
35 {
36   AMD64_RAX_REGNUM,             /* %rax */
37   AMD64_RBX_REGNUM,             /* %rbx */
38   AMD64_RCX_REGNUM,             /* %rcx */
39   AMD64_RDX_REGNUM,             /* %rdx */
40   AMD64_RSI_REGNUM,             /* %rsi */
41   AMD64_RDI_REGNUM,             /* %rdi */
42   AMD64_RBP_REGNUM,             /* %rbp */
43   AMD64_RSP_REGNUM,             /* %rsp */
44   AMD64_R8_REGNUM = 8,          /* %r8 */
45   AMD64_R15_REGNUM = 15,        /* %r15 */
46   AMD64_RIP_REGNUM,             /* %rip */
47   AMD64_EFLAGS_REGNUM,          /* %eflags */
48   AMD64_ST0_REGNUM = 24,        /* %st0 */
49   AMD64_XMM0_REGNUM = 40,       /* %xmm0 */
50   AMD64_XMM1_REGNUM             /* %xmm1 */
51 };
52
53 /* Number of general purpose registers.  */
54 #define AMD64_NUM_GREGS         24
55
56 extern void amd64_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch);
57
58 /* Fill register REGNUM in REGCACHE with the appropriate
59    floating-point or SSE register value from *FXSAVE.  If REGNUM is
60    -1, do this for all registers.  This function masks off any of the
61    reserved bits in *FXSAVE.  */
62
63 extern void amd64_supply_fxsave (struct regcache *regcache, int regnum,
64                                  const void *fxsave);
65
66 /* Fill register REGNUM (if it is a floating-point or SSE register) in
67    *FXSAVE with the value from REGCACHE.  If REGNUM is -1, do this for
68    all registers.  This function doesn't touch any of the reserved
69    bits in *FXSAVE.  */
70
71 extern void amd64_collect_fxsave (const struct regcache *regcache, int regnum,
72                                   void *fxsave);
73
74 /* Fill register REGNUM (if it is a floating-point or SSE register) in
75    *FXSAVE with the value in GDB's register cache.  If REGNUM is -1, do
76    this for all registers.  This function doesn't touch any of the
77    reserved bits in *FXSAVE.  */
78
79 extern void amd64_fill_fxsave (char *fxsave, int regnum);
80 \f
81
82 /* Variables exported from amd64nbsd-tdep.c.  */
83 extern int amd64nbsd_r_reg_offset[];
84
85 /* Variables exported from amd64obsd-tdep.c.  */
86 extern int amd64obsd_r_reg_offset[];
87
88 /* Variables exported from amd64fbsd-tdep.c.  */
89 extern CORE_ADDR amd64fbsd_sigtramp_start_addr;
90 extern CORE_ADDR amd64fbsd_sigtramp_end_addr;
91 extern int amd64fbsd_sc_reg_offset[];
92
93 #endif /* amd64-tdep.h */