[dahdi-commits] fjoe: freebsd/trunk r9108 - in /freebsd/trunk: freebsd/dahdi/ include/dahdi/c...

SVN commits to the DAHDI project dahdi-commits at lists.digium.com
Sun Aug 8 03:30:59 CDT 2010


Author: fjoe
Date: Sun Aug  8 03:30:55 2010
New Revision: 9108

URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=9108
Log:
- Add cpu_to_be32(), le16_to_cpu(), cpu_to_be16(), be16_to_cpu()
- Add __be16 and __be32
- Add __LITTLE_ENDIAN_BITFIELD and __BIG_ENDIAN_BITFIELD
- Add wait_for_completion()
- Add ETH_ALEN

Modified:
    freebsd/trunk/freebsd/dahdi/bsd-compat.c
    freebsd/trunk/include/dahdi/compat/bsd.h

Modified: freebsd/trunk/freebsd/dahdi/bsd-compat.c
URL: http://svnview.digium.com/svn/dahdi/freebsd/trunk/freebsd/dahdi/bsd-compat.c?view=diff&rev=9108&r1=9107&r2=9108
==============================================================================
--- freebsd/trunk/freebsd/dahdi/bsd-compat.c (original)
+++ freebsd/trunk/freebsd/dahdi/bsd-compat.c Sun Aug  8 03:30:55 2010
@@ -182,6 +182,14 @@
 	mtx_destroy(&c->lock);
 }
 
+void
+wait_for_completion(struct completion *c)
+{
+	mtx_lock(&c->lock);
+	cv_wait(&c->cv, &c->lock);
+	mtx_unlock(&c->lock);
+}
+
 int
 wait_for_completion_timeout(struct completion *c, unsigned long timeout)
 {

Modified: freebsd/trunk/include/dahdi/compat/bsd.h
URL: http://svnview.digium.com/svn/dahdi/freebsd/trunk/include/dahdi/compat/bsd.h?view=diff&rev=9108&r1=9107&r2=9108
==============================================================================
--- freebsd/trunk/include/dahdi/compat/bsd.h (original)
+++ freebsd/trunk/include/dahdi/compat/bsd.h Sun Aug  8 03:30:55 2010
@@ -22,11 +22,21 @@
  */
 #define cpu_to_le32(x)	htole32(x)
 #define le32_to_cpu(x)	le32toh(x)
+#define cpu_to_be32(x)	htobe32(x)
+
 #define cpu_to_le16(x)	htole16(x)
+#define le16_to_cpu(x)	le16toh(x)
+#define cpu_to_be16(x)	htobe16(x)
+#define be16_to_cpu(x)	be16toh(x)
+
+#define __be16  u_int16_t
+#define __be32  u_int32_t
 
 #if _BYTE_ORDER == _LITTLE_ENDIAN
+#define __LITTLE_ENDIAN_BITFIELD
 #define __constant_htons(x)	((uint16_t) (((uint16_t) (x)) << 8 | ((uint16_t) (x)) >> 8))
-#else
+#elif _BYTE_ORDER == _BIG_ENDIAN
+#define __BIG_ENDIAN_BITFIELD
 #define __constant_htons(x)	(x)
 #endif
 
@@ -205,6 +215,7 @@
 #define INIT_COMPLETION(c)
 void init_completion(struct completion *c);
 void destroy_completion(struct completion *c);
+void wait_for_completion(struct completion *c);
 int wait_for_completion_timeout(struct completion *c, unsigned long timeout);
 void complete(struct completion *c);
 
@@ -525,4 +536,6 @@
 	int (*mmap)(struct file *file, struct vm_area_struct *vma);
 };
 
+#define ETH_ALEN ETHER_ADDR_LEN
+
 #endif /* _DAHDI_COMPAT_BSD_H_ */




More information about the dahdi-commits mailing list