summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2022-10-31 23:39:51 +0545
committerMike Frysinger <vapier@gentoo.org>2022-11-11 01:44:21 +0700
commitad450d269d9a0f4460162567330fd383f202b926 (patch)
treee15373c444119ff88180e173872b16eb1925d7eb
parent911ee5419e9acf5ba9095ec951163030990e0f4b (diff)
downloadbinutils-gdb-ad450d269d9a0f4460162567330fd383f202b926.tar.gz
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.
-rw-r--r--sim/aarch64/sim-main.h2
-rw-r--r--sim/arm/sim-main.h2
-rw-r--r--sim/avr/sim-main.h2
-rw-r--r--sim/bfin/sim-main.h2
-rw-r--r--sim/bpf/sim-main.h2
-rw-r--r--sim/common/sim-cpu.c11
-rw-r--r--sim/common/sim-cpu.h2
-rw-r--r--sim/cr16/sim-main.h2
-rw-r--r--sim/cris/sim-main.h2
-rw-r--r--sim/d10v/sim-main.h2
-rw-r--r--sim/example-synacor/sim-main.h2
-rw-r--r--sim/frv/sim-main.h2
-rw-r--r--sim/ft32/sim-main.h2
-rw-r--r--sim/h8300/sim-main.h2
-rw-r--r--sim/iq2000/sim-main.h2
-rw-r--r--sim/lm32/sim-main.h2
-rw-r--r--sim/m32r/sim-main.h2
-rw-r--r--sim/m68hc11/sim-main.h2
-rw-r--r--sim/mcore/sim-main.h2
-rw-r--r--sim/microblaze/sim-main.h2
-rw-r--r--sim/mips/sim-main.h2
-rw-r--r--sim/mn10300/sim-main.h2
-rw-r--r--sim/moxie/sim-main.h2
-rw-r--r--sim/msp430/sim-main.h2
-rw-r--r--sim/or1k/sim-main.h2
-rw-r--r--sim/pru/sim-main.h2
-rw-r--r--sim/riscv/sim-main.h2
-rw-r--r--sim/sh/sim-main.h2
-rw-r--r--sim/v850/sim-main.h2
29 files changed, 1 insertions, 66 deletions
diff --git a/sim/aarch64/sim-main.h b/sim/aarch64/sim-main.h
index 0da730d3a3e..211685f8864 100644
--- a/sim/aarch64/sim-main.h
+++ b/sim/aarch64/sim-main.h
@@ -22,8 +22,6 @@
#ifndef _SIM_MAIN_H
#define _SIM_MAIN_H
-#define SIM_HAVE_COMMON_SIM_CPU
-
#include "sim-basics.h"
#include "sim-types.h"
#include "sim-base.h"
diff --git a/sim/arm/sim-main.h b/sim/arm/sim-main.h
index ba44314927a..bdc5019a303 100644
--- a/sim/arm/sim-main.h
+++ b/sim/arm/sim-main.h
@@ -19,8 +19,6 @@
#ifndef SIM_MAIN_H
#define SIM_MAIN_H
-#define SIM_HAVE_COMMON_SIM_CPU
-
#include "sim-basics.h"
#include "sim-base.h"
#include "bfd.h"
diff --git a/sim/avr/sim-main.h b/sim/avr/sim-main.h
index 63f43dded5f..97129ec9183 100644
--- a/sim/avr/sim-main.h
+++ b/sim/avr/sim-main.h
@@ -19,8 +19,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
#ifndef SIM_MAIN_H
#define SIM_MAIN_H
-#define SIM_HAVE_COMMON_SIM_CPU
-
#include "sim-basics.h"
#include "sim-base.h"
diff --git a/sim/bfin/sim-main.h b/sim/bfin/sim-main.h
index 48e54c8c8e1..a3855f3ded6 100644
--- a/sim/bfin/sim-main.h
+++ b/sim/bfin/sim-main.h
@@ -21,8 +21,6 @@
#ifndef _BFIN_MAIN_SIM_H_
#define _BFIN_MAIN_SIM_H_
-#define SIM_HAVE_COMMON_SIM_CPU
-
#include "sim-basics.h"
#include "arch.h"
#include "sim-base.h"
diff --git a/sim/bpf/sim-main.h b/sim/bpf/sim-main.h
index 5a29360e389..0de4d4125ae 100644
--- a/sim/bpf/sim-main.h
+++ b/sim/bpf/sim-main.h
@@ -19,8 +19,6 @@
#ifndef SIM_MAIN_H
#define SIM_MAIN_H
-#define SIM_HAVE_COMMON_SIM_CPU
-
#include "sim-basics.h"
#include "cgen-types.h"
#include "bpf-desc.h"
diff --git a/sim/common/sim-cpu.c b/sim/common/sim-cpu.c
index fa3e77abd35..1a912c6a7f8 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 e895664c2ef..83244e09c9e 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);
diff --git a/sim/cr16/sim-main.h b/sim/cr16/sim-main.h
index 7ac6bd2c0de..667db199ea1 100644
--- a/sim/cr16/sim-main.h
+++ b/sim/cr16/sim-main.h
@@ -19,8 +19,6 @@
#ifndef SIM_MAIN_H
#define SIM_MAIN_H
-#define SIM_HAVE_COMMON_SIM_CPU
-
#include "sim-basics.h"
typedef long int word;
diff --git a/sim/cris/sim-main.h b/sim/cris/sim-main.h
index f60c454ddc4..e946489cfc2 100644
--- a/sim/cris/sim-main.h
+++ b/sim/cris/sim-main.h
@@ -24,8 +24,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
#ifndef SIM_MAIN_H
#define SIM_MAIN_H
-#define SIM_HAVE_COMMON_SIM_CPU
-
/* This is a global setting. Different cpu families can't mix-n-match -scache
and -pbb. However some cpu families may use -simple while others use
one of -scache/-pbb. */
diff --git a/sim/d10v/sim-main.h b/sim/d10v/sim-main.h
index 5327e7ec3d0..3d7b7323183 100644
--- a/sim/d10v/sim-main.h
+++ b/sim/d10v/sim-main.h
@@ -19,8 +19,6 @@
#ifndef SIM_MAIN_H
#define SIM_MAIN_H
-#define SIM_HAVE_COMMON_SIM_CPU
-
#include "sim-basics.h"
typedef long int word;
diff --git a/sim/example-synacor/sim-main.h b/sim/example-synacor/sim-main.h
index 11566d2c6b9..258d61879cc 100644
--- a/sim/example-synacor/sim-main.h
+++ b/sim/example-synacor/sim-main.h
@@ -21,8 +21,6 @@
#ifndef SIM_MAIN_H
#define SIM_MAIN_H
-#define SIM_HAVE_COMMON_SIM_CPU
-
#include "sim-basics.h"
#include "sim-base.h"
diff --git a/sim/frv/sim-main.h b/sim/frv/sim-main.h
index 3e40bd52ab3..5fbf94d1f61 100644
--- a/sim/frv/sim-main.h
+++ b/sim/frv/sim-main.h
@@ -22,8 +22,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* Main header for the frv. */
-#define SIM_HAVE_COMMON_SIM_CPU
-
/* This is a global setting. Different cpu families can't mix-n-match -scache
and -pbb. However some cpu families may use -simple while others use
one of -scache/-pbb. ???? */
diff --git a/sim/ft32/sim-main.h b/sim/ft32/sim-main.h
index 3a002efd359..e160a12880d 100644
--- a/sim/ft32/sim-main.h
+++ b/sim/ft32/sim-main.h
@@ -21,8 +21,6 @@
#ifndef SIM_MAIN_H
#define SIM_MAIN_H
-#define SIM_HAVE_COMMON_SIM_CPU
-
#include "sim-basics.h"
#include "sim-base.h"
#include "bfd.h"
diff --git a/sim/h8300/sim-main.h b/sim/h8300/sim-main.h
index d0a04f5fa46..84bb346a9a9 100644
--- a/sim/h8300/sim-main.h
+++ b/sim/h8300/sim-main.h
@@ -5,8 +5,6 @@
#ifndef SIM_MAIN_H
#define SIM_MAIN_H
-#define SIM_HAVE_COMMON_SIM_CPU
-
#define DEBUG
/* These define the size of main memory for the simulator.
diff --git a/sim/iq2000/sim-main.h b/sim/iq2000/sim-main.h
index bb927fcf57c..ccc3fc877b9 100644
--- a/sim/iq2000/sim-main.h
+++ b/sim/iq2000/sim-main.h
@@ -4,8 +4,6 @@
#ifndef SIM_MAIN_H
#define SIM_MAIN_H
-#define SIM_HAVE_COMMON_SIM_CPU
-
/* This is a global setting. Different cpu families can't mix-n-match -scache
and -pbb. However some cpu families may use -simple while others use
one of -scache/-pbb. ???? */
diff --git a/sim/lm32/sim-main.h b/sim/lm32/sim-main.h
index 17c817cb1f6..6ae757f089b 100644
--- a/sim/lm32/sim-main.h
+++ b/sim/lm32/sim-main.h
@@ -23,8 +23,6 @@
#ifndef SIM_MAIN_H
#define SIM_MAIN_H
-#define SIM_HAVE_COMMON_SIM_CPU
-
#define WITH_SCACHE_PBB 1
#include "symcat.h"
diff --git a/sim/m32r/sim-main.h b/sim/m32r/sim-main.h
index fcde7feb61c..6d69ecf52a0 100644
--- a/sim/m32r/sim-main.h
+++ b/sim/m32r/sim-main.h
@@ -3,8 +3,6 @@
#ifndef SIM_MAIN_H
#define SIM_MAIN_H
-#define SIM_HAVE_COMMON_SIM_CPU
-
/* This is a global setting. Different cpu families can't mix-n-match -scache
and -pbb. However some cpu families may use -simple while others use
one of -scache/-pbb. */
diff --git a/sim/m68hc11/sim-main.h b/sim/m68hc11/sim-main.h
index 26293bc654f..e47bd83f9b9 100644
--- a/sim/m68hc11/sim-main.h
+++ b/sim/m68hc11/sim-main.h
@@ -20,8 +20,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
#ifndef _SIM_MAIN_H
#define _SIM_MAIN_H
-#define SIM_HAVE_COMMON_SIM_CPU
-
#include "sim-basics.h"
#include "sim-base.h"
diff --git a/sim/mcore/sim-main.h b/sim/mcore/sim-main.h
index 82a720b1e51..fc4625ba8ec 100644
--- a/sim/mcore/sim-main.h
+++ b/sim/mcore/sim-main.h
@@ -19,8 +19,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
#ifndef SIM_MAIN_H
#define SIM_MAIN_H
-#define SIM_HAVE_COMMON_SIM_CPU
-
#include "sim-basics.h"
typedef long int word;
diff --git a/sim/microblaze/sim-main.h b/sim/microblaze/sim-main.h
index df85a6f1e23..160f10156ff 100644
--- a/sim/microblaze/sim-main.h
+++ b/sim/microblaze/sim-main.h
@@ -18,8 +18,6 @@
#ifndef MICROBLAZE_SIM_MAIN
#define MICROBLAZE_SIM_MAIN
-#define SIM_HAVE_COMMON_SIM_CPU
-
#include "microblaze.h"
#include "sim-basics.h"
#include "sim-base.h"
diff --git a/sim/mips/sim-main.h b/sim/mips/sim-main.h
index d4e6a2f4a54..ea203c4a688 100644
--- a/sim/mips/sim-main.h
+++ b/sim/mips/sim-main.h
@@ -20,8 +20,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
#ifndef SIM_MAIN_H
#define SIM_MAIN_H
-#define SIM_HAVE_COMMON_SIM_CPU
-
#define SIM_CORE_SIGNAL(SD,CPU,CIA,MAP,NR_BYTES,ADDR,TRANSFER,ERROR) \
mips_core_signal ((SD), (CPU), (CIA), (MAP), (NR_BYTES), (ADDR), (TRANSFER), (ERROR))
diff --git a/sim/mn10300/sim-main.h b/sim/mn10300/sim-main.h
index 37e5ce011b5..77a7ba8ea0d 100644
--- a/sim/mn10300/sim-main.h
+++ b/sim/mn10300/sim-main.h
@@ -22,8 +22,6 @@
#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"
diff --git a/sim/moxie/sim-main.h b/sim/moxie/sim-main.h
index 7db12e01498..c4be80e39d2 100644
--- a/sim/moxie/sim-main.h
+++ b/sim/moxie/sim-main.h
@@ -20,8 +20,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
#ifndef SIM_MAIN_H
#define SIM_MAIN_H
-#define SIM_HAVE_COMMON_SIM_CPU
-
#include "sim-basics.h"
#include "sim-base.h"
#include "bfd.h"
diff --git a/sim/msp430/sim-main.h b/sim/msp430/sim-main.h
index 9d5a7b33072..5603d411df7 100644
--- a/sim/msp430/sim-main.h
+++ b/sim/msp430/sim-main.h
@@ -21,8 +21,6 @@
#ifndef _MSP430_MAIN_SIM_H_
#define _MSP430_MAIN_SIM_H_
-#define SIM_HAVE_COMMON_SIM_CPU
-
#include "sim-basics.h"
#include "msp430-sim.h"
#include "sim-base.h"
diff --git a/sim/or1k/sim-main.h b/sim/or1k/sim-main.h
index bf3558ddfef..1b6939dfbc9 100644
--- a/sim/or1k/sim-main.h
+++ b/sim/or1k/sim-main.h
@@ -19,8 +19,6 @@
#ifndef SIM_MAIN_H
#define SIM_MAIN_H
-#define SIM_HAVE_COMMON_SIM_CPU
-
#define WITH_SCACHE_PBB 1
#include "ansidecl.h"
diff --git a/sim/pru/sim-main.h b/sim/pru/sim-main.h
index a217eee576a..ada1e388627 100644
--- a/sim/pru/sim-main.h
+++ b/sim/pru/sim-main.h
@@ -19,8 +19,6 @@
#ifndef PRU_SIM_MAIN
#define PRU_SIM_MAIN
-#define SIM_HAVE_COMMON_SIM_CPU
-
#include <stdint.h>
#include <stddef.h>
#include "pru.h"
diff --git a/sim/riscv/sim-main.h b/sim/riscv/sim-main.h
index aeeb0ad788f..48ea452fb0b 100644
--- a/sim/riscv/sim-main.h
+++ b/sim/riscv/sim-main.h
@@ -21,8 +21,6 @@
#ifndef SIM_MAIN_H
#define SIM_MAIN_H
-#define SIM_HAVE_COMMON_SIM_CPU
-
#include "sim-basics.h"
#include "machs.h"
#include "sim-base.h"
diff --git a/sim/sh/sim-main.h b/sim/sh/sim-main.h
index 5504ad24109..6008b699712 100644
--- a/sim/sh/sim-main.h
+++ b/sim/sh/sim-main.h
@@ -19,8 +19,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
#ifndef SIM_MAIN_H
#define SIM_MAIN_H
-#define SIM_HAVE_COMMON_SIM_CPU
-
#include "sim-basics.h"
#include "sim-base.h"
diff --git a/sim/v850/sim-main.h b/sim/v850/sim-main.h
index 970a1486ea1..abf2ed78feb 100644
--- a/sim/v850/sim-main.h
+++ b/sim/v850/sim-main.h
@@ -1,8 +1,6 @@
#ifndef SIM_MAIN_H
#define SIM_MAIN_H
-#define SIM_HAVE_COMMON_SIM_CPU
-
/* The v850 has 32bit words, numbered 31 (MSB) to 0 (LSB) */
#define WITH_TARGET_WORD_MSB 31