PERFORCE change 127712 for review
Kip Macy
kmacy at FreeBSD.org
Thu Oct 18 12:55:24 PDT 2007
http://perforce.freebsd.org/chv.cgi?CH=127712
Change 127712 by kmacy at kmacy_home:ethng on 2007/10/18 19:54:32
add BUG_ON, dst_mtu, and skb_put analog
Affected files ...
.. //depot/projects/ethng/src/sys/sys/linux_compat.h#3 edit
Differences ...
==== //depot/projects/ethng/src/sys/sys/linux_compat.h#3 (text+ko) ====
@@ -3,7 +3,7 @@
#define _SYS_LINUX_COMPAT_H_
#include <machine/bus.h>
#include <sys/bus_dma.h>
-
+#include <sys/mbuf.h>
typedef uint8_t u8;
typedef uint16_t u16;
@@ -59,4 +59,27 @@
#define cpu_to_be64 htobe64
#define container_of(p, stype, field) ((stype *)(((uint8_t *)(p)) - offsetof(stype, field)))
+
+/*
+ * mimic the interface to skb_put
+ */
+static __inline caddr_t
+mbuf_put(struct mbuf *m, unsigned int len)
+{
+ caddr_t tmp = m->m_data;
+
+ m->m_data += len;
+ m->m_len += len;
+
+ return (tmp);
+}
+
+#define dst_mtu(rt) ((rt)->rt_rmx.rmx_mtu)
+#define BUG_ON(e) \
+ do { \
+ if (e) { \
+ panic("BUG: %s %s:%d", #e, __FILE__, __LINE__); \
+ } \
+ } while (0)
+
#endif
More information about the p4-projects
mailing list