/* interp.c -- Simulator for Motorola 68HC11/68HC12
- Copyright (C) 1999-2020 Free Software Foundation, Inc.
+ Copyright (C) 1999-2021 Free Software Foundation, Inc.
Written by Stephane Carrez (stcarrez@nerim.fr)
This file is part of GDB, the GNU debugger.
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 "sim-assert.h"
#include "sim-hw.h"
sim_io_eprintf (sd, "Valid devices: cpu timer sio eeprom\n");
return;
}
- hw_dev = sim_hw_parse (sd, dev_list[i].device);
+ hw_dev = sim_hw_parse (sd, "%s", dev_list[i].device);
if (hw_dev == 0)
{
sim_io_eprintf (sd, "Device '%s' not found\n", dev_list[i].device);
cpu_type = "/m68hc12";
}
- hw_cpu = sim_hw_parse (sd, cpu_type);
+ hw_cpu = sim_hw_parse (sd, "%s", cpu_type);
if (hw_cpu == 0)
{
sim_io_eprintf (sd, "%s cpu not found in device tree.", cpu_type);
/* Allocate core managed memory */
/* the monitor */
- sim_do_commandf (sd, "memory region 0x%lx@%d,0x%lx",
+ sim_do_commandf (sd, "memory region 0x%x@%d,0x%x",
/* MONITOR_BASE, MONITOR_SIZE */
0x8000, M6811_RAM_LEVEL, 0x8000);
sim_do_commandf (sd, "memory region 0x000@%d,0x8000",
sim_hw_parse (sd, "/m68hc11/reg 0x1000 0x03F");
if (cpu->bank_start < cpu->bank_end)
{
- sim_do_commandf (sd, "memory region 0x%lx@%d,0x100000",
+ sim_do_commandf (sd, "memory region 0x%x@%d,0x100000",
cpu->bank_virtual, M6811_RAM_LEVEL);
sim_hw_parse (sd, "/m68hc11/use_bank 1");
}
if (hw_tree_find_property (device_tree, "/m68hc12/reg") == 0)
{
/* Allocate core external memory. */
- sim_do_commandf (sd, "memory region 0x%lx@%d,0x%lx",
+ sim_do_commandf (sd, "memory region 0x%x@%d,0x%x",
0x8000, M6811_RAM_LEVEL, 0x8000);
sim_do_commandf (sd, "memory region 0x000@%d,0x8000",
M6811_RAM_LEVEL);
if (cpu->bank_start < cpu->bank_end)
{
- sim_do_commandf (sd, "memory region 0x%lx@%d,0x100000",
+ sim_do_commandf (sd, "memory region 0x%x@%d,0x100000",
cpu->bank_virtual, M6811_RAM_LEVEL);
sim_hw_parse (sd, "/m68hc12/use_bank 1");
}
SIM_ASSERT (STATE_MAGIC (sd) == SIM_MAGIC_NUMBER);
+ /* Set default options before parsing user options. */
+ current_target_byte_order = BFD_ENDIAN_BIG;
+
/* The cpu data is kept in a separately allocated chunk of memory. */
- if (sim_cpu_alloc_all (sd, 1, /*cgen_cpu_max_extra_bytes ()*/0) != SIM_RC_OK)
+ if (sim_cpu_alloc_all (sd, 1) != SIM_RC_OK)
{
free_state (sd);
return 0;