summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJordan Hargrave <jordan@cvs.openbsd.org>2006-02-16 22:42:12 +0000
committerJordan Hargrave <jordan@cvs.openbsd.org>2006-02-16 22:42:12 +0000
commit78d09a35c70bfb85175af75560a1d9dfb5bfcd2b (patch)
tree74b006699a3e244bb29cc3a5149c24117e50c0ee
parent6f6fa1bcc70d5b7486c6a12d046ac4c7006e7e18 (diff)
Added stub for calling _INI
Fixed aml_dowhile for NULL return ok marco@
-rw-r--r--sys/dev/acpi/acpi.c17
-rw-r--r--sys/dev/acpi/dsdt.c11
2 files changed, 25 insertions, 3 deletions
diff --git a/sys/dev/acpi/acpi.c b/sys/dev/acpi/acpi.c
index e53d7a11603..1a0e224525d 100644
--- a/sys/dev/acpi/acpi.c
+++ b/sys/dev/acpi/acpi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: acpi.c,v 1.27 2006/02/16 21:11:13 jordan Exp $ */
+/* $OpenBSD: acpi.c,v 1.28 2006/02/16 22:42:11 jordan Exp $ */
/*
* Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com>
* Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org>
@@ -53,6 +53,7 @@ void acpi_write_pmreg(struct acpi_softc *, int, int);
void acpi_gpe(struct aml_node *, void *);
void acpi_foundhid(struct aml_node *, void *);
+void acpi_inidev(struct aml_node *, void *);
int acpi_loadtables(struct acpi_softc *, struct acpi_rsdp *);
void acpi_load_table(paddr_t, size_t, acpi_qhead_t *);
@@ -445,6 +446,15 @@ acpi_gpe(struct aml_node *node, void *arg)
}
void
+acpi_inidev(struct aml_node *node, void *arg)
+{
+ struct acpi_softc *sc = (struct acpi_softc *)arg;
+ struct aml_value res;
+
+ aml_eval_object(sc, node, &res, 0, NULL);
+}
+
+void
acpi_foundhid(struct aml_node *node, void *arg)
{
struct acpi_softc *sc = (struct acpi_softc *)arg;
@@ -705,6 +715,11 @@ acpi_attach(struct device *parent, struct device *self, void *aux)
acpi_softc = sc;
+#if 0
+ /* attach devices found in dsdt */
+ aml_find_node(aml_root.child, "_INI", acpi_inidev, sc);
+#endif
+
/* attach devices found in dsdt */
aml_find_node(aml_root.child, "_HID", acpi_foundhid, sc);
}
diff --git a/sys/dev/acpi/dsdt.c b/sys/dev/acpi/dsdt.c
index 9108693c76b..18eb6909574 100644
--- a/sys/dev/acpi/dsdt.c
+++ b/sys/dev/acpi/dsdt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dsdt.c,v 1.20 2006/02/16 21:11:13 jordan Exp $ */
+/* $OpenBSD: dsdt.c,v 1.21 2006/02/16 22:42:11 jordan Exp $ */
/*
* Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org>
*
@@ -1888,7 +1888,7 @@ aml_dowhile(struct acpi_context *ctx)
break;
}
}
- if (*ctx->pos == AMLOP_BREAK) {
+ if (ctx->pos == NULL || *ctx->pos == AMLOP_BREAK) {
dnprintf(40, "break\n");
break;
}
@@ -2795,15 +2795,22 @@ acpi_parse_aml(struct acpi_softc *sc, u_int8_t *start, u_int32_t length)
{
struct acpi_context *ctx;
struct aml_value *rv;
+ struct aml_value aml_os;
aml_root.depth = -1;
aml_root.mnem = "ROOT";
aml_root.start = start;
aml_root.end = start + length;
+ /* Add \_OS_ string */
+ aml_os.type = AML_OBJTYPE_STRING;
+ aml_os.v_string = "OpenBSD";
ctx = acpi_alloccontext(sc, &aml_root, 0, NULL);
+ aml_addvname(ctx, "\\_OS_", 0, &aml_os);
+
rv = aml_eparselist(ctx, aml_root.end, 0);
aml_freevalue(&rv);
+
acpi_freecontext(ctx);
dnprintf(50, " : parsed %d AML bytes\n", length);