From e50592ac572d97a1ad258f180a94a57db5e06052 Mon Sep 17 00:00:00 2001 From: iwasaki Date: Sat, 30 Sep 2000 22:37:24 +0000 Subject: - Add acpi_disable_events() and set it with EVENTHANDLER_REGISTER in order to avoid power on again problem after acpi_soft_off() calling. - Implement SleepOp/StallOp in AML interpreter. Also provide ACPICA compatibility. - Minor changes on __inline function declaration in acpica_osd.h (obtained from NetBSD porting). --- usr.sbin/acpi/amldb/aml/aml_common.h | 4 ++++ usr.sbin/acpi/amldb/aml/aml_parse.c | 20 ++++++++++++++++---- 2 files changed, 20 insertions(+), 4 deletions(-) (limited to 'usr.sbin/acpi') 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 +#include +#include +#include +#include +#include +#ifndef ACPI_NO_OSDFUNC_INLINE +#include +#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 */ -- cgit v1.1