summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authormycroft <mycroft@NetBSD.org>2003-10-31 20:54:18 +0000
committermycroft <mycroft@NetBSD.org>2003-10-31 20:54:18 +0000
commitfec4c11f9e685b69afe48ffbd4ae229e0970375d (patch)
treed64337ee657a67f19e32e72360aedced3e899315 /sys
parent3970401fd999553afee82a7a0adfbaf3778e3de6 (diff)
Catch up with ABI changes in ACPI-CA. Some additional changes to acpi_bat to
set the VALID bits correctly, so we don't report garbage for missing batteries.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/acpi/acpi.c110
-rw-r--r--sys/dev/acpi/acpi_acad.c6
-rw-r--r--sys/dev/acpi/acpi_bat.c44
-rw-r--r--sys/dev/acpi/acpi_button.c12
-rw-r--r--sys/dev/acpi/acpi_ec.c47
-rw-r--r--sys/dev/acpi/acpi_lid.c6
-rw-r--r--sys/dev/acpi/acpi_madt.c75
-rw-r--r--sys/dev/acpi/acpi_madt.h110
-rw-r--r--sys/dev/acpi/acpi_quirks.c10
-rw-r--r--sys/dev/acpi/acpivar.h6
-rw-r--r--sys/dev/acpi/com_acpi.c6
-rw-r--r--sys/dev/acpi/fdc_acpi.c6
-rw-r--r--sys/dev/acpi/lpt_acpi.c6
-rw-r--r--sys/dev/acpi/pckbc_acpi.c8
-rw-r--r--sys/dev/acpi/wss_acpi.c8
15 files changed, 144 insertions, 316 deletions
diff --git a/sys/dev/acpi/acpi.c b/sys/dev/acpi/acpi.c
index f8e90324021..087cbf2122b 100644
--- a/sys/dev/acpi/acpi.c
+++ b/sys/dev/acpi/acpi.c
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi.c,v 1.47 2003/10/31 17:22:28 mycroft Exp $ */
+/* $NetBSD: acpi.c,v 1.48 2003/10/31 20:54:18 mycroft Exp $ */
/*
* Copyright 2001, 2003 Wasabi Systems, Inc.
@@ -41,7 +41,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi.c,v 1.47 2003/10/31 17:22:28 mycroft Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi.c,v 1.48 2003/10/31 20:54:18 mycroft Exp $");
#include "opt_acpi.h"
@@ -213,7 +213,6 @@ acpi_attach(struct device *parent, struct device *self, void *aux)
{
struct acpi_softc *sc = (void *) self;
struct acpibus_attach_args *aa = aux;
- ACPI_TABLE_HEADER *ap = &AcpiGbl_XSDT->Header;
ACPI_STATUS rv;
printf("\n");
@@ -228,8 +227,9 @@ acpi_attach(struct device *parent, struct device *self, void *aux)
printf("%s: X/RSDT: OemId <%6.6s,%8.8s,%08x>, AslId <%4.4s,%08x>\n",
sc->sc_dev.dv_xname,
- ap->OemId, ap->OemTableId, ap->OemRevision,
- ap->AslCompilerId, ap->AslCompilerRevision);
+ AcpiGbl_XSDT->OemId, AcpiGbl_XSDT->OemTableId,
+ AcpiGbl_XSDT->OemRevision,
+ AcpiGbl_XSDT->AslCompilerId, AcpiGbl_XSDT->AslCompilerRevision);
sc->sc_quirks = acpi_find_quirks();
@@ -473,20 +473,20 @@ acpi_activate_device(ACPI_HANDLE handle, ACPI_DEVICE_INFO *di)
#ifdef ACPI_DEBUG
printf("acpi_activate_device: %s, old status=%x\n",
- di->HardwareId, di->CurrentStatus);
+ di->HardwareId.Value, di->CurrentStatus);
#endif
rv = acpi_allocate_resources(handle);
if (ACPI_FAILURE(rv)) {
- printf("acpi: activate failed for %s\n", di->HardwareId);
+ printf("acpi: activate failed for %s\n", di->HardwareId.Value);
} else {
- printf("acpi: activated %s\n", di->HardwareId);
+ printf("acpi: activated %s\n", di->HardwareId.Value);
}
#ifdef ACPI_DEBUG
(void)AcpiGetObjectInfo(handle, di);
printf("acpi_activate_device: %s, new status=%x\n",
- di->HardwareId, di->CurrentStatus);
+ di->HardwareId.Value, di->CurrentStatus);
#endif
}
#endif /* ACPI_ACTIVATE_DEV */
@@ -506,12 +506,15 @@ acpi_make_devnode(ACPI_HANDLE handle, UINT32 level, void *context,
#endif
struct acpi_scope *as = state->scope;
struct acpi_devnode *ad;
- ACPI_DEVICE_INFO devinfo;
ACPI_OBJECT_TYPE type;
+ ACPI_BUFFER buf;
+ ACPI_DEVICE_INFO devinfo;
ACPI_STATUS rv;
if (AcpiGetType(handle, &type) == AE_OK) {
- rv = AcpiGetObjectInfo(handle, &devinfo);
+ buf.Pointer = &devinfo;
+ buf.Length = sizeof(devinfo);
+ rv = AcpiGetObjectInfo(handle, &buf);
if (rv != AE_OK) {
#ifdef ACPI_DEBUG
printf("%s: AcpiGetObjectInfo failed\n",
@@ -531,7 +534,9 @@ acpi_make_devnode(ACPI_HANDLE handle, UINT32 level, void *context,
acpi_activate_device(handle, &devinfo);
/* Update devinfo. */
- rv = AcpiGetObjectInfo(handle, &devinfo);
+ buf.Pointer = &devinfo;
+ buf.Length = sizeof(devinfo);
+ rv = AcpiGetObjectInfo(handle, &buf);
if (rv != AE_OK)
goto out;
}
@@ -559,7 +564,7 @@ acpi_make_devnode(ACPI_HANDLE handle, UINT32 level, void *context,
#ifdef ACPI_EXTRA_DEBUG
printf("%s: HID %s found in scope %s level %d\n",
- sc->sc_dev.dv_xname, ad->ad_devinfo.HardwareId,
+ sc->sc_dev.dv_xname, ad->ad_devinfo.HardwareId.Value,
as->as_name, ad->ad_level);
if (ad->ad_devinfo.Valid & ACPI_VALID_UID)
printf(" UID %s\n",
@@ -589,7 +594,7 @@ acpi_print(void *aux, const char *pnp)
if (pnp) {
if (aa->aa_node->ad_devinfo.Valid & ACPI_VALID_HID) {
- char *pnpstr = aa->aa_node->ad_devinfo.HardwareId;
+ char *pnpstr = aa->aa_node->ad_devinfo.HardwareId.Value;
char *str;
aprint_normal("%s ", pnpstr);
@@ -621,14 +626,13 @@ acpi_print(void *aux, const char *pnp)
aprint_normal("at %s", pnp);
} else {
if (aa->aa_node->ad_devinfo.Valid & ACPI_VALID_HID) {
- aprint_normal(" (%s", aa->aa_node->ad_devinfo.HardwareId);
+ aprint_normal(" (%s", aa->aa_node->ad_devinfo.HardwareId.Value);
if (aa->aa_node->ad_devinfo.Valid & ACPI_VALID_UID) {
char *uid;
- if (aa->aa_node->ad_devinfo.UniqueId[0] == '\0')
+ uid = aa->aa_node->ad_devinfo.UniqueId.Value;
+ if (uid[0] == '\0')
uid = "<null>";
- else
- uid = aa->aa_node->ad_devinfo.UniqueId;
aprint_normal("-%s", uid);
}
aprint_normal(")");
@@ -848,76 +852,6 @@ acpi_get(ACPI_HANDLE handle, ACPI_BUFFER *buf,
}
-/*
- * acpi_acquire_global_lock:
- *
- * Acquire global lock, with sleeping appropriately.
- */
-#define ACQUIRE_WAIT 1000
-
-ACPI_STATUS
-acpi_acquire_global_lock(UINT32 *handle)
-{
- ACPI_STATUS status;
- UINT32 h;
- int s;
-
- s = splhigh();
- simple_lock(&acpi_slock);
- while (acpi_locked)
- ltsleep(&acpi_slock, PVM, "acpi_lock", 0, &acpi_slock);
- acpi_locked = 1;
- simple_unlock(&acpi_slock);
- splx(s);
- status = AcpiAcquireGlobalLock(ACQUIRE_WAIT, &h);
- if (ACPI_SUCCESS(status))
- *handle = h;
- else {
- printf("acpi: cannot acquire lock. status=0x%X\n", status);
- s = splhigh();
- simple_lock(&acpi_slock);
- acpi_locked = 0;
- simple_unlock(&acpi_slock);
- splx(s);
- }
-
- return (status);
-}
-
-void
-acpi_release_global_lock(UINT32 handle)
-{
- ACPI_STATUS status;
- int s;
-
- if (!acpi_locked) {
- printf("acpi: not locked.\n");
- return;
- }
-
- status = AcpiReleaseGlobalLock(handle);
- if (ACPI_FAILURE(status)) {
- printf("acpi: AcpiReleaseGlobalLock failed. status=0x%X\n",
- status);
- return;
- }
-
- s = splhigh();
- simple_lock(&acpi_slock);
- acpi_locked = 0;
- simple_unlock(&acpi_slock);
- splx(s);
- wakeup(&acpi_slock);
-}
-
-int
-acpi_is_global_locked(void)
-{
- return (acpi_locked);
-}
-
-
-
/*****************************************************************************
* ACPI sleep support.
*****************************************************************************/
diff --git a/sys/dev/acpi/acpi_acad.c b/sys/dev/acpi/acpi_acad.c
index d243a32e3ee..015baf72d75 100644
--- a/sys/dev/acpi/acpi_acad.c
+++ b/sys/dev/acpi/acpi_acad.c
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_acad.c,v 1.8 2003/02/19 11:32:13 yamt Exp $ */
+/* $NetBSD: acpi_acad.c,v 1.9 2003/10/31 20:54:18 mycroft Exp $ */
/*
* Copyright 2001 Wasabi Systems, Inc.
@@ -44,7 +44,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi_acad.c,v 1.8 2003/02/19 11:32:13 yamt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_acad.c,v 1.9 2003/10/31 20:54:18 mycroft Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -138,7 +138,7 @@ acpiacad_match(struct device *parent, struct cfdata *match, void *aux)
if (aa->aa_node->ad_type != ACPI_TYPE_DEVICE)
return (0);
- if (strcmp(aa->aa_node->ad_devinfo.HardwareId, "ACPI0003") == 0)
+ if (strcmp(aa->aa_node->ad_devinfo.HardwareId.Value, "ACPI0003") == 0)
return (1);
return (0);
diff --git a/sys/dev/acpi/acpi_bat.c b/sys/dev/acpi/acpi_bat.c
index 96dd9f048dc..e7c72828d44 100644
--- a/sys/dev/acpi/acpi_bat.c
+++ b/sys/dev/acpi/acpi_bat.c
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_bat.c,v 1.23 2003/10/30 22:12:02 mycroft Exp $ */
+/* $NetBSD: acpi_bat.c,v 1.24 2003/10/31 20:54:18 mycroft Exp $ */
/*
* Copyright 2001 Bill Sommerfeld.
@@ -50,7 +50,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi_bat.c,v 1.23 2003/10/30 22:12:02 mycroft Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_bat.c,v 1.24 2003/10/31 20:54:18 mycroft Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -208,7 +208,7 @@ acpibat_match(struct device *parent, struct cfdata *match, void *aux)
if (aa->aa_node->ad_type != ACPI_TYPE_DEVICE)
return (0);
- if (strcmp(aa->aa_node->ad_devinfo.HardwareId, "PNP0C0A") == 0)
+ if (strcmp(aa->aa_node->ad_devinfo.HardwareId.Value, "PNP0C0A") == 0)
return (1);
return (0);
@@ -282,13 +282,20 @@ acpibat_clear_info(struct acpibat_softc *sc)
if (sc->sc_available>ABAT_ALV_PRESENCE)
sc->sc_available = ABAT_ALV_PRESENCE;
sc->sc_data[ACPIBAT_DCAPACITY].cur.data_s = 0;
+ sc->sc_data[ACPIBAT_DCAPACITY].validflags &= ~ENVSYS_FCURVALID;
sc->sc_data[ACPIBAT_LFCCAPACITY].cur.data_s = 0;
sc->sc_data[ACPIBAT_LFCCAPACITY].max.data_s = 0;
+ sc->sc_data[ACPIBAT_LFCCAPACITY].validflags &= ~(ENVSYS_FCURVALID | ENVSYS_FMAXVALID | ENVSYS_FFRACVALID);
sc->sc_data[ACPIBAT_CAPACITY].max.data_s = 0;
+ sc->sc_data[ACPIBAT_CAPACITY].validflags &= ~ENVSYS_FMAXVALID;
sc->sc_data[ACPIBAT_TECHNOLOGY].cur.data_s = 0;
+ sc->sc_data[ACPIBAT_TECHNOLOGY].validflags &= ~ENVSYS_FCURVALID;
sc->sc_data[ACPIBAT_DVOLTAGE].cur.data_s = 0;
+ sc->sc_data[ACPIBAT_DVOLTAGE].validflags &= ~ENVSYS_FCURVALID;
sc->sc_data[ACPIBAT_WCAPACITY].cur.data_s = 0;
+ sc->sc_data[ACPIBAT_WCAPACITY].validflags &= ~ENVSYS_FCURVALID;
sc->sc_data[ACPIBAT_LCAPACITY].cur.data_s = 0;
+ sc->sc_data[ACPIBAT_LCAPACITY].validflags &= ~ENVSYS_FCURVALID;
}
void
@@ -300,11 +307,16 @@ acpibat_clear_stat(struct acpibat_softc *sc)
if (sc->sc_available>ABAT_ALV_INFO)
sc->sc_available = ABAT_ALV_INFO;
sc->sc_data[ACPIBAT_LOAD].cur.data_s = 0;
+ sc->sc_data[ACPIBAT_LOAD].validflags &= ~ENVSYS_FCURVALID;
sc->sc_data[ACPIBAT_CAPACITY].cur.data_s = 0;
- sc->sc_data[ACPIBAT_VOLTAGE].cur.data_s = 0;
+ sc->sc_data[ACPIBAT_CAPACITY].validflags &= ~(ENVSYS_FCURVALID | ENVSYS_FFRACVALID);
sc->sc_data[ACPIBAT_CAPACITY].warnflags = 0;
+ sc->sc_data[ACPIBAT_VOLTAGE].cur.data_s = 0;
+ sc->sc_data[ACPIBAT_VOLTAGE].validflags &= ~ENVSYS_FCURVALID;
sc->sc_data[ACPIBAT_DISCHARGING].cur.data_s = 0;
+ sc->sc_data[ACPIBAT_DISCHARGING].validflags &= ~ENVSYS_FCURVALID;
sc->sc_data[ACPIBAT_CHARGING].cur.data_s = 0;
+ sc->sc_data[ACPIBAT_CHARGING].validflags &= ~ENVSYS_FCURVALID;
}
@@ -334,6 +346,7 @@ acpibat_battery_present(struct acpibat_softc *sc)
sc->sc_data[ACPIBAT_PRESENT].cur.data_s = 1;
} else
sc->sc_data[ACPIBAT_PRESENT].cur.data_s = 0;
+ sc->sc_data[ACPIBAT_PRESENT].validflags |= ENVSYS_FCURVALID;
ABAT_UNLOCK(sc, s);
return ((sta & ACPIBAT_STA_PRESENT)?1:0);
@@ -407,13 +420,20 @@ acpibat_get_info(struct acpibat_softc *sc)
INITDATA(ACPIBAT_CAPACITY, capunit, capstring);
sc->sc_data[ACPIBAT_DCAPACITY].cur.data_s = p2[1].Integer.Value * 1000;
+ sc->sc_data[ACPIBAT_DCAPACITY].validflags |= ENVSYS_FCURVALID;
sc->sc_data[ACPIBAT_LFCCAPACITY].cur.data_s = p2[2].Integer.Value * 1000;
sc->sc_data[ACPIBAT_LFCCAPACITY].max.data_s = p2[1].Integer.Value * 1000;
+ sc->sc_data[ACPIBAT_LFCCAPACITY].validflags |= ENVSYS_FCURVALID | ENVSYS_FMAXVALID | ENVSYS_FFRACVALID;
sc->sc_data[ACPIBAT_CAPACITY].max.data_s = p2[1].Integer.Value * 1000;
+ sc->sc_data[ACPIBAT_CAPACITY].validflags |= ENVSYS_FMAXVALID;
sc->sc_data[ACPIBAT_TECHNOLOGY].cur.data_s = p2[3].Integer.Value;
+ sc->sc_data[ACPIBAT_TECHNOLOGY].validflags |= ENVSYS_FCURVALID;
sc->sc_data[ACPIBAT_DVOLTAGE].cur.data_s = p2[4].Integer.Value * 1000;
+ sc->sc_data[ACPIBAT_DVOLTAGE].validflags |= ENVSYS_FCURVALID;
sc->sc_data[ACPIBAT_WCAPACITY].cur.data_s = p2[5].Integer.Value * 1000;
+ sc->sc_data[ACPIBAT_WCAPACITY].validflags |= ENVSYS_FCURVALID;
sc->sc_data[ACPIBAT_LCAPACITY].cur.data_s = p2[6].Integer.Value * 1000;
+ sc->sc_data[ACPIBAT_LCAPACITY].validflags |= ENVSYS_FCURVALID;
sc->sc_available = ABAT_ALV_INFO;
ABAT_UNLOCK(sc, s);
@@ -465,8 +485,11 @@ acpibat_get_status(struct acpibat_softc *sc)
ABAT_LOCK(sc, s);
status = p2[0].Integer.Value;
sc->sc_data[ACPIBAT_LOAD].cur.data_s = p2[1].Integer.Value * 1000;
+ sc->sc_data[ACPIBAT_LOAD].validflags |= ENVSYS_FCURVALID;
sc->sc_data[ACPIBAT_CAPACITY].cur.data_s = p2[2].Integer.Value * 1000;
+ sc->sc_data[ACPIBAT_CAPACITY].validflags |= ENVSYS_FCURVALID | ENVSYS_FFRACVALID;
sc->sc_data[ACPIBAT_VOLTAGE].cur.data_s = p2[3].Integer.Value * 1000;
+ sc->sc_data[ACPIBAT_VOLTAGE].validflags |= ENVSYS_FCURVALID;
flags = 0;
if (sc->sc_data[ACPIBAT_CAPACITY].cur.data_s <
@@ -477,8 +500,10 @@ acpibat_get_status(struct acpibat_softc *sc)
sc->sc_data[ACPIBAT_CAPACITY].warnflags = flags;
sc->sc_data[ACPIBAT_DISCHARGING].cur.data_s =
((status & ACPIBAT_ST_DISCHARGING) != 0);
+ sc->sc_data[ACPIBAT_DISCHARGING].validflags |= ENVSYS_FCURVALID;
sc->sc_data[ACPIBAT_CHARGING].cur.data_s =
((status & ACPIBAT_ST_CHARGING) != 0);
+ sc->sc_data[ACPIBAT_CHARGING].validflags |= ENVSYS_FCURVALID;
sc->sc_available = ABAT_ALV_STAT;
ABAT_UNLOCK(sc, s);
@@ -670,7 +695,7 @@ acpibat_init_envsys(struct acpibat_softc *sc)
for (i = 0 ; i < ACPIBAT_NSENSORS; i++) {
sc->sc_data[i].sensor = sc->sc_info[i].sensor = i;
- sc->sc_data[i].validflags |= (ENVSYS_FVALID | ENVSYS_FCURVALID);
+ sc->sc_data[i].validflags = ENVSYS_FVALID;
sc->sc_info[i].validflags = ENVSYS_FVALID;
sc->sc_data[i].warnflags = 0;
}
@@ -687,15 +712,6 @@ acpibat_init_envsys(struct acpibat_softc *sc)
INITDATA(ACPIBAT_CHARGING, ENVSYS_INDICATOR, "charging");
INITDATA(ACPIBAT_DISCHARGING, ENVSYS_INDICATOR, "discharging");
- /*
- * ACPIBAT_CAPACITY is the "gas gauge".
- * ACPIBAT_LFCCAPACITY is the "wear gauge".
- */
- sc->sc_data[ACPIBAT_CAPACITY].validflags |=
- ENVSYS_FMAXVALID | ENVSYS_FFRACVALID;
- sc->sc_data[ACPIBAT_LFCCAPACITY].validflags |=
- ENVSYS_FMAXVALID | ENVSYS_FFRACVALID;
-
sc->sc_sysmon.sme_sensor_info = sc->sc_info;
sc->sc_sysmon.sme_sensor_data = sc->sc_data;
sc->sc_sysmon.sme_cookie = sc;
diff --git a/sys/dev/acpi/acpi_button.c b/sys/dev/acpi/acpi_button.c
index c2c3a73c61e..7232af8838f 100644
--- a/sys/dev/acpi/acpi_button.c
+++ b/sys/dev/acpi/acpi_button.c
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_button.c,v 1.9 2003/04/18 01:31:34 thorpej Exp $ */
+/* $NetBSD: acpi_button.c,v 1.10 2003/10/31 20:54:18 mycroft Exp $ */
/*
* Copyright 2001, 2003 Wasabi Systems, Inc.
@@ -40,7 +40,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi_button.c,v 1.9 2003/04/18 01:31:34 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_button.c,v 1.10 2003/10/31 20:54:18 mycroft Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -83,8 +83,8 @@ acpibut_match(struct device *parent, struct cfdata *match, void *aux)
if (aa->aa_node->ad_type != ACPI_TYPE_DEVICE)
return (0);
- if (strcmp(aa->aa_node->ad_devinfo.HardwareId, "PNP0C0C") == 0 ||
- strcmp(aa->aa_node->ad_devinfo.HardwareId, "PNP0C0E") == 0)
+ if (strcmp(aa->aa_node->ad_devinfo.HardwareId.Value, "PNP0C0C") == 0 ||
+ strcmp(aa->aa_node->ad_devinfo.HardwareId.Value, "PNP0C0E") == 0)
return (1);
return (0);
@@ -105,10 +105,10 @@ acpibut_attach(struct device *parent, struct device *self, void *aux)
sc->sc_smpsw.smpsw_name = sc->sc_dev.dv_xname;
- if (strcmp(aa->aa_node->ad_devinfo.HardwareId, "PNP0C0C") == 0) {
+ if (strcmp(aa->aa_node->ad_devinfo.HardwareId.Value, "PNP0C0C") == 0) {
sc->sc_smpsw.smpsw_type = PSWITCH_TYPE_POWER;
desc = "Power";
- } else if (strcmp(aa->aa_node->ad_devinfo.HardwareId, "PNP0C0E") == 0) {
+ } else if (strcmp(aa->aa_node->ad_devinfo.HardwareId.Value, "PNP0C0E") == 0) {
sc->sc_smpsw.smpsw_type = PSWITCH_TYPE_SLEEP;
desc = "Sleep";
} else {
diff --git a/sys/dev/acpi/acpi_ec.c b/sys/dev/acpi/acpi_ec.c
index 2efed2d5570..0582258f1aa 100644
--- a/sys/dev/acpi/acpi_ec.c
+++ b/sys/dev/acpi/acpi_ec.c
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_ec.c,v 1.10 2003/08/03 08:16:07 kochi Exp $ */
+/* $NetBSD: acpi_ec.c,v 1.11 2003/10/31 20:54:18 mycroft Exp $ */
/*
* Copyright 2001 Wasabi Systems, Inc.
@@ -172,7 +172,7 @@
*****************************************************************************/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi_ec.c,v 1.10 2003/08/03 08:16:07 kochi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_ec.c,v 1.11 2003/10/31 20:54:18 mycroft Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -227,31 +227,23 @@ static __inline int
EcIsLocked(struct acpi_ec_softc *sc)
{
- return (acpi_is_global_locked() && (sc->sc_flags & EC_F_LOCKED));
+ return (sc->sc_flags & EC_F_LOCKED);
}
-static __inline ACPI_STATUS
+static __inline void
EcLock(struct acpi_ec_softc *sc)
{
- ACPI_STATUS status;
- UINT32 handle;
-
- status = acpi_acquire_global_lock(&handle);
- if (ACPI_SUCCESS(status)) {
- sc->sc_flags |= EC_F_LOCKED;
- sc->sc_lockhandle = handle;
- }
- return (status);
+ sc->sc_flags |= EC_F_LOCKED;
+ AcpiOsAcquireLock (AcpiGbl_GpeLock, ACPI_NOT_ISR);
}
static __inline void
EcUnlock(struct acpi_ec_softc *sc)
{
- if (!EcIsLocked(sc))
- return;
+
+ AcpiOsReleaseLock (AcpiGbl_GpeLock, ACPI_NOT_ISR);
sc->sc_flags &= ~EC_F_LOCKED;
- acpi_release_global_lock(sc->sc_lockhandle);
}
typedef struct {
@@ -296,7 +288,7 @@ acpiec_match(struct device *parent, struct cfdata *match, void *aux)
if (aa->aa_node->ad_type != ACPI_TYPE_DEVICE)
return (0);
- if (strcmp(aa->aa_node->ad_devinfo.HardwareId, "PNP0C09") == 0)
+ if (strcmp(aa->aa_node->ad_devinfo.HardwareId.Value, "PNP0C09") == 0)
return (1);
return (0);
@@ -380,7 +372,7 @@ acpiec_attach(struct device *parent, struct device *self, void *aux)
* events we cause while performing a transaction (e.g. IBE/OBF) get
* cleared before re-enabling the GPE.
*/
- if ((rv = AcpiInstallGpeHandler(sc->sc_gpebit,
+ if ((rv = AcpiInstallGpeHandler(sc->sc_node->ad_handle, sc->sc_gpebit,
ACPI_EVENT_LEVEL_TRIGGERED | ACPI_EVENT_EDGE_TRIGGERED,
EcGpeHandler, sc)) != AE_OK) {
printf("%s: unable to install GPE handler: %d\n",
@@ -458,10 +450,9 @@ EcGpeQueryHandler(void *Context)
}
/* I know I request Level trigger cleanup */
- if (AcpiClearEvent(sc->sc_gpebit, ACPI_EVENT_GPE) != AE_OK)
- printf("%s: AcpiClearEvent failed\n", sc->sc_dev.dv_xname);
- if (AcpiEnableEvent(sc->sc_gpebit, ACPI_EVENT_GPE, 0) != AE_OK)
- printf("%s: AcpiEnableEvent failed\n", sc->sc_dev.dv_xname);
+ if (AcpiClearGpe(sc->sc_node->ad_handle, sc->sc_gpebit, ACPI_NOT_ISR)
+ != AE_OK)
+ printf("%s: AcpiClearGpe failed\n", sc->sc_dev.dv_xname);
return_VOID;
}
@@ -653,8 +644,7 @@ EcQuery(struct acpi_ec_softc *sc, UINT8 *Data)
{
ACPI_STATUS Status;
- if ((Status = EcLock(sc)) != AE_OK)
- return (Status);
+ EcLock(sc);
EC_CSR_WRITE(sc, EC_COMMAND_QUERY);
Status = EcWaitEvent(sc, EC_EVENT_OUTPUT_BUFFER_FULL);
@@ -675,8 +665,7 @@ EcTransaction(struct acpi_ec_softc *sc, EC_REQUEST *EcRequest)
{
ACPI_STATUS Status;
- if ((Status = EcLock(sc)) != AE_OK)
- return (Status);
+ EcLock(sc);
/*
* Perform the transaction.
@@ -712,12 +701,10 @@ EcTransaction(struct acpi_ec_softc *sc, EC_REQUEST *EcRequest)
sc->sc_flags &= ~EC_F_PENDQUERY;
}
- if (AcpiClearEvent(sc->sc_gpebit, ACPI_EVENT_GPE) != AE_OK)
+ if (AcpiClearGpe(sc->sc_node->ad_handle, sc->sc_gpebit, ACPI_NOT_ISR)
+ != AE_OK)
printf("%s: EcRequest: unable to clear EC GPE\n",
sc->sc_dev.dv_xname);
- if (AcpiEnableEvent(sc->sc_gpebit, ACPI_EVENT_GPE, 0) != AE_OK)
- printf("%s: EcRequest: unable to reenable EC GPE\n",
- sc->sc_dev.dv_xname);
EcUnlock(sc);
diff --git a/sys/dev/acpi/acpi_lid.c b/sys/dev/acpi/acpi_lid.c
index e0ddf70f6cb..69d5b2e5ae1 100644
--- a/sys/dev/acpi/acpi_lid.c
+++ b/sys/dev/acpi/acpi_lid.c
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_lid.c,v 1.8 2003/04/18 01:31:34 thorpej Exp $ */
+/* $NetBSD: acpi_lid.c,v 1.9 2003/10/31 20:54:18 mycroft Exp $ */
/*
* Copyright 2001, 2003 Wasabi Systems, Inc.
@@ -40,7 +40,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi_lid.c,v 1.8 2003/04/18 01:31:34 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_lid.c,v 1.9 2003/10/31 20:54:18 mycroft Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -80,7 +80,7 @@ acpilid_match(struct device *parent, struct cfdata *match, void *aux)
if (aa->aa_node->ad_type != ACPI_TYPE_DEVICE)
return (0);
- if (strcmp(aa->aa_node->ad_devinfo.HardwareId, "PNP0C0D") == 0)
+ if (strcmp(aa->aa_node->ad_devinfo.HardwareId.Value, "PNP0C0D") == 0)
return (1);
return (0);
diff --git a/sys/dev/acpi/acpi_madt.c b/sys/dev/acpi/acpi_madt.c
index b0abb8d536f..c30f59fd3d6 100644
--- a/sys/dev/acpi/acpi_madt.c
+++ b/sys/dev/acpi/acpi_madt.c
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_madt.c,v 1.7 2003/10/30 01:58:17 simonb Exp $ */
+/* $NetBSD: acpi_madt.c,v 1.8 2003/10/31 20:54:18 mycroft Exp $ */
/*
* Copyright (c) 2003 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi_madt.c,v 1.7 2003/10/30 01:58:17 simonb Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_madt.c,v 1.8 2003/10/31 20:54:18 mycroft Exp $");
#include <sys/param.h>
#include <sys/ioctl.h>
@@ -56,15 +56,15 @@ __KERNEL_RCSID(0, "$NetBSD: acpi_madt.c,v 1.7 2003/10/30 01:58:17 simonb Exp $")
#ifdef ACPI_MADT_DEBUG
static void acpi_madt_print(void);
static ACPI_STATUS acpi_madt_print_entry(APIC_HEADER *, void *);
-static void acpi_print_apic_proc(PROCESSOR_APIC *);
-static void acpi_print_ioapic(IO_APIC *);
-static void acpi_print_intsrc_ovr(INT_SOURCE_OVERRIDE *);
-static void acpi_print_intsrc_nmi(INT_IOAPIC_SOURCE_NMI *);
-static void acpi_print_lapic_nmi(INT_LAPIC_SOURCE_NMI *);
-static void acpi_print_lapic_addr_ovr(LAPIC_ADDR_OVR *);
-static void acpi_print_iosapic(IO_SAPIC *);
-static void acpi_print_local_sapic(LOCAL_SAPIC *);
-static void acpi_print_platint(INT_PLATFORM *);
+static void acpi_print_apic_proc(MADT_PROCESSOR_APIC *);
+static void acpi_print_ioapic(MADT_IO_APIC *);
+static void acpi_print_intsrc_ovr(MADT_INTERRUPT_OVERRIDE *);
+static void acpi_print_intsrc_nmi(MADT_NMI_SOURCE *);
+static void acpi_print_lapic_nmi(MADT_LOCAL_APIC_NMI *);
+static void acpi_print_lapic_addr_ovr(MADT_ADDRESS_OVERRIDE *);
+static void acpi_print_iosapic(MADT_IO_SAPIC *);
+static void acpi_print_local_sapic(MADT_LOCAL_SAPIC *);
+static void acpi_print_platint(MADT_INTERRUPT_SOURCE *);
#endif
ACPI_TABLE_HEADER *AcpiGbl_MADT;
@@ -72,7 +72,7 @@ ACPI_TABLE_HEADER *AcpiGbl_MADT;
ACPI_STATUS
acpi_madt_map(void)
{
- ACPI_TABLE_HEADER *hdrp, header;
+ ACPI_TABLE_HEADER header;
XSDT_DESCRIPTOR *xp;
ACPI_POINTER Address;
ACPI_STATUS Status = AE_OK;
@@ -85,11 +85,10 @@ acpi_madt_map(void)
return AE_ALREADY_EXISTS;
xp = AcpiGbl_XSDT;
- hdrp = &AcpiGbl_XSDT->Header;
Address.PointerType = AcpiGbl_TableFlags | ACPI_LOGICAL_ADDRESSING;
- len = (hdrp->Length - sizeof (ACPI_TABLE_HEADER))
+ len = (xp->Length - sizeof (ACPI_TABLE_HEADER))
/ sizeof (xp->TableOffsetEntry[0]);
for (i = 0; i < len; i++) {
@@ -124,57 +123,57 @@ acpi_madt_unmap(void)
#ifdef ACPI_MADT_DEBUG
static void
-acpi_print_apic_proc(PROCESSOR_APIC *p)
+acpi_print_apic_proc(MADT_PROCESSOR_APIC *p)
{
printf("processor: id %u apid %u enabled: %s\n",
- p->ProcessorApicId, p->LocalApicId,
+ p->ProcessorId, p->LocalApicId,
p->ProcessorEnabled ? "yes" : "no");
}
static void
-acpi_print_ioapic(IO_APIC *p)
+acpi_print_ioapic(MADT_IO_APIC *p)
{
printf("ioapic: apid %u address %x vector base %x\n",
- p->IoApicId, p->IoApicAddress, p->Vector);
+ p->IoApicId, p->Address, p->Interrupt);
}
static void
-acpi_print_intsrc_ovr(INT_SOURCE_OVERRIDE *p)
+acpi_print_intsrc_ovr(MADT_INTERRUPT_OVERRIDE *p)
{
printf("int override: bus %u irq %u int %u\n",
- p->Bus, p->Source, p->GlobalInt);
+ p->Bus, p->Source, p->Interrupt);
}
static void
-acpi_print_intsrc_nmi(INT_IOAPIC_SOURCE_NMI *p)
+acpi_print_intsrc_nmi(MADT_NMI_SOURCE *p)
{
- printf("ioapic NMI: int %u\n", p->GlobalInt);
+ printf("ioapic NMI: int %u\n", p->Interrupt);
}
static void
-acpi_print_lapic_nmi(INT_LAPIC_SOURCE_NMI *p)
+acpi_print_lapic_nmi(MADT_LOCAL_APIC_NMI *p)
{
- printf("lapic NMI: apid %u input %u\n", p->ApicId, p->Lint);
+ printf("lapic NMI: apid %u input %u\n", p->ProcessorId, p->Lint);
}
static void
-acpi_print_lapic_addr_ovr(LAPIC_ADDR_OVR *p)
+acpi_print_lapic_addr_ovr(MADT_ADDRESS_OVERRIDE *p)
{
- printf("lapic addr override: %llx\n", p->LocalApicAddress);
+ printf("lapic addr override: %llx\n", p->Address);
}
static void
-acpi_print_iosapic(IO_SAPIC *p)
+acpi_print_iosapic(MADT_IO_SAPIC *p)
{
printf("iosapic: sapid %u address %llx vector base %x\n",
- p->IoSapicId, p->IoSapicAddress, p->Vector);
+ p->IoSapicId, p->Address, p->InterruptBase);
}
static void
-acpi_print_local_sapic(LOCAL_SAPIC *p)
+acpi_print_local_sapic(MADT_LOCAL_SAPIC *p)
{
printf("local sapic: cpu %u sapid %u sapeid %u enabled: %s\n",
- p->ProcessorApicId, p->LocalSapicId, p->LocalSapicEid,
+ p->ProcessorId, p->LocalSapicId, p->LocalSapicEid,
p->ProcessorEnabled ? "yes" : "no");
}
@@ -182,7 +181,7 @@ static void
acpi_print_platint(INT_PLATFORM *p)
{
printf("platform int: type %u apid %u apeid %u\n",
- p->Type, p->ProcessorId, p->ProcessorEid);
+ p->InterruptType, p->ProcessorId, p->ProcessorEid);
}
#endif
@@ -194,7 +193,7 @@ acpi_madt_walk(ACPI_STATUS (*func)(APIC_HEADER *, void *), void *aux)
APIC_HEADER *hdrp;
madtend = (char *)AcpiGbl_MADT + AcpiGbl_MADT->Length;
- where = (char *)AcpiGbl_MADT + sizeof (APIC_TABLE);
+ where = (char *)AcpiGbl_MADT + sizeof (MULTIPLE_APIC_TABLE);
while (where < madtend) {
hdrp = (APIC_HEADER *)where;
if (func(hdrp, aux) != AE_OK)
@@ -229,25 +228,25 @@ acpi_madt_print_entry(APIC_HEADER *hdrp, void *aux)
case APIC_IO:
acpi_print_ioapic((void *)hdrp);
break;
- case APIC_INTSRC_OVR:
+ case APIC_XRUPT_OVERRIDE:
acpi_print_intsrc_ovr((void *)hdrp);
break;
- case APIC_INTSRC_NMI:
+ case APIC_NMI:
acpi_print_intsrc_nmi((void *)hdrp);
break;
- case APIC_LAPIC_NMI:
+ case APIC_LOCAL_NMI:
acpi_print_lapic_nmi((void *)hdrp);
break;
- case APIC_ADDR_OVR:
+ case APIC_ADDRESS_OVERRIDE:
acpi_print_lapic_addr_ovr((void *)hdrp);
break;
- case APIC_IOSAPIC:
+ case APIC_IO_SAPIC:
acpi_print_iosapic((void *)hdrp);
break;
case APIC_LOCAL_SAPIC:
acpi_print_local_sapic((void *)hdrp);
break;
- case APIC_PLAT_INTSRC:
+ case APIC_XRUPT_SOURCE:
acpi_print_platint((void *)hdrp);
break;
default:
diff --git a/sys/dev/acpi/acpi_madt.h b/sys/dev/acpi/acpi_madt.h
index 7c109f6b539..5f58564de49 100644
--- a/sys/dev/acpi/acpi_madt.h
+++ b/sys/dev/acpi/acpi_madt.h
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_madt.h,v 1.2 2003/01/07 18:46:49 fvdl Exp $ */
+/* $NetBSD: acpi_madt.h,v 1.3 2003/10/31 20:54:18 mycroft Exp $ */
/*
* Copyright (c) 2003 Wasabi Systems, Inc.
@@ -36,113 +36,11 @@
*/
/*
- * MADT entry types not defined in actbl.h
- */
-#define APIC_INTSRC_OVR 2
-#define APIC_INTSRC_NMI 3
-#define APIC_LAPIC_NMI 4
-#define APIC_ADDR_OVR 5
-#define APIC_IOSAPIC 6
-#define APIC_LOCAL_SAPIC 7
-#define APIC_PLAT_INTSRC 8
-
-#pragma pack(1)
-
-/*
* MADT entry structures not defined in actbl.h
*/
-
-/*
- * Interrupt source override.
- */
-typedef struct
-{
- APIC_HEADER Header;
- UINT8 Bus; /* 0 (ISA) */
- UINT8 Source; /* Legacy IRQ */
- UINT32 GlobalInt; /* Glocal IO APIC int */
- UINT32_BIT Polarity:2; /* See MPS_INTPO* in mpbiosreg.h */
- UINT32_BIT Trigger:2; /* See MPS_INTTR* in mpbiosreg.h */
- UINT32_BIT Reserved:12; /* Must be zero */
-} INT_SOURCE_OVERRIDE;
-
-/*
- * I/O APIC NMI source structure.
- */
-typedef struct
-{
- APIC_HEADER Header;
- UINT32_BIT Polarity:2; /* See above */
- UINT32_BIT Trigger:2; /* See above */
- UINT32_BIT Reserved:12;
- UINT32 GlobalInt;
-} INT_IOAPIC_SOURCE_NMI;
-
-/*
- * Local APIC NMI mapping.
- */
-typedef struct
-{
- APIC_HEADER Header;
- UINT8 ApicId; /* Local APIC Id */
- UINT32_BIT Polarity:2; /* See above */
- UINT32_BIT Trigger:2; /* See above */
- UINT32_BIT Reserved:12;
- UINT8 Lint; /* Local APIC input */
-} INT_LAPIC_SOURCE_NMI;
-
-/*
- * 64-bit local APIC address override.
- */
-typedef struct
-{
- APIC_HEADER Header;
- UINT16 Reserved; /* Must be zero */
- UINT64 LocalApicAddress; /* Phys addr of local APIC */
-} LAPIC_ADDR_OVR;
-
-/*
- * I/O SAPIC.
- */
-typedef struct
-{
- APIC_HEADER Header;
- UINT8 IoSapicId;
- UINT8 Reserved;
- UINT32 Vector; /* Vectors start at this off */
- UINT64 IoSapicAddress; /* Phys addr of SAPIC */
-} IO_SAPIC;
-
-/*
- * Local SAPIC.
- */
-typedef struct
-{
- APIC_HEADER Header;
- UINT8 ProcessorApicId;
- UINT8 LocalSapicId;
- UINT8 LocalSapicEid;
- UINT8 Reserved[3];
- UINT32_BIT ProcessorEnabled:1;
- UINT32_BIT Reserved1:31;
-} LOCAL_SAPIC;
-
-/*
- * Platform interrupt source.
- */
-typedef struct
-{
- APIC_HEADER Header;
- UINT32_BIT Polarity:2; /* See above */
- UINT32_BIT Trigger:2; /* See above */
- UINT32_BIT Reserved:12;
- UINT8 Type; /* See below */
- UINT8 ProcessorId;
- UINT8 ProcessorEid;
- UINT8 IoSapicVector;
- UINT32 GlobalInt;
- UINT32 Reserved1;
-} INT_PLATFORM;
+typedef struct {
+ APIC_HEADER_DEF
+} APIC_HEADER;
#define ACPI_PLATFORM_INT_PMI 1
#define ACPI_PLATFORM_INT_INIT 2
diff --git a/sys/dev/acpi/acpi_quirks.c b/sys/dev/acpi/acpi_quirks.c
index 5fd6b6ff0b2..c54c5051668 100644
--- a/sys/dev/acpi/acpi_quirks.c
+++ b/sys/dev/acpi/acpi_quirks.c
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_quirks.c,v 1.2 2003/10/02 16:05:33 christos Exp $ */
+/* $NetBSD: acpi_quirks.c,v 1.3 2003/10/31 20:54:18 mycroft Exp $ */
/*
* Copyright 2002 Wasabi Systems, Inc.
@@ -37,7 +37,7 @@
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi_quirks.c,v 1.2 2003/10/02 16:05:33 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_quirks.c,v 1.3 2003/10/31 20:54:18 mycroft Exp $");
#include "opt_acpi.h"
@@ -76,15 +76,13 @@ acpi_find_quirks(void)
{
int i, nquirks;
struct acpi_quirk *aqp;
- ACPI_TABLE_HEADER *ap;
- ap = &AcpiGbl_XSDT->Header;
nquirks = sizeof(acpi_quirks) / sizeof(struct acpi_quirk);
for (i = 0; i < nquirks; i++) {
aqp = &acpi_quirks[i];
- if (!strncmp(aqp->aq_oemid, ap->OemId, strlen(aqp->aq_oemid)) &&
- aqp->aq_oemrev == ap->OemRevision)
+ if (!strncmp(aqp->aq_oemid, AcpiGbl_XSDT->OemId, strlen(aqp->aq_oemid)) &&
+ aqp->aq_oemrev == AcpiGbl_XSDT->OemRevision)
return aqp->aq_quirks;
}
return 0;
diff --git a/sys/dev/acpi/acpivar.h b/sys/dev/acpi/acpivar.h
index 7f74dc61b20..27b82924bd8 100644
--- a/sys/dev/acpi/acpivar.h
+++ b/sys/dev/acpi/acpivar.h
@@ -1,4 +1,4 @@
-/* $NetBSD: acpivar.h,v 1.12 2003/07/08 09:07:16 itojun Exp $ */
+/* $NetBSD: acpivar.h,v 1.13 2003/10/31 20:54:18 mycroft Exp $ */
/*
* Copyright 2001 Wasabi Systems, Inc.
@@ -283,10 +283,6 @@ struct acpi_drq *acpi_res_drq(struct acpi_resources *, int);
*/
ACPI_STATUS acpi_enter_sleep_state(struct acpi_softc *, int);
-ACPI_STATUS acpi_acquire_global_lock(UINT32 *);
-void acpi_release_global_lock(UINT32);
-int acpi_is_global_locked(void);
-
/*
* quirk handling
*/
diff --git a/sys/dev/acpi/com_acpi.c b/sys/dev/acpi/com_acpi.c
index 6ab9b1a1ec1..4e5029e3455 100644
--- a/sys/dev/acpi/com_acpi.c
+++ b/sys/dev/acpi/com_acpi.c
@@ -1,4 +1,4 @@
-/* $NetBSD: com_acpi.c,v 1.7 2003/01/09 12:23:28 jdolecek Exp $ */
+/* $NetBSD: com_acpi.c,v 1.8 2003/10/31 20:54:18 mycroft Exp $ */
/*
* Copyright (c) 2002 Jared D. McNeill <jmcneill@invisible.ca>
@@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: com_acpi.c,v 1.7 2003/01/09 12:23:28 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: com_acpi.c,v 1.8 2003/10/31 20:54:18 mycroft Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -86,7 +86,7 @@ com_acpi_match(struct device *parent, struct cfdata *match, void *aux)
return 0;
for (i = 0; (id = com_acpi_ids[i]) != NULL; ++i) {
- if (strcmp(aa->aa_node->ad_devinfo.HardwareId, id) == 0)
+ if (strcmp(aa->aa_node->ad_devinfo.HardwareId.Value, id) == 0)
return 1;
}
diff --git a/sys/dev/acpi/fdc_acpi.c b/sys/dev/acpi/fdc_acpi.c
index 35d03e1caca..33a4b8e5f8b 100644
--- a/sys/dev/acpi/fdc_acpi.c
+++ b/sys/dev/acpi/fdc_acpi.c
@@ -1,4 +1,4 @@
-/* $NetBSD: fdc_acpi.c,v 1.13 2003/09/25 21:55:49 christos Exp $ */
+/* $NetBSD: fdc_acpi.c,v 1.14 2003/10/31 20:54:18 mycroft Exp $ */
/*
* Copyright (c) 2002 Jared D. McNeill <jmcneill@invisible.ca>
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fdc_acpi.c,v 1.13 2003/09/25 21:55:49 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fdc_acpi.c,v 1.14 2003/10/31 20:54:18 mycroft Exp $");
#include "rnd.h"
@@ -106,7 +106,7 @@ fdc_acpi_match(struct device *parent, struct cfdata *match, void *aux)
return 0;
for (i = 0; (id = fdc_acpi_ids[i]) != NULL; ++i) {
- if (strcmp(aa->aa_node->ad_devinfo.HardwareId, id) == 0)
+ if (strcmp(aa->aa_node->ad_devinfo.HardwareId.Value, id) == 0)
return 1;
}
diff --git a/sys/dev/acpi/lpt_acpi.c b/sys/dev/acpi/lpt_acpi.c
index 7b3dafa0cff..83280472cfe 100644
--- a/sys/dev/acpi/lpt_acpi.c
+++ b/sys/dev/acpi/lpt_acpi.c
@@ -1,4 +1,4 @@
-/* $NetBSD: lpt_acpi.c,v 1.2 2003/01/09 12:23:28 jdolecek Exp $ */
+/* $NetBSD: lpt_acpi.c,v 1.3 2003/10/31 20:54:18 mycroft Exp $ */
/*
* Copyright (c) 2002 Jared D. McNeill <jmcneill@invisible.ca>
@@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: lpt_acpi.c,v 1.2 2003/01/09 12:23:28 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lpt_acpi.c,v 1.3 2003/10/31 20:54:18 mycroft Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -82,7 +82,7 @@ lpt_acpi_match(struct device *parent, struct cfdata *match, void *aux)
return 0;
for (i = 0; (id = lpt_acpi_ids[i]) != NULL; ++i) {
- if (strcmp(aa->aa_node->ad_devinfo.HardwareId, id) == 0)
+ if (strcmp(aa->aa_node->ad_devinfo.HardwareId.Value, id) == 0)
return 1;
}
diff --git a/sys/dev/acpi/pckbc_acpi.c b/sys/dev/acpi/pckbc_acpi.c
index 157675b8244..f61abfd8d74 100644
--- a/sys/dev/acpi/pckbc_acpi.c
+++ b/sys/dev/acpi/pckbc_acpi.c
@@ -1,4 +1,4 @@
-/* $NetBSD: pckbc_acpi.c,v 1.5 2003/10/27 06:15:52 christos Exp $ */
+/* $NetBSD: pckbc_acpi.c,v 1.6 2003/10/31 20:54:18 mycroft Exp $ */
/*-
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -49,7 +49,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pckbc_acpi.c,v 1.5 2003/10/27 06:15:52 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pckbc_acpi.c,v 1.6 2003/10/31 20:54:18 mycroft Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -120,7 +120,7 @@ pckbc_acpi_match(struct device *parent, struct cfdata *match, void *aux)
return (0);
for (i = 0; (id = pckbc_acpi_ids[i]) != NULL; ++i) {
- if (strcmp(aa->aa_node->ad_devinfo.HardwareId, id) == 0)
+ if (strcmp(aa->aa_node->ad_devinfo.HardwareId.Value, id) == 0)
return (1);
}
@@ -138,7 +138,7 @@ pckbc_acpi_attach(struct device *parent,
struct pckbc_internal *t;
struct acpi_attach_args *aa = aux;
bus_space_handle_t ioh_d, ioh_c;
- const char *idstr = aa->aa_node->ad_devinfo.HardwareId;
+ const char *idstr = aa->aa_node->ad_devinfo.HardwareId.Value;
pckbc_slot_t peer;
struct acpi_resources res;
struct acpi_io *io0, *io1;
diff --git a/sys/dev/acpi/wss_acpi.c b/sys/dev/acpi/wss_acpi.c
index 935fe6f5173..d4354e6ac53 100644
--- a/sys/dev/acpi/wss_acpi.c
+++ b/sys/dev/acpi/wss_acpi.c
@@ -1,4 +1,4 @@
-/* $NetBSD: wss_acpi.c,v 1.5 2003/01/13 13:01:15 mrg Exp $ */
+/* $NetBSD: wss_acpi.c,v 1.6 2003/10/31 20:54:18 mycroft Exp $ */
/*
* Copyright (c) 2002 Jared D. McNeill <jmcneill@invisible.ca>
@@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wss_acpi.c,v 1.5 2003/01/13 13:01:15 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wss_acpi.c,v 1.6 2003/10/31 20:54:18 mycroft Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -102,7 +102,7 @@ wss_acpi_match(struct device *parent, struct cfdata *match, void *aux)
struct acpi_attach_args *aa = aux;
if (aa->aa_node->ad_type != ACPI_TYPE_DEVICE ||
- wss_acpi_hints_index(aa->aa_node->ad_devinfo.HardwareId) == -1)
+ wss_acpi_hints_index(aa->aa_node->ad_devinfo.HardwareId.Value) == -1)
return (0);
return (1);
@@ -127,7 +127,7 @@ wss_acpi_attach(struct device *parent, struct device *self, void *aux)
printf(": NeoMagic 256AV audio\n");
wah = &wss_acpi_hints[
- wss_acpi_hints_index(aa->aa_node->ad_devinfo.HardwareId)];
+ wss_acpi_hints_index(aa->aa_node->ad_devinfo.HardwareId.Value)];
/* Parse our resources */
rv = acpi_resource_parse(&sc->sc_ad1848.sc_ad1848.sc_dev,