[PATCH] Fix beagle bsp irq issue

Sichen Zhao 1473996754 at qq.com
Sat Jun 17 15:23:05 UTC 2017


Yes, i will!
------------------ Original ------------------
From:  "punit vara";<punitvara at gmail.com>;
Date:  Sat, Jun 17, 2017 11:44 PM
To:  "Sichen Zhao"<1473996754 at qq.com>; 
Cc:  "rtems-devel at rtems.org"<devel at rtems.org>; "Christian Mauderer"<christian.mauderer at embedded-brains.de>; 
Subject:  Re: [PATCH] Fix beagle bsp irq issue



Good job Sichen. Keep it up

On Sat, Jun 17, 2017 at 8:01 PM, Sichen Zhao <1473996754 at qq.com> wrote:
> Enable/disable vector routines now check for a valid vector.
> Without these guards, the enable/disable vector routines
> will not work with the interrupt server.
> ---
>  c/src/lib/libbsp/arm/beagle/irq.c | 22 ++++++++++++++--------
>  1 file changed, 14 insertions(+), 8 deletions(-)
>
> diff --git a/c/src/lib/libbsp/arm/beagle/irq.c b/c/src/lib/libbsp/arm/beagle/irq.c
> index d080a5e..35750ba 100644
> --- a/c/src/lib/libbsp/arm/beagle/irq.c
> +++ b/c/src/lib/libbsp/arm/beagle/irq.c
> @@ -98,11 +98,14 @@ static uint32_t omap_get_mir_reg(rtems_vector_number vector, uint32_t *const mas
>  rtems_status_code bsp_interrupt_vector_enable(rtems_vector_number vector)
>  {
>    uint32_t mask, cur;
> -  uint32_t mir_reg = omap_get_mir_reg(vector, &mask);
>
> -  cur = mmio_read(omap_intr.base + mir_reg);
> -  mmio_write(omap_intr.base + mir_reg, cur & ~mask);
> -  flush_data_cache();
> +  if (bsp_interrupt_is_valid_vector(vector)) {
> +    uint32_t mir_reg = omap_get_mir_reg(vector, &mask);
> +
> +    cur = mmio_read(omap_intr.base + mir_reg);
> +    mmio_write(omap_intr.base + mir_reg, cur & ~mask);
> +    flush_data_cache();
> +  }
>
>    return RTEMS_SUCCESSFUL;
>  }
> @@ -110,11 +113,14 @@ rtems_status_code bsp_interrupt_vector_enable(rtems_vector_number vector)
>  rtems_status_code bsp_interrupt_vector_disable(rtems_vector_number vector)
>  {
>    uint32_t mask, cur;
> -  uint32_t mir_reg = omap_get_mir_reg(vector, &mask);
>
> -  cur = mmio_read(omap_intr.base + mir_reg);
> -  mmio_write(omap_intr.base + mir_reg, cur | mask);
> -  flush_data_cache();
> +  if (bsp_interrupt_is_valid_vector(vector)) {
> +    uint32_t mir_reg = omap_get_mir_reg(vector, &mask);
> +
> +    cur = mmio_read(omap_intr.base + mir_reg);
> +    mmio_write(omap_intr.base + mir_reg, cur | mask);
> +    flush_data_cache();
> +  }
>
>    return RTEMS_SUCCESSFUL;
>  }
> --
> 2.7.4
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20170617/7642060a/attachment-0002.html>


More information about the devel mailing list