mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
locking: Convert raw_spinlock to arch_spinlock
The raw_spin* namespace was taken by lockdep for the architecture specific implementations. raw_spin_* would be the ideal name space for the spinlocks which are not converted to sleeping locks in preempt-rt. Linus suggested to convert the raw_ to arch_ locks and cleanup the name space instead of using an artifical name like core_spin, atomic_spin or whatever No functional change. Signed-off-by: Thomas Gleixner <[email protected]> Acked-by: Peter Zijlstra <[email protected]> Acked-by: David S. Miller <[email protected]> Acked-by: Ingo Molnar <[email protected]> Cc: [email protected]
This commit is contained in:
parent
6b6b4792f8
commit
445c89514b
51 changed files with 164 additions and 164 deletions
|
|
@ -27,18 +27,18 @@
|
|||
# define ATOMIC_HASH_SIZE 4
|
||||
# define ATOMIC_HASH(a) (&(__atomic_hash[ (((unsigned long) (a))/L1_CACHE_BYTES) & (ATOMIC_HASH_SIZE-1) ]))
|
||||
|
||||
extern raw_spinlock_t __atomic_hash[ATOMIC_HASH_SIZE] __lock_aligned;
|
||||
extern arch_spinlock_t __atomic_hash[ATOMIC_HASH_SIZE] __lock_aligned;
|
||||
|
||||
/* Can't use raw_spin_lock_irq because of #include problems, so
|
||||
* this is the substitute */
|
||||
#define _atomic_spin_lock_irqsave(l,f) do { \
|
||||
raw_spinlock_t *s = ATOMIC_HASH(l); \
|
||||
arch_spinlock_t *s = ATOMIC_HASH(l); \
|
||||
local_irq_save(f); \
|
||||
__raw_spin_lock(s); \
|
||||
} while(0)
|
||||
|
||||
#define _atomic_spin_unlock_irqrestore(l,f) do { \
|
||||
raw_spinlock_t *s = ATOMIC_HASH(l); \
|
||||
arch_spinlock_t *s = ATOMIC_HASH(l); \
|
||||
__raw_spin_unlock(s); \
|
||||
local_irq_restore(f); \
|
||||
} while(0)
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
#include <asm/processor.h>
|
||||
#include <asm/spinlock_types.h>
|
||||
|
||||
static inline int __raw_spin_is_locked(raw_spinlock_t *x)
|
||||
static inline int __raw_spin_is_locked(arch_spinlock_t *x)
|
||||
{
|
||||
volatile unsigned int *a = __ldcw_align(x);
|
||||
return *a == 0;
|
||||
|
|
@ -15,7 +15,7 @@ static inline int __raw_spin_is_locked(raw_spinlock_t *x)
|
|||
#define __raw_spin_unlock_wait(x) \
|
||||
do { cpu_relax(); } while (__raw_spin_is_locked(x))
|
||||
|
||||
static inline void __raw_spin_lock_flags(raw_spinlock_t *x,
|
||||
static inline void __raw_spin_lock_flags(arch_spinlock_t *x,
|
||||
unsigned long flags)
|
||||
{
|
||||
volatile unsigned int *a;
|
||||
|
|
@ -33,7 +33,7 @@ static inline void __raw_spin_lock_flags(raw_spinlock_t *x,
|
|||
mb();
|
||||
}
|
||||
|
||||
static inline void __raw_spin_unlock(raw_spinlock_t *x)
|
||||
static inline void __raw_spin_unlock(arch_spinlock_t *x)
|
||||
{
|
||||
volatile unsigned int *a;
|
||||
mb();
|
||||
|
|
@ -42,7 +42,7 @@ static inline void __raw_spin_unlock(raw_spinlock_t *x)
|
|||
mb();
|
||||
}
|
||||
|
||||
static inline int __raw_spin_trylock(raw_spinlock_t *x)
|
||||
static inline int __raw_spin_trylock(arch_spinlock_t *x)
|
||||
{
|
||||
volatile unsigned int *a;
|
||||
int ret;
|
||||
|
|
|
|||
|
|
@ -9,10 +9,10 @@ typedef struct {
|
|||
volatile unsigned int lock[4];
|
||||
# define __RAW_SPIN_LOCK_UNLOCKED { { 1, 1, 1, 1 } }
|
||||
#endif
|
||||
} raw_spinlock_t;
|
||||
} arch_spinlock_t;
|
||||
|
||||
typedef struct {
|
||||
raw_spinlock_t lock;
|
||||
arch_spinlock_t lock;
|
||||
volatile int counter;
|
||||
} raw_rwlock_t;
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
#include <asm/atomic.h>
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
raw_spinlock_t __atomic_hash[ATOMIC_HASH_SIZE] __lock_aligned = {
|
||||
arch_spinlock_t __atomic_hash[ATOMIC_HASH_SIZE] __lock_aligned = {
|
||||
[0 ... (ATOMIC_HASH_SIZE-1)] = __RAW_SPIN_LOCK_UNLOCKED
|
||||
};
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Reference in a new issue