summaryrefslogtreecommitdiff
path: root/sim/bfin
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/bfin
parent681eb80f1217f66c83dec4a3db83577a2a09f74a (diff)
downloadbinutils-gdb-6df01ab8ab8509b04f86d7da069ec2d25eb31bf9.tar.gz
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/bfin')
-rw-r--r--sim/bfin/ChangeLog13
-rw-r--r--sim/bfin/bfin-sim.c3
-rw-r--r--sim/bfin/devices.c3
-rw-r--r--sim/bfin/dv-bfin_cec.c3
-rw-r--r--sim/bfin/dv-bfin_ctimer.c3
-rw-r--r--sim/bfin/dv-bfin_dma.c3
-rw-r--r--sim/bfin/dv-bfin_dmac.c3
-rw-r--r--sim/bfin/dv-bfin_ebiu_amc.c3
-rw-r--r--sim/bfin/dv-bfin_ebiu_ddrc.c3
-rw-r--r--sim/bfin/dv-bfin_ebiu_sdc.c3
-rw-r--r--sim/bfin/dv-bfin_emac.c3
-rw-r--r--sim/bfin/dv-bfin_eppi.c3
-rw-r--r--sim/bfin/dv-bfin_evt.c3
-rw-r--r--sim/bfin/dv-bfin_gpio.c3
-rw-r--r--sim/bfin/dv-bfin_gpio2.c3
-rw-r--r--sim/bfin/dv-bfin_gptimer.c3
-rw-r--r--sim/bfin/dv-bfin_jtag.c3
-rw-r--r--sim/bfin/dv-bfin_mmu.c3
-rw-r--r--sim/bfin/dv-bfin_nfc.c3
-rw-r--r--sim/bfin/dv-bfin_otp.c3
-rw-r--r--sim/bfin/dv-bfin_pfmon.c3
-rw-r--r--sim/bfin/dv-bfin_pint.c3
-rw-r--r--sim/bfin/dv-bfin_pll.c3
-rw-r--r--sim/bfin/dv-bfin_ppi.c3
-rw-r--r--sim/bfin/dv-bfin_rtc.c3
-rw-r--r--sim/bfin/dv-bfin_sic.c3
-rw-r--r--sim/bfin/dv-bfin_spi.c3
-rw-r--r--sim/bfin/dv-bfin_trace.c3
-rw-r--r--sim/bfin/dv-bfin_twi.c3
-rw-r--r--sim/bfin/dv-bfin_uart.c3
-rw-r--r--sim/bfin/dv-bfin_uart2.c3
-rw-r--r--sim/bfin/dv-bfin_wdog.c3
-rw-r--r--sim/bfin/dv-bfin_wp.c3
-rw-r--r--sim/bfin/dv-eth_phy.c3
-rw-r--r--sim/bfin/gui.c3
-rw-r--r--sim/bfin/interp.c3
-rw-r--r--sim/bfin/machs.c3
37 files changed, 85 insertions, 36 deletions
diff --git a/sim/bfin/ChangeLog b/sim/bfin/ChangeLog
index 84e1dd34a55..c9b64b11f42 100644
--- a/sim/bfin/ChangeLog
+++ b/sim/bfin/ChangeLog
@@ -1,5 +1,18 @@
2021-05-16 Mike Frysinger <vapier@gentoo.org>
+ * bfin-sim.c, devices.c, dv-bfin_cec.c, dv-bfin_ctimer.c,
+ dv-bfin_dma.c, dv-bfin_dmac.c, dv-bfin_ebiu_amc.c,
+ dv-bfin_ebiu_ddrc.c, dv-bfin_ebiu_sdc.c, dv-bfin_emac.c,
+ dv-bfin_eppi.c, dv-bfin_evt.c, dv-bfin_gpio.c, dv-bfin_gpio2.c,
+ dv-bfin_gptimer.c, dv-bfin_jtag.c, dv-bfin_mmu.c, dv-bfin_nfc.c,
+ dv-bfin_otp.c, dv-bfin_pfmon.c, dv-bfin_pint.c, dv-bfin_pll.c,
+ dv-bfin_ppi.c, dv-bfin_rtc.c, dv-bfin_sic.c, dv-bfin_spi.c,
+ dv-bfin_trace.c, dv-bfin_twi.c, dv-bfin_uart.c, dv-bfin_uart2.c,
+ dv-bfin_wdog.c, dv-bfin_wp.c, dv-eth_phy.c, gui.c, interp.c,
+ machs.c: Replace config.h include with 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/bfin/bfin-sim.c b/sim/bfin/bfin-sim.c
index 33bbc6e4963..486fe4717ef 100644
--- a/sim/bfin/bfin-sim.c
+++ b/sim/bfin/bfin-sim.c
@@ -18,7 +18,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
#include <stdio.h>
#include <stdlib.h>
diff --git a/sim/bfin/devices.c b/sim/bfin/devices.c
index aadb9bcf1f4..97873f6f59e 100644
--- a/sim/bfin/devices.c
+++ b/sim/bfin/devices.c
@@ -18,7 +18,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
#include "sim-main.h"
#include "sim-hw.h"
diff --git a/sim/bfin/dv-bfin_cec.c b/sim/bfin/dv-bfin_cec.c
index 2236830d24d..6179b16ad8a 100644
--- a/sim/bfin/dv-bfin_cec.c
+++ b/sim/bfin/dv-bfin_cec.c
@@ -18,7 +18,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
#include "sim-main.h"
#include "devices.h"
diff --git a/sim/bfin/dv-bfin_ctimer.c b/sim/bfin/dv-bfin_ctimer.c
index beb4a0e76f8..df62d9487e6 100644
--- a/sim/bfin/dv-bfin_ctimer.c
+++ b/sim/bfin/dv-bfin_ctimer.c
@@ -18,7 +18,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
#include "sim-main.h"
#include "devices.h"
diff --git a/sim/bfin/dv-bfin_dma.c b/sim/bfin/dv-bfin_dma.c
index e3834d76143..d7dc541dd8c 100644
--- a/sim/bfin/dv-bfin_dma.c
+++ b/sim/bfin/dv-bfin_dma.c
@@ -18,7 +18,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
#include <stdlib.h>
diff --git a/sim/bfin/dv-bfin_dmac.c b/sim/bfin/dv-bfin_dmac.c
index ae720cb8b61..d5c608f4cd9 100644
--- a/sim/bfin/dv-bfin_dmac.c
+++ b/sim/bfin/dv-bfin_dmac.c
@@ -18,7 +18,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
#include "sim-main.h"
#include "sim-hw.h"
diff --git a/sim/bfin/dv-bfin_ebiu_amc.c b/sim/bfin/dv-bfin_ebiu_amc.c
index 67f557d29b2..29c4c4a5a9f 100644
--- a/sim/bfin/dv-bfin_ebiu_amc.c
+++ b/sim/bfin/dv-bfin_ebiu_amc.c
@@ -19,7 +19,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
#include "sim-main.h"
#include "devices.h"
diff --git a/sim/bfin/dv-bfin_ebiu_ddrc.c b/sim/bfin/dv-bfin_ebiu_ddrc.c
index 4206c253778..4160cb210e5 100644
--- a/sim/bfin/dv-bfin_ebiu_ddrc.c
+++ b/sim/bfin/dv-bfin_ebiu_ddrc.c
@@ -18,7 +18,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
#include "sim-main.h"
#include "devices.h"
diff --git a/sim/bfin/dv-bfin_ebiu_sdc.c b/sim/bfin/dv-bfin_ebiu_sdc.c
index d542f02c082..4af04dcdac4 100644
--- a/sim/bfin/dv-bfin_ebiu_sdc.c
+++ b/sim/bfin/dv-bfin_ebiu_sdc.c
@@ -18,7 +18,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
#include "sim-main.h"
#include "devices.h"
diff --git a/sim/bfin/dv-bfin_emac.c b/sim/bfin/dv-bfin_emac.c
index 249aef6b9d3..e5ceedbef51 100644
--- a/sim/bfin/dv-bfin_emac.c
+++ b/sim/bfin/dv-bfin_emac.c
@@ -18,7 +18,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
#include <errno.h>
#include <fcntl.h>
diff --git a/sim/bfin/dv-bfin_eppi.c b/sim/bfin/dv-bfin_eppi.c
index ad36a943f20..169895d3dd4 100644
--- a/sim/bfin/dv-bfin_eppi.c
+++ b/sim/bfin/dv-bfin_eppi.c
@@ -19,7 +19,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
#include "sim-main.h"
#include "devices.h"
diff --git a/sim/bfin/dv-bfin_evt.c b/sim/bfin/dv-bfin_evt.c
index c4cf691da92..e49f4804fe6 100644
--- a/sim/bfin/dv-bfin_evt.c
+++ b/sim/bfin/dv-bfin_evt.c
@@ -18,7 +18,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
#include "sim-main.h"
#include "devices.h"
diff --git a/sim/bfin/dv-bfin_gpio.c b/sim/bfin/dv-bfin_gpio.c
index 2830aa3847f..bbcc54f0fb5 100644
--- a/sim/bfin/dv-bfin_gpio.c
+++ b/sim/bfin/dv-bfin_gpio.c
@@ -18,7 +18,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
#include "sim-main.h"
#include "devices.h"
diff --git a/sim/bfin/dv-bfin_gpio2.c b/sim/bfin/dv-bfin_gpio2.c
index 2933ad15b86..61c99802c13 100644
--- a/sim/bfin/dv-bfin_gpio2.c
+++ b/sim/bfin/dv-bfin_gpio2.c
@@ -19,7 +19,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
#include "sim-main.h"
#include "devices.h"
diff --git a/sim/bfin/dv-bfin_gptimer.c b/sim/bfin/dv-bfin_gptimer.c
index 8f2b476eeb6..3dfa2b58e91 100644
--- a/sim/bfin/dv-bfin_gptimer.c
+++ b/sim/bfin/dv-bfin_gptimer.c
@@ -18,7 +18,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
#include "sim-main.h"
#include "devices.h"
diff --git a/sim/bfin/dv-bfin_jtag.c b/sim/bfin/dv-bfin_jtag.c
index d97b9eac822..12629970cc8 100644
--- a/sim/bfin/dv-bfin_jtag.c
+++ b/sim/bfin/dv-bfin_jtag.c
@@ -18,7 +18,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
#include "sim-main.h"
#include "devices.h"
diff --git a/sim/bfin/dv-bfin_mmu.c b/sim/bfin/dv-bfin_mmu.c
index cbaaaa2cae1..cadc9df552e 100644
--- a/sim/bfin/dv-bfin_mmu.c
+++ b/sim/bfin/dv-bfin_mmu.c
@@ -18,7 +18,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
#include "sim-main.h"
#include "sim-options.h"
diff --git a/sim/bfin/dv-bfin_nfc.c b/sim/bfin/dv-bfin_nfc.c
index a26cb139903..80fe49da72c 100644
--- a/sim/bfin/dv-bfin_nfc.c
+++ b/sim/bfin/dv-bfin_nfc.c
@@ -18,7 +18,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
#include "sim-main.h"
#include "devices.h"
diff --git a/sim/bfin/dv-bfin_otp.c b/sim/bfin/dv-bfin_otp.c
index e11e04e9672..6cf1c8155c6 100644
--- a/sim/bfin/dv-bfin_otp.c
+++ b/sim/bfin/dv-bfin_otp.c
@@ -18,7 +18,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
#include "sim-main.h"
#include "devices.h"
diff --git a/sim/bfin/dv-bfin_pfmon.c b/sim/bfin/dv-bfin_pfmon.c
index 2216c064569..bffe67b18a0 100644
--- a/sim/bfin/dv-bfin_pfmon.c
+++ b/sim/bfin/dv-bfin_pfmon.c
@@ -18,7 +18,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
#include "sim-main.h"
#include "devices.h"
diff --git a/sim/bfin/dv-bfin_pint.c b/sim/bfin/dv-bfin_pint.c
index 90b3190c025..b4f4f40ab65 100644
--- a/sim/bfin/dv-bfin_pint.c
+++ b/sim/bfin/dv-bfin_pint.c
@@ -18,7 +18,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
#include "sim-main.h"
#include "devices.h"
diff --git a/sim/bfin/dv-bfin_pll.c b/sim/bfin/dv-bfin_pll.c
index 5ba1a6afafc..e2a5f5cd55c 100644
--- a/sim/bfin/dv-bfin_pll.c
+++ b/sim/bfin/dv-bfin_pll.c
@@ -18,7 +18,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
#include "sim-main.h"
#include "machs.h"
diff --git a/sim/bfin/dv-bfin_ppi.c b/sim/bfin/dv-bfin_ppi.c
index e319df91440..a67dc5eecb0 100644
--- a/sim/bfin/dv-bfin_ppi.c
+++ b/sim/bfin/dv-bfin_ppi.c
@@ -19,7 +19,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
#include "sim-main.h"
#include "devices.h"
diff --git a/sim/bfin/dv-bfin_rtc.c b/sim/bfin/dv-bfin_rtc.c
index 5486ac8287f..06ae4249d6e 100644
--- a/sim/bfin/dv-bfin_rtc.c
+++ b/sim/bfin/dv-bfin_rtc.c
@@ -18,7 +18,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
#include <time.h>
#include "sim-main.h"
diff --git a/sim/bfin/dv-bfin_sic.c b/sim/bfin/dv-bfin_sic.c
index 94e55f21eea..cc90a4cf22a 100644
--- a/sim/bfin/dv-bfin_sic.c
+++ b/sim/bfin/dv-bfin_sic.c
@@ -18,7 +18,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
#include "sim-main.h"
#include "devices.h"
diff --git a/sim/bfin/dv-bfin_spi.c b/sim/bfin/dv-bfin_spi.c
index 8fdd9dbc514..c0869fcf77c 100644
--- a/sim/bfin/dv-bfin_spi.c
+++ b/sim/bfin/dv-bfin_spi.c
@@ -18,7 +18,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
#include "sim-main.h"
#include "devices.h"
diff --git a/sim/bfin/dv-bfin_trace.c b/sim/bfin/dv-bfin_trace.c
index ab8220f7a19..56fad63cd3e 100644
--- a/sim/bfin/dv-bfin_trace.c
+++ b/sim/bfin/dv-bfin_trace.c
@@ -18,7 +18,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
#include "sim-main.h"
#include "devices.h"
diff --git a/sim/bfin/dv-bfin_twi.c b/sim/bfin/dv-bfin_twi.c
index 87794f53852..00b080f122c 100644
--- a/sim/bfin/dv-bfin_twi.c
+++ b/sim/bfin/dv-bfin_twi.c
@@ -18,7 +18,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
#include "sim-main.h"
#include "devices.h"
diff --git a/sim/bfin/dv-bfin_uart.c b/sim/bfin/dv-bfin_uart.c
index d0136217502..7aa843065b8 100644
--- a/sim/bfin/dv-bfin_uart.c
+++ b/sim/bfin/dv-bfin_uart.c
@@ -19,7 +19,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
#include "sim-main.h"
#include "dv-sockser.h"
diff --git a/sim/bfin/dv-bfin_uart2.c b/sim/bfin/dv-bfin_uart2.c
index 2fd540164dc..a7985889f87 100644
--- a/sim/bfin/dv-bfin_uart2.c
+++ b/sim/bfin/dv-bfin_uart2.c
@@ -19,7 +19,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
#include "sim-main.h"
#include "devices.h"
diff --git a/sim/bfin/dv-bfin_wdog.c b/sim/bfin/dv-bfin_wdog.c
index 4be19aa6458..850ae0618df 100644
--- a/sim/bfin/dv-bfin_wdog.c
+++ b/sim/bfin/dv-bfin_wdog.c
@@ -18,7 +18,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
#include "sim-main.h"
#include "dv-sockser.h"
diff --git a/sim/bfin/dv-bfin_wp.c b/sim/bfin/dv-bfin_wp.c
index 28626a569f8..189c121d97a 100644
--- a/sim/bfin/dv-bfin_wp.c
+++ b/sim/bfin/dv-bfin_wp.c
@@ -18,7 +18,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
#include "sim-main.h"
#include "devices.h"
diff --git a/sim/bfin/dv-eth_phy.c b/sim/bfin/dv-eth_phy.c
index 14aafee9192..486054277c2 100644
--- a/sim/bfin/dv-eth_phy.c
+++ b/sim/bfin/dv-eth_phy.c
@@ -18,7 +18,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
#include "sim-main.h"
#include "devices.h"
diff --git a/sim/bfin/gui.c b/sim/bfin/gui.c
index 029a22ef3b5..8e84d2dff96 100644
--- a/sim/bfin/gui.c
+++ b/sim/bfin/gui.c
@@ -18,7 +18,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
#ifdef HAVE_SDL
# include <SDL.h>
diff --git a/sim/bfin/interp.c b/sim/bfin/interp.c
index aa5c245c829..8e3a1214b78 100644
--- a/sim/bfin/interp.c
+++ b/sim/bfin/interp.c
@@ -18,7 +18,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
#include <stdio.h>
#include <stdlib.h>
diff --git a/sim/bfin/machs.c b/sim/bfin/machs.c
index a2060e8d898..e94af5d0f5b 100644
--- a/sim/bfin/machs.c
+++ b/sim/bfin/machs.c
@@ -18,7 +18,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "config.h"
+/* This must come before any other includes. */
+#include "defs.h"
#include <stdlib.h>