diff --git a/sys/arm/xscale/pxa/pxa_smi.c b/sys/arm/xscale/pxa/pxa_smi.c index 1f18c63dfaa2..f25dac771234 100644 --- a/sys/arm/xscale/pxa/pxa_smi.c +++ b/sys/arm/xscale/pxa/pxa_smi.c @@ -82,6 +82,9 @@ static int pxa_smi_probe(device_t dev) { + if (resource_disabled("smi", device_get_unit(dev))) + return (ENXIO); + device_set_desc(dev, "Static Memory Interface"); return (0); } diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c index 5e0466d08eff..cfe08ed1dbfe 100644 --- a/sys/dev/acpica/acpi.c +++ b/sys/dev/acpica/acpi.c @@ -377,6 +377,10 @@ acpi_identify(void) if (!cold) return (ENXIO); + /* Check that we haven't been disabled with a hint. */ + if (resource_disabled("acpi", 0)) + return (ENXIO); + /* Check for other PM systems. */ if (power_pm_get_type() != POWER_PM_TYPE_NONE && power_pm_get_type() != POWER_PM_TYPE_ACPI) { diff --git a/sys/dev/acpica/acpi_perf.c b/sys/dev/acpica/acpi_perf.c index e7d697cf39cd..3f047cce6b85 100644 --- a/sys/dev/acpica/acpi_perf.c +++ b/sys/dev/acpica/acpi_perf.c @@ -175,6 +175,9 @@ acpi_perf_probe(device_t dev) ACPI_BUFFER buf; int error, rid, type; + if (resource_disabled("acpi_perf", 0)) + return (ENXIO); + /* * Check the performance state registers. If they are of type * "functional fixed hardware", we attach quietly since we will diff --git a/sys/dev/acpica/acpi_throttle.c b/sys/dev/acpica/acpi_throttle.c index 4ac52225296f..40476e02bd98 100644 --- a/sys/dev/acpica/acpi_throttle.c +++ b/sys/dev/acpica/acpi_throttle.c @@ -167,6 +167,9 @@ static int acpi_throttle_probe(device_t dev) { + if (resource_disabled("acpi_throttle", 0)) + return (ENXIO); + /* * On i386 platforms at least, ACPI throttling is accomplished by * the chipset modulating the STPCLK# pin based on the duty cycle. diff --git a/sys/dev/agp/agp_ali.c b/sys/dev/agp/agp_ali.c index 0a4726815ea7..09ebb2bdb6da 100644 --- a/sys/dev/agp/agp_ali.c +++ b/sys/dev/agp/agp_ali.c @@ -81,6 +81,8 @@ agp_ali_probe(device_t dev) { const char *desc; + if (resource_disabled("agp", device_get_unit(dev))) + return (ENXIO); desc = agp_ali_match(dev); if (desc) { device_set_desc(dev, desc); diff --git a/sys/dev/agp/agp_amd.c b/sys/dev/agp/agp_amd.c index 2a9005b02fbc..fabb9b13472c 100644 --- a/sys/dev/agp/agp_amd.c +++ b/sys/dev/agp/agp_amd.c @@ -203,6 +203,8 @@ agp_amd_probe(device_t dev) { const char *desc; + if (resource_disabled("agp", device_get_unit(dev))) + return (ENXIO); desc = agp_amd_match(dev); if (desc) { device_set_desc(dev, desc); diff --git a/sys/dev/agp/agp_amd64.c b/sys/dev/agp/agp_amd64.c index 391ac4a435c1..e2bfa6764541 100644 --- a/sys/dev/agp/agp_amd64.c +++ b/sys/dev/agp/agp_amd64.c @@ -152,6 +152,8 @@ agp_amd64_probe(device_t dev) { const char *desc; + if (resource_disabled("agp", device_get_unit(dev))) + return (ENXIO); if ((desc = agp_amd64_match(dev))) { device_set_desc(dev, desc); return (BUS_PROBE_DEFAULT); diff --git a/sys/dev/agp/agp_apple.c b/sys/dev/agp/agp_apple.c index 2de843ac4786..e16e11489a7a 100644 --- a/sys/dev/agp/agp_apple.c +++ b/sys/dev/agp/agp_apple.c @@ -71,6 +71,9 @@ static int agp_apple_probe(device_t dev) { + if (resource_disabled("agp", device_get_unit(dev))) + return (ENXIO); + if (pci_get_class(dev) != PCIC_BRIDGE || pci_get_subclass(dev) != PCIS_BRIDGE_HOST) return (ENXIO); diff --git a/sys/dev/agp/agp_i810.c b/sys/dev/agp/agp_i810.c index be3448be8aee..39d6cba8a557 100644 --- a/sys/dev/agp/agp_i810.c +++ b/sys/dev/agp/agp_i810.c @@ -860,6 +860,8 @@ agp_i810_probe(device_t dev) const struct agp_i810_match *match; int err; + if (resource_disabled("agp", device_get_unit(dev))) + return (ENXIO); match = agp_i810_match(dev); if (match == NULL) return (ENXIO); diff --git a/sys/dev/agp/agp_intel.c b/sys/dev/agp/agp_intel.c index f69a56d0584b..ac10c8ee1be7 100644 --- a/sys/dev/agp/agp_intel.c +++ b/sys/dev/agp/agp_intel.c @@ -117,6 +117,8 @@ agp_intel_probe(device_t dev) { const char *desc; + if (resource_disabled("agp", device_get_unit(dev))) + return (ENXIO); desc = agp_intel_match(dev); if (desc) { device_set_desc(dev, desc); diff --git a/sys/dev/agp/agp_nvidia.c b/sys/dev/agp/agp_nvidia.c index db726c9ec162..6db87c625bf9 100644 --- a/sys/dev/agp/agp_nvidia.c +++ b/sys/dev/agp/agp_nvidia.c @@ -117,6 +117,8 @@ agp_nvidia_probe (device_t dev) { const char *desc; + if (resource_disabled("agp", device_get_unit(dev))) + return (ENXIO); desc = agp_nvidia_match(dev); if (desc) { device_set_desc(dev, desc); diff --git a/sys/dev/agp/agp_sis.c b/sys/dev/agp/agp_sis.c index 1e52d4efba8e..e8f542bfe306 100644 --- a/sys/dev/agp/agp_sis.c +++ b/sys/dev/agp/agp_sis.c @@ -113,6 +113,8 @@ agp_sis_probe(device_t dev) { const char *desc; + if (resource_disabled("agp", device_get_unit(dev))) + return (ENXIO); desc = agp_sis_match(dev); if (desc) { device_set_desc(dev, desc); diff --git a/sys/dev/agp/agp_via.c b/sys/dev/agp/agp_via.c index c6b4aba435dc..c561513b1d4d 100644 --- a/sys/dev/agp/agp_via.c +++ b/sys/dev/agp/agp_via.c @@ -147,6 +147,8 @@ agp_via_probe(device_t dev) { const char *desc; + if (resource_disabled("agp", device_get_unit(dev))) + return (ENXIO); desc = agp_via_match(dev); if (desc) { device_set_desc(dev, desc); diff --git a/sys/dev/amdsbwd/amdsbwd.c b/sys/dev/amdsbwd/amdsbwd.c index da0ec5b63a55..4256381f5312 100644 --- a/sys/dev/amdsbwd/amdsbwd.c +++ b/sys/dev/amdsbwd/amdsbwd.c @@ -267,6 +267,8 @@ amdsbwd_identify(driver_t *driver, device_t parent) device_t child; device_t smb_dev; + if (resource_disabled("amdsbwd", 0)) + return; if (device_find_child(parent, "amdsbwd", -1) != NULL) return; diff --git a/sys/dev/amdtemp/amdtemp.c b/sys/dev/amdtemp/amdtemp.c index 53714c6e297f..6d106aed0cb8 100644 --- a/sys/dev/amdtemp/amdtemp.c +++ b/sys/dev/amdtemp/amdtemp.c @@ -185,6 +185,9 @@ amdtemp_probe(device_t dev) { uint32_t family, model; + if (resource_disabled("amdtemp", 0)) + return (ENXIO); + family = CPUID_TO_FAMILY(cpu_id); model = CPUID_TO_MODEL(cpu_id); diff --git a/sys/dev/asmc/asmc.c b/sys/dev/asmc/asmc.c index 8c25679e8062..5fc8c4128cb5 100644 --- a/sys/dev/asmc/asmc.c +++ b/sys/dev/asmc/asmc.c @@ -291,6 +291,8 @@ asmc_probe(device_t dev) { struct asmc_model *model; + if (resource_disabled("asmc", 0)) + return (ENXIO); if (ACPI_ID_PROBE(device_get_parent(dev), dev, asmc_ids) == NULL) return (ENXIO); diff --git a/sys/dev/coretemp/coretemp.c b/sys/dev/coretemp/coretemp.c index 8c82222b5394..54e5a4365e87 100644 --- a/sys/dev/coretemp/coretemp.c +++ b/sys/dev/coretemp/coretemp.c @@ -138,6 +138,8 @@ coretemp_identify(driver_t *driver, device_t parent) static int coretemp_probe(device_t dev) { + if (resource_disabled("coretemp", 0)) + return (ENXIO); device_set_desc(dev, "CPU On-Die Thermal Sensors"); diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c index c64b417f15ff..112b538f5585 100644 --- a/sys/dev/e1000/if_em.c +++ b/sys/dev/e1000/if_em.c @@ -472,6 +472,11 @@ em_attach(device_t dev) INIT_DEBUGOUT("em_attach: begin"); + if (resource_disabled("em", device_get_unit(dev))) { + device_printf(dev, "Disabled by device hint\n"); + return (ENXIO); + } + adapter = device_get_softc(dev); adapter->dev = adapter->osdep.dev = dev; hw = &adapter->hw; diff --git a/sys/dev/e1000/if_igb.c b/sys/dev/e1000/if_igb.c index ae3665843640..13189108c060 100644 --- a/sys/dev/e1000/if_igb.c +++ b/sys/dev/e1000/if_igb.c @@ -460,6 +460,11 @@ igb_attach(device_t dev) INIT_DEBUGOUT("igb_attach: begin"); + if (resource_disabled("igb", device_get_unit(dev))) { + device_printf(dev, "Disabled by device hint\n"); + return (ENXIO); + } + adapter = device_get_softc(dev); adapter->dev = adapter->osdep.dev = dev; IGB_CORE_LOCK_INIT(adapter, device_get_nameunit(dev)); diff --git a/sys/dev/e1000/if_lem.c b/sys/dev/e1000/if_lem.c index aeb32952de68..cce734695ace 100644 --- a/sys/dev/e1000/if_lem.c +++ b/sys/dev/e1000/if_lem.c @@ -390,6 +390,11 @@ lem_attach(device_t dev) INIT_DEBUGOUT("lem_attach: begin"); + if (resource_disabled("lem", device_get_unit(dev))) { + device_printf(dev, "Disabled by device hint\n"); + return (ENXIO); + } + adapter = device_get_softc(dev); adapter->dev = adapter->osdep.dev = dev; EM_CORE_LOCK_INIT(adapter, device_get_nameunit(dev)); diff --git a/sys/dev/glxiic/glxiic.c b/sys/dev/glxiic/glxiic.c index 00a42c6cba63..6eeac7cee381 100644 --- a/sys/dev/glxiic/glxiic.c +++ b/sys/dev/glxiic/glxiic.c @@ -298,6 +298,9 @@ static int glxiic_probe(device_t dev) { + if (resource_disabled("glxiic", device_get_unit(dev))) + return (ENXIO); + device_set_desc(dev, "AMD Geode CS5536 SMBus controller"); return (BUS_PROBE_DEFAULT); diff --git a/sys/dev/ixgbe/ixgbe.c b/sys/dev/ixgbe/ixgbe.c index e7011af5a3e5..d9f028ba5389 100644 --- a/sys/dev/ixgbe/ixgbe.c +++ b/sys/dev/ixgbe/ixgbe.c @@ -401,6 +401,11 @@ ixgbe_attach(device_t dev) INIT_DEBUGOUT("ixgbe_attach: begin"); + if (resource_disabled("ixgbe", device_get_unit(dev))) { + device_printf(dev, "Disabled by device hint\n"); + return (ENXIO); + } + /* Allocate, clear, and link in our adapter structure */ adapter = device_get_softc(dev); adapter->dev = adapter->osdep.dev = dev; diff --git a/sys/dev/ixgbe/ixv.c b/sys/dev/ixgbe/ixv.c index 37f602b6b196..1acb3f0bf960 100644 --- a/sys/dev/ixgbe/ixv.c +++ b/sys/dev/ixgbe/ixv.c @@ -299,6 +299,11 @@ ixv_attach(device_t dev) INIT_DEBUGOUT("ixv_attach: begin"); + if (resource_disabled("ixgbe", device_get_unit(dev))) { + device_printf(dev, "Disabled by device hint\n"); + return (ENXIO); + } + /* Allocate, clear, and link in our adapter structure */ adapter = device_get_softc(dev); adapter->dev = adapter->osdep.dev = dev; diff --git a/sys/dev/kbdmux/kbdmux.c b/sys/dev/kbdmux/kbdmux.c index 16e653548fc2..a21b37cdf095 100644 --- a/sys/dev/kbdmux/kbdmux.c +++ b/sys/dev/kbdmux/kbdmux.c @@ -378,6 +378,8 @@ kbdmux_configure(int flags) static int kbdmux_probe(int unit, void *arg, int flags) { + if (resource_disabled(KEYBOARD_NAME, unit)) + return (ENXIO); return (0); } diff --git a/sys/dev/sound/pci/emu10kx.c b/sys/dev/sound/pci/emu10kx.c index c15a03b63b8e..d92fa448be08 100644 --- a/sys/dev/sound/pci/emu10kx.c +++ b/sys/dev/sound/pci/emu10kx.c @@ -3050,6 +3050,11 @@ emu_pci_attach(device_t dev) sc = device_get_softc(dev); unit = device_get_unit(dev); + if (resource_disabled("emu10kx", unit)) { + device_printf(dev, "disabled by kernel hints\n"); + return (ENXIO); /* XXX to avoid unit reuse */ + } + /* Get configuration */ sc->ctx = device_get_sysctl_ctx(dev); diff --git a/sys/i386/acpica/acpi_machdep.c b/sys/i386/acpica/acpi_machdep.c index 42c6c86e1c08..08721279b6cd 100644 --- a/sys/i386/acpica/acpi_machdep.c +++ b/sys/i386/acpica/acpi_machdep.c @@ -268,6 +268,9 @@ acpi_find_table(const char *sig) vm_paddr_t addr; int i, count; + if (resource_disabled("acpi", 0)) + return (0); + /* * Map in the RSDP. Since ACPI uses AcpiOsMapMemory() which in turn * calls pmap_mapbios() to find the RSDP, we assume that we can use diff --git a/sys/i386/bios/apm.c b/sys/i386/bios/apm.c index 5477383f3dcc..bf5071f0dedd 100644 --- a/sys/i386/bios/apm.c +++ b/sys/i386/bios/apm.c @@ -878,6 +878,9 @@ apm_identify(driver_t *driver, device_t parent) return; } + if (resource_disabled("apm", 0)) + return; + child = BUS_ADD_CHILD(parent, 0, "apm", 0); if (child == NULL) panic("apm_identify"); diff --git a/sys/x86/cpufreq/est.c b/sys/x86/cpufreq/est.c index 41660cbe15e3..cc9502d04556 100644 --- a/sys/x86/cpufreq/est.c +++ b/sys/x86/cpufreq/est.c @@ -991,6 +991,9 @@ est_probe(device_t dev) uint64_t msr; int error, type; + if (resource_disabled("est", 0)) + return (ENXIO); + /* * If the ACPI perf driver has attached and is not just offering * info, let it manage things. diff --git a/sys/x86/cpufreq/p4tcc.c b/sys/x86/cpufreq/p4tcc.c index 4e37def42a43..e11b4a8d499b 100644 --- a/sys/x86/cpufreq/p4tcc.c +++ b/sys/x86/cpufreq/p4tcc.c @@ -139,6 +139,10 @@ p4tcc_identify(driver_t *driver, device_t parent) static int p4tcc_probe(device_t dev) { + + if (resource_disabled("p4tcc", 0)) + return (ENXIO); + device_set_desc(dev, "CPU Frequency Thermal Control"); return (0); } diff --git a/sys/x86/isa/elcr.c b/sys/x86/isa/elcr.c index ec457bceef89..266d78396db9 100644 --- a/sys/x86/isa/elcr.c +++ b/sys/x86/isa/elcr.c @@ -84,6 +84,8 @@ elcr_probe(void) printf(" E"); printf("\n"); } + if (resource_disabled("elcr", 0)) + return (ENXIO); elcr_found = 1; return (0); }