Commit 3d853391 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull ARC fixes from Vineet Gupta:

 - arch_atomic64_cmpxchg relaxed variant [Jason]

 - use of inbuilt swap in stack unwinder  [Yu-Chun Lin]

 - use of __ASSEMBLER__ in kernel headers [Thomas Huth]

* tag 'arc-6.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc:
  ARC: Replace __ASSEMBLY__ with __ASSEMBLER__ in the non-uapi headers
  ARC: Replace __ASSEMBLY__ with __ASSEMBLER__ in uapi headers
  ARC: unwind: Use built-in sort swap to reduce code size and improve performance
  ARC: atomics: Implement arch_atomic64_cmpxchg using _relaxed
parents 2c4a1f3f 179e9497
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -144,7 +144,7 @@
#define ARC_AUX_AGU_MOD2	0x5E2
#define ARC_AUX_AGU_MOD3	0x5E3

#ifndef __ASSEMBLY__
#ifndef __ASSEMBLER__

#include <soc/arc/arc_aux.h>

+2 −2
Original line number Diff line number Diff line
@@ -6,7 +6,7 @@
#ifndef _ASM_ARC_ATOMIC_H
#define _ASM_ARC_ATOMIC_H

#ifndef __ASSEMBLY__
#ifndef __ASSEMBLER__

#include <linux/types.h>
#include <linux/compiler.h>
@@ -31,6 +31,6 @@
#include <asm/atomic64-arcv2.h>
#endif

#endif	/* !__ASSEMBLY__ */
#endif	/* !__ASSEMBLER__ */

#endif
+5 −10
Original line number Diff line number Diff line
@@ -137,12 +137,9 @@ ATOMIC64_OPS(xor, xor, xor)
#undef ATOMIC64_OP_RETURN
#undef ATOMIC64_OP

static inline s64
arch_atomic64_cmpxchg(atomic64_t *ptr, s64 expected, s64 new)
static inline u64 __arch_cmpxchg64_relaxed(volatile void *ptr, u64 old, u64 new)
{
	s64 prev;

	smp_mb();
	u64 prev;

	__asm__ __volatile__(
	"1:	llockd  %0, [%1]	\n"
@@ -152,14 +149,12 @@ arch_atomic64_cmpxchg(atomic64_t *ptr, s64 expected, s64 new)
	"	bnz     1b		\n"
	"2:				\n"
	: "=&r"(prev)
	: "r"(ptr), "ir"(expected), "r"(new)
	: "cc");	/* memory clobber comes from smp_mb() */

	smp_mb();
	: "r"(ptr), "ir"(old), "r"(new)
	: "memory", "cc");

	return prev;
}
#define arch_atomic64_cmpxchg arch_atomic64_cmpxchg
#define arch_cmpxchg64_relaxed __arch_cmpxchg64_relaxed

static inline s64 arch_atomic64_xchg(atomic64_t *ptr, s64 new)
{
+2 −2
Original line number Diff line number Diff line
@@ -10,7 +10,7 @@
#error only <linux/bitops.h> can be included directly
#endif

#ifndef __ASSEMBLY__
#ifndef __ASSEMBLER__

#include <linux/types.h>
#include <linux/compiler.h>
@@ -192,6 +192,6 @@ static inline __attribute__ ((const)) unsigned long __ffs(unsigned long x)
#include <asm-generic/bitops/le.h>
#include <asm-generic/bitops/ext2-atomic-setbit.h>

#endif /* !__ASSEMBLY__ */
#endif /* !__ASSEMBLER__ */

#endif
+2 −2
Original line number Diff line number Diff line
@@ -6,7 +6,7 @@
#ifndef _ASM_ARC_BUG_H
#define _ASM_ARC_BUG_H

#ifndef __ASSEMBLY__
#ifndef __ASSEMBLER__

#include <asm/ptrace.h>

@@ -29,6 +29,6 @@ void die(const char *str, struct pt_regs *regs, unsigned long address);

#include <asm-generic/bug.h>

#endif	/* !__ASSEMBLY__ */
#endif	/* !__ASSEMBLER__ */

#endif
Loading