From: David Schleef Date: Tue, 7 Nov 2000 20:20:35 +0000 (+0000) Subject: move parts to include/linux X-Git-Tag: r0_7_51~44 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=9ec843dc988fdbcd9ec2c6e645954053ae241d2c;p=comedi.git move parts to include/linux --- diff --git a/comedi/kern_compat.h b/comedi/kern_compat.h index e802748d..c862f784 100644 --- a/comedi/kern_compat.h +++ b/comedi/kern_compat.h @@ -76,43 +76,6 @@ #endif -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,2,0) /* XXX */ -/* somewhere about 2.1.4 */ - -#include - -static inline int copy_to_user(void * to,const void *from,unsigned long n_bytes) -{ - int i; - - if((i=verify_area(VERIFY_WRITE,to,n_bytes)) != 0) - return i; - memcpy_tofs(to,from,n_bytes); - return 0; -} - -static inline int copy_from_user(void * to,const void *from,unsigned long n_bytes) -{ - int i; - if((i=verify_area(VERIFY_READ,from,n_bytes))!=0) - return i; - memcpy_fromfs(to,from,n_bytes); - return 0; -} - -static inline int clear_user(void * mem,unsigned long len) -{ - char *cmem=mem; - - if(verify_area(VERIFY_WRITE,mem,len)) - return len; - /* this is slow, but I'm lazy */ - while(len--){put_user(0,cmem);cmem++;} - return 0; -} - -#endif - #if LINUX_VERSION_CODE < KERNEL_VERSION(2,1,0) static inline void __process_timeout(unsigned long __data) { @@ -161,12 +124,6 @@ static inline long interruptible_sleep_on_timeout(struct wait_queue ** p, #endif #endif -#if LINUX_VERSION_CODE < 0x020115 -#define MODULE_AUTHOR(a) -#define MODULE_DESCRIPTION(a) -#define MODULE_PARM(a,b) -#endif - #if LINUX_VERSION_CODE < 0x20138 #define test_and_set_bit(val, addr) set_bit(val, addr) #define le32_to_cpu(val) (val) @@ -178,13 +135,6 @@ static inline long interruptible_sleep_on_timeout(struct wait_queue ** p, #define NETSTATS_VER2 #endif -#if LINUX_VERSION_CODE < 0x20155 -#include -#define PCI_SUPPORT_VER1 -#else -#define PCI_SUPPORT_VER2 -#endif - #if LINUX_VERSION_CODE < 0x20159 #define DEV_FREE_SKB(skb) dev_kfree_skb (skb, FREE_WRITE); #else /* Grrr, unneeded incompatible change. */ @@ -202,24 +152,6 @@ static inline long interruptible_sleep_on_timeout(struct wait_queue ** p, #endif -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,2,18) /* ? */ -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,1,0) - #ifdef MODULE - /* don't ask. It works. */ - #define THIS_MODULE ((struct module *)&mod_use_count_) - #else - #define THIS_MODULE NULL - #endif - #define __MOD_INC_USE_COUNT(x) ((*(long *)(x))++, (*(long *)(x)) |= MOD_VISITED) - #define __MOD_DEC_USE_COUNT(x) ((*(long *)(x))--, (*(long *)(x)) |= MOD_VISITED) -#else - #ifdef MODULE - #define THIS_MODULE &__this_module - #else - #define THIS_MODULE NULL - #endif -#endif -#endif #endif /* _KERN_COMPAT_H */