]> xenbits.xensource.com Git - seabios.git/commitdiff
acpi_extract: detect DeviceOp
authorPaolo Bonzini <pbonzini@redhat.com>
Thu, 2 Aug 2012 13:07:24 +0000 (15:07 +0200)
committerKevin O'Connor <kevin@koconnor.net>
Sun, 2 Sep 2012 20:20:13 +0000 (16:20 -0400)
The DeviceOp AML opcode has more or less the same structure as ProcessorOp,
except that there is no processor ID.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
tools/acpi_extract.py

index 81fa4aa31eef4f8a628ceb47d730a4ad04e1d4af..32956788596bb8a53474e60f606ee20a0704a810 100755 (executable)
@@ -164,6 +164,28 @@ def aml_name_word_const(offset):
 def aml_name_byte_const(offset):
     return aml_data_byte_const(aml_name_string(offset) + 4)
 
+def aml_device_start(offset):
+    #0x5B 0x82 DeviceOp PkgLength NameString
+    if ((aml[offset] != 0x5B) or (aml[offset + 1] != 0x82)):
+        die( "Name offset 0x%x: expected 0x5B 0x82 actual 0x%x 0x%x" %
+             (offset, aml[offset], aml[offset + 1]));
+    return offset
+
+def aml_device_string(offset):
+    #0x5B 0x82 DeviceOp PkgLength NameString
+    start = aml_device_start(offset)
+    offset += 2
+    pkglenbytes = aml_pkglen_bytes(offset)
+    offset += pkglenbytes
+    return offset
+
+def aml_device_end(offset):
+    start = aml_device_start(offset)
+    offset += 2
+    pkglenbytes = aml_pkglen_bytes(offset)
+    pkglen = aml_pkglen(offset)
+    return offset + pkglen
+
 def aml_processor_start(offset):
     #0x5B 0x83 ProcessorOp PkgLength NameString ProcID
     if ((aml[offset] != 0x5B) or (aml[offset + 1] != 0x83)):
@@ -271,6 +293,12 @@ for i in range(len(asl)):
         offset = aml_name_string(offset)
     elif (directive == "ACPI_EXTRACT_METHOD_STRING"):
         offset = aml_method_string(offset)
+    elif (directive == "ACPI_EXTRACT_DEVICE_START"):
+        offset = aml_device_start(offset)
+    elif (directive == "ACPI_EXTRACT_DEVICE_STRING"):
+        offset = aml_device_string(offset)
+    elif (directive == "ACPI_EXTRACT_DEVICE_END"):
+        offset = aml_device_end(offset)
     elif (directive == "ACPI_EXTRACT_PROCESSOR_START"):
         offset = aml_processor_start(offset)
     elif (directive == "ACPI_EXTRACT_PROCESSOR_STRING"):