All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paul Burton <paul.burton@mips.com>
To: "linux-mips@linux-mips.org" <linux-mips@linux-mips.org>
Cc: Paul Burton <pburton@wavecomp.com>
Subject: [PATCH 6/7] MIPS: lib: Use kernel_pref & user_pref in memcpy()
Date: Mon, 15 Oct 2018 18:33:22 +0000	[thread overview]
Message-ID: <20181015183304.16782-7-paul.burton@mips.com> (raw)
In-Reply-To: <20181015183304.16782-1-paul.burton@mips.com>

memcpy() is the only user of the PREF() & PREFE() macros from asm/asm.h.
Switch to using the kernel_pref() & user_pref() macros from
asm/asm-eva.h which fit more consistently with other abstractions of EVA
vs non-EVA instructions.

Signed-off-by: Paul Burton <paul.burton@mips.com>
---

 arch/mips/lib/memcpy.S | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/arch/mips/lib/memcpy.S b/arch/mips/lib/memcpy.S
index 207b320aa81d..cdd19d8561e8 100644
--- a/arch/mips/lib/memcpy.S
+++ b/arch/mips/lib/memcpy.S
@@ -204,9 +204,10 @@
 #define LOADB(reg, addr, handler)	EXC(lb, LD_INSN, reg, addr, handler)
 #define STOREB(reg, addr, handler)	EXC(sb, ST_INSN, reg, addr, handler)
 
-#define _PREF(hint, addr, type)						\
+#ifdef CONFIG_CPU_HAS_PREFETCH
+# define _PREF(hint, addr, type)					\
 	.if \mode == LEGACY_MODE;					\
-		PREF(hint, addr);					\
+		kernel_pref(hint, addr);				\
 	.else;								\
 		.if ((\from == USEROP) && (type == SRC_PREFETCH)) ||	\
 		    ((\to == USEROP) && (type == DST_PREFETCH));	\
@@ -218,12 +219,15 @@
 			 * used later on. Therefore use $v1.		\
 			 */						\
 			.set at=v1;					\
-			PREFE(hint, addr);				\
+			user_pref(hint, addr);				\
 			.set noat;					\
 		.else;							\
-			PREF(hint, addr);				\
+			kernel_pref(hint, addr);			\
 		.endif;							\
 	.endif
+#else
+# define _PREF(hint, addr, type)
+#endif
 
 #define PREFS(hint, addr) _PREF(hint, addr, SRC_PREFETCH)
 #define PREFD(hint, addr) _PREF(hint, addr, DST_PREFETCH)
-- 
2.19.1

  parent reply	other threads:[~2018-10-15 18:34 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-15 18:33 [PATCH 0/7] MIPS: Remove unused asm/asm.h macros Paul Burton
2018-10-15 18:33 ` [PATCH 2/7] MIPS: Remove unused PIC macros Paul Burton
2018-11-22 16:31   ` Maciej W. Rozycki
2018-11-26 18:17     ` Paul Burton
2018-11-26 20:45       ` Maciej W. Rozycki
2018-10-15 18:33 ` [PATCH 1/7] MIPS: Remove unused MOVN & MOVZ macros Paul Burton
2018-10-15 18:33 ` [PATCH 3/7] MIPS: Remove unused TTABLE macro Paul Burton
2018-10-15 18:33 ` [PATCH 4/7] MIPS: Remove unused CAT macro Paul Burton
2018-10-15 18:33 ` [PATCH 5/7] MIPS: Add kernel_pref & user_pref helpers Paul Burton
2018-10-15 18:33 ` Paul Burton [this message]
2018-10-15 18:33 ` [PATCH 7/7] MIPS: Remove unused PREF, PREFE & PREFX macros Paul Burton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181015183304.16782-7-paul.burton@mips.com \
    --to=paul.burton@mips.com \
    --cc=linux-mips@linux-mips.org \
    --cc=pburton@wavecomp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.