Ignore:
Timestamp:
Jun 6, 2009, 4:22:27 AM (16 years ago)
Author:
Paul Smedley
Message:

Move functions out of config.h into appropriate linux header

Location:
GPL/trunk/include/linux
Files:
24 edited

Legend:

Unmodified
Added
Removed
  • GPL/trunk/include/linux/bitops.h

    r32 r441  
    1 /* $Id: bitops.h,v 1.1.1.1 2003/07/02 13:57:00 eleph Exp $ */
    2 
    31#ifndef _I386_BITOPS_H
    42#define _I386_BITOPS_H
     
    2018 */
    2119#include <asm\bitops.h>
    22 
     20#define smp_mb__after_clear_bit()       
    2321#endif /* _I386_BITOPS_H */
  • GPL/trunk/include/linux/capability.h

    r305 r441  
    33#ifndef _LINUX_CAPABILITY_H
    44#define _LINUX_CAPABILITY_H
    5 
     5#define capable(a)      1
     6#define CAP_SYS_ADMIN   0
    67#endif /* _LINUX_CAPABILITY_H */
  • GPL/trunk/include/linux/compiler-gcc.h

    r305 r441  
    99/* The "volatile" is due to gcc bugs */
    1010//#define barrier() __asm__ __volatile__("": : :"memory")
    11 #define barrier
     11#define barrier()
    1212
    1313/* This macro obfuscates arithmetic on a variable address so that gcc
  • GPL/trunk/include/linux/compiler.h

    r305 r441  
    1010# define __kernel
    1111# define __safe
     12# define __nocast
     13# define __iomem
     14# define __deprecated           /* unimplemented */
    1215#endif
    1316
     
    4144#define unlikely(x)     __builtin_expect(!!(x), 0)
    4245
    43 /* Optimization barrier */
    44 #ifndef barrier
    45 # define barrier() __memory_barrier()
    46 #endif
    4746
    4847#ifndef RELOC_HIDE
  • GPL/trunk/include/linux/device.h

    r305 r441  
    33#ifndef _LINUX_DEVICE_H
    44#define _LINUX_DEVICE_H
    5 #include <sound/config.h>
     5#include <linux/pm.h>
    66#if 0
    77struct device {
     
    4242#define dev_get_drvdata(dev)    (dev)->private_data
    4343
     44#define MODULE_ALIAS_CHARDEV_MAJOR(x)
    4445
    4546#endif /* _LINUX_DEVICE_H */
  • GPL/trunk/include/linux/dma-mapping.h

    r305 r441  
    2929#define DMA_24BIT_MASK  0x0000000000ffffffULL
    3030#endif
    31 
     31#define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1))
    3232#endif
    3333
  • GPL/trunk/include/linux/fs.h

    r305 r441  
    264264extern void kill_fasync(struct fasync_struct *, int, int);
    265265
     266#define fops_get(x) (x)
     267#define fops_put(x) do { ; } while (0)
     268#define imajor(x) major((x)->i_rdev)
     269
    266270#endif /* _LINUX_FS_H */
  • GPL/trunk/include/linux/init.h

    r32 r441  
    1 /* $Id: init.h,v 1.1.1.1 2003/07/02 13:57:00 eleph Exp $ */
    2 
    31#ifndef _LINUX_INIT_H
    42#define _LINUX_INIT_H
     
    138136#endif
    139137
     138#define __devexit_p(x) x
     139
    140140#endif /* _LINUX_INIT_H */
  • GPL/trunk/include/linux/interrupt.h

    r438 r441  
    2626#define IRQ_HANDLED     (1)
    2727#define IRQ_RETVAL(x)   ((x) != 0)
     28
     29#include <linux/signal.h>
     30#define IRQF_SHARED                     SA_SHIRQ
     31#define IRQF_DISABLED                   SA_INTERRUPT
     32#define IRQF_SAMPLE_RANDOM              SA_SAMPLE_RANDOM
     33#define IRQF_PERCPU                     SA_PERCPU
     34#ifdef SA_PROBEIRQ
     35#define IRQF_PROBE_SHARED               SA_PROBEIRQ
     36#else
     37#define IRQF_PROBE_SHARED               0 /* dummy */
     38#endif
    2839
    2940struct irqaction {
     
    132143extern int probe_irq_off(unsigned long);        /* returns 0 or negative on failure */
    133144
     145typedef irqreturn_t (*snd_irq_handler_t)(int, void *);
     146#define irq_handler_t snd_irq_handler_t
     147#undef irq_handler_t
     148#define irq_handler_t snd_irq_handler_t
     149
     150int request_irq(unsigned int, irq_handler_t handler,
     151                    unsigned long, const char *, void *);
     152
    134153#endif
  • GPL/trunk/include/linux/kernel.h

    r319 r441  
    1 /* $Id: kernel.h,v 1.1.1.1 2003/07/02 13:57:00 eleph Exp $ */
    2 
    31#ifndef _LINUX_KERNEL_H
    42#define _LINUX_KERNEL_H
     
    9997
    10098static void complete_and_exit(struct completion *, long);
     99#define printk_ratelimit()      1
     100#define ALIGN(x,a) (((x)+(a)-1)&~((a)-1))
     101#define dump_stack()
     102#define upper_32_bits(n) ((u32)(((n) >> 16) >> 16))
    101103
    102104#endif
  • GPL/trunk/include/linux/list.h

    r32 r441  
    112112#endif /* __KERNEL__ */
    113113
     114#define container_of(ptr, type, member) \
     115( (type *)( (char *)ptr - offsetof(type,member) ) )
     116_WCRTLINK extern int     snprintf( char *__buf, size_t __bufsize,
     117                                   const char *__fmt, ... );
     118#define offsetof(__typ,__id) ((size_t)&(((__typ*)0)->__id))
     119#define list_for_each_entry(itemptr, headptr, struct_listmember_name, container_type) \
     120    for (itemptr=(container_type *) \
     121         (((char *)((headptr)->next))-offsetof(container_type, struct_listmember_name)); \
     122         &(itemptr->struct_listmember_name)!=(headptr); \
     123         itemptr=(container_type *) \
     124         (((char *)(itemptr->struct_listmember_name.next))-offsetof(container_type, struct_listmember_name)))
     125
     126#define list_for_each_entry_safe(itemptr, n, headptr, struct_listmember_name, container_type) \
     127    for (itemptr=(container_type *) \
     128         (((char *)((headptr)->next))-offsetof(container_type, struct_listmember_name)), \
     129         n=(container_type *) \
     130         (((char *)(itemptr->struct_listmember_name.next))-offsetof(container_type, struct_listmember_name)); \
     131         &(itemptr->struct_listmember_name)!=(headptr); \
     132         itemptr=n, \
     133         n=(container_type *) \
     134         (((char *)(n->struct_listmember_name.next))-offsetof(container_type, struct_listmember_name)))
     135
     136/**
     137 * list_move_tail - delete from one list and add as another's tail
     138 * @list: the entry to move
     139 * @head: the head that will follow our entry
     140 */
     141static inline void list_move_tail(struct list_head *list,
     142                                  struct list_head *head)
     143{
     144        __list_del(list->prev, list->next);
     145        list_add_tail(list, head);
     146}
     147
    114148#endif
  • GPL/trunk/include/linux/mm.h

    r305 r441  
    171171};
    172172
     173#define SetPageReserved(a)              a
     174#define ClearPageReserved(a)            a
     175
    173176#endif
  • GPL/trunk/include/linux/module.h

    r280 r441  
    5959#endif
    6060
     61#define try_inc_mod_count(x)            ++(*(unsigned long *)x)
     62#define try_module_get(x) try_inc_mod_count(x)
     63static inline void module_put(struct module *module)
     64{
     65    if (module)
     66        do {} while(0);
     67}
     68
     69#define MODULE_FIRMWARE(x)
     70#define MODULE_ALIAS(x)
     71
    6172#endif /* _LINUX_MODULE_H */
  • GPL/trunk/include/linux/pci.h

    r428 r441  
    295295typedef struct pci_dev;
    296296
    297 
     297#define PCI_D0     0
     298#define PCI_D1     1
     299#define PCI_D2     2
     300#define PCI_D3hot  3
     301#define PCI_D3cold 4
     302#define pci_choose_state(pci,state)     ((state) ? PCI_D3hot : PCI_D0)
    298303
    299304typedef struct device {
     
    678683
    679684#endif /* __KERNEL__ */
     685
     686static inline unsigned char snd_pci_revision(struct pci_dev *pci)
     687{
     688        unsigned char rev;
     689        pci_read_config_byte(pci, PCI_REVISION_ID, &rev);
     690        return rev;
     691}
     692
     693/* pci_intx() wrapper */
     694#define pci_intx(pci,x)
     695
     696/* MSI */
     697static inline int snd_pci_enable_msi(struct pci_dev *dev) { return -1; }
     698#undef pci_enable_msi
     699#define pci_enable_msi(dev) snd_pci_enable_msi(dev)
     700#undef pci_disable_msi
     701#define pci_disable_msi(dev)
     702#define pci_dev_present(x) snd_pci_dev_present(x)
     703extern void * __ioremap(unsigned long offset, unsigned long size, unsigned long flags);
     704static inline void *pci_ioremap_bar(struct pci_dev *pdev, int bar)
     705{
     706        return __ioremap(pci_resource_start(pdev, bar),
     707                               pci_resource_len(pdev, bar),0x010);
     708}
     709
    680710#endif /* LINUX_PCI_H */
  • GPL/trunk/include/linux/pm.h

    r305 r441  
    249249#endif /* __KERNEL__ */
    250250
     251typedef u32 __bitwise pm_message_t;
     252#define PMSG_FREEZE     3
     253#define PMSG_SUSPEND    3
     254#define PMSG_ON         0
     255
    251256#endif /* _LINUX_PM_H */
  • GPL/trunk/include/linux/pnp.h

    r249 r441  
    1919#endif /* TARGET_OS2 */
    2020#include <linux/list.h>
     21#include <linux/pm.h>
    2122
    2223#define PNP_MAX_PORT            8
  • GPL/trunk/include/linux/proc_fs.h

    r305 r441  
    236236#endif /* CONFIG_PROC_FS */
    237237
     238static inline struct proc_dir_entry *PDE(const struct inode *inode)
     239{
     240        return (struct proc_dir_entry *) inode->u.generic_ip;
     241}
     242
    238243#endif /* _LINUX_PROC_FS_H */
  • GPL/trunk/include/linux/sched.h

    r351 r441  
    1414#define TASK_SWAPPING           16
    1515#define TASK_EXCLUSIVE          32
     16
     17#define set_current_state(a)
    1618
    1719struct task_struct {
     
    4749void schedule(void);
    4850
     51#define cond_resched() \
     52        do { \
     53                if (1) { \
     54                        set_current_state(TASK_RUNNING); \
     55                        schedule(); \
     56                } \
     57        } while (0)
     58
    4959// 12 Jun 07 SHL Drop superfluous near
    5060#if 0
     
    6878}
    6979
     80#define flush_scheduled_work()
     81
     82#define schedule_timeout_interruptible(x) \
     83        set_current_state(TASK_INTERRUPTIBLE); \
     84        schedule_timeout(x);
     85
     86#define schedule_timeout_uninterruptible(x) \
     87        set_current_state(TASK_UNINTERRUPTIBLE); \
     88        schedule_timeout(x);
     89
    7090#endif /* _LINUX_SCHED_H */
  • GPL/trunk/include/linux/spinlock.h

    r32 r441  
    7878#define write_unlock(lock)              spin_unlock(lock)
    7979
     80#define rwlock_init(x) *(x) = RW_LOCK_UNLOCKED;
     81
    8082#endif /* !SMP */
    8183#endif /* __LINUX_SPINLOCK_H */
  • GPL/trunk/include/linux/string.h

    r305 r441  
    1010int   strncmp (const char *string1, const char *string2, size_t count);
    1111#endif
     12
    1213#endif
    1314
  • GPL/trunk/include/linux/time.h

    r32 r441  
    114114#endif
    115115
     116/* wrapper for getnstimeofday()
     117 * it's needed for recent 2.6 kernels, too, due to lack of EXPORT_SYMBOL
     118 */
     119#define getnstimeofday(x) do { \
     120        struct timeval __x; \
     121        do_gettimeofday(&__x); \
     122        (x)->tv_sec = __x.tv_sec;       \
     123        (x)->tv_nsec = __x.tv_usec * 1000; \
     124} while (0)
     125
     126#define do_posix_clock_monotonic_gettime getnstimeofday
     127
    116128#endif
  • GPL/trunk/include/linux/types.h

    r120 r441  
    1 /* $Id: types.h,v 1.1.1.1 2003/07/02 13:57:02 eleph Exp $ */
    2 
    31#ifndef _LINUX_TYPES_H
    42#define _LINUX_TYPES_H
     
    75
    86#include <linux/posix_types.h>
     7#include <linux/compiler.h>
    98#include <asm/types.h>
    109
     
    7271typedef unsigned long           ulong;
    7372
     73#define BITS_PER_LONG   32
     74
    7475typedef unsigned long           dma_addr_t;
    7576
     
    131132#endif
    132133
     134typedef unsigned __nocast gfp_t;
     135
    133136#include <string.h>
    134 
     137typedef __u32 __le32;
    135138#endif /* _LINUX_TYPES_H */
  • GPL/trunk/include/linux/uio.h

    r305 r441  
    33#ifndef _LINUX_UIO_H
    44#define _LINUX_UIO_H
     5struct iovec {
     6        char    *iov_base;      /* Base address. */
     7#ifdef __32BIT__
     8        size_t   iov_len;       /* Length. */
     9#else
     10        long     iov_len;       /* Length. */
     11#endif
     12};
    513
    614#endif /* _LINUX_UIO_H */
  • GPL/trunk/include/linux/workqueue.h

    r305 r441  
    11#ifndef __LINUX_WORKQUEUE_H
    22#define __LINUX_WORKQUEUE_H
     3struct work_struct {
     4        unsigned long pending;
     5        struct list_head entry;
     6        void (*func)(void *);
     7        void *data;
     8        void *wq_data;
     9        struct timer_list timer;
     10};
     11
     12struct delayed_work {
     13        struct work_struct work;
     14};
     15
     16#define INIT_WORK(_work, _func, _data)                  \
     17        do {                                            \
     18                (_work)->func = _func;                  \
     19                (_work)->data = _data;                  \
     20                init_timer(&(_work)->timer);            \
     21        } while (0)
     22#define __WORK_INITIALIZER(n, f, d) {                   \
     23                .func = (f),                            \
     24                .data = (d),                            \
     25        }
     26#define DECLARE_WORK(n, f, d)                           \
     27        struct work_struct n = __WORK_INITIALIZER(n, f, d)
     28
     29/* redefine INIT_WORK() */
     30static inline void snd_INIT_WORK(struct work_struct *w, void (*f)(struct work_struct *))
     31{
     32        INIT_WORK(w, (void(*)(void*))(f), w);
     33}
     34#undef INIT_WORK
     35#define INIT_WORK(w,f) snd_INIT_WORK(w,f)
     36#define create_singlethread_workqueue(name) create_workqueue(name)
    337#endif /* __LINUX_WORKQUEUE_H */
Note: See TracChangeset for help on using the changeset viewer.