forked from Imagelibrary/binutils-gdb
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:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user