#include <time.h>
#include <unistd.h>
#include <utime.h>
+/* TODO: The Linux syscall emulation needs work to support non-Linux hosts.
+ Use an OS hack for now so the CPU emulation is available everywhere.
+ NB: The emulation is also missing argument conversion (endian & bitsize)
+ even on Linux hosts. */
+#ifdef __linux__
#include <sys/mman.h>
#include <sys/poll.h>
#include <sys/resource.h>
#include <linux/sysctl.h>
#include <linux/types.h>
#include <linux/unistd.h>
+#endif
#define TRAP_LINUX_SYSCALL 2
#define TRAP_FLUSH_CACHE 12
break;
}
+#ifdef __linux__
case TRAP_LINUX_SYSCALL:
{
CB_SYSCALL s;
m32rbf_h_gr_set (current_cpu, 0, result);
break;
}
+#endif
case TRAP_BREAKPOINT:
sim_engine_halt (sd, current_cpu, NULL, pc,