aboutsummaryrefslogtreecommitdiff
path: root/sim/v850
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>1997-04-17 06:05:19 +0000
committerAndrew Cagney <cagney@redhat.com>1997-04-17 06:05:19 +0000
commit87e43259f1f31bb1de748139bb56161d99c44962 (patch)
tree99bef4aecfba88423d2801356e731c186b14e94b /sim/v850
parenta895901a15f2a103b51052cb1884ada96fd88690 (diff)
downloadgdb-87e43259f1f31bb1de748139bb56161d99c44962.zip
gdb-87e43259f1f31bb1de748139bb56161d99c44962.tar.gz
gdb-87e43259f1f31bb1de748139bb56161d99c44962.tar.bz2
Cleanups to compile under FreeBSD
Diffstat (limited to 'sim/v850')
-rw-r--r--sim/v850/ChangeLog10
-rw-r--r--sim/v850/simops.c27
2 files changed, 27 insertions, 10 deletions
diff --git a/sim/v850/ChangeLog b/sim/v850/ChangeLog
index 316c7ad..79e5593 100644
--- a/sim/v850/ChangeLog
+++ b/sim/v850/ChangeLog
@@ -1,3 +1,13 @@
+Wed Apr 16 19:53:55 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * simops.c (OP_10007E0): Only provide system calls SYS_execv,
+ SYS_wait, SYS_wait, SYS_utime, SYS_time if defined by the host.
+
+Mon Apr 7 15:45:02 1997 Andrew Cagney <cagney@kremvax.cygnus.com>
+
+ * configure: Regenerated to track ../common/aclocal.m4 changes.
+ * config.in: Ditto.
+
Wed Apr 2 15:06:28 1997 Doug Evans <dje@canuck.cygnus.com>
* interp.c (sim_open): New arg `kind'.
diff --git a/sim/v850/simops.c b/sim/v850/simops.c
index e044c46..101741a 100644
--- a/sim/v850/simops.c
+++ b/sim/v850/simops.c
@@ -1,17 +1,14 @@
-#include "config.h"
-
#include <signal.h>
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
#include "v850_sim.h"
#include "simops.h"
#include "sys/syscall.h"
#include "bfd.h"
#include <errno.h>
+#if !defined(__GO32__) && !defined(_WIN32)
#include <sys/stat.h>
#include <sys/times.h>
#include <sys/time.h>
+#endif
enum op_types {
OP_UNKNOWN,
@@ -1077,8 +1074,8 @@ void
OP_E0 ()
{
trace_input ("mulh", OP_REG_REG, 0);
- State.regs[OP[1]] = ((State.regs[OP[1]] & 0xffff)
- * (State.regs[OP[0]] & 0xffff));
+ State.regs[OP[1]] = (SEXT16 (State.regs[OP[1]])
+ * SEXT16 (State.regs[OP[0]]));
trace_output (OP_REG_REG);
}
@@ -1091,7 +1088,7 @@ OP_2E0 ()
int value = SEXT5 (OP[0]);
trace_input ("mulh", OP_IMM_REG, 0);
- State.regs[OP[1]] = (State.regs[OP[1]] & 0xffff) * value;
+ State.regs[OP[1]] = SEXT16 (State.regs[OP[1]]) * value;
trace_output (OP_IMM_REG);
}
@@ -1099,10 +1096,10 @@ OP_2E0 ()
void
OP_6E0 ()
{
- int value = OP[0] & 0xffff;
+ int value = SEXT16 (OP[0]);
trace_input ("mulhi", OP_IMM_REG_REG, 0);
- State.regs[OP[2]] = (State.regs[OP[1]] & 0xffff) * value;
+ State.regs[OP[2]] = SEXT16 (State.regs[OP[1]]) * value;
trace_output (OP_IMM_REG_REG);
}
@@ -2003,9 +2000,11 @@ OP_10007E0 ()
RETVAL = execve (MEMPTR (PARM1), (char **) MEMPTR (PARM2),
(char **)MEMPTR (PARM3));
break;
+#ifdef SYS_execv
case SYS_execv:
RETVAL = execve (MEMPTR (PARM1), (char **) MEMPTR (PARM2), NULL);
break;
+#endif
#if 0
case SYS_pipe:
{
@@ -2061,6 +2060,7 @@ OP_10007E0 ()
State.exception = SIG_V850_EXIT; /* PARM1 has exit status encoded */
break;
+#if !defined(__GO32__) && !defined(_WIN32)
case SYS_stat: /* added at hmsi */
/* stat system call */
{
@@ -2092,6 +2092,7 @@ OP_10007E0 ()
case SYS_chmod:
RETVAL = chmod (MEMPTR (PARM1), PARM2);
break;
+#ifdef SYS_time
case SYS_time:
{
time_t now;
@@ -2099,6 +2100,8 @@ OP_10007E0 ()
store_mem (PARM1, 4, now);
}
break;
+#endif
+#ifdef SYS_times
case SYS_times:
{
struct tms tms;
@@ -2109,6 +2112,7 @@ OP_10007E0 ()
store_mem (PARM1 + 12, 4, tms.tms_cstime);
break;
}
+#endif
case SYS_gettimeofday:
{
struct timeval t;
@@ -2120,11 +2124,14 @@ OP_10007E0 ()
store_mem (PARM2 + 4, 4, tz.tz_dsttime);
break;
}
+#ifdef SYS_utime
case SYS_utime:
/* Cast the second argument to void *, to avoid type mismatch
if a prototype is present. */
RETVAL = utime (MEMPTR (PARM1), (void *) MEMPTR (PARM2));
break;
+#endif
+#endif
default:
abort ();
}