summary refs log tree commit diff stats
path: root/hw/i386/acpi-build.c
diff options
context:
space:
mode:
authorIgor Mammedov <imammedo@redhat.com>2015-12-28 18:02:48 +0100
committerMichael S. Tsirkin <mst@redhat.com>2016-01-09 23:20:19 +0200
commit78e1ad05097a351fe1657713619c8457dfa714da (patch)
tree0d44ff62822caf4bf1b2da1d3e8397de5174a5eb /hw/i386/acpi-build.c
parent16682a9d865d00968a35e02bf2b666399e7ceea5 (diff)
downloadfocaccia-qemu-78e1ad05097a351fe1657713619c8457dfa714da.tar.gz
focaccia-qemu-78e1ad05097a351fe1657713619c8457dfa714da.zip
pc: acpi: q35: move IQST() into SSDT
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


Diffstat (limited to 'hw/i386/acpi-build.c')
-rw-r--r--hw/i386/acpi-build.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index 5bb544ba52..f454ac50e1 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -1555,12 +1555,24 @@ static Aml *build_iqcr_method(bool is_piix4)
     return method;
 }
 
+/* _STA method - get status */
+static Aml *build_irq_status_method(void)
+{
+    Aml *if_ctx;
+    Aml *method = aml_method("IQST", 1, AML_NOTSERIALIZED);
+
+    if_ctx = aml_if(aml_and(aml_int(0x80), aml_arg(0), NULL));
+    aml_append(if_ctx, aml_return(aml_int(0x09)));
+    aml_append(method, if_ctx);
+    aml_append(method, aml_return(aml_int(0x0B)));
+    return method;
+}
+
 static void build_piix4_pci0_int(Aml *table)
 {
     Aml *dev;
     Aml *crs;
     Aml *field;
-    Aml *if_ctx;
     Aml *method;
     uint32_t irqs;
     Aml *sb_scope = aml_scope("_SB");
@@ -1576,16 +1588,7 @@ static void build_piix4_pci0_int(Aml *table)
     aml_append(field, aml_named_field("PRQ3", 8));
     aml_append(sb_scope, field);
 
-    /* _STA method - get status */
-    method = aml_method("IQST", 1, AML_NOTSERIALIZED);
-    {
-        if_ctx = aml_if(aml_and(aml_int(0x80), aml_arg(0), NULL));
-        aml_append(if_ctx, aml_return(aml_int(0x09)));
-        aml_append(method, if_ctx);
-        aml_append(method, aml_return(aml_int(0x0B)));
-    }
-    aml_append(sb_scope, method);
-
+    aml_append(sb_scope, build_irq_status_method());
     aml_append(sb_scope, build_iqcr_method(true));
 
     aml_append(sb_scope, build_link_dev("LNKA", 0, aml_name("PRQ0")));
@@ -1632,6 +1635,7 @@ static void build_q35_pci0_int(Aml *table)
 {
     Aml *sb_scope = aml_scope("_SB");
 
+    aml_append(sb_scope, build_irq_status_method());
     aml_append(sb_scope, build_iqcr_method(false));
 
     aml_append(sb_scope, build_link_dev("LNKA", 0, aml_name("PRQA")));