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.
This commit is contained in:
Mike Frysinger
2022-10-31 23:39:51 +05:45
parent 4c3c31719b
commit 4a21ad1e76
29 changed files with 1 additions and 66 deletions

View File

@@ -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);
}

View File

@@ -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);