[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH RFC 4/7] piix4: add notifer for ec to generate sci
From: |
liguang |
Subject: |
[Qemu-devel] [PATCH RFC 4/7] piix4: add notifer for ec to generate sci |
Date: |
Wed, 29 May 2013 09:47:39 +0800 |
Signed-off-by: liguang <address@hidden>
---
hw/acpi/piix4.c | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c
index c4af1cc..fc42333 100644
--- a/hw/acpi/piix4.c
+++ b/hw/acpi/piix4.c
@@ -29,6 +29,7 @@
#include "exec/ioport.h"
#include "hw/nvram/fw_cfg.h"
#include "exec/address-spaces.h"
+#include "hw/acpi/ec.h"
//#define DEBUG
@@ -53,6 +54,7 @@
#define PIIX4_PCI_HOTPLUG_STATUS 2
#define PIIX4_CPU_HOTPLUG_STATUS 4
+#define GPE_EC_SCI_STATUS 8
struct pci_status {
uint32_t up; /* deprecated, maintained for migration compatibility */
@@ -94,6 +96,7 @@ typedef struct PIIX4PMState {
CPUStatus gpe_cpu;
Notifier cpu_added_notifier;
+ Notifier ec_sci_notifier;
} PIIX4PMState;
static void piix4_acpi_system_hot_add_init(MemoryRegion *parent,
@@ -622,6 +625,15 @@ static const MemoryRegionOps cpu_hotplug_ops = {
},
};
+static void pm_ec_sci_req(Notifier *n, void *opaque)
+{
+ PIIX4PMState *s = container_of(n, PIIX4PMState, ec_sci_notifier);
+ ACPIGPE *gpe = &s->ar.gpe;
+
+ *gpe->sts |= GPE_EC_SCI_STATUS;
+ pm_update_sci(s);
+}
+
typedef enum {
PLUG,
UNPLUG,
@@ -686,6 +698,8 @@ static void piix4_acpi_system_hot_add_init(MemoryRegion
*parent,
memory_region_add_subregion(parent, PIIX4_PROC_BASE, &s->io_cpu);
s->cpu_added_notifier.notify = piix4_cpu_added_req;
qemu_register_cpu_added_notifier(&s->cpu_added_notifier);
+ s->ec_sci_notifier.notify = pm_ec_sci_req;
+ qemu_register_ec_sci_notifier(&s->ec_sci_notifier);
}
static void enable_device(PIIX4PMState *s, int slot)
--
1.7.2.5
- [Qemu-devel] [PATCH RFC 0/7] pass cpu online/offline event bewteen QEMU and linux kernel by ACPI Embedded Controller, liguang, 2013/05/28
- [Qemu-devel] [PATCH RFC 7/7] pc: add EC qdev init for piix & q35, liguang, 2013/05/28
- [Qemu-devel] [PATCH RFC 2/7] ich9: add notifer for ec to generate sci, liguang, 2013/05/28
- [Qemu-devel] [PATCH RFC 5/7] piix4: add events for cpu hotplug, liguang, 2013/05/28
- [Qemu-devel] [PATCH RFC 6/7] qmp: add 'cpu-del' command, liguang, 2013/05/28
- [Qemu-devel] [PATCH RFC 3/7] ec: add operations for _Qxx events, liguang, 2013/05/28
- [Qemu-devel] [PATCH RFC 1/7] acpi: add ACPI Embedded Controller support, liguang, 2013/05/28
- [Qemu-devel] [PATCH RFC 4/7] piix4: add notifer for ec to generate sci,
liguang <=
- Re: [Qemu-devel] [PATCH RFC 0/7] pass cpu online/offline event bewteen QEMU and linux kernel by ACPI Embedded Controller, Igor Mammedov, 2013/05/30