version 1.268.2.3, 2018/06/25 07:25:49 |
version 1.268.2.4, 2018/10/20 06:58:30 |
Line 148 static uint64_t acpi_root_pointer; |
|
Line 148 static uint64_t acpi_root_pointer; |
|
extern kmutex_t acpi_interrupt_list_mtx; |
extern kmutex_t acpi_interrupt_list_mtx; |
static ACPI_HANDLE acpi_scopes[4]; |
static ACPI_HANDLE acpi_scopes[4]; |
ACPI_TABLE_HEADER *madt_header; |
ACPI_TABLE_HEADER *madt_header; |
|
ACPI_TABLE_HEADER *gtdt_header; |
|
|
/* |
/* |
* This structure provides a context for the ACPI |
* This structure provides a context for the ACPI |
Line 173 static const char * const acpi_ignored_i |
|
Line 174 static const char * const acpi_ignored_i |
|
#if defined(x86_64) |
#if defined(x86_64) |
"PNP0C04", /* FPU is handled internally */ |
"PNP0C04", /* FPU is handled internally */ |
#endif |
#endif |
|
#if defined(__aarch64__) |
|
"ACPI0007", /* ACPI CPUs are attached via MADT GICC subtables */ |
|
#endif |
NULL |
NULL |
}; |
}; |
|
|
Line 520 acpi_attach(device_t parent, device_t se |
|
Line 524 acpi_attach(device_t parent, device_t se |
|
|
|
acpi_active = 1; |
acpi_active = 1; |
|
|
/* Show SCI interrupt. */ |
if (!AcpiGbl_ReducedHardware) { |
aprint_verbose_dev(self, "SCI interrupting at int %u\n", |
/* Show SCI interrupt. */ |
AcpiGbl_FADT.SciInterrupt); |
aprint_verbose_dev(self, "SCI interrupting at int %u\n", |
|
AcpiGbl_FADT.SciInterrupt); |
|
|
/* |
/* |
* Install fixed-event handlers. |
* Install fixed-event handlers. |
*/ |
*/ |
acpi_register_fixed_button(sc, ACPI_EVENT_POWER_BUTTON); |
acpi_register_fixed_button(sc, ACPI_EVENT_POWER_BUTTON); |
acpi_register_fixed_button(sc, ACPI_EVENT_SLEEP_BUTTON); |
acpi_register_fixed_button(sc, ACPI_EVENT_SLEEP_BUTTON); |
|
} |
|
|
acpitimer_init(sc); |
acpitimer_init(sc); |
acpi_config_tree(sc); |
acpi_config_tree(sc); |
Line 578 acpi_detach(device_t self, int flags) |
|
Line 584 acpi_detach(device_t self, int flags) |
|
if ((rc = acpitimer_detach()) != 0) |
if ((rc = acpitimer_detach()) != 0) |
return rc; |
return rc; |
|
|
acpi_deregister_fixed_button(sc, ACPI_EVENT_POWER_BUTTON); |
if (!AcpiGbl_ReducedHardware) { |
acpi_deregister_fixed_button(sc, ACPI_EVENT_SLEEP_BUTTON); |
acpi_deregister_fixed_button(sc, ACPI_EVENT_POWER_BUTTON); |
|
acpi_deregister_fixed_button(sc, ACPI_EVENT_SLEEP_BUTTON); |
|
} |
|
|
pmf_device_deregister(self); |
pmf_device_deregister(self); |
|
|
Line 1196 acpi_register_fixed_button(struct acpi_s |
|
Line 1204 acpi_register_fixed_button(struct acpi_s |
|
} |
} |
|
|
aprint_normal_dev(sc->sc_dev, "fixed %s button present\n", |
aprint_normal_dev(sc->sc_dev, "fixed %s button present\n", |
(type != ACPI_EVENT_SLEEP_BUTTON) ? "power" : "sleep"); |
(type != PSWITCH_TYPE_SLEEP) ? "power" : "sleep"); |
|
|
return; |
return; |
|
|
Line 1405 acpi_enter_sleep_state(int state) |
|
Line 1413 acpi_enter_sleep_state(int state) |
|
AcpiClearEvent(ACPI_EVENT_POWER_BUTTON); |
AcpiClearEvent(ACPI_EVENT_POWER_BUTTON); |
AcpiClearEvent(ACPI_EVENT_SLEEP_BUTTON); |
AcpiClearEvent(ACPI_EVENT_SLEEP_BUTTON); |
AcpiClearEvent(ACPI_EVENT_RTC); |
AcpiClearEvent(ACPI_EVENT_RTC); |
|
#if (!ACPI_REDUCED_HARDWARE) |
AcpiHwDisableAllGpes(); |
AcpiHwDisableAllGpes(); |
|
#endif |
|
|
acpi_md_OsEnableInterrupt(); |
acpi_md_OsEnableInterrupt(); |
rv = AcpiLeaveSleepState(state); |
rv = AcpiLeaveSleepState(state); |
Line 1708 acpi_madt_unmap(void) |
|
Line 1718 acpi_madt_unmap(void) |
|
madt_header = NULL; |
madt_header = NULL; |
} |
} |
|
|
|
ACPI_STATUS |
|
acpi_gtdt_map(void) |
|
{ |
|
ACPI_STATUS rv; |
|
|
|
if (gtdt_header != NULL) |
|
return AE_ALREADY_EXISTS; |
|
|
|
rv = AcpiGetTable(ACPI_SIG_GTDT, 1, >dt_header); |
|
|
|
if (ACPI_FAILURE(rv)) |
|
return rv; |
|
|
|
return AE_OK; |
|
} |
|
|
|
void |
|
acpi_gtdt_unmap(void) |
|
{ |
|
gtdt_header = NULL; |
|
} |
|
|
/* |
/* |
* XXX: Refactor to be a generic function that walks tables. |
* XXX: Refactor to be a generic function that walks tables. |
*/ |
*/ |
Line 1731 acpi_madt_walk(ACPI_STATUS (*func)(ACPI_ |
|
Line 1763 acpi_madt_walk(ACPI_STATUS (*func)(ACPI_ |
|
} |
} |
} |
} |
|
|
|
void |
|
acpi_gtdt_walk(ACPI_STATUS (*func)(ACPI_GTDT_HEADER *, void *), void *aux) |
|
{ |
|
ACPI_GTDT_HEADER *hdrp; |
|
char *gtdtend, *where; |
|
|
|
gtdtend = (char *)gtdt_header + gtdt_header->Length; |
|
where = (char *)gtdt_header + sizeof (ACPI_TABLE_GTDT); |
|
|
|
while (where < gtdtend) { |
|
|
|
hdrp = (ACPI_GTDT_HEADER *)where; |
|
|
|
if (ACPI_FAILURE(func(hdrp, aux))) |
|
break; |
|
|
|
where += hdrp->Length; |
|
} |
|
} |
|
|
/* |
/* |
* Miscellaneous. |
* Miscellaneous. |
*/ |
*/ |