qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] hw/pl190.c: Fix writing of default vector address
@ 2011-01-20 16:04 Peter Maydell
  2011-01-20 16:28 ` [Qemu-devel] " Aurelien Jarno
  0 siblings, 1 reply; 2+ messages in thread
From: Peter Maydell @ 2011-01-20 16:04 UTC (permalink / raw)
  To: qemu-devel; +Cc: Himanshu Chauhan, Aurelien Jarno, patches

The PL190 implementation keeps the default vector address
in vect_addr[16], but we weren't using this for writes to
the DEFVECTADDR register. As a result of this fix the
default_addr structure member is unused and we can delete it.

Reported-by: Himanshu Chauhan <hschauhan@nulltrace.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
(This patch addresses Aurelien's comments on Himanshu's
patch from November: http://patchwork.ozlabs.org/patch/69768/)

 hw/pl190.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/hw/pl190.c b/hw/pl190.c
index 17c279b..75f2ba1 100644
--- a/hw/pl190.c
+++ b/hw/pl190.c
@@ -21,7 +21,6 @@ typedef struct {
     uint32_t soft_level;
     uint32_t irq_enable;
     uint32_t fiq_select;
-    uint32_t default_addr;
     uint8_t vect_control[16];
     uint32_t vect_addr[PL190_NUM_PRIO];
     /* Mask containing interrupts with higher priority than this one.  */
@@ -186,7 +185,7 @@ static void pl190_write(void *opaque, target_phys_addr_t offset, uint32_t val)
             s->priority = s->prev_prio[s->priority];
         break;
     case 13: /* DEFVECTADDR */
-        s->default_addr = val;
+        s->vect_addr[16] = val;
         break;
     case 0xc0: /* ITCR */
         if (val) {
@@ -252,7 +251,6 @@ static const VMStateDescription vmstate_pl190 = {
         VMSTATE_UINT32(soft_level, pl190_state),
         VMSTATE_UINT32(irq_enable, pl190_state),
         VMSTATE_UINT32(fiq_select, pl190_state),
-        VMSTATE_UINT32(default_addr, pl190_state),
         VMSTATE_UINT8_ARRAY(vect_control, pl190_state, 16),
         VMSTATE_UINT32_ARRAY(vect_addr, pl190_state, PL190_NUM_PRIO),
         VMSTATE_UINT32_ARRAY(prio_mask, pl190_state, PL190_NUM_PRIO+1),
-- 
1.6.3.3

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [Qemu-devel] Re: [PATCH] hw/pl190.c: Fix writing of default vector address
  2011-01-20 16:04 [Qemu-devel] [PATCH] hw/pl190.c: Fix writing of default vector address Peter Maydell
@ 2011-01-20 16:28 ` Aurelien Jarno
  0 siblings, 0 replies; 2+ messages in thread
From: Aurelien Jarno @ 2011-01-20 16:28 UTC (permalink / raw)
  To: Peter Maydell; +Cc: Himanshu Chauhan, qemu-devel, patches

On Thu, Jan 20, 2011 at 04:04:52PM +0000, Peter Maydell wrote:
> The PL190 implementation keeps the default vector address
> in vect_addr[16], but we weren't using this for writes to
> the DEFVECTADDR register. As a result of this fix the
> default_addr structure member is unused and we can delete it.
> 
> Reported-by: Himanshu Chauhan <hschauhan@nulltrace.org>
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
> (This patch addresses Aurelien's comments on Himanshu's
> patch from November: http://patchwork.ozlabs.org/patch/69768/)
> 
>  hw/pl190.c |    4 +---
>  1 files changed, 1 insertions(+), 3 deletions(-)
> 
> diff --git a/hw/pl190.c b/hw/pl190.c
> index 17c279b..75f2ba1 100644
> --- a/hw/pl190.c
> +++ b/hw/pl190.c
> @@ -21,7 +21,6 @@ typedef struct {
>      uint32_t soft_level;
>      uint32_t irq_enable;
>      uint32_t fiq_select;
> -    uint32_t default_addr;
>      uint8_t vect_control[16];
>      uint32_t vect_addr[PL190_NUM_PRIO];
>      /* Mask containing interrupts with higher priority than this one.  */
> @@ -186,7 +185,7 @@ static void pl190_write(void *opaque, target_phys_addr_t offset, uint32_t val)
>              s->priority = s->prev_prio[s->priority];
>          break;
>      case 13: /* DEFVECTADDR */
> -        s->default_addr = val;
> +        s->vect_addr[16] = val;
>          break;
>      case 0xc0: /* ITCR */
>          if (val) {
> @@ -252,7 +251,6 @@ static const VMStateDescription vmstate_pl190 = {
>          VMSTATE_UINT32(soft_level, pl190_state),
>          VMSTATE_UINT32(irq_enable, pl190_state),
>          VMSTATE_UINT32(fiq_select, pl190_state),
> -        VMSTATE_UINT32(default_addr, pl190_state),
>          VMSTATE_UINT8_ARRAY(vect_control, pl190_state, 16),
>          VMSTATE_UINT32_ARRAY(vect_addr, pl190_state, PL190_NUM_PRIO),
>          VMSTATE_UINT32_ARRAY(prio_mask, pl190_state, PL190_NUM_PRIO+1),
> -- 
> 1.6.3.3
> 

Thanks, applied.

-- 
Aurelien Jarno	                        GPG: 1024D/F1BCDB73
aurelien@aurel32.net                 http://www.aurel32.net

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-01-20 16:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-20 16:04 [Qemu-devel] [PATCH] hw/pl190.c: Fix writing of default vector address Peter Maydell
2011-01-20 16:28 ` [Qemu-devel] " Aurelien Jarno

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).