From: anthony.perard@citrix.com Subject: [PATCH V2 2/3] xen, handle both old and new acpi ioport. Date: Mon, 25 Oct 2010 19:28:09 +0100 Message-ID: <1288031290-6876-3-git-send-email-anthony.perard@citrix.com> References: <1288031290-6876-1-git-send-email-anthony.perard@citrix.com> Return-path: In-Reply-To: <1288031290-6876-1-git-send-email-anthony.perard@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Xen Devel Cc: anthony.perard@citrix.com List-Id: xen-devel@lists.xenproject.org From: Anthony PERARD With the change of the firmware, we have to handle the new ioport and keep the old one. Signed-off-by: Anthony PERARD --- 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 /* 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