[patch/sim] Build hacks for PPC on NetBSD

Andrew Cagney ac131313@cygnus.com
Mon Mar 5 08:25:00 GMT 2001


FYI,

I've committed the attatched.  It addresses the build problem for the
PPC on recent NetBSD releases.  Briefly what has happened is that things
like SYS_lstat have been re-named/re-numbered.

Things to do today would include adding support for the more recent
syscalls.

	Andrew
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.

Index: emul_netbsd.c
===================================================================
RCS file: /cvs/src/src/sim/ppc/emul_netbsd.c,v
retrieving revision 1.2
diff -p -r1.2 emul_netbsd.c
*** emul_netbsd.c	2001/01/15 23:24:30	1.2
--- emul_netbsd.c	2001/03/05 16:20:34
***************
*** 42,47 ****
--- 42,48 ----
  #include <stdio.h>
  #include <signal.h>
  #include <fcntl.h>
+ #include <errno.h>
  #include <sys/errno.h>
  #include <sys/param.h>
  #include <sys/time.h>
*************** int getrusage();
*** 91,96 ****
--- 92,98 ----
  #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
  
*************** do_sigprocmask(os_emul_data *emul,
*** 595,601 ****
--- 597,605 ----
    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);
*************** do_stat(os_emul_data *emul,
*** 811,817 ****
--- 815,823 ----
    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)
*************** do_fstat(os_emul_data *emul,
*** 833,839 ****
--- 839,847 ----
    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);
*************** do_lstat(os_emul_data *emul,
*** 857,863 ****
--- 865,873 ----
    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);
*************** do_getdirentries(os_emul_data *emul,
*** 882,888 ****
--- 892,900 ----
    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


More information about the Gdb-patches mailing list