summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJordan Hargrave <jordan@cvs.openbsd.org>2008-05-13 09:05:07 +0000
committerJordan Hargrave <jordan@cvs.openbsd.org>2008-05-13 09:05:07 +0000
commit116e7b78e0e3110208e1eaf0c4256267047b5992 (patch)
treee5ad03e877142835ea8e73ba32a241e11fb503bf
parent047c11b31b3a3259782666248f79e4ecb993e340 (diff)
Adding changes for new parser
ok marco@
-rw-r--r--sys/dev/acpi/amltypes.h42
-rw-r--r--sys/dev/acpi/dsdt.h19
2 files changed, 59 insertions, 2 deletions
diff --git a/sys/dev/acpi/amltypes.h b/sys/dev/acpi/amltypes.h
index e7d7913868f..54fd887a99d 100644
--- a/sys/dev/acpi/amltypes.h
+++ b/sys/dev/acpi/amltypes.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: amltypes.h,v 1.25 2007/02/06 18:56:31 jordan Exp $ */
+/* $OpenBSD: amltypes.h,v 1.26 2008/05/13 09:05:06 jordan Exp $ */
/*
* Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org>
*
@@ -181,6 +181,8 @@ enum aml_objecttype {
AML_OBJTYPE_NAMEREF = 0x100,
AML_OBJTYPE_OBJREF,
+ AML_OBJTYPE_SCOPE,
+ AML_OBJTYPE_NOTARGET,
AML_OBJTYPE_STATICINT=AML_OBJTYPE_INTEGER|AML_STATIC,
};
@@ -211,6 +213,17 @@ enum aml_objecttype {
#define AML_ARG_TERMOBJLIST 'T'
#define AML_ARG_TERMOBJ 't'
+#define AML_ARG_IFELSE 'I'
+#define AML_ARG_WHILE 'W'
+#define AML_ARG_BUFFER 'B'
+#define AML_ARG_SEARCHNAME 'n'
+#define AML_ARG_CREATENAME 'N'
+#define AML_ARG_STKARG 'A'
+#define AML_ARG_STKLOCAL 'L'
+#define AML_ARG_DEBUG 'D'
+#define AML_ARG_CONST 'c'
+#define AML_ARG_TARGET 'r'
+
#define AML_METHOD_ARGCOUNT(v) (((v) >> 0) & 0x7)
#define AML_METHOD_SERIALIZED(v) (((v) >> 3) & 0x1)
#define AML_METHOD_SYNCLEVEL(v) (((v) >> 4) & 0xF)
@@ -239,6 +252,13 @@ enum aml_objecttype {
struct aml_scope;
struct aml_node;
+struct aml_waitq
+{
+ struct aml_scope *scope;
+ SIMPLEQ_ENTRY(aml_waitq) link;
+};
+SIMPLEQ_HEAD(aml_waitq_head, aml_waitq);
+
/* AML Object Value */
struct aml_value {
int type;
@@ -261,6 +281,7 @@ struct aml_value {
u_int8_t *start;
u_int8_t *end;
struct aml_value *(*fneval)(struct aml_scope *, struct aml_value *);
+ u_int8_t *base;
} vmethod;
struct {
u_int16_t type;
@@ -277,6 +298,7 @@ struct aml_value {
u_int8_t proc_len;
} vprocessor;
struct {
+ int type;
int index;
struct aml_value *ref;
} vobjref;
@@ -285,6 +307,22 @@ struct aml_value {
u_int16_t pwr_order;
} vpowerrsrc;
struct acpi_mutex *vmutex;
+ struct {
+ u_int8_t *name;
+ struct aml_node *node;
+ } vnameref;
+ struct {
+ int synclvl;
+ int savelvl;
+ int count;
+ char ownername[5];
+ struct aml_scope *owner;
+ struct aml_waitq_head waiters;
+ } Vmutex;
+ struct {
+ int state;
+ struct aml_waitq_head waiters;
+ } Vevent;
} _;
};
@@ -300,6 +338,8 @@ struct aml_value {
#define v_processor _.vprocessor
#define v_powerrsrc _.vpowerrsrc
#define v_mutex _.vmutex
+#define v_mtx _.Vmutex
+#define v_evt _.Vevent
#define xaml_intval(v) ((v)->v_integer)
#define aml_strlen(v) ((v)->length)
diff --git a/sys/dev/acpi/dsdt.h b/sys/dev/acpi/dsdt.h
index 0160272da9f..5ec041f0d8f 100644
--- a/sys/dev/acpi/dsdt.h
+++ b/sys/dev/acpi/dsdt.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: dsdt.h,v 1.31 2007/11/14 20:31:31 deraadt Exp $ */
+/* $OpenBSD: dsdt.h,v 1.32 2008/05/13 09:05:06 jordan Exp $ */
/*
* Copyright (c) 2005 Marco Peereboom <marco@openbsd.org>
*
@@ -34,6 +34,10 @@ struct aml_scope {
struct aml_value *locals;
struct aml_value *args;
int nargs;
+ int flags;
+ struct aml_value *retv;
+ uint8_t *start;
+ int type;
};
@@ -60,6 +64,8 @@ void aml_freevalue(struct aml_value *);
void aml_notify(struct aml_node *, int);
void aml_notify_dev(const char *, int);
void aml_showvalue(struct aml_value *, int);
+void aml_walkroot(void);
+void aml_walktree(struct aml_node *);
int aml_find_node(struct aml_node *, const char *,
int (*)(struct aml_node *, void *), void *);
@@ -245,4 +251,15 @@ void aml_foreachpkg(struct aml_value *, int,
const char *aml_val_to_string(const struct aml_value *);
+int valid_acpihdr(void *, int, const char *);
+void aml_disasm(struct aml_scope *scope, int lvl,
+ void (*dbprintf)(void *, const char *, ...),
+ void *arg);
+int aml_xgetpci(struct aml_node *, int64_t *);
+
+#define aml_get8(p) *(uint8_t *)(p)
+#define aml_get16(p) *(uint16_t *)(p)
+#define aml_get32(p) *(uint32_t *)(p)
+#define aml_get64(p) *(uint64_t *)(p)
+
#endif /* __DEV_ACPI_DSDT_H__ */