void do_become_nonbusy(comedi_device *dev,comedi_subdevice *s);
static int do_cancel(comedi_device *dev,comedi_subdevice *s);
-#if LINUX_VERSION_CODE >= 0x020100
static int comedi_fasync (int fd, struct file *file, int on);
-#endif
static void init_async_buf( comedi_async *async );
static int comedi_ioctl(struct inode * inode,struct file * file,
}
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,2,0) /* XXX */
-#define RDEV_OF_FILE(x) ((x)->f_inode->i_rdev)
-#else
#define RDEV_OF_FILE(x) ((x)->f_dentry->d_inode->i_rdev)
-#endif
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,0)
void comedi_unmap(struct vm_area_struct *area)
{
comedi_async *async;
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,17)
- async = (void *)area->vm_pte;
-#else
async = area->vm_private_data;
-#endif
async->mmap_count--;
}
static struct vm_operations_struct comedi_vm_ops={
close: comedi_unmap,
};
-/*
- comedi_mmap_v22
- */
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,17)
-#define page_address(x) x
-#endif
-static int comedi_mmap_v22(struct file * file, struct vm_area_struct *vma)
+static int comedi_mmap(struct file * file, struct vm_area_struct *vma)
{
unsigned int minor=MINOR(RDEV_OF_FILE(file));
comedi_device *dev=comedi_get_device_by_minor(minor);
return -EINVAL;
}
-#if LINUX_VERSION_CODE < 0x020300
- if(vma->vm_offset != 0){
- DPRINTK("comedi: mmap() offset must be 0.\n");
- return -EINVAL;
- }
-#else
if(vma->vm_pgoff != 0){
DPRINTK("comedi: mmap() offset must be 0.\n");
return -EINVAL;
}
-#endif
size = vma->vm_end - vma->vm_start;
if(size>async->prealloc_bufsz)
}
vma->vm_ops = &comedi_vm_ops;
-#if LINUX_VERSION_CODE < 0x020300
- (void *)vma->vm_pte = async;
-#else
vma->vm_private_data = async;
-#endif
async->mmap_count++;
return 0;
}
-#endif
-#if LINUX_VERSION_CODE >= 0x020100
-static unsigned int comedi_poll_v22(struct file *file, poll_table * wait)
+static unsigned int comedi_poll(struct file *file, poll_table * wait)
{
comedi_device *dev;
comedi_subdevice *s;
return mask;
}
-#endif
-static ssize_t comedi_write_v22(struct file *file,const char *buf,size_t nbytes,loff_t *offset)
+static ssize_t comedi_write(struct file *file,const char *buf,size_t nbytes,loff_t *offset)
{
comedi_device *dev;
comedi_subdevice *s;
}
-static ssize_t comedi_read_v22(struct file * file,char *buf,size_t nbytes,loff_t *offset)
+static ssize_t comedi_read(struct file * file,char *buf,size_t nbytes,loff_t *offset)
{
comedi_device *dev;
comedi_subdevice *s;
#define SEEK_CUR 1
#define SEEK_END 2
-static loff_t comedi_lseek_v22(struct file *file,loff_t offset,int origin)
+static loff_t comedi_lseek(struct file *file,loff_t offset,int origin)
{
comedi_device *dev;
loff_t new_offset;
return file->f_pos=new_offset;
}
-static int comedi_fop_open(struct inode *inode,struct file *file)
+static int comedi_open(struct inode *inode,struct file *file)
{
unsigned int minor=MINOR(inode->i_rdev);
comedi_device *dev;
return 0;
}
-static int comedi_close_v22(struct inode *inode,struct file *file)
+static int comedi_close(struct inode *inode,struct file *file)
{
comedi_device *dev=comedi_get_device_by_minor(MINOR(inode->i_rdev));
comedi_subdevice *s = NULL;
dev->use_count--;
-#if LINUX_VERSION_CODE >= 0x020100
if(file->f_flags & FASYNC){
comedi_fasync(-1,file,0);
}
-#endif
return 0;
}
-#if LINUX_VERSION_CODE >= 0x020100
static int comedi_fasync (int fd, struct file *file, int on)
{
comedi_device *dev=comedi_get_device_by_minor(MINOR(RDEV_OF_FILE(file)));
return fasync_helper(fd,file,on,&dev->async_queue);
}
-#endif
-
-/*
- kernel compatibility
-*/
-
-#if LINUX_VERSION_CODE < 0x020100
-
-static int comedi_write_v20(struct inode *inode,struct file *file,const char *buf,int nbytes)
-{
- return comedi_write_v22(file,buf,nbytes,NULL);
-}
-
-static int comedi_read_v20(struct inode *inode,struct file *file,char *buf,int nbytes)
-{
- return comedi_read_v22(file,buf,nbytes,NULL);
-}
-
-static int comedi_lseek_v20(struct inode * inode,struct file *file,off_t offset,int origin)
-{
- return comedi_lseek_v22(file,offset,origin);
-}
-
-static void comedi_close_v20(struct inode *inode,struct file *file)
-{
- comedi_close_v22(inode,file);
-}
-#define comedi_ioctl_v20 comedi_ioctl
-#define comedi_open_v20 comedi_fop_open
static struct file_operations comedi_fops={
- lseek : comedi_lseek_v20,
- ioctl : comedi_ioctl_v20,
- open : comedi_open_v20,
- release : comedi_close_v20,
- read : comedi_read_v20,
- write : comedi_write_v20,
-};
-
-#endif
-
-#if LINUX_VERSION_CODE >= 0x020200
-
-#define comedi_ioctl_v22 comedi_ioctl
-#define comedi_open_v22 comedi_fop_open
-
-static struct file_operations comedi_fops={
-#if LINUX_VERSION_CODE >= 0x020400
owner : THIS_MODULE,
-#endif
- llseek : comedi_lseek_v22,
- ioctl : comedi_ioctl_v22,
- open : comedi_open_v22,
- release : comedi_close_v22,
- read : comedi_read_v22,
- write : comedi_write_v22,
- mmap : comedi_mmap_v22,
- poll : comedi_poll_v22,
+ llseek : comedi_lseek,
+ ioctl : comedi_ioctl,
+ open : comedi_open,
+ release : comedi_close,
+ read : comedi_read,
+ write : comedi_write,
+ mmap : comedi_mmap,
+ poll : comedi_poll,
fasync : comedi_fasync,
};
-#endif
static struct class *comedi_class;
}else{
if(s==dev->read_subdev){
wake_up_interruptible(&dev->read_wait);
- KILL_FASYNC(dev->async_queue, SIGIO, POLL_IN);
+ kill_fasync(&dev->async_queue, SIGIO, POLL_IN);
}
if(s==dev->write_subdev){
wake_up_interruptible(&dev->write_wait);
- KILL_FASYNC(dev->async_queue, SIGIO, POLL_OUT);
+ kill_fasync(&dev->async_queue, SIGIO, POLL_OUT);
}
}
}else{
-#if LINUX_VERSION_CODE >= 0x020200
-
/* for drivers */
EXPORT_SYMBOL(comedi_driver_register);
EXPORT_SYMBOL(comedi_driver_unregister);
EXPORT_SYMBOL(comedi_buf_read_free);
EXPORT_SYMBOL(comedi_buf_memcpy_to);
EXPORT_SYMBOL(comedi_buf_memcpy_from);
-#endif
{
unsigned long va, kva;
- va = VMALLOC_VMADDR(adr);
+ va = adr;
kva = uvirt_to_kva(pgd_offset_k(va), va);
return kva;
//#include <linux/string.h>
-#if LINUX_VERSION_CODE < 0x020100
-int comedi_read_procmem(char *buf,char **start,off_t offset,int len,int unused);
-
-struct proc_dir_entry comedi_proc_entry =
-{
- 0,
- 6, "comedi",
- S_IFREG | S_IRUGO,
- 1, 0, 0,
- 0, NULL,
- &comedi_read_procmem,
-};
-
-#else
int comedi_read_procmem(char *buf,char **start,off_t offset,int len,int *eof,void *data);
-
-#endif
-
extern comedi_driver *comedi_drivers;
-#if LINUX_VERSION_CODE < 0x020100
-int comedi_read_procmem(char *buf,char **start,off_t offset,int len,int unused)
-#else
int comedi_read_procmem(char *buf,char **start,off_t offset,int len,int *eof,void *data)
-#endif
{
int i;
int devices_q=0;
void comedi_proc_init(void)
{
-#if LINUX_VERSION_CODE < 0x020100
- proc_register_dynamic(&proc_root,&comedi_proc_entry);
-#else
struct proc_dir_entry *comedi_proc;
comedi_proc = create_proc_entry("comedi",S_IFREG | S_IRUGO,0);
if(comedi_proc)
comedi_proc->read_proc = comedi_read_procmem;
-#endif
}
void comedi_proc_cleanup(void)
{
-#if LINUX_VERSION_CODE < 0x020100
- proc_unregister(&proc_root,comedi_proc_entry.low_ino);
-#else
remove_proc_entry("comedi",0);
-#endif
}
#define __MULTI_CONFIG_H_
#include <config.h>
-#ifdef CONFIG_COMEDI_RTAI
-//#include <modbuild/config.h>
-#endif
#include_next <linux/config.h>
#endif
+++ /dev/null
-/*
- * linux/fs.h compatibility header
- */
-
-#ifndef __COMPAT_LINUX_FS_H_
-#define __COMPAT_LINUX_FS_H_
-
-#include <linux/version.h>
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,2,0)
-/* no fasync */
-#define KILL_FASYNC(a,b,c)
-#else
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0)
-#define KILL_FASYNC(a,b,c) kill_fasync((a),(c))
-#else
-#define KILL_FASYNC(a,b,c) kill_fasync(&(a),(b),(c))
-#endif
-#endif
-
-#include_next <linux/fs.h>
-
-#endif
-
+++ /dev/null
-
-/*
- * linux/highmem.h compatibility header
- */
-
-#ifndef __COMPAT_LINUX_DEVFS_FS_KERNEL_H_
-#define __COMPAT_LINUX_DEVFS_FS_KERNEL_H_
-
-#include <linux/version.h>
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 0)
-#else
-#include_next <linux/highmem.h>
-#endif
-
-#endif
-
+++ /dev/null
-/*
- * linux/init.h compatibility header
- */
-
-#ifndef __COMPAT_LINUX_INIT_H_
-#define __COMPAT_LINUX_INIT_H_
-
-#include <linux/version.h>
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0)
-#define __devinitdata __initdata
-#define __exit
-#endif
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,2,0)
-#define __init
-#else
-#include_next <linux/init.h>
-#endif
-
-#endif
-
+++ /dev/null
-// linux/ioport.h compatibility header
-
-#ifndef _COMPAT_IOPORT_H
-#define _COMPAT_IOPORT_H
-
-#include <linux/version.h>
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,2,20)
-
-#define request_mem_region(start,n,name) ((void*) 1)
-#define release_mem_region(start,n)
-
-#endif
-
-#include_next <linux/ioport.h>
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,11)
-
-/* 'struct resource' not defined. Define a dummy version. */
-struct resource {
- int dummy;
-};
-
-/* Define a compatible version of request_region that returns a pointer
- * to a non-NULL value on success. */
-static inline struct resource *compat__request_region(unsigned long from,
- unsigned long extent, const char *name)
-{
- if (check_region(from, extent) < 0) {
- return (struct resource *)0;
- }
- request_region(from, extent, name);
- return ((struct resource *)0 + 1); /* Should be non-NULL */
-}
-
-/* Replace existing request_region macro/function. */
-#undef request_region
-#define request_region(f,e,n) compat__request_region(f,e,n)
-
-#endif
-
-#endif // _COMPAT_IOPORT_H
-
+++ /dev/null
-/*
- * linux/fisapnp.h compatibility header
- */
-
-#ifndef __COMPAT_LINUX_ISAPNP_H_
-#define __COMPAT_LINUX_ISAPNP_H_
-
-#include <linux/version.h>
-
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,0)
-#include_next <linux/isapnp.h>
-#else
-#include <linux/pci.h>
-#endif
-
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,0)
-/* FIXME drivers are broken with __ISAPNP__ in 2.6. */
-#undef __ISAPNP__
-#endif
-
-#endif
-
+++ /dev/null
-/*
- linux/kdev_t.h compatibility header
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-#ifndef __COMPAT_LINUX_KDEV_T_H_
-#define __COMPAT_LINUX_KDEV_T_H_
-
-#include <linux/version.h>
-#include_next <linux/kdev_t.h>
-
-#if 0
-
-#ifndef major
-#define major(x) MAJOR(x)
-#endif
-#ifndef minor
-#define minor(x) MINOR(x)
-#endif
-
-#endif
-
-#endif /* __COMPAT_LINUX_KDEV_T_H_ */
-
+++ /dev/null
-/*
- * linux/kmod.h compatibility header
- */
-
-#ifndef __COMPAT_LINUX_KMOD_H_
-#define __COMPAT_LINUX_KMOD_H_
-
-#include <linux/version.h>
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,2,0)
-
-#else
-#include_next <linux/kmod.h>
-#endif
-
-#endif
-
#include <linux/version.h>
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0)
-#define VM_OFFSET(a) ((a)->vm_offset)
-#define page_address(page) page
-#else
-#define VM_OFFSET(a) ((a)->vm_pgoff * PAGE_SIZE)
-#endif
-
#include_next <linux/mm.h>
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,10) \
#include <linux/version.h>
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,1,19)
-#define MODULE_AUTHOR(a)
-#define MODULE_DESCRIPTION(a)
-#define MODULE_PARM(a,b)
-#endif
-
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,10)
#define MODULE_LICENSE(x)
#endif
#define EXPORT_SYMBOL_GPL(x) EXPORT_SYMBOL(x)
#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)
- #define EXPORT_SYMBOL(x)
-#else
- #ifdef MODULE
- #define THIS_MODULE &__this_module
- #else
- #define THIS_MODULE NULL
- #endif
-#endif
-#endif
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,2,18) /* ? */
- typedef int (*__init_module_func_t)(void);
- typedef void (*__cleanup_module_func_t)(void);
- #define module_init(x) \
- int init_module(void) __attribute__((alias(#x))); \
- static inline __init_module_func_t __init_module_inline(void) \
- { return x; }
- #define module_exit(x) \
- void cleanup_module(void) __attribute__((alias(#x))); \
- static inline __cleanup_module_func_t __cleanup_module_inline(void) \
- { return x; }
-#endif
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0)
-#define MODULE_DEVICE_TABLE(a,b) struct pci_device_id *module_device_table_unused = (b)
-#endif
-
#include_next <linux/module.h>
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
#include <linux/version.h>
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,1,55)
-#include <linux/bios32.h>
-#define PCI_SUPPORT_VER1
-#else
#include_next <linux/pci.h>
-#define PCI_SUPPORT_VER2
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0) /* XXX */
-
-struct pci_driver {
- struct list_head node;
- char *name;
- const struct pci_device_id *id_table; /* must be non-NULL for probe to be called */
- int (*probe) (struct pci_dev *dev, const struct pci_device_id *id); /* New device inserted */
- void (*remove) (struct pci_dev *dev); /* Device removed (NULL if not a hot-plug capable driver) */
- int (*save_state) (struct pci_dev *dev, u32 state); /* Save Device Context */
- int (*suspend) (struct pci_dev *dev, u32 state); /* Device suspended */
- int (*resume) (struct pci_dev *dev); /* Device woken up */
- int (*enable_wake) (struct pci_dev *dev, u32 state, int enable); /* Enable wake event */
-};
-static inline int pci_module_init(struct pci_driver *drv) { return 0; }
-static inline void pci_unregister_driver(struct pci_driver *) { return; }
-
-static inline int pci_enable_device(struct pci_dev *dev){return 0;}
-#define pci_disable_device(x)
-
-#define PCI_ANY_ID (~0)
-
-struct pci_device_id {
- unsigned int vendor, device;
- unsigned int subvendor, subdevice;
- unsigned int class, class_mask;
- unsigned long driver_data;
-};
-
-// stuff for allocating pci dma buffers
-#include <asm/io.h>
-#include <linux/malloc.h>
-#include <linux/ioport.h>
-#define PCI_DMA_FROMDEVICE 0
-#define PCI_DMA_TODEVICE 0
-
-static inline void *pci_alloc_consistent(struct pci_dev *hwdev, size_t size,
- dma_addr_t *dma_handle)
-{
- void *ret;
- int gfp = GFP_KERNEL;
-
- if (hwdev == NULL)
- gfp |= GFP_DMA;
- ret = (void *) __get_free_pages(gfp, get_order(size));
-
- if (ret != NULL)
- {
- memset(ret, 0, size);
- *dma_handle = virt_to_bus(ret);
- }
- return ret;
-}
-
-static inline void pci_free_consistent(struct pci_dev *hwdev, size_t size,
- void *vaddr, dma_addr_t dma_handle)
-{
- free_pages((unsigned long)vaddr, get_order(size));
-}
-
-#define pci_map_single(cookie, address, size, dir) virt_to_bus(address)
-#define pci_unmap_single(cookie, address, size, dir)
-#define pci_dma_sync_single(cookie, address, size, dir)
-
-// for getting base addresses
-static inline unsigned long pci_resource_start(struct pci_dev *dev, unsigned int bar)
-{
- if(dev->base_address[bar] & PCI_BASE_ADDRESS_SPACE_IO)
- return dev->base_address[bar] & PCI_BASE_ADDRESS_IO_MASK;
- return dev->base_address[bar] & PCI_BASE_ADDRESS_MEM_MASK;
-}
-
-static inline unsigned long pci_resource_end(struct pci_dev *dev, unsigned int bar)
-{
- return pci_resource_start(dev, bar);
-}
-
-static inline int pci_request_regions(struct pci_dev *dev, char *name)
-{
- const int max_num_base_addr = 6;
- static const int fake_length = 1;
- int i;
- int retval = 0;
-
- for(i = 0; i < max_num_base_addr; i++)
- {
- if(dev->base_address[i])
- {
- if(dev->base_address[i] & PCI_BASE_ADDRESS_SPACE_IO)
- if(!request_region(pci_resource_start(dev, i),
- fake_length, name))
- {
- retval = -EBUSY;
- break;
- }
- }
- }
-
- if(retval)
- {
- while(--i >= 0)
- {
- if(dev->base_address[i] & PCI_BASE_ADDRESS_SPACE_IO)
- release_region(pci_resource_start(dev, i),
- fake_length);
- }
- }
-
- return retval;
-}
-
-static inline void pci_release_regions(struct pci_dev *dev)
-{
- static const int max_num_base_addr = 6;
- static const int fake_length = 1;
- int i;
-
- for(i = 0; i < max_num_base_addr; i++)
- {
- if(dev->base_address[i])
- {
- if(dev->base_address[i] & PCI_BASE_ADDRESS_SPACE_IO)
- release_region(pci_resource_start(dev, i),
- fake_length);
- }
- }
-}
-
-#endif
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,15)
-static inline struct pci_dev* pci_find_subsys( unsigned int vendor, unsigned int device,
- unsigned int ss_vendor, unsigned int ss_device,
- const struct pci_dev *from)
-{
- struct pci_dev *dev = (struct pci_dev *)from; /* ignore const */
-
- while((dev=pci_find_device(vendor,device,dev))!=NULL){
- if(ss_vendor!=PCI_ANY_ID){
- u16 temp;
- pci_read_config_word(dev,PCI_SUBSYSTEM_VENDOR_ID,&temp);
- if(ss_vendor!=temp){
- continue;
- }
- }
- if(ss_device!=PCI_ANY_ID){
- u16 temp;
- pci_read_config_word(dev,PCI_SUBSYSTEM_ID,&temp);
- if(ss_device!=temp){
- continue;
- }
- }
- break; /* match */
- }
- return dev;
-}
-#endif // <2.3.15
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,2,14)
-static inline void pci_set_master(struct pci_dev *dev)
-{ return; }
-#endif // 2.2.14
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,2,18)
-static inline unsigned long pci_resource_len (struct pci_dev *dev, int n_base)
-{ return 0; }
-#endif // 2.2.18
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
#define pci_get_device pci_find_device
#define pci_dev_put(x)
#endif
-#endif
-
#endif /* _COMPAT_PCI_H */
+++ /dev/null
-/*
- * linux/poll.h compatibility header
- */
-
-#ifndef __COMPAT_LINUX_POLL_H_
-#define __COMPAT_LINUX_POLL_H_
-
-#include <linux/version.h>
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,2,0)
-
-#else
-#include_next <linux/poll.h>
-#endif
-
-#endif
-
#include <linux/version.h>
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,2,0)
-#define signal_pending(x) (((x)->signal) & (~(x)->blocked))
-#endif
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,2,3)
-#define __wait_event(wq, condition) \
-do { \
- struct wait_queue __wait; \
- \
- __wait.task = current; \
- add_wait_queue(&wq, &__wait); \
- for (;;) { \
- current->state = TASK_UNINTERRUPTIBLE; \
- mb(); \
- if (condition) \
- break; \
- schedule(); \
- } \
- current->state = TASK_RUNNING; \
- remove_wait_queue(&wq, &__wait); \
-} while (0)
-
-#define wait_event(wq, condition) \
-do { \
- if (condition) \
- break; \
- __wait_event(wq, condition); \
-} while (0)
-
-#define __wait_event_interruptible(wq, condition, ret) \
-do { \
- struct wait_queue __wait; \
- \
- __wait.task = current; \
- add_wait_queue(&wq, &__wait); \
- for (;;) { \
- current->state = TASK_INTERRUPTIBLE; \
- mb(); \
- if (condition) \
- break; \
- if (!signal_pending(current)) { \
- schedule(); \
- continue; \
- } \
- ret = -ERESTARTSYS; \
- break; \
- } \
- current->state = TASK_RUNNING; \
- remove_wait_queue(&wq, &__wait); \
-} while (0)
-
-#define wait_event_interruptible(wq, condition) \
-({ \
- int __ret = 0; \
- if (!(condition)) \
- __wait_event_interruptible(wq, condition, __ret); \
- __ret; \
-})
-#endif
-
#include_next <linux/sched.h>
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,20)
+++ /dev/null
-/*
- * linux/slab.h compatibility header
- */
-
-#ifndef __COMPAT_LINUX_SLAB_H_
-#define __COMPAT_LINUX_SLAB_H_
-
-#include <linux/version.h>
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,2,0)
-#include <linux/malloc.h>
-#else
-#include_next <linux/slab.h>
-#endif
-
-#endif
-
+++ /dev/null
-/*
- * linux/spinlock.h compatibility header
- */
-
-#ifndef _COMPAT_SPINLOCK_H
-#define _COMPAT_SPINLOCK_H
-
-#include <linux/version.h>
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,1,0)
-/* no spinlocks */
-typedef int spinlock_t;
-
-#define spin_lock_init(lock) do { } while(0)
-#define spin_lock(lock) (void)(lock) /* Not "unused variable". */
-#define spin_trylock(lock) (1)
-#define spin_unlock_wait(lock) do { } while(0)
-#define spin_unlock(lock) do { } while(0)
-#define spin_lock_irq(lock) cli()
-#define spin_unlock_irq(lock) sti()
-
-#define spin_lock_irqsave(lock, flags) \
- do { save_flags(flags); cli(); } while (0)
-#define spin_unlock_irqrestore(lock, flags) \
- restore_flags(flags)
-
-#define SPIN_LOCK_UNLOCKED 0
-
-#else
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0)
-#include <asm/spinlock.h>
-#else
-#include_next <linux/spinlock.h>
-#endif
-#endif
-
-
-#endif /* _COMPAT_SPINLOCK_H */
-
-
-
-
+++ /dev/null
-/*
- * linux/timer.h compatibility header
- */
-
-#ifndef __COMPAT_LINUX_TIMER_H_
-#define __COMPAT_LINUX_TIMER_H_
-
-#include <linux/version.h>
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,2,0)
-
-#define mod_timer(a,b) do{del_timer((a));(a)->expires=(b);add_timer((a));}while(0)
-#endif
-
-#include_next <linux/timer.h>
-
-#endif
-
+++ /dev/null
-/*
- * linux/vmalloc.h compatibility header
- */
-
-#ifndef __COMPAT_LINUX_VMALLOC_H_
-#define __COMPAT_LINUX_VMALLOC_H_
-
-#include <linux/version.h>
-
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,2,0)
-
-#else
-#include_next <linux/vmalloc.h>
-#endif
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 2, 18)
-extern inline void * vmalloc_32(unsigned long size)
-{
- return vmalloc(size);
-}
-#endif // 2.2.18
-
-#ifndef VMALLOC_VMADDR
-#define VMALLOC_VMADDR(x) ((unsigned long)(x))
-#endif
-
-#endif
-
+++ /dev/null
-
-#ifndef __COMPAT_LINUX_WAIT_H
-#define __COMPAT_LINUX_WAIT_H
-
-#include <linux/version.h>
-
-#include_next <linux/wait.h>
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,2,18)
-typedef struct wait_queue *wait_queue_head_t;
-#define DECLARE_WAITQUEUE(x,y) struct wait_queue x={y,NULL}
-#define init_waitqueue_head(x)
-#endif
-
-#endif
-