aboutsummaryrefslogtreecommitdiff
path: root/sim
diff options
context:
space:
mode:
authorMark Alexander <marka@cygnus>1998-02-24 05:07:11 +0000
committerMark Alexander <marka@cygnus>1998-02-24 05:07:11 +0000
commita9faef120ed530b3f327c91b22667e0768e43558 (patch)
treecaa9bfea9e1c428ee6c44f8e6214332982dbea77 /sim
parent845a5917855ebe14a25bc4676d66e5024ab25e06 (diff)
downloadgdb-a9faef120ed530b3f327c91b22667e0768e43558.zip
gdb-a9faef120ed530b3f327c91b22667e0768e43558.tar.gz
gdb-a9faef120ed530b3f327c91b22667e0768e43558.tar.bz2
* Makefile.in: Last change was bad. Define NL_TARGET
so that targ-vals.h will be used instead of syscall.h. * simops.c: Use targ-vals.h instead of syscall.h. (OP_F020): Disable unsupported system calls.
Diffstat (limited to 'sim')
-rw-r--r--sim/mn10300/ChangeLog7
-rw-r--r--sim/mn10300/Makefile.in4
-rw-r--r--sim/mn10300/simops.c52
3 files changed, 40 insertions, 23 deletions
diff --git a/sim/mn10300/ChangeLog b/sim/mn10300/ChangeLog
index fd20455..ad4abf2 100644
--- a/sim/mn10300/ChangeLog
+++ b/sim/mn10300/ChangeLog
@@ -1,3 +1,10 @@
+Mon Feb 23 20:23:19 1998 Mark Alexander <marka@cygnus.com>
+
+ * Makefile.in: Last change was bad. Define NL_TARGET
+ so that targ-vals.h will be used instead of syscall.h.
+ * simops.c: Use targ-vals.h instead of syscall.h.
+ (OP_F020): Disable unsupported system calls.
+
Mon Feb 23 09:44:38 1998 Mark Alexander <marka@cygnus.com>
* Makefile.in: Get header files from libgloss/mn10300/sys.
diff --git a/sim/mn10300/Makefile.in b/sim/mn10300/Makefile.in
index 50d96e0..34c12bf 100644
--- a/sim/mn10300/Makefile.in
+++ b/sim/mn10300/Makefile.in
@@ -19,9 +19,11 @@
## COMMON_PRE_CONFIG_FRAG
SIM_OBJS = interp.o table.o simops.o sim-load.o
-SIM_EXTRA_CFLAGS = -I$(srcdir)/../../libgloss/mn10300/sys
SIM_EXTRA_CLEAN = clean-extra
+# This selects the m32r newlib/libgloss syscall definitions.
+NL_TARGET = -DNL_TARGET_mn10300
+
INCLUDE = mn10300_sim.h $(srcdir)/../../include/callback.h
## COMMON_POST_CONFIG_FRAG
diff --git a/sim/mn10300/simops.c b/sim/mn10300/simops.c
index 438258b..efed7dc 100644
--- a/sim/mn10300/simops.c
+++ b/sim/mn10300/simops.c
@@ -7,7 +7,7 @@
#include "mn10300_sim.h"
#include "simops.h"
#include "sim-types.h"
-#include "sys/syscall.h"
+#include "targ-vals.h"
#include "bfd.h"
#include <errno.h>
#include <sys/stat.h>
@@ -2899,38 +2899,42 @@ void OP_F020 (insn, extension)
switch (FUNC)
{
#if !defined(__GO32__) && !defined(_WIN32)
- case SYS_fork:
+#ifdef TARGET_SYS_fork
+ case TARGET_SYS_fork:
RETVAL = fork ();
break;
- case SYS_execve:
+#endif
+#ifdef TARGET_SYS_execve
+ case TARGET_SYS_execve:
RETVAL = execve (MEMPTR (PARM1), (char **) MEMPTR (PARM2),
(char **)MEMPTR (PARM3));
break;
-#ifdef SYS_execv
- case SYS_execv:
+#endif
+#ifdef TARGET_SYS_execv
+ case TARGET_SYS_execv:
RETVAL = execve (MEMPTR (PARM1), (char **) MEMPTR (PARM2), NULL);
break;
#endif
-#endif
+#endif /* ! GO32 and ! WIN32 */
- case SYS_read:
+ case TARGET_SYS_read:
RETVAL = mn10300_callback->read (mn10300_callback, PARM1,
MEMPTR (PARM2), PARM3);
break;
- case SYS_write:
+ case TARGET_SYS_write:
RETVAL = (int)mn10300_callback->write (mn10300_callback, PARM1,
MEMPTR (PARM2), PARM3);
break;
- case SYS_lseek:
+ case TARGET_SYS_lseek:
RETVAL = mn10300_callback->lseek (mn10300_callback, PARM1, PARM2, PARM3);
break;
- case SYS_close:
+ case TARGET_SYS_close:
RETVAL = mn10300_callback->close (mn10300_callback, PARM1);
break;
- case SYS_open:
+ case TARGET_SYS_open:
RETVAL = mn10300_callback->open (mn10300_callback, MEMPTR (PARM1), PARM2);
break;
- case SYS_exit:
+ case TARGET_SYS_exit:
/* EXIT - caller can look in PARM1 to work out the
reason */
if (PARM1 == 0xdead)
@@ -2940,7 +2944,7 @@ void OP_F020 (insn, extension)
State.exited = 1;
break;
- case SYS_stat: /* added at hmsi */
+ case TARGET_SYS_stat: /* added at hmsi */
/* stat system call */
{
struct stat host_stat;
@@ -2965,19 +2969,21 @@ void OP_F020 (insn, extension)
}
break;
- case SYS_chown:
+#ifdef TARGET_SYS_chown
+ case TARGET_SYS_chown:
RETVAL = chown (MEMPTR (PARM1), PARM2, PARM3);
break;
- case SYS_chmod:
+#endif
+ case TARGET_SYS_chmod:
RETVAL = chmod (MEMPTR (PARM1), PARM2);
break;
-#ifdef SYS_time
- case SYS_time:
+#ifdef TARGET_SYS_time
+ case TARGET_SYS_time:
RETVAL = time ((void*) MEMPTR (PARM1));
break;
#endif
-#ifdef SYS_times
- case SYS_times:
+#ifdef TARGET_SYS_times
+ case TARGET_SYS_times:
{
struct tms tms;
RETVAL = times (&tms);
@@ -2988,7 +2994,8 @@ void OP_F020 (insn, extension)
break;
}
#endif
- case SYS_gettimeofday:
+#ifdef TARGET_SYS_gettimeofday
+ case TARGET_SYS_gettimeofday:
{
struct timeval t;
struct timezone tz;
@@ -2999,8 +3006,9 @@ void OP_F020 (insn, extension)
store_word (PARM2 + 4, tz.tz_dsttime);
break;
}
-#ifdef SYS_utime
- case SYS_utime:
+#endif
+#ifdef TARGET_SYS_utime
+ case TARGET_SYS_utime:
/* Cast the second argument to void *, to avoid type mismatch
if a prototype is present. */
RETVAL = utime (MEMPTR (PARM1), (void *) MEMPTR (PARM2));