qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Gleb Natapov <gleb@redhat.com>
To: seabios@seabios.org
Cc: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH 1/2] Add ACPI_EXTRACT_PKG_START macro parsing
Date: Mon, 14 May 2012 15:35:22 +0300	[thread overview]
Message-ID: <1336998923-30144-1-git-send-email-gleb@redhat.com> (raw)

It allows to extract the beginning of a Package object content.

Signed-off-by: Gleb Natapov <gleb@redhat.com>
---
 tools/acpi_extract.py |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/tools/acpi_extract.py b/tools/acpi_extract.py
index 5f613e4..14c1dfe 100755
--- a/tools/acpi_extract.py
+++ b/tools/acpi_extract.py
@@ -29,6 +29,7 @@
 # ACPI_EXTRACT_PROCESSOR_START - start of Processor() block
 # ACPI_EXTRACT_PROCESSOR_STRING - extract a NameString from Processor()
 # ACPI_EXTRACT_PROCESSOR_END - offset at last byte of Processor() + 1
+# ACPI_EXTRACT_PKG_START - start of Package block
 #
 # ACPI_EXTRACT_ALL_CODE - create an array storing the generated AML bytecode
 # 
@@ -181,6 +182,15 @@ def aml_processor_end(offset):
     pkglen = aml_pkglen(offset)
     return offset + pkglen
 
+def aml_package_start(offset):
+    offset = aml_name_string(offset) + 4
+    # 0x12 PkgLength NumElements PackageElementList
+    if (aml[offset] != 0x12):
+        die( "Name offset 0x%x: expected 0x12 actual 0x%x" %
+             (offset, aml[offset]));
+    offset += 1
+    return offset + aml_pkglen_bytes(offset) + 1
+
 lineno = 0
 for line in fileinput.input():
     # Strip trailing newline
@@ -263,6 +273,8 @@ for i in range(len(asl)):
         offset = aml_processor_string(offset)
     elif (directive == "ACPI_EXTRACT_PROCESSOR_END"):
         offset = aml_processor_end(offset)
+    elif (directive == "ACPI_EXTRACT_PKG_START"):
+        offset = aml_package_start(offset)
     else:
         die("Unsupported directive %s" % directive)
 
-- 
1.7.7.3

             reply	other threads:[~2012-05-14 12:35 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-14 12:35 Gleb Natapov [this message]
2012-05-14 12:35 ` [Qemu-devel] [PATCH 2/2] Get system state configuration from QEMU and patcth DSDT with it Gleb Natapov
2012-05-15  1:43   ` Kevin O'Connor
2012-05-15  8:06     ` Gleb Natapov
2012-05-15 23:18       ` Kevin O'Connor
2012-05-16 13:46         ` Gleb Natapov
2012-05-16 15:50           ` Paolo Bonzini
2012-05-16 16:40             ` Gleb Natapov
2012-05-16 16:47               ` Paolo Bonzini
2012-05-16 17:01                 ` Gleb Natapov
2012-05-17  0:24             ` Kevin O'Connor
2012-05-17 10:01               ` Paolo Bonzini
2012-05-17  0:20           ` Kevin O'Connor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1336998923-30144-1-git-send-email-gleb@redhat.com \
    --to=gleb@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=seabios@seabios.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).