[rtems commit] Updated Legacy code in arm edb7312
Vipul Nayyar
nayyar_vipul at yahoo.com
Fri Jul 12 10:36:58 UTC 2013
Hello,
I agree that g_cs variable has no important use and can be replaced. Do you want to use the pointer cs like this ? Or someway else ?
void cs8900_isr(cs8900_device *cs)
{
cs8900_interrupt(BSP_EINT3, cs);
}
void cs8900_attach_interrupt (void) {
....
}
Regards
Vipul Nayyar
________________________________
From: Sebastian Huber <sebastian.huber at embedded-brains.de>
To: rtems-devel at rtems.org
Cc: Joel Sherrill <joel at rtems.org>
Sent: Thursday, 11 July 2013 1:29 PM
Subject: Re: [rtems commit] Updated Legacy code in arm edb7312
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.
_______________________________________________
rtems-devel mailing list
rtems-devel at rtems.org
http://www.rtems.org/mailman/listinfo/rtems-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20130712/902752de/attachment-0001.html>
More information about the devel
mailing list