RTEMS Event Receive Issue
Joel Sherrill <joel@OARcorp.com>
joel.sherrill at OARcorp.com
Tue Feb 11 22:58:50 UTC 2003
Thanks for the optimization and to those who reviewed
it and said "yeah verily it is good." :)
It is merged.
Mike Siers wrote:
>
> Hi All,
> Attached is a small patch to the network daemon task
> code. I just added code to check the return value of
> the rtems_bsdnet_event_receive function. Only when
> this function returns a SUCCESSFUL status, will the
> event flags be checked.
>
> This is more of a code cleanup issue than a bug. The
> patch will just ensure the ipintr() and arpintr()
> functions are only called when a event is signaled.
>
> Please review and let me know if you think this is
> the correct fix. The rtems_glue.c file is in the
> cpukit/libnetworking/rtems directory.
>
> Thanks
> Mike Siers
>
> --- rtems_glue.c Fri Nov 1 12:43:57 2002
> +++ rtems_glue.new Mon Feb 10 10:09:51 2003
> @@ -493,6 +493,7 @@
> static void
> networkDaemon (void *task_argument)
> {
> + rtems_status_code sc;
> rtems_event_set events;
> rtems_interval now;
> int ticksPassed;
> @@ -505,14 +506,18 @@
> timeout = c->c_time;
> else
> timeout = RTEMS_NO_TIMEOUT;
> - rtems_bsdnet_event_receive (NETISR_EVENTS,
> +
> + sc = rtems_bsdnet_event_receive (NETISR_EVENTS,
> RTEMS_EVENT_ANY | RTEMS_WAIT,
> timeout,
> &events);
> - if (events & NETISR_IP_EVENT)
> - ipintr ();
> - if (events & NETISR_ARP_EVENT)
> - arpintr ();
> + if ( sc == RTEMS_SUCCESSFUL ) {
> + if (events & NETISR_IP_EVENT)
> + ipintr ();
> + if (events & NETISR_ARP_EVENT)
> + arpintr ();
> + }
> +
> rtems_clock_get (RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, &now);
> ticksPassed = now - ticksWhenCalloutsLastChecked;
> if (ticksPassed != 0) {
--
Joel Sherrill, Ph.D. Director of Research & Development
joel at OARcorp.com On-Line Applications Research
Ask me about RTEMS: a free RTOS Huntsville AL 35805
Support Available (256) 722-9985
More information about the users
mailing list