1 /* Target dependent code for ARC arhitecture, for GDB.
3 Copyright 2005-2017 Free Software Foundation, Inc.
4 Contributed by Synopsys Inc.
6 This file is part of GDB.
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.
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.
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/>. */
24 /* Need disassemble_info. */
27 /* To simplify GDB code this enum assumes that internal regnums should be same
28 as architectural register numbers, i.e. PCL regnum is 63. This allows to
29 use internal GDB regnums as architectural numbers when dealing with
30 instruction encodings, for example when analyzing what are the registers
31 saved in function prologue. */
37 ARC_FIRST_CORE_REGNUM
= ARC_R0_REGNUM
,
45 /* Global data pointer. */
51 /* Return address from interrupt. */
54 /* Return address from function. */
56 /* Zero-delay loop counter. */
57 ARC_LP_COUNT_REGNUM
= 60,
58 /* Reserved register number. There should never be a register with such
59 number, this name is needed only for a sanity check in
60 arc_cannot_(fetch|store)_register. */
62 /* Long-immediate value. This is not a physical register - if instruction
63 has register 62 as an operand, then this operand is a literal value
64 stored in the instruction memory right after the instruction itself.
65 This value is required in this enumeration as an architectural number
66 for instruction analysis. */
68 /* Program counter, aligned to 4-bytes, read-only. */
70 ARC_LAST_CORE_REGNUM
= ARC_PCL_REGNUM
,
72 /* Actual program counter. */
74 ARC_FIRST_AUX_REGNUM
= ARC_PC_REGNUM
,
75 /* Status register. */
77 ARC_LAST_REGNUM
= ARC_STATUS32_REGNUM
,
78 ARC_LAST_AUX_REGNUM
= ARC_STATUS32_REGNUM
,
80 /* Additional ABI constants. */
81 ARC_FIRST_ARG_REGNUM
= ARC_R0_REGNUM
,
82 ARC_LAST_ARG_REGNUM
= ARC_R7_REGNUM
,
83 ARC_FIRST_CALLEE_SAVED_REGNUM
= ARC_R13_REGNUM
,
84 ARC_LAST_CALLEE_SAVED_REGNUM
= ARC_R25_REGNUM
,
87 /* Number of bytes in ARC register. All ARC registers are considered 32-bit.
88 Those registers, which are actually shorter has zero-on-read for extra bits.
89 Longer registers are represented as pairs of 32-bit registers. */
90 #define ARC_REGISTER_SIZE 4
92 #define arc_print(fmt, args...) fprintf_unfiltered (gdb_stdlog, fmt, ##args)
96 /* Target-dependent information. */
100 /* Offset to PC value in jump buffer. If this is negative, longjmp
101 support will be disabled. */
105 /* Utility functions used by other ARC-specific modules. */
108 arc_mach_is_arc600 (struct gdbarch
*gdbarch
)
110 return (gdbarch_bfd_arch_info (gdbarch
)->mach
== bfd_mach_arc_arc600
111 || gdbarch_bfd_arch_info (gdbarch
)->mach
== bfd_mach_arc_arc601
);
115 arc_mach_is_arc700 (struct gdbarch
*gdbarch
)
117 return gdbarch_bfd_arch_info (gdbarch
)->mach
== bfd_mach_arc_arc700
;
121 arc_mach_is_arcv2 (struct gdbarch
*gdbarch
)
123 return gdbarch_bfd_arch_info (gdbarch
)->mach
== bfd_mach_arc_arcv2
;
126 #endif /* ARC_TDEP_H */