WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH V2 2/3] xen, handle both old and new acpi ioport.

From: Anthony PERARD <anthony.perard@xxxxxxxxxx>

With the change of the firmware, we have to handle the new ioport and
keep the old one.

Signed-off-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>
---
 xen/arch/x86/hvm/pmtimer.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/hvm/pmtimer.c b/xen/arch/x86/hvm/pmtimer.c
index 48fe26a..ee0558f 100644
--- a/xen/arch/x86/hvm/pmtimer.c
+++ b/xen/arch/x86/hvm/pmtimer.c
@@ -24,6 +24,9 @@
 #include <asm/acpi.h> /* for hvm_acpi_power_button prototype */
 
 /* Slightly more readable port I/O addresses for the registers we intercept */
+#define PM1a_STS_ADDR_OLD (ACPI_PM1A_EVT_BLK_ADDRESS_OLD)
+#define PM1a_EN_ADDR_OLD  (ACPI_PM1A_EVT_BLK_ADDRESS_OLD + 2)
+#define TMR_VAL_ADDR_OLD  (ACPI_PM_TMR_BLK_ADDRESS_OLD)
 #define PM1a_STS_ADDR (ACPI_PM1A_EVT_BLK_ADDRESS)
 #define PM1a_EN_ADDR  (ACPI_PM1A_EVT_BLK_ADDRESS + 2)
 #define TMR_VAL_ADDR  (ACPI_PM_TMR_BLK_ADDRESS)
@@ -153,16 +156,20 @@ static int handle_evt_io(
             switch ( addr )
             {
                 /* PM1a_STS register bits are write-to-clear */
+            case PM1a_STS_ADDR_OLD:
             case PM1a_STS_ADDR:
                 s->pm.pm1a_sts &= ~byte;
                 break;
+            case PM1a_STS_ADDR_OLD + 1:
             case PM1a_STS_ADDR + 1:
                 s->pm.pm1a_sts &= ~(byte << 8);
                 break;
                 
+            case PM1a_EN_ADDR_OLD:
             case PM1a_EN_ADDR:
                 s->pm.pm1a_en = (s->pm.pm1a_en & 0xff00) | byte;
                 break;
+            case PM1a_EN_ADDR_OLD + 1:
             case PM1a_EN_ADDR + 1:
                 s->pm.pm1a_en = (s->pm.pm1a_en & 0xff) | (byte << 8);
                 break;
@@ -280,6 +287,9 @@ void pmtimer_init(struct vcpu *v)
 
     /* Intercept port I/O (need two handlers because PM1a_CNT is between
      * PM1a_EN and TMR_VAL and is handled by qemu) */
+    /* Add handler for both old and new port I/O of the firmware */
+    register_portio_handler(v->domain, TMR_VAL_ADDR_OLD, 4, handle_pmt_io);
+    register_portio_handler(v->domain, PM1a_STS_ADDR_OLD, 4, handle_evt_io);
     register_portio_handler(v->domain, TMR_VAL_ADDR, 4, handle_pmt_io);
     register_portio_handler(v->domain, PM1a_STS_ADDR, 4, handle_evt_io);
 
-- 
1.7.1


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel