ia64/xen-unstable

changeset 17672:3a5750f4a738

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@amd.com>
author Keir Fraser <keir.fraser@citrix.com>
date Mon May 19 09:40:53 2008 +0100 (2008-05-19)
parents d0817f08599a
children f34f771f9ddd
files xen/arch/x86/hvm/stdvga.c
line diff
     1.1 --- a/xen/arch/x86/hvm/stdvga.c	Fri May 16 09:37:19 2008 +0100
     1.2 +++ b/xen/arch/x86/hvm/stdvga.c	Mon May 19 09:40:53 2008 +0100
     1.3 @@ -271,9 +271,9 @@ static uint8_t stdvga_mem_readb(uint64_t
     1.4      return ret;
     1.5  }
     1.6  
     1.7 -static uint32_t stdvga_mem_read(uint32_t addr, uint32_t size)
     1.8 +static uint64_t stdvga_mem_read(uint64_t addr, uint64_t size)
     1.9  {
    1.10 -    uint32_t data = 0;
    1.11 +    uint64_t data = 0;
    1.12  
    1.13      switch ( size )
    1.14      {
    1.15 @@ -293,8 +293,19 @@ static uint32_t stdvga_mem_read(uint32_t
    1.16          data |= stdvga_mem_readb(addr + 3) << 24;
    1.17          break;
    1.18  
    1.19 +    case 8:
    1.20 +        data =  (uint64_t)(stdvga_mem_readb(addr));
    1.21 +        data |= (uint64_t)(stdvga_mem_readb(addr + 1)) << 8;
    1.22 +        data |= (uint64_t)(stdvga_mem_readb(addr + 2)) << 16;
    1.23 +        data |= (uint64_t)(stdvga_mem_readb(addr + 3)) << 24;
    1.24 +        data |= (uint64_t)(stdvga_mem_readb(addr + 4)) << 32;
    1.25 +        data |= (uint64_t)(stdvga_mem_readb(addr + 5)) << 40;
    1.26 +        data |= (uint64_t)(stdvga_mem_readb(addr + 6)) << 48;
    1.27 +        data |= (uint64_t)(stdvga_mem_readb(addr + 7)) << 56;
    1.28 +        break;
    1.29 +
    1.30      default:
    1.31 -        gdprintk(XENLOG_WARNING, "invalid io size:%d\n", size);
    1.32 +        gdprintk(XENLOG_WARNING, "invalid io size: %"PRId64"\n", size);
    1.33          break;
    1.34      }
    1.35  
    1.36 @@ -409,7 +420,7 @@ static void stdvga_mem_writeb(uint64_t a
    1.37      }
    1.38  }
    1.39  
    1.40 -static void stdvga_mem_write(uint32_t addr, uint32_t data, uint32_t size)
    1.41 +static void stdvga_mem_write(uint64_t addr, uint64_t data, uint64_t size)
    1.42  {
    1.43      /* Intercept mmio write */
    1.44      switch ( size )
    1.45 @@ -430,8 +441,19 @@ static void stdvga_mem_write(uint32_t ad
    1.46          stdvga_mem_writeb(addr+3, (data >> 24) & 0xff);
    1.47          break;
    1.48  
    1.49 +    case 8:
    1.50 +        stdvga_mem_writeb(addr+0, (data >>  0) & 0xff);
    1.51 +        stdvga_mem_writeb(addr+1, (data >>  8) & 0xff);
    1.52 +        stdvga_mem_writeb(addr+2, (data >> 16) & 0xff);
    1.53 +        stdvga_mem_writeb(addr+3, (data >> 24) & 0xff);
    1.54 +        stdvga_mem_writeb(addr+4, (data >> 32) & 0xff);
    1.55 +        stdvga_mem_writeb(addr+5, (data >> 40) & 0xff);
    1.56 +        stdvga_mem_writeb(addr+6, (data >> 48) & 0xff);
    1.57 +        stdvga_mem_writeb(addr+7, (data >> 56) & 0xff);
    1.58 +        break;
    1.59 +
    1.60      default:
    1.61 -        gdprintk(XENLOG_WARNING, "invalid io size:%d\n", size);
    1.62 +        gdprintk(XENLOG_WARNING, "invalid io size: %"PRId64"\n", size);
    1.63          break;
    1.64      }
    1.65  }
    1.66 @@ -447,7 +469,7 @@ static int mmio_move(struct hvm_hw_stdvg
    1.67      {
    1.68          if ( p->dir == IOREQ_READ )
    1.69          {
    1.70 -            uint32_t addr = p->addr, data = p->data, tmp;
    1.71 +            uint64_t addr = p->addr, data = p->data, tmp;
    1.72              for ( i = 0; i < p->count; i++ ) 
    1.73              {
    1.74                  tmp = stdvga_mem_read(addr, p->size);