aboutsummaryrefslogtreecommitdiff
path: root/sim/mn10300/simops.c
diff options
context:
space:
mode:
Diffstat (limited to 'sim/mn10300/simops.c')
-rw-r--r--sim/mn10300/simops.c52
1 files changed, 30 insertions, 22 deletions
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));