From: Tang Chen <tangchen@cn.fujitsu.com>
To: qemu-devel@nongnu.org, imammedo@redhat.com, mst@redhat.com,
pbonzini@redhat.com
Cc: hutao@cn.fujitsu.com, isimatu.yasuaki@jp.fujitsu.com,
zhugh.fnst@cn.fujitsu.com, tangchen@cn.fujitsu.com
Subject: [Qemu-devel] [RFC PATCH v1 1/4] Use macro to define ACPI notification event.
Date: Wed, 27 Aug 2014 16:09:45 +0800 [thread overview]
Message-ID: <1409126988-22287-2-git-send-email-tangchen@cn.fujitsu.com> (raw)
In-Reply-To: <1409126988-22287-1-git-send-email-tangchen@cn.fujitsu.com>
According to ACPI spec, device object notification values define insertion
request (Device Check) as 1, and ejection request as 3.
Use macro to define them.
Signed-off-by: Tang Chen <tangchen@cn.fujitsu.com>
---
hw/acpi/memory_hotplug.c | 7 +++++--
include/hw/acpi/acpi.h | 5 ++++-
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/hw/acpi/memory_hotplug.c b/hw/acpi/memory_hotplug.c
index f29715a..1b21191 100644
--- a/hw/acpi/memory_hotplug.c
+++ b/hw/acpi/memory_hotplug.c
@@ -155,10 +155,13 @@ static void acpi_memory_hotplug_write(void *opaque, hwaddr addr, uint64_t data,
break;
case 0x4: /* _OST event */
mdev = &mem_st->devs[mem_st->selector];
- if (data == 1) {
+ switch (data) {
+ case ACPI_NOTIFY_DEVICE_CHECK:
/* TODO: handle device insert OST event */
- } else if (data == 3) {
+ break;
+ case ACPI_NOTIFY_EJECT_REQUEST:
/* TODO: handle device remove OST event */
+ break;
}
mdev->ost_event = data;
trace_mhp_acpi_write_ost_ev(mem_st->selector, mdev->ost_event);
diff --git a/include/hw/acpi/acpi.h b/include/hw/acpi/acpi.h
index e105e45..e8499f6 100644
--- a/include/hw/acpi/acpi.h
+++ b/include/hw/acpi/acpi.h
@@ -92,9 +92,12 @@
#define ACPI_BITMASK_ARB_DISABLE 0x0001
/* OST_EVENT */
-#define ACPI_NOTIFY_EJECT_REQUEST 0x03
#define ACPI_OSPM_EJECT 0x103
+/* NOTIFY_EVENT */
+#define ACPI_NOTIFY_DEVICE_CHECK 0x1
+#define ACPI_NOTIFY_EJECT_REQUEST 0x3
+
/* OST_STATUS */
#define ACPI_SUCCESS 0x0
#define ACPI_FAILURE 0x1
--
1.8.4.2
next prev parent reply other threads:[~2014-08-27 8:08 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-27 8:09 [Qemu-devel] [RFC PATCH v1 0/4] Handle memory hotplug errors from guest OS Tang Chen
2014-08-27 8:09 ` Tang Chen [this message]
2014-08-27 8:09 ` [Qemu-devel] [RFC PATCH v1 2/4] Add event handling for memory device insertion Tang Chen
2014-08-27 8:09 ` [Qemu-devel] [RFC PATCH v1 3/4] Introduce wait condition to catch guest OS memory hotplug error Tang Chen
2014-08-27 8:09 ` [Qemu-devel] [RFC PATCH v1 4/4] Handle memory hotplug error from guest OS in QEmu Tang Chen
2014-08-27 8:14 ` [Qemu-devel] [RFC PATCH v1 0/4] Handle memory hotplug errors from guest OS tangchen
2014-09-03 9:05 ` tangchen
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=1409126988-22287-2-git-send-email-tangchen@cn.fujitsu.com \
--to=tangchen@cn.fujitsu.com \
--cc=hutao@cn.fujitsu.com \
--cc=imammedo@redhat.com \
--cc=isimatu.yasuaki@jp.fujitsu.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=zhugh.fnst@cn.fujitsu.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).