aboutsummaryrefslogtreecommitdiff
path: root/sim/mips/sim-main.h
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2022-11-11 22:57:05 +0700
committerMike Frysinger <vapier@gentoo.org>2022-12-21 22:27:11 -0500
commit0fb6c560ffa591fbb7f8aa7de4f6719e20ced208 (patch)
tree2ce518bb0ad16f919ae3e86444dba188ee0e689e /sim/mips/sim-main.h
parentf4ac2306058aecab760b05e425d089a1c86e0618 (diff)
downloadgdb-0fb6c560ffa591fbb7f8aa7de4f6719e20ced208.zip
gdb-0fb6c560ffa591fbb7f8aa7de4f6719e20ced208.tar.gz
gdb-0fb6c560ffa591fbb7f8aa7de4f6719e20ced208.tar.bz2
sim: mips: always resolve active bfd mach dynamically
Don't assume that the default bfd that we configured for is the one that is always active when running a program. We already have access to the real runtime value, so use it directly. This simplifies the code quite a bit, and will make it easier to support multiple mach's in a single binary.
Diffstat (limited to 'sim/mips/sim-main.h')
-rw-r--r--sim/mips/sim-main.h13
1 files changed, 3 insertions, 10 deletions
diff --git a/sim/mips/sim-main.h b/sim/mips/sim-main.h
index ea203c4..3868fff 100644
--- a/sim/mips/sim-main.h
+++ b/sim/mips/sim-main.h
@@ -1051,24 +1051,17 @@ void mips_cpu_exception_trigger(SIM_DESC sd, sim_cpu* cpu, address_word pc);
void mips_cpu_exception_suspend(SIM_DESC sd, sim_cpu* cpu, int exception);
void mips_cpu_exception_resume(SIM_DESC sd, sim_cpu* cpu, int exception);
-#ifdef MIPS_MACH_MULTI
-extern int mips_mach_multi(SIM_DESC sd);
-#define MIPS_MACH(SD) mips_mach_multi(SD)
-#else
-#define MIPS_MACH(SD) MIPS_MACH_DEFAULT
-#endif
-
/* Macros for determining whether a MIPS IV or MIPS V part is subject
to the hi/lo restrictions described in mips.igen. */
#define MIPS_MACH_HAS_MT_HILO_HAZARD(SD) \
- (MIPS_MACH (SD) != bfd_mach_mips5500)
+ (STATE_ARCHITECTURE (SD)->mach != bfd_mach_mips5500)
#define MIPS_MACH_HAS_MULT_HILO_HAZARD(SD) \
- (MIPS_MACH (SD) != bfd_mach_mips5500)
+ (STATE_ARCHITECTURE (SD)->mach != bfd_mach_mips5500)
#define MIPS_MACH_HAS_DIV_HILO_HAZARD(SD) \
- (MIPS_MACH (SD) != bfd_mach_mips5500)
+ (STATE_ARCHITECTURE (SD)->mach != bfd_mach_mips5500)
#if H_REVEALS_MODULE_P (SIM_MAIN_INLINE)
#include "sim-main.c"