From: "Michael S. Tsirkin" <mst@redhat.com>
To: qemu-devel@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>,
Igor Mammedov <imammedo@redhat.com>,
dgilbert@redhat.com, Juan Quintela <quintela@redhat.com>
Subject: [Qemu-devel] [PULL 78/96] acpi: add aml_field() & aml_named_field() terms
Date: Wed, 18 Feb 2015 22:51:27 +0100 [thread overview]
Message-ID: <1424295164-4774-79-git-send-email-mst@redhat.com> (raw)
In-Reply-To: <1424295164-4774-1-git-send-email-mst@redhat.com>
From: Igor Mammedov <imammedo@redhat.com>
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>
---
include/hw/acpi/aml-build.h | 6 ++++++
hw/acpi/aml-build.c | 28 ++++++++++++++++++++++++++++
2 files changed, 34 insertions(+)
diff --git a/include/hw/acpi/aml-build.h b/include/hw/acpi/aml-build.h
index 57926e5..2bb5f39 100644
--- a/include/hw/acpi/aml-build.h
+++ b/include/hw/acpi/aml-build.h
@@ -29,6 +29,10 @@ typedef enum {
} AmlIODecode;
typedef enum {
+ aml_byte_acc = 1,
+} AmlFieldFlags;
+
+typedef enum {
aml_system_memory = 0x00,
aml_system_io = 0x01,
} AmlRegionSpace;
@@ -86,6 +90,7 @@ Aml *aml_io(AmlIODecode dec, uint16_t min_base, uint16_t max_base,
uint8_t aln, uint8_t len);
Aml *aml_operation_region(const char *name, AmlRegionSpace rs,
uint32_t offset, uint32_t len);
+Aml *aml_named_field(const char *name, unsigned length);
/* Block AML object primitives */
Aml *aml_scope(const char *name_format, ...) GCC_FMT_ATTR(1, 2);
@@ -95,6 +100,7 @@ Aml *aml_if(Aml *predicate);
Aml *aml_package(uint8_t num_elements);
Aml *aml_buffer(void);
Aml *aml_resource_template(void);
+Aml *aml_field(const char *name, AmlFieldFlags flags);
/* other helpers */
GArray *build_alloc_array(void);
diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c
index d72d5b4..b91141e 100644
--- a/hw/acpi/aml-build.c
+++ b/hw/acpi/aml-build.c
@@ -216,6 +216,16 @@ build_prepend_package_length(GArray *package, unsigned length, bool incl_self)
build_prepend_byte(package, byte);
}
+static void
+build_append_pkg_length(GArray *array, unsigned length, bool incl_self)
+{
+ GArray *tmp = build_alloc_array();
+
+ build_prepend_package_length(tmp, length, incl_self);
+ build_append_array(array, tmp);
+ build_free_array(tmp);
+}
+
void build_package(GArray *package, uint8_t op)
{
build_prepend_package_length(package, package->len, true);
@@ -568,3 +578,21 @@ Aml *aml_operation_region(const char *name, AmlRegionSpace rs,
build_append_int(var->buf, len);
return var;
}
+
+/* ACPI 1.0b: 16.2.5.2 Named Objects Encoding: NamedField */
+Aml *aml_named_field(const char *name, unsigned length)
+{
+ Aml *var = aml_alloc();
+ build_append_nameseg(var->buf, name);
+ build_append_pkg_length(var->buf, length, false);
+ return var;
+}
+
+/* ACPI 1.0b: 16.2.5.2 Named Objects Encoding: DefField */
+Aml *aml_field(const char *name, AmlFieldFlags flags)
+{
+ Aml *var = aml_bundle(0x81 /* FieldOp */, AML_EXT_PACKAGE);
+ build_append_namestring(var->buf, "%s", name);
+ build_append_byte(var->buf, flags);
+ return var;
+}
--
MST
next prev parent reply other threads:[~2015-02-18 21:51 UTC|newest]
Thread overview: 111+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-18 21:43 [Qemu-devel] [PULL 00/96] pci, pc, virtio fixes and cleanups Michael S. Tsirkin
2015-02-18 21:44 ` [Qemu-devel] [PULL 01/96] acpi-build: fix memory leak with bridge hp off Michael S. Tsirkin
2015-02-18 21:44 ` [Qemu-devel] [PULL 02/96] bios linker: validate pointer within table Michael S. Tsirkin
2015-02-18 21:44 ` [Qemu-devel] [PULL 03/96] acpi: move generic aml building helpers into dedictated file Michael S. Tsirkin
2015-02-18 21:44 ` [Qemu-devel] [PULL 04/96] acpi: add build_append_namestring() helper Michael S. Tsirkin
2015-02-18 21:44 ` [Qemu-devel] [PULL 05/96] acpi: drop min-bytes in build_package() Michael S. Tsirkin
2015-02-18 21:44 ` [Qemu-devel] [PULL 06/96] pci: Convert core to realize Michael S. Tsirkin
2015-02-18 21:44 ` [Qemu-devel] [PULL 07/96] pci: Permit incremental conversion of device models " Michael S. Tsirkin
2015-02-18 21:44 ` [Qemu-devel] [PULL 08/96] pci: Trivial device model conversions " Michael S. Tsirkin
2015-02-18 21:44 ` [Qemu-devel] [PULL 09/96] pcnet: pcnet_common_init() always returns 0, change to void Michael S. Tsirkin
2015-02-18 21:45 ` [Qemu-devel] [PULL 10/96] pcnet: Convert to realize Michael S. Tsirkin
2015-02-18 21:45 ` [Qemu-devel] [PULL 11/96] serial-pci: " Michael S. Tsirkin
2015-02-18 21:45 ` [Qemu-devel] [PULL 12/96] ide/ich: " Michael S. Tsirkin
2015-02-18 21:45 ` [Qemu-devel] [PULL 13/96] cirrus-vga: " Michael S. Tsirkin
2015-02-18 21:45 ` [Qemu-devel] [PULL 14/96] qxl: " Michael S. Tsirkin
2015-02-18 21:45 ` [Qemu-devel] [PULL 15/96] pci-assign: " Michael S. Tsirkin
2015-02-18 21:45 ` [Qemu-devel] [PULL 16/96] qdev: Don't exit when running into bad -global Michael S. Tsirkin
2015-02-18 21:45 ` [Qemu-devel] [PULL 17/96] acpi, pc: Add hotunplug request cb for pc machine Michael S. Tsirkin
2015-02-18 21:45 ` [Qemu-devel] [PULL 18/96] acpi, ich9: Add hotunplug request cb for ich9 Michael S. Tsirkin
2015-02-18 21:45 ` [Qemu-devel] [PULL 19/96] acpi, pc: Add unplug cb for pc machine Michael S. Tsirkin
2015-02-18 21:46 ` [Qemu-devel] [PULL 20/96] acpi, ich9: Add unplug cb for ich9 Michael S. Tsirkin
2015-02-18 21:46 ` [Qemu-devel] [PULL 21/96] acpi, piix4: Add unplug cb for piix4 Michael S. Tsirkin
2015-02-18 21:46 ` [Qemu-devel] [PULL 22/96] vl.c: Fix error messages when parsing maxmem parameters Michael S. Tsirkin
2015-02-18 21:46 ` [Qemu-devel] [PULL 23/96] pc: memory: Validate alignment of maxram_size to page size Michael S. Tsirkin
2015-02-18 21:46 ` [Qemu-devel] [PULL 24/96] acpi: update RSDP on guest access Michael S. Tsirkin
2015-02-18 21:46 ` [Qemu-devel] [PULL 25/96] pc: acpi-build: update linker " Michael S. Tsirkin
2015-02-18 21:46 ` [Qemu-devel] [PULL 26/96] pc: acpi-build: migrate RSDP table Michael S. Tsirkin
2015-02-18 21:46 ` [Qemu-devel] [PULL 27/96] exec: round up size on MR resize Michael S. Tsirkin
2015-02-18 21:46 ` [Qemu-devel] [PULL 28/96] acpi-build: fix ACPI RAM management Michael S. Tsirkin
2015-02-18 21:46 ` [Qemu-devel] [PULL 29/96] acpi: has_immutable_rsdp->!rsdp_in_ram Michael S. Tsirkin
2015-02-18 21:47 ` [Qemu-devel] [PULL 30/96] acpi-build: simplify rsdp management for legacy Michael S. Tsirkin
2015-02-18 21:47 ` [Qemu-devel] [PULL 31/96] scripts/update-linux-headers.sh: pull virtio hdrs Michael S. Tsirkin
2015-02-18 21:47 ` [Qemu-devel] [PULL 32/96] include: import virtio headers from linux 4.0 Michael S. Tsirkin
2015-02-18 21:47 ` [Qemu-devel] [PULL 33/96] virtio: use standard virtio_ring.h Michael S. Tsirkin
2015-02-18 21:47 ` [Qemu-devel] [PULL 34/96] virtio: use standard-headers Michael S. Tsirkin
2015-02-18 21:47 ` [Qemu-devel] [PULL 35/96] virtio-balloon: use standard headers Michael S. Tsirkin
2015-02-18 21:47 ` [Qemu-devel] [PULL 36/96] virtio-9p: " Michael S. Tsirkin
2015-02-18 21:47 ` [Qemu-devel] [PULL 37/96] virtio-blk: switch to standard-headers Michael S. Tsirkin
2015-02-18 21:47 ` [Qemu-devel] [PULL 38/96] virtio-net,tap: use standard-headers Michael S. Tsirkin
2015-02-18 21:48 ` [Qemu-devel] [PULL 39/96] virtio-rng: " Michael S. Tsirkin
2015-02-18 21:48 ` [Qemu-devel] [PULL 40/96] virtio-scsi: " Michael S. Tsirkin
2015-03-11 7:14 ` Fam Zheng
2015-03-11 8:31 ` Michael S. Tsirkin
2015-03-11 9:48 ` Paolo Bonzini
2015-03-11 12:25 ` Michael S. Tsirkin
2015-02-18 21:48 ` [Qemu-devel] [PULL 41/96] virtio-serial: switch to standard-headers Michael S. Tsirkin
2015-02-18 21:48 ` [Qemu-devel] [PULL 42/96] update-linux-headers: use standard-headers Michael S. Tsirkin
2015-02-18 21:48 ` [Qemu-devel] [PULL 43/96] linux-headers: " Michael S. Tsirkin
2015-02-18 21:48 ` [Qemu-devel] [PULL 00/96] pci, pc, virtio fixes and cleanups Michael S. Tsirkin
2015-02-18 22:03 ` Michael S. Tsirkin
2015-02-19 7:58 ` Michael S. Tsirkin
2015-02-19 8:23 ` Peter Maydell
2015-02-18 21:48 ` [Qemu-devel] [PULL 44/96] virtio-pci: use standard headers Michael S. Tsirkin
2015-02-18 21:48 ` [Qemu-devel] [PULL 45/96] scripts: add arch specific standard-headers Michael S. Tsirkin
2015-02-18 21:48 ` [Qemu-devel] [PULL 46/96] standard-headers: add s390 virtio headers Michael S. Tsirkin
2015-02-18 21:48 ` [Qemu-devel] [PULL 47/96] s390: use standard headers Michael S. Tsirkin
2015-02-18 21:48 ` [Qemu-devel] [PULL 48/96] virtio: cull virtio_bus_set_vdev_features Michael S. Tsirkin
2015-02-18 21:48 ` [Qemu-devel] [PULL 49/96] virtio: feature bit manipulation helpers Michael S. Tsirkin
2015-02-18 21:49 ` [Qemu-devel] [PULL 50/96] virtio: add feature checking helpers Michael S. Tsirkin
2015-02-18 21:49 ` [Qemu-devel] [PULL 51/96] acpi-build: skip hotplugged bridges Michael S. Tsirkin
2015-02-18 21:49 ` [Qemu-devel] [PULL 52/96] pc: acpi: use local var for accessing ACPI tables blob in acpi_build() Michael S. Tsirkin
2015-02-18 21:49 ` [Qemu-devel] [PULL 53/96] update-linux-headers.sh: s/__inline__/inline/ Michael S. Tsirkin
2015-02-18 21:49 ` [Qemu-devel] [PULL 54/96] virtio-serial-bus.c: drop virtio_ids.h Michael S. Tsirkin
2015-02-18 21:49 ` [Qemu-devel] [PULL 55/96] standard-headers: include stdint.h Michael S. Tsirkin
2015-02-18 21:49 ` [Qemu-devel] [PULL 56/96] virtio_ring.h: s/__inline__/inline/ Michael S. Tsirkin
2015-02-18 21:49 ` [Qemu-devel] [PULL 57/96] acpi: introduce AML composer aml_append() Michael S. Tsirkin
2015-02-18 21:49 ` [Qemu-devel] [PULL 58/96] acpi: add aml_scope() term Michael S. Tsirkin
2015-02-18 21:49 ` [Qemu-devel] [PULL 59/96] pc: acpi-build: use aml_scope() for \_SB scope Michael S. Tsirkin
2015-02-18 21:49 ` [Qemu-devel] [PULL 60/96] acpi: add aml_device() term Michael S. Tsirkin
2015-02-18 21:50 ` [Qemu-devel] [PULL 61/96] acpi: add aml_method() term Michael S. Tsirkin
2015-02-18 21:50 ` [Qemu-devel] [PULL 62/96] acpi: add aml_if() term Michael S. Tsirkin
2015-02-18 21:50 ` [Qemu-devel] [PULL 63/96] acpi: add aml_name() & aml_name_decl() term Michael S. Tsirkin
2015-02-18 21:50 ` [Qemu-devel] [PULL 64/96] acpi: add aml_int() term Michael S. Tsirkin
2015-02-18 21:50 ` [Qemu-devel] [PULL 65/96] acpi: add aml_return() term Michael S. Tsirkin
2015-02-18 21:50 ` [Qemu-devel] [PULL 66/96] acpi: add aml_arg() term Michael S. Tsirkin
2015-02-18 21:50 ` [Qemu-devel] [PULL 67/96] acpi: add aml_store() term Michael S. Tsirkin
2015-02-18 21:50 ` [Qemu-devel] [PULL 68/96] acpi: add aml_and() term Michael S. Tsirkin
2015-02-18 21:50 ` [Qemu-devel] [PULL 69/96] acpi: add aml_notify() term Michael S. Tsirkin
2015-02-18 21:50 ` [Qemu-devel] [PULL 70/96] acpi: add aml_call1(), aml_call2(), aml_call3(), aml_call4() helpers Michael S. Tsirkin
2015-02-18 21:50 ` [Qemu-devel] [PULL 71/96] acpi: add aml_package() term Michael S. Tsirkin
2015-02-18 21:50 ` [Qemu-devel] [PULL 72/96] pc: acpi-build: generate _S[345] packages dynamically Michael S. Tsirkin
2015-02-18 21:51 ` [Qemu-devel] [PULL 73/96] acpi: add aml_buffer() term Michael S. Tsirkin
2015-02-18 21:51 ` [Qemu-devel] [PULL 74/96] acpi: add aml_resource_template() helper Michael S. Tsirkin
2015-02-18 21:51 ` [Qemu-devel] [PULL 75/96] acpi: add aml_io() helper Michael S. Tsirkin
2015-02-18 21:51 ` [Qemu-devel] [PULL 76/96] acpi: include PkgLength size only when requested Michael S. Tsirkin
2015-02-18 21:51 ` [Qemu-devel] [PULL 77/96] acpi: add aml_operation_region() term Michael S. Tsirkin
2015-02-18 21:51 ` Michael S. Tsirkin [this message]
2015-02-18 21:51 ` [Qemu-devel] [PULL 79/96] acpi: add aml_local() term Michael S. Tsirkin
2015-02-18 21:51 ` [Qemu-devel] [PULL 80/96] acpi: add aml_string() term Michael S. Tsirkin
2015-02-18 21:51 ` [Qemu-devel] [PULL 81/96] pc: acpi-build: generate pvpanic device description dynamically Michael S. Tsirkin
2015-02-18 21:51 ` [Qemu-devel] [PULL 82/96] acpi: add aml_varpackage() term Michael S. Tsirkin
2015-02-18 21:51 ` [Qemu-devel] [PULL 83/96] acpi: add aml_equal() term Michael S. Tsirkin
2015-02-18 21:51 ` [Qemu-devel] [PULL 84/96] acpi: add aml_processor() term Michael S. Tsirkin
2015-02-18 21:52 ` [Qemu-devel] [PULL 85/96] acpi: add aml_eisaid() term Michael S. Tsirkin
2015-02-18 21:52 ` [Qemu-devel] [PULL 86/96] pc: acpi-build: drop template patching and CPU hotplug objects dynamically Michael S. Tsirkin
2015-02-18 21:52 ` [Qemu-devel] [PULL 87/96] pc: acpi-build: create CPU hotplug IO region dynamically Michael S. Tsirkin
2015-02-18 21:52 ` [Qemu-devel] [PULL 88/96] acpi: add aml_reserved_field() term Michael S. Tsirkin
2015-02-18 21:52 ` [Qemu-devel] [PULL 89/96] pc: acpi-build: drop template patching and memory hotplug objects dynamically Michael S. Tsirkin
2015-02-18 21:52 ` [Qemu-devel] [PULL 90/96] pc: acpi-build: create memory hotplug IO region dynamically Michael S. Tsirkin
2015-02-18 21:52 ` [Qemu-devel] [PULL 91/96] acpi: add aml_word_bus_number(), aml_word_io(), aml_dword_memory(), aml_qword_memory() terms Michael S. Tsirkin
2015-02-18 21:52 ` [Qemu-devel] [PULL 92/96] pc: pcihp: expose MMIO base and len as properties Michael S. Tsirkin
2015-02-18 21:52 ` [Qemu-devel] [PULL 93/96] pc: acpi-build: reserve PCIHP MMIO resources Michael S. Tsirkin
2015-02-18 21:52 ` [Qemu-devel] [PULL 94/96] acpi: update generated hex files Michael S. Tsirkin
2015-02-18 21:53 ` [Qemu-devel] [PULL 95/96] acpi: drop unused generated files Michael S. Tsirkin
2015-02-18 21:53 ` [Qemu-devel] [PULL 96/96] acpi-test: update expected files Michael S. Tsirkin
2015-02-24 16:47 ` [Qemu-devel] [PULL 00/96] pci, pc, virtio fixes and cleanups Michael S. Tsirkin
2015-02-26 11:17 ` Peter Maydell
2015-02-26 11:41 ` Michael S. Tsirkin
2015-02-26 11:59 ` Peter Maydell
2015-02-26 12:06 ` Michael S. Tsirkin
2015-02-26 11:53 ` Michael S. Tsirkin
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=1424295164-4774-79-git-send-email-mst@redhat.com \
--to=mst@redhat.com \
--cc=dgilbert@redhat.com \
--cc=imammedo@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
/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).