diff options
author | iwasaki <iwasaki@FreeBSD.org> | 2000-09-20 22:53:39 +0000 |
---|---|---|
committer | iwasaki <iwasaki@FreeBSD.org> | 2000-09-20 22:53:39 +0000 |
commit | de69fdf50b0c4a7db6616d494a19b5da4ca4a18b (patch) | |
tree | e22218c86c7a6fe332133772c59a1ad2fe59249a /sys/dev/acpi/aml/aml_evalobj.c | |
parent | ef70022f844efbe7329a5fe222fa0b475c9374cf (diff) | |
download | FreeBSD-src-de69fdf50b0c4a7db6616d494a19b5da4ca4a18b.zip FreeBSD-src-de69fdf50b0c4a7db6616d494a19b5da4ca4a18b.tar.gz |
Add new function in AML interpreter; aml_invoke_method().
Also remove unneeded includes in aml_obj.c and aml_parse.c.
This new function takes 'struct aml_name *' as a argument rather than
'char *' where aml_invoke_method_by_name() does. It's worth to have
these two interfaces in many cases.
Diffstat (limited to 'sys/dev/acpi/aml/aml_evalobj.c')
-rw-r--r-- | sys/dev/acpi/aml/aml_evalobj.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/sys/dev/acpi/aml/aml_evalobj.c b/sys/dev/acpi/aml/aml_evalobj.c index 41916f6..b73ef70 100644 --- a/sys/dev/acpi/aml/aml_evalobj.c +++ b/sys/dev/acpi/aml/aml_evalobj.c @@ -55,7 +55,6 @@ #include "debug.h" #else /* _KERNEL */ -#include <sys/bus.h> #include <sys/systm.h> #endif /* !_KERNEL */ @@ -378,10 +377,9 @@ aml_execute_method(struct aml_environ *env) } union aml_object * -aml_invoke_method_by_name(char *method, int argc, union aml_object *argv) +aml_invoke_method(struct aml_name *name, int argc, union aml_object *argv) { int i; - struct aml_name *name; struct aml_name *tmp; struct aml_environ *env; struct aml_local_stack *stack; @@ -394,7 +392,6 @@ aml_invoke_method_by_name(char *method, int argc, union aml_object *argv) return (NULL); } bzero(env, sizeof(struct aml_environ)); - name = aml_find_from_namespace(aml_get_rootname(), method); if (name != NULL && name->property != NULL && name->property->type == aml_t_method) { @@ -424,3 +421,16 @@ aml_invoke_method_by_name(char *method, int argc, union aml_object *argv) memman_free(aml_memman, memid_aml_environ, env); return (retval); } + +union aml_object * +aml_invoke_method_by_name(char *method, int argc, union aml_object *argv) +{ + struct aml_name *name; + + name = aml_find_from_namespace(aml_get_rootname(), method); + if (name == NULL) { + return (NULL); + } + + return (aml_invoke_method(name, argc, argv)); +} |