[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] stdvga: handle 64bit io operations



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1211186453 -3600
# Node ID 3a5750f4a7387cd635328449a03bdc0eb4ae9ce6
# Parent  d0817f08599afe3f2d7ffa2e3fd88e6a65f5e85d
stdvga: handle 64bit io operations

Handle 64bit operations in stdvga instead of throwing away the
upper 32bits.

This fixes some noisy xen messages like "invalid io size: 8".

Signed-off-by: Christoph Egger <Christoph.Egger@xxxxxxx>
---
 xen/arch/x86/hvm/stdvga.c |   36 +++++++++++++++++++++++++++++-------
 1 files changed, 29 insertions(+), 7 deletions(-)

diff -r d0817f08599a -r 3a5750f4a738 xen/arch/x86/hvm/stdvga.c
--- a/xen/arch/x86/hvm/stdvga.c Fri May 16 09:37:19 2008 +0100
+++ b/xen/arch/x86/hvm/stdvga.c Mon May 19 09:40:53 2008 +0100
@@ -271,9 +271,9 @@ static uint8_t stdvga_mem_readb(uint64_t
     return ret;
 }
 
-static uint32_t stdvga_mem_read(uint32_t addr, uint32_t size)
-{
-    uint32_t data = 0;
+static uint64_t stdvga_mem_read(uint64_t addr, uint64_t size)
+{
+    uint64_t data = 0;
 
     switch ( size )
     {
@@ -293,8 +293,19 @@ static uint32_t stdvga_mem_read(uint32_t
         data |= stdvga_mem_readb(addr + 3) << 24;
         break;
 
+    case 8:
+        data =  (uint64_t)(stdvga_mem_readb(addr));
+        data |= (uint64_t)(stdvga_mem_readb(addr + 1)) << 8;
+        data |= (uint64_t)(stdvga_mem_readb(addr + 2)) << 16;
+        data |= (uint64_t)(stdvga_mem_readb(addr + 3)) << 24;
+        data |= (uint64_t)(stdvga_mem_readb(addr + 4)) << 32;
+        data |= (uint64_t)(stdvga_mem_readb(addr + 5)) << 40;
+        data |= (uint64_t)(stdvga_mem_readb(addr + 6)) << 48;
+        data |= (uint64_t)(stdvga_mem_readb(addr + 7)) << 56;
+        break;
+
     default:
-        gdprintk(XENLOG_WARNING, "invalid io size:%d\n", size);
+        gdprintk(XENLOG_WARNING, "invalid io size: %"PRId64"\n", size);
         break;
     }
 
@@ -409,7 +420,7 @@ static void stdvga_mem_writeb(uint64_t a
     }
 }
 
-static void stdvga_mem_write(uint32_t addr, uint32_t data, uint32_t size)
+static void stdvga_mem_write(uint64_t addr, uint64_t data, uint64_t size)
 {
     /* Intercept mmio write */
     switch ( size )
@@ -430,8 +441,19 @@ static void stdvga_mem_write(uint32_t ad
         stdvga_mem_writeb(addr+3, (data >> 24) & 0xff);
         break;
 
+    case 8:
+        stdvga_mem_writeb(addr+0, (data >>  0) & 0xff);
+        stdvga_mem_writeb(addr+1, (data >>  8) & 0xff);
+        stdvga_mem_writeb(addr+2, (data >> 16) & 0xff);
+        stdvga_mem_writeb(addr+3, (data >> 24) & 0xff);
+        stdvga_mem_writeb(addr+4, (data >> 32) & 0xff);
+        stdvga_mem_writeb(addr+5, (data >> 40) & 0xff);
+        stdvga_mem_writeb(addr+6, (data >> 48) & 0xff);
+        stdvga_mem_writeb(addr+7, (data >> 56) & 0xff);
+        break;
+
     default:
-        gdprintk(XENLOG_WARNING, "invalid io size:%d\n", size);
+        gdprintk(XENLOG_WARNING, "invalid io size: %"PRId64"\n", size);
         break;
     }
 }
@@ -447,7 +469,7 @@ static int mmio_move(struct hvm_hw_stdvg
     {
         if ( p->dir == IOREQ_READ )
         {
-            uint32_t addr = p->addr, data = p->data, tmp;
+            uint64_t addr = p->addr, data = p->data, tmp;
             for ( i = 0; i < p->count; i++ ) 
             {
                 tmp = stdvga_mem_read(addr, p->size);

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.