diff options
| author | Roman Yeryomin <roman@advem.lv> | 2013-05-17 20:40:24 +0300 |
|---|---|---|
| committer | Roman Yeryomin <roman@advem.lv> | 2013-05-26 00:48:34 +0300 |
| commit | 7e810011201bf926cba09ec07424893e4cd8ce67 (patch) | |
| tree | 202fc7a42607e366848ca59c7a61a8f9fa2712ca /target/linux/realtek/files/arch/rlx/include/asm/local.h | |
| parent | a45894b5a0f65585440d98bf71ef3e919c84cb5f (diff) | |
Move to rsdk 3.2.4. Compiles cleanly.
Signed-off-by: Roman Yeryomin <roman@advem.lv>
Diffstat (limited to 'target/linux/realtek/files/arch/rlx/include/asm/local.h')
| -rw-r--r-- | target/linux/realtek/files/arch/rlx/include/asm/local.h | 44 |
1 files changed, 20 insertions, 24 deletions
diff --git a/target/linux/realtek/files/arch/rlx/include/asm/local.h b/target/linux/realtek/files/arch/rlx/include/asm/local.h index 889cc4a15..797a87e63 100644 --- a/target/linux/realtek/files/arch/rlx/include/asm/local.h +++ b/target/linux/realtek/files/arch/rlx/include/asm/local.h @@ -26,13 +26,11 @@ typedef struct */ static __inline__ long local_add_return(long i, local_t * l) { - unsigned long result; - #ifdef CONFIG_CPU_HAS_LLSC - unsigned long temp; + unsigned long result; + unsigned long temp; - __asm__ __volatile__( - " .set mips3 \n" + __asm__ __volatile__( "1: ll %1, %2 # local_add_return \n" #if defined(CONFIG_CPU_RLX4181) || defined(CONFIG_CPU_RLX5181) || defined(CONFIG_CPU_RLX5281) " nop \n" @@ -41,18 +39,18 @@ static __inline__ long local_add_return(long i, local_t * l) " sc %0, %2 \n" " beqz %0, 1b \n" " addu %0, %1, %3 \n" - " .set mips0 \n" : "=&r" (result), "=&r" (temp), "=m" (l->a.counter) : "Ir" (i), "m" (l->a.counter) : "memory"); #else - unsigned long flags; + unsigned long result; + unsigned long flags; - local_irq_save(flags); - result = l->a.counter; - result += i; - l->a.counter = result; - local_irq_restore(flags); + local_irq_save(flags); + result = l->a.counter; + result += i; + l->a.counter = result; + local_irq_restore(flags); #endif return result; @@ -60,13 +58,11 @@ static __inline__ long local_add_return(long i, local_t * l) static __inline__ long local_sub_return(long i, local_t * l) { - unsigned long result; - #ifdef CONFIG_CPU_HAS_LLSC - unsigned long temp; + unsigned long result; + unsigned long temp; - __asm__ __volatile__( - " .set mips3 \n" + __asm__ __volatile__( "1: ll %1, %2 # local_sub_return \n" #if defined(CONFIG_CPU_RLX4181) || defined(CONFIG_CPU_RLX5181) || defined(CONFIG_CPU_RLX5281) " nop \n" @@ -75,18 +71,18 @@ static __inline__ long local_sub_return(long i, local_t * l) " sc %0, %2 \n" " beqz %0, 1b \n" " subu %0, %1, %3 \n" - " .set mips0 \n" : "=&r" (result), "=&r" (temp), "=m" (l->a.counter) : "Ir" (i), "m" (l->a.counter) : "memory"); #else - unsigned long flags; + unsigned long result; + unsigned long flags; - local_irq_save(flags); - result = l->a.counter; - result -= i; - l->a.counter = result; - local_irq_restore(flags); + local_irq_save(flags); + result = l->a.counter; + result -= i; + l->a.counter = result; + local_irq_restore(flags); #endif return result; |
