aboutsummaryrefslogtreecommitdiff
path: root/sim/mn10300
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2016-08-12 23:43:27 +0800
committerMike Frysinger <vapier@gentoo.org>2022-12-20 23:57:38 -0500
commitffeb72b44c8c5060465005178dd3a4a304117a58 (patch)
treeb44abd51ce73b4207664c3570fb0a834668aff65 /sim/mn10300
parentd026e67ed41a249ec758847008d8a19257bf45fc (diff)
downloadgdb-ffeb72b44c8c5060465005178dd3a4a304117a58.zip
gdb-ffeb72b44c8c5060465005178dd3a4a304117a58.tar.gz
gdb-ffeb72b44c8c5060465005178dd3a4a304117a58.tar.bz2
sim: sim_cpu: invert sim_cpu storage
Currently all ports have to declare sim_cpu themselves in their sim-main.h and then embed the common sim_cpu_base in it. This dynamic makes it impossible to share common object code among multiple ports because the core data structure is always different. Let's invert this relationship: common code declares sim_cpu, and the port uses the new arch_data field for its per-cpu state. This is the first in a series of changes: it adds a define to select between the old & new layouts, then converts all the ports that don't need custom state over to the new layout. This includes mn10300 that, while it defines custom fields in its cpu struct, never uses them.
Diffstat (limited to 'sim/mn10300')
-rw-r--r--sim/mn10300/sim-main.h13
1 files changed, 2 insertions, 11 deletions
diff --git a/sim/mn10300/sim-main.h b/sim/mn10300/sim-main.h
index dd4f966..37e5ce0 100644
--- a/sim/mn10300/sim-main.h
+++ b/sim/mn10300/sim-main.h
@@ -22,6 +22,8 @@
#ifndef SIM_MAIN_H
#define SIM_MAIN_H
+#define SIM_HAVE_COMMON_SIM_CPU
+
#define SIM_ENGINE_HALT_HOOK(SD,LAST_CPU,CIA) /* disable this hook */
#include "sim-basics.h"
@@ -53,17 +55,6 @@ mn10300_core_signal ((SD), (CPU), (CIA), (MAP), (NR_BYTES), (ADDR), (TRANSFER),
#define IMEM8_IMMED(EA, N) \
(sim_core_read_aligned_1(STATE_CPU(sd, 0), EA, exec_map, (EA) + (N)))
-
-/* FIXME: For moment, save/restore PC value found in struct State.
- Struct State will one day go away, being placed in the sim_cpu
- state. */
-
-struct _sim_cpu {
- sim_event *pending_nmi;
- sim_cia cia;
- sim_cpu_base base;
-};
-
/* For compatibility, until all functions converted to passing
SIM_DESC as an argument */
extern SIM_DESC simulator;