All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] parisc: Define depi_safe macro
@ 2021-12-21 20:04 John David Anglin
  0 siblings, 0 replies; only message in thread
From: John David Anglin @ 2021-12-21 20:04 UTC (permalink / raw)
  To: linux-parisc; +Cc: Helge Deller, Deller, James Bottomley

Define depi_safe macro.

The depi instruction is similar to the extru instruction on 64-bit machines. It leaves
the most-significant 32 bits of the target register in an undefined state.  On 64-bit
machines, the macro uses depdi to perform safe deposits in the least-significant 32 bits.

Signed-off-by: John David Anglin <dave.anglin@bell.net>
---

diff --git a/arch/parisc/include/asm/assembly.h b/arch/parisc/include/asm/assembly.h
index 6d13ae236fcb..6369082c6c74 100644
--- a/arch/parisc/include/asm/assembly.h
+++ b/arch/parisc/include/asm/assembly.h
@@ -158,6 +158,16 @@
  #endif
  	.endm

+	/* The depi instruction leaves the most significant 32 bits of the
+	 * target register in an undefined state on PA 2.0 systems. */
+	.macro depi_safe i, p, len, t
+#ifdef CONFIG_64BIT
+	depdi	\i, 32+(\p), \len, \t
+#else
+	depi	\i, \p, \len, \t
+#endif
+	.endm
+
  	/* load 32-bit 'value' into 'reg' compensating for the ldil
  	 * sign-extension when running in wide mode.
  	 * WARNING!! neither 'value' nor 'reg' can be expressions

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-12-21 20:04 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-21 20:04 [PATCH] parisc: Define depi_safe macro John David Anglin

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.