qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 2/5] Provide SSDT for enabled TPM device


From: Stefan Berger
Subject: Re: [Qemu-devel] [PATCH 2/5] Provide SSDT for enabled TPM device
Date: Fri, 18 Feb 2011 12:02:19 -0500
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101209 Fedora/3.1.7-0.35.b3pre.fc14 Lightning/1.0b3pre Thunderbird/3.1.7

On 02/18/2011 10:33 AM, Andreas Niederl wrote:
Signed-off-by: Andreas Niederl<address@hidden>
---
  Makefile.target |    3 +++
  hw/acpi.c       |   28 ++++++++++++++++++++++++++++
  hw/pc.h         |    1 +
  hw/tpm.h        |    2 ++
  hw/tpm_acpi.c   |   40 ++++++++++++++++++++++++++++++++++++++++
  hw/tpm_ssdt.dsl |   55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
  hw/tpm_ssdt.hex |   41 +++++++++++++++++++++++++++++++++++++++++
  hw/tpm_tis.c    |    1 +
  rules.mak       |    7 ++++++-
  vl.c            |   23 +++++++++++++++++++++++
  10 files changed, 200 insertions(+), 1 deletions(-)
  create mode 100644 hw/tpm_acpi.c
  create mode 100644 hw/tpm_ssdt.dsl
  create mode 100644 hw/tpm_ssdt.hex

diff --git a/Makefile.target b/Makefile.target
index 5a0fd40..33ffe19 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -211,6 +211,9 @@ obj-$(CONFIG_XEN) += xen_machine_pv.o xen_domainbuild.o
  # Inter-VM PCI shared memory
  obj-$(CONFIG_KVM) += ivshmem.o

+# TPM acpi support
+obj-$(CONFIG_TPM) += tpm_acpi.o
+
  # Hardware support
  obj-i386-y += vga.o
  obj-i386-y += mc146818rtc.o i8259.o pc.o
diff --git a/hw/acpi.c b/hw/acpi.c
index 8071e7b..93656c5 100644
--- a/hw/acpi.c
+++ b/hw/acpi.c
@@ -35,6 +35,34 @@ struct acpi_table_header
  char *acpi_tables;
  size_t acpi_tables_len;

+
+/*
+ * add a table directly (e.g. iasl C source output)
+ */
+int acpi_table_add_raw(const char *t, uint32_t length)
+{
+    char *p;
+
+    if (!acpi_tables) {
+        acpi_tables_len = sizeof(uint16_t);
+        acpi_tables = qemu_mallocz(acpi_tables_len);
+    }
+    acpi_tables = qemu_realloc(acpi_tables,
+                               acpi_tables_len + sizeof(uint16_t) + length);
+    p = acpi_tables + acpi_tables_len;
+    acpi_tables_len += sizeof(uint16_t) + length;
+
+    *(uint16_t*)p = cpu_to_le32(length);
+    p += sizeof(uint16_t);
+
+    memcpy(p, t, length);
+
+    /* increase number of tables */
+    (*(uint16_t*)acpi_tables) =
+        cpu_to_le32(le32_to_cpu(*(uint16_t*)acpi_tables) + 1);
+    return 0;
+}
+
Does it show up in Linux? I am trying to find the code that connects it to the RSDT, but don't see any.

    Stefan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]