Add support for module(9).

This commit is contained in:
jruoho 2010-10-25 17:06:58 +00:00
parent a60aadf22e
commit 9fad28a567
4 changed files with 121 additions and 9 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: acpi_display.c,v 1.1 2010/10/12 19:10:50 gsutre Exp $ */
/* $NetBSD: acpi_display.c,v 1.2 2010/10/25 17:06:58 jruoho Exp $ */
/*-
* Copyright (c) 2010 The NetBSD Foundation, Inc.
@ -66,11 +66,12 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: acpi_display.c,v 1.1 2010/10/12 19:10:50 gsutre Exp $");
__KERNEL_RCSID(0, "$NetBSD: acpi_display.c,v 1.2 2010/10/25 17:06:58 jruoho Exp $");
#include <sys/param.h>
#include <sys/device.h>
#include <sys/kmem.h>
#include <sys/module.h>
#include <sys/mutex.h>
#include <sys/sysctl.h>
#include <sys/systm.h>
@ -2004,3 +2005,30 @@ acpidisp_array_search(const uint8_t *a, uint16_t n, int v, uint8_t *l, uint8_t *
*u = a[j];
return;
}
#ifdef _MODULE
MODULE(MODULE_CLASS_DRIVER, acpivga, NULL);
#include "ioconf.c"
static int
acpivga_modcmd(modcmd_t cmd, void *context)
{
switch (cmd) {
case MODULE_CMD_INIT:
return config_init_component(cfdriver_ioconf_acpivga,
cfattach_ioconf_acpivga, cfdata_ioconf_acpivga);
case MODULE_CMD_FINI:
return config_fini_component(cfdriver_ioconf_acpivga,
cfattach_ioconf_acpivga, cfdata_ioconf_acpivga);
default:
return ENOTTY;
}
}
#endif /* _MODULE */

View File

@ -1,4 +1,4 @@
/* $NetBSD: acpi_tz.c,v 1.74 2010/06/07 17:28:17 jruoho Exp $ */
/* $NetBSD: acpi_tz.c,v 1.75 2010/10/25 17:06:58 jruoho Exp $ */
/*
* Copyright (c) 2003 Jared D. McNeill <jmcneill@invisible.ca>
@ -30,12 +30,13 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: acpi_tz.c,v 1.74 2010/06/07 17:28:17 jruoho Exp $");
__KERNEL_RCSID(0, "$NetBSD: acpi_tz.c,v 1.75 2010/10/25 17:06:58 jruoho Exp $");
#include <sys/param.h>
#include <sys/device.h>
#include <sys/callout.h>
#include <sys/kernel.h>
#include <sys/module.h>
#include <sys/systm.h>
#include <dev/acpi/acpireg.h>
@ -796,3 +797,30 @@ acpitz_get_limits(struct sysmon_envsys *sme, envsys_data_t *edata,
break;
}
}
#ifdef _MODULE
MODULE(MODULE_CLASS_DRIVER, acpitz, NULL);
#include "ioconf.c"
static int
acpitz_modcmd(modcmd_t cmd, void *context)
{
switch (cmd) {
case MODULE_CMD_INIT:
return config_init_component(cfdriver_ioconf_acpitz,
cfattach_ioconf_acpitz, cfdata_ioconf_acpitz);
case MODULE_CMD_FINI:
return config_fini_component(cfdriver_ioconf_acpitz,
cfattach_ioconf_acpitz, cfdata_ioconf_acpitz);
default:
return ENOTTY;
}
}
#endif /* _MODULE */

View File

@ -1,4 +1,4 @@
/* $NetBSD: atk0110.c,v 1.12 2010/07/28 16:02:33 jruoho Exp $ */
/* $NetBSD: atk0110.c,v 1.13 2010/10/25 17:06:58 jruoho Exp $ */
/* $OpenBSD: atk0110.c,v 1.1 2009/07/23 01:38:16 cnst Exp $ */
/*
@ -18,10 +18,11 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: atk0110.c,v 1.12 2010/07/28 16:02:33 jruoho Exp $");
__KERNEL_RCSID(0, "$NetBSD: atk0110.c,v 1.13 2010/10/25 17:06:58 jruoho Exp $");
#include <sys/param.h>
#include <sys/malloc.h>
#include <sys/module.h>
#include <sys/systm.h>
#include <dev/acpi/acpireg.h>
@ -414,3 +415,30 @@ aibs_get_limits(struct sysmon_envsys *sme, envsys_data_t *edata,
break;
}
}
#ifdef _MODULE
MODULE(MODULE_CLASS_DRIVER, aibs, NULL);
#include "ioconf.c"
static int
aibs_modcmd(modcmd_t cmd, void *context)
{
switch (cmd) {
case MODULE_CMD_INIT:
return config_init_component(cfdriver_ioconf_aibs,
cfattach_ioconf_aibs, cfdata_ioconf_aibs);
case MODULE_CMD_FINI:
return config_fini_component(cfdriver_ioconf_aibs,
cfattach_ioconf_aibs, cfdata_ioconf_aibs);
default:
return ENOTTY;
}
}
#endif /* _MODULE */

View File

@ -1,4 +1,4 @@
/* $NetBSD: dalb_acpi.c,v 1.15 2010/04/24 19:36:14 jruoho Exp $ */
/* $NetBSD: dalb_acpi.c,v 1.16 2010/10/25 17:06:58 jruoho Exp $ */
/*-
* Copyright (c) 2008 Christoph Egger <cegger@netbsd.org>
@ -27,7 +27,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: dalb_acpi.c,v 1.15 2010/04/24 19:36:14 jruoho Exp $");
__KERNEL_RCSID(0, "$NetBSD: dalb_acpi.c,v 1.16 2010/10/25 17:06:58 jruoho Exp $");
/*
* Direct Application Launch Button:
@ -36,6 +36,7 @@ __KERNEL_RCSID(0, "$NetBSD: dalb_acpi.c,v 1.15 2010/04/24 19:36:14 jruoho Exp $"
#include <sys/param.h>
#include <sys/device.h>
#include <sys/module.h>
#include <sys/systm.h>
#include <dev/acpi/acpireg.h>
@ -197,7 +198,7 @@ acpi_dalb_notify_handler(ACPI_HANDLE hdl, uint32_t notify, void *opaque)
case DALB_SYSTEM_RUNTIME:
rv = AcpiOsExecute(OSL_NOTIFY_HANDLER,
acpi_dalb_get_runtime_hotkeys, dev);
break;
break;
default:
aprint_error_dev(dev,
@ -259,3 +260,30 @@ acpi_dalb_resume(device_t dev, const pmf_qual_t *qual)
return true;
}
#ifdef _MODULE
MODULE(MODULE_CLASS_DRIVER, acpidalb, NULL);
#include "ioconf.c"
static int
acpidalb_modcmd(modcmd_t cmd, void *context)
{
switch (cmd) {
case MODULE_CMD_INIT:
return config_init_component(cfdriver_ioconf_acpidalb,
cfattach_ioconf_acpidalb, cfdata_ioconf_acpidalb);
case MODULE_CMD_FINI:
return config_fini_component(cfdriver_ioconf_acpidalb,
cfattach_ioconf_acpidalb, cfdata_ioconf_acpidalb);
default:
return ENOTTY;
}
}
#endif /* _MODULE */