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

Reorganise code to make maintenance easier

File:
1 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__
Note: See TracChangeset for help on using the changeset viewer.