(sparc_fetch_instruction): New prototype.
* sparc-tdep.c: Update copyright year.
(sparc_fetch_instruction): Make global.
* sparc64-tdep.c: Update copyright year.
(sparc_fetch_instruction): Remove function.
(X_OP, X_RD, X_A, X_COND, X_OP2, X_IMM22, X_OP3, X_I, X_DISP22)
(X_DISP19): Really remove macros.
* sparc64-sol2-tdep.c: Update copyright year.
* sparc64fbsd-tdep.c: Likewise.
2004-01-01 Mark Kettenis <kettenis@gnu.org>
+ * sparc-tdep.h: Update copyright year.
+ (sparc_fetch_instruction): New prototype.
+ * sparc-tdep.c: Update copyright year.
+ (sparc_fetch_instruction): Make global.
+ * sparc64-tdep.c: Update copyright year.
+ (sparc_fetch_instruction): Remove function.
+ (X_OP, X_RD, X_A, X_COND, X_OP2, X_IMM22, X_OP3, X_I, X_DISP22)
+ (X_DISP19): Really remove macros.
+ * sparc64-sol2-tdep.c: Update copyright year.
+ * sparc64fbsd-tdep.c: Likewise.
+
* sparc64-tdep.c (BIAS): Remove define.
* sparc64-sol2-tdep.c (BIAS): Remove define.
* sparc64fbsd-tdep.c: Likewise.
/* Target-dependent code for SPARC.
- Copyright 2003 Free Software Foundation, Inc.
+ Copyright 2003, 2004 Free Software Foundation, Inc.
This file is part of GDB.
/* Fetch the instruction at PC. Instructions are always big-endian
even if the processor operates in little-endian mode. */
-static unsigned long
+unsigned long
sparc_fetch_instruction (CORE_ADDR pc)
{
unsigned char buf[4];
/* Target-dependent code for SPARC.
- Copyright 2003 Free Software Foundation, Inc.
+ Copyright 2003, 2004 Free Software Foundation, Inc.
This file is part of GDB.
struct trad_frame_saved_reg *saved_regs;
};
+/* Fetch the instruction at PC. */
+extern unsigned long sparc_fetch_instruction (CORE_ADDR pc);
+
extern CORE_ADDR sparc_analyze_prologue (CORE_ADDR pc, CORE_ADDR current_pc,
struct sparc_frame_cache *cache);
/* Target-dependent code for Solaris UltraSPARC.
- Copyright 2003 Free Software Foundation, Inc.
+ Copyright 2003, 2004 Free Software Foundation, Inc.
This file is part of GDB.
/* Target-dependent code for UltraSPARC.
- Copyright 2003 Free Software Foundation, Inc.
+ Copyright 2003, 2004 Free Software Foundation, Inc.
This file is part of GDB.
/* Please use the sparc32_-prefix for 32-bit specific code, the
sparc64_-prefix for 64-bit specific code and the sparc_-prefix for
code can handle both. */
-
-/* Macros to extract fields from SPARC instructions. */
-#define X_OP(i) (((i) >> 30) & 0x3)
-#define X_RD(i) (((i) >> 25) & 0x1f)
-#define X_A(i) (((i) >> 29) & 1)
-#define X_COND(i) (((i) >> 25) & 0xf)
-#define X_OP2(i) (((i) >> 22) & 0x7)
-#define X_IMM22(i) ((i) & 0x3fffff)
-#define X_OP3(i) (((i) >> 19) & 0x3f)
-#define X_I(i) (((i) >> 13) & 1)
-/* Sign extension macros. */
-#define X_DISP22(i) ((X_IMM22 (i) ^ 0x200000) - 0x200000)
-#define X_DISP19(i) ((((i) & 0x7ffff) ^ 0x40000) - 0x40000)
-
-/* Fetch the instruction at PC. Instructions are always big-endian
- even if the processor operates in little-endian mode. */
-
-static unsigned long
-sparc_fetch_instruction (CORE_ADDR pc)
-{
- unsigned char buf[4];
- unsigned long insn;
- int i;
-
- read_memory (pc, buf, sizeof (buf));
-
- insn = 0;
- for (i = 0; i < sizeof (buf); i++)
- insn = (insn << 8) | buf[i];
- return insn;
-}
\f
/* The functions on this page are intended to be used to classify
function arguments. */
/* Target-dependent code for FreeBSD/sparc64.
- Copyright 2003 Free Software Foundation, Inc.
+ Copyright 2003, 2004 Free Software Foundation, Inc.
This file is part of GDB.