summaryrefslogtreecommitdiffstats
path: root/sys/i386
diff options
context:
space:
mode:
authormsmith <msmith@FreeBSD.org>1999-08-21 06:24:40 +0000
committermsmith <msmith@FreeBSD.org>1999-08-21 06:24:40 +0000
commitb51f157bff8b959d943b0836a1c57f065b9318d5 (patch)
treee447ab34080a4d202ed41db3476df31ef1f56a50 /sys/i386
parenta753b272ec1066c690e1ba83c8780af55e3a6c78 (diff)
downloadFreeBSD-src-b51f157bff8b959d943b0836a1c57f065b9318d5.zip
FreeBSD-src-b51f157bff8b959d943b0836a1c57f065b9318d5.tar.gz
Implement a new generic mechanism for attaching handler functions to
events, in order to pave the way for removing a number of the ad-hoc implementations currently in use. Retire the at_shutdown family of functions and replace them with new event handler lists. Rework kern_shutdown.c to take greater advantage of the use of event handlers. Reviewed by: green
Diffstat (limited to 'sys/i386')
-rw-r--r--sys/i386/apm/apm.c8
-rw-r--r--sys/i386/bios/apm.c8
-rw-r--r--sys/i386/isa/if_ie.c9
-rw-r--r--sys/i386/isa/if_wi.c13
4 files changed, 22 insertions, 16 deletions
diff --git a/sys/i386/apm/apm.c b/sys/i386/apm/apm.c
index d2c2264..1beb8b5 100644
--- a/sys/i386/apm/apm.c
+++ b/sys/i386/apm/apm.c
@@ -15,13 +15,14 @@
*
* Sep, 1994 Implemented on FreeBSD 1.1.5.1R (Toshiba AVS001WD)
*
- * $Id: apm.c,v 1.98 1999/08/02 18:46:34 msmith Exp $
+ * $Id: apm.c,v 1.99 1999/08/14 18:39:40 iwasaki Exp $
*/
#include "opt_devfs.h"
#include <sys/param.h>
#include <sys/systm.h>
+#include <sys/eventhandler.h>
#include <sys/conf.h>
#include <sys/kernel.h>
#ifdef DEVFS
@@ -302,7 +303,7 @@ apm_display(int newstate)
* Turn off the entire system.
*/
static void
-apm_power_off(int howto, void *junk)
+apm_power_off(void *junk, int howto)
{
struct apm_softc *sc = &apm_softc;
@@ -1047,7 +1048,8 @@ apm_attach(device_t dev)
apm_hook_establish(APM_HOOK_RESUME , &sc->sc_resume);
/* Power the system off using APM */
- at_shutdown_pri(apm_power_off, NULL, SHUTDOWN_FINAL, SHUTDOWN_PRI_LAST);
+ EVENTHANDLER_REGISTER(shutdown_final, apm_power_off, NULL,
+ SHUTDOWN_PRI_LAST);
sc->initialized = 1;
diff --git a/sys/i386/bios/apm.c b/sys/i386/bios/apm.c
index d2c2264..1beb8b5 100644
--- a/sys/i386/bios/apm.c
+++ b/sys/i386/bios/apm.c
@@ -15,13 +15,14 @@
*
* Sep, 1994 Implemented on FreeBSD 1.1.5.1R (Toshiba AVS001WD)
*
- * $Id: apm.c,v 1.98 1999/08/02 18:46:34 msmith Exp $
+ * $Id: apm.c,v 1.99 1999/08/14 18:39:40 iwasaki Exp $
*/
#include "opt_devfs.h"
#include <sys/param.h>
#include <sys/systm.h>
+#include <sys/eventhandler.h>
#include <sys/conf.h>
#include <sys/kernel.h>
#ifdef DEVFS
@@ -302,7 +303,7 @@ apm_display(int newstate)
* Turn off the entire system.
*/
static void
-apm_power_off(int howto, void *junk)
+apm_power_off(void *junk, int howto)
{
struct apm_softc *sc = &apm_softc;
@@ -1047,7 +1048,8 @@ apm_attach(device_t dev)
apm_hook_establish(APM_HOOK_RESUME , &sc->sc_resume);
/* Power the system off using APM */
- at_shutdown_pri(apm_power_off, NULL, SHUTDOWN_FINAL, SHUTDOWN_PRI_LAST);
+ EVENTHANDLER_REGISTER(shutdown_final, apm_power_off, NULL,
+ SHUTDOWN_PRI_LAST);
sc->initialized = 1;
diff --git a/sys/i386/isa/if_ie.c b/sys/i386/isa/if_ie.c
index f9b155a..b7e04df 100644
--- a/sys/i386/isa/if_ie.c
+++ b/sys/i386/isa/if_ie.c
@@ -47,7 +47,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: if_ie.c,v 1.64 1999/08/20 14:12:13 mdodd Exp $
+ * $Id: if_ie.c,v 1.65 1999/08/20 14:36:40 mdodd Exp $
*/
/*
@@ -190,7 +190,7 @@ static void ee16_eeprom_outbits(struct ie_softc * ie, int edata, int cnt);
static void ee16_eeprom_clock(struct ie_softc * ie, int state);
static u_short ee16_read_eeprom(struct ie_softc * ie, int location);
static int ee16_eeprom_inbits(struct ie_softc * ie);
-static void ee16_shutdown(int howto, void *sc);
+static void ee16_shutdown(void *sc, int howto);
static void iereset(int unit);
static void ie_readframe(int unit, struct ie_softc * ie, int bufno);
@@ -550,7 +550,7 @@ ni_probe(struct isa_device *dvp)
static void
-ee16_shutdown(int howto, void *sc)
+ee16_shutdown(void *sc, int howto)
{
struct ie_softc *ie = (struct ie_softc *)sc;
int unit = ie - &ie_softc[0];
@@ -832,7 +832,8 @@ ieattach(struct isa_device *dvp)
ifp->if_hdrlen = 14;
if (ie->hard_type == IE_EE16)
- at_shutdown(ee16_shutdown, ie, SHUTDOWN_POST_SYNC);
+ EVENTHANDLER_REGISTER(shutdown_post_sync, ee16_shutdown,
+ ie, SHUTDOWN_PRI_DEFAULT);
#if NBPF > 0
bpfattach(ifp, DLT_EN10MB, sizeof(struct ether_header));
diff --git a/sys/i386/isa/if_wi.c b/sys/i386/isa/if_wi.c
index 4e2b2cf..5b6467f 100644
--- a/sys/i386/isa/if_wi.c
+++ b/sys/i386/isa/if_wi.c
@@ -29,7 +29,7 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: if_wi.c,v 1.7 1999/07/04 14:40:22 wpaul Exp $
+ * $Id: if_wi.c,v 1.8 1999/07/06 19:22:53 des Exp $
*/
/*
@@ -116,7 +116,7 @@
#if !defined(lint)
static const char rcsid[] =
- "$Id: if_wi.c,v 1.7 1999/07/04 14:40:22 wpaul Exp $";
+ "$Id: if_wi.c,v 1.8 1999/07/06 19:22:53 des Exp $";
#endif
static struct wi_softc wi_softc[NWI];
@@ -136,7 +136,7 @@ static void wi_init __P((void *));
static void wi_start __P((struct ifnet *));
static void wi_stop __P((struct wi_softc *));
static void wi_watchdog __P((struct ifnet *));
-static void wi_shutdown __P((int, void *));
+static void wi_shutdown __P((void *, int));
static void wi_rxeof __P((struct wi_softc *));
static void wi_txeof __P((struct wi_softc *, int));
static void wi_update_stats __P((struct wi_softc *));
@@ -367,7 +367,8 @@ static int wi_attach(isa_dev)
bpfattach(ifp, DLT_EN10MB, sizeof(struct ether_header));
#endif
- at_shutdown(wi_shutdown, sc, SHUTDOWN_POST_SYNC);
+ EVENTHANDLER_REGISTER(shutdown_post_sync, wi_shutdown, sc,
+ SHUTDOWN_PRI_DEFAULT);
}
return(0);
@@ -1336,9 +1337,9 @@ static void wi_watchdog(ifp)
return;
}
-static void wi_shutdown(howto, arg)
- int howto;
+static void wi_shutdown(arg, howto)
void *arg;
+ int howto;
{
struct wi_softc *sc;
OpenPOWER on IntegriCloud