The content of LoongArch's compiler.h is trivial, with some unused anywhere, so inline the definitions and remove the header.
Unified · Split
| @@ -69,7 +69,6 @@ config LOONGARCH · 68 unmodified lines | ||
| 69 | 69 | select GENERIC_TIME_VSYSCALL |
| 70 | 70 | select GPIOLIB |
| 71 | 71 | select HAVE_ARCH_AUDITSYSCALL |
| 72 | − select HAVE_ARCH_COMPILER_H | |
| 73 | 72 | select HAVE_ARCH_MMAP_RND_BITS if MMU |
| 74 | 73 | select HAVE_ARCH_SECCOMP_FILTER |
| 75 | 74 | select HAVE_ARCH_TRACEHOOK |
| @@ -10,7 +10,6 @@ · 9 unmodified lines | ||
| 10 | 10 | #include <linux/types.h> |
| 11 | 11 | #include <asm/barrier.h> |
| 12 | 12 | #include <asm/cmpxchg.h> |
| 13 | −#include <asm/compiler.h> | |
| 14 | 13 | |
| 15 | 14 | #if __SIZEOF_LONG__ == 4 |
| 16 | 15 | #define __LL "ll.w " |
| @@ -163,8 +162,7 @@ static inline int arch_atomic_sub_if_positive(int i, atomic_t *v) · 146 unmodified lines | ||
| 163 | 162 | " beqz %1, 1b \n" |
| 164 | 163 | "2: \n" |
| 165 | 164 | __WEAK_LLSC_MB |
| 166 | − : "=&r" (result), "=&r" (temp), | |
| 167 | − "+" GCC_OFF_SMALL_ASM() (v->counter) | |
| 165 | + : "=&r" (result), "=&r" (temp), "+ZC" (v->counter) | |
| 168 | 166 | : "I" (-i)); |
| 169 | 167 | } else { |
| 170 | 168 | __asm__ __volatile__( |
| @@ -176,8 +174,7 @@ static inline int arch_atomic_sub_if_positive(int i, atomic_t *v) · 5 unmodified lines | ||
| 176 | 174 | " beqz %1, 1b \n" |
| 177 | 175 | "2: \n" |
| 178 | 176 | __WEAK_LLSC_MB |
| 179 | − : "=&r" (result), "=&r" (temp), | |
| 180 | − "+" GCC_OFF_SMALL_ASM() (v->counter) | |
| 177 | + : "=&r" (result), "=&r" (temp), "+ZC" (v->counter) | |
| 181 | 178 | : "r" (i)); |
| 182 | 179 | } |
| 183 | 180 | |
| @@ -326,8 +323,7 @@ static inline long arch_atomic64_sub_if_positive(long i, atomic64_t *v) · 142 unmodified lines | ||
| 326 | 323 | " beqz %1, 1b \n" |
| 327 | 324 | "2: \n" |
| 328 | 325 | __WEAK_LLSC_MB |
| 329 | − : "=&r" (result), "=&r" (temp), | |
| 330 | − "+" GCC_OFF_SMALL_ASM() (v->counter) | |
| 326 | + : "=&r" (result), "=&r" (temp), "+ZC" (v->counter) | |
| 331 | 327 | : "I" (-i)); |
| 332 | 328 | } else { |
| 333 | 329 | __asm__ __volatile__( |
| @@ -339,8 +335,7 @@ static inline long arch_atomic64_sub_if_positive(long i, atomic64_t *v) · 5 unmodified lines | ||
| 339 | 335 | " beqz %1, 1b \n" |
| 340 | 336 | "2: \n" |
| 341 | 337 | __WEAK_LLSC_MB |
| 342 | − : "=&r" (result), "=&r" (temp), | |
| 343 | − "+" GCC_OFF_SMALL_ASM() (v->counter) | |
| 338 | + : "=&r" (result), "=&r" (temp), "+ZC" (v->counter) | |
| 344 | 339 | : "r" (i)); |
| 345 | 340 | } |
| 346 | 341 | |
| @@ -1,15 +0,0 @@ | ||
| 1 | −/* SPDX-License-Identifier: GPL-2.0 */ | |
| 2 | −/* | |
| 3 | − * Copyright (C) 2020-2022 Loongson Technology Corporation Limited | |
| 4 | − */ | |
| 5 | −#ifndef _ASM_COMPILER_H | |
| 6 | −#define _ASM_COMPILER_H | |
| 7 | − | |
| 8 | −#define GCC_OFF_SMALL_ASM() "ZC" | |
| 9 | − | |
| 10 | −#define LOONGARCH_ISA_LEVEL "loongarch" | |
| 11 | −#define LOONGARCH_ISA_ARCH_LEVEL "arch=loongarch" | |
| 12 | −#define LOONGARCH_ISA_LEVEL_RAW loongarch | |
| 13 | −#define LOONGARCH_ISA_ARCH_LEVEL_RAW LOONGARCH_ISA_LEVEL_RAW | |
| 14 | − | |
| 15 | −#endif /* _ASM_COMPILER_H */ | |
| @@ -8,7 +8,6 @@ · 7 unmodified lines | ||
| 8 | 8 | #include <linux/futex.h> |
| 9 | 9 | #include <linux/uaccess.h> |
| 10 | 10 | #include <asm/barrier.h> |
| 11 | −#include <asm/compiler.h> | |
| 12 | 11 | #include <asm/errno.h> |
| 13 | 12 | |
| 14 | 13 | #define __futex_atomic_op(insn, ret, oldval, uaddr, oparg) \ |
| @@ -95,8 +94,8 @@ futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr, u32 oldval, u32 newv · 80 unmodified lines | ||
| 95 | 94 | " "__UA_ADDR "\t1b, 4b \n" |
| 96 | 95 | " "__UA_ADDR "\t2b, 4b \n" |
| 97 | 96 | " .previous \n" |
| 98 | − : "+r" (ret), "=&r" (val), "=" GCC_OFF_SMALL_ASM() (*uaddr) | |
| 99 | − : GCC_OFF_SMALL_ASM() (*uaddr), "Jr" (oldval), "Jr" (newval), | |
| 97 | + : "+r" (ret), "=&r" (val), "=ZC" (*uaddr) | |
| 98 | + : "ZC" (*uaddr), "Jr" (oldval), "Jr" (newval), | |
| 100 | 99 | "i" (-EFAULT) |
| 101 | 100 | : "memory", "t0"); |
| 102 | 101 | |
| @@ -9,7 +9,6 @@ · 8 unmodified lines | ||
| 9 | 9 | |
| 10 | 10 | #include <linux/compiler.h> |
| 11 | 11 | #include <linux/stringify.h> |
| 12 | −#include <asm/compiler.h> | |
| 13 | 12 | #include <asm/loongarch.h> |
| 14 | 13 | |
| 15 | 14 | static inline void arch_local_irq_enable(void) |
| @@ -9,7 +9,6 @@ · 8 unmodified lines | ||
| 9 | 9 | #include <linux/bitops.h> |
| 10 | 10 | #include <linux/atomic.h> |
| 11 | 11 | #include <asm/cmpxchg.h> |
| 12 | −#include <asm/compiler.h> | |
| 13 | 12 | |
| 14 | 13 | typedef struct { |
| 15 | 14 | atomic_long_t a; |
| @@ -13,7 +13,6 @@ · 12 unmodified lines | ||
| 13 | 13 | #include <linux/console.h> |
| 14 | 14 | |
| 15 | 15 | #include <acpi/reboot.h> |
| 16 | −#include <asm/compiler.h> | |
| 17 | 16 | #include <asm/idle.h> |
| 18 | 17 | #include <asm/loongarch.h> |
| 19 | 18 | #include <asm/reboot.h> |
| @@ -7,7 +7,6 @@ · 6 unmodified lines | ||
| 7 | 7 | #include <linux/smp.h> |
| 8 | 8 | #include <linux/timex.h> |
| 9 | 9 | |
| 10 | −#include <asm/compiler.h> | |
| 11 | 10 | #include <asm/processor.h> |
| 12 | 11 | |
| 13 | 12 | void __delay(unsigned long cycles) |