qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH V5 3/8] hw/cirrus_vga.c: replace register_ioport


From: Jan Kiszka
Subject: Re: [Qemu-devel] [PATCH V5 3/8] hw/cirrus_vga.c: replace register_ioport*
Date: Sun, 26 Aug 2012 11:19:09 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666

On 2012-08-22 14:27, Julien Grall wrote:
> This patch replaces all register_ioport* with portio_*. It permits to
> use the new Memory stuff like listener.
> 
> Signed-off-by: Julien Grall <address@hidden>
> ---
>  hw/cirrus_vga.c |   42 ++++++++++++++++++++++++------------------
>  1 files changed, 24 insertions(+), 18 deletions(-)
> 
> diff --git a/hw/cirrus_vga.c b/hw/cirrus_vga.c
> index e8dcc6b..adfc855 100644
> --- a/hw/cirrus_vga.c
> +++ b/hw/cirrus_vga.c
> @@ -200,6 +200,7 @@ typedef void (*cirrus_fill_t)(struct CirrusVGAState *s,
>  typedef struct CirrusVGAState {
>      VGACommonState vga;
>  
> +    MemoryRegion cirrus_vga_io;
>      MemoryRegion cirrus_linear_io;
>      MemoryRegion cirrus_linear_bitblt_io;
>      MemoryRegion cirrus_mmio_io;
> @@ -2528,12 +2529,15 @@ static uint32_t cirrus_vga_ioport_read(void *opaque, 
> uint32_t addr)
>      return val;
>  }
>  
> -static void cirrus_vga_ioport_write(void *opaque, uint32_t addr, uint32_t 
> val)
> +static void cirrus_vga_ioport_write(void *opaque, target_phys_addr_t addr,
> +                                    uint64_t val, unsigned size)
>  {
>      CirrusVGAState *c = opaque;
>      VGACommonState *s = &c->vga;
>      int index;
>  
> +    addr += 0x3b0;
> +
>      /* check port range access depending on color/monochrome mode */
>      if (vga_ioport_invalid(s, addr)) {
>       return;
> @@ -2657,7 +2661,7 @@ static void cirrus_mmio_write(void *opaque, 
> target_phys_addr_t addr,
>      if (addr >= 0x100) {
>       cirrus_mmio_blt_write(s, addr - 0x100, val);
>      } else {
> -        cirrus_vga_ioport_write(s, addr + 0x3c0, val);
> +        cirrus_vga_ioport_write(s, addr + 0x10, val, size);
>      }
>  }
>  
> @@ -2783,8 +2787,18 @@ static const MemoryRegionOps cirrus_linear_io_ops = {
>      },
>  };
>  
> +static const MemoryRegionOps cirrus_vga_io_ops = {
> +    .write = cirrus_vga_ioport_write,

Missing .read. Crashes immediately when you test it.

Jan


Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]