Mon Sep 18 18:42:27 1995 steve chamberlain <sac@slash.cygnus.com>
* interp.c (trap): Remove useless code. Fri Sep 15 19:30:05 1995 steve chamberlain <sac@slash.cygnus.com> * syscall.h: Copy from newlib.
This commit is contained in:
parent
b3625fe62c
commit
e9aea0b33e
4 changed files with 49 additions and 36 deletions
|
@ -33,6 +33,7 @@ interp.c
|
||||||
gencode.c
|
gencode.c
|
||||||
run.1
|
run.1
|
||||||
run.c
|
run.c
|
||||||
|
syscall.h
|
||||||
|
|
||||||
Things-to-lose:
|
Things-to-lose:
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,11 @@
|
||||||
|
Mon Sep 18 18:42:27 1995 steve chamberlain <sac@slash.cygnus.com>
|
||||||
|
|
||||||
|
* interp.c (trap): Remove useless code.
|
||||||
|
|
||||||
|
Fri Sep 15 19:30:05 1995 steve chamberlain <sac@slash.cygnus.com>
|
||||||
|
|
||||||
|
* syscall.h: Copy from newlib.
|
||||||
|
|
||||||
start-sanitize-sh3e
|
start-sanitize-sh3e
|
||||||
Thu Sep 14 19:32:59 1995 Stu Grossman (grossman@cygnus.com)
|
Thu Sep 14 19:32:59 1995 Stu Grossman (grossman@cygnus.com)
|
||||||
|
|
||||||
|
|
|
@ -22,23 +22,18 @@
|
||||||
#include "sysdep.h"
|
#include "sysdep.h"
|
||||||
#include "bfd.h"
|
#include "bfd.h"
|
||||||
#include "remote-sim.h"
|
#include "remote-sim.h"
|
||||||
#include <sys/syscall.h>
|
|
||||||
|
/* This file is local - if newlib changes, then so should this. */
|
||||||
|
#include "syscall.h"
|
||||||
|
|
||||||
/* start-sanitize-sh3e */
|
/* start-sanitize-sh3e */
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
/* end-sanitize-sh3e */
|
/* end-sanitize-sh3e */
|
||||||
|
|
||||||
#if !defined (SYS_wait) && defined (SYS_wait4)
|
|
||||||
#define SYS_wait SYS_wait4 /* SunOS 4.1.3 for example */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if !defined (SYS_utime) && defined (SYS_utimes)
|
|
||||||
#define SYS_utime SYS_utimes /* SunOS 4.1.3 for example */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef SIGBUS
|
#ifndef SIGBUS
|
||||||
#define SIGBUS SIGSEGV
|
#define SIGBUS SIGSEGV
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef SIGQUIT
|
#ifndef SIGQUIT
|
||||||
#define SIGQUIT SIGTERM
|
#define SIGQUIT SIGTERM
|
||||||
#endif
|
#endif
|
||||||
|
@ -79,7 +74,6 @@ int
|
||||||
fail ()
|
fail ()
|
||||||
{
|
{
|
||||||
abort ();
|
abort ();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#define BUSERROR(addr, mask) \
|
#define BUSERROR(addr, mask) \
|
||||||
|
@ -168,11 +162,9 @@ typedef union
|
||||||
int profile;
|
int profile;
|
||||||
unsigned short *profile_hist;
|
unsigned short *profile_hist;
|
||||||
unsigned char *memory;
|
unsigned char *memory;
|
||||||
|
|
||||||
}
|
}
|
||||||
asregs;
|
asregs;
|
||||||
int asints[28];
|
int asints[28];
|
||||||
|
|
||||||
} saved_state_type;
|
} saved_state_type;
|
||||||
saved_state_type saved_state;
|
saved_state_type saved_state;
|
||||||
|
|
||||||
|
@ -470,24 +462,6 @@ trap (i, regs, memory, maskl, maskw, little_endian)
|
||||||
case 2:
|
case 2:
|
||||||
saved_state.asregs.exception = SIGQUIT;
|
saved_state.asregs.exception = SIGQUIT;
|
||||||
break;
|
break;
|
||||||
#if 0
|
|
||||||
case 8:
|
|
||||||
trap8 (ptr (regs[4]));
|
|
||||||
break;
|
|
||||||
case 9:
|
|
||||||
trap9 (ptr (regs[4]));
|
|
||||||
break;
|
|
||||||
case 10:
|
|
||||||
trap10 ();
|
|
||||||
break;
|
|
||||||
case 11:
|
|
||||||
regs[0] = trap11 ();
|
|
||||||
break;
|
|
||||||
case 12:
|
|
||||||
regs[0] = trap12 ();
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
case 3: /* FIXME: for backwards compat, should be removed */
|
case 3: /* FIXME: for backwards compat, should be removed */
|
||||||
case 34:
|
case 34:
|
||||||
{
|
{
|
||||||
|
@ -499,18 +473,15 @@ trap (i, regs, memory, maskl, maskw, little_endian)
|
||||||
{
|
{
|
||||||
|
|
||||||
#if !defined(__GO32__) && !defined(WIN32)
|
#if !defined(__GO32__) && !defined(WIN32)
|
||||||
|
|
||||||
case SYS_fork:
|
case SYS_fork:
|
||||||
regs[0] = fork ();
|
regs[0] = fork ();
|
||||||
break;
|
break;
|
||||||
case SYS_execve:
|
case SYS_execve:
|
||||||
regs[0] = execve (ptr (regs[5]), ptr (regs[6]), ptr (regs[7]));
|
regs[0] = execve (ptr (regs[5]), ptr (regs[6]), ptr (regs[7]));
|
||||||
break;
|
break;
|
||||||
#ifdef SYS_execv /* May be implemented as execve(arg,arg,0) */
|
|
||||||
case SYS_execv:
|
case SYS_execv:
|
||||||
regs[0] = execv (ptr (regs[5]), ptr (regs[6]));
|
regs[0] = execve (ptr (regs[5]), ptr (regs[6]), 0);
|
||||||
break;
|
break;
|
||||||
#endif
|
|
||||||
case SYS_pipe:
|
case SYS_pipe:
|
||||||
{
|
{
|
||||||
char *buf;
|
char *buf;
|
||||||
|
|
33
sim/sh/syscall.h
Normal file
33
sim/sh/syscall.h
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
|
||||||
|
/* !!! DANGER !!!
|
||||||
|
This was copied from newlib. */
|
||||||
|
|
||||||
|
|
||||||
|
#define SYS_exit 1
|
||||||
|
#define SYS_fork 2
|
||||||
|
#define SYS_read 3
|
||||||
|
#define SYS_write 4
|
||||||
|
#define SYS_open 5
|
||||||
|
#define SYS_close 6
|
||||||
|
#define SYS_wait4 7
|
||||||
|
#define SYS_creat 8
|
||||||
|
#define SYS_link 9
|
||||||
|
#define SYS_unlink 10
|
||||||
|
#define SYS_execv 11
|
||||||
|
#define SYS_chdir 12
|
||||||
|
#define SYS_mknod 14
|
||||||
|
#define SYS_chmod 15
|
||||||
|
#define SYS_chown 16
|
||||||
|
#define SYS_lseek 19
|
||||||
|
#define SYS_getpid 20
|
||||||
|
#define SYS_isatty 21
|
||||||
|
#define SYS_fstat 22
|
||||||
|
#define SYS_time 23
|
||||||
|
#define SYS_ARG 24
|
||||||
|
#define SYS_stat 38
|
||||||
|
#define SYS_pipe 42
|
||||||
|
#define SYS_execve 59
|
||||||
|
#define SYS_utime 201 /* not really a system call */
|
||||||
|
#define SYS_wait 202 /* nor is this */
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue