mirror of https://gitee.com/openkylin/linux.git
[ARM] 3810/1: switch atomic helpers over to raw_local_irq_{save,restore}
Now that we have raw_* variants of local_irq_$FOO(), switch the atomic helpers over to use those raw_* variants. This is necessary when using lockdep on pre-ARMv6 hardware, as lockdep uses atomic_t counters in the trace_hardirqs_off() path. Signed-off-by: Lennert Buytenhek <buytenh@wantstofly.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
This commit is contained in:
parent
34148c6990
commit
8dd5c845bb
|
@ -128,10 +128,10 @@ static inline int atomic_add_return(int i, atomic_t *v)
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
int val;
|
int val;
|
||||||
|
|
||||||
local_irq_save(flags);
|
raw_local_irq_save(flags);
|
||||||
val = v->counter;
|
val = v->counter;
|
||||||
v->counter = val += i;
|
v->counter = val += i;
|
||||||
local_irq_restore(flags);
|
raw_local_irq_restore(flags);
|
||||||
|
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
@ -141,10 +141,10 @@ static inline int atomic_sub_return(int i, atomic_t *v)
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
int val;
|
int val;
|
||||||
|
|
||||||
local_irq_save(flags);
|
raw_local_irq_save(flags);
|
||||||
val = v->counter;
|
val = v->counter;
|
||||||
v->counter = val -= i;
|
v->counter = val -= i;
|
||||||
local_irq_restore(flags);
|
raw_local_irq_restore(flags);
|
||||||
|
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
@ -154,11 +154,11 @@ static inline int atomic_cmpxchg(atomic_t *v, int old, int new)
|
||||||
int ret;
|
int ret;
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
|
|
||||||
local_irq_save(flags);
|
raw_local_irq_save(flags);
|
||||||
ret = v->counter;
|
ret = v->counter;
|
||||||
if (likely(ret == old))
|
if (likely(ret == old))
|
||||||
v->counter = new;
|
v->counter = new;
|
||||||
local_irq_restore(flags);
|
raw_local_irq_restore(flags);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -167,9 +167,9 @@ static inline void atomic_clear_mask(unsigned long mask, unsigned long *addr)
|
||||||
{
|
{
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
|
|
||||||
local_irq_save(flags);
|
raw_local_irq_save(flags);
|
||||||
*addr &= ~mask;
|
*addr &= ~mask;
|
||||||
local_irq_restore(flags);
|
raw_local_irq_restore(flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* __LINUX_ARM_ARCH__ */
|
#endif /* __LINUX_ARM_ARCH__ */
|
||||||
|
|
Loading…
Reference in New Issue