* pull across fixes for PSIM from gdb-current on NetBSD:

2001-03-04  Andrew Cagney  <ac131313@redhat.com>
	* emul_netbsd.c [WITH_NetBSD_HOST]: Include <sys/mount.h> and
	<errno.h>.
	(do_stat): Only do SYS test when SYS_stat defined.
	(do_sigprocmask): Ditto for SYS_sigprocmask.
	(do_fstat): Ditto for SYS_fstat.
	(do_getdirentries): Ditto for SYS_getdirentries.
	(do_lstat): Ditto for SYS_lstat.

	2001-01-15  Geoffrey Keating  <geoffk@redhat.com>
	* emul_netbsd.c (do_open): Translate the flag parameter to the
	open syscall to the numbers supported by the host.

* part of port-powerpc/14307

	2001-10-19  Andrew Cagney  <ac131313@redhat.com>
	* configure.in: When Linux or NetBSD, enable PowerPC simulator.
	* configure: Re-generate.
This commit is contained in:
mrg 2002-01-22 12:28:49 +00:00
parent 858c824a54
commit f2f685f22a
5 changed files with 55 additions and 3 deletions

View File

@ -1,3 +1,8 @@
2001-10-19 Andrew Cagney <ac131313@redhat.com>
* configure.in: When Linux or NetBSD, enable PowerPC simulator.
* configure: Re-generate.
Sat Mar 4 16:48:54 2000 Andrew Cagney <cagney@b1.cygnus.com>
* MAINTAINERS: New file. Blank.

View File

@ -1440,7 +1440,8 @@ case "${target}" in
sim_target=mn10200
;;
sh*-*-*) sim_target=sh ;;
powerpc*-*-eabi* | powerpc*-*-solaris* | powerpc*-*-sysv4* | powerpc*-*-elf* | powerpc*-*-linux* )
powerpc*-*-eabi* | powerpc*-*-solaris* | powerpc*-*-sysv4* | \
powerpc*-*-elf* | powerpc*-*-linux* | powerpc*-*-netbsd* )
# The PowerPC simulator uses the GCC extension long long as well as
# ANSI prototypes, so don't enable it for random host compilers
# unless asked to.

View File

@ -79,7 +79,8 @@ case "${target}" in
sim_target=mn10200
;;
sh*-*-*) sim_target=sh ;;
powerpc*-*-eabi* | powerpc*-*-solaris* | powerpc*-*-sysv4* | powerpc*-*-elf* | powerpc*-*-linux* )
powerpc*-*-eabi* | powerpc*-*-solaris* | powerpc*-*-sysv4* | \
powerpc*-*-elf* | powerpc*-*-linux* | powerpc*-*-netbsd* )
# The PowerPC simulator uses the GCC extension long long as well as
# ANSI prototypes, so don't enable it for random host compilers
# unless asked to.

View File

@ -1,3 +1,18 @@
2002-01-22 matthew green <mrg@netbsd.org>
2001-03-04 Andrew Cagney <ac131313@redhat.com>
* emul_netbsd.c [WITH_NetBSD_HOST]: Include <sys/mount.h> and
<errno.h>.
(do_stat): Only do SYS test when SYS_stat defined.
(do_sigprocmask): Ditto for SYS_sigprocmask.
(do_fstat): Ditto for SYS_fstat.
(do_getdirentries): Ditto for SYS_getdirentries.
(do_lstat): Ditto for SYS_lstat.
2001-01-15 Geoffrey Keating <geoffk@redhat.com>
* emul_netbsd.c (do_open): Translate the flag parameter to the
open syscall to the numbers supported by the host.
Fri Apr 28 15:59:27 2000 Andrew Cagney <cagney@b1.cygnus.com>
* events.c (event_queue_process): Call update_time_from_event

View File

@ -42,6 +42,7 @@
#include <stdio.h>
#include <signal.h>
#include <fcntl.h>
#include <errno.h>
#include <sys/errno.h>
#include <sys/param.h>
#include <sys/time.h>
@ -91,6 +92,7 @@ int getrusage();
#if WITH_NetBSD_HOST /* here NetBSD as that is what we're emulating */
#include <sys/syscall.h> /* FIXME - should not be including this one */
#include <sys/sysctl.h>
#include <sys/mount.h>
extern int getdirentries(int fd, char *buf, int nbytes, long *basep);
#else
@ -386,6 +388,7 @@ do_open(os_emul_data *emul,
char *path = emul_read_string(path_buf, path_addr, PATH_MAX, processor, cia);
int flags = (int)cpu_registers(processor)->gpr[arg0+1];
int mode = (int)cpu_registers(processor)->gpr[arg0+2];
int hostflags;
int status;
if (WITH_TRACE && ppc_trace[trace_os_emul])
@ -393,8 +396,25 @@ do_open(os_emul_data *emul,
SYS(open);
/* Do some translation on 'flags' to match it to the host's version. */
/* These flag values were taken from the NetBSD 1.4 header files. */
if ((flags & 3) == 0)
hostflags = O_RDONLY;
else if ((flags & 3) == 1)
hostflags = O_WRONLY;
else
hostflags = O_RDWR;
if (flags & 0x00000008)
hostflags |= O_APPEND;
if (flags & 0x00000200)
hostflags |= O_CREAT;
if (flags & 0x00000400)
hostflags |= O_TRUNC;
if (flags & 0x00000800)
hostflags |= O_EXCL;
/* Can't combine these statements, cuz open sets errno. */
status = open(path, flags, mode);
status = open(path, hostflags, mode);
emul_write_status(processor, status, errno);
}
@ -577,7 +597,9 @@ do_sigprocmask(os_emul_data *emul,
natural_word how = cpu_registers(processor)->gpr[arg0];
unsigned_word set = cpu_registers(processor)->gpr[arg0+1];
unsigned_word oset = cpu_registers(processor)->gpr[arg0+2];
#ifdef SYS_sigprocmask
SYS(sigprocmask);
#endif
if (WITH_TRACE && ppc_trace[trace_os_emul])
printf_filtered ("%ld, 0x%ld, 0x%ld", (long)how, (long)set, (long)oset);
@ -793,7 +815,9 @@ do_stat(os_emul_data *emul,
char *path = emul_read_string(path_buf, path_addr, PATH_MAX, processor, cia);
struct stat buf;
int status;
#ifdef SYS_stat
SYS(stat);
#endif
status = stat(path, &buf);
emul_write_status(processor, status, errno);
if (status == 0)
@ -815,7 +839,9 @@ do_fstat(os_emul_data *emul,
unsigned_word stat_buf_addr = cpu_registers(processor)->gpr[arg0+1];
struct stat buf;
int status;
#ifdef SYS_fstat
SYS(fstat);
#endif
/* Can't combine these statements, cuz fstat sets errno. */
status = fstat(fd, &buf);
emul_write_status(processor, status, errno);
@ -839,7 +865,9 @@ do_lstat(os_emul_data *emul,
unsigned_word stat_buf_addr = cpu_registers(processor)->gpr[arg0+1];
struct stat buf;
int status;
#ifdef SYS_lstat
SYS(lstat);
#endif
/* Can't combine these statements, cuz lstat sets errno. */
status = lstat(path, &buf);
emul_write_status(processor, status, errno);
@ -864,7 +892,9 @@ do_getdirentries(os_emul_data *emul,
unsigned_word basep_addr = cpu_registers(processor)->gpr[arg0+3];
long basep;
int status;
#ifdef SYS_getdirentries
SYS(getdirentries);
#endif
if (buf_addr != 0 && nbytes >= 0)
buf = zalloc(nbytes);
else