[rtems commit] libnetworking: Move RTEMS-specific socket wake-up

Sebastian Huber sebh at rtems.org
Tue Jun 28 13:20:33 UTC 2016


Module:    rtems
Branch:    master
Commit:    e79a0ca75fbc87c17e220f6a80a64bff3d10c9dd
Changeset: http://git.rtems.org/rtems/commit/?id=e79a0ca75fbc87c17e220f6a80a64bff3d10c9dd

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Tue Jun 28 07:50:59 2016 +0200

libnetworking: Move RTEMS-specific socket wake-up

Close #2748.

---

 cpukit/libnetworking/kern/uipc_socket.c   |  2 ++
 cpukit/libnetworking/rtems/rtems_bsdnet.h | 16 ++++++++++++++++
 cpukit/libnetworking/sys/socket.h         | 15 ---------------
 3 files changed, 18 insertions(+), 15 deletions(-)

diff --git a/cpukit/libnetworking/kern/uipc_socket.c b/cpukit/libnetworking/kern/uipc_socket.c
index a583653..1ea34a3 100644
--- a/cpukit/libnetworking/kern/uipc_socket.c
+++ b/cpukit/libnetworking/kern/uipc_socket.c
@@ -51,6 +51,8 @@
  * Turn this feature into essentially dead code.
  */
 #define	SO_PRIVSTATE	0x1009		/* get/deny privileged state */
+
+#include <rtems/rtems_bsdnet.h>
 #endif /* __rtems__ */
 
 static int somaxconn = SOMAXCONN;
diff --git a/cpukit/libnetworking/rtems/rtems_bsdnet.h b/cpukit/libnetworking/rtems/rtems_bsdnet.h
index 5a95b3a..80886ec 100644
--- a/cpukit/libnetworking/rtems/rtems_bsdnet.h
+++ b/cpukit/libnetworking/rtems/rtems_bsdnet.h
@@ -316,6 +316,22 @@ void* rtems_bsdnet_malloc_mbuf(size_t size, int type);
 #define MBUF_MALLOC_MCLREFCNT   (1)
 #define MBUF_MALLOC_MBUF        (2)
 
+/*
+ * RTEMS-specific socket wake-up additions previously part of <sys/socket.h>.
+ *
+ * An alternative in the LibBSD network stack for this is KQUEUE(2).
+ */
+
+#define SO_SNDWAKEUP	0x1020		/* wakeup when ready to send */
+#define SO_RCVWAKEUP	0x1021		/* wakeup when ready to receive */
+
+struct socket;
+
+struct	sockwakeup {
+	void	(*sw_pfn)(struct socket *, void *);
+	void	*sw_arg;
+};
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/cpukit/libnetworking/sys/socket.h b/cpukit/libnetworking/sys/socket.h
index 85de630..0e9df62 100644
--- a/cpukit/libnetworking/sys/socket.h
+++ b/cpukit/libnetworking/sys/socket.h
@@ -102,12 +102,6 @@ typedef	__socklen_t	socklen_t;
 #define	SO_TYPE		0x1008		/* get socket type */
 
 /*
- * RTEMS addition: get and set wakeup functions.
- */
-#define SO_SNDWAKEUP	0x1020		/* wakeup when ready to send */
-#define SO_RCVWAKEUP	0x1021		/* wakeup when ready to receive */
-
-/*
  * Structure used for manipulating linger option.
  */
 struct	linger {
@@ -116,15 +110,6 @@ struct	linger {
 };
 
 /*
- * RTEMS addition: structure used to get and set wakeup function.
- */
-struct socket;
-struct	sockwakeup {
-	void	(*sw_pfn)(struct socket *, void *);
-	void	*sw_arg;
-};
-
-/*
  * Level number for (get/set)sockopt() to apply to socket itself.
  */
 #define	SOL_SOCKET	0xffff		/* options for socket level */




More information about the vc mailing list