summaryrefslogtreecommitdiffstats
path: root/cpukit/libnetworking/rtems/rtems_malloc_mbuf.c
diff options
context:
space:
mode:
authorEric Norum <WENorum@lbl.gov>2006-05-25 17:36:31 +0000
committerEric Norum <WENorum@lbl.gov>2006-05-25 17:36:31 +0000
commitbe31de713feda36d1da3771df5decaa96088713a (patch)
treed0e0a94c3e92658edad482effc4b086674267069 /cpukit/libnetworking/rtems/rtems_malloc_mbuf.c
parent2006-05-16 Ralf Corsépius <ralf.corsepius@rtems.org> (diff)
downloadrtems-be31de713feda36d1da3771df5decaa96088713a.tar.bz2
Provide customisable mbuf allocation.
Patch from Steven Johnson <sjohnson@sakuraindustries.com>
Diffstat (limited to 'cpukit/libnetworking/rtems/rtems_malloc_mbuf.c')
-rw-r--r--cpukit/libnetworking/rtems/rtems_malloc_mbuf.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/cpukit/libnetworking/rtems/rtems_malloc_mbuf.c b/cpukit/libnetworking/rtems/rtems_malloc_mbuf.c
new file mode 100644
index 0000000000..d5654c8297
--- /dev/null
+++ b/cpukit/libnetworking/rtems/rtems_malloc_mbuf.c
@@ -0,0 +1,33 @@
+/*
+ * $Id$
+ */
+
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#define RTEMS_FAST_MUTEX
+
+#ifdef RTEMS_FAST_MUTEX
+#define __RTEMS_VIOLATE_KERNEL_VISIBILITY__ 1
+#endif
+
+#include <string.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <errno.h>
+
+#include <rtems.h>
+#include <rtems/rtems_bsdnet.h>
+
+/*
+ * Default allocator for mbuf data. Over-ride in user code to change
+ * the way mbuf's are allocated.
+ */
+
+void* rtems_bsdnet_malloc_mbuf(size_t size, int type)
+{
+ return malloc(size);
+}
+
+