Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

MIPS: retire "asm/llsc.h"

all that "asm/llsc.h" does is just to help inline asm, which can be
stringifyed from "asm/asm.h"

+. Since "asm/asm.h" has all we need, retire "asm/llsc.h"

+. remove unused header file

Inspired-by: Maciej W. Rozycki <macro@orcam.me.uk>
Signed-off-by: Huang Pei <huangpei@loongson.cn>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>

authored by

Huang Pei and committed by
Thomas Bogendoerfer
f0b7ddbd 10657660

+31 -69
+4
arch/mips/include/asm/asm.h
··· 222 222 #define LONG_SRLV srlv 223 223 #define LONG_SRA sra 224 224 #define LONG_SRAV srav 225 + #define LONG_INS ins 226 + #define LONG_EXT ext 225 227 226 228 #ifdef __ASSEMBLY__ 227 229 #define LONG .word ··· 251 249 #define LONG_SRLV dsrlv 252 250 #define LONG_SRA dsra 253 251 #define LONG_SRAV dsrav 252 + #define LONG_INS dins 253 + #define LONG_EXT dext 254 254 255 255 #ifdef __ASSEMBLY__ 256 256 #define LONG .dword
+5 -6
arch/mips/include/asm/atomic.h
··· 16 16 17 17 #include <linux/irqflags.h> 18 18 #include <linux/types.h> 19 + #include <asm/asm.h> 19 20 #include <asm/barrier.h> 20 21 #include <asm/compiler.h> 21 22 #include <asm/cpu-features.h> 22 23 #include <asm/cmpxchg.h> 23 - #include <asm/llsc.h> 24 24 #include <asm/sync.h> 25 - #include <asm/war.h> 26 25 27 26 #define ATOMIC_OPS(pfx, type) \ 28 27 static __always_inline type arch_##pfx##_read(const pfx##_t *v) \ ··· 73 74 "1: " #ll " %0, %1 # " #pfx "_" #op " \n" \ 74 75 " " #asm_op " %0, %2 \n" \ 75 76 " " #sc " %0, %1 \n" \ 76 - "\t" __SC_BEQZ "%0, 1b \n" \ 77 + "\t" __stringify(SC_BEQZ) " %0, 1b \n" \ 77 78 " .set pop \n" \ 78 79 : "=&r" (temp), "+" GCC_OFF_SMALL_ASM() (v->counter) \ 79 80 : "Ir" (i) : __LLSC_CLOBBER); \ ··· 103 104 "1: " #ll " %1, %2 # " #pfx "_" #op "_return\n" \ 104 105 " " #asm_op " %0, %1, %3 \n" \ 105 106 " " #sc " %0, %2 \n" \ 106 - "\t" __SC_BEQZ "%0, 1b \n" \ 107 + "\t" __stringify(SC_BEQZ) " %0, 1b \n" \ 107 108 " " #asm_op " %0, %1, %3 \n" \ 108 109 " .set pop \n" \ 109 110 : "=&r" (result), "=&r" (temp), \ ··· 136 137 "1: " #ll " %1, %2 # " #pfx "_fetch_" #op "\n" \ 137 138 " " #asm_op " %0, %1, %3 \n" \ 138 139 " " #sc " %0, %2 \n" \ 139 - "\t" __SC_BEQZ "%0, 1b \n" \ 140 + "\t" __stringify(SC_BEQZ) " %0, 1b \n" \ 140 141 " .set pop \n" \ 141 142 " move %0, %1 \n" \ 142 143 : "=&r" (result), "=&r" (temp), \ ··· 236 237 " .set push \n" \ 237 238 " .set " MIPS_ISA_LEVEL " \n" \ 238 239 " " #sc " %1, %2 \n" \ 239 - " " __SC_BEQZ "%1, 1b \n" \ 240 + " " __stringify(SC_BEQZ) " %1, 1b \n" \ 240 241 "2: " __SYNC(full, loongson3_war) " \n" \ 241 242 " .set pop \n" \ 242 243 : "=&r" (result), "=&r" (temp), \
+11 -13
arch/mips/include/asm/bitops.h
··· 16 16 #include <linux/bits.h> 17 17 #include <linux/compiler.h> 18 18 #include <linux/types.h> 19 + #include <asm/asm.h> 19 20 #include <asm/barrier.h> 20 21 #include <asm/byteorder.h> /* sigh ... */ 21 22 #include <asm/compiler.h> 22 23 #include <asm/cpu-features.h> 23 - #include <asm/isa-rev.h> 24 - #include <asm/llsc.h> 25 24 #include <asm/sgidefs.h> 26 - #include <asm/war.h> 27 25 28 26 #define __bit_op(mem, insn, inputs...) do { \ 29 27 unsigned long __temp; \ ··· 30 32 " .set push \n" \ 31 33 " .set " MIPS_ISA_LEVEL " \n" \ 32 34 " " __SYNC(full, loongson3_war) " \n" \ 33 - "1: " __LL "%0, %1 \n" \ 35 + "1: " __stringify(LONG_LL) " %0, %1 \n" \ 34 36 " " insn " \n" \ 35 - " " __SC "%0, %1 \n" \ 36 - " " __SC_BEQZ "%0, 1b \n" \ 37 + " " __stringify(LONG_SC) " %0, %1 \n" \ 38 + " " __stringify(SC_BEQZ) " %0, 1b \n" \ 37 39 " .set pop \n" \ 38 40 : "=&r"(__temp), "+" GCC_OFF_SMALL_ASM()(mem) \ 39 41 : inputs \ ··· 47 49 " .set push \n" \ 48 50 " .set " MIPS_ISA_LEVEL " \n" \ 49 51 " " __SYNC(full, loongson3_war) " \n" \ 50 - "1: " __LL ll_dst ", %2 \n" \ 52 + "1: " __stringify(LONG_LL) " " ll_dst ", %2\n" \ 51 53 " " insn " \n" \ 52 - " " __SC "%1, %2 \n" \ 53 - " " __SC_BEQZ "%1, 1b \n" \ 54 + " " __stringify(LONG_SC) " %1, %2 \n" \ 55 + " " __stringify(SC_BEQZ) " %1, 1b \n" \ 54 56 " .set pop \n" \ 55 57 : "=&r"(__orig), "=&r"(__temp), \ 56 58 "+" GCC_OFF_SMALL_ASM()(mem) \ ··· 96 98 } 97 99 98 100 if ((MIPS_ISA_REV >= 2) && __builtin_constant_p(bit) && (bit >= 16)) { 99 - __bit_op(*m, __INS "%0, %3, %2, 1", "i"(bit), "r"(~0)); 101 + __bit_op(*m, __stringify(LONG_INS) " %0, %3, %2, 1", "i"(bit), "r"(~0)); 100 102 return; 101 103 } 102 104 ··· 124 126 } 125 127 126 128 if ((MIPS_ISA_REV >= 2) && __builtin_constant_p(bit)) { 127 - __bit_op(*m, __INS "%0, $0, %2, 1", "i"(bit)); 129 + __bit_op(*m, __stringify(LONG_INS) " %0, $0, %2, 1", "i"(bit)); 128 130 return; 129 131 } 130 132 ··· 232 234 res = __mips_test_and_clear_bit(nr, addr); 233 235 } else if ((MIPS_ISA_REV >= 2) && __builtin_constant_p(nr)) { 234 236 res = __test_bit_op(*m, "%1", 235 - __EXT "%0, %1, %3, 1;" 236 - __INS "%1, $0, %3, 1", 237 + __stringify(LONG_EXT) " %0, %1, %3, 1;" 238 + __stringify(LONG_INS) " %1, $0, %3, 1", 237 239 "i"(bit)); 238 240 } else { 239 241 orig = __test_bit_op(*m, "%0",
+4 -5
arch/mips/include/asm/cmpxchg.h
··· 10 10 11 11 #include <linux/bug.h> 12 12 #include <linux/irqflags.h> 13 + #include <asm/asm.h> 13 14 #include <asm/compiler.h> 14 - #include <asm/llsc.h> 15 15 #include <asm/sync.h> 16 - #include <asm/war.h> 17 16 18 17 /* 19 18 * These functions doesn't exist, so if they are called you'll either: ··· 47 48 " move $1, %z3 \n" \ 48 49 " .set " MIPS_ISA_ARCH_LEVEL " \n" \ 49 50 " " st " $1, %1 \n" \ 50 - "\t" __SC_BEQZ "$1, 1b \n" \ 51 + "\t" __stringify(SC_BEQZ) " $1, 1b \n" \ 51 52 " .set pop \n" \ 52 53 : "=&r" (__ret), "=" GCC_OFF_SMALL_ASM() (*m) \ 53 54 : GCC_OFF_SMALL_ASM() (*m), "Jr" (val) \ ··· 126 127 " move $1, %z4 \n" \ 127 128 " .set "MIPS_ISA_ARCH_LEVEL" \n" \ 128 129 " " st " $1, %1 \n" \ 129 - "\t" __SC_BEQZ "$1, 1b \n" \ 130 + "\t" __stringify(SC_BEQZ) " $1, 1b \n" \ 130 131 " .set pop \n" \ 131 132 "2: " __SYNC(full, loongson3_war) " \n" \ 132 133 : "=&r" (__ret), "=" GCC_OFF_SMALL_ASM() (*m) \ ··· 281 282 /* Attempt to store new at ptr */ 282 283 " scd %L1, %2 \n" 283 284 /* If we failed, loop! */ 284 - "\t" __SC_BEQZ "%L1, 1b \n" 285 + "\t" __stringify(SC_BEQZ) " %L1, 1b \n" 285 286 "2: " __SYNC(full, loongson3_war) " \n" 286 287 " .set pop \n" 287 288 : "=&r"(ret),
+7 -6
arch/mips/include/asm/kvm_host.h
··· 20 20 #include <linux/threads.h> 21 21 #include <linux/spinlock.h> 22 22 23 + #include <asm/asm.h> 23 24 #include <asm/inst.h> 24 25 #include <asm/mipsregs.h> 25 26 ··· 380 379 __asm__ __volatile__( 381 380 " .set push \n" 382 381 " .set "MIPS_ISA_ARCH_LEVEL" \n" 383 - " " __LL "%0, %1 \n" 382 + " "__stringify(LONG_LL) " %0, %1 \n" 384 383 " or %0, %2 \n" 385 - " " __SC "%0, %1 \n" 384 + " "__stringify(LONG_SC) " %0, %1 \n" 386 385 " .set pop \n" 387 386 : "=&r" (temp), "+m" (*reg) 388 387 : "r" (val)); ··· 397 396 __asm__ __volatile__( 398 397 " .set push \n" 399 398 " .set "MIPS_ISA_ARCH_LEVEL" \n" 400 - " " __LL "%0, %1 \n" 399 + " "__stringify(LONG_LL) " %0, %1 \n" 401 400 " and %0, %2 \n" 402 - " " __SC "%0, %1 \n" 401 + " "__stringify(LONG_SC) " %0, %1 \n" 403 402 " .set pop \n" 404 403 : "=&r" (temp), "+m" (*reg) 405 404 : "r" (~val)); ··· 415 414 __asm__ __volatile__( 416 415 " .set push \n" 417 416 " .set "MIPS_ISA_ARCH_LEVEL" \n" 418 - " " __LL "%0, %1 \n" 417 + " "__stringify(LONG_LL) " %0, %1 \n" 419 418 " and %0, %2 \n" 420 419 " or %0, %3 \n" 421 - " " __SC "%0, %1 \n" 420 + " "__stringify(LONG_SC) " %0, %1 \n" 422 421 " .set pop \n" 423 422 : "=&r" (temp), "+m" (*reg) 424 423 : "r" (~change), "r" (val & change));
-39
arch/mips/include/asm/llsc.h
··· 1 - /* 2 - * This file is subject to the terms and conditions of the GNU General Public 3 - * License. See the file "COPYING" in the main directory of this archive 4 - * for more details. 5 - * 6 - * Macros for 32/64-bit neutral inline assembler 7 - */ 8 - 9 - #ifndef __ASM_LLSC_H 10 - #define __ASM_LLSC_H 11 - 12 - #include <asm/isa-rev.h> 13 - 14 - #if _MIPS_SZLONG == 32 15 - #define __LL "ll " 16 - #define __SC "sc " 17 - #define __INS "ins " 18 - #define __EXT "ext " 19 - #elif _MIPS_SZLONG == 64 20 - #define __LL "lld " 21 - #define __SC "scd " 22 - #define __INS "dins " 23 - #define __EXT "dext " 24 - #endif 25 - 26 - /* 27 - * Using a branch-likely instruction to check the result of an sc instruction 28 - * works around a bug present in R10000 CPUs prior to revision 3.0 that could 29 - * cause ll-sc sequences to execute non-atomically. 30 - */ 31 - #ifdef CONFIG_WAR_R10000_LLSC 32 - # define __SC_BEQZ "beqzl " 33 - #elif MIPS_ISA_REV >= 6 34 - # define __SC_BEQZ "beqzc " 35 - #else 36 - # define __SC_BEQZ "beqz " 37 - #endif 38 - 39 - #endif /* __ASM_LLSC_H */