diff options
-rw-r--r-- | sys/dev/streams/streams.c | 29 | ||||
-rw-r--r-- | sys/modules/Makefile | 5 | ||||
-rw-r--r-- | sys/modules/svr4/svr4.sh | 12 |
3 files changed, 41 insertions, 5 deletions
diff --git a/sys/dev/streams/streams.c b/sys/dev/streams/streams.c index 248f7ac..eb5d469 100644 --- a/sys/dev/streams/streams.c +++ b/sys/dev/streams/streams.c @@ -146,6 +146,35 @@ typedef struct streams_softc *sc_p; static sc_p sca[NSTREAMS]; +static void +streamsattach(void *dummy) +{ + cdevsw_add_generic(CDEV_MAJOR, CDEV_MAJOR, &streams_cdevsw); +} + +static int +streams_modevent(module_t mod, int type, void *unused) +{ + switch (type) { + case MOD_LOAD: + streamsattach(NULL); + return 0; + case MOD_UNLOAD: + cdevsw[CDEV_MAJOR] = NULL; /* clean up cdev */ + return 0; + default: + break; + } + return 0; +} + +static moduledata_t streams_mod = { + "streams", + streams_modevent, + 0 +}; +DECLARE_MODULE(streams, streams_mod, SI_SUB_DRIVERS, SI_ORDER_ANY); + /* * We only need open() and close() routines. open() calls socreate() * to allocate a "real" object behind the stream and mallocs some state diff --git a/sys/modules/Makefile b/sys/modules/Makefile index dc88aa9..59d56bb 100644 --- a/sys/modules/Makefile +++ b/sys/modules/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.49 1999/01/30 06:31:51 newton Exp $ +# $Id: Makefile,v 1.50 1999/02/03 04:18:25 semenu Exp $ # XXX present but broken: ip_mroute_mod # XXX not yet completed porting: acd @@ -9,7 +9,8 @@ SUBDIR= ccd cd9660 coda fdesc if_disc if_ppp if_sl if_tun ipfw kernfs \ # XXX some of these can move to the general case when de-i386'ed .if ${MACHINE_ARCH} == "i386" -SUBDIR+=atapi coff fpu gnufpu ibcs2 joy linux lkm pcic splash syscons vesa svr4 +SUBDIR+=atapi coff fpu gnufpu ibcs2 joy linux lkm pcic splash streams \ + syscons vesa svr4 .endif .include <bsd.subdir.mk> diff --git a/sys/modules/svr4/svr4.sh b/sys/modules/svr4/svr4.sh index 1d8e694..6acf668 100644 --- a/sys/modules/svr4/svr4.sh +++ b/sys/modules/svr4/svr4.sh @@ -1,12 +1,18 @@ #!/bin/sh -# $Id$ +# $Id: svr4.sh,v 1.1 1999/01/30 06:29:48 newton Exp $ -FOUND=`kldstat -v | egrep 'svr4elf'` +STREAMS=`kldstat -v | egrep 'streams'` +SVR4=`kldstat -v | egrep 'svr4elf'` -if [ "x$FOUND" != x ] ; then +if [ "x$SVR4" != x ] ; then echo SysVR4 driver already loaded exit 1 else + if [ "x$STREAMS" = x ] ; then + kldload streams + echo "Loaded SysVR4 STREAMS driver" + fi kldload svr4 + echo "Loaded SysVR4 emulator" fi |