Changeset 442


Ignore:
Timestamp:
Jun 6, 2009, 11:07:11 AM (16 years ago)
Author:
Paul Smedley
Message:

Reorganise code to make maintenance easier

Location:
GPL/trunk
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • GPL/trunk/alsa-kernel/include/sound/config.h

    r441 r442  
     1#ifndef __ALSA_CONFIG_H__
     2#define __ALSA_CONFIG_H__
     3
    14/*
    25 *  Configuration header file for compilation of the ALSA driver
    36 */
    47
    5 #ifndef __ALSA_CONFIG_H__
    6 #define __ALSA_CONFIG_H__
    7 
    8 #define inline __inline
    9 #define INLINE inline
    10 #define __attribute__
    118
    129#include <linux/version.h>
     
    4037#include <sys/cdefs.h>
    4138#include <stdio.h>
    42 
    43 typedef unsigned int fmode_t;
    44 
    45 /*
    46  *  ==========================================================================
    47  */
    48 
    49 #ifdef ALSA_BUILD
    50 #undef MODULE
    51 #define MODULE
    52 #endif
    53 
    5439#include <linux/config.h>
    55 #include <linux/version.h>
    56 
    57 #define LINUX_2_2
    58 
    59 #ifdef ALSA_BUILD
    60 #if defined(CONFIG_MODVERSIONS) && !defined(__GENKSYMS__) && !defined(__DEPEND__)
    61 #define MODVERSIONS
    62 #include <linux/modversions.h>
    63 #include "sndversions.h"
    64 #endif
    65 #endif /* ALSA_BUILD */
    66 
    67 #ifndef SNDRV_MAIN_OBJECT_FILE
    68 #define __NO_VERSION__
    69 #endif
    7040#include <linux/module.h>
    71 
    7241#include <linux/utsname.h>
    7342#include <linux/errno.h>
     
    7645#include <linux/malloc.h>
    7746#include <linux/delay.h>
    78 
    7947#include <linux/ioport.h>
    80 
    8148#include <asm/io.h>
    8249#include <asm/irq.h>
     
    8552#include <asm/system.h>
    8653#include <asm/string.h>
    87 
    8854#include <linux/pci.h>
    8955#include <linux/interrupt.h>
     
    9561#include <linux/reboot.h>
    9662#include <linux/init.h>
     63#include <linux/lockdep.h>
    9764#include "compat_22.h"
    98 
    99 #if defined(CONFIG_ISAPNP) || (defined(CONFIG_ISAPNP_MODULE) && defined(MODULE))
    100 #if (defined(CONFIG_ISAPNP_KERNEL) && defined(ALSA_BUILD)) || (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 3, 30) && !defined(ALSA_BUILD))
    101 #include <linux/isapnp.h>
    102 #define isapnp_dev pci_dev
    103 #define isapnp_card pci_bus
    104 #else
    105 #include "isapnp.h"
    106 #endif
    107 #undef __ISAPNP__
    108 #define __ISAPNP__
    109 #endif
    11065
    11166#include <sound/asound.h>
    11267#include <sound/asoundef.h>
    113 
    114 
    115 int snd_compat_schedule_work(struct work_struct *work);
    116 #define schedule_work(w) snd_compat_schedule_work(w)
    117 void snd_compat_flush_workqueue(struct workqueue_struct *wq);
    118 #define flush_workqueue(wq) snd_compat_flush_workqueue((wq));
    119 
    120 /* Name change */
    121 typedef struct timeval snd_timestamp_t;
    122 typedef union sndrv_pcm_sync_id snd_pcm_sync_id_t;
    123 
    124 #ifdef CONFIG_SND_DEBUG_MEMORY
    125 void *snd_wrapper_kmalloc(size_t, int);
    126 #undef kmalloc
    127 void snd_wrapper_kfree(const void *);
    128 #undef kfree
    129 void *snd_wrapper_vmalloc(size_t);
    130 #undef vmalloc
    131 void snd_wrapper_vfree(void *);
    132 #undef vfree
    133 #endif
    13468
    13569/*
     
    13771 */
    13872
    139 extern int this_module[64];
    140 #define THIS_MODULE (void *)&this_module[0]
    141 #define MODULE_GENERIC_TABLE(gtype,name)
    142 #define MODULE_DEVICE_TABLE(type,name)
     73#define ATTRIBUTE_UNUSED
     74#define CONFIG_HAS_DMA
     75#define CONFIG_HAVE_KZALLOC
     76#define CONFIG_HAVE_KCALLOC
     77#define CONFIG_HAVE_KSTRDUP
     78#define CONFIG_HAVE_MSLEEP
     79#define CONFIG_HAVE_PCI_DEV_PRESENT
     80#define CONFIG_PCI
     81#define CONFIG_PM
    14382#define CONFIG_PROC_FS
    144 #define CONFIG_PM
    145 #define PCI_NEW_SUSPEND
    146 #define CONFIG_PCI
    147 #define CONFIG_HAS_DMA
    148 #define CONFIG_SND_SEQUENCER
    149 #define CONFIG_SND_OSSEMUL
    150 #define CONFIG_SND_PCM_OSS
    151 #define SNDRV_LITTLE_ENDIAN
    152 #define EXPORT_SYMBOL(a)
    153 #define CONFIG_SOUND
    154 #define ATTRIBUTE_UNUSED
     83#define CONFIG_SND_DEBUG_DETECT
     84#define CONFIG_SND_DEBUG_VERBOSE
     85#define CONFIG_SND_HDA_CODEC_ANALOG
     86#define CONFIG_SND_HDA_CODEC_ATIHDMI
     87#define CONFIG_SND_HDA_CODEC_CONEXANT
     88#define CONFIG_SND_HDA_CODEC_CMEDIA
    15589#define CONFIG_SND_HDA_CODEC_REALTEK
    156 #define CONFIG_SND_HDA_CODEC_CMEDIA
    157 #define CONFIG_SND_HDA_CODEC_ANALOG
    15890#define CONFIG_SND_HDA_CODEC_SIGMATEL
    15991#define CONFIG_SND_HDA_CODEC_SI3054
    160 #define CONFIG_SND_HDA_CODEC_ATIHDMI
    161 #define CONFIG_SND_HDA_CODEC_CONEXANT
    16292#define CONFIG_SND_HDA_CODEC_VIA
    16393#define CONFIG_SND_HDA_GENERIC
    16494#define CONFIG_SND_HDA_HWDEP
    165 #define CONFIG_PM
    166 #define CONFIG_HAVE_PCI_DEV_PRESENT
    167 #define CONFIG_SND_DEBUG_DETECT
    168 #define CONFIG_SND_DEBUG_VERBOSE
     95#define CONFIG_SND_OSSEMUL
     96#define CONFIG_SND_PCM_OSS
     97#define CONFIG_SND_SEQUENCER
     98#define CONFIG_SOUND
    16999#define CONFIG_SYSFS_DEPRECATED
     100#define PCI_NEW_SUSPEND
     101#define SNDRV_LITTLE_ENDIAN
     102
     103
     104/* Still need to work out where the following really belong */
    170105#undef interrupt
    171 
    172106#define __builtin_return_address(a)     0
    173107#define __builtin_expect(x, expected_value) (x)
    174 
    175 
    176 #ifndef CONFIG_HAVE_KZALLOC
    177 void *snd_compat_kzalloc(size_t n, gfp_t gfp_flags);
    178 #define kzalloc(s,f) snd_compat_kzalloc(s,f)
    179 #endif
    180 
    181 #ifndef CONFIG_HAVE_KSTRDUP
    182 char *snd_compat_kstrdup(const char *s, unsigned int __nocast gfp_flags);
    183 #define kstrdup(s,f) snd_compat_kstrdup(s,f)
    184 #endif
    185 
    186 #ifndef CONFIG_HAVE_KCALLOC
    187 void *snd_compat_kcalloc(size_t n, size_t size, unsigned int __nocast gfp_flags);
    188 #define kcalloc(n,s,f) snd_compat_kcalloc(n,s,f)
    189 #endif
    190 
    191 struct workqueue_struct *snd_compat_create_workqueue(const char *name);
    192 #define create_workqueue(name) snd_compat_create_workqueue((name))
    193 void snd_compat_destroy_workqueue(struct workqueue_struct *wq);
    194 #define destroy_workqueue(wq) snd_compat_destroy_workqueue((wq))
    195 int snd_compat_queue_work(struct workqueue_struct *wq, struct work_struct *work);
    196 #define queue_work(wq, work) snd_compat_queue_work((wq), (work))
    197 
    198 #ifndef BUG_ON
    199108#define BUG_ON(x) /* nothing */
    200 #endif
    201 
    202 int snd_compat_devfs_mk_dir(const char *dir, ...);
    203 #define devfs_mk_dir snd_compat_devfs_mk_dir
    204 int snd_compat_devfs_mk_cdev(dev_t dev, umode_t mode, const char *fmt, ...);
    205 #define devfs_mk_cdev snd_compat_devfs_mk_cdev
    206 void snd_compat_devfs_remove(const char *fmt, ...);
    207 #define devfs_remove snd_compat_devfs_remove
    208 #define SINGLE_DEPTH_NESTING                    1
    209 
    210 #ifndef roundup
    211 #define roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y))
    212 #endif
    213 
    214 
    215 /* msleep */
    216 #ifndef CONFIG_HAVE_MSLEEP
    217 void snd_compat_msleep(unsigned int msecs);
    218 #define msleep snd_compat_msleep
    219 #endif
    220 
    221109#define assert(a)
    222 
    223 /* memdup_user() wrapper */
    224 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 30)
    225 #include <linux/err.h>
    226 #include <asm/uaccess.h>
    227 static inline void *memdup_user(void __user *src, size_t len)
    228 {
    229         void *p = kmalloc(len, GFP_KERNEL);
    230         if (!p)
    231                 return ERR_PTR(-ENOMEM);
    232         if (copy_from_user(p, src, len)) {
    233                 kfree(p);
    234                 return ERR_PTR(-EFAULT);
    235         }
    236         return p;
    237 }
    238 #endif
    239110
    240111#endif //__ALSA_CONFIG_H__
  • GPL/trunk/include/asm/bitops.h

    r32 r442  
    1 #ifndef _I386_BITOPS_H
    2 #define _I386_BITOPS_H
     1#ifndef _ASM_BITOPS_H
     2#define _ASM_BITOPS_H
    33
    44/*
     
    101101#define test_bit(nr, addr) (((1UL << (nr & 31)) & (((const unsigned int *) addr)[nr >> 5])) != 0)
    102102
    103 #endif /* _I386_BITOPS_H */
     103#endif /* _ASM_BITOPS_H */
  • GPL/trunk/include/asm/io.h

    r399 r442  
    5454#define memcpy_fromio(a,b,c)    memcpy((a),__io_virt(b),(c))
    5555#define memcpy_toio(a,b,c)      memcpy(__io_virt(a),(b),(c))
     56
     57unsigned int ioread8(void __iomem *addr);
     58unsigned int ioread16(void __iomem *addr);
     59unsigned int ioread32(void __iomem *addr);
     60void iowrite8(u8 val, void __iomem *addr);
     61void iowrite16(u16 val, void __iomem *addr);
     62void iowrite32(u32 val, void __iomem *addr);
     63void __iomem *ioport_map(unsigned long port, unsigned int nr);
     64void ioport_unmap(void __iomem *addr);
     65void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen);
     66void pci_iounmap(struct pci_dev *dev, void __iomem * addr);
    5667
    5768/*
  • GPL/trunk/include/asm/page.h

    r32 r442  
    1 /* $Id: page.h,v 1.1.1.1 2003/07/02 13:56:58 eleph Exp $ */
    2 
    31#ifndef _I386_PAGE_H
    42#define _I386_PAGE_H
     
    7169
    7270#endif /* __KERNEL__ */
     71#define page_to_pfn(page)       (page_to_phys(page) >> PAGE_SHIFT)
    7372
    7473#endif /* _I386_PAGE_H */
  • GPL/trunk/include/asm/processor.h

    r32 r442  
    344344#define init_stack      (init_task_union.stack)
    345345
     346#define cpu_relax()
     347
    346348#endif /* __ASM_I386_PROCESSOR_H */
  • GPL/trunk/include/asm/system.h

    r32 r442  
    3232#define cli()                   _asm cli;
    3333#define sti()                   _asm sti;
     34#endif
     35
     36#define smp_mb()        barrier()
     37#define smp_rmb()       barrier()
     38#define smp_wmb()       barrier()
    3439
    3540#endif
    36 #endif
  • GPL/trunk/include/linux/compiler-gcc3.h

    r305 r442  
    33/* These definitions are for GCC v3.x.  */
    44#include <linux/compiler-gcc.h>
     5
     6#define inline __inline
     7#define INLINE inline
     8#define __attribute__
    59
    610#if __GNUC_MINOR__ >= 1  && __GNUC_MINOR__ < 4
  • GPL/trunk/include/linux/kernel.h

    r441 r442  
    101101#define dump_stack()
    102102#define upper_32_bits(n) ((u32)(((n) >> 16) >> 16))
     103#define roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y))
    103104
    104105#endif
  • GPL/trunk/include/linux/lockdep.h

    r439 r442  
    11#ifndef __LINUX_LOCKDEP_H
    22#define __LINUX_LOCKDEP_H
     3#define SINGLE_DEPTH_NESTING                    1
    34/*
    45 * lockdep macros
     
    1213#define spin_lock_irqsave_nested(lock, f, x)    spin_lock_irqsave(lock, f)
    1314
     15
    1416#endif /* __LINUX_LOCKDEP_H */
  • GPL/trunk/include/linux/module.h

    r441 r442  
    7070#define MODULE_ALIAS(x)
    7171
     72extern int this_module[64];
     73#define THIS_MODULE (void *)&this_module[0]
     74#define MODULE_GENERIC_TABLE(gtype,name)
     75#define MODULE_DEVICE_TABLE(type,name)
     76#define EXPORT_SYMBOL(a)
     77
    7278#endif /* _LINUX_MODULE_H */
  • GPL/trunk/include/linux/slab.h

    r32 r442  
    44 * (markhe@nextd.demon.co.uk)
    55 */
     6
     7#include <linux/types.h>
    68
    79#if     !defined(_LINUX_SLAB_H)
     
    6668#endif
    6769
     70void *kzalloc(size_t n, gfp_t gfp_flags);
     71void *kcalloc(size_t n, size_t size, unsigned int __nocast gfp_flags);
     72
    6873#endif  /* _LINUX_SLAB_H */
  • GPL/trunk/include/linux/string.h

    r441 r442  
    1111#endif
    1212
     13char *kstrdup(const char *s, unsigned int gfp_flags);
     14
    1315#endif
    1416
  • GPL/trunk/include/linux/time.h

    r441 r442  
    126126#define do_posix_clock_monotonic_gettime getnstimeofday
    127127
     128void msleep(unsigned int msecs);
     129
    128130#endif
  • GPL/trunk/include/linux/types.h

    r441 r442  
    136136#include <string.h>
    137137typedef __u32 __le32;
     138typedef unsigned int fmode_t;
     139
    138140#endif /* _LINUX_TYPES_H */
  • GPL/trunk/include/linux/workqueue.h

    r441 r442  
    11#ifndef __LINUX_WORKQUEUE_H
    22#define __LINUX_WORKQUEUE_H
     3
     4#include <sound/compat_22.h>
     5/* we know this is used below exactly once for at most one waiter */
     6
    37struct work_struct {
    48        unsigned long pending;
     
    1014};
    1115
     16struct workqueue_struct {
     17        spinlock_t lock;
     18        const char *name;
     19        struct list_head worklist;
     20        int task_pid;
     21        struct task_struct *task;
     22        wait_queue_head_t more_work;
     23        wait_queue_head_t work_done;
     24        struct completion thread_exited;
     25};
    1226struct delayed_work {
    1327        struct work_struct work;
    1428};
     29
     30struct workqueue_struct *create_workqueue(const char *name);
     31void destroy_workqueue(struct workqueue_struct *wq);
     32int queue_work(struct workqueue_struct *wq, struct work_struct *work);
     33void flush_workqueue(struct workqueue_struct *wq);
    1534
    1635#define INIT_WORK(_work, _func, _data)                  \
     
    3554#define INIT_WORK(w,f) snd_INIT_WORK(w,f)
    3655#define create_singlethread_workqueue(name) create_workqueue(name)
     56
    3757#endif /* __LINUX_WORKQUEUE_H */
Note: See TracChangeset for help on using the changeset viewer.