Index: sys/x86/isa/atrtc.c =================================================================== --- sys/x86/isa/atrtc.c +++ sys/x86/isa/atrtc.c @@ -85,6 +85,7 @@ #ifdef DEV_ACPI #define _COMPONENT ACPI_TIMER +static int acpi_rtc_is_present; ACPI_MODULE_NAME("ATRTC") #endif @@ -203,6 +204,7 @@ struct resource *intr_res; void *intr_handler; struct eventtimer et; + int is_active; #ifdef DEV_ACPI ACPI_HANDLE acpi_handle; #endif @@ -293,7 +295,7 @@ if (addr >= ATRTC_LAST_REG || addr + len > ATRTC_LAST_REG) return (false); - if (is_read) { + if (is_read || !(acpi_rtc_is_present)) { /* Reading 0x0C will muck with interrupts */ if (addr <= RTC_INTR && addr + len > RTC_INTR) return (false); @@ -487,6 +489,8 @@ sc->et.et_priv = dev; et_register(&sc->et); } + sc->is_active = 1; + return(0); } @@ -502,11 +506,14 @@ atrtc_acpi_attach(device_t dev) { int ret; - - ret = atrtc_attach(dev); - if (ret) - return (ret); - + acpi_rtc_is_present = acpi_DeviceIsPresent(dev); + if (acpi_rtc_is_present){ + ret = atrtc_attach(dev); + if (ret) + return (ret); + }else{ + device_printf(dev, "disabled in acpi handle. Only address space handler\n"); + } (void)atrtc_reg_acpi_cmos_handler(dev); return (0); @@ -524,8 +531,9 @@ static int atrtc_resume(device_t dev) { - - atrtc_restore(); + struct atrtc_softc *sc = device_get_softc(dev); + if(sc->is_active) + atrtc_restore(); return(0); }