[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 40/49] acpi: add function to extract oem_id and oem_t
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] [PULL 40/49] acpi: add function to extract oem_id and oem_table_id from the user's SLIC |
Date: |
Thu, 4 Feb 2016 23:53:39 +0200 |
From: Laszlo Ersek <address@hidden>
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" <address@hidden> (supporter:ACPI/SMBIOS)
Cc: Igor Mammedov <address@hidden> (supporter:ACPI/SMBIOS)
Cc: Richard W.M. Jones <address@hidden>
Cc: Aleksei Kovura <address@hidden>
Cc: Michael Tokarev <address@hidden>
Cc: Steven Newbury <address@hidden>
RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=1248758
LP: https://bugs.launchpad.net/qemu/+bug/1533848
Signed-off-by: Laszlo Ersek <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
Reviewed-by: Steven Newbury <address@hidden>
---
include/hw/acpi/acpi.h | 7 +++++++
hw/acpi/core.c | 16 ++++++++++++++++
2 files changed, 23 insertions(+)
diff --git a/include/hw/acpi/acpi.h b/include/hw/acpi/acpi.h
index b20bd55..2de3021 100644
--- a/include/hw/acpi/acpi.h
+++ b/include/hw/acpi/acpi.h
@@ -196,4 +196,11 @@ unsigned acpi_table_len(void *current);
void acpi_table_add(const QemuOpts *opts, Error **errp);
void acpi_table_add_builtin(const QemuOpts *opts, Error **errp);
+typedef struct AcpiSlicOem AcpiSlicOem;
+struct AcpiSlicOem {
+ char *id;
+ char *table_id;
+};
+int acpi_get_slic_oem(AcpiSlicOem *oem);
+
#endif /* !QEMU_HW_ACPI_H */
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);
--
MST
- [Qemu-devel] [PULL 31/49] acpi: Don't save PcGuestInfo on AcpiBuildState, (continued)
- [Qemu-devel] [PULL 31/49] acpi: Don't save PcGuestInfo on AcpiBuildState, Michael S. Tsirkin, 2016/02/04
- [Qemu-devel] [PULL 32/49] pc: Remove compat fields from PcGuestInfo, Michael S. Tsirkin, 2016/02/04
- [Qemu-devel] [PULL 34/49] pc: Remove PcGuestInfo.isapc_ram_fw field, Michael S. Tsirkin, 2016/02/04
- [Qemu-devel] [PULL 35/49] pc: Move PcGuestInfo.fw_cfg to PCMachineState, Michael S. Tsirkin, 2016/02/04
- [Qemu-devel] [PULL 33/49] pc: Remove RAM size fields from PcGuestInfo, Michael S. Tsirkin, 2016/02/04
- [Qemu-devel] [PULL 37/49] pc: Eliminate PcGuestInfo struct, Michael S. Tsirkin, 2016/02/04
- [Qemu-devel] [PULL 36/49] pc: Move APIC and NUMA data from PcGuestInfo to PCMachineState, Michael S. Tsirkin, 2016/02/04
- [Qemu-devel] [PULL 38/49] acpi: take oem_id in build_header(), optionally, Michael S. Tsirkin, 2016/02/04
- [Qemu-devel] [PULL 39/49] acpi: expose oem_id and oem_table_id in build_rsdt(), Michael S. Tsirkin, 2016/02/04
- [Qemu-devel] [PULL 40/49] acpi: add function to extract oem_id and oem_table_id from the user's SLIC,
Michael S. Tsirkin <=
- [Qemu-devel] [PULL 41/49] pc: set the OEM fields in the RSDT and the FADT from the SLIC, Michael S. Tsirkin, 2016/02/04
- [Qemu-devel] [PULL 42/49] dimm: Correct type of MemoryHotplugState->base, Michael S. Tsirkin, 2016/02/04
- [Qemu-devel] [PULL 43/49] intel_iommu: large page support, Michael S. Tsirkin, 2016/02/04
- [Qemu-devel] [PULL 44/49] fix MSI injection on Xen, Michael S. Tsirkin, 2016/02/04
- [Qemu-devel] [PULL 45/49] net: set endianness on all backend devices, Michael S. Tsirkin, 2016/02/04
- [Qemu-devel] [PULL 46/49] i386/acpi: make floppy controller object dynamic, Michael S. Tsirkin, 2016/02/04
- [Qemu-devel] [PULL 48/49] i386: populate floppy drive information in DSDT, Michael S. Tsirkin, 2016/02/04