Skip to content

Commit

Permalink
hw/i386: Fix _STA return value for ACPI0017
Browse files Browse the repository at this point in the history
Found whilst testing a series for the linux kernel that actually
bothers to check if enabled is set. 0xB is the option used
for vast majority of DSDT entries in QEMU.
It is a little odd for a device that doesn't really exist and
is simply a hook to tell the OS there is a CEDT table but 0xB
seems a reasonable choice and avoids need to special case
this device in the OS.

Means:
* Device present.
* Device enabled and decoding it's resources.
* Not shown in UI
* Functioning properly
* No battery (on this device!)

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Message-Id: <20240126120132.24248-12-Jonathan.Cameron@huawei.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
(cherry picked from commit d9ae580)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
  • Loading branch information
jic23 authored and Michael Tokarev committed Feb 15, 2024
1 parent b8c6b78 commit 3b88637
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion hw/i386/acpi-build.c
Original file line number Diff line number Diff line change
Expand Up @@ -1311,7 +1311,7 @@ static void build_acpi0017(Aml *table)
aml_append(dev, aml_name_decl("_HID", aml_string("ACPI0017")));

method = aml_method("_STA", 0, AML_NOTSERIALIZED);
aml_append(method, aml_return(aml_int(0x01)));
aml_append(method, aml_return(aml_int(0x0B)));
aml_append(dev, method);

aml_append(scope, dev);
Expand Down

0 comments on commit 3b88637

Please sign in to comment.