diff options
author | Jody McIntyre <scjody@modernduck.com> | 2005-11-18 00:18:25 -0500 |
---|---|---|
committer | Jody McIntyre <scjody@modernduck.com> | 2005-11-18 00:18:25 -0500 |
commit | a9931a6e37c09f6b76a9fa0cbd777c335548692b (patch) | |
tree | cd6ba9d36e350dd6188f7b8f95efc59c85d34485 /include/asm-v850 | |
parent | 7301c8d3a05dc52d33598364da7c4eb6ab6357eb (diff) | |
parent | 811803c5572b296e0031e0099203de90d77c7bcf (diff) |
Merge with http://kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
Diffstat (limited to 'include/asm-v850')
-rw-r--r-- | include/asm-v850/atomic.h | 32 | ||||
-rw-r--r-- | include/asm-v850/bitops.h | 6 | ||||
-rw-r--r-- | include/asm-v850/delay.h | 4 | ||||
-rw-r--r-- | include/asm-v850/hardirq.h | 4 | ||||
-rw-r--r-- | include/asm-v850/hw_irq.h | 2 | ||||
-rw-r--r-- | include/asm-v850/processor.h | 4 | ||||
-rw-r--r-- | include/asm-v850/semaphore.h | 10 | ||||
-rw-r--r-- | include/asm-v850/system.h | 2 | ||||
-rw-r--r-- | include/asm-v850/tlbflush.h | 4 | ||||
-rw-r--r-- | include/asm-v850/uaccess.h | 2 | ||||
-rw-r--r-- | include/asm-v850/unaligned.h | 6 |
11 files changed, 55 insertions, 21 deletions
diff --git a/include/asm-v850/atomic.h b/include/asm-v850/atomic.h index 8284aa7363f..bede3172ce7 100644 --- a/include/asm-v850/atomic.h +++ b/include/asm-v850/atomic.h @@ -31,7 +31,7 @@ typedef struct { int counter; } atomic_t; #define atomic_read(v) ((v)->counter) #define atomic_set(v,i) (((v)->counter) = (i)) -extern __inline__ int atomic_add_return (int i, volatile atomic_t *v) +static inline int atomic_add_return (int i, volatile atomic_t *v) { unsigned long flags; int res; @@ -90,6 +90,36 @@ static __inline__ void atomic_clear_mask (unsigned long mask, unsigned long *add #define atomic_dec_and_test(v) (atomic_sub_return (1, (v)) == 0) #define atomic_add_negative(i,v) (atomic_add_return ((i), (v)) < 0) +static inline int atomic_cmpxchg(atomic_t *v, int old, int new) +{ + int ret; + unsigned long flags; + + local_irq_save(flags); + ret = v->counter; + if (likely(ret == old)) + v->counter = new; + local_irq_restore(flags); + + return ret; +} + +static inline int atomic_add_unless(atomic_t *v, int a, int u) +{ + int ret; + unsigned long flags; + + local_irq_save(flags); + ret = v->counter; + if (ret != u) + v->counter += a; + local_irq_restore(flags); + + return ret != u; +} + +#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0) + /* Atomic operations are already serializing on ARM */ #define smp_mb__before_atomic_dec() barrier() #define smp_mb__after_atomic_dec() barrier() diff --git a/include/asm-v850/bitops.h b/include/asm-v850/bitops.h index 0e5c2f21087..b91e799763f 100644 --- a/include/asm-v850/bitops.h +++ b/include/asm-v850/bitops.h @@ -30,7 +30,7 @@ * ffz = Find First Zero in word. Undefined if no zero exists, * so code should check against ~0UL first.. */ -extern __inline__ unsigned long ffz (unsigned long word) +static inline unsigned long ffz (unsigned long word) { unsigned long result = 0; @@ -135,7 +135,7 @@ extern __inline__ unsigned long ffz (unsigned long word) "m" (*((const char *)(addr) + ((nr) >> 3)))); \ __test_bit_res; \ }) -extern __inline__ int __test_bit (int nr, const void *addr) +static inline int __test_bit (int nr, const void *addr) { int res; __asm__ __volatile__ ("tst1 %1, [%2]; setf nz, %0" @@ -157,7 +157,7 @@ extern __inline__ int __test_bit (int nr, const void *addr) #define find_first_zero_bit(addr, size) \ find_next_zero_bit ((addr), (size), 0) -extern __inline__ int find_next_zero_bit(const void *addr, int size, int offset) +static inline int find_next_zero_bit(const void *addr, int size, int offset) { unsigned long *p = ((unsigned long *) addr) + (offset >> 5); unsigned long result = offset & ~31UL; diff --git a/include/asm-v850/delay.h b/include/asm-v850/delay.h index 1ce65d48a7c..6d028e6b235 100644 --- a/include/asm-v850/delay.h +++ b/include/asm-v850/delay.h @@ -16,7 +16,7 @@ #include <asm/param.h> -extern __inline__ void __delay(unsigned long loops) +static inline void __delay(unsigned long loops) { if (loops) __asm__ __volatile__ ("1: add -1, %0; bnz 1b" @@ -33,7 +33,7 @@ extern __inline__ void __delay(unsigned long loops) extern unsigned long loops_per_jiffy; -extern __inline__ void udelay(unsigned long usecs) +static inline void udelay(unsigned long usecs) { register unsigned long full_loops, part_loops; diff --git a/include/asm-v850/hardirq.h b/include/asm-v850/hardirq.h index 5dfca8047cb..d98488cd5af 100644 --- a/include/asm-v850/hardirq.h +++ b/include/asm-v850/hardirq.h @@ -5,6 +5,8 @@ #include <linux/threads.h> #include <linux/cache.h> +#include <asm/irq.h> + typedef struct { unsigned int __softirq_pending; } ____cacheline_aligned irq_cpustat_t; @@ -22,4 +24,6 @@ typedef struct { # error HARDIRQ_BITS is too low! #endif +void ack_bad_irq(unsigned int irq); + #endif /* __V850_HARDIRQ_H__ */ diff --git a/include/asm-v850/hw_irq.h b/include/asm-v850/hw_irq.h index 4bdc98edb9f..a8aab434271 100644 --- a/include/asm-v850/hw_irq.h +++ b/include/asm-v850/hw_irq.h @@ -1,7 +1,7 @@ #ifndef __V850_HW_IRQ_H__ #define __V850_HW_IRQ_H__ -extern inline void hw_resend_irq (struct hw_interrupt_type *h, unsigned int i) +static inline void hw_resend_irq (struct hw_interrupt_type *h, unsigned int i) { } diff --git a/include/asm-v850/processor.h b/include/asm-v850/processor.h index d41f925f518..98f929427d3 100644 --- a/include/asm-v850/processor.h +++ b/include/asm-v850/processor.h @@ -59,7 +59,7 @@ struct thread_struct { /* Do necessary setup to start up a newly executed thread. */ -extern inline void start_thread (struct pt_regs *regs, +static inline void start_thread (struct pt_regs *regs, unsigned long pc, unsigned long usp) { regs->pc = pc; @@ -68,7 +68,7 @@ extern inline void start_thread (struct pt_regs *regs, } /* Free all resources held by a thread. */ -extern inline void release_thread (struct task_struct *dead_task) +static inline void release_thread (struct task_struct *dead_task) { } diff --git a/include/asm-v850/semaphore.h b/include/asm-v850/semaphore.h index df6cdecf6c1..735baaf3a16 100644 --- a/include/asm-v850/semaphore.h +++ b/include/asm-v850/semaphore.h @@ -24,7 +24,7 @@ struct semaphore { #define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC (name,1) #define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC (name,0) -extern inline void sema_init (struct semaphore *sem, int val) +static inline void sema_init (struct semaphore *sem, int val) { *sem = (struct semaphore)__SEMAPHORE_INITIALIZER((*sem),val); } @@ -52,14 +52,14 @@ extern int __down_interruptible (struct semaphore * sem); extern int __down_trylock (struct semaphore * sem); extern void __up (struct semaphore * sem); -extern inline void down (struct semaphore * sem) +static inline void down (struct semaphore * sem) { might_sleep(); if (atomic_dec_return (&sem->count) < 0) __down (sem); } -extern inline int down_interruptible (struct semaphore * sem) +static inline int down_interruptible (struct semaphore * sem) { int ret = 0; might_sleep(); @@ -68,7 +68,7 @@ extern inline int down_interruptible (struct semaphore * sem) return ret; } -extern inline int down_trylock (struct semaphore *sem) +static inline int down_trylock (struct semaphore *sem) { int ret = 0; if (atomic_dec_return (&sem->count) < 0) @@ -76,7 +76,7 @@ extern inline int down_trylock (struct semaphore *sem) return ret; } -extern inline void up (struct semaphore * sem) +static inline void up (struct semaphore * sem) { if (atomic_inc_return (&sem->count) <= 0) __up (sem); diff --git a/include/asm-v850/system.h b/include/asm-v850/system.h index 20f4c738c04..107decbd6e6 100644 --- a/include/asm-v850/system.h +++ b/include/asm-v850/system.h @@ -81,7 +81,7 @@ static inline int irqs_disabled (void) ((__typeof__ (*(ptr)))__xchg ((unsigned long)(with), (ptr), sizeof (*(ptr)))) #define tas(ptr) (xchg ((ptr), 1)) -extern inline unsigned long __xchg (unsigned long with, +static inline unsigned long __xchg (unsigned long with, __volatile__ void *ptr, int size) { unsigned long tmp, flags; diff --git a/include/asm-v850/tlbflush.h b/include/asm-v850/tlbflush.h index 501e4498172..5f2f85f636e 100644 --- a/include/asm-v850/tlbflush.h +++ b/include/asm-v850/tlbflush.h @@ -56,12 +56,12 @@ static inline void flush_tlb_range(struct vm_area_struct *vma, BUG (); } -extern inline void flush_tlb_kernel_page(unsigned long addr) +static inline void flush_tlb_kernel_page(unsigned long addr) { BUG (); } -extern inline void flush_tlb_pgtables(struct mm_struct *mm, +static inline void flush_tlb_pgtables(struct mm_struct *mm, unsigned long start, unsigned long end) { BUG (); diff --git a/include/asm-v850/uaccess.h b/include/asm-v850/uaccess.h index 188b28597cf..64563c409bb 100644 --- a/include/asm-v850/uaccess.h +++ b/include/asm-v850/uaccess.h @@ -14,7 +14,7 @@ #define VERIFY_READ 0 #define VERIFY_WRITE 1 -extern inline int access_ok (int type, const void *addr, unsigned long size) +static inline int access_ok (int type, const void *addr, unsigned long size) { /* XXX I guess we should check against real ram bounds at least, and possibly make sure ADDR is not within the kernel. diff --git a/include/asm-v850/unaligned.h b/include/asm-v850/unaligned.h index 65e38362142..e30b18653a9 100644 --- a/include/asm-v850/unaligned.h +++ b/include/asm-v850/unaligned.h @@ -82,19 +82,19 @@ extern int __bug_unaligned_x(void *ptr); }) -extern inline void __put_unaligned_2(__u32 __v, register __u8 *__p) +static inline void __put_unaligned_2(__u32 __v, register __u8 *__p) { *__p++ = __v; *__p++ = __v >> 8; } -extern inline void __put_unaligned_4(__u32 __v, register __u8 *__p) +static inline void __put_unaligned_4(__u32 __v, register __u8 *__p) { __put_unaligned_2(__v >> 16, __p + 2); __put_unaligned_2(__v, __p); } -extern inline void __put_unaligned_8(const unsigned long long __v, register __u8 *__p) +static inline void __put_unaligned_8(const unsigned long long __v, register __u8 *__p) { /* * tradeoff: 8 bytes of stack for all unaligned puts (2 |