aboutsummaryrefslogtreecommitdiff
path: root/tools/acpi_extract.py
diff options
context:
space:
mode:
Diffstat (limited to 'tools/acpi_extract.py')
-rwxr-xr-xtools/acpi_extract.py17
1 files changed, 16 insertions, 1 deletions
diff --git a/tools/acpi_extract.py b/tools/acpi_extract.py
index dd3ccfd..ab8ced6 100755
--- a/tools/acpi_extract.py
+++ b/tools/acpi_extract.py
@@ -128,6 +128,15 @@ def aml_name_string(offset):
offset += 1
return offset;
+# Given data offset, find 8 byte buffer offset
+def aml_data_buffer8(offset):
+ #0x08 NameOp NameString DataRef
+ expect = [0x11, 0x0B, 0x0A, 0x08]
+ if (aml[offset:offset+4] != expect):
+ die( "Name offset 0x%x: expected %s actual %s" %
+ (offset, aml[offset:offset+4], expect))
+ return offset + len(expect)
+
# Given data offset, find dword const offset
def aml_data_dword_const(offset):
#0x08 NameOp NameString DataRef
@@ -152,6 +161,10 @@ def aml_data_byte_const(offset):
(offset, aml[offset]));
return offset + 1;
+# Find name'd buffer8
+def aml_name_buffer8(offset):
+ return aml_data_buffer8(aml_name_string(offset) + 4)
+
# Given name offset, find dword const offset
def aml_name_dword_const(offset):
return aml_data_dword_const(aml_name_string(offset) + 4)
@@ -283,7 +296,9 @@ for i in range(len(asl)):
die("%s directive used more than once" % directive)
output[array] = aml
continue
- if (directive == "ACPI_EXTRACT_NAME_DWORD_CONST"):
+ if (directive == "ACPI_EXTRACT_NAME_BUFFER8"):
+ offset = aml_name_buffer8(offset)
+ elif (directive == "ACPI_EXTRACT_NAME_DWORD_CONST"):
offset = aml_name_dword_const(offset)
elif (directive == "ACPI_EXTRACT_NAME_WORD_CONST"):
offset = aml_name_word_const(offset)