diff options
Diffstat (limited to 'usr.sbin/acpi')
-rw-r--r-- | usr.sbin/acpi/amldb/aml/aml_common.h | 4 | ||||
-rw-r--r-- | usr.sbin/acpi/amldb/aml/aml_parse.c | 20 |
2 files changed, 20 insertions, 4 deletions
diff --git a/usr.sbin/acpi/amldb/aml/aml_common.h b/usr.sbin/acpi/amldb/aml/aml_common.h index 4988385..827c324 100644 --- a/usr.sbin/acpi/amldb/aml/aml_common.h +++ b/usr.sbin/acpi/amldb/aml/aml_common.h @@ -47,11 +47,15 @@ printf(fmt, args); \ } while(0) #define AML_DEBUGGER(x, y) /* no debugger in kernel */ +#define AML_STALL(micro) DELAY(micro) +#define AML_SLEEP(sec, milli) OsdSleep(sec, milli) #else /* !_KERNEL */ #define AML_SYSASSERT(x) assert(x) #define AML_SYSABORT() abort() #define AML_SYSERRX(eval, fmt, args...) errx(eval, fmt, args) #define AML_DEBUGGER(x, y) aml_dbgr(x, y) +#define AML_STALL(micro) /* not required in userland */ +#define AML_SLEEP(sec, milli) /* not required in userland */ #endif /* _KERNEL */ union aml_object; diff --git a/usr.sbin/acpi/amldb/aml/aml_parse.c b/usr.sbin/acpi/amldb/aml/aml_parse.c index f98977d..ce40e64 100644 --- a/usr.sbin/acpi/amldb/aml/aml_parse.c +++ b/usr.sbin/acpi/amldb/aml/aml_parse.c @@ -55,6 +55,14 @@ #include "debug.h" #else /* _KERNEL */ #include <sys/systm.h> +#include <sys/bus.h> +#include <machine/bus.h> +#include <machine/clock.h> +#include <dev/acpi/acpireg.h> +#include <dev/acpi/acpivar.h> +#ifndef ACPI_NO_OSDFUNC_INLINE +#include <machine/acpica_osd.h> +#endif #endif /* !_KERNEL */ static int findsetleftbit(int num); @@ -1484,14 +1492,18 @@ aml_parse_termobj(struct aml_environ *env, int indent) aml_parse_termobj(env, indent); AML_DEBUGPRINT(")"); break; - case 0x21: /* StallOp *//* XXX Not yet */ + case 0x21: /* StallOp */ AML_DEBUGPRINT("Stall("); - aml_parse_termobj(env, indent); + num1 = aml_objtonum(env, aml_eval_name(env, + aml_parse_termobj(env, indent))); AML_DEBUGPRINT(")"); + AML_STALL(num1); break; - case 0x22: /* SleepOp *//* XXX Not yet */ + case 0x22: /* SleepOp */ AML_DEBUGPRINT("Sleep("); - aml_parse_termobj(env, indent); + num1 = aml_objtonum(env, aml_eval_name(env, + aml_parse_termobj(env, indent))); + AML_SLEEP(0, num1); AML_DEBUGPRINT(")"); break; case 0x23: /* AcquireOp *//* XXX Not yet */ |