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

Re: [Xen-devel] [PATCH 1/3] xen/arm: io: Extend write/read handler to pass private data



On Mon, 2015-09-28 at 21:31 +0100, Julien Grall wrote:
> Some handlers may require to use private data in order to get quickly
> information related to the region emulated.
> 
> Signed-off-by: Julien Grall <julien.grall@xxxxxxxxxx>
> 
> ---
> 
> Cc: shameerali.kolothum.thodi@xxxxxxxxxx
> 
>     This will be necessary in the follow-up in order to fix bug in the
>     GICR emulation.
> ---
>  xen/arch/arm/io.c          | 15 +++++++++++----
>  xen/arch/arm/vgic-v2.c     |  8 +++++---
>  xen/arch/arm/vgic-v3.c     | 17 +++++++++++------
>  xen/arch/arm/vuart.c       | 11 ++++++-----
>  xen/include/asm-arm/mmio.h |  7 ++++---
>  5 files changed, 37 insertions(+), 21 deletions(-)
> 
> diff --git a/xen/arch/arm/io.c b/xen/arch/arm/io.c
> index 8e55d49..85797f1 100644
> --- a/xen/arch/arm/io.c
> +++ b/xen/arch/arm/io.c
> @@ -37,18 +37,24 @@ int handle_mmio(mmio_info_t *info)
>          if ( (info->gpa >= mmio_handler->addr) &&
>               (info->gpa < (mmio_handler->addr + mmio_handler->size)) )
>          {
> -            return info->dabt.write ?
> -                mmio_handler->mmio_handler_ops->write_handler(v, info) :
> -                mmio_handler->mmio_handler_ops->read_handler(v, info);
> +            goto found;

Rather than goto use break instead.

>          }
>      }
>  
>      return 0;

And make this "if ( i == io_handlers->num_entries ) return 0;"

The continue to handle the op as you have done.

Other than that looks good.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

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