]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - gdb/arc-tdep.h
arc: Add a gdbarch_tdep structure
[thirdparty/binutils-gdb.git] / gdb / arc-tdep.h
1 /* Target dependent code for ARC arhitecture, for GDB.
2
3 Copyright 2005-2016 Free Software Foundation, Inc.
4 Contributed by Synopsys Inc.
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 3 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, see <http://www.gnu.org/licenses/>. */
20
21 #ifndef ARC_TDEP_H
22 #define ARC_TDEP_H
23
24 /* Need disassemble_info. */
25 #include "dis-asm.h"
26
27 enum arc_regnum
28 {
29 /* Core registers. */
30 ARC_R0_REGNUM = 0,
31 ARC_FIRST_CORE_REGNUM = ARC_R0_REGNUM,
32 ARC_R1_REGNUM = 1,
33 ARC_R4_REGNUM = 4,
34 ARC_R7_REGNUM = 7,
35 ARC_R9_REGNUM = 9,
36 ARC_R13_REGNUM = 13,
37 ARC_R16_REGNUM = 16,
38 ARC_R25_REGNUM = 25,
39 /* Global data pointer. */
40 ARC_GP_REGNUM,
41 /* Frame pointer. */
42 ARC_FP_REGNUM,
43 /* Stack pointer. */
44 ARC_SP_REGNUM,
45 /* Return address from interrupt. */
46 ARC_ILINK_REGNUM,
47 ARC_R30_REGNUM,
48 /* Return address from function. */
49 ARC_BLINK_REGNUM,
50 /* Zero-delay loop counter. */
51 ARC_LP_COUNT_REGNUM = 60,
52 /* Program counter, aligned to 4-bytes, read-only. */
53 ARC_PCL_REGNUM,
54 ARC_LAST_CORE_REGNUM = ARC_PCL_REGNUM,
55 /* AUX registers. */
56 /* Actual program counter. */
57 ARC_PC_REGNUM,
58 ARC_FIRST_AUX_REGNUM = ARC_PC_REGNUM,
59 /* Status register. */
60 ARC_STATUS32_REGNUM,
61 ARC_LAST_REGNUM = ARC_STATUS32_REGNUM,
62 ARC_LAST_AUX_REGNUM = ARC_STATUS32_REGNUM,
63
64 /* Additional ABI constants. */
65 ARC_FIRST_ARG_REGNUM = ARC_R0_REGNUM,
66 ARC_LAST_ARG_REGNUM = ARC_R7_REGNUM,
67 ARC_FIRST_CALLEE_SAVED_REGNUM = ARC_R13_REGNUM,
68 ARC_LAST_CALLEE_SAVED_REGNUM = ARC_R25_REGNUM,
69 };
70
71 /* Number of bytes in ARC register. All ARC registers are considered 32-bit.
72 Those registers, which are actually shorter has zero-on-read for extra bits.
73 Longer registers are represented as pairs of 32-bit registers. */
74 #define ARC_REGISTER_SIZE 4
75
76 #define arc_print(fmt, args...) fprintf_unfiltered (gdb_stdlog, fmt, ##args)
77
78 extern int arc_debug;
79
80 /* Target-dependent information. */
81
82 struct gdbarch_tdep
83 {
84 };
85
86 /* Utility functions used by other ARC-specific modules. */
87
88 static inline int
89 arc_mach_is_arc600 (struct gdbarch *gdbarch)
90 {
91 return (gdbarch_bfd_arch_info (gdbarch)->mach == bfd_mach_arc_arc600
92 || gdbarch_bfd_arch_info (gdbarch)->mach == bfd_mach_arc_arc601);
93 }
94
95 static inline int
96 arc_mach_is_arc700 (struct gdbarch *gdbarch)
97 {
98 return gdbarch_bfd_arch_info (gdbarch)->mach == bfd_mach_arc_arc700;
99 }
100
101 static inline int
102 arc_mach_is_arcv2 (struct gdbarch *gdbarch)
103 {
104 return gdbarch_bfd_arch_info (gdbarch)->mach == bfd_mach_arc_arcv2;
105 }
106
107 #endif /* ARC_TDEP_H */