From b9cb29b33276a5d5938fa0305b728842f91ee998 Mon Sep 17 00:00:00 2001 From: Paul Irofti Date: Fri, 13 Jul 2012 10:37:41 +0000 Subject: Make the ACPI EC aware of the AML global lock. Comments from kettenis@ and matthew@. Okay deraadt@, kettenis@. --- sys/dev/acpi/acpidev.h | 3 ++- sys/dev/acpi/acpiec.c | 13 +++++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) (limited to 'sys') diff --git a/sys/dev/acpi/acpidev.h b/sys/dev/acpi/acpidev.h index c04d292d133..4db5e1d1c1f 100644 --- a/sys/dev/acpi/acpidev.h +++ b/sys/dev/acpi/acpidev.h @@ -1,4 +1,4 @@ -/* $OpenBSD: acpidev.h,v 1.32 2010/08/06 21:12:27 marco Exp $ */ +/* $OpenBSD: acpidev.h,v 1.33 2012/07/13 10:37:40 pirofti Exp $ */ /* * Copyright (c) 2005 Marco Peereboom * Copyright (c) 2005 Thorsten Lockert @@ -332,6 +332,7 @@ struct acpiec_softc { u_int32_t sc_gpe; struct acpiec_event sc_events[ACPIEC_MAX_EVENTS]; int sc_gotsci; + int sc_glk; }; void acpibtn_disable_psw(void); diff --git a/sys/dev/acpi/acpiec.c b/sys/dev/acpi/acpiec.c index cabb3000441..e6a5e01854a 100644 --- a/sys/dev/acpi/acpiec.c +++ b/sys/dev/acpi/acpiec.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpiec.c,v 1.45 2012/03/10 21:27:07 kettenis Exp $ */ +/* $OpenBSD: acpiec.c,v 1.46 2012/07/13 10:37:40 pirofti Exp $ */ /* * Copyright (c) 2006 Can Erkin Acar * @@ -253,7 +253,8 @@ acpiec_match(struct device *parent, void *match, void *aux) struct acpi_softc *acpisc = (struct acpi_softc *)parent; /* Check for early ECDT table attach */ - if (ecdt && !memcmp(ecdt->hdr.signature, ECDT_SIG, sizeof(ECDT_SIG) - 1)) + if (ecdt && + !memcmp(ecdt->hdr.signature, ECDT_SIG, sizeof(ECDT_SIG) - 1)) return (1); if (acpisc->sc_ec) return (0); @@ -267,6 +268,7 @@ acpiec_attach(struct device *parent, struct device *self, void *aux) { struct acpiec_softc *sc = (struct acpiec_softc *)self; struct acpi_attach_args *aa = aux; + struct aml_value res; sc->sc_acpi = (struct acpi_softc *)parent; sc->sc_devnode = aa->aaa_node; @@ -291,6 +293,13 @@ acpiec_attach(struct device *parent, struct device *self, void *aux) acpi_set_gpehandler(sc->sc_acpi, sc->sc_gpe, acpiec_gpehandler, sc, 1); #endif + + if (aml_evalname(sc->sc_acpi, sc->sc_devnode, "_GLK", 0, NULL, &res)) + sc->sc_glk = 0; + else if (res.type != AML_OBJTYPE_INTEGER) + sc->sc_glk = 0; + else + sc->sc_glk = res.v_integer ? 1 : 0; printf("\n"); } -- cgit v1.2.3