summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2016-06-28 07:50:59 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2016-06-28 13:10:01 +0200
commite79a0ca75fbc87c17e220f6a80a64bff3d10c9dd (patch)
tree8f72757de1d5568d8333acf09f8e392e646bc789
parent4ba4f8218a6e84484f32a43d8b0a95759d0741ba (diff)
downloadrtems-e79a0ca75fbc87c17e220f6a80a64bff3d10c9dd.tar.bz2
libnetworking: Move RTEMS-specific socket wake-up
Close #2748.
-rw-r--r--cpukit/libnetworking/kern/uipc_socket.c2
-rw-r--r--cpukit/libnetworking/rtems/rtems_bsdnet.h16
-rw-r--r--cpukit/libnetworking/sys/socket.h15
3 files changed, 18 insertions, 15 deletions
diff --git a/cpukit/libnetworking/kern/uipc_socket.c b/cpukit/libnetworking/kern/uipc_socket.c
index a5836531c6..1ea34a38af 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 5a95b3a2d2..80886ec736 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 85de630565..0e9df62ec4 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 */