From: "Michael S. Tsirkin" <mst@redhat.com>
To: qemu-devel@nongnu.org
Cc: ehabkost@redhat.com, imammedo@redhat.com, pbonzini@redhat.com
Subject: [Qemu-devel] [PATCH hack dontapply v2 5/7] acpi: init header without linking
Date: Tue, 10 Jul 2018 03:01:33 +0300 [thread overview]
Message-ID: <20180710000024.542612-6-mst@redhat.com> (raw)
In-Reply-To: <20180710000024.542612-1-mst@redhat.com>
build_header inits the table header and then adds it to list
for checksumming and linking into XSDT.
Dynamically loaded SSDTs are not linked into XSDT so
they just need the header initialized.
Split out the relevant part of build_header so it can
be invoked externally for this purpose.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
include/hw/acpi/aml-build.h | 3 +++
hw/acpi/aml-build.c | 18 +++++++++++++-----
2 files changed, 16 insertions(+), 5 deletions(-)
diff --git a/include/hw/acpi/aml-build.h b/include/hw/acpi/aml-build.h
index f764f71e25..0371a96c46 100644
--- a/include/hw/acpi/aml-build.h
+++ b/include/hw/acpi/aml-build.h
@@ -389,6 +389,9 @@ void
build_header(BIOSLinker *linker, GArray *table_data,
AcpiTableHeader *h, const char *sig, int len, uint8_t rev,
const char *oem_id, const char *oem_table_id);
+void
+acpi_init_header(AcpiTableHeader *h, const char *sig, int len, uint8_t rev,
+ const char *oem_id, const char *oem_table_id);
void *acpi_data_push(GArray *table_data, unsigned size);
unsigned acpi_data_len(GArray *table);
void acpi_add_table(GArray *table_offsets, GArray *table_data);
diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c
index ce691c1618..02f9710caa 100644
--- a/hw/acpi/aml-build.c
+++ b/hw/acpi/aml-build.c
@@ -1574,12 +1574,9 @@ Aml *aml_unload(Aml *ddbhandle)
}
void
-build_header(BIOSLinker *linker, GArray *table_data,
- AcpiTableHeader *h, const char *sig, int len, uint8_t rev,
- const char *oem_id, const char *oem_table_id)
+acpi_init_header(AcpiTableHeader *h, const char *sig, int len, uint8_t rev,
+ const char *oem_id, const char *oem_table_id)
{
- unsigned tbl_offset = (char *)h - table_data->data;
- unsigned checksum_offset = (char *)&h->checksum - table_data->data;
memcpy(&h->signature, sig, 4);
h->length = cpu_to_le32(len);
h->revision = rev;
@@ -1600,6 +1597,17 @@ build_header(BIOSLinker *linker, GArray *table_data,
h->oem_revision = cpu_to_le32(1);
memcpy(h->asl_compiler_id, ACPI_BUILD_APPNAME4, 4);
h->asl_compiler_revision = cpu_to_le32(1);
+}
+
+void
+build_header(BIOSLinker *linker, GArray *table_data,
+ AcpiTableHeader *h, const char *sig, int len, uint8_t rev,
+ const char *oem_id, const char *oem_table_id)
+{
+ unsigned tbl_offset = (char *)h - table_data->data;
+ unsigned checksum_offset = (char *)&h->checksum - table_data->data;
+
+ acpi_init_header(h, sig, len, rev, oem_id, oem_table_id);
/* Checksum to be filled in by Guest linker */
bios_linker_loader_add_checksum(linker, ACPI_BUILD_TABLE_FILE,
tbl_offset, len, checksum_offset);
--
MST
next prev parent reply other threads:[~2018-07-10 0:01 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-10 0:01 [Qemu-devel] [PATCH hack dontapply v2 0/7] Dynamic _CST generation Michael S. Tsirkin
2018-07-10 0:01 ` [Qemu-devel] [PATCH hack dontapply v2 1/7] acpi: aml: add aml_register() Michael S. Tsirkin
2018-07-10 0:01 ` [Qemu-devel] [PATCH hack dontapply v2 2/7] acpi: generalize aml_package / aml_varpackage Michael S. Tsirkin
2018-07-10 0:01 ` [Qemu-devel] [PATCH hack dontapply v2 4/7] acpi: export acpi_checksum Michael S. Tsirkin
2018-07-10 0:01 ` [Qemu-devel] [PATCH hack dontapply v2 3/7] acpi: aml_load/aml_unload Michael S. Tsirkin
2018-07-10 0:01 ` Michael S. Tsirkin [this message]
2018-07-10 0:01 ` [Qemu-devel] [PATCH hack dontapply v2 6/7] acpi: aml generation for _CST Michael S. Tsirkin
2018-07-25 12:42 ` Igor Mammedov
2018-07-25 12:54 ` Michael S. Tsirkin
2018-07-25 14:39 ` Igor Mammedov
2018-07-26 17:26 ` Michael S. Tsirkin
2018-07-26 17:43 ` Michael S. Tsirkin
2018-07-10 0:01 ` [Qemu-devel] [PATCH hack dontapply v2 7/7] pc: HACK: acpi: tie in _CST object to Processor Michael S. Tsirkin
2018-07-25 12:37 ` Igor Mammedov
2018-07-25 12:50 ` Michael S. Tsirkin
2018-07-25 14:49 ` Igor Mammedov
2018-07-26 15:49 ` Michael S. Tsirkin
2018-07-27 15:02 ` Igor Mammedov
2018-07-28 20:53 ` Michael S. Tsirkin
2018-07-10 0:10 ` [Qemu-devel] [PATCH hack dontapply v2 0/7] Dynamic _CST generation no-reply
2018-07-10 1:49 ` [Qemu-devel] [PATCH hack dontapply v2 8/7 untested] acpi: support cst change notifications Michael S. Tsirkin
2018-07-25 12:32 ` [Qemu-devel] [PATCH hack dontapply v2 0/7] Dynamic _CST generation Igor Mammedov
2018-07-25 12:44 ` Michael S. Tsirkin
2018-07-25 15:53 ` Igor Mammedov
2018-07-26 16:09 ` Michael S. Tsirkin
2018-08-02 9:18 ` Igor Mammedov
2018-08-02 10:00 ` Michael S. Tsirkin
2018-08-08 15:29 ` Igor Mammedov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180710000024.542612-6-mst@redhat.com \
--to=mst@redhat.com \
--cc=ehabkost@redhat.com \
--cc=imammedo@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).