#include "sim-signal.h"
#include "cgen-mem.h"
#include "cgen-ops.h"
-#include "targ-vals.h"
+#include "target-newlib-syscall.h"
#include <stdlib.h>
enum
exit (1);
}
- case TARGET_SYS_write:
+ case TARGET_NEWLIB_SYS_write:
buf = zalloc (PARM3);
sim_read (CPU_STATE (current_cpu), CPU2DATA(PARM2), buf, PARM3);
SET_H_GR (ret_reg,
free (buf);
break;
- case TARGET_SYS_lseek:
+ case TARGET_NEWLIB_SYS_lseek:
SET_H_GR (ret_reg,
sim_io_lseek (CPU_STATE (current_cpu),
PARM1, PARM2, PARM3));
break;
- case TARGET_SYS_exit:
+ case TARGET_NEWLIB_SYS_exit:
sim_engine_halt (CPU_STATE (current_cpu), current_cpu,
NULL, pc, sim_exited, PARM1);
break;
- case TARGET_SYS_read:
+ case TARGET_NEWLIB_SYS_read:
buf = zalloc (PARM3);
SET_H_GR (ret_reg,
sim_io_read (CPU_STATE (current_cpu),
free (buf);
break;
- case TARGET_SYS_open:
+ case TARGET_NEWLIB_SYS_open:
buf = fetch_str (current_cpu, pc, PARM1);
SET_H_GR (ret_reg,
sim_io_open (CPU_STATE (current_cpu),
free (buf);
break;
- case TARGET_SYS_close:
+ case TARGET_NEWLIB_SYS_close:
SET_H_GR (ret_reg,
sim_io_close (CPU_STATE (current_cpu), PARM1));
break;
- case TARGET_SYS_time:
+ case TARGET_NEWLIB_SYS_time:
SET_H_GR (ret_reg, time (0));
break;
#include "sim-signal.h"
#include "sim-syscall.h"
#include "lm32-sim.h"
-#include "targ-vals.h"
+#include "target-newlib-syscall.h"
/* Handle invalid instructions. */
host_callback *cb = STATE_CALLBACK (sd);
if ((STATE_ENVIRONMENT (sd) != OPERATING_ENVIRONMENT)
- || (GET_H_GR (8) == TARGET_SYS_exit))
+ || (GET_H_GR (8) == TARGET_NEWLIB_SYS_exit))
{
/* Delegate system call to host O/S. */
long result, result2;
#include "cpu.h"
#include "mem.h"
#include "syscalls.h"
-#include "targ-vals.h"
+#include "target-newlib-syscall.h"
/* The current syscall callbacks we're using. */
static struct host_callback_struct *callbacks;
printf ("\033[31m/* SYSCALL(%d) = %s */\033[0m\n", id, callnames[id]);
switch (id)
{
- case TARGET_SYS_exit:
+ case TARGET_NEWLIB_SYS_exit:
{
int ec = arg (2);
if (verbose)
}
break;
- case TARGET_SYS_open:
+ case TARGET_NEWLIB_SYS_open:
{
int path = arg (PTRSZ);
int oflags = arg (2);
}
break;
- case TARGET_SYS_close:
+ case TARGET_NEWLIB_SYS_close:
{
int fd = arg (2);
}
break;
- case TARGET_SYS_read:
+ case TARGET_NEWLIB_SYS_read:
{
int fd = arg (2);
int addr = arg (PTRSZ);
}
break;
- case TARGET_SYS_write:
+ case TARGET_NEWLIB_SYS_write:
{
int fd = arg (2);
int addr = arg (PTRSZ);
}
break;
- case TARGET_SYS_getpid:
+ case TARGET_NEWLIB_SYS_getpid:
put_reg (r0, 42);
break;
- case TARGET_SYS_gettimeofday:
+ case TARGET_NEWLIB_SYS_gettimeofday:
{
int tvaddr = arg (PTRSZ);
struct timeval tv;
}
break;
- case TARGET_SYS_kill:
+ case TARGET_NEWLIB_SYS_kill:
{
int pid = arg (2);
int sig = arg (2);
#include "sim-options.h"
#include "sim-io.h"
#include "sim-signal.h"
-#include "targ-vals.h"
+#include "target-newlib-syscall.h"
typedef int word;
typedef unsigned int uword;
cpu.asregs.sregs[3] = inum;
switch (inum)
{
- case TARGET_SYS_exit:
+ case TARGET_NEWLIB_SYS_exit:
{
sim_engine_halt (sd, scpu, NULL, pc, sim_exited,
cpu.asregs.regs[2]);
break;
}
- case TARGET_SYS_open:
+ case TARGET_NEWLIB_SYS_open:
{
char fname[1024];
int mode = (int) convert_target_flags ((unsigned) cpu.asregs.regs[3]);
cpu.asregs.regs[2] = fd;
break;
}
- case TARGET_SYS_read:
+ case TARGET_NEWLIB_SYS_read:
{
int fd = cpu.asregs.regs[2];
unsigned len = (unsigned) cpu.asregs.regs[4];
free (buf);
break;
}
- case TARGET_SYS_write:
+ case TARGET_NEWLIB_SYS_write:
{
char *str;
/* String length is at 0x12($fp) */
cpu.asregs.regs[2] = count;
break;
}
- case TARGET_SYS_unlink:
+ case TARGET_NEWLIB_SYS_unlink:
{
char fname[1024];
int fd;
#include "cpu.h"
#include "mem.h"
#include "syscalls.h"
-#include "targ-vals.h"
+#include "target-newlib-syscall.h"
/* The current syscall callbacks we're using. */
static struct host_callback_struct *callbacks;
argp = 0;
stackp = 4;
if (trace)
- printf ("\033[31m/* SYSCALL(%d) = %s */\033[0m\n", id, id <= TARGET_SYS_link ? callnames[id] : "unknown");
+ printf ("\033[31m/* SYSCALL(%d) = %s */\033[0m\n", id, id <= TARGET_NEWLIB_SYS_link ? callnames[id] : "unknown");
switch (id)
{
- case TARGET_SYS_exit:
+ case TARGET_NEWLIB_SYS_exit:
{
int ec = arg ();
if (verbose)
}
break;
- case TARGET_SYS_open:
+ case TARGET_NEWLIB_SYS_open:
{
int oflags, cflags;
int path = arg ();
}
break;
- case TARGET_SYS_close:
+ case TARGET_NEWLIB_SYS_close:
{
int fd = arg ();
}
break;
- case TARGET_SYS_read:
+ case TARGET_NEWLIB_SYS_read:
{
int fd = arg ();
int addr = arg ();
}
break;
- case TARGET_SYS_write:
+ case TARGET_NEWLIB_SYS_write:
{
int fd = arg ();
int addr = arg ();
}
break;
- case TARGET_SYS_getpid:
+ case TARGET_NEWLIB_SYS_getpid:
put_reg (1, 42);
break;
- case TARGET_SYS_gettimeofday:
+ case TARGET_NEWLIB_SYS_gettimeofday:
{
int tvaddr = arg ();
struct timeval tv;
}
break;
- case TARGET_SYS_kill:
+ case TARGET_NEWLIB_SYS_kill:
{
int pid = arg ();
int sig = arg ();