Commit 61bb51cb authored by Paul Mackerras's avatar Paul Mackerras Committed by Tom Rini

PPC32: make xchg take volatile *, remove duplicate xchg_u32 defn.

Previously we had xchg_u32 both inline in system.h and out-of-line
in arch/ppc/kernel/misc.S, and it was exported for good measure.
We only need the inline definition.
parent 43a84310
...@@ -751,21 +751,6 @@ _GLOBAL(copy_page) ...@@ -751,21 +751,6 @@ _GLOBAL(copy_page)
blr blr
#endif /* CONFIG_PPC_ISERIES */ #endif /* CONFIG_PPC_ISERIES */
/*
* Atomic [test&set] exchange
*
* unsigned long xchg_u32(void *ptr, unsigned long val)
* Changes the memory location '*ptr' to be val and returns
* the previous value stored there.
*/
_GLOBAL(xchg_u32)
mr r5,r3 /* Save pointer */
10: lwarx r3,0,r5 /* Fetch old value & reserve */
PPC405_ERR77(0,r5)
stwcx. r4,0,r5 /* Update with new value */
bne- 10b /* Retry if "reservation" (i.e. lock) lost */
blr
/* /*
* void atomic_clear_mask(atomic_t mask, atomic_t *addr) * void atomic_clear_mask(atomic_t mask, atomic_t *addr)
* void atomic_set_mask(atomic_t mask, atomic_t *addr); * void atomic_set_mask(atomic_t mask, atomic_t *addr);
......
...@@ -191,7 +191,6 @@ EXPORT_SYMBOL(flush_dcache_range); ...@@ -191,7 +191,6 @@ EXPORT_SYMBOL(flush_dcache_range);
EXPORT_SYMBOL(flush_icache_user_range); EXPORT_SYMBOL(flush_icache_user_range);
EXPORT_SYMBOL(flush_icache_page); EXPORT_SYMBOL(flush_icache_page);
EXPORT_SYMBOL(flush_dcache_page); EXPORT_SYMBOL(flush_dcache_page);
EXPORT_SYMBOL(xchg_u32);
#ifdef CONFIG_ALTIVEC #ifdef CONFIG_ALTIVEC
EXPORT_SYMBOL(last_task_used_altivec); EXPORT_SYMBOL(last_task_used_altivec);
EXPORT_SYMBOL(giveup_altivec); EXPORT_SYMBOL(giveup_altivec);
......
...@@ -119,14 +119,14 @@ extern void __xchg_called_with_bad_pointer(void); ...@@ -119,14 +119,14 @@ extern void __xchg_called_with_bad_pointer(void);
#define xchg(ptr,x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr)))) #define xchg(ptr,x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr))))
#define tas(ptr) (xchg((ptr),1)) #define tas(ptr) (xchg((ptr),1))
static inline unsigned long __xchg(unsigned long x, void * ptr, int size) static inline unsigned long __xchg(unsigned long x, volatile void *ptr, int size)
{ {
switch (size) { switch (size) {
case 4: case 4:
return (unsigned long )xchg_u32(ptr, x); return (unsigned long) xchg_u32(ptr, x);
#if 0 /* xchg_u64 doesn't exist on 32-bit PPC */ #if 0 /* xchg_u64 doesn't exist on 32-bit PPC */
case 8: case 8:
return (unsigned long )xchg_u64(ptr, x); return (unsigned long) xchg_u64(ptr, x);
#endif /* 0 */ #endif /* 0 */
} }
__xchg_called_with_bad_pointer(); __xchg_called_with_bad_pointer();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment