aboutsummaryrefslogtreecommitdiff
path: root/sim/common
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2022-10-31 23:39:51 +0545
committerMike Frysinger <vapier@gentoo.org>2022-12-21 00:00:18 -0500
commit4a21ad1e76631ead9b0a40aabc6e51d17cb632c7 (patch)
tree4cce21081d98d224dd6d19c5c749e7ea9aee7012 /sim/common
parent4c3c31719b1a2e2a93087223286d927477646474 (diff)
downloadgdb-4a21ad1e76631ead9b0a40aabc6e51d17cb632c7.zip
gdb-4a21ad1e76631ead9b0a40aabc6e51d17cb632c7.tar.gz
gdb-4a21ad1e76631ead9b0a40aabc6e51d17cb632c7.tar.bz2
sim: enable common sim_cpu usage everywhere
All ports should be migrated now. Drop the SIM_HAVE_COMMON_SIM_CPU knob and require it be used everywhere now.
Diffstat (limited to 'sim/common')
-rw-r--r--sim/common/sim-cpu.c11
-rw-r--r--sim/common/sim-cpu.h2
2 files changed, 1 insertions, 12 deletions
diff --git a/sim/common/sim-cpu.c b/sim/common/sim-cpu.c
index 951e937..024bd05 100644
--- a/sim/common/sim-cpu.c
+++ b/sim/common/sim-cpu.c
@@ -46,20 +46,14 @@ sim_cpu_alloc_all_extra (SIM_DESC sd, int ncpus, size_t extra_bytes)
sim_cpu *
sim_cpu_alloc_extra (SIM_DESC sd, size_t extra_bytes)
{
- sim_cpu *cpu;
+ sim_cpu *cpu = zalloc (sizeof (*cpu));
#ifndef CGEN_ARCH
# define cgen_cpu_max_extra_bytes(sd) 0
#endif
-#ifdef SIM_HAVE_COMMON_SIM_CPU
- cpu = zalloc (sizeof (*cpu));
-
extra_bytes += cgen_cpu_max_extra_bytes (sd);
if (extra_bytes)
CPU_ARCH_DATA (cpu) = zalloc (extra_bytes);
-#else
- cpu = zalloc (sizeof (*cpu) + cgen_cpu_max_extra_bytes (sd));
-#endif
return cpu;
}
@@ -81,10 +75,7 @@ sim_cpu_free_all (SIM_DESC sd)
void
sim_cpu_free (sim_cpu *cpu)
{
-#ifdef SIM_HAVE_COMMON_SIM_CPU
free (CPU_ARCH_DATA (cpu));
-#endif
-
free (cpu);
}
diff --git a/sim/common/sim-cpu.h b/sim/common/sim-cpu.h
index e895664..83244e0 100644
--- a/sim/common/sim-cpu.h
+++ b/sim/common/sim-cpu.h
@@ -126,7 +126,6 @@ typedef struct {
} sim_cpu_base;
-#ifdef SIM_HAVE_COMMON_SIM_CPU
struct _sim_cpu {
/* All the common state. */
sim_cpu_base base;
@@ -142,7 +141,6 @@ struct _sim_cpu {
void *arch_data;
#define CPU_ARCH_DATA(cpu) ((cpu)->arch_data)
};
-#endif
/* Create all cpus. */
extern SIM_RC sim_cpu_alloc_all_extra (SIM_DESC, int, size_t);