Changeset 445 for GPL


Ignore:
Timestamp:
Jun 8, 2009, 11:51:32 AM (16 years ago)
Author:
Paul Smedley
Message:

More code tidyups, remove some unnecessary #ifndef TARGET_OS2 by adding some more stub functions

Location:
GPL/trunk
Files:
1 added
26 edited

Legend:

Unmodified
Added
Removed
  • GPL/trunk/alsa-kernel/core/control.c

    r426 r445  
    14101410#endif
    14111411{
    1412 #ifndef TARGET_OS2
    14131412        .owner =        THIS_MODULE,
    1414 #endif
    14151413        .read =         snd_ctl_read,
    14161414        .open =         snd_ctl_open,
  • GPL/trunk/alsa-kernel/core/hwdep.c

    r426 r445  
    268268}
    269269
    270 #ifndef TARGET_OS2x
    271270static int snd_hwdep_mmap(struct file * file, struct vm_area_struct * vma)
    272271{
     
    276275        return -ENXIO;
    277276}
    278 #endif
     277
    279278static int snd_hwdep_control_ioctl(struct snd_card *card,
    280279                                   struct snd_ctl_file * control,
     
    350349#endif
    351350{
    352 #ifndef TARGET_OS2
    353351        .owner =        THIS_MODULE,
    354 #endif
    355352        .llseek =       snd_hwdep_llseek,
    356353        .read =         snd_hwdep_read,
     
    365362        .ioctl =        snd_hwdep_ioctl_old,
    366363#endif
    367 #ifndef TARGET_OS2x
    368364        .mmap =         snd_hwdep_mmap,
    369 #endif
    370365};
    371366
  • GPL/trunk/alsa-kernel/core/info.c

    r426 r445  
    172172        data = file->private_data;
    173173        entry = data->entry;
    174 #ifndef TARGET_OS2
    175174        lock_kernel();
    176 #endif
    177175        switch (entry->content) {
    178176        case SNDRV_INFO_CONTENT_TEXT:
     
    203201        ret = -ENXIO;
    204202out:
    205 #ifndef TARGET_OS2
    206203        unlock_kernel();
    207 #endif
    208204        return ret;
    209205}
     
    528524static const struct file_operations snd_info_entry_operations =
    529525{
    530 #ifndef TARGET_OS2
    531526        .owner =                THIS_MODULE,
    532 #endif
    533527        .llseek =               snd_info_entry_llseek,
    534528        .read =                 snd_info_entry_read,
  • GPL/trunk/alsa-kernel/core/init.c

    r426 r445  
    344344#endif
    345345{
    346 #ifndef TARGET_OS2
    347346        .owner =        THIS_MODULE,
    348 #endif
    349347        .llseek =       snd_disconnect_llseek,
    350348        .read =         snd_disconnect_read,
  • GPL/trunk/alsa-kernel/core/oss/mixer_oss.c

    r426 r445  
    3636MODULE_DESCRIPTION("Mixer OSS emulation for ALSA.");
    3737MODULE_LICENSE("GPL");
    38 #ifndef TARGET_OS2
    3938MODULE_ALIAS_SNDRV_MINOR(SNDRV_MINOR_OSS_MIXER);
    40 #endif
    4139
    4240static int snd_mixer_oss_open(struct inode *inode, struct file *file)
     
    412410static const struct file_operations snd_mixer_oss_f_ops =
    413411{
    414 #ifndef TARGET_OS2
    415412        .owner =        THIS_MODULE,
    416 #endif
    417413        .open =         snd_mixer_oss_open,
    418414        .release =      snd_mixer_oss_release,
  • GPL/trunk/alsa-kernel/core/oss/pcm_oss.c

    r426 r445  
    6161module_param(nonblock_open, bool, 0644);
    6262MODULE_PARM_DESC(nonblock_open, "Don't block opening busy PCM devices.");
    63 #ifndef TARGET_OS2
    6463MODULE_ALIAS_SNDRV_MINOR(SNDRV_MINOR_OSS_PCM);
    6564MODULE_ALIAS_SNDRV_MINOR(SNDRV_MINOR_OSS_PCM1);
    66 #endif
    6765
    6866extern int snd_mixer_oss_ioctl_card(struct snd_card *card, unsigned int cmd, unsigned long arg);
     
    29962994#endif
    29972995{
    2998 #ifndef TARGET_OS2
    29992996        .owner =        THIS_MODULE,
    3000 #endif
    30012997        .read =         snd_pcm_oss_read,
    30022998        .write =        snd_pcm_oss_write,
  • GPL/trunk/alsa-kernel/core/pcm_native.c

    r426 r445  
    32763276        int err = -ENXIO;
    32773277
    3278 #ifndef TARGET_OS2
    32793278        lock_kernel();
    3280 #endif
    32813279        pcm_file = file->private_data;
    32823280        substream = pcm_file->substream;
     
    32863284        err = fasync_helper(fd, file, on, &runtime->fasync);
    32873285out:
    3288 #ifndef TARGET_OS2
    32893286        unlock_kernel();
    3290 #endif
    32913287        return err;
    32923288}
     
    34473443#endif
    34483444        {
    3449 #ifndef TARGET_OS2
    34503445                .owner =                THIS_MODULE,
    3451 #endif
    34523446                .write =                snd_pcm_write,
    34533447#ifdef SND_PCM_USE_AIO
     
    34743468        },
    34753469        {
    3476 #ifndef TARGET_OS2
    34773470                .owner =                THIS_MODULE,
    3478 #endif
    34793471                .read =                 snd_pcm_read,
    34803472#ifdef SND_PCM_USE_AIO
  • GPL/trunk/alsa-kernel/core/rawmidi.c

    r426 r445  
    14071407#endif
    14081408{
    1409 #ifndef TARGET_OS2
    14101409        .owner =        THIS_MODULE,
    1411 #endif
    14121410        .read =         snd_rawmidi_read,
    14131411        .write =        snd_rawmidi_write,
  • GPL/trunk/alsa-kernel/core/seq/oss/seq_oss.c

    r399 r445  
    3737MODULE_LICENSE("GPL");
    3838/* Takashi says this is really only for sound-service-0-, but this is OK. */
    39 #ifndef TARGET_OS2
    4039MODULE_ALIAS_SNDRV_MINOR(SNDRV_MINOR_OSS_SEQUENCER);
    4140MODULE_ALIAS_SNDRV_MINOR(SNDRV_MINOR_OSS_MUSIC);
    42 #endif
    4341
    4442#ifdef SNDRV_SEQ_OSS_DEBUG
     
    226224static const struct file_operations seq_oss_f_ops =
    227225{
    228 #ifndef TARGET_OS2
    229226        .owner =        THIS_MODULE,
    230 #endif
    231227        .read =         odev_read,
    232228        .write =        odev_write,
  • GPL/trunk/alsa-kernel/core/seq/oss/seq_oss_init.c

    r399 r445  
    2121 */
    2222
    23 #ifdef TARGET_OS2
    24 #include <sound/initval.h>
    25 #endif
    2623#include "seq_oss_device.h"
    2724#include "seq_oss_synth.h"
  • GPL/trunk/alsa-kernel/core/seq/seq_clientmgr.c

    r399 r445  
    22232223{
    22242224        int err;
    2225 #ifndef TARGET_OS2
    22262225        unlock_kernel();
    2227 #endif
    22282226        err = snd_seq_ioctl(file, cmd, arg);
    2229 #ifndef TARGET_OS2
    22302227        lock_kernel();
    2231 #endif
    22322228        return err;
    22332229}
     
    25712567#endif
    25722568{
    2573 #ifndef TARGET_OS2
    25742569        .owner =        THIS_MODULE,
    2575 #endif
    25762570        .read =         snd_seq_read,
    25772571        .write =        snd_seq_write,
  • GPL/trunk/alsa-kernel/core/seq/seq_memory.c

    r399 r445  
    434434                        break;
    435435                }
    436 #ifndef TARGET_OS2
    437436                schedule_timeout_uninterruptible(1);
    438 #else
    439                 set_current_state(TASK_UNINTERRUPTIBLE);
    440                 schedule_timeout(1);
    441 #endif
    442437                max_count--;
    443438        }
  • GPL/trunk/alsa-kernel/core/sound.c

    r410 r445  
    181181        int ret;
    182182
    183 #ifndef TARGET_OS2
    184183        lock_kernel();
    185 #endif
    186184        ret = __snd_open(inode, file);
    187 #ifndef TARGET_OS2
    188185        unlock_kernel();
    189 #endif
    190186        return ret;
    191187}
     
    197193#endif
    198194{
    199 #ifndef TARGET_OS2
    200195        .owner =        THIS_MODULE,
    201 #endif
    202196        .open =         snd_open
    203197};
  • GPL/trunk/alsa-kernel/core/timer.c

    r426 r445  
    19491949#endif
    19501950{
    1951 #ifndef TARGET_OS2
    19521951        .owner =        THIS_MODULE,
    1953 #endif
    19541952        .read =         snd_timer_user_read,
    19551953        .open =         snd_timer_user_open,
  • GPL/trunk/alsa-kernel/include/sound/config.h

    r442 r445  
    6262#include <linux/init.h>
    6363#include <linux/lockdep.h>
     64#include <linux/smp_lock.h>
    6465#include "compat_22.h"
    6566
  • GPL/trunk/alsa-kernel/include/sound/minors.h

    r399 r445  
    103103#define SNDRV_OSS_DEVICE_TYPE_MUSIC     6
    104104
     105#ifndef TARGET_OS2
    105106#define MODULE_ALIAS_SNDRV_MINOR(type) \
    106107        MODULE_ALIAS("sound-service-?-" __stringify(type))
    107 
     108#else
     109#define MODULE_ALIAS_SNDRV_MINOR(a)
     110#endif
    108111#endif
    109112
  • GPL/trunk/alsa-kernel/pci/bt87x.c

    r410 r445  
    2222 */
    2323
    24 #ifdef TARGET_OS2
    25 #include <asm/bitops.h>
    26 #endif
    2724#include <linux/init.h>
    2825#include <linux/interrupt.h>
  • GPL/trunk/alsa-kernel/pci/hda/hda_intel.c

    r434 r445  
    19381938                printk(KERN_ERR "hda-intel: unable to grab IRQ %d, "
    19391939                       "disabling device\n", chip->pci->irq);
    1940 #ifndef TARGEt_OS2
     1940#ifndef TARGET_OS2
    19411941                if (do_disconnect)
    19421942                        snd_card_disconnect(chip->card);
  • GPL/trunk/alsa-kernel/pci/hda/makefile.os2

    r433 r445  
    1616FILE2    = patch_realtek.obj patch_cmedia.obj patch_analog.obj patch_sigmatel.obj
    1717FILE3    = patch_si3054.obj patch_atihdmi.obj patch_conexant.obj patch_via.obj
    18 FILE4    =
     18FILE4    = 
    1919FILE5    =
    2020FILE6    =
  • GPL/trunk/alsa-kernel/pci/intel8x0.c

    r426 r445  
    4141/* for 440MX workaround */
    4242#include <asm/pgtable.h>
    43 #ifndef TARGET_OS2
    4443#include <asm/cacheflush.h>
    45 #endif
    4644
    4745MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>");
  • GPL/trunk/alsa-kernel/pci/ymfpci/ymfpci_main.c

    r426 r445  
    8585                if ((snd_ymfpci_readw(chip, reg) & 0x8000) == 0)
    8686                        return 0;
    87 #ifndef TARGET_OS2
    8887                schedule_timeout_uninterruptible(1);
    89 #else
    90                 set_current_state(TASK_UNINTERRUPTIBLE);
    91                 schedule_timeout(1);
    92 #endif
    9388        } while (time_before(jiffies, end_time));
    9489        snd_printk(KERN_ERR "codec_ready: codec %i is not ready [0x%x]\n", secondary, snd_ymfpci_readw(chip, reg));
     
    794789                add_wait_queue(&chip->interrupt_sleep, &wait);
    795790                atomic_inc(&chip->interrupt_sleep_count);
    796 #ifndef TARGET_OS2
    797791                schedule_timeout_uninterruptible(msecs_to_jiffies(50));
    798 #else
    799                 set_current_state(TASK_UNINTERRUPTIBLE);
    800                 schedule_timeout(msecs_to_jiffies(50));
    801 #endif
    802 
    803792                remove_wait_queue(&chip->interrupt_sleep, &wait);
    804793        }
  • GPL/trunk/include/linux/fs.h

    r441 r445  
    233233
    234234struct file_operations {
     235        struct module *owner;
    235236        loff_t (*llseek) (struct file *, loff_t, int);
    236237        int (*read) (struct file *, char *, size_t, loff_t *);
  • GPL/trunk/include/linux/smp_lock.h

    r305 r445  
    33#ifndef _LINUX_SMP_LOCK_H
    44#define _LINUX_SMP_LOCK_H
    5 
     5#define lock_kernel()                           do { } while(0)
     6#define unlock_kernel()                         do { } while(0)
    67#endif /* _LINUX_SMP_LOCK_H */
  • GPL/trunk/lib32/memory.cpp

    r340 r445  
    3333#include <dbgos2.h>
    3434#include <stacktoflat.h>
     35#include <limits.h>
    3536#ifdef KEE
    3637#include <kee.h>
     
    645646//******************************************************************************
    646647//******************************************************************************
    647 
    648 }
     648void *kzalloc(size_t size, unsigned int flags)
     649{
     650        void *ret;
     651        ret = _kmalloc(size, flags);
     652        if (ret)
     653                memset(ret, 0, size);
     654        return ret;
     655}
     656//******************************************************************************
     657//******************************************************************************
     658void *kcalloc(size_t n, size_t size, unsigned int flags)
     659{
     660        if (n != 0 && size > INT_MAX / n)
     661                return NULL;
     662        return kzalloc(n * size, flags);
     663}
     664//******************************************************************************
     665//******************************************************************************
     666
     667}
  • GPL/trunk/lib32/misc.c

    r305 r445  
    3636#include <linux\utsname.h>
    3737#include <linux\module.h>
     38#include <linux/workqueue.h>
     39#include <linux/firmware.h>
    3840#include <dbgos2.h>
    3941#include <printfos2.h>
     
    219221//******************************************************************************
    220222//******************************************************************************
     223static void __x_queue_work(struct workqueue_struct *wq, struct work_struct *work)
     224{
     225        unsigned long flags;
     226
     227        spin_lock_irqsave(&wq->lock, flags);
     228        work->wq_data = wq;
     229        list_add_tail(&work->entry, &wq->worklist);
     230        wake_up(&wq->more_work);
     231        spin_unlock_irqrestore(&wq->lock, flags);
     232}
     233//******************************************************************************
     234//******************************************************************************
     235int queue_work(struct workqueue_struct *wq, struct work_struct *work)
     236{
     237        if (!test_and_set_bit(0, &work->pending)) {
     238                __x_queue_work(wq, work);
     239                return 1;
     240        }
     241        return 0;
     242}
     243//******************************************************************************
     244//******************************************************************************
     245void flush_workqueue(struct workqueue_struct *wq)
     246{
     247        if (wq->task == current) {
     248                run_workqueue(wq);
     249        } else {
     250                wait_queue_t wait;
     251
     252                init_waitqueue_entry(&wait, current);
     253                set_current_state(TASK_UNINTERRUPTIBLE);
     254                spin_lock_irq(&wq->lock);
     255                add_wait_queue(&wq->work_done, &wait);
     256                while (!list_empty(&wq->worklist)) {
     257                        spin_unlock_irq(&wq->lock);
     258                        schedule();
     259                        spin_lock_irq(&wq->lock);
     260                }
     261                set_current_state(TASK_RUNNING);
     262                remove_wait_queue(&wq->work_done, &wait);
     263                spin_unlock_irq(&wq->lock);
     264        }
     265}
     266//******************************************************************************
     267//******************************************************************************
     268static void run_workqueue(struct workqueue_struct *wq)
     269{
     270        unsigned long flags;
     271
     272        spin_lock_irqsave(&wq->lock, flags);
     273        while (!list_empty(&wq->worklist)) {
     274                struct work_struct *work = list_entry(wq->worklist.next,
     275                                                      struct work_struct, entry);
     276                void (*f) (void *) = work->func;
     277                void *data = work->data;
     278
     279                list_del_init(wq->worklist.next);
     280                spin_unlock_irqrestore(&wq->lock, flags);
     281                clear_bit(0, &work->pending);
     282                f(data);
     283                spin_lock_irqsave(&wq->lock, flags);
     284                wake_up(&wq->work_done);
     285        }
     286        spin_unlock_irqrestore(&wq->lock, flags);
     287}
     288//******************************************************************************
     289//******************************************************************************
     290struct workqueue_struct *create_workqueue(const char *name)
     291{
     292        struct workqueue_struct *wq;
     293       
     294        BUG_ON(strlen(name) > 10);
     295       
     296        wq = kmalloc(sizeof(*wq), GFP_KERNEL);
     297        if (!wq)
     298                return NULL;
     299        memset(wq, 0, sizeof(*wq));
     300       
     301        spin_lock_init(&wq->lock);
     302        INIT_LIST_HEAD(&wq->worklist);
     303        init_waitqueue_head(&wq->more_work);
     304        init_waitqueue_head(&wq->work_done);
     305#ifndef TARGET_OS2
     306        init_completion(&wq->thread_exited);
     307        wq->name = name;
     308        wq->task_pid = kernel_thread(xworker_thread, wq, 0);
     309        if (wq->task_pid < 0) {
     310                printk(KERN_ERR "snd: failed to start thread %s\n", name);
     311                snd_compat_destroy_workqueue(wq);
     312                wq = NULL;
     313        }
     314        wq->task = find_task_by_pid(wq->task_pid);
     315#endif
     316        return wq;
     317}
     318//******************************************************************************
     319//******************************************************************************
     320void destroy_workqueue(struct workqueue_struct *wq)
     321{
     322#ifndef TARGET_OS2
     323        snd_compat_flush_workqueue(wq);
     324        kill_proc(wq->task_pid, SIGKILL, 1);
     325        if (wq->task_pid >= 0)
     326                wait_for_completion(&wq->thread_exited);
     327#endif
     328        kfree(wq);
     329}
     330
     331//******************************************************************************
     332//******************************************************************************
     333char *kstrdup(const char *s, unsigned int __nocast gfp_flags)
     334{
     335        int len;
     336        char *buf;
     337
     338        if (!s) return NULL;
     339
     340        len = strlen(s) + 1;
     341        buf = kmalloc(len, gfp_flags);
     342        if (buf)
     343                memcpy(buf, s, len);
     344        return buf;
     345}
     346//******************************************************************************
     347//******************************************************************************
     348int mod_firmware_load(const char *fn, char **fp)
     349{
     350    return 0;
     351}
     352//******************************************************************************
     353//******************************************************************************
     354static int snd_try_load_firmware(const char *path, const char *name,
     355                                 struct firmware *firmware)
     356{
     357        char filename[30 + FIRMWARE_NAME_MAX];
     358
     359        sprintf(filename, "%s/%s", path, name);
     360        firmware->size = mod_firmware_load(filename, (char **)&firmware->data);
     361        if (firmware->size)
     362                printk(KERN_INFO "Loaded '%s'.", filename);
     363        return firmware->size;
     364}
     365//******************************************************************************
     366//******************************************************************************
     367int request_firmware(const struct firmware **fw, const char *name,
     368                     struct device *device)
     369{
     370        struct firmware *firmware;
     371
     372        *fw = NULL;
     373        firmware = kmalloc(sizeof *firmware, GFP_KERNEL);
     374        if (!firmware)
     375                return -ENOMEM;
     376        if (!snd_try_load_firmware("/lib/firmware", name, firmware) &&
     377            !snd_try_load_firmware("/lib/hotplug/firmware", name, firmware) &&
     378            !snd_try_load_firmware("/usr/lib/hotplug/firmware", name, firmware)) {
     379                kfree(firmware);
     380                return -EIO;
     381        }
     382        *fw = firmware;
     383        return 0;
     384}
     385//******************************************************************************
     386//******************************************************************************
     387void release_firmware(const struct firmware *fw)
     388{
     389        if (fw) {
     390                vfree(fw->data);
     391                kfree(fw);
     392        }
     393}
     394//******************************************************************************
     395//******************************************************************************
     396void *memdup_user(void __user *src, size_t len)
     397{
     398        void *p = kmalloc(len, GFP_KERNEL);
     399        if (!p)
     400                return ERR_PTR(-ENOMEM);
     401        if (copy_from_user(p, src, len)) {
     402                kfree(p);
     403                return ERR_PTR(-EFAULT);
     404        }
     405        return p;
     406}
     407//******************************************************************************
     408//******************************************************************************
  • GPL/trunk/lib32/timer.c

    r76 r445  
    127127//******************************************************************************
    128128//******************************************************************************
     129#include <linux/delay.h>
     130void msleep(unsigned int msecs)
     131{
     132        unsigned long timeout = ((msecs) * HZ + 999) / 1000;
    129133
     134        while (timeout) {
     135                set_current_state(TASK_UNINTERRUPTIBLE);
     136                timeout = schedule_timeout(timeout);
     137        }
     138}
     139
     140//******************************************************************************
     141//******************************************************************************
Note: See TracChangeset for help on using the changeset viewer.