Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/isa Add module glue.



details:   https://anonhg.NetBSD.org/src/rev/3865b5915878
branches:  trunk
changeset: 772826:3865b5915878
user:      jakllsch <jakllsch%NetBSD.org@localhost>
date:      Tue Jan 17 16:34:52 2012 +0000

description:
Add module glue.

diffstat:

 sys/dev/isa/wbsio.c |  32 +++++++++++++++++++++++++++++++-
 1 files changed, 31 insertions(+), 1 deletions(-)

diffs (50 lines):

diff -r 28551e8cdb56 -r 3865b5915878 sys/dev/isa/wbsio.c
--- a/sys/dev/isa/wbsio.c       Tue Jan 17 16:32:03 2012 +0000
+++ b/sys/dev/isa/wbsio.c       Tue Jan 17 16:34:52 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: wbsio.c,v 1.5 2012/01/17 16:32:03 jakllsch Exp $       */
+/*     $NetBSD: wbsio.c,v 1.6 2012/01/17 16:34:52 jakllsch Exp $       */
 /*     $OpenBSD: wbsio.c,v 1.5 2009/03/29 21:53:52 sthen Exp $ */
 /*
  * Copyright (c) 2008 Mark Kettenis <kettenis%openbsd.org@localhost>
@@ -23,6 +23,7 @@
 #include <sys/param.h>
 #include <sys/device.h>
 #include <sys/kernel.h>
+#include <sys/module.h>
 #include <sys/systm.h>
 
 #include <sys/bus.h>
@@ -261,3 +262,32 @@
                    ia->ia_io[0].ir_size - 1);
        return (UNCONF);
 }
+
+MODULE(MODULE_CLASS_DRIVER, wbsio, "");
+
+#ifdef _MODULE
+#include "ioconf.c"
+#endif
+
+static int
+wbsio_modcmd(modcmd_t cmd, void *opaque)
+{
+       switch (cmd) {
+       case MODULE_CMD_INIT:
+#ifdef _MODULE
+               return config_init_component(cfdriver_ioconf_wbsio,
+                   cfattach_ioconf_wbsio, cfdata_ioconf_wbsio);
+#else
+               return 0;
+#endif
+       case MODULE_CMD_FINI:
+#ifdef _MODULE
+               return config_fini_component(cfdriver_ioconf_wbsio,
+                   cfattach_ioconf_wbsio, cfdata_ioconf_wbsio);
+#else
+               return 0;
+#endif
+       default:
+               return ENOTTY;
+       }
+}



Home | Main Index | Thread Index | Old Index