OSDN Git Service

rx: use generic headers.
authorYoshinori Sato <ysato@users.sourceforge.jp>
Thu, 27 Jan 2022 13:46:10 +0000 (22:46 +0900)
committerYoshinori Sato <yo-satoh@sios.com>
Sat, 29 Jan 2022 07:42:43 +0000 (16:42 +0900)
Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
arch/rx/include/asm/atomic.h [deleted file]
arch/rx/include/asm/cmpxchg.h [deleted file]
arch/rx/include/asm/uaccess.h [deleted file]

diff --git a/arch/rx/include/asm/atomic.h b/arch/rx/include/asm/atomic.h
deleted file mode 100644 (file)
index f246d88..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-#ifndef __ARCH_RX_ATOMIC__
-#define __ARCH_RX_ATOMIC__
-
-#include <linux/compiler.h>
-#include <linux/types.h>
-#include <asm/cmpxchg.h>
-
-/*
- * Atomic operations that C can't guarantee us.  Useful for
- * resource counting etc..
- */
-
-#define ATOMIC_INIT(i) { (i) }
-
-#define atomic_read(v)         READ_ONCE((v)->counter)
-#define atomic_set(v, i)       WRITE_ONCE(((v)->counter), (i))
-
-#define ATOMIC_OP_RETURN(op, c_op)                             \
-static inline int atomic_##op##_return(int i, atomic_t *v)     \
-{                                                              \
-       unsigned long flags;                                    \
-       int ret;                                                \
-                                                               \
-       flags = arch_local_irq_save();                          \
-       ret = v->counter c_op i;                                \
-       arch_local_irq_restore(flags);                          \
-       return ret;                                             \
-}
-
-#define ATOMIC_FETCH_OP(op, c_op)                              \
-static inline int atomic_fetch_##op(int i, atomic_t *v)                \
-{                                                              \
-       unsigned long flags;                                    \
-       int ret;                                                \
-                                                               \
-       flags = arch_local_irq_save();                          \
-       ret = v->counter;                                       \
-       v->counter c_op i;                                      \
-       arch_local_irq_restore(flags);                          \
-       return ret;                                             \
-}
-
-#define ATOMIC_OP(op, c_op)                                    \
-static inline void atomic_##op(int i, atomic_t *v)             \
-{                                                              \
-       unsigned long flags;                                    \
-                                                               \
-       flags = arch_local_irq_save();                          \
-       v->counter c_op i;                                      \
-       arch_local_irq_restore(flags);                          \
-}
-
-ATOMIC_OP_RETURN(add, +=)
-ATOMIC_OP_RETURN(sub, -=)
-
-#define ATOMIC_OPS(op, c_op)                                   \
-       ATOMIC_OP(op, c_op)                                     \
-       ATOMIC_FETCH_OP(op, c_op)
-
-ATOMIC_OPS(and, &=)
-ATOMIC_OPS(or,  |=)
-ATOMIC_OPS(xor, ^=)
-ATOMIC_OPS(add, +=)
-ATOMIC_OPS(sub, -=)
-
-#undef ATOMIC_OPS
-#undef ATOMIC_OP_RETURN
-#undef ATOMIC_OP
-
-static inline int atomic_cmpxchg(atomic_t *v, int old, int new)
-{
-       int ret;
-       unsigned long flags;
-
-       flags = arch_local_irq_save();
-       ret = v->counter;
-       if (likely(ret == old))
-               v->counter = new;
-       arch_local_irq_restore(flags);
-       return ret;
-}
-
-static inline int atomic_fetch_add_unless(atomic_t *v, int a, int u)
-{
-       int ret;
-       unsigned long flags;
-
-       flags = arch_local_irq_save();
-       ret = v->counter;
-       if (ret != u)
-               v->counter += a;
-       arch_local_irq_restore(flags);
-       return ret;
-}
-#define atomic_fetch_add_unless                atomic_fetch_add_unless
-
-#endif /* __ARCH_RX_ATOMIC __ */
diff --git a/arch/rx/include/asm/cmpxchg.h b/arch/rx/include/asm/cmpxchg.h
deleted file mode 100644 (file)
index 749100c..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-#ifndef __ARCH_RX_CMPXCHG__
-#define __ARCH_RX_CMPXCHG__
-
-#define xchg(ptr, x) \
-       ((__typeof__(*(ptr)))__xchg((unsigned long)(x), (ptr), \
-                                   sizeof(*(ptr))))
-
-struct __xchg_dummy { unsigned long a[100]; };
-#define __xg(x) ((volatile struct __xchg_dummy *)(x))
-
-extern void __bad_xchg_size(void);
-
-static inline unsigned long __xchg(unsigned long x,
-                                  volatile void *ptr, int size)
-{
-       switch (size) {
-       case 1:
-               __asm__ __volatile__
-                       ("xchg %1.b,%0"
-                        : "+r" (x), "+Q" (*__xg(ptr)));
-               break;
-       case 2:
-               __asm__ __volatile__
-                       ("xchg %1.w,%0"
-                        : "+r" (x), "+Q" (*__xg(ptr)));
-               break;
-       case 4:
-               __asm__ __volatile__
-                       ("xchg %1.l,%0"
-                        : "+r" (x), "+Q" (*__xg(ptr)));
-               break;
-       default:
-               __bad_xchg_size();
-       }
-       return x;
-}
-
-#include <asm-generic/cmpxchg-local.h>
-
-/*
- * cmpxchg_local and cmpxchg64_local are atomic wrt current CPU. Always make
- * them available.
- */
-#define cmpxchg_local(ptr, o, n)                                        \
-       ((__typeof__(*(ptr)))__cmpxchg_local_generic((ptr),              \
-                                                    (unsigned long)(o), \
-                                                    (unsigned long)(n), \
-                                                    sizeof(*(ptr))))
-#define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n))
-
-#ifndef CONFIG_SMP
-#include <asm-generic/cmpxchg.h>
-#endif
-
-#define atomic_xchg(v, new) (xchg(&((v)->counter), new))
-
-#endif /* __ARCH_RX_CMPXCHG__ */
diff --git a/arch/rx/include/asm/uaccess.h b/arch/rx/include/asm/uaccess.h
deleted file mode 100644 (file)
index bc80319..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-#ifndef _ASM_UACCESS_H
-#define _ASM_UACCESS_H
-
-#include <linux/string.h>
-
-static inline __must_check unsigned long
-raw_copy_from_user(void *to, const void __user * from, unsigned long n)
-{
-       if (__builtin_constant_p(n)) {
-               switch(n) {
-               case 1:
-                       *(u8 *)to = *(u8 __force *)from;
-                       return 0;
-               case 2:
-                       *(u16 *)to = *(u16 __force *)from;
-                       return 0;
-               case 4:
-                       *(u32 *)to = *(u32 __force *)from;
-                       return 0;
-               }
-       }
-
-       memcpy(to, (const void __force *)from, n);
-       return 0;
-}
-
-static inline __must_check unsigned long
-raw_copy_to_user(void __user *to, const void *from, unsigned long n)
-{
-       if (__builtin_constant_p(n)) {
-               switch(n) {
-               case 1:
-                       *(u8 __force *)to = *(u8 *)from;
-                       return 0;
-               case 2:
-                       *(u16 __force *)to = *(u16 *)from;
-                       return 0;
-               case 4:
-                       *(u32 __force *)to = *(u32 *)from;
-                       return 0;
-               default:
-                       break;
-               }
-       }
-
-       memcpy((void __force *)to, from, n);
-       return 0;
-}
-#define INLINE_COPY_FROM_USER
-#define INLINE_COPY_TO_USER
-
-#include <asm-generic/uaccess.h>
-
-#endif