PERFORCE change 127832 for review

Kip Macy kmacy at FreeBSD.org
Sat Oct 20 12:52:45 PDT 2007


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

Change 127832 by kmacy at kmacy_home:ethng on 2007/10/20 19:52:30

	more general compat macros and typedefs
		move atomics to own header

Affected files ...

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

Differences ...

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

@@ -15,13 +15,17 @@
 typedef uint32_t __u32;
 typedef uint64_t __u64;
 
+typedef int8_t __s8;
+typedef int16_t __s16;
+typedef int32_t __s32;
+typedef int64_t __s64;
+
 typedef uint8_t __be8;
 typedef uint16_t __be16;
 typedef uint32_t __be32;
 typedef uint64_t __be64;
 
 #define __attribute_const__
-typedef volatile int atomic_t;
 #define rw_semaphore rwlock
 #define __user
 typedef struct rwlock rwlock_t;
@@ -133,4 +137,15 @@
 static inline void idr_init(struct idr *idp){}
 
 
+#define copy_from_user(a,b,c) copyin(b,a,c)
+#define copy_to_user(a,b,c) copyout(b,a,c)
+#define __user
+#define put_user(a,b) copyout(&a,b,4)
+#define get_user(a,b) copyin(&a,b,4)
+
+
+#define ERR_PTR(err) ((void *)((long)(err)))
+#define IS_ERR(ptr)  ((unsigned long)(ptr) > (unsigned long)(-1000))
+#define PTR_ERR(ptr)    ((long)(ptr))
+
 #endif


More information about the p4-projects mailing list