aboutsummaryrefslogtreecommitdiffstats
path: root/xen/arch/x86/hvm/pmtimer.c
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2010-01-20 20:34:19 +0000
committerKeir Fraser <keir.fraser@citrix.com>2010-01-20 20:34:19 +0000
commit9e2b86f4864fc8b9dc3b70bb60e7dc2cf4305f9a (patch)
treec6b62f0a555955f0b8592cfb8a7e84924db5bf5f /xen/arch/x86/hvm/pmtimer.c
parent650afa3995c32c50f3272dbe4514781abed8bdc0 (diff)
downloadxen-9e2b86f4864fc8b9dc3b70bb60e7dc2cf4305f9a.tar.gz
xen-9e2b86f4864fc8b9dc3b70bb60e7dc2cf4305f9a.tar.bz2
xen-9e2b86f4864fc8b9dc3b70bb60e7dc2cf4305f9a.zip
hvm: Add ACPI fixed sleep button
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Diffstat (limited to 'xen/arch/x86/hvm/pmtimer.c')
-rw-r--r--xen/arch/x86/hvm/pmtimer.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/xen/arch/x86/hvm/pmtimer.c b/xen/arch/x86/hvm/pmtimer.c
index 0a0b326efe..48fe26ac87 100644
--- a/xen/arch/x86/hvm/pmtimer.c
+++ b/xen/arch/x86/hvm/pmtimer.c
@@ -32,14 +32,16 @@
#define TMR_STS (1 << 0)
#define GBL_STS (1 << 5)
#define PWRBTN_STS (1 << 8)
+#define SLPBTN_STS (1 << 9)
/* The same in PM1a_EN */
#define TMR_EN (1 << 0)
#define GBL_EN (1 << 5)
#define PWRBTN_EN (1 << 8)
+#define SLPBTN_EN (1 << 9)
/* Mask of bits in PM1a_STS that can generate an SCI. */
-#define SCI_MASK (TMR_STS|PWRBTN_STS|GBL_STS)
+#define SCI_MASK (TMR_STS|PWRBTN_STS|SLPBTN_STS|GBL_STS)
/* SCI IRQ number (must match SCI_INT number in ACPI FADT in hvmloader) */
#define SCI_IRQ 9
@@ -68,6 +70,15 @@ void hvm_acpi_power_button(struct domain *d)
spin_unlock(&s->lock);
}
+void hvm_acpi_sleep_button(struct domain *d)
+{
+ PMTState *s = &d->arch.hvm_domain.pl_time.vpmt;
+ spin_lock(&s->lock);
+ s->pm.pm1a_sts |= SLPBTN_STS;
+ pmt_update_sci(s);
+ spin_unlock(&s->lock);
+}
+
/* Set the correct value in the timer, accounting for time elapsed
* since the last time we did that. */
static void pmt_update_time(PMTState *s)