aboutsummaryrefslogtreecommitdiff
path: root/sim/mips
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2021-05-01 18:05:23 -0400
committerMike Frysinger <vapier@gentoo.org>2021-05-16 22:38:41 -0400
commit6df01ab8ab8509b04f86d7da069ec2d25eb31bf9 (patch)
tree21a00924bc74b7d5ec239a133d223f9d52f1dd67 /sim/mips
parent681eb80f1217f66c83dec4a3db83577a2a09f74a (diff)
downloadgdb-6df01ab8ab8509b04f86d7da069ec2d25eb31bf9.zip
gdb-6df01ab8ab8509b04f86d7da069ec2d25eb31bf9.tar.gz
gdb-6df01ab8ab8509b04f86d7da069ec2d25eb31bf9.tar.bz2
sim: switch config.h usage to defs.h
The defs.h header will take care of including the various config.h headers. For now, it's just config.h, but we'll add more when we integrate gnulib in. This header should be used instead of config.h, and should be the first include in every .c file. We won't rely on the old behavior where we expected files to include the port's sim-main.h which then includes the common sim-basics.h which then includes config.h. We have a ton of code that includes things before sim-main.h, and it sometimes needs to be that way. Creating a dedicated header avoids the ordering mess and implicit inclusion that shows up otherwise.
Diffstat (limited to 'sim/mips')
-rw-r--r--sim/mips/ChangeLog7
-rw-r--r--sim/mips/cp1.c3
-rw-r--r--sim/mips/dsp.c3
-rw-r--r--sim/mips/dv-tx3904cpu.c2
-rw-r--r--sim/mips/dv-tx3904irc.c2
-rw-r--r--sim/mips/dv-tx3904sio.c2
-rw-r--r--sim/mips/dv-tx3904tmr.c2
-rw-r--r--sim/mips/interp.c7
-rw-r--r--sim/mips/m16run.c3
-rw-r--r--sim/mips/mdmx.c3
-rw-r--r--sim/mips/micromipsrun.c3
-rw-r--r--sim/mips/sim-main.c3
12 files changed, 36 insertions, 4 deletions
diff --git a/sim/mips/ChangeLog b/sim/mips/ChangeLog
index 76134b7..68c2503 100644
--- a/sim/mips/ChangeLog
+++ b/sim/mips/ChangeLog
@@ -1,5 +1,12 @@
2021-05-16 Mike Frysinger <vapier@gentoo.org>
+ * interp.c: Replace config.h include with defs.h.
+ * cp1.c, dsp.c, dv-tx3904cpu.c, dv-tx3904irc.c, dv-tx3904sio.c,
+ dv-tx3904tmr.c, m16run.c, mdmx.c, micromipsrun.c, sim-main.c:
+ Include defs.h.
+
+2021-05-16 Mike Frysinger <vapier@gentoo.org>
+
* config.in, configure: Regenerate.
2021-05-14 Mike Frysinger <vapier@gentoo.org>
diff --git a/sim/mips/cp1.c b/sim/mips/cp1.c
index f5d3d1d..03ed0c0 100644
--- a/sim/mips/cp1.c
+++ b/sim/mips/cp1.c
@@ -40,6 +40,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
(Originally, this code was in interp.c)
*/
+/* This must come before any other includes. */
+#include "defs.h"
+
#include "sim-main.h"
#include <stdlib.h>
diff --git a/sim/mips/dsp.c b/sim/mips/dsp.c
index b82ff68..fb25caa 100644
--- a/sim/mips/dsp.c
+++ b/sim/mips/dsp.c
@@ -17,6 +17,9 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
+
#include "sim-main.h"
int DSPLO_REGNUM[4] =
diff --git a/sim/mips/dv-tx3904cpu.c b/sim/mips/dv-tx3904cpu.c
index bf23a06..43f38d2 100644
--- a/sim/mips/dv-tx3904cpu.c
+++ b/sim/mips/dv-tx3904cpu.c
@@ -18,6 +18,8 @@
*/
+/* This must come before any other includes. */
+#include "defs.h"
#include "sim-main.h"
#include "hw-main.h"
diff --git a/sim/mips/dv-tx3904irc.c b/sim/mips/dv-tx3904irc.c
index d9a9197..0896b0f 100644
--- a/sim/mips/dv-tx3904irc.c
+++ b/sim/mips/dv-tx3904irc.c
@@ -18,6 +18,8 @@
*/
+/* This must come before any other includes. */
+#include "defs.h"
#include "sim-main.h"
#include "hw-main.h"
diff --git a/sim/mips/dv-tx3904sio.c b/sim/mips/dv-tx3904sio.c
index 9676344..c81b2dd 100644
--- a/sim/mips/dv-tx3904sio.c
+++ b/sim/mips/dv-tx3904sio.c
@@ -18,6 +18,8 @@
*/
+/* This must come before any other includes. */
+#include "defs.h"
#include "sim-main.h"
#include "hw-main.h"
diff --git a/sim/mips/dv-tx3904tmr.c b/sim/mips/dv-tx3904tmr.c
index 48b169f..5b5d8ac 100644
--- a/sim/mips/dv-tx3904tmr.c
+++ b/sim/mips/dv-tx3904tmr.c
@@ -18,6 +18,8 @@
*/
+/* This must come before any other includes. */
+#include "defs.h"
#include "sim-main.h"
#include "hw-main.h"
diff --git a/sim/mips/interp.c b/sim/mips/interp.c
index 49b79f9..25eb497 100644
--- a/sim/mips/interp.c
+++ b/sim/mips/interp.c
@@ -22,7 +22,9 @@ code on the hardware.
*/
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
+
#include "bfd.h"
#include "sim-main.h"
#include "sim-utils.h"
@@ -32,9 +34,6 @@ code on the hardware.
#include "itable.h"
-
-#include "config.h"
-
#include <stdio.h>
#include <stdarg.h>
#include <ansidecl.h>
diff --git a/sim/mips/m16run.c b/sim/mips/m16run.c
index 44fb9e4..a04e3ee 100644
--- a/sim/mips/m16run.c
+++ b/sim/mips/m16run.c
@@ -17,6 +17,9 @@
*/
+/* This must come before any other includes. */
+#include "defs.h"
+
#include "sim-main.h"
#include "m16_idecode.h"
#include "m32_idecode.h"
diff --git a/sim/mips/mdmx.c b/sim/mips/mdmx.c
index 948bb0d..6978251 100644
--- a/sim/mips/mdmx.c
+++ b/sim/mips/mdmx.c
@@ -18,6 +18,9 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
+
#include <stdio.h>
#include "sim-main.h"
diff --git a/sim/mips/micromipsrun.c b/sim/mips/micromipsrun.c
index 3950dc2..53a5c08 100644
--- a/sim/mips/micromipsrun.c
+++ b/sim/mips/micromipsrun.c
@@ -19,6 +19,9 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+/* This must come before any other includes. */
+#include "defs.h"
+
#include "sim-main.h"
#include "micromips16_idecode.h"
#include "micromips32_idecode.h"
diff --git a/sim/mips/sim-main.c b/sim/mips/sim-main.c
index 620f4b2..24e1602 100644
--- a/sim/mips/sim-main.c
+++ b/sim/mips/sim-main.c
@@ -19,6 +19,9 @@
#ifndef SIM_MAIN_C
#define SIM_MAIN_C
+/* This must come before any other includes. */
+#include "defs.h"
+
#include "sim-main.h"
#include "sim-assert.h"