patch-2.2.18 linux/drivers/sound/emu10k1/emu_wrapper.h

Next file: linux/drivers/sound/emu10k1/hwaccess.c
Previous file: linux/drivers/sound/emu10k1/emu_wrapper.c
Back to the patch index
Back to the overall index

diff -u --new-file --recursive --exclude-from /usr/src/exclude v2.2.17/drivers/sound/emu10k1/emu_wrapper.h linux/drivers/sound/emu10k1/emu_wrapper.h
@@ -14,11 +14,6 @@
 #include <linux/tqueue.h>
 
 #define vma_get_pgoff(v)	vma_get_offset(v)
-#define wait_queue_head_t	struct wait_queue *
-#define DECLARE_WAITQUEUE(a, b)	struct wait_queue a = {b, NULL};
-#define init_waitqueue_head(a)	init_waitqueue(a)
-
-#define init_MUTEX(a)		*(a) = MUTEX
 
 #define UP_INODE_SEM(a)		up(a)
 #define DOWN_INODE_SEM(a)	down(a)
@@ -44,30 +39,8 @@
 #define __devexit
 #define __devexitdata
 
-/* Not sure what version aliases were introduced in, but certainly in 2.91.66.  */
-#ifdef MODULE
-  #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 91)
-    #define module_init(x)      int init_module(void) __attribute__((alias(#x)));
-    #define module_exit(x)      void cleanup_module(void) __attribute__((alias(#x)));
-  #else
-    #define module_init(x)      int init_module(void) { return x(); }
-    #define module_exit(x)      void cleanup_module(void) { x(); }
-  #endif
-#else
-  #define module_init(x)
-  #define module_exit(x)
-#endif
-
 #define MODULE_DEVICE_TABLE(foo,bar)
 
-static __inline__ void list_add_tail(struct list_head *new, struct list_head *head)
-{
-        __list_add(new, head->prev, head);
-}
-
-#define list_for_each(pos, head) \
-        for (pos = (head)->next; pos != (head); pos = pos->next)
-
 #define pci_dma_supported(dev, mask) 1
 
 #define PCI_ANY_ID (~0)
@@ -88,7 +61,6 @@
 (((dev)->base_address[(bar)] & PCI_BASE_ADDRESS_SPACE) ? \
  ((dev)->base_address[(bar)] & PCI_BASE_ADDRESS_IO_MASK) : \
  ((dev)->base_address[(bar)] & PCI_BASE_ADDRESS_MEM_MASK))
-#define pci_resource_len pci_compat_get_size
 
 struct pci_device_id {
         unsigned int vendor, device;
@@ -111,27 +83,11 @@
 const struct pci_device_id * pci_compat_match_device(const struct pci_device_id *ids, struct pci_dev *dev);
 int pci_compat_register_driver(struct pci_driver *drv);
 void pci_compat_unregister_driver(struct pci_driver *drv);
-unsigned long pci_compat_get_size (struct pci_dev *dev, int n_base);
 int pci_compat_enable_device(struct pci_dev *dev);
 void *compat_request_region (unsigned long start, unsigned long n, const char *name);
 void * pci_compat_get_driver_data (struct pci_dev *dev);
 void pci_compat_set_driver_data (struct pci_dev *dev, void *driver_data);
 
-typedef u32 dma_addr_t;
-
-extern __inline__ int __compat_get_order(unsigned long size)
-{
-        int order;
-
-        size = (size-1) >> (PAGE_SHIFT-1);
-        order = -1;
-        do {
-                size >>= 1;
-                order++;
-        } while (size);
-        return order;
-}
-
 extern __inline__ void *
 pci_alloc_consistent(struct pci_dev *hwdev,
                      size_t size, dma_addr_t *dma_handle) {
@@ -140,7 +96,7 @@
 
         if (hwdev == NULL)
                 gfp |= GFP_DMA;
-        ret = (void *)__get_free_pages(gfp, __compat_get_order(size));
+        ret = (void *)__get_free_pages(gfp, get_order(size));
 
         if (ret != NULL) {
                 memset(ret, 0, size);
@@ -153,7 +109,7 @@
 pci_free_consistent(struct pci_dev *hwdev, size_t size,
                     void *vaddr, dma_addr_t dma_handle)
 {
-        free_pages((unsigned long)vaddr, __compat_get_order(size));
+        free_pages((unsigned long)vaddr, get_order(size));
 }
 
 static inline int pci_module_init(struct pci_driver *drv)
@@ -169,10 +125,5 @@
         
         return -ENODEV;
 }
-
-#define BUG() do { \
-        printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \
-        __asm__ __volatile__(".byte 0x0f,0x0b"); \
-} while (0)
 
 #endif

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)