Staticise devclasses and some unnecessarily global variables.
This commit is contained in:
parent
0f6f526c97
commit
3273b00523
@ -61,7 +61,7 @@
|
||||
|
||||
extern void initializecpu(void);
|
||||
|
||||
struct region_descriptor r_idt, r_gdt, *p_gdt;
|
||||
static struct region_descriptor r_idt, r_gdt, *p_gdt;
|
||||
static u_int16_t r_ldt;
|
||||
|
||||
static u_int32_t r_eax, r_ebx, r_ecx, r_edx, r_ebp, r_esi, r_edi,
|
||||
|
@ -57,7 +57,7 @@ AcpiOsInstallInterruptHandler(UINT32 InterruptNumber, OSD_HANDLER ServiceRoutine
|
||||
|
||||
FUNCTION_TRACE(__func__);
|
||||
|
||||
if ((sc = devclass_get_softc(acpi_devclass, 0)) == NULL)
|
||||
if ((sc = devclass_get_softc(devclass_find("acpi"), 0)) == NULL)
|
||||
panic("can't find ACPI device to register interrupt");
|
||||
if (sc->acpi_dev == NULL)
|
||||
panic("acpi softc has invalid device");
|
||||
@ -108,7 +108,7 @@ AcpiOsRemoveInterruptHandler (UINT32 InterruptNumber, OSD_HANDLER ServiceRoutine
|
||||
if (ServiceRoutine == NULL)
|
||||
return_ACPI_STATUS(AE_BAD_PARAMETER);
|
||||
|
||||
if ((sc = devclass_get_softc(acpi_devclass, 0)) == NULL)
|
||||
if ((sc = devclass_get_softc(find_devclass("acpi"), 0)) == NULL)
|
||||
panic("can't find ACPI device to deregister interrupt");
|
||||
|
||||
if (sc->acpi_irq == NULL)
|
||||
|
@ -168,7 +168,7 @@ static driver_t acpi_driver = {
|
||||
sizeof(struct acpi_softc),
|
||||
};
|
||||
|
||||
devclass_t acpi_devclass;
|
||||
static devclass_t acpi_devclass;
|
||||
DRIVER_MODULE(acpi, nexus, acpi_driver, acpi_devclass, acpi_modevent, 0);
|
||||
MODULE_VERSION(acpi, 100);
|
||||
|
||||
|
@ -183,7 +183,7 @@ acpi_battery_init(void)
|
||||
struct acpi_softc *sc;
|
||||
int error;
|
||||
|
||||
if ((dev = devclass_get_device(acpi_devclass, 0)) == NULL) {
|
||||
if ((dev = devclass_get_device(devclass_find("acpi"), 0)) == NULL) {
|
||||
return (ENXIO);
|
||||
}
|
||||
if ((sc = device_get_softc(dev)) == NULL) {
|
||||
|
@ -71,7 +71,7 @@ static driver_t acpi_button_driver = {
|
||||
sizeof(struct acpi_button_softc),
|
||||
};
|
||||
|
||||
devclass_t acpi_button_devclass;
|
||||
static devclass_t acpi_button_devclass;
|
||||
DRIVER_MODULE(acpi_button, acpi, acpi_button_driver, acpi_button_devclass, 0, 0);
|
||||
|
||||
static int
|
||||
|
@ -116,7 +116,7 @@ static driver_t acpi_cpu_driver = {
|
||||
sizeof(struct acpi_cpu_softc),
|
||||
};
|
||||
|
||||
devclass_t acpi_cpu_devclass;
|
||||
static devclass_t acpi_cpu_devclass;
|
||||
DRIVER_MODULE(acpi_cpu, acpi, acpi_cpu_driver, acpi_cpu_devclass, 0, 0);
|
||||
|
||||
static int
|
||||
|
@ -308,7 +308,7 @@ static driver_t acpi_ec_driver = {
|
||||
sizeof(struct acpi_ec_softc),
|
||||
};
|
||||
|
||||
devclass_t acpi_ec_devclass;
|
||||
static devclass_t acpi_ec_devclass;
|
||||
DRIVER_MODULE(acpi_ec, acpi, acpi_ec_driver, acpi_ec_devclass, 0, 0);
|
||||
|
||||
/*
|
||||
|
@ -72,7 +72,7 @@ static driver_t acpi_lid_driver = {
|
||||
sizeof(struct acpi_lid_softc),
|
||||
};
|
||||
|
||||
devclass_t acpi_lid_devclass;
|
||||
static devclass_t acpi_lid_devclass;
|
||||
DRIVER_MODULE(acpi_lid, acpi, acpi_lid_driver, acpi_lid_devclass, 0, 0);
|
||||
|
||||
static int
|
||||
|
@ -100,7 +100,7 @@ static driver_t acpi_pcib_driver = {
|
||||
sizeof(struct acpi_pcib_softc),
|
||||
};
|
||||
|
||||
devclass_t acpi_pcib_devclass;
|
||||
static devclass_t acpi_pcib_devclass;
|
||||
DRIVER_MODULE(acpi_pcib, acpi, acpi_pcib_driver, acpi_pcib_devclass, 0, 0);
|
||||
|
||||
static int
|
||||
|
@ -100,7 +100,7 @@ static driver_t acpi_pcib_driver = {
|
||||
sizeof(struct acpi_pcib_softc),
|
||||
};
|
||||
|
||||
devclass_t acpi_pcib_devclass;
|
||||
static devclass_t acpi_pcib_devclass;
|
||||
DRIVER_MODULE(acpi_pcib, acpi, acpi_pcib_driver, acpi_pcib_devclass, 0, 0);
|
||||
|
||||
static int
|
||||
|
@ -112,8 +112,8 @@ struct acpi_powerresource {
|
||||
ACPI_INTEGER ap_order;
|
||||
};
|
||||
|
||||
TAILQ_HEAD(acpi_powerresource_list, acpi_powerresource) acpi_powerresources;
|
||||
TAILQ_HEAD(acpi_powerconsumer_list, acpi_powerconsumer) acpi_powerconsumers;
|
||||
static TAILQ_HEAD(acpi_powerresource_list, acpi_powerresource) acpi_powerresources;
|
||||
static TAILQ_HEAD(acpi_powerconsumer_list, acpi_powerconsumer) acpi_powerconsumers;
|
||||
|
||||
static ACPI_STATUS acpi_pwr_register_consumer(ACPI_HANDLE consumer);
|
||||
static ACPI_STATUS acpi_pwr_deregister_consumer(ACPI_HANDLE consumer);
|
||||
|
@ -535,7 +535,7 @@ static driver_t acpi_sysresource_driver = {
|
||||
0,
|
||||
};
|
||||
|
||||
devclass_t acpi_sysresource_devclass;
|
||||
static devclass_t acpi_sysresource_devclass;
|
||||
DRIVER_MODULE(acpi_sysresource, acpi, acpi_sysresource_driver, acpi_sysresource_devclass, 0, 0);
|
||||
|
||||
static int
|
||||
|
@ -122,7 +122,7 @@ static driver_t acpi_tz_driver = {
|
||||
sizeof(struct acpi_tz_softc),
|
||||
};
|
||||
|
||||
devclass_t acpi_tz_devclass;
|
||||
static devclass_t acpi_tz_devclass;
|
||||
DRIVER_MODULE(acpi_tz, acpi, acpi_tz_driver, acpi_tz_devclass, 0, 0);
|
||||
|
||||
static struct sysctl_ctx_list acpi_tz_sysctl_ctx;
|
||||
|
@ -88,7 +88,7 @@ static driver_t acpi_timer_driver = {
|
||||
0,
|
||||
};
|
||||
|
||||
devclass_t acpi_timer_devclass;
|
||||
static devclass_t acpi_timer_devclass;
|
||||
DRIVER_MODULE(acpi_timer, acpi, acpi_timer_driver, acpi_timer_devclass, 0, 0);
|
||||
|
||||
/*
|
||||
|
@ -35,8 +35,6 @@
|
||||
#include <machine/bus.h>
|
||||
#include <machine/resource.h>
|
||||
|
||||
extern devclass_t acpi_devclass;
|
||||
|
||||
struct acpi_softc {
|
||||
device_t acpi_dev;
|
||||
dev_t acpi_dev_t;
|
||||
|
@ -61,7 +61,7 @@
|
||||
|
||||
extern void initializecpu(void);
|
||||
|
||||
struct region_descriptor r_idt, r_gdt, *p_gdt;
|
||||
static struct region_descriptor r_idt, r_gdt, *p_gdt;
|
||||
static u_int16_t r_ldt;
|
||||
|
||||
static u_int32_t r_eax, r_ebx, r_ecx, r_edx, r_ebp, r_esi, r_edi,
|
||||
|
Loading…
Reference in New Issue
Block a user