This is a preparation diff making acpiec(4) global lock aware.
Others will build on it when doing reads and writes.
Okay?
Index: acpiec.c
===================================================================
RCS file: /cvs/src/sys/dev/acpi/acpiec.c,v
retrieving revision 1.45
diff -u -p -r1.45 acpiec.c
--- acpiec.c 10 Mar 2012 21:27:07 -0000 1.45
+++ acpiec.c 12 Jul 2012 16:37:18 -0000
@@ -253,7 +253,8 @@ acpiec_match(struct device *parent, void
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, str
{
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, str
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;
+ if (res.type != AML_OBJTYPE_INTEGER)
+ sc->sc_glk = 0;
+ else
+ sc->sc_glk = res.v_integer ? 1 : 0;
printf("\n");
}
Index: acpidev.h
===================================================================
RCS file: /cvs/src/sys/dev/acpi/acpidev.h,v
retrieving revision 1.32
diff -u -p -r1.32 acpidev.h
--- acpidev.h 6 Aug 2010 21:12:27 -0000 1.32
+++ acpidev.h 12 Jul 2012 16:37:18 -0000
@@ -332,6 +332,7 @@ struct acpiec_softc {
u_int32_t sc_gpe;
struct acpiec_event sc_events[ACPIEC_MAX_EVENTS];
int sc_gotsci;
+ char sc_glk;
};
void acpibtn_disable_psw(void);