mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-11-24 10:35:12 +08:00
Add Solaris and Linux emulations
This commit is contained in:
parent
9c44af609b
commit
88f1eac415
@ -64,6 +64,8 @@ emul_generic.c
|
||||
emul_generic.h
|
||||
emul_netbsd.c
|
||||
emul_netbsd.h
|
||||
emul_unix.c
|
||||
emul_unix.h
|
||||
events.c
|
||||
events.h
|
||||
filter_filename.c
|
||||
|
@ -1,3 +1,35 @@
|
||||
Sun Jun 2 11:21:17 1996 Michael Meissner <meissner@tiktok.cygnus.com>
|
||||
|
||||
* emul_unix.{h,c}: New files to provide Solaris and Linux system
|
||||
call emulations.
|
||||
|
||||
* Makefile.in (LIB_{SRC,OBJ}): Add emul_unix.{c,o}.
|
||||
(os_emul.o): Depend on emul_unix.h.
|
||||
(emul_unix.o): New dependency.
|
||||
|
||||
* configure.in (--enable-sim-alignment): Add 0|default to mean set
|
||||
alignment to 0, which means use appropriate alignment for mode.
|
||||
(AC_CHECK_FUNCS): Add new functions needed by emul_unix.c.
|
||||
(AC_CHECK_HEADERS): Add new include files needed by emul_unix.c.
|
||||
* config.in: Regenerate.
|
||||
* configure: Regenerate.
|
||||
|
||||
* emul_generic.c (emul_write2_status): New function to return
|
||||
results in r3 and r4 for Solaris system calls.
|
||||
(emul_do_system_call): If the system call is not support, but
|
||||
there is a string for the system call name, print out the string
|
||||
instead of the system call number.
|
||||
|
||||
* emul_generic.h (emul_write2_status): Declare it.
|
||||
|
||||
* emul_netbsd.c: Use /* */ around comment on #endif.
|
||||
|
||||
* os_emul.c: Include emul_unix.h.
|
||||
(os_emulations): Add emulations for Solaris, and Linux.
|
||||
|
||||
* psim.c (psim_usage): Add message about solaris, linux
|
||||
emulations.
|
||||
|
||||
Fri May 24 10:08:10 1996 Michael Meissner <meissner@tiktok.cygnus.com>
|
||||
|
||||
* configure.in (AC_STRUCT_ST_{BLKSIZE,BLOCKS,RDEV}): Use these
|
||||
|
@ -228,6 +228,7 @@ LIB_SRC = \
|
||||
os_emul.c \
|
||||
emul_generic.c \
|
||||
emul_netbsd.c \
|
||||
emul_unix.c \
|
||||
emul_chirp.c \
|
||||
emul_bugapi.c \
|
||||
registers.c \
|
||||
@ -255,6 +256,7 @@ LIB_OBJ = \
|
||||
os_emul.o \
|
||||
emul_generic.o \
|
||||
emul_netbsd.o \
|
||||
emul_unix.o \
|
||||
emul_chirp.o \
|
||||
emul_bugapi.o \
|
||||
registers.o \
|
||||
@ -317,10 +319,11 @@ filter_filename.o: filter_filename.c filter_filename.h config.h ppc-config.h
|
||||
|
||||
sim-endian.o: sim-endian.c sim-endian-n.h $(BASICS_H)
|
||||
|
||||
os_emul.o: os_emul.c emul_netbsd.h emul_chirp.h emul_bugapi.h $(EMUL_GENERIC_H)
|
||||
os_emul.o: os_emul.c emul_netbsd.h emul_unix.h emul_chirp.h emul_bugapi.h $(EMUL_GENERIC_H)
|
||||
emul_generic.o: emul_generic.c $(EMUL_GENERIC_H)
|
||||
|
||||
emul_netbsd.o: emul_netbsd.c emul_netbsd.h $(EMUL_GENERIC_H)
|
||||
emul_unix.o: emul_unix.c emul_unix.h $(EMUL_GENERIC_H)
|
||||
emul_chirp.o: emul_chirp.c emul_chirp.h $(EMUL_GENERIC_H)
|
||||
emul_bugapi.o: emul_bugapi.c emul_bugapi.h $(EMUL_GENERIC_H)
|
||||
|
||||
@ -346,7 +349,7 @@ events.o: events.c events.h $(BASICS_H)
|
||||
|
||||
sim_calls.o: sim_calls.c $(PSIM_H) itable.h ../../gdb/tm.h options.h
|
||||
|
||||
spreg.o: spreg.h spreg.c $(BASICS_H)
|
||||
spreg.o: spreg.c spreg.h spreg.c $(BASICS_H)
|
||||
|
||||
main.o: main.c $(PSIM_H) itable.h options.h
|
||||
|
||||
@ -418,10 +421,10 @@ itable.h itable.c icache.h idecode.h idecode.c semantics.h semantics.c model.h m
|
||||
spreg.h spreg.c: tmp-dgen
|
||||
|
||||
dgen: dgen.o table.o lf.o misc.o filter_host.o
|
||||
$(CC_FOR_BUILD) $(BUILD_CFLAGS) -o dgen dgen.o table.o lf.o misc.o filter_host.o $(LIBIBERTY_LIB) $(LIBS)
|
||||
$(CC_FOR_BUILD) $(BUILD_CFLAGS) -o dgen dgen.o table.o lf.o misc.o filter_host.o $(BUILD_LIBS)
|
||||
|
||||
igen: igen.o table.o lf.o misc.o filter_host.o
|
||||
$(CC_FOR_BUILD) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o igen igen.o table.o lf.o misc.o filter_host.o $(LIBIBERTY_LIB) $(LIBS)
|
||||
$(CC_FOR_BUILD) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o igen igen.o table.o lf.o misc.o filter_host.o $(BUILD_LIBS)
|
||||
|
||||
filter_host.c: filter_filename.c
|
||||
cat $(srcdir)/filter_filename.c > filter_host.c
|
||||
@ -441,7 +444,7 @@ dgen.o: dgen.c misc.h filter_filename.h lf.h table.h
|
||||
igen.o: igen.c misc.h filter_filename.h lf.h table.h
|
||||
$(CC_FOR_BUILD) $(BUILD_CFLAGS) -c $(srcdir)/igen.c
|
||||
|
||||
misc.o: misc.h filter_filename.h
|
||||
misc.o: misc.c misc.h filter_filename.h
|
||||
$(CC_FOR_BUILD) $(BUILD_CFLAGS) -c $(srcdir)/misc.c
|
||||
|
||||
# With out this #, make thinks that misc.o doesn't have a rule
|
||||
|
@ -23,12 +23,39 @@
|
||||
byte first (like Motorola and SPARC, unlike Intel and VAX). */
|
||||
#undef WORDS_BIGENDIAN
|
||||
|
||||
/* Define if you have the cfgetispeed function. */
|
||||
#undef HAVE_CFGETISPEED
|
||||
|
||||
/* Define if you have the cfgetospeed function. */
|
||||
#undef HAVE_CFGETOSPEED
|
||||
|
||||
/* Define if you have the cfsetispeed function. */
|
||||
#undef HAVE_CFSETISPEED
|
||||
|
||||
/* Define if you have the cfsetospeed function. */
|
||||
#undef HAVE_CFSETOSPEED
|
||||
|
||||
/* Define if you have the chdir function. */
|
||||
#undef HAVE_CHDIR
|
||||
|
||||
/* Define if you have the chmod function. */
|
||||
#undef HAVE_CHMOD
|
||||
|
||||
/* Define if you have the chown function. */
|
||||
#undef HAVE_CHOWN
|
||||
|
||||
/* Define if you have the dup function. */
|
||||
#undef HAVE_DUP
|
||||
|
||||
/* Define if you have the dup2 function. */
|
||||
#undef HAVE_DUP2
|
||||
|
||||
/* Define if you have the fchmod function. */
|
||||
#undef HAVE_FCHMOD
|
||||
|
||||
/* Define if you have the fchown function. */
|
||||
#undef HAVE_FCHOWN
|
||||
|
||||
/* Define if you have the fcntl function. */
|
||||
#undef HAVE_FCNTL
|
||||
|
||||
@ -53,6 +80,9 @@
|
||||
/* Define if you have the getpid function. */
|
||||
#undef HAVE_GETPID
|
||||
|
||||
/* Define if you have the getppid function. */
|
||||
#undef HAVE_GETPPID
|
||||
|
||||
/* Define if you have the getrusage function. */
|
||||
#undef HAVE_GETRUSAGE
|
||||
|
||||
@ -68,24 +98,81 @@
|
||||
/* Define if you have the kill function. */
|
||||
#undef HAVE_KILL
|
||||
|
||||
/* Define if you have the link function. */
|
||||
#undef HAVE_LINK
|
||||
|
||||
/* Define if you have the lseek function. */
|
||||
#undef HAVE_LSEEK
|
||||
|
||||
/* Define if you have the lstat function. */
|
||||
#undef HAVE_LSTAT
|
||||
|
||||
/* Define if you have the mkdir function. */
|
||||
#undef HAVE_MKDIR
|
||||
|
||||
/* Define if you have the pipe function. */
|
||||
#undef HAVE_PIPE
|
||||
|
||||
/* Define if you have the readlink function. */
|
||||
#undef HAVE_READLINK
|
||||
|
||||
/* Define if you have the rmdir function. */
|
||||
#undef HAVE_RMDIR
|
||||
|
||||
/* Define if you have the setregid function. */
|
||||
#undef HAVE_SETREGID
|
||||
|
||||
/* Define if you have the setreuid function. */
|
||||
#undef HAVE_SETREUID
|
||||
|
||||
/* Define if you have the sigprocmask function. */
|
||||
#undef HAVE_SIGPROCMASK
|
||||
|
||||
/* Define if you have the stat function. */
|
||||
#undef HAVE_STAT
|
||||
|
||||
/* Define if you have the symlink function. */
|
||||
#undef HAVE_SYMLINK
|
||||
|
||||
/* Define if you have the tcdrain function. */
|
||||
#undef HAVE_TCDRAIN
|
||||
|
||||
/* Define if you have the tcflow function. */
|
||||
#undef HAVE_TCFLOW
|
||||
|
||||
/* Define if you have the tcflush function. */
|
||||
#undef HAVE_TCFLUSH
|
||||
|
||||
/* Define if you have the tcgetattr function. */
|
||||
#undef HAVE_TCGETATTR
|
||||
|
||||
/* Define if you have the tcgetpgrp function. */
|
||||
#undef HAVE_TCGETPGRP
|
||||
|
||||
/* Define if you have the tcsendbreak function. */
|
||||
#undef HAVE_TCSENDBREAK
|
||||
|
||||
/* Define if you have the tcsetattr function. */
|
||||
#undef HAVE_TCSETATTR
|
||||
|
||||
/* Define if you have the tcsetpgrp function. */
|
||||
#undef HAVE_TCSETPGRP
|
||||
|
||||
/* Define if you have the time function. */
|
||||
#undef HAVE_TIME
|
||||
|
||||
/* Define if you have the umask function. */
|
||||
#undef HAVE_UMASK
|
||||
|
||||
/* Define if you have the unlink function. */
|
||||
#undef HAVE_UNLINK
|
||||
|
||||
/* Define if you have the <dirent.h> header file. */
|
||||
#undef HAVE_DIRENT_H
|
||||
|
||||
/* Define if you have the <fcntl.h> header file. */
|
||||
#undef HAVE_FCNTL_H
|
||||
|
||||
/* Define if you have the <ndir.h> header file. */
|
||||
#undef HAVE_NDIR_H
|
||||
|
||||
@ -110,9 +197,21 @@
|
||||
/* Define if you have the <sys/ndir.h> header file. */
|
||||
#undef HAVE_SYS_NDIR_H
|
||||
|
||||
/* Define if you have the <sys/param.h> header file. */
|
||||
#undef HAVE_SYS_PARAM_H
|
||||
|
||||
/* Define if you have the <sys/resource.h> header file. */
|
||||
#undef HAVE_SYS_RESOURCE_H
|
||||
|
||||
/* Define if you have the <sys/stat.h> header file. */
|
||||
#undef HAVE_SYS_STAT_H
|
||||
|
||||
/* Define if you have the <sys/termio.h> header file. */
|
||||
#undef HAVE_SYS_TERMIO_H
|
||||
|
||||
/* Define if you have the <sys/termios.h> header file. */
|
||||
#undef HAVE_SYS_TERMIOS_H
|
||||
|
||||
/* Define if you have the <sys/time.h> header file. */
|
||||
#undef HAVE_SYS_TIME_H
|
||||
|
||||
|
87
sim/ppc/configure
vendored
87
sim/ppc/configure
vendored
@ -1,8 +1,8 @@
|
||||
#! /bin/sh
|
||||
|
||||
# Guess values for system-dependent variables and create Makefiles.
|
||||
# Generated automatically using autoconf version 2.8
|
||||
# Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
|
||||
# Generated automatically using autoconf version 2.10
|
||||
# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
|
||||
#
|
||||
# This configure script is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy, distribute and modify it.
|
||||
@ -386,7 +386,7 @@ EOF
|
||||
verbose=yes ;;
|
||||
|
||||
-version | --version | --versio | --versi | --vers)
|
||||
echo "configure generated by autoconf version 2.8"
|
||||
echo "configure generated by autoconf version 2.10"
|
||||
exit 0 ;;
|
||||
|
||||
-with-* | --with-*)
|
||||
@ -1160,6 +1160,7 @@ if test "${enable_sim_alignment+set}" = set; then
|
||||
case "${enableval}" in
|
||||
yes | strict | STRICT) sim_alignment="-DWITH_ALIGNMENT=STRICT_ALIGNMENT";;
|
||||
no | nonstrict | NONSTRICT) sim_alignment="-DWITH_ALIGNMENT=NONSTRICT_ALIGNMENT";;
|
||||
0 | default | DEFAULT) sim_alignment="-DWITH_ALIGNMENT=0";;
|
||||
*) { echo "configure: error: "Unknown value $enableval passed to --enable-sim-alignment"" 1>&2; exit 1; }; sim_alignment="";;
|
||||
esac
|
||||
if test x"$silent" != x"yes" && test x"$sim_alignment" != x""; then
|
||||
@ -1500,7 +1501,7 @@ if eval "test \"`echo '$''{'ac_cv_struct_st_blksize'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1504 "configure"
|
||||
#line 1505 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
@ -1509,7 +1510,7 @@ int t() {
|
||||
struct stat s; s.st_blksize;
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:1513: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
if { (eval echo configure:1514: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
rm -rf conftest*
|
||||
ac_cv_struct_st_blksize=yes
|
||||
else
|
||||
@ -1533,7 +1534,7 @@ if eval "test \"`echo '$''{'ac_cv_struct_st_blocks'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1537 "configure"
|
||||
#line 1538 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
@ -1542,7 +1543,7 @@ int t() {
|
||||
struct stat s; s.st_blocks;
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:1546: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
if { (eval echo configure:1547: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
rm -rf conftest*
|
||||
ac_cv_struct_st_blocks=yes
|
||||
else
|
||||
@ -1568,7 +1569,7 @@ if eval "test \"`echo '$''{'ac_cv_struct_st_rdev'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1572 "configure"
|
||||
#line 1573 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
@ -1577,7 +1578,7 @@ int t() {
|
||||
struct stat s; s.st_rdev;
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:1581: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
if { (eval echo configure:1582: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
rm -rf conftest*
|
||||
ac_cv_struct_st_rdev=yes
|
||||
else
|
||||
@ -1601,7 +1602,7 @@ if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1605 "configure"
|
||||
#line 1606 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <sys/types.h>
|
||||
#include <time.h>
|
||||
@ -1610,7 +1611,7 @@ int t() {
|
||||
struct tm *tp; tp->tm_sec;
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:1614: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
if { (eval echo configure:1615: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
rm -rf conftest*
|
||||
ac_cv_struct_tm=time.h
|
||||
else
|
||||
@ -1634,7 +1635,7 @@ if eval "test \"`echo '$''{'ac_cv_struct_tm_zone'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1638 "configure"
|
||||
#line 1639 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <sys/types.h>
|
||||
#include <$ac_cv_struct_tm>
|
||||
@ -1643,7 +1644,7 @@ int t() {
|
||||
struct tm tm; tm.tm_zone;
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:1647: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
if { (eval echo configure:1648: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
rm -rf conftest*
|
||||
ac_cv_struct_tm_zone=yes
|
||||
else
|
||||
@ -1666,7 +1667,7 @@ if eval "test \"`echo '$''{'ac_cv_var_tzname'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1670 "configure"
|
||||
#line 1671 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <time.h>
|
||||
#ifndef tzname /* For SGI. */
|
||||
@ -1677,7 +1678,7 @@ int t() {
|
||||
atoi(*tzname);
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:1681: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
|
||||
if { (eval echo configure:1682: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
|
||||
rm -rf conftest*
|
||||
ac_cv_var_tzname=yes
|
||||
else
|
||||
@ -1698,19 +1699,21 @@ EOF
|
||||
fi
|
||||
|
||||
|
||||
for ac_func in dup dup2 fcntl fstat fstatfs getdirentries getegid geteuid getgid getpid getrusage gettimeofday getuid ioctl kill lseek lstat sigprocmask stat umask
|
||||
for ac_func in cfgetispeed cfgetospeed cfsetispeed cfsetospeed chdir chmod chown dup dup2 fchmod fchown fcntl fstat fstatfs getdirentries getegid geteuid getgid getpid getppid getrusage gettimeofday getuid ioctl kill link lseek lstat mkdir pipe readlink rmdir setreuid setregid stat sigprocmask stat symlink tcgetattr tcsetattr tcsendbreak tcdrain tcflush tcflow tcgetpgrp tcsetpgrp time umask unlink
|
||||
do
|
||||
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
|
||||
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1709 "configure"
|
||||
#line 1710 "configure"
|
||||
#include "confdefs.h"
|
||||
/* System header to define __stub macros and hopefully few prototypes,
|
||||
which can conflict with char $ac_func(); below. */
|
||||
#include <assert.h>
|
||||
/* Override any gcc2 internal prototype to avoid an error. */
|
||||
/* We use char because int might match the return type of a gcc2
|
||||
builtin and then its argument prototype would still apply. */
|
||||
char $ac_func();
|
||||
|
||||
int main() { return 0; }
|
||||
@ -1727,7 +1730,7 @@ $ac_func();
|
||||
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:1731: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
|
||||
if { (eval echo configure:1734: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
|
||||
rm -rf conftest*
|
||||
eval "ac_cv_func_$ac_func=yes"
|
||||
else
|
||||
@ -1765,13 +1768,13 @@ else
|
||||
# On the NeXT, cc -E runs the code through the compiler's parser,
|
||||
# not just through cpp.
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1769 "configure"
|
||||
#line 1772 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <assert.h>
|
||||
Syntax Error
|
||||
EOF
|
||||
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
|
||||
{ (eval echo configure:1775: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
{ (eval echo configure:1778: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
ac_err=`grep -v '^ *+' conftest.out`
|
||||
if test -z "$ac_err"; then
|
||||
:
|
||||
@ -1780,13 +1783,13 @@ else
|
||||
rm -rf conftest*
|
||||
CPP="${CC-cc} -E -traditional-cpp"
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1784 "configure"
|
||||
#line 1787 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <assert.h>
|
||||
Syntax Error
|
||||
EOF
|
||||
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
|
||||
{ (eval echo configure:1790: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
{ (eval echo configure:1793: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
ac_err=`grep -v '^ *+' conftest.out`
|
||||
if test -z "$ac_err"; then
|
||||
:
|
||||
@ -1806,7 +1809,7 @@ else
|
||||
fi
|
||||
echo "$ac_t""$CPP" 1>&6
|
||||
|
||||
for ac_hdr in string.h strings.h stdlib.h time.h sys/mount.h sys/types.h sys/time.h sys/times.h unistd.h sys/resource.h sys/ioctl.h
|
||||
for ac_hdr in fcntl.h stdlib.h string.h strings.h sys/ioctl.h sys/mount.h sys/param.h sys/resource.h sys/stat.h sys/termio.h sys/termios.h sys/time.h sys/times.h sys/types.h time.h unistd.h
|
||||
do
|
||||
ac_safe=`echo "$ac_hdr" | tr './\055' '___'`
|
||||
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
|
||||
@ -1814,12 +1817,12 @@ if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1818 "configure"
|
||||
#line 1821 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <$ac_hdr>
|
||||
EOF
|
||||
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
|
||||
{ (eval echo configure:1823: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
{ (eval echo configure:1826: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
ac_err=`grep -v '^ *+' conftest.out`
|
||||
if test -z "$ac_err"; then
|
||||
rm -rf conftest*
|
||||
@ -1852,7 +1855,7 @@ if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1856 "configure"
|
||||
#line 1859 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <sys/types.h>
|
||||
#include <$ac_hdr>
|
||||
@ -1861,7 +1864,7 @@ int t() {
|
||||
DIR *dirp = 0;
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:1865: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
if { (eval echo configure:1868: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
rm -rf conftest*
|
||||
eval "ac_cv_header_dirent_$ac_safe=yes"
|
||||
else
|
||||
@ -1885,22 +1888,26 @@ done
|
||||
# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
|
||||
if test $ac_header_dirent = dirent.h; then
|
||||
echo $ac_n "checking for -ldir""... $ac_c" 1>&6
|
||||
ac_lib_var=`echo dir_opendir | tr '.-/+' '___p'`
|
||||
ac_lib_var=`echo dir'_'opendir | tr './+\055' '__p_'`
|
||||
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
ac_save_LIBS="$LIBS"
|
||||
LIBS="-ldir $LIBS"
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1896 "configure"
|
||||
#line 1899 "configure"
|
||||
#include "confdefs.h"
|
||||
/* Override any gcc2 internal prototype to avoid an error. */
|
||||
/* We use char because int might match the return type of a gcc2
|
||||
builtin and then its argument prototype would still apply. */
|
||||
char opendir();
|
||||
|
||||
int main() { return 0; }
|
||||
int t() {
|
||||
opendir()
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:1904: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
|
||||
if { (eval echo configure:1911: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
|
||||
rm -rf conftest*
|
||||
eval "ac_cv_lib_$ac_lib_var=yes"
|
||||
else
|
||||
@ -1920,22 +1927,26 @@ fi
|
||||
|
||||
else
|
||||
echo $ac_n "checking for -lx""... $ac_c" 1>&6
|
||||
ac_lib_var=`echo x_opendir | tr '.-/+' '___p'`
|
||||
ac_lib_var=`echo x'_'opendir | tr './+\055' '__p_'`
|
||||
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
ac_save_LIBS="$LIBS"
|
||||
LIBS="-lx $LIBS"
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1931 "configure"
|
||||
#line 1938 "configure"
|
||||
#include "confdefs.h"
|
||||
/* Override any gcc2 internal prototype to avoid an error. */
|
||||
/* We use char because int might match the return type of a gcc2
|
||||
builtin and then its argument prototype would still apply. */
|
||||
char opendir();
|
||||
|
||||
int main() { return 0; }
|
||||
int t() {
|
||||
opendir()
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:1939: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
|
||||
if { (eval echo configure:1950: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
|
||||
rm -rf conftest*
|
||||
eval "ac_cv_lib_$ac_lib_var=yes"
|
||||
else
|
||||
@ -2032,7 +2043,7 @@ do
|
||||
echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
|
||||
exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
|
||||
-version | --version | --versio | --versi | --vers | --ver | --ve | --v)
|
||||
echo "$CONFIG_STATUS generated by autoconf version 2.8"
|
||||
echo "$CONFIG_STATUS generated by autoconf version 2.10"
|
||||
exit 0 ;;
|
||||
-help | --help | --hel | --he | --h)
|
||||
echo "\$ac_cs_usage"; exit 0 ;;
|
||||
@ -2221,7 +2232,7 @@ rm -f conftest.vals
|
||||
cat > conftest.hdr <<\EOF
|
||||
s/[\\&%]/\\&/g
|
||||
s%[\\$`]%\\&%g
|
||||
s%#define \([A-Za-z_][A-Za-z0-9_]*\) \(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
|
||||
s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
|
||||
s%ac_d%ac_u%gp
|
||||
s%ac_u%ac_e%gp
|
||||
EOF
|
||||
@ -2269,6 +2280,12 @@ cat >> $CONFIG_STATUS <<\EOF
|
||||
echo "$ac_file is unchanged"
|
||||
rm -f conftest.h
|
||||
else
|
||||
# Remove last slash and all that follows it. Not all systems have dirname.
|
||||
ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
|
||||
if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
|
||||
# The file is in a subdirectory.
|
||||
test ! -d "$ac_dir" && mkdir "$ac_dir"
|
||||
fi
|
||||
rm -f $ac_file
|
||||
mv conftest.h $ac_file
|
||||
fi
|
||||
|
@ -290,6 +290,7 @@ AC_ARG_ENABLE(sim-alignment,
|
||||
[case "${enableval}" in
|
||||
yes | strict | STRICT) sim_alignment="-DWITH_ALIGNMENT=STRICT_ALIGNMENT";;
|
||||
no | nonstrict | NONSTRICT) sim_alignment="-DWITH_ALIGNMENT=NONSTRICT_ALIGNMENT";;
|
||||
0 | default | DEFAULT) sim_alignment="-DWITH_ALIGNMENT=0";;
|
||||
*) AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-alignment"); sim_alignment="";;
|
||||
esac
|
||||
if test x"$silent" != x"yes" && test x"$sim_alignment" != x""; then
|
||||
@ -443,9 +444,9 @@ AC_STRUCT_ST_BLOCKS
|
||||
AC_STRUCT_ST_RDEV
|
||||
AC_STRUCT_TIMEZONE
|
||||
|
||||
AC_CHECK_FUNCS(dup dup2 fcntl fstat fstatfs getdirentries getegid geteuid getgid getpid getrusage gettimeofday getuid ioctl kill lseek lstat sigprocmask stat umask)
|
||||
AC_CHECK_FUNCS(cfgetispeed cfgetospeed cfsetispeed cfsetospeed chdir chmod chown dup dup2 fchmod fchown fcntl fstat fstatfs getdirentries getegid geteuid getgid getpid getppid getrusage gettimeofday getuid ioctl kill link lseek lstat mkdir pipe readlink rmdir setreuid setregid stat sigprocmask stat symlink tcgetattr tcsetattr tcsendbreak tcdrain tcflush tcflow tcgetpgrp tcsetpgrp time umask unlink)
|
||||
|
||||
AC_CHECK_HEADERS(string.h strings.h stdlib.h time.h sys/mount.h sys/types.h sys/time.h sys/times.h unistd.h sys/resource.h sys/ioctl.h)
|
||||
AC_CHECK_HEADERS(fcntl.h stdlib.h string.h strings.h sys/ioctl.h sys/mount.h sys/param.h sys/resource.h sys/stat.h sys/termio.h sys/termios.h sys/time.h sys/times.h sys/types.h time.h unistd.h)
|
||||
AC_HEADER_DIRENT
|
||||
|
||||
AC_OUTPUT(Makefile,
|
||||
|
@ -123,11 +123,32 @@ emul_write_status(cpu *processor,
|
||||
int status,
|
||||
int errno)
|
||||
{
|
||||
cpu_registers(processor)->gpr[3] = status;
|
||||
if (status < 0)
|
||||
cpu_registers(processor)->gpr[0] = errno;
|
||||
else
|
||||
cpu_registers(processor)->gpr[0] = 0;
|
||||
if (status == -1 && errno != 0) {
|
||||
cpu_registers(processor)->gpr[3] = errno;
|
||||
CR_SET(0, cr_i_summary_overflow);
|
||||
}
|
||||
else {
|
||||
cpu_registers(processor)->gpr[3] = status;
|
||||
CR_SET(0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
INLINE_EMUL_GENERIC void
|
||||
emul_write2_status(cpu *processor,
|
||||
int status1,
|
||||
int status2,
|
||||
int errno)
|
||||
{
|
||||
if (status1 == -1 && errno != 0) {
|
||||
cpu_registers(processor)->gpr[3] = errno;
|
||||
CR_SET(0, cr_i_summary_overflow);
|
||||
}
|
||||
else {
|
||||
cpu_registers(processor)->gpr[3] = status1;
|
||||
cpu_registers(processor)->gpr[4] = status2;
|
||||
CR_SET(0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -201,8 +222,13 @@ emul_do_system_call(os_emul_data *emul_data,
|
||||
error("do_call() os_emul call %d out-of-range\n", call);
|
||||
|
||||
handler = emul->syscall_descriptor[call].handler;
|
||||
if (handler == NULL)
|
||||
error("do_call() unimplemented call %d\n", call);
|
||||
if (handler == NULL) {
|
||||
if (emul->syscall_descriptor[call].name) {
|
||||
error("do_call() unimplemented call %s\n", emul->syscall_descriptor[call].name);
|
||||
} else {
|
||||
error("do_call() unimplemented call %d\n", call);
|
||||
}
|
||||
}
|
||||
|
||||
if (WITH_TRACE && ppc_trace[trace_os_emul])
|
||||
emul_syscall_enter(emul, call, arg0, processor, cia);
|
||||
@ -269,6 +295,9 @@ emul_add_tree_options(device *tree,
|
||||
INLINE_EMUL_GENERIC void
|
||||
emul_add_tree_hardware(device *root)
|
||||
{
|
||||
int i;
|
||||
int nr_cpus = device_find_integer_property(root, "/openprom/options/smp");
|
||||
|
||||
/* add some memory */
|
||||
if (device_tree_find_device(root, "/memory") == NULL) {
|
||||
unsigned_word memory_size =
|
||||
@ -277,19 +306,30 @@ emul_add_tree_hardware(device *root)
|
||||
(unsigned long)memory_size);
|
||||
/* what about allocated? */
|
||||
}
|
||||
/* an eeprom */
|
||||
device_tree_add_parsed(root, "/openprom/eeprom@0xfff00000/reg { 0xfff00000 0x3000");
|
||||
/* the IO bus */
|
||||
device_tree_add_parsed(root, "/iobus@0x400000/reg { 0x400000 0x400000");
|
||||
device_tree_add_parsed(root, "/iobus/console@0x000000/reg { 0x000000 16");
|
||||
device_tree_add_parsed(root, "/iobus/halt@0x100000/reg { 0x100000 4");
|
||||
device_tree_add_parsed(root, "/iobus/icu@0x200000/reg { 0x200000 8");
|
||||
device_tree_add_parsed(root, "/iobus/icu > 0 0 /iobus/icu");
|
||||
device_tree_add_parsed(root, "/iobus/icu > 1 1 /iobus/icu");
|
||||
|
||||
/* our processors */
|
||||
for (i = 0; i < nr_cpus; i++) {
|
||||
device_tree_add_parsed(root, "/cpus/cpu@%d/cpu-nr %d", i, i);
|
||||
}
|
||||
|
||||
/* a fake eeprom - need to be able to write to it */
|
||||
device_tree_add_parsed(root, "/openprom/memory@0xfff00000/reg { 0xfff00000 0x3000");
|
||||
|
||||
/* A local bus containing basic devices */
|
||||
device_tree_add_parsed(root, "/iobus@0xf0000000/reg { 0xf0000000 0x0f000000");
|
||||
device_tree_add_parsed(root, "/iobus/nvram@0x0/reg { 0 0x1000");
|
||||
device_tree_add_parsed(root, "/iobus/nvram/timezone 600");
|
||||
|
||||
/* the debugging pal. Wire interrupts up directly */
|
||||
device_tree_add_parsed(root, "/iobus/pal@0x0x1000/reg { 0x1000 32");
|
||||
for (i = 0; i < nr_cpus; i++) {
|
||||
device_tree_add_parsed(root, "/iobus/pal > %d int /cpus/cpu@%d", i, i);
|
||||
}
|
||||
|
||||
/* chosen etc */
|
||||
device_tree_add_parsed(root, "/chosen/stdin */iobus/console");
|
||||
device_tree_add_parsed(root, "/chosen/stdin */iobus/pal");
|
||||
device_tree_add_parsed(root, "/chosen/stdout !/chosen/stdin");
|
||||
device_tree_add_parsed(root, "/chosen/memory */memory");
|
||||
}
|
||||
|
||||
#endif /* _SYSTEM_C_ */
|
||||
#endif /* _EMUL_GENERIC_C_ */
|
||||
|
@ -1422,4 +1422,4 @@ const os_emul emul_netbsd = {
|
||||
0 /*data*/
|
||||
};
|
||||
|
||||
#endif _EMUL_NETBSD_C_
|
||||
#endif /* _EMUL_NETBSD_C_ */
|
||||
|
2525
sim/ppc/emul_unix.c
Normal file
2525
sim/ppc/emul_unix.c
Normal file
File diff suppressed because it is too large
Load Diff
28
sim/ppc/emul_unix.h
Normal file
28
sim/ppc/emul_unix.h
Normal file
@ -0,0 +1,28 @@
|
||||
/* This file is part of the program psim.
|
||||
|
||||
Copyright (C) 1996, Andrew Cagney <cagney@highland.com.au>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _EMUL_UNIX_H_
|
||||
#define _EMUL_UNIX_H_
|
||||
|
||||
extern const os_emul emul_solaris;
|
||||
extern const os_emul emul_linux;
|
||||
|
||||
#endif
|
@ -155,6 +155,8 @@ psim_usage(int verbose)
|
||||
printf_filtered("\t Can be any of the following:\n");
|
||||
printf_filtered("\t bug - OEA + MOTO BUG ROM calls\n");
|
||||
printf_filtered("\t netbsd - UEA + NetBSD system calls\n");
|
||||
printf_filtered("\t solaris - UEA + Solaris system calls\n");
|
||||
printf_filtered("\t linux - UEA + Linux system calls\n");
|
||||
printf_filtered("\t chirp - OEA + a few OpenBoot calls\n");
|
||||
printf_filtered("\n"); }
|
||||
printf_filtered("\t-i Print instruction counting statistics\n");
|
||||
@ -353,7 +355,6 @@ psim_create(const char *file_name,
|
||||
for (cpu_nr = 0; cpu_nr < MAX_NR_PROCESSORS; cpu_nr++) {
|
||||
system->processors[cpu_nr] = cpu_create(system,
|
||||
system->memory,
|
||||
system->events,
|
||||
mon_cpu(system->monitor,
|
||||
cpu_nr),
|
||||
system->os_emulation,
|
||||
@ -404,15 +405,16 @@ INLINE_PSIM\
|
||||
(void)
|
||||
psim_halt(psim *system,
|
||||
int current_cpu,
|
||||
unsigned_word cia,
|
||||
stop_reason reason,
|
||||
int signal)
|
||||
{
|
||||
ASSERT(current_cpu >= 0 && current_cpu < system->nr_cpus);
|
||||
system->last_cpu = current_cpu;
|
||||
system->halt_status.cpu_nr = current_cpu;
|
||||
system->halt_status.reason = reason;
|
||||
system->halt_status.signal = signal;
|
||||
system->halt_status.program_counter = cia;
|
||||
system->halt_status.program_counter =
|
||||
cpu_get_program_counter(system->processors[current_cpu]);
|
||||
longjmp(*(jmp_buf*)(system->path_to_halt), current_cpu + 1);
|
||||
}
|
||||
|
||||
@ -444,6 +446,13 @@ psim_device(psim *system,
|
||||
return device_tree_find_device(system->devices, path);
|
||||
}
|
||||
|
||||
INLINE_PSIM\
|
||||
(event_queue *)
|
||||
psim_event_queue(psim *system)
|
||||
{
|
||||
return system->events;
|
||||
}
|
||||
|
||||
|
||||
|
||||
INLINE_PSIM\
|
||||
|
Loading…
Reference in New Issue
Block a user