summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/dev/acpi/dsdt.c17
-rw-r--r--sys/dev/acpi/dsdt.h6
2 files changed, 20 insertions, 3 deletions
diff --git a/sys/dev/acpi/dsdt.c b/sys/dev/acpi/dsdt.c
index 7efe0a1fd56..fb70fb0e3fa 100644
--- a/sys/dev/acpi/dsdt.c
+++ b/sys/dev/acpi/dsdt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dsdt.c,v 1.196 2012/07/10 15:57:41 pirofti Exp $ */
+/* $OpenBSD: dsdt.c,v 1.197 2012/07/16 15:27:11 deraadt Exp $ */
/*
* Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org>
*
@@ -4058,6 +4058,21 @@ aml_evalnode(struct acpi_softc *sc, struct aml_node *node,
return (0);
}
+int
+aml_node_setval(struct acpi_softc *sc, struct aml_node *node, int64_t val)
+{
+ struct aml_value env;
+
+ if (!node)
+ return (0);
+
+ memset(&env, 0, sizeof(env));
+ env.type = AML_OBJTYPE_INTEGER;
+ env.v_integer = val;
+
+ return aml_evalnode(sc, node, 1, &env, NULL);
+}
+
/*
* evaluate an AML name
* Returns a copy of the value in res (must be freed by user)
diff --git a/sys/dev/acpi/dsdt.h b/sys/dev/acpi/dsdt.h
index fc0f1a7696c..9333cb4ef32 100644
--- a/sys/dev/acpi/dsdt.h
+++ b/sys/dev/acpi/dsdt.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: dsdt.h,v 1.59 2011/06/03 03:54:19 jordan Exp $ */
+/* $OpenBSD: dsdt.h,v 1.60 2012/07/16 15:27:11 deraadt Exp $ */
/*
* Copyright (c) 2005 Marco Peereboom <marco@openbsd.org>
*
@@ -62,7 +62,9 @@ void aml_register_notify(struct aml_node *, const char *,
int);
int aml_evalnode(struct acpi_softc *, struct aml_node *,
- int , struct aml_value *, struct aml_value *);
+ int, struct aml_value *, struct aml_value *);
+int aml_node_setval(struct acpi_softc *, struct aml_node *,
+ int64_t);
int aml_evalname(struct acpi_softc *, struct aml_node *,
const char *, int, struct aml_value *,
struct aml_value *);