summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2002-10-21 09:32:14 +0000
committerThomas Schwinge <tschwinge@gnu.org>2009-06-17 23:50:19 +0200
commite5b75ecd7efb550bac974ce6968f022aa2a19d69 (patch)
treedf2479991380b57f0cf75ff69c2aa9643a81c63b
parenta521aa9beb2e0ebba012ce34af93d0280eec6321 (diff)
2002-10-21 Roland McGrath <roland@frob.com>
* configure.in: Check for oskit/dev/stream.h. * configure, config.h.in: Regenerated. * oskit/ds_routines.c (dev_open_com): Query for an oskit_streamdev_t and open it.
-rw-r--r--config.h.in3
-rwxr-xr-xconfigure47
-rw-r--r--configure.in2
-rw-r--r--oskit/ds_routines.c29
4 files changed, 78 insertions, 3 deletions
diff --git a/config.h.in b/config.h.in
index d391df81..3c60e134 100644
--- a/config.h.in
+++ b/config.h.in
@@ -7,3 +7,6 @@
/* Define this to nonzero to enable the software FPU emulator,
used on machines that have no FPU. */
#undef FPE
+
+/* Define if you have the <oskit/dev/stream.h> header file. */
+#undef HAVE_OSKIT_DEV_STREAM_H
diff --git a/configure b/configure
index bc7b2792..3b1f3fb8 100755
--- a/configure
+++ b/configure
@@ -1257,10 +1257,51 @@ else
echo "$ac_t""yes, ok" 1>&6
fi
+for ac_hdr in oskit/dev/stream.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:1265: checking for $ac_hdr" >&5
+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 1270 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:1275: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=yes"
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+
SMP_LIBS=
if test $MAXCPUS -gt 1; then
echo $ac_n "checking for smp_init in -loskit_smp""... $ac_c" 1>&6
-echo "configure:1264: checking for smp_init in -loskit_smp" >&5
+echo "configure:1305: checking for smp_init in -loskit_smp" >&5
ac_lib_var=`echo oskit_smp'_'smp_init | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1268,7 +1309,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-loskit_smp $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1272 "configure"
+#line 1313 "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
@@ -1279,7 +1320,7 @@ int main() {
smp_init()
; return 0; }
EOF
-if { (eval echo configure:1283: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1324: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
diff --git a/configure.in b/configure.in
index 89a3b199..41e9280b 100644
--- a/configure.in
+++ b/configure.in
@@ -96,6 +96,8 @@ else
AC_MSG_RESULT([yes, ok])
fi
+AC_CHECK_HEADERS(oskit/dev/stream.h)
+
AC_SUBST(SMP_LIBS)SMP_LIBS=
if test $MAXCPUS -gt 1; then
AC_CHECK_LIB(oskit_smp, smp_init, [SMP_LIBS=-loskit_smp], [
diff --git a/oskit/ds_routines.c b/oskit/ds_routines.c
index 1af34757..c674e0cd 100644
--- a/oskit/ds_routines.c
+++ b/oskit/ds_routines.c
@@ -49,6 +49,9 @@
#include <oskit/unsupp/bus_walk.h>
#include <oskit/dev/bus.h>
#include <oskit/dev/blk.h>
+#ifdef HAVE_OSKIT_DEV_STREAM_H
+# include <oskit/dev/stream.h>
+#endif
#include <oskit/dev/net.h>
#include <oskit/dev/linux.h>
#include <oskit/com/stream.h>
@@ -401,6 +404,9 @@ dev_open_com (oskit_device_t *com_device, dev_mode_t mode, device_t *devp,
oskit_bus_t *bus;
oskit_blkdev_t *blkdev;
oskit_netdev_t *netdev;
+#ifdef oskit_streamdev_open
+ oskit_streamdev_t *streamdev;
+#endif
oskit_error_t rc;
inline void asyncio_init (device_t dev)
{
@@ -465,6 +471,29 @@ dev_open_com (oskit_device_t *com_device, dev_mode_t mode, device_t *devp,
ops = &net_device_ops;
rc = ds_netdev_open (dev, netdev);
}
+#ifdef oskit_streamdev_open
+ else if (oskit_device_query (com_device, &oskit_streamdev_iid,
+ (void **) &streamdev) == 0)
+ {
+ rc = oskit_streamdev_open (streamdev,
+ ((mode & D_READ) ? OSKIT_DEV_OPEN_READ : 0)
+ | ((mode & D_WRITE)
+ ? OSKIT_DEV_OPEN_WRITE : 0),
+ &dev->com.stream.io);
+ oskit_streamdev_release (streamdev);
+ if (OSKIT_SUCCEEDED (rc))
+ {
+ if (oskit_stream_query (dev->com.stream.io, &oskit_asyncio_iid,
+ (void **) &dev->com.stream.aio) == 0)
+ {
+ asyncio_init (dev);
+ ops = &asyncio_device_ops;
+ }
+ else
+ ops = &stream_device_ops;
+ }
+ }
+#endif
if (OSKIT_FAILED (rc))
{