aboutsummaryrefslogtreecommitdiff
path: root/sim/ppc
diff options
context:
space:
mode:
authorMichael Meissner <gnu@the-meissners.org>1996-08-12 23:06:21 +0000
committerMichael Meissner <gnu@the-meissners.org>1996-08-12 23:06:21 +0000
commit9aecf50da5ff4a6f6ab62fccac0010bf9519b8b2 (patch)
tree4d5ef09a95ef28d5909de51be6618391f5dd2bd2 /sim/ppc
parentd9538961ccee460bce76d0e940a305c15eb171bf (diff)
downloadgdb-9aecf50da5ff4a6f6ab62fccac0010bf9519b8b2.zip
gdb-9aecf50da5ff4a6f6ab62fccac0010bf9519b8b2.tar.gz
gdb-9aecf50da5ff4a6f6ab62fccac0010bf9519b8b2.tar.bz2
Test whether /dev/zero works before attemping to us it
Diffstat (limited to 'sim/ppc')
-rw-r--r--sim/ppc/ChangeLog14
-rw-r--r--sim/ppc/Makefile.in4
-rw-r--r--sim/ppc/configure.in28
3 files changed, 45 insertions, 1 deletions
diff --git a/sim/ppc/ChangeLog b/sim/ppc/ChangeLog
index e67bdfe..add31b5 100644
--- a/sim/ppc/ChangeLog
+++ b/sim/ppc/ChangeLog
@@ -1,3 +1,17 @@
+Mon Aug 12 18:42:37 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+
+ * configure.in: Test whether /dev/zero works on the system, and if
+ it does, define HAVE_DEVZERO.
+ * configure: Regenerate.
+
+ * emul_generic.c (emul_add_tree_hardware): Do not add /iobus/disk
+ if we don't have a working /dev/zero on the system.
+
+ * emul_bugapi.c (emul_bugapi_init): If HAVE_DEVZERO is not
+ defined, don't add disk support.
+ (emul_bugapi_do_diskio): Ditto.
+ (emul_bugapi_instruction_call): Ditto.
+
Wed Aug 7 14:34:20 1996 Michael Meissner <meissner@tiktok.cygnus.com>
* emul_unix.c (HAVE_TCGETATTR): If HAVE_TERMIOS_STRUCTURE is not
diff --git a/sim/ppc/Makefile.in b/sim/ppc/Makefile.in
index 5ab3c22..1d36f65 100644
--- a/sim/ppc/Makefile.in
+++ b/sim/ppc/Makefile.in
@@ -88,6 +88,7 @@ MODEL_CFLAGS = @sim_model@ @sim_default_model@ @sim_model_issue@
STDIO_CFLAGS = @sim_stdio@
TERMIO_CFLAGS = @sim_termio@
WARNING_CFLAGS = @sim_warnings@
+DEVZERO_CFLAGS = @sim_devzero@
CONFIG_CFLAGS = $(BSWAP_CFLAGS) \
$(ENDIAN_CFLAGS) \
$(REGPARM_CFLAGS) \
@@ -107,7 +108,8 @@ CONFIG_CFLAGS = $(BSWAP_CFLAGS) \
$(MONITOR_CFLAGS) \
$(MODEL_CFLAGS) \
$(STDIO_CFLAGS) \
- $(TERMIO_CFLAGS)
+ $(TERMIO_CFLAGS) \
+ $(DEVZERO_CFLAGS)
STD_CFLAGS = $(CFLAGS) $(INLINE_CFLAGS) $(CONFIG_CFLAGS) $(WARNING_CFLAGS) $(SIM_CFLAGS) $(HDEFINES) $(TDEFINES) $(INCLUDES)
NOWARN_CFLAGS = $(CFLAGS) $(INLINE_CFLAGS) $(CONFIG_CFLAGS) $(SIM_CFLAGS) $(HDEFINES) $(TDEFINES) $(INCLUDES)
diff --git a/sim/ppc/configure.in b/sim/ppc/configure.in
index 1314a93..4924f78 100644
--- a/sim/ppc/configure.in
+++ b/sim/ppc/configure.in
@@ -593,6 +593,33 @@ else
ac_cv_termio_cline=no
fi
+dnl Figure out if /dev/zero exists or not
+sim_devzero=""
+AC_MSG_CHECKING(for /dev/zero)
+AC_CACHE_VAL(ac_cv_devzero,
+[AC_TRY_RUN([#include <fcntl.h>
+main () {
+ char buf[2048];
+ int i;
+ int fd = open ("/dev/zero", O_RDONLY);
+ if (fd < 0)
+ return 1;
+ for (i = 0; i < sizeof (buf); i++)
+ buf[i] = 1;
+ if (read (fd, buf, sizeof (buf)) != sizeof (buf))
+ return 1;
+ for (i = 0; i < sizeof (buf); i++)
+ if (buf[i])
+ return 1;
+ return 0;
+}],[ac_cv_devzero=yes],[ac_cv_devzero=no],[ac_cv_devzero=no])])
+AC_MSG_RESULT($ac_cv_devzero)
+if test $ac_cv_devzero = yes; then
+ sim_devzero="-DHAVE_DEVZERO"
+else
+ sim_devzero=""
+fi
+
AC_SUBST(CC_FOR_BUILD)
AC_SUBST(CFLAGS)
AC_SUBST(HDEFINES)
@@ -637,6 +664,7 @@ AC_SUBST(sim_default_model)
AC_SUBST(sim_model_issue)
AC_SUBST(sim_stdio)
AC_SUBST(sim_termio)
+AC_SUBST(sim_devzero)
AC_OUTPUT(Makefile,
[case x$CONFIG_HEADERS in xconfig.h:config.in) echo > stamp-h ;; esac])