When writing code for your driver transmit and receive tasks you must
take care to follow the network scheduling conventions. All tasks
which are associated with networking share various
data structures and resources. To ensure the consistency
of these structures the tasks
execute only when they hold the network semaphore (rtems_bsdnet_semaphore
).
Your transmit and receive tasks must abide by this protocol which means you must
be careful to avoid `deadly embraces' with the other network tasks.
A number of routines are provided to make it easier for your code
to conform to the network task scheduling conventions.
void rtems_bsdnet_semaphore_release(void)
This function releases the network semaphore. Your task must call this function immediately before making any blocking RTEMS request.
void rtems_bsdnet_semaphore_obtain(void)
This function obtains the network semaphore. If your task has released the network semaphore to allow other network-related tasks to run while your task blocks you must call this function to reobtain the semaphore immediately after the return from the blocking RTEMS request.
rtems_bsdnet_event_receive(rtems_event_set, rtems_option, rtems_interval, rtems_event_set *)
Your task should call this function when it wishes to wait for an event.
This function releases the network semaphore,
calls rtems_event_receive
to wait for the specified event
or events and reobtains the semaphore.
The value returned is the value returned by the rtems_event_receive
.
Copyright © 1988-1998 OAR Corporation