Wed Sep 3 10:18:55 1997 Andrew Cagney <cagney@b1.cygnus.com>
+ * sim-main.h: Replace SIM_HAVE_FLATMEM with mem ptr.
+ * interp.c (map): Do not add to a void pointer.
+
+ * Makefile.in (INCLUDE): Add sim-main.h
+
+ * configure.in: Check for time.h
+ * configure: Re-generate.
+
+ * interp.c (struct interrupt_generator): Make time unsigned long,
+ address SIM_ADDR.
+ (sim_resume): Make oldpc SIM_ADDR.
+ (struct hash_entry): Make mask/opcode unsigned.
+
+ * v850_sim.h (struct simops ): Make opcode and mask unsigned.
+
* simops.c (utime.h): Include if available.
(OP_10007E0): Check for UTIME function.
(divun): Put parentheses around shift argument.
chmod
else
echo "$ac_t""no" 1>&6
+utime
fi
done
-for ac_hdr in unistd.h
+for ac_hdr in unistd.h stdlib.h string.h strings.h utime.h time.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1523: checking for $ac_hdr" >&5
+echo "configure:1524: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1528 "configure"
+#line 1529 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1533: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1534: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
enum interrupt_type type;
enum interrupt_cond_type cond_type;
int number;
- int address;
- int time;
+ SIM_ADDR address;
+ unsigned long time;
int enabled;
struct interrupt_generator *next;
};
struct hash_entry
{
struct hash_entry *next;
- long opcode;
- long mask;
+ unsigned long opcode;
+ unsigned long mask;
struct simops *ops;
};
{
/* "Mirror" the addresses below 1MB. */
addr = addr & (simulator->rom_size - 1);
- return (uint8 *) (addr + STATE_MEMORY (simulator));
+ return (uint8 *) (simulator->mem) + addr;
}
else if (addr < simulator->low_end)
{
/* chunk is just after the rom */
addr = addr - 0x100000 + simulator->rom_size;
- return (uint8 *) (addr + STATE_MEMORY (simulator));
+ return (uint8 *) (simulator->mem) + addr;
}
else if (addr >= simulator->high_start)
{
else if (addr >= 0xffe000)
addr &= 0xffe3ff;
addr = addr - simulator->high_start + simulator->high_base;
- return (uint8 *) (STATE_MEMORY (simulator));
+ return (uint8 *) (simulator->mem) + addr;
}
else
{
{
int totsize;
- if (STATE_MEMORY (sd))
- zfree (STATE_MEMORY (sd));
+ if (sd->mem)
+ zfree (sd->mem);
totsize = (simulator->rom_size
+ (sd->low_end - 0x100000)
sd->high_base = sd->rom_size + (sd->low_end - 0x100000);
- STATE_MEMORY (sd) = zalloc (totsize);
- if (!STATE_MEMORY (sd))
+ sd->mem = zalloc (totsize);
+ if (!sd->mem)
{
sim_io_error (sd, "Allocation of main memory failed.");
}
{
SIM_ELAPSED_TIME start_time;
uint32 inst;
- reg_t oldpc;
+ SIM_ADDR oldpc;
struct interrupt_generator *intgen;
if (step)
intgen->enabled = 1;
intgen->next = intgen_list;
intgen_list = intgen;
- sim_io_printf (sd, "Interrupt generator %d (NMI) at pc=0x%x, time=%d.\n", intgen_list->number, intgen_list->address, intgen_list->time);
+ sim_io_printf (sd, "Interrupt generator %d (NMI) at pc=0x%x, time=%ld.\n", intgen_list->number, intgen_list->address, intgen_list->time);
}
else if (*argv && !strcmp (*argv, "remove"))
{
if (intgen_list)
{
for (intgen = intgen_list; intgen != NULL; intgen = intgen->next)
- sim_io_printf (sd, "Interrupt generator %d (%s) at pc=0x%x/time=%d%s.\n",
+ sim_io_printf (sd, "Interrupt generator %d (%s) at pc=0x%lx/time=%ld%s.\n",
intgen->number,
interrupt_names[intgen->type],
- intgen->address,
+ (long) intgen->address,
intgen->time,
(intgen->enabled ? "" : " (disabled)"));
}