diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 1998-12-10 23:31:54 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 1998-12-10 23:31:54 +0000 |
commit | cca44008d81209e9fa992157637d9de0384e0536 (patch) | |
tree | e13728c80e91a8cff28f98ca7d7e6dea2359e05f /c/src/lib/libnetworking/rtems/rtems_glue.c | |
parent | RDBG headers files ignored if not configured (diff) | |
download | rtems-cca44008d81209e9fa992157637d9de0384e0536.tar.bz2 |
Merged Eric Norum's select patch that was based on 4.0 and resolved
all conflicts.
Diffstat (limited to '')
-rw-r--r-- | c/src/lib/libnetworking/rtems/rtems_glue.c | 36 |
1 files changed, 6 insertions, 30 deletions
diff --git a/c/src/lib/libnetworking/rtems/rtems_glue.c b/c/src/lib/libnetworking/rtems/rtems_glue.c index f2449831f5..28fb179c22 100644 --- a/c/src/lib/libnetworking/rtems/rtems_glue.c +++ b/c/src/lib/libnetworking/rtems/rtems_glue.c @@ -31,19 +31,6 @@ #include <net/route.h> /* - * Events used by networking routines. - * Everything will break if the application - * tries to use these events or if the `sleep' - * events are equal to any of the NETISR * events. - */ -#define SBWAIT_EVENT RTEMS_EVENT_24 -#define SOSLEEP_EVENT RTEMS_EVENT_25 -#define NETISR_IP_EVENT (1 << NETISR_IP) -#define NETISR_ARP_EVENT (1 << NETISR_ARP) -#define NETISR_EVENTS (NETISR_IP_EVENT|NETISR_ARP_EVENT) - - -/* * Memory allocation */ static int nmbuf = (64 * 1024) / MSIZE; @@ -246,7 +233,7 @@ rtems_bsdnet_initialize (void) /* * Register as an external I/O handler */ - rtems_register_libio_handler (RTEMS_FILE_DESCRIPTOR_TYPE_SOCKET, + rtems_register_libio_handler (LIBIO_FLAGS_HANDLER_SOCK, &rtems_bsdnet_io_handler); /* @@ -305,17 +292,10 @@ sbwait(sb) /* * Set this task as the target of the wakeup operation. */ - if (sb->sb_sel.si_pid) - rtems_panic ("Another task is already sleeping on that socket buffer"); rtems_task_ident (RTEMS_SELF, 0, &tid); sb->sb_sel.si_pid = tid; /* - * Mark the socket buffer as waiting. - */ - sb->sb_flags |= SB_WAIT; - - /* * Release the network semaphore. */ rtems_bsdnet_semaphore_release (); @@ -331,12 +311,6 @@ sbwait(sb) rtems_bsdnet_semaphore_obtain (); /* - * Relinquish ownership of the socket buffer - */ - sb->sb_flags &= ~SB_WAIT; - sb->sb_sel.si_pid = 0; - - /* * Return the status of the wait. */ switch (sc) { @@ -355,9 +329,11 @@ sowakeup(so, sb) register struct socket *so; register struct sockbuf *sb; { - if (sb->sb_flags & SB_WAIT) { - sb->sb_flags &= ~SB_WAIT; - rtems_event_send (sb->sb_sel.si_pid, SBWAIT_EVENT); + rtems_id tid; + + if ((tid = sb->sb_sel.si_pid) != 0) { + sb->sb_sel.si_pid = 0; + rtems_event_send (tid, SBWAIT_EVENT); } } |