PERFORCE change 127541 for review

Kip Macy kmacy at FreeBSD.org
Sun Oct 14 20:32:40 PDT 2007


http://perforce.freebsd.org/chv.cgi?CH=127541

Change 127541 by kmacy at kmacy_home:ethng on 2007/10/15 03:32:10

	add endian conversion routines as well as some more type annotations

Affected files ...

.. //depot/projects/ethng/src/sys/sys/linux_compat.h#2 edit

Differences ...

==== //depot/projects/ethng/src/sys/sys/linux_compat.h#2 (text+ko) ====

@@ -1,6 +1,10 @@
 
-#ifndef _LINUX_COMPAT_H_
-#define _LINUX_COMPAT_H_
+#ifndef _SYS_LINUX_COMPAT_H_
+#define _SYS_LINUX_COMPAT_H_
+#include <machine/bus.h>
+#include <sys/bus_dma.h>
+
+
 typedef uint8_t u8;
 typedef uint16_t u16;
 typedef uint32_t u32;
@@ -41,4 +45,18 @@
 typedef uint32_t gfp_t;
 typedef struct mtx spinlock_t;
 
+#define __iomem
+#define __init
+#define __exit
+#define __bitwise
+
+#define be16_to_cpu be16toh
+#define be32_to_cpu be32toh
+#define be64_to_cpu be64toh
+
+#define cpu_to_be16 htobe16
+#define cpu_to_be32 htobe32
+#define cpu_to_be64 htobe64
+
+#define container_of(p, stype, field) ((stype *)(((uint8_t *)(p)) - offsetof(stype, field)))
 #endif


More information about the p4-projects mailing list