Changeset 102 for GPL/branches


Ignore:
Timestamp:
May 12, 2007, 6:46:46 AM (18 years ago)
Author:
Brendan Oakley
Message:

Moved some code from driver.h to adriver.h where it belongs

Location:
GPL/branches/alsa-resync1/alsa-kernel/include/sound
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • GPL/branches/alsa-resync1/alsa-kernel/include/sound/adriver.h

    r98 r102  
    5353#endif
    5454
     55#ifndef __iomem
     56#define __iomem
     57#endif
     58
    5559#ifdef LINUX_2_2
    5660#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 2, 18)
     
    107111        return (struct proc_dir_entry *) inode->u.generic_ip;
    108112}
     113#endif
     114#ifndef cond_resched
     115#define cond_resched() \
     116        do { \
     117                if (1) { \
     118                        set_current_state(TASK_RUNNING); \
     119                        schedule(); \
     120                } \
     121        } while (0)
    109122#endif
    110123#include <asm/io.h>
     
    166179#endif
    167180
     181#define IRQ_NONE      (0)  /*void*/
     182#define IRQ_HANDLED   (1)  /*void*/
     183#define IRQ_RETVAL(x) ((x) != 0)  /*void*/
     184typedef int irqreturn_t;
     185
     186struct work_struct {
     187        unsigned long pending;
     188        struct list_head entry;
     189        void (*func)(void *);
     190        void *data;
     191        void *wq_data;
     192        struct timer_list timer;
     193};
     194#define INIT_WORK(_work, _func, _data)                  \
     195        do {                                            \
     196                (_work)->func = _func;                  \
     197                (_work)->data = _data;                  \
     198                init_timer(&(_work)->timer);            \
     199        } while (0)
     200#define __WORK_INITIALIZER(n, f, d) {                   \
     201                .func = (f),                            \
     202                .data = (d),                            \
     203        }
     204#define DECLARE_WORK(n, f, d)                           \
     205        struct work_struct n = __WORK_INITIALIZER(n, f, d)
     206int snd_compat_schedule_work(struct work_struct *work);
     207#define schedule_work(w) snd_compat_schedule_work(w)
     208
     209#ifndef PCI_D0
     210#define PCI_D0     0
     211#define PCI_D1     1
     212#define PCI_D2     2
     213#define PCI_D3hot  3
     214#define PCI_D3cold 4
     215#define pci_choose_state(pci,state)     ((state) ? PCI_D3hot : PCI_D0)
     216#endif
     217
     218/* wrapper for getnstimeofday()
     219 * it's needed for recent 2.6 kernels, too, due to lack of EXPORT_SYMBOL
     220 */
     221#define getnstimeofday(x) do { \
     222        struct timeval __x; \
     223        do_gettimeofday(&__x); \
     224        (x)->tv_sec = __x.tv_sec;       \
     225        (x)->tv_nsec = __x.tv_usec * 1000; \
     226} while (0)
     227
    168228#endif /* __SOUND_LOCAL_DRIVER_H */
  • GPL/branches/alsa-resync1/alsa-kernel/include/sound/driver.h

    r95 r102  
    4646#include <linux/module.h>
    4747
    48 #ifndef __iomem
    49 #define __iomem
    50 #endif
    51 
    52 #ifndef cond_resched
    53 #define cond_resched() \
    54         do { \
    55                 if (1) { \
    56                         set_current_state(TASK_RUNNING); \
    57                         schedule(); \
    58                 } \
    59         } while (0)
    60 #endif
    61 
    62 #define IRQ_NONE      (0)  /*void*/
    63 #define IRQ_HANDLED   (1)  /*void*/
    64 #define IRQ_RETVAL(x) ((x) != 0)  /*void*/
    65 typedef int irqreturn_t;
    66 #ifndef PCI_D0
    67 #define PCI_D0     0
    68 #define PCI_D1     1
    69 #define PCI_D2     2
    70 #define PCI_D3hot  3
    71 #define PCI_D3cold 4
    72 #define pci_choose_state(pci,state)     ((state) ? PCI_D3hot : PCI_D0)
    73 #endif
    74 
    75 /* wrapper for getnstimeofday()
    76  * it's needed for recent 2.6 kernels, too, due to lack of EXPORT_SYMBOL
    77  */
    78 #define getnstimeofday(x) do { \
    79         struct timeval __x; \
    80         do_gettimeofday(&__x); \
    81         (x)->tv_sec = __x.tv_sec;       \
    82         (x)->tv_nsec = __x.tv_usec * 1000; \
    83 } while (0)
    84 
    85 struct work_struct {
    86         unsigned long pending;
    87         struct list_head entry;
    88         void (*func)(void *);
    89         void *data;
    90         void *wq_data;
    91         struct timer_list timer;
    92 };
    93 
    94 #define INIT_WORK(_work, _func, _data)                  \
    95         do {                                            \
    96                 (_work)->func = _func;                  \
    97                 (_work)->data = _data;                  \
    98                 init_timer(&(_work)->timer);            \
    99         } while (0)
    100 #define __WORK_INITIALIZER(n, f, d) {                   \
    101         .func = (f),                                    \
    102         .data = (d),                                    \
    103         }
    104 #define DECLARE_WORK(n, f, d)                           \
    105         struct work_struct n = __WORK_INITIALIZER(n, f, d)
    106 int snd_compat_schedule_work(struct work_struct *work);
    107 #define schedule_work(w) snd_compat_schedule_work(w)
    108 
    10948/*
    11049 *  ==========================================================================
     
    15291 * Temporary hack, until linux/init.h is fixed.
    15392 */
    154 
    15593#include <linux/init.h>
    15694#ifndef __devexit_p
Note: See TracChangeset for help on using the changeset viewer.