[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH RFC v2 2/8] ich9: add notifer for ec to generate sci
From: |
liguang |
Subject: |
[Qemu-devel] [PATCH RFC v2 2/8] ich9: add notifer for ec to generate sci |
Date: |
Thu, 6 Jun 2013 11:16:55 +0800 |
Signed-off-by: liguang <address@hidden>
---
hw/acpi/ich9.c | 15 +++++++++++++++
include/hw/acpi/ich9.h | 1 +
2 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/hw/acpi/ich9.c b/hw/acpi/ich9.c
index 4a17f32..f1583ef 100644
--- a/hw/acpi/ich9.c
+++ b/hw/acpi/ich9.c
@@ -33,6 +33,7 @@
#include "exec/address-spaces.h"
#include "hw/i386/ich9.h"
+#include "hw/acpi/ec.h"
//#define DEBUG
@@ -43,6 +44,8 @@ do { printf("%s "fmt, __func__, ## __VA_ARGS__); } while (0)
#define ICH9_DEBUG(fmt, ...) do { } while (0)
#endif
+#define GPE_EC_SCI_STATUS 8
+
static void pm_update_sci(ICH9LPCPMRegs *pm)
{
int sci_level, pm1a_sts;
@@ -202,6 +205,15 @@ static void pm_powerdown_req(Notifier *n, void *opaque)
acpi_pm1_evt_power_down(&pm->acpi_regs);
}
+static void pm_ec_sci_req(Notifier *n, void *opaque)
+{
+ ICH9LPCPMRegs *pm = container_of(n, ICH9LPCPMRegs, ec_sci_notifier);
+ ACPIGPE *gpe = &pm->acpi_regs.gpe;
+
+ *gpe->sts |= GPE_EC_SCI_STATUS;
+ pm_update_sci(pm);
+}
+
void ich9_pm_init(PCIDevice *lpc_pci, ICH9LPCPMRegs *pm,
qemu_irq sci_irq)
{
@@ -227,4 +239,7 @@ void ich9_pm_init(PCIDevice *lpc_pci, ICH9LPCPMRegs *pm,
qemu_register_reset(pm_reset, pm);
pm->powerdown_notifier.notify = pm_powerdown_req;
qemu_register_powerdown_notifier(&pm->powerdown_notifier);
+
+ pm->ec_sci_notifier.notify = pm_ec_sci_req;
+ qemu_register_ec_sci_notifier(&pm->ec_sci_notifier);
}
diff --git a/include/hw/acpi/ich9.h b/include/hw/acpi/ich9.h
index b1fe71f..f358deb 100644
--- a/include/hw/acpi/ich9.h
+++ b/include/hw/acpi/ich9.h
@@ -42,6 +42,7 @@ typedef struct ICH9LPCPMRegs {
uint32_t pm_io_base;
Notifier powerdown_notifier;
+ Notifier ec_sci_notifier;
} ICH9LPCPMRegs;
void ich9_pm_init(PCIDevice *lpc_pci, ICH9LPCPMRegs *pm,
--
1.7.2.5
- [Qemu-devel] [PATCH RFC v2 0/7] coordinate cpu hotplug/unplug bewteen QEMU and kernel by EC, liguang, 2013/06/05
- [Qemu-devel] [PATCH RFC v2 1/8] acpi: add ACPI Embedded Controller support, liguang, 2013/06/05
- [Qemu-devel] [PATCH RFC v2 2/8] ich9: add notifer for ec to generate sci,
liguang <=
- [Qemu-devel] [PATCH RFC v2 3/8] ec: add operations for _Qxx events, liguang, 2013/06/05
- [Qemu-devel] [PATCH RFC v2 5/8] piix4: add events for cpu hotplug, liguang, 2013/06/05
- [Qemu-devel] [PATCH RFC v2 4/8] piix4: add notifer for ec to generate sci, liguang, 2013/06/05
- [Qemu-devel] [PATCH RFC v2 8/8] cpu-hotplug: remove memory regison for cpu hotplug, liguang, 2013/06/05
- [Qemu-devel] [PATCH RFC v2 6/8] qmp: add 'cpu-del' command, liguang, 2013/06/05
- [Qemu-devel] [PATCH RFC v2 7/8] pc: add EC qdev init for piix & q35, liguang, 2013/06/05
- Re: [Qemu-devel] [PATCH RFC v2 0/7] coordinate cpu hotplug/unplug bewteen QEMU and kernel by EC, Michael S. Tsirkin, 2013/06/06