diff options
author | Laszlo Ersek <lersek@redhat.com> | 2016-01-18 15:12:12 +0100 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2016-02-06 20:44:10 +0200 |
commit | 88594e4fd1e916b778968b2bdd8d7375ca2fe8d8 (patch) | |
tree | da3dd41042acf372398cd68e3e5469a0b06b19b5 /hw/acpi | |
parent | 5151355898699eb66fad0a710b8b6011690a0dfc (diff) | |
download | qemu-88594e4fd1e916b778968b2bdd8d7375ca2fe8d8.zip qemu-88594e4fd1e916b778968b2bdd8d7375ca2fe8d8.tar.gz qemu-88594e4fd1e916b778968b2bdd8d7375ca2fe8d8.tar.bz2 |
acpi: add function to extract oem_id and oem_table_id from the user's SLIC
The acpi_get_slic_oem() function stores pointers to these fields in the
(first) SLIC table that the user passes in with the -acpitable switch.
Cc: "Michael S. Tsirkin" <mst@redhat.com> (supporter:ACPI/SMBIOS)
Cc: Igor Mammedov <imammedo@redhat.com> (supporter:ACPI/SMBIOS)
Cc: Richard W.M. Jones <rjones@redhat.com>
Cc: Aleksei Kovura <alex3kov@zoho.com>
Cc: Michael Tokarev <mjt@tls.msk.ru>
Cc: Steven Newbury <steve@snewbury.org.uk>
RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=1248758
LP: https://bugs.launchpad.net/qemu/+bug/1533848
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Steven Newbury <steve@snewbury.org.uk>
Diffstat (limited to 'hw/acpi')
-rw-r--r-- | hw/acpi/core.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/hw/acpi/core.c b/hw/acpi/core.c index 397e6da..edf3f96 100644 --- a/hw/acpi/core.c +++ b/hw/acpi/core.c @@ -350,6 +350,22 @@ uint8_t *acpi_table_next(uint8_t *current) } } +int acpi_get_slic_oem(AcpiSlicOem *oem) +{ + uint8_t *u; + + for (u = acpi_table_first(); u; u = acpi_table_next(u)) { + struct acpi_table_header *hdr = (void *)(u - sizeof(hdr->_length)); + + if (memcmp(hdr->sig, "SLIC", 4) == 0) { + oem->id = hdr->oem_id; + oem->table_id = hdr->oem_table_id; + return 0; + } + } + return -1; +} + static void acpi_notify_wakeup(Notifier *notifier, void *data) { ACPIREGS *ar = container_of(notifier, ACPIREGS, wakeup); |