[rtems commit] Updated Legacy code in arm edb7312

Sebastian Huber sebastian.huber at embedded-brains.de
Thu Jul 11 07:59:26 UTC 2013


On 07/10/2013 07:18 PM, Joel Sherrill wrote:
> diff --git a/c/src/lib/libbsp/arm/edb7312/network/network.c b/c/src/lib/libbsp/arm/edb7312/network/network.c
> index 1db4d02..ce139ec 100644
> --- a/c/src/lib/libbsp/arm/edb7312/network/network.c
> +++ b/c/src/lib/libbsp/arm/edb7312/network/network.c
> @@ -2,18 +2,13 @@
>   #include <sys/mbuf.h>
>   #include <bsp/irq.h>
>   #include <libchip/cs8900.h>
> +#include <assert.h>
>
>   #define CS8900_BASE 0x20000300
>   unsigned int bsp_cs8900_io_base = 0;
>   unsigned int bsp_cs8900_memory_base = 0;
>   cs8900_device *g_cs;

This global variable is superfluous, since ...

>   void cs8900_isr(rtems_irq_hdl_param unused);
> -rtems_irq_connect_data cs8900_isr_data = {BSP_EINT3,
> -					  cs8900_isr,
> -					  NULL,
> -					  NULL,
> -					  NULL,
> -					  NULL};
>
>   char g_enetbuf[1520];
>
> @@ -68,13 +63,29 @@ unsigned short cs8900_mem_get_reg (cs8900_device *cs, unsigned long reg)
>
>   void cs8900_attach_interrupt (cs8900_device *cs)
>   {
> +    rtems_status_code status = RTEMS_SUCCESSFUL;
>       g_cs = cs;
> -    BSP_install_rtems_irq_handler(&cs8900_isr_data);
> +
> +    status = rtems_interrupt_handler_install(
> +        BSP_EINT3,
> +        "Network",
> +        RTEMS_INTERRUPT_UNIQUE,
> +        cs8900_isr,
> +        NULL

... we can pass "cs" as an argument here and use it in cs8900_isr.

> +    );
> +    assert(status == RTEMS_SUCCESSFUL);
>   }


-- 
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax     : +49 89 189 47 41-09
E-Mail  : sebastian.huber at embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.



More information about the devel mailing list